aboutsummaryrefslogtreecommitdiff
path: root/app/src/main
diff options
context:
space:
mode:
authorDocile-Alligator <chineseperson5@gmail.com>2022-06-27 15:28:17 +0000
committerDocile-Alligator <chineseperson5@gmail.com>2022-06-27 15:28:17 +0000
commit0736f86e170fa1f6f104a80c72c27349ab99a46b (patch)
treef2f64869f3c84a5d5609034645cbb30a69d77c8b /app/src/main
parent042834cc9bffc7d9a5649f035775ec92ffb9209e (diff)
downloadinfinity-for-reddit-0736f86e170fa1f6f104a80c72c27349ab99a46b.tar
infinity-for-reddit-0736f86e170fa1f6f104a80c72c27349ab99a46b.tar.gz
infinity-for-reddit-0736f86e170fa1f6f104a80c72c27349ab99a46b.tar.bz2
infinity-for-reddit-0736f86e170fa1f6f104a80c72c27349ab99a46b.tar.lz
infinity-for-reddit-0736f86e170fa1f6f104a80c72c27349ab99a46b.tar.xz
infinity-for-reddit-0736f86e170fa1f6f104a80c72c27349ab99a46b.tar.zst
infinity-for-reddit-0736f86e170fa1f6f104a80c72c27349ab99a46b.zip
Navigation rail in ViewMultiRedditDetailActivity.
Diffstat (limited to '')
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/activities/MainActivity.java33
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewMultiRedditDetailActivity.java180
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewUserDetailActivity.java14
-rw-r--r--app/src/main/res/layout-land/activity_view_multi_reddit_detail.xml70
-rw-r--r--app/src/main/res/layout-sw600dp/activity_view_multi_reddit_detail.xml70
5 files changed, 238 insertions, 129 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/MainActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/MainActivity.java
index 5ec839d8..b04a9260 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/MainActivity.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/MainActivity.java
@@ -160,20 +160,6 @@ public class MainActivity extends BaseActivity implements SortTypeSelectionCallb
RecyclerView navDrawerRecyclerView;
@BindView(R.id.tab_layout_main_activity)
TabLayout tabLayout;
- /*@BindView(R.id.bottom_app_bar_bottom_app_bar)
- BottomAppBar bottomAppBar;
- @BindView(R.id.linear_layout_bottom_app_bar)
- LinearLayout linearLayoutBottomAppBar;
- @BindView(R.id.option_1_bottom_app_bar)
- ImageView option1BottomAppBar;
- @BindView(R.id.option_2_bottom_app_bar)
- ImageView option2BottomAppBar;
- @BindView(R.id.option_3_bottom_app_bar)
- ImageView option3BottomAppBar;
- @BindView(R.id.option_4_bottom_app_bar)
- ImageView option4BottomAppBar;*/
- /*@BindView(R.id.fab_main_activity)
- FloatingActionButton fab;*/
MultiRedditViewModel multiRedditViewModel;
SubscribedSubredditViewModel subscribedSubredditViewModel;
AccountViewModel accountViewModel;
@@ -580,18 +566,9 @@ public class MainActivity extends BaseActivity implements SortTypeSelectionCallb
int option1 = mBottomAppBarSharedPreference.getInt((mAccessToken == null ? "-" : "") + SharedPreferencesUtils.MAIN_ACTIVITY_BOTTOM_APP_BAR_OPTION_1, SharedPreferencesUtils.MAIN_ACTIVITY_BOTTOM_APP_BAR_OPTION_SUBSCRIPTIONS);
int option2 = mBottomAppBarSharedPreference.getInt((mAccessToken == null ? "-" : "") + SharedPreferencesUtils.MAIN_ACTIVITY_BOTTOM_APP_BAR_OPTION_2, SharedPreferencesUtils.MAIN_ACTIVITY_BOTTOM_APP_BAR_OPTION_MULTIREDDITS);
- //bottomAppBar.setVisibility(View.VISIBLE);
-
if (optionCount == 2) {
navigationWrapper.bindOptionDrawableResource(getBottomAppBarOptionDrawableResource(option1), getBottomAppBarOptionDrawableResource(option2));
- /*linearLayoutBottomAppBar.setWeightSum(3);
- option1BottomAppBar.setVisibility(View.GONE);
- option3BottomAppBar.setVisibility(View.GONE);
-
- option2BottomAppBar.setImageResource(getBottomAppBarOptionDrawableResource(option1));
- option4BottomAppBar.setImageResource(getBottomAppBarOptionDrawableResource(option2));*/
-
if (navigationWrapper.navigationRailView == null) {
navigationWrapper.option2BottomAppBar.setOnClickListener(view -> {
bottomAppBarOptionAction(option1);
@@ -621,11 +598,6 @@ public class MainActivity extends BaseActivity implements SortTypeSelectionCallb
getBottomAppBarOptionDrawableResource(option2), getBottomAppBarOptionDrawableResource(option3),
getBottomAppBarOptionDrawableResource(option4));
- /*navigationWrapper.option1BottomAppBar.setImageResource(getBottomAppBarOptionDrawableResource(option1));
- navigationWrapper.option2BottomAppBar.setImageResource(getBottomAppBarOptionDrawableResource(option2));
- navigationWrapper.option3BottomAppBar.setImageResource(getBottomAppBarOptionDrawableResource(option3));
- navigationWrapper.option4BottomAppBar.setImageResource(getBottomAppBarOptionDrawableResource(option4));*/
-
if (navigationWrapper.navigationRailView == null) {
navigationWrapper.option1BottomAppBar.setOnClickListener(view -> {
bottomAppBarOptionAction(option1);
@@ -937,7 +909,6 @@ public class MainActivity extends BaseActivity implements SortTypeSelectionCallb
if (showBottomAppBar) {
navigationWrapper.showNavigation();
}
- //fab.show();
navigationWrapper.showFab();
sectionsPagerAdapter.displaySortTypeInToolbar();
}
@@ -1221,11 +1192,9 @@ public class MainActivity extends BaseActivity implements SortTypeSelectionCallb
@Override
public void contentScrollUp() {
if (showBottomAppBar && !mLockBottomAppBar) {
- //bottomAppBar.performShow();
navigationWrapper.showNavigation();
}
if (!(showBottomAppBar && mLockBottomAppBar)) {
- //fab.show();
navigationWrapper.showFab();
}
}
@@ -1233,11 +1202,9 @@ public class MainActivity extends BaseActivity implements SortTypeSelectionCallb
@Override
public void contentScrollDown() {
if (!(showBottomAppBar && mLockBottomAppBar)) {
- //fab.hide();
navigationWrapper.hideFab();
}
if (showBottomAppBar && !mLockBottomAppBar) {
- //bottomAppBar.performHide();
navigationWrapper.hideNavigation();
}
}
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewMultiRedditDetailActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewMultiRedditDetailActivity.java
index 220207a2..97799f6b 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewMultiRedditDetailActivity.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewMultiRedditDetailActivity.java
@@ -3,8 +3,6 @@ package ml.docilealligator.infinityforreddit.activities;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
-import android.content.res.ColorStateList;
-import android.graphics.PorterDuff;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
@@ -18,8 +16,6 @@ import android.view.Window;
import android.view.WindowManager;
import android.view.inputmethod.EditorInfo;
import android.view.inputmethod.InputMethodManager;
-import android.widget.ImageView;
-import android.widget.LinearLayout;
import android.widget.Toast;
import androidx.annotation.NonNull;
@@ -30,9 +26,7 @@ import androidx.recyclerview.widget.RecyclerView;
import com.google.android.material.appbar.AppBarLayout;
import com.google.android.material.appbar.CollapsingToolbarLayout;
-import com.google.android.material.bottomappbar.BottomAppBar;
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
-import com.google.android.material.floatingactionbutton.FloatingActionButton;
import com.google.android.material.textfield.TextInputEditText;
import com.r0adkll.slidr.Slidr;
@@ -66,6 +60,7 @@ import ml.docilealligator.infinityforreddit.bottomsheetfragments.RandomBottomShe
import ml.docilealligator.infinityforreddit.bottomsheetfragments.SortTimeBottomSheetFragment;
import ml.docilealligator.infinityforreddit.bottomsheetfragments.SortTypeBottomSheetFragment;
import ml.docilealligator.infinityforreddit.customtheme.CustomThemeWrapper;
+import ml.docilealligator.infinityforreddit.customviews.NavigationWrapper;
import ml.docilealligator.infinityforreddit.events.GoBackToMainPageEvent;
import ml.docilealligator.infinityforreddit.events.RefreshMultiRedditsEvent;
import ml.docilealligator.infinityforreddit.events.SwitchAccountEvent;
@@ -103,20 +98,6 @@ public class ViewMultiRedditDetailActivity extends BaseActivity implements SortT
CollapsingToolbarLayout collapsingToolbarLayout;
@BindView(R.id.toolbar_view_multi_reddit_detail_activity)
Toolbar toolbar;
- @BindView(R.id.bottom_app_bar_bottom_app_bar)
- BottomAppBar bottomNavigationView;
- @BindView(R.id.linear_layout_bottom_app_bar)
- LinearLayout linearLayoutBottomAppBar;
- @BindView(R.id.option_1_bottom_app_bar)
- ImageView option1BottomAppBar;
- @BindView(R.id.option_2_bottom_app_bar)
- ImageView option2BottomAppBar;
- @BindView(R.id.option_3_bottom_app_bar)
- ImageView option3BottomAppBar;
- @BindView(R.id.option_4_bottom_app_bar)
- ImageView option4BottomAppBar;
- @BindView(R.id.fab_view_multi_reddit_detail_activity)
- FloatingActionButton fab;
@Inject
@Named("no_oauth")
Retrofit mRetrofit;
@@ -158,6 +139,7 @@ public class ViewMultiRedditDetailActivity extends BaseActivity implements SortT
private boolean showBottomAppBar;
private boolean lockBottomAppBar;
private Call<String> subredditAutocompleteCall;
+ private NavigationWrapper navigationWrapper;
@Override
protected void onCreate(Bundle savedInstanceState) {
@@ -169,6 +151,14 @@ public class ViewMultiRedditDetailActivity extends BaseActivity implements SortT
EventBus.getDefault().register(this);
+ showBottomAppBar = mSharedPreferences.getBoolean(SharedPreferencesUtils.BOTTOM_APP_BAR_KEY, false);
+
+ navigationWrapper = new NavigationWrapper(findViewById(R.id.bottom_app_bar_bottom_app_bar), findViewById(R.id.linear_layout_bottom_app_bar),
+ findViewById(R.id.option_1_bottom_app_bar), findViewById(R.id.option_2_bottom_app_bar),
+ findViewById(R.id.option_3_bottom_app_bar), findViewById(R.id.option_4_bottom_app_bar),
+ findViewById(R.id.fab_view_multi_reddit_detail_activity),
+ findViewById(R.id.navigation_rail), showBottomAppBar);
+
applyCustomTheme();
if (mSharedPreferences.getBoolean(SharedPreferencesUtils.SWIPE_RIGHT_TO_GO_BACK, true)) {
@@ -194,10 +184,16 @@ public class ViewMultiRedditDetailActivity extends BaseActivity implements SortT
int navBarHeight = getNavBarHeight();
if (navBarHeight > 0) {
- CoordinatorLayout.LayoutParams params = (CoordinatorLayout.LayoutParams) fab.getLayoutParams();
- params.bottomMargin += navBarHeight;
- fab.setLayoutParams(params);
- bottomNavigationView.setPadding(0, 0, 0, navBarHeight);
+ if (navigationWrapper.navigationRailView == null) {
+ CoordinatorLayout.LayoutParams params = (CoordinatorLayout.LayoutParams) navigationWrapper.floatingActionButton.getLayoutParams();
+ params.bottomMargin += navBarHeight;
+ navigationWrapper.floatingActionButton.setLayoutParams(params);
+ }
+
+ if (navigationWrapper.linearLayoutBottomAppBar != null) {
+ navigationWrapper.linearLayoutBottomAppBar.setPadding(0,
+ navigationWrapper.linearLayoutBottomAppBar.getPaddingTop(), 0, navBarHeight);
+ }
}
}
}
@@ -223,7 +219,6 @@ public class ViewMultiRedditDetailActivity extends BaseActivity implements SortT
mAccessToken = mCurrentAccountSharedPreferences.getString(SharedPreferencesUtils.ACCESS_TOKEN, null);
mAccountName = mCurrentAccountSharedPreferences.getString(SharedPreferencesUtils.ACCOUNT_NAME, null);
- showBottomAppBar = mSharedPreferences.getBoolean(SharedPreferencesUtils.BOTTOM_APP_BAR_KEY, false);
lockBottomAppBar = mSharedPreferences.getBoolean(SharedPreferencesUtils.LOCK_BOTTOM_APP_BAR, false);
if (savedInstanceState != null) {
@@ -238,99 +233,125 @@ public class ViewMultiRedditDetailActivity extends BaseActivity implements SortT
int option1 = mBottomAppBarSharedPreference.getInt((mAccessToken == null ? "-" : "") + SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_1, SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_HOME);
int option2 = mBottomAppBarSharedPreference.getInt((mAccessToken == null ? "-" : "") + SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_2, SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_SUBSCRIPTIONS);
- bottomNavigationView.setVisibility(View.VISIBLE);
-
if (optionCount == 2) {
- linearLayoutBottomAppBar.setWeightSum(3);
- option1BottomAppBar.setVisibility(View.GONE);
- option3BottomAppBar.setVisibility(View.GONE);
+ navigationWrapper.bindOptionDrawableResource(getBottomAppBarOptionDrawableResource(option1), getBottomAppBarOptionDrawableResource(option2));
- option2BottomAppBar.setImageResource(getBottomAppBarOptionDrawableResource(option1));
- option4BottomAppBar.setImageResource(getBottomAppBarOptionDrawableResource(option2));
+ if (navigationWrapper.navigationRailView == null) {
+ navigationWrapper.option2BottomAppBar.setOnClickListener(view -> {
+ bottomAppBarOptionAction(option1);
+ });
- option2BottomAppBar.setOnClickListener(view -> {
- bottomAppBarOptionAction(option1);
- });
-
- option4BottomAppBar.setOnClickListener(view -> {
- bottomAppBarOptionAction(option2);
- });
+ navigationWrapper.option4BottomAppBar.setOnClickListener(view -> {
+ bottomAppBarOptionAction(option2);
+ });
+ } else {
+ navigationWrapper.navigationRailView.setOnItemSelectedListener(item -> {
+ int itemId = item.getItemId();
+ if (itemId == R.id.navigation_rail_option_1) {
+ bottomAppBarOptionAction(option1);
+ return true;
+ } else if (itemId == R.id.navigation_rail_option_2) {
+ bottomAppBarOptionAction(option2);
+ return true;
+ }
+ return false;
+ });
+ }
} else {
int option3 = mBottomAppBarSharedPreference.getInt((mAccessToken == null ? "-" : "") + SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_3, mAccessToken == null ? SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_MULTIREDDITS : SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_INBOX);
int option4 = mBottomAppBarSharedPreference.getInt((mAccessToken == null ? "-" : "") + SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_4, mAccessToken == null ? SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_REFRESH : SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_PROFILE);
- option1BottomAppBar.setImageResource(getBottomAppBarOptionDrawableResource(option1));
- option2BottomAppBar.setImageResource(getBottomAppBarOptionDrawableResource(option2));
- option3BottomAppBar.setImageResource(getBottomAppBarOptionDrawableResource(option3));
- option4BottomAppBar.setImageResource(getBottomAppBarOptionDrawableResource(option4));
+ navigationWrapper.bindOptionDrawableResource(getBottomAppBarOptionDrawableResource(option1),
+ getBottomAppBarOptionDrawableResource(option2), getBottomAppBarOptionDrawableResource(option3),
+ getBottomAppBarOptionDrawableResource(option4));
- option1BottomAppBar.setOnClickListener(view -> {
- bottomAppBarOptionAction(option1);
- });
+ if (navigationWrapper.navigationRailView == null) {
+ navigationWrapper.option1BottomAppBar.setOnClickListener(view -> {
+ bottomAppBarOptionAction(option1);
+ });
- option2BottomAppBar.setOnClickListener(view -> {
- bottomAppBarOptionAction(option2);
- });
+ navigationWrapper.option2BottomAppBar.setOnClickListener(view -> {
+ bottomAppBarOptionAction(option2);
+ });
- option3BottomAppBar.setOnClickListener(view -> {
- bottomAppBarOptionAction(option3);
- });
+ navigationWrapper.option3BottomAppBar.setOnClickListener(view -> {
+ bottomAppBarOptionAction(option3);
+ });
- option4BottomAppBar.setOnClickListener(view -> {
- bottomAppBarOptionAction(option4);
- });
+ navigationWrapper.option4BottomAppBar.setOnClickListener(view -> {
+ bottomAppBarOptionAction(option4);
+ });
+ } else {
+ navigationWrapper.navigationRailView.setOnItemSelectedListener(item -> {
+ int itemId = item.getItemId();
+ if (itemId == R.id.navigation_rail_option_1) {
+ bottomAppBarOptionAction(option1);
+ return true;
+ } else if (itemId == R.id.navigation_rail_option_2) {
+ bottomAppBarOptionAction(option2);
+ return true;
+ } else if (itemId == R.id.navigation_rail_option_3) {
+ bottomAppBarOptionAction(option3);
+ return true;
+ } else if (itemId == R.id.navigation_rail_option_4) {
+ bottomAppBarOptionAction(option4);
+ return true;
+ }
+ return false;
+ });
+ }
}
} else {
- CoordinatorLayout.LayoutParams lp = (CoordinatorLayout.LayoutParams) fab.getLayoutParams();
+ CoordinatorLayout.LayoutParams lp = (CoordinatorLayout.LayoutParams) navigationWrapper.floatingActionButton.getLayoutParams();
lp.setAnchorId(View.NO_ID);
lp.gravity = Gravity.END | Gravity.BOTTOM;
- fab.setLayoutParams(lp);
+ navigationWrapper.floatingActionButton.setLayoutParams(lp);
}
fabOption = bottomAppBarSharedPreference.getInt(SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_FAB, SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_FAB_SUBMIT_POSTS);
switch (fabOption) {
case SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_FAB_REFRESH:
- fab.setImageResource(R.drawable.ic_refresh_24dp);
+ navigationWrapper.floatingActionButton.setImageResource(R.drawable.ic_refresh_24dp);
break;
case SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_FAB_CHANGE_SORT_TYPE:
- fab.setImageResource(R.drawable.ic_sort_toolbar_24dp);
+ navigationWrapper.floatingActionButton.setImageResource(R.drawable.ic_sort_toolbar_24dp);
break;
case SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_FAB_CHANGE_POST_LAYOUT:
- fab.setImageResource(R.drawable.ic_post_layout_24dp);
+ navigationWrapper.floatingActionButton.setImageResource(R.drawable.ic_post_layout_24dp);
break;
case SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_FAB_SEARCH:
- fab.setImageResource(R.drawable.ic_search_24dp);
+ navigationWrapper.floatingActionButton.setImageResource(R.drawable.ic_search_24dp);
break;
case SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_FAB_GO_TO_SUBREDDIT:
- fab.setImageResource(R.drawable.ic_subreddit_24dp);
+ navigationWrapper.floatingActionButton.setImageResource(R.drawable.ic_subreddit_24dp);
break;
case SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_FAB_GO_TO_USER:
- fab.setImageResource(R.drawable.ic_user_24dp);
+ navigationWrapper.floatingActionButton.setImageResource(R.drawable.ic_user_24dp);
break;
case SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_FAB_RANDOM:
- fab.setImageResource(R.drawable.ic_random_24dp);
+ navigationWrapper.floatingActionButton.setImageResource(R.drawable.ic_random_24dp);
break;
case SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_FAB_HIDE_READ_POSTS:
if (mAccessToken == null) {
- fab.setImageResource(R.drawable.ic_filter_24dp);
+ navigationWrapper.floatingActionButton.setImageResource(R.drawable.ic_filter_24dp);
fabOption = SharedPreferencesUtils.MAIN_ACTIVITY_BOTTOM_APP_BAR_FAB_FILTER_POSTS;
} else {
- fab.setImageResource(R.drawable.ic_hide_read_posts_24dp);
+ navigationWrapper.floatingActionButton.setImageResource(R.drawable.ic_hide_read_posts_24dp);
}
break;
case SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_FAB_FILTER_POSTS:
- fab.setImageResource(R.drawable.ic_filter_24dp);
+ navigationWrapper.floatingActionButton.setImageResource(R.drawable.ic_filter_24dp);
break;
default:
if (mAccessToken == null) {
- fab.setImageResource(R.drawable.ic_filter_24dp);
+ navigationWrapper.floatingActionButton.setImageResource(R.drawable.ic_filter_24dp);
fabOption = SharedPreferencesUtils.MAIN_ACTIVITY_BOTTOM_APP_BAR_FAB_FILTER_POSTS;
} else {
- fab.setImageResource(R.drawable.ic_add_day_night_24dp);
+ navigationWrapper.floatingActionButton.setImageResource(R.drawable.ic_add_day_night_24dp);
}
break;
}
- fab.setOnClickListener(view -> {
+ navigationWrapper.floatingActionButton.setOnClickListener(view -> {
switch (fabOption) {
case SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_FAB_REFRESH: {
if (mFragment instanceof PostFragment) {
@@ -376,7 +397,7 @@ public class ViewMultiRedditDetailActivity extends BaseActivity implements SortT
break;
}
});
- fab.setOnLongClickListener(view -> {
+ navigationWrapper.floatingActionButton.setOnLongClickListener(view -> {
FABMoreOptionsBottomSheetFragment fabMoreOptionsBottomSheetFragment = new FABMoreOptionsBottomSheetFragment();
Bundle bundle = new Bundle();
bundle.putBoolean(FABMoreOptionsBottomSheetFragment.EXTRA_ANONYMOUS_MODE, mAccessToken == null);
@@ -840,13 +861,8 @@ public class ViewMultiRedditDetailActivity extends BaseActivity implements SortT
protected void applyCustomTheme() {
coordinatorLayout.setBackgroundColor(mCustomThemeWrapper.getBackgroundColor());
applyAppBarLayoutAndCollapsingToolbarLayoutAndToolbarTheme(appBarLayout, collapsingToolbarLayout, toolbar);
- bottomNavigationView.setBackgroundTint(ColorStateList.valueOf(mCustomThemeWrapper.getBottomAppBarBackgroundColor()));
- int bottomAppBarIconColor = mCustomThemeWrapper.getBottomAppBarIconColor();
- option2BottomAppBar.setColorFilter(bottomAppBarIconColor, PorterDuff.Mode.SRC_IN);
- option1BottomAppBar.setColorFilter(bottomAppBarIconColor, PorterDuff.Mode.SRC_IN);
- option3BottomAppBar.setColorFilter(bottomAppBarIconColor, PorterDuff.Mode.SRC_IN);
- option4BottomAppBar.setColorFilter(bottomAppBarIconColor, PorterDuff.Mode.SRC_IN);
- applyFABTheme(fab);
+ navigationWrapper.applyCustomTheme(mCustomThemeWrapper.getBottomAppBarIconColor(), mCustomThemeWrapper.getBottomAppBarBackgroundColor());
+ applyFABTheme(navigationWrapper.floatingActionButton);
}
@Override
@@ -958,20 +974,20 @@ public class ViewMultiRedditDetailActivity extends BaseActivity implements SortT
@Override
public void contentScrollUp() {
if (showBottomAppBar && !lockBottomAppBar) {
- bottomNavigationView.performShow();
+ navigationWrapper.showNavigation();
}
if (!(showBottomAppBar && lockBottomAppBar)) {
- fab.show();
+ navigationWrapper.showFab();
}
}
@Override
public void contentScrollDown() {
if (!(showBottomAppBar && lockBottomAppBar)) {
- fab.hide();
+ navigationWrapper.hideFab();
}
if (showBottomAppBar && !lockBottomAppBar) {
- bottomNavigationView.performHide();
+ navigationWrapper.hideNavigation();
}
}
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewUserDetailActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewUserDetailActivity.java
index 5184e6f7..56f137ed 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewUserDetailActivity.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewUserDetailActivity.java
@@ -175,20 +175,6 @@ public class ViewUserDetailActivity extends BaseActivity implements SortTypeSele
TextView cakedayTextView;
@BindView(R.id.description_text_view_view_user_detail_activity)
TextView descriptionTextView;
- /*@BindView(R.id.bottom_app_bar_bottom_app_bar)
- BottomAppBar bottomNavigationView;
- @BindView(R.id.linear_layout_bottom_app_bar)
- LinearLayout linearLayoutBottomAppBar;
- @BindView(R.id.option_1_bottom_app_bar)
- ImageView option1BottomAppBar;
- @BindView(R.id.option_2_bottom_app_bar)
- ImageView option2BottomAppBar;
- @BindView(R.id.option_3_bottom_app_bar)
- ImageView option3BottomAppBar;
- @BindView(R.id.option_4_bottom_app_bar)
- ImageView option4BottomAppBar;
- @BindView(R.id.fab_view_user_detail_activity)
- FloatingActionButton fab;*/
@Inject
@Named("no_oauth")
Retrofit mRetrofit;
diff --git a/app/src/main/res/layout-land/activity_view_multi_reddit_detail.xml b/app/src/main/res/layout-land/activity_view_multi_reddit_detail.xml
new file mode 100644
index 00000000..ef0aecbb
--- /dev/null
+++ b/app/src/main/res/layout-land/activity_view_multi_reddit_detail.xml
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="utf-8"?>
+<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:id="@+id/coordinator_layout_view_multi_reddit_detail_activity"
+ tools:context=".activities.ViewMultiRedditDetailActivity">
+
+ <com.google.android.material.appbar.AppBarLayout
+ android:id="@+id/appbar_layout_view_multi_reddit_detail_activity"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:theme="@style/AppTheme.AppBarOverlay">
+
+ <com.google.android.material.appbar.CollapsingToolbarLayout
+ android:id="@+id/collapsing_toolbar_layout_view_multi_reddit_detail_activity"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ app:layout_scrollFlags="scroll|enterAlways"
+ app:titleEnabled="false"
+ app:toolbarId="@+id/toolbar_view_multi_reddit_detail_activity">
+
+ <androidx.appcompat.widget.Toolbar
+ android:id="@+id/toolbar_view_multi_reddit_detail_activity"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:minHeight="?attr/actionBarSize"
+ app:popupTheme="@style/AppTheme.PopupOverlay"
+ app:navigationIcon="?attr/homeAsUpIndicator" />
+
+ </com.google.android.material.appbar.CollapsingToolbarLayout>
+
+ </com.google.android.material.appbar.AppBarLayout>
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ app:layout_behavior="@string/appbar_scrolling_view_behavior">
+
+ <com.google.android.material.navigationrail.NavigationRailView
+ android:id="@+id/navigation_rail"
+ android:layout_width="80dp"
+ android:layout_height="match_parent"
+ app:headerLayout="@layout/floating_action_button"
+ app:menu="@menu/navigation_rail_menu"
+ app:labelVisibilityMode="unlabeled"
+ app:itemActiveIndicatorStyle="@style/App.Custom.Indicator" />
+
+ <androidx.fragment.app.FragmentContainerView
+ android:id="@+id/frame_layout_view_multi_reddit_detail_activity"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent" />
+
+ </LinearLayout>
+
+ <include
+ layout="@layout/bottom_app_bar"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_gravity="bottom" />
+
+ <com.google.android.material.floatingactionbutton.FloatingActionButton
+ android:id="@+id/fab_view_multi_reddit_detail_activity"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_margin="@dimen/fab_margin"
+ android:visibility="gone" />
+
+</androidx.coordinatorlayout.widget.CoordinatorLayout> \ No newline at end of file
diff --git a/app/src/main/res/layout-sw600dp/activity_view_multi_reddit_detail.xml b/app/src/main/res/layout-sw600dp/activity_view_multi_reddit_detail.xml
new file mode 100644
index 00000000..ef0aecbb
--- /dev/null
+++ b/app/src/main/res/layout-sw600dp/activity_view_multi_reddit_detail.xml
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="utf-8"?>
+<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:id="@+id/coordinator_layout_view_multi_reddit_detail_activity"
+ tools:context=".activities.ViewMultiRedditDetailActivity">
+
+ <com.google.android.material.appbar.AppBarLayout
+ android:id="@+id/appbar_layout_view_multi_reddit_detail_activity"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:theme="@style/AppTheme.AppBarOverlay">
+
+ <com.google.android.material.appbar.CollapsingToolbarLayout
+ android:id="@+id/collapsing_toolbar_layout_view_multi_reddit_detail_activity"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ app:layout_scrollFlags="scroll|enterAlways"
+ app:titleEnabled="false"
+ app:toolbarId="@+id/toolbar_view_multi_reddit_detail_activity">
+
+ <androidx.appcompat.widget.Toolbar
+ android:id="@+id/toolbar_view_multi_reddit_detail_activity"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:minHeight="?attr/actionBarSize"
+ app:popupTheme="@style/AppTheme.PopupOverlay"
+ app:navigationIcon="?attr/homeAsUpIndicator" />
+
+ </com.google.android.material.appbar.CollapsingToolbarLayout>
+
+ </com.google.android.material.appbar.AppBarLayout>
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ app:layout_behavior="@string/appbar_scrolling_view_behavior">
+
+ <com.google.android.material.navigationrail.NavigationRailView
+ android:id="@+id/navigation_rail"
+ android:layout_width="80dp"
+ android:layout_height="match_parent"
+ app:headerLayout="@layout/floating_action_button"
+ app:menu="@menu/navigation_rail_menu"
+ app:labelVisibilityMode="unlabeled"
+ app:itemActiveIndicatorStyle="@style/App.Custom.Indicator" />
+
+ <androidx.fragment.app.FragmentContainerView
+ android:id="@+id/frame_layout_view_multi_reddit_detail_activity"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent" />
+
+ </LinearLayout>
+
+ <include
+ layout="@layout/bottom_app_bar"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_gravity="bottom" />
+
+ <com.google.android.material.floatingactionbutton.FloatingActionButton
+ android:id="@+id/fab_view_multi_reddit_detail_activity"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_margin="@dimen/fab_margin"
+ android:visibility="gone" />
+
+</androidx.coordinatorlayout.widget.CoordinatorLayout> \ No newline at end of file