From c097a454bfc01cbbf9cf426db3c2c164e5394893 Mon Sep 17 00:00:00 2001 From: Shinokuni Date: Sat, 28 Sep 2019 12:59:12 +0200 Subject: [PATCH] Remove action bar/tool bar hard-coded colors --- .../java/com/readrops/app/activities/ItemActivity.java | 5 ----- .../java/com/readrops/app/activities/MainActivity.java | 1 - .../app/activities/ManageFeedsFoldersActivity.java | 6 +----- app/src/main/res/layout/activity_item.xml | 6 ++---- app/src/main/res/layout/activity_main.xml | 2 +- app/src/main/res/layout/activity_manage_feeds_folders.xml | 7 ++----- app/src/main/res/values/styles.xml | 2 +- 7 files changed, 7 insertions(+), 22 deletions(-) diff --git a/app/src/main/java/com/readrops/app/activities/ItemActivity.java b/app/src/main/java/com/readrops/app/activities/ItemActivity.java index 3579bb22..d2c142a0 100644 --- a/app/src/main/java/com/readrops/app/activities/ItemActivity.java +++ b/app/src/main/java/com/readrops/app/activities/ItemActivity.java @@ -2,7 +2,6 @@ package com.readrops.app.activities; import android.content.Intent; import android.content.res.ColorStateList; -import android.graphics.Color; import android.net.Uri; import android.os.Bundle; import android.view.Menu; @@ -86,12 +85,9 @@ public class ItemActivity extends AppCompatActivity { toolbarLayout.setTitleEnabled(false); scrim.setVisibility(View.GONE); - toolbar.setTitleTextColor(Color.WHITE); } else { appBarLayout.setExpanded(true); toolbarLayout.setTitleEnabled(true); - toolbarLayout.setExpandedTitleColor(Color.WHITE); - toolbarLayout.setCollapsedTitleTextColor(Color.WHITE); GlideApp.with(this) .load(imageUrl) @@ -126,7 +122,6 @@ public class ItemActivity extends AppCompatActivity { if (itemWithFeed.getFolder() != null) { toolbar.setSubtitle(itemWithFeed.getFolder().getName()); - toolbar.setSubtitleTextColor(Color.WHITE); } title.setText(item.getTitle()); diff --git a/app/src/main/java/com/readrops/app/activities/MainActivity.java b/app/src/main/java/com/readrops/app/activities/MainActivity.java index ff023991..573bd96b 100644 --- a/app/src/main/java/com/readrops/app/activities/MainActivity.java +++ b/app/src/main/java/com/readrops/app/activities/MainActivity.java @@ -111,7 +111,6 @@ public class MainActivity extends AppCompatActivity implements SwipeRefreshLayou toolbar = findViewById(R.id.toolbar_main); setSupportActionBar(toolbar); - toolbar.setTitleTextColor(Color.WHITE); emptyListLayout = findViewById(R.id.empty_list_layout); refreshLayout = findViewById(R.id.swipe_refresh_layout); diff --git a/app/src/main/java/com/readrops/app/activities/ManageFeedsFoldersActivity.java b/app/src/main/java/com/readrops/app/activities/ManageFeedsFoldersActivity.java index 0542358e..409f876c 100644 --- a/app/src/main/java/com/readrops/app/activities/ManageFeedsFoldersActivity.java +++ b/app/src/main/java/com/readrops/app/activities/ManageFeedsFoldersActivity.java @@ -1,6 +1,5 @@ package com.readrops.app.activities; -import android.graphics.Color; import android.os.Bundle; import android.view.Menu; import android.view.MenuItem; @@ -16,8 +15,8 @@ import androidx.viewpager.widget.ViewPager; import com.afollestad.materialdialogs.MaterialDialog; import com.readrops.app.R; -import com.readrops.app.database.entities.account.Account; import com.readrops.app.database.entities.Folder; +import com.readrops.app.database.entities.account.Account; import com.readrops.app.databinding.ActivityManageFeedsFoldersBinding; import com.readrops.app.fragments.FeedsFragment; import com.readrops.app.fragments.FoldersFragment; @@ -47,9 +46,6 @@ public class ManageFeedsFoldersActivity extends AppCompatActivity { setSupportActionBar(binding.manageFeedsFoldersToolbar); getSupportActionBar().setDisplayHomeAsUpEnabled(true); - binding.manageFeedsFoldersToolbar.setTitleTextColor(Color.WHITE); - binding.manageFeedsFoldersTablayout.setTabTextColors(Color.WHITE, Color.WHITE); - account = getIntent().getParcelableExtra(ACCOUNT); pageAdapter = new FeedsFoldersPageAdapter(getSupportFragmentManager()); diff --git a/app/src/main/res/layout/activity_item.xml b/app/src/main/res/layout/activity_item.xml index 18a770a8..9885afc9 100644 --- a/app/src/main/res/layout/activity_item.xml +++ b/app/src/main/res/layout/activity_item.xml @@ -11,7 +11,7 @@ android:id="@+id/app_bar_layout" android:layout_width="match_parent" android:layout_height="wrap_content" - android:theme="@style/Widget.AppCompat.Light.ActionBar"> + android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"> + app:layout_collapseMode="pin" /> diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index 6bb7b24e..34a4c80d 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -18,7 +18,7 @@ android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" android:background="?attr/colorPrimary" - app:popupTheme="@style/ThemeOverlay.AppCompat.Light" /> + android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" /> + android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"> + app:layout_scrollFlags="scroll|enterAlways" /> @color/textColorPrimary -