From 03c97e912efc8a1f4c4df2e82e21ceccf6a4b66d Mon Sep 17 00:00:00 2001 From: Alex Ning Date: Tue, 24 Sep 2019 08:51:56 +0800 Subject: Minor UI tweaks. Fix UI issues in dark theme. Fix settings activity title. --- app/src/main/AndroidManifest.xml | 2 +- .../infinityforreddit/MainActivity.java | 1 - .../ViewSubredditDetailActivity.java | 5 ++ .../infinityforreddit/ViewUserDetailActivity.java | 5 ++ app/src/main/res/layout/activity_search.xml | 53 +++++++++------------- app/src/main/res/layout/activity_search_result.xml | 3 +- app/src/main/res/layout/app_bar_main.xml | 3 +- app/src/main/res/values-night/colors.xml | 4 +- app/src/main/res/values/colors.xml | 2 + app/src/main/res/values/styles.xml | 1 + 10 files changed, 40 insertions(+), 39 deletions(-) (limited to 'app') diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 210a9216..9d4280ec 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -50,7 +50,7 @@ { + if(mAccessToken == null) { + Toast.makeText(ViewSubredditDetailActivity.this, R.string.login_first, Toast.LENGTH_SHORT).show(); + return; + } + if(subscriptionReady) { subscriptionReady = false; if(subscribeSubredditChip.getText().equals(getResources().getString(R.string.subscribe))) { diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/ViewUserDetailActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/ViewUserDetailActivity.java index d57e57f8..805c5af5 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/ViewUserDetailActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/ViewUserDetailActivity.java @@ -311,6 +311,11 @@ public class ViewUserDetailActivity extends AppCompatActivity implements UserThi if (userData.isCanBeFollowed()) { subscribeUserChip.setVisibility(View.VISIBLE); subscribeUserChip.setOnClickListener(view -> { + if(mAccessToken == null) { + Toast.makeText(ViewUserDetailActivity.this, R.string.login_first, Toast.LENGTH_SHORT).show(); + return; + } + if (subscriptionReady) { subscriptionReady = false; if (subscribeUserChip.getText().equals(resources.getString(R.string.follow))) { diff --git a/app/src/main/res/layout/activity_search.xml b/app/src/main/res/layout/activity_search.xml index 15c3ba9e..d83a52ea 100644 --- a/app/src/main/res/layout/activity_search.xml +++ b/app/src/main/res/layout/activity_search.xml @@ -11,42 +11,33 @@ android:layout_height="wrap_content" android:theme="@style/AppTheme.AppBarOverlay"> - + android:layout_height="wrap_content"> - + android:layout_height="?attr/actionBarSize" + app:navigationIcon="?attr/homeAsUpIndicator" + app:popupTheme="@style/AppTheme.PopupOverlay" /> - - - - - + - + diff --git a/app/src/main/res/layout/activity_search_result.xml b/app/src/main/res/layout/activity_search_result.xml index ca7c4e84..839820c6 100644 --- a/app/src/main/res/layout/activity_search_result.xml +++ b/app/src/main/res/layout/activity_search_result.xml @@ -26,7 +26,6 @@ android:id="@+id/toolbar_search_result_activity" android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" - android:background="?attr/colorPrimary" app:popupTheme="@style/AppTheme.PopupOverlay" /> @@ -37,7 +36,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="bottom" - android:background="@color/colorPrimary" + android:background="@color/greyTabBackgroundColor" app:layout_scrollFlags="scroll|enterAlways" app:tabGravity="fill" app:tabIndicatorColor="@android:color/white" diff --git a/app/src/main/res/values-night/colors.xml b/app/src/main/res/values-night/colors.xml index b6930940..ff7a6510 100644 --- a/app/src/main/res/values-night/colors.xml +++ b/app/src/main/res/values-night/colors.xml @@ -4,8 +4,6 @@ #121212 #FF4081 - #E91E63 - #88000000 #FFC107 @@ -55,4 +53,6 @@ #1565C0 #B3FFFFFF + + #282828 diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index 82afbe60..a3357db3 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -69,4 +69,6 @@ #EE0220 #02EE6E #EE4602 + + @color/colorPrimary diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index 6a59fbc6..f066da89 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -78,6 +78,7 @@