aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Ning <chineseperson5@gmail.com>2019-08-12 01:26:27 +0000
committerAlex Ning <chineseperson5@gmail.com>2019-08-12 01:26:27 +0000
commit90c7c664053efe0f09c971ba5ee7a63b3a57b3c6 (patch)
tree8e72bb4a0155b3b497c5eca301daee65256e9047
parent002fa44d8a8e640dfe6643f65b266b552be029cb (diff)
downloadinfinity-for-reddit-90c7c664053efe0f09c971ba5ee7a63b3a57b3c6.tar
infinity-for-reddit-90c7c664053efe0f09c971ba5ee7a63b3a57b3c6.tar.gz
infinity-for-reddit-90c7c664053efe0f09c971ba5ee7a63b3a57b3c6.tar.bz2
infinity-for-reddit-90c7c664053efe0f09c971ba5ee7a63b3a57b3c6.tar.lz
infinity-for-reddit-90c7c664053efe0f09c971ba5ee7a63b3a57b3c6.tar.xz
infinity-for-reddit-90c7c664053efe0f09c971ba5ee7a63b3a57b3c6.tar.zst
infinity-for-reddit-90c7c664053efe0f09c971ba5ee7a63b3a57b3c6.zip
Fixed nav bar icon color in dark theme. Transparent nav bar in SubredditSelectionActivity for Android version >= 8.1.
-rw-r--r--app/src/main/AndroidManifest.xml3
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/MainActivity.java14
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/RulesActivity.java59
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/SearchResultActivity.java14
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/SubredditSelectionActivity.java51
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/SubscribedThingListingActivity.java17
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/ViewPostDetailActivity.java17
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/ViewSubredditDetailActivity.java14
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/ViewUserDetailActivity.java14
-rw-r--r--app/src/main/res/layout/activity_rules.xml34
-rw-r--r--app/src/main/res/layout/activity_subreddit_selection.xml20
11 files changed, 231 insertions, 26 deletions
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index ace418e0..e85143cb 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -64,7 +64,8 @@
<activity
android:name=".RulesActivity"
android:label="@string/rules_activity_label"
- android:parentActivityName=".MainActivity" />
+ android:parentActivityName=".MainActivity"
+ android:theme="@style/AppTheme.NoActionBar" />
<activity
android:name=".PostVideoActivity"
android:label="@string/post_video_activity_label"
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/MainActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/MainActivity.java
index 14b76146..9b44e82b 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/MainActivity.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/MainActivity.java
@@ -134,14 +134,24 @@ public class MainActivity extends AppCompatActivity implements SortTypeBottomShe
Window window = getWindow();
window.setFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS, WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
+ boolean lightNavBar = false;
+ if((resources.getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK) != Configuration.UI_MODE_NIGHT_YES) {
+ lightNavBar = true;
+ }
+ boolean finalLightNavBar = lightNavBar;
+
View decorView = window.getDecorView();
appBarLayout.addOnOffsetChangedListener(new AppBarStateChangeListener() {
@Override
void onStateChanged(AppBarLayout appBarLayout, State state) {
if(state == State.COLLAPSED) {
- decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR | View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR);
+ if(finalLightNavBar) {
+ decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR | View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR);
+ }
} else if(state == State.EXPANDED) {
- decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR);
+ if(finalLightNavBar) {
+ decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR);
+ }
}
}
});
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/RulesActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/RulesActivity.java
index 4471cec6..53790e32 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/RulesActivity.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/RulesActivity.java
@@ -1,19 +1,26 @@
package ml.docilealligator.infinityforreddit;
-import android.graphics.drawable.Drawable;
+import android.content.res.Configuration;
+import android.content.res.Resources;
import android.os.AsyncTask;
+import android.os.Build;
import android.os.Bundle;
import android.view.MenuItem;
import android.view.View;
+import android.view.ViewGroup;
+import android.view.Window;
+import android.view.WindowManager;
import android.widget.ProgressBar;
import android.widget.TextView;
import androidx.annotation.NonNull;
-import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.AppCompatActivity;
+import androidx.appcompat.widget.Toolbar;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
+import com.google.android.material.appbar.AppBarLayout;
+
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
@@ -34,6 +41,8 @@ public class RulesActivity extends AppCompatActivity {
static final String EXTRA_SUBREDDIT_NAME = "ESN";
+ @BindView(R.id.appbar_rules_activity) AppBarLayout appBarLayout;
+ @BindView(R.id.toolbar_rules_activity) Toolbar toolbar;
@BindView(R.id.progress_bar_rules_activity) ProgressBar progressBar;
@BindView(R.id.recycler_view_rules_activity) RecyclerView recyclerView;
@BindView(R.id.error_text_view_rules_activity) TextView errorTextView;
@@ -55,9 +64,49 @@ public class RulesActivity extends AppCompatActivity {
((Infinity) getApplication()).getAppComponent().inject(this);
- ActionBar actionBar = getSupportActionBar();
- Drawable upArrow = getResources().getDrawable(R.drawable.ic_arrow_back_white_24dp);
- actionBar.setHomeAsUpIndicator(upArrow);
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O_MR1) {
+ Resources resources = getResources();
+
+ if(resources.getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT || resources.getBoolean(R.bool.isTablet)) {
+ Window window = getWindow();
+ window.setFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS, WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
+
+ boolean lightNavBar = false;
+ if((resources.getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK) != Configuration.UI_MODE_NIGHT_YES) {
+ lightNavBar = true;
+ }
+ boolean finalLightNavBar = lightNavBar;
+
+ View decorView = window.getDecorView();
+ if(finalLightNavBar) {
+ decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR);
+ }
+ appBarLayout.addOnOffsetChangedListener(new AppBarStateChangeListener() {
+ @Override
+ void onStateChanged(AppBarLayout appBarLayout, State state) {
+ if(state == State.COLLAPSED) {
+ if(finalLightNavBar) {
+ decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR | View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR);
+ }
+ } else if(state == State.EXPANDED) {
+ if(finalLightNavBar) {
+ decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR);
+ }
+ }
+ }
+ });
+
+ int statusBarResourceId = getResources().getIdentifier("status_bar_height", "dimen", "android");
+ if (statusBarResourceId > 0) {
+ ViewGroup.MarginLayoutParams params = (ViewGroup.MarginLayoutParams) toolbar.getLayoutParams();
+ params.topMargin = getResources().getDimensionPixelSize(statusBarResourceId);
+ toolbar.setLayoutParams(params);
+ }
+ }
+ }
+
+ setSupportActionBar(toolbar);
+ getSupportActionBar().setDisplayHomeAsUpEnabled(true);
mSubredditName = getIntent().getExtras().getString(EXTRA_SUBREDDIT_NAME);
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/SearchResultActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/SearchResultActivity.java
index d528488d..72b6215f 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/SearchResultActivity.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/SearchResultActivity.java
@@ -72,14 +72,24 @@ public class SearchResultActivity extends AppCompatActivity implements SearchPos
Window window = getWindow();
window.setFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS, WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
+ boolean lightNavBar = false;
+ if((resources.getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK) != Configuration.UI_MODE_NIGHT_YES) {
+ lightNavBar = true;
+ }
+ boolean finalLightNavBar = lightNavBar;
+
View decorView = window.getDecorView();
appBarLayout.addOnOffsetChangedListener(new AppBarStateChangeListener() {
@Override
void onStateChanged(AppBarLayout appBarLayout, State state) {
if(state == State.COLLAPSED) {
- decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR | View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR);
+ if(finalLightNavBar) {
+ decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR | View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR);
+ }
} else if(state == State.EXPANDED) {
- decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR);
+ if(finalLightNavBar) {
+ decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR);
+ }
}
}
});
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/SubredditSelectionActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/SubredditSelectionActivity.java
index 8069499c..e9f5e4db 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/SubredditSelectionActivity.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/SubredditSelectionActivity.java
@@ -2,9 +2,16 @@ package ml.docilealligator.infinityforreddit;
import android.app.Activity;
import android.content.Intent;
+import android.content.res.Configuration;
+import android.content.res.Resources;
+import android.os.Build;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
+import android.view.View;
+import android.view.ViewGroup;
+import android.view.Window;
+import android.view.WindowManager;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
@@ -12,6 +19,8 @@ import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import androidx.fragment.app.Fragment;
+import com.google.android.material.appbar.AppBarLayout;
+
import java.util.ArrayList;
import javax.inject.Inject;
@@ -39,6 +48,7 @@ public class SubredditSelectionActivity extends AppCompatActivity {
private static final String ACCOUNT_PROFILE_IMAGE_URL = "APIU";
private static final String FRAGMENT_OUT_STATE = "FOS";
+ @BindView(R.id.appbar_layout_subreddit_selection_activity) AppBarLayout appBarLayout;
@BindView(R.id.toolbar_subreddit_selection_activity) Toolbar toolbar;
private boolean mNullAccessToken = false;
@@ -65,6 +75,47 @@ public class SubredditSelectionActivity extends AppCompatActivity {
((Infinity) getApplication()).getAppComponent().inject(this);
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O_MR1) {
+ Resources resources = getResources();
+
+ if(resources.getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT || resources.getBoolean(R.bool.isTablet)) {
+ Window window = getWindow();
+ window.setFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS, WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
+
+ boolean lightNavBar = false;
+ if((resources.getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK) != Configuration.UI_MODE_NIGHT_YES) {
+ lightNavBar = true;
+ }
+ boolean finalLightNavBar = lightNavBar;
+
+ View decorView = window.getDecorView();
+ if(finalLightNavBar) {
+ decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR);
+ }
+ appBarLayout.addOnOffsetChangedListener(new AppBarStateChangeListener() {
+ @Override
+ void onStateChanged(AppBarLayout appBarLayout, State state) {
+ if(state == State.COLLAPSED) {
+ if(finalLightNavBar) {
+ decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR | View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR);
+ }
+ } else if(state == State.EXPANDED) {
+ if(finalLightNavBar) {
+ decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR);
+ }
+ }
+ }
+ });
+
+ int statusBarResourceId = getResources().getIdentifier("status_bar_height", "dimen", "android");
+ if (statusBarResourceId > 0) {
+ ViewGroup.MarginLayoutParams params = (ViewGroup.MarginLayoutParams) toolbar.getLayoutParams();
+ params.topMargin = getResources().getDimensionPixelSize(statusBarResourceId);
+ toolbar.setLayoutParams(params);
+ }
+ }
+ }
+
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/SubscribedThingListingActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/SubscribedThingListingActivity.java
index 85ad1196..ab0c03ef 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/SubscribedThingListingActivity.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/SubscribedThingListingActivity.java
@@ -75,14 +75,27 @@ public class SubscribedThingListingActivity extends AppCompatActivity {
Window window = getWindow();
window.setFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS, WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
+ boolean lightNavBar = false;
+ if((resources.getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK) != Configuration.UI_MODE_NIGHT_YES) {
+ lightNavBar = true;
+ }
+ boolean finalLightNavBar = lightNavBar;
+
View decorView = window.getDecorView();
+ if(finalLightNavBar) {
+ decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR);
+ }
appBarLayout.addOnOffsetChangedListener(new AppBarStateChangeListener() {
@Override
void onStateChanged(AppBarLayout appBarLayout, State state) {
if(state == State.COLLAPSED) {
- decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR | View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR);
+ if(finalLightNavBar) {
+ decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR | View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR);
+ }
} else if(state == State.EXPANDED) {
- decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR);
+ if(finalLightNavBar) {
+ decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR);
+ }
}
}
});
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/ViewPostDetailActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/ViewPostDetailActivity.java
index e3bf8ee8..8ef11517 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/ViewPostDetailActivity.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/ViewPostDetailActivity.java
@@ -131,14 +131,27 @@ public class ViewPostDetailActivity extends AppCompatActivity {
Window window = getWindow();
window.setFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS, WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
+ boolean lightNavBar = false;
+ if((resources.getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK) != Configuration.UI_MODE_NIGHT_YES) {
+ lightNavBar = true;
+ }
+ boolean finalLightNavBar = lightNavBar;
+
View decorView = window.getDecorView();
+ if(finalLightNavBar) {
+ decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR);
+ }
appBarLayout.addOnOffsetChangedListener(new AppBarStateChangeListener() {
@Override
void onStateChanged(AppBarLayout appBarLayout, State state) {
if (state == State.COLLAPSED) {
- decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR | View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR);
+ if(finalLightNavBar) {
+ decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR | View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR);
+ }
} else if (state == State.EXPANDED) {
- decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR);
+ if(finalLightNavBar) {
+ decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR);
+ }
}
}
});
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/ViewSubredditDetailActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/ViewSubredditDetailActivity.java
index f398fbe6..610c4a23 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/ViewSubredditDetailActivity.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/ViewSubredditDetailActivity.java
@@ -113,14 +113,24 @@ public class ViewSubredditDetailActivity extends AppCompatActivity implements So
Window window = getWindow();
window.setFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS, WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
+ boolean lightNavBar = false;
+ if((resources.getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK) != Configuration.UI_MODE_NIGHT_YES) {
+ lightNavBar = true;
+ }
+ boolean finalLightNavBar = lightNavBar;
+
View decorView = window.getDecorView();
appBarLayout.addOnOffsetChangedListener(new AppBarStateChangeListener() {
@Override
void onStateChanged(AppBarLayout appBarLayout, State state) {
if (state == State.COLLAPSED) {
- decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR | View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR);
+ if(finalLightNavBar) {
+ decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR | View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR);
+ }
} else if (state == State.EXPANDED) {
- decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR);
+ if(finalLightNavBar) {
+ decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR);
+ }
}
}
});
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/ViewUserDetailActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/ViewUserDetailActivity.java
index 61e4f5cb..670547d9 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/ViewUserDetailActivity.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/ViewUserDetailActivity.java
@@ -176,17 +176,27 @@ public class ViewUserDetailActivity extends AppCompatActivity {
Window window = getWindow();
window.setFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS, WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
+ boolean lightNavBar = false;
+ if((resources.getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK) != Configuration.UI_MODE_NIGHT_YES) {
+ lightNavBar = true;
+ }
+ boolean finalLightNavBar = lightNavBar;
+
View decorView = window.getDecorView();
appBarLayout.addOnOffsetChangedListener(new AppBarStateChangeListener() {
@Override
void onStateChanged(AppBarLayout appBarLayout, State state) {
if (state == State.COLLAPSED) {
- decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR | View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR);
+ if(finalLightNavBar) {
+ decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR | View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR);
+ }
tabLayout.setTabTextColors(collapsedTabTextColor, collapsedTabTextColor);
tabLayout.setSelectedTabIndicatorColor(collapsedTabIndicatorColor);
tabLayout.setBackgroundColor(collapsedTabBackgroundColor);
} else if (state == State.EXPANDED) {
- decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR);
+ if(finalLightNavBar) {
+ decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR);
+ }
tabLayout.setTabTextColors(expandedTabTextColor, expandedTabTextColor);
tabLayout.setSelectedTabIndicatorColor(expandedTabIndicatorColor);
tabLayout.setBackgroundColor(expandedTabBackgroundColor);
diff --git a/app/src/main/res/layout/activity_rules.xml b/app/src/main/res/layout/activity_rules.xml
index a5764fa9..55f0ba07 100644
--- a/app/src/main/res/layout/activity_rules.xml
+++ b/app/src/main/res/layout/activity_rules.xml
@@ -6,22 +6,50 @@
android:layout_height="match_parent"
tools:application=".RulesActivity">
+ <com.google.android.material.appbar.AppBarLayout
+ android:id="@+id/appbar_rules_activity"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:theme="@style/AppTheme.AppBarOverlay">
+
+ <com.google.android.material.appbar.CollapsingToolbarLayout
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ app:layout_scrollFlags="scroll|enterAlways"
+ app:titleEnabled="false"
+ app:toolbarId="@+id/toolbar_rules_activity">
+
+ <androidx.appcompat.widget.Toolbar
+ android:id="@+id/toolbar_rules_activity"
+ android:layout_width="match_parent"
+ android:layout_height="?attr/actionBarSize"
+ android:background="?attr/colorPrimary"
+ app:popupTheme="@style/AppTheme.PopupOverlay" />
+
+ </com.google.android.material.appbar.CollapsingToolbarLayout>
+
+ </com.google.android.material.appbar.AppBarLayout>
+
<ProgressBar
android:id="@+id/progress_bar_rules_activity"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_gravity="center" />
+ android:layout_gravity="center"
+ app:layout_behavior="@string/appbar_scrolling_view_behavior" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler_view_rules_activity"
android:layout_width="match_parent"
- android:layout_height="match_parent" />
+ android:layout_height="match_parent"
+ android:clipToPadding="false"
+ app:layout_behavior="@string/appbar_scrolling_view_behavior" />
<TextView
android:id="@+id/error_text_view_rules_activity"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
- android:visibility="gone" />
+ android:visibility="gone"
+ app:layout_behavior="@string/appbar_scrolling_view_behavior" />
</androidx.coordinatorlayout.widget.CoordinatorLayout> \ No newline at end of file
diff --git a/app/src/main/res/layout/activity_subreddit_selection.xml b/app/src/main/res/layout/activity_subreddit_selection.xml
index 6306a39f..92be6bbe 100644
--- a/app/src/main/res/layout/activity_subreddit_selection.xml
+++ b/app/src/main/res/layout/activity_subreddit_selection.xml
@@ -7,16 +7,26 @@
tools:application=".SubredditSelectionActivity">
<com.google.android.material.appbar.AppBarLayout
+ android:id="@+id/appbar_layout_subreddit_selection_activity"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/AppTheme.AppBarOverlay">
- <androidx.appcompat.widget.Toolbar
- android:id="@+id/toolbar_subreddit_selection_activity"
+ <com.google.android.material.appbar.CollapsingToolbarLayout
android:layout_width="match_parent"
- android:layout_height="?attr/actionBarSize"
- app:popupTheme="@style/AppTheme.PopupOverlay"
- app:navigationIcon="?attr/homeAsUpIndicator" />
+ android:layout_height="match_parent"
+ app:layout_scrollFlags="scroll|enterAlways"
+ app:titleEnabled="false"
+ app:toolbarId="@+id/toolbar_subreddit_selection_activity">
+
+ <androidx.appcompat.widget.Toolbar
+ android:id="@+id/toolbar_subreddit_selection_activity"
+ android:layout_width="match_parent"
+ android:layout_height="?attr/actionBarSize"
+ app:popupTheme="@style/AppTheme.PopupOverlay"
+ app:navigationIcon="?attr/homeAsUpIndicator" />
+
+ </com.google.android.material.appbar.CollapsingToolbarLayout>
</com.google.android.material.appbar.AppBarLayout>