Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Useless Toasts and Other Minor Changes #12

Merged
merged 12 commits into from
May 4, 2024
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
Loading