diff options
author | Stefan Niedermann <info@niedermann.it> | 2020-04-10 18:41:51 +0300 |
---|---|---|
committer | Stefan Niedermann <info@niedermann.it> | 2020-04-10 18:41:51 +0300 |
commit | 214301826990b168fb7830711bc566127a8646a4 (patch) | |
tree | 75bebb736a01ce80b125ccbf5a680959f2cbfb4a /app/src/main/java/it/niedermann/nextcloud/deck/ui/card/EditActivity.java | |
parent | 03cab823be1096104d2b59a6241839fc07701112 (diff) |
#317 Adjust theme for each account
Fix some light theme issues
Signed-off-by: Stefan Niedermann <info@niedermann.it>
Diffstat (limited to 'app/src/main/java/it/niedermann/nextcloud/deck/ui/card/EditActivity.java')
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/ui/card/EditActivity.java | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/EditActivity.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/EditActivity.java index 7da0aac9a..05bb8d0e3 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/EditActivity.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/EditActivity.java @@ -1,5 +1,8 @@ package it.niedermann.nextcloud.deck.ui.card; +import android.content.res.ColorStateList; +import android.graphics.PorterDuff; +import android.graphics.drawable.Drawable; import android.os.Bundle; import android.text.Editable; import android.text.TextWatcher; @@ -9,6 +12,7 @@ import android.view.MenuItem; import android.view.WindowManager; import androidx.appcompat.app.AlertDialog; +import androidx.core.graphics.drawable.DrawableCompat; import com.google.android.material.tabs.TabLayout; import com.google.android.material.tabs.TabLayoutMediator; @@ -341,7 +345,22 @@ public class EditActivity extends AbstractThemableActivity implements CardDetail super.applyNextcloudTheme(mainColor, textColor); binding.toolbar.setBackgroundColor(mainColor); binding.toolbar.setTitleTextColor(textColor); + Drawable drawable = binding.toolbar.getOverflowIcon(); + if(drawable != null) { + drawable = DrawableCompat.wrap(drawable); + DrawableCompat.setTint(drawable.mutate(), textColor); + binding.toolbar.setOverflowIcon(drawable); + } + + Drawable navigationDrawable = binding.toolbar.getNavigationIcon(); + if(navigationDrawable != null) { + navigationDrawable.setColorFilter(textColor, PorterDuff.Mode.SRC_ATOP); + binding.toolbar.setNavigationIcon(navigationDrawable); + } + + binding.title.setTextColor(textColor); binding.tabLayout.setBackgroundColor(mainColor); - binding.tabLayout.setTabTextColors(textColor, textColor); + binding.tabLayout.setTabIconTint(new ColorStateList(new int[][]{new int[]{}}, new int[]{textColor})); + binding.tabLayout.setSelectedTabIndicatorColor(textColor); } } |