diff --git a/ui/BankingAndroidApp/src/main/java/net/dankito/banking/ui/android/dialogs/settings/SettingsDialog.kt b/ui/BankingAndroidApp/src/main/java/net/dankito/banking/ui/android/dialogs/settings/SettingsDialog.kt index 13e057e5..a1bcec1a 100644 --- a/ui/BankingAndroidApp/src/main/java/net/dankito/banking/ui/android/dialogs/settings/SettingsDialog.kt +++ b/ui/BankingAndroidApp/src/main/java/net/dankito/banking/ui/android/dialogs/settings/SettingsDialog.kt @@ -3,6 +3,7 @@ package net.dankito.banking.ui.android.dialogs.settings import android.os.Bundle import android.view.* import androidx.appcompat.app.AppCompatActivity +import androidx.appcompat.content.res.AppCompatResources import kotlinx.android.synthetic.main.dialog_settings.* import kotlinx.android.synthetic.main.dialog_settings.view.* import net.dankito.banking.ui.android.R @@ -55,6 +56,9 @@ open class SettingsDialog : SettingsDialogBase() { btnSetAppProtection.setOnClickListener { ProtectAppSettingsDialog().show(requireActivity() as AppCompatActivity) } + // on Pre Lollipop devices setting vector drawables in xml is not supported -> set left drawable here + val sendIcon = AppCompatResources.getDrawable(context, R.drawable.ic_baseline_send_24) + btnShowSendMessageLogDialog.setCompoundDrawablesWithIntrinsicBounds(sendIcon, null, null, null) btnShowSendMessageLogDialog.setOnClickListener { presenter.showSendMessageLogDialog() } } } diff --git a/ui/BankingAndroidApp/src/main/java/net/dankito/banking/ui/android/views/DrawerView.kt b/ui/BankingAndroidApp/src/main/java/net/dankito/banking/ui/android/views/DrawerView.kt index 13e80abb..6adb720d 100644 --- a/ui/BankingAndroidApp/src/main/java/net/dankito/banking/ui/android/views/DrawerView.kt +++ b/ui/BankingAndroidApp/src/main/java/net/dankito/banking/ui/android/views/DrawerView.kt @@ -1,12 +1,14 @@ package net.dankito.banking.ui.android.views +import android.graphics.drawable.Drawable import android.view.View import android.widget.TextView +import androidx.annotation.DrawableRes import androidx.appcompat.app.AppCompatActivity +import androidx.appcompat.content.res.AppCompatResources import androidx.core.content.ContextCompat import androidx.core.view.GravityCompat import androidx.drawerlayout.widget.DrawerLayout -import com.mikepenz.iconics.typeface.library.fontawesome.FontAwesome import com.mikepenz.iconics.typeface.library.googlematerial.GoogleMaterial import com.mikepenz.materialdrawer.model.DividerDrawerItem import com.mikepenz.materialdrawer.model.PrimaryDrawerItem @@ -108,7 +110,7 @@ open class DrawerView( PrimaryDrawerItem() .withName(R.string.settings) - .withIcon(R.drawable.ic_baseline_settings_24) + .withIcon(getVectorDrawable(R.drawable.ic_baseline_settings_24)) .withIconColor(ContextCompat.getColorStateList(activity, R.color.primaryTextColor_Dark)!!) .withSelectable(false) .withOnDrawerItemClickListener { _, _, _ -> itemClicked { SettingsDialog().show(activity) } } @@ -149,7 +151,7 @@ open class DrawerView( val accountItem = AccountDrawerItem() .withName(bank.displayName) .withLevel(BankLevel) - .withSecondaryIcon(R.drawable.ic_baseline_settings_24) + .withSecondaryIcon(getVectorDrawable(R.drawable.ic_baseline_settings_24)) .withSecondaryIconColor(activity, R.color.primaryTextColor_Dark) .withOnSecondaryIconClickedListener { closeDrawerAndEditAccount(bank) } .withIcon(bank.iconData?.toDrawable(activity.resources)) @@ -206,4 +208,9 @@ open class DrawerView( drawerLayout.closeDrawer(GravityCompat.START) } + + private fun getVectorDrawable(@DrawableRes drawableResId: Int): Drawable? { + return AppCompatResources.getDrawable(activity, drawableResId) + } + } \ No newline at end of file diff --git a/ui/BankingAndroidApp/src/main/res/layout/dialog_settings.xml b/ui/BankingAndroidApp/src/main/res/layout/dialog_settings.xml index 526e424b..0bf10896 100644 --- a/ui/BankingAndroidApp/src/main/res/layout/dialog_settings.xml +++ b/ui/BankingAndroidApp/src/main/res/layout/dialog_settings.xml @@ -94,14 +94,13 @@ /> +