Skip to content

Commit

Permalink
Merge pull request #12 from Tonnie-Dev/main
Browse files Browse the repository at this point in the history
Remove Useless Toasts and Other Minor Changes
  • Loading branch information
nkuppan authored May 4, 2024
2 parents d893db9 + 622500a commit 6e6bd4a
Show file tree
Hide file tree
Showing 6 changed files with 221 additions and 173 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ captures/
.idea/dictionaries
.idea/libraries
.idea/jarRepositories.xml
.idea/appInsightsSettings.xml
.idea/.name

# Android Studio 3 in .gitignore file.
.idea/caches
.idea/modules.xml
Expand Down
2 changes: 1 addition & 1 deletion .idea/appInsightsSettings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,16 @@ import android.content.Intent
import android.content.pm.PackageInfo
import android.content.pm.PackageManager
import android.net.Uri
import android.widget.Toast
import com.naveenapps.expensemanager.core.designsystem.R

@SuppressLint("DiscouragedApi")
fun Context.getDrawable(iconName: String): Int {
return runCatching {
val resources = this.resources.getIdentifier(
iconName,
"drawable",
this.packageName,
iconName,
"drawable",
this.packageName,
)

if (resources > 0) resources else null
Expand All @@ -29,6 +30,7 @@ fun openWebPage(context: Context, webpage: String) {
context.startActivity(intent)
} catch (e: ActivityNotFoundException) {
// Define what your app should do if no activity can handle the intent.

}
}

Expand All @@ -40,6 +42,7 @@ fun openEmailToOption(context: Context, emailId: String) {
context.startActivity(intent)
} catch (e: ActivityNotFoundException) {
// Define what your app should do if no activity can handle the intent.

}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import com.naveenapps.expensemanager.core.common.R
@ColorInt
fun getColorValue(colorValue: String?): Int {
return runCatching {
return Color.parseColor(if (colorValue?.isNotEmpty() == true) colorValue else "#000000")
Color.parseColor(if (colorValue?.isNotEmpty() == true) colorValue else "#000000")
}.getOrNull() ?: Color.BLACK
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,8 @@ class AccountSelectionViewModel @Inject constructor(
}

fun selectAllThisAccount(accounts: List<AccountUiModel>) {
if (accounts.isEmpty()) {
return
}

accounts.ifEmpty { return }

viewModelScope.launch {
clearChanges()
Expand Down
Loading

0 comments on commit 6e6bd4a

Please sign in to comment.