Navigation rail in ViewUserDetailActivity.

This commit is contained in:
Docile-Alligator 2022-06-27 21:01:33 +08:00
parent 1f17f526f9
commit 042834cc9b
4 changed files with 445 additions and 71 deletions

View File

@ -5,7 +5,6 @@ import android.content.Intent;
import android.content.SharedPreferences;
import android.content.res.ColorStateList;
import android.content.res.Resources;
import android.graphics.PorterDuff;
import android.net.Uri;
import android.os.AsyncTask;
import android.os.Build;
@ -24,7 +23,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.TextView;
import android.widget.Toast;
@ -46,10 +44,8 @@ import com.bumptech.glide.request.RequestOptions;
import com.google.android.material.appbar.AppBarLayout;
import com.google.android.material.appbar.CollapsingToolbarLayout;
import com.google.android.material.appbar.MaterialToolbar;
import com.google.android.material.bottomappbar.BottomAppBar;
import com.google.android.material.chip.Chip;
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
import com.google.android.material.snackbar.Snackbar;
import com.google.android.material.tabs.TabLayout;
import com.google.android.material.tabs.TabLayoutMediator;
@ -107,6 +103,7 @@ import ml.docilealligator.infinityforreddit.bottomsheetfragments.SortTimeBottomS
import ml.docilealligator.infinityforreddit.bottomsheetfragments.UrlMenuBottomSheetFragment;
import ml.docilealligator.infinityforreddit.bottomsheetfragments.UserThingSortTypeBottomSheetFragment;
import ml.docilealligator.infinityforreddit.customtheme.CustomThemeWrapper;
import ml.docilealligator.infinityforreddit.customviews.NavigationWrapper;
import ml.docilealligator.infinityforreddit.events.ChangeNSFWEvent;
import ml.docilealligator.infinityforreddit.events.GoBackToMainPageEvent;
import ml.docilealligator.infinityforreddit.events.SwitchAccountEvent;
@ -178,7 +175,7 @@ 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)
/*@BindView(R.id.bottom_app_bar_bottom_app_bar)
BottomAppBar bottomNavigationView;
@BindView(R.id.linear_layout_bottom_app_bar)
LinearLayout linearLayoutBottomAppBar;
@ -191,7 +188,7 @@ public class ViewUserDetailActivity extends BaseActivity implements SortTypeSele
@BindView(R.id.option_4_bottom_app_bar)
ImageView option4BottomAppBar;
@BindView(R.id.fab_view_user_detail_activity)
FloatingActionButton fab;
FloatingActionButton fab;*/
@Inject
@Named("no_oauth")
Retrofit mRetrofit;
@ -229,6 +226,7 @@ public class ViewUserDetailActivity extends BaseActivity implements SortTypeSele
private UserThingSortTypeBottomSheetFragment userThingSortTypeBottomSheetFragment;
private SortTimeBottomSheetFragment sortTimeBottomSheetFragment;
private PostLayoutBottomSheetFragment postLayoutBottomSheetFragment;
private NavigationWrapper navigationWrapper;
private Call<String> subredditAutocompleteCall;
private String mAccessToken;
private String mAccountName;
@ -264,6 +262,14 @@ public class ViewUserDetailActivity extends BaseActivity implements SortTypeSele
ButterKnife.bind(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_user_detail_activity),
findViewById(R.id.navigation_rail), showBottomAppBar);
EventBus.getDefault().register(this);
applyCustomTheme();
@ -278,7 +284,6 @@ public class ViewUserDetailActivity extends BaseActivity implements SortTypeSele
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) {
@ -319,10 +324,15 @@ public class ViewUserDetailActivity extends BaseActivity implements SortTypeSele
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);
}
}
showToast = true;
}
@ -654,13 +664,8 @@ public class ViewUserDetailActivity extends BaseActivity implements SortTypeSele
userNameTextView.setTextColor(mCustomThemeWrapper.getUsername());
karmaTextView.setTextColor(mCustomThemeWrapper.getPrimaryTextColor());
cakedayTextView.setTextColor(mCustomThemeWrapper.getPrimaryTextColor());
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);
descriptionTextView.setTextColor(mCustomThemeWrapper.getPrimaryTextColor());
subscribeUserChip.setTextColor(mCustomThemeWrapper.getChipTextColor());
applyTabLayoutTheme(tabLayout);
@ -723,9 +728,9 @@ public class ViewUserDetailActivity extends BaseActivity implements SortTypeSele
}
if (showBottomAppBar) {
bottomNavigationView.performShow();
navigationWrapper.showNavigation();
}
fab.show();
navigationWrapper.showFab();
sectionsPagerAdapter.displaySortTypeInToolbar();
}
@ -752,99 +757,125 @@ public class ViewUserDetailActivity extends BaseActivity implements SortTypeSele
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 = mBottomAppBarSharedPreference.getInt((mAccessToken == null ? "-" : "") + 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.OTHER_ACTIVITIES_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.OTHER_ACTIVITIES_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 (sectionsPagerAdapter != null) {
@ -890,7 +921,7 @@ public class ViewUserDetailActivity extends BaseActivity implements SortTypeSele
break;
}
});
fab.setOnLongClickListener(view -> {
navigationWrapper.floatingActionButton.setOnLongClickListener(view -> {
FABMoreOptionsBottomSheetFragment fabMoreOptionsBottomSheetFragment = new FABMoreOptionsBottomSheetFragment();
Bundle bundle = new Bundle();
bundle.putBoolean(FABMoreOptionsBottomSheetFragment.EXTRA_ANONYMOUS_MODE, mAccessToken == null);
@ -1503,20 +1534,20 @@ public class ViewUserDetailActivity extends BaseActivity implements SortTypeSele
@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();
}
}

View File

@ -0,0 +1,171 @@
<?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_user_detail_activity"
tools:application="ml.docilealligator.infinityforreddit.activities.ViewUserDetailActivity">
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appbar_layout_view_user_detail"
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_user_detail_activity"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:titleEnabled="false"
app:layout_scrollFlags="scroll|enterAlways|enterAlwaysCollapsed"
app:toolbarId="@+id/toolbar_view_user_detail_activity">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<pl.droidsonroids.gif.GifImageView
android:id="@+id/banner_image_view_view_user_detail_activity"
android:layout_width="match_parent"
android:scaleType="centerCrop"
android:layout_height="180dp"
android:contentDescription="@string/content_description_banner_imageview" />
<pl.droidsonroids.gif.GifImageView
android:id="@+id/icon_gif_image_view_view_user_detail_activity"
android:layout_width="72dp"
android:layout_height="72dp"
android:layout_marginTop="-36dp"
android:layout_below="@id/banner_image_view_view_user_detail_activity"
android:layout_centerHorizontal="true"
android:elevation="4dp" />
<LinearLayout
android:id="@+id/toolbar_linear_layout_view_user_detail_activity"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingTop="36dp"
android:paddingStart="16dp"
android:paddingEnd="16dp"
android:layout_below="@id/banner_image_view_view_user_detail_activity">
<TextView
android:id="@+id/user_name_text_view_view_user_detail_activity"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:layout_marginBottom="16dp"
android:textSize="?attr/font_18"
android:fontFamily="?attr/font_family"
android:layout_gravity="center_horizontal"/>
<com.google.android.material.chip.Chip
android:id="@+id/subscribe_user_chip_view_user_detail_activity"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="16dp"
android:layout_gravity="center_horizontal"
android:visibility="gone"
app:chipStrokeColor="#00000000" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="16dp">
<TextView
android:id="@+id/karma_text_view_view_user_detail_activity"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_toStartOf="@id/cakeday_text_view_view_user_detail_activity"
android:textSize="?attr/font_default"
android:fontFamily="?attr/font_family" />
<TextView
android:id="@+id/cakeday_text_view_view_user_detail_activity"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="end"
android:layout_alignParentEnd="true"
android:textSize="?attr/font_default"
android:fontFamily="?attr/font_family" />
</RelativeLayout>
<TextView
android:id="@+id/description_text_view_view_user_detail_activity"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="16dp"
android:textSize="?attr/font_default"
android:fontFamily="?attr/font_family"
android:visibility="gone" />
</LinearLayout>
</RelativeLayout>
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar_view_user_detail_activity"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize"
app:layout_collapseMode="pin"
app:layout_scrollFlags="scroll|enterAlways"
app:popupTheme="@style/AppTheme.PopupOverlay"
app:navigationIcon="?attr/homeAsUpIndicator" />
</com.google.android.material.appbar.CollapsingToolbarLayout>
<com.google.android.material.tabs.TabLayout
android:id="@+id/tab_layout_view_user_detail_activity"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
app:layout_scrollFlags="scroll|enterAlways"
app:tabGravity="fill"
app:tabMode="fixed"
app:tabIndicatorHeight="3dp"
app:tabRippleColor="?attr/colorControlHighlight"
app:tabUnboundedRipple="false" />
</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.viewpager2.widget.ViewPager2
android:id="@+id/view_pager_view_user_detail_activity"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</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_user_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>

View File

@ -48,7 +48,7 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior" >
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<com.google.android.material.navigationrail.NavigationRailView
android:id="@+id/navigation_rail"

View File

@ -0,0 +1,172 @@
<?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_user_detail_activity"
tools:application="ml.docilealligator.infinityforreddit.activities.ViewUserDetailActivity">
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appbar_layout_view_user_detail"
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_user_detail_activity"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:titleEnabled="false"
app:layout_scrollFlags="scroll|enterAlways|enterAlwaysCollapsed"
app:toolbarId="@+id/toolbar_view_user_detail_activity">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<pl.droidsonroids.gif.GifImageView
android:id="@+id/banner_image_view_view_user_detail_activity"
android:layout_width="match_parent"
android:scaleType="centerCrop"
android:layout_height="180dp"
android:contentDescription="@string/content_description_banner_imageview" />
<pl.droidsonroids.gif.GifImageView
android:id="@+id/icon_gif_image_view_view_user_detail_activity"
android:layout_width="72dp"
android:layout_height="72dp"
android:layout_marginTop="-36dp"
android:layout_below="@id/banner_image_view_view_user_detail_activity"
android:layout_centerHorizontal="true"
android:elevation="4dp" />
<LinearLayout
android:id="@+id/toolbar_linear_layout_view_user_detail_activity"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingTop="36dp"
android:paddingStart="16dp"
android:paddingEnd="16dp"
android:layout_below="@id/banner_image_view_view_user_detail_activity">
<TextView
android:id="@+id/user_name_text_view_view_user_detail_activity"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:layout_marginBottom="16dp"
android:textSize="?attr/font_18"
android:fontFamily="?attr/font_family"
android:layout_gravity="center_horizontal"/>
<com.google.android.material.chip.Chip
android:id="@+id/subscribe_user_chip_view_user_detail_activity"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="16dp"
android:layout_gravity="center_horizontal"
android:visibility="gone"
app:chipStrokeColor="#00000000" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="16dp">
<TextView
android:id="@+id/karma_text_view_view_user_detail_activity"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_toStartOf="@id/cakeday_text_view_view_user_detail_activity"
android:textSize="?attr/font_default"
android:fontFamily="?attr/font_family" />
<TextView
android:id="@+id/cakeday_text_view_view_user_detail_activity"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="end"
android:layout_alignParentEnd="true"
android:textSize="?attr/font_default"
android:fontFamily="?attr/font_family" />
</RelativeLayout>
<TextView
android:id="@+id/description_text_view_view_user_detail_activity"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="16dp"
android:textSize="?attr/font_default"
android:fontFamily="?attr/font_family"
android:visibility="gone" />
</LinearLayout>
</RelativeLayout>
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar_view_user_detail_activity"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize"
app:layout_collapseMode="pin"
app:layout_scrollFlags="scroll|enterAlways"
app:popupTheme="@style/AppTheme.PopupOverlay"
app:navigationIcon="?attr/homeAsUpIndicator" />
</com.google.android.material.appbar.CollapsingToolbarLayout>
<com.google.android.material.tabs.TabLayout
android:id="@+id/tab_layout_view_user_detail_activity"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
app:layout_scrollFlags="scroll|enterAlways"
app:tabGravity="fill"
app:tabMode="fixed"
app:tabIndicatorHeight="3dp"
app:tabRippleColor="?attr/colorControlHighlight"
app:tabUnboundedRipple="false" />
</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.viewpager2.widget.ViewPager2
android:id="@+id/view_pager_view_user_detail_activity"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
</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_user_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>