mirror of
https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy.git
synced 2024-11-10 12:47:26 +01:00
parent
47a06c372e
commit
5098cb698d
@ -807,17 +807,17 @@ public class MainActivity extends BaseActivity implements SortTypeSelectionCallb
|
||||
|
||||
adapter = new NavigationDrawerRecyclerViewMergedAdapter(this, mSharedPreferences,
|
||||
mNsfwAndSpoilerSharedPreferences, mNavigationDrawerSharedPreferences, mSecuritySharedPreferences,
|
||||
mCustomThemeWrapper, mAccountName, new NavigationDrawerRecyclerViewMergedAdapter.ItemClickListener() {
|
||||
@Override
|
||||
public void onMenuClick(int stringId) {
|
||||
Intent intent = null;
|
||||
if (stringId == R.string.profile) {
|
||||
intent = new Intent(MainActivity.this, ViewUserDetailActivity.class);
|
||||
intent.putExtra(ViewUserDetailActivity.EXTRA_USER_NAME_KEY, mAccountName);
|
||||
intent.putExtra(ViewUserDetailActivity.EXTRA_QUALIFIED_USER_NAME_KEY, mAccountQualifiedName);
|
||||
} else if (stringId == R.string.subscriptions) {
|
||||
intent = new Intent(MainActivity.this, SubscribedThingListingActivity.class);
|
||||
} else if (stringId == R.string.multi_reddit) {
|
||||
mCustomThemeWrapper, mAccountName, mAccountQualifiedName, new NavigationDrawerRecyclerViewMergedAdapter.ItemClickListener() {
|
||||
@Override
|
||||
public void onMenuClick(int stringId) {
|
||||
Intent intent = null;
|
||||
if (stringId == R.string.profile) {
|
||||
intent = new Intent(MainActivity.this, ViewUserDetailActivity.class);
|
||||
intent.putExtra(ViewUserDetailActivity.EXTRA_USER_NAME_KEY, mAccountName);
|
||||
intent.putExtra(ViewUserDetailActivity.EXTRA_QUALIFIED_USER_NAME_KEY, mAccountQualifiedName);
|
||||
} else if (stringId == R.string.subscriptions) {
|
||||
intent = new Intent(MainActivity.this, SubscribedThingListingActivity.class);
|
||||
} else if (stringId == R.string.multi_reddit) {
|
||||
intent = new Intent(MainActivity.this, SubscribedThingListingActivity.class);
|
||||
intent.putExtra(SubscribedThingListingActivity.EXTRA_SHOW_MULTIREDDITS, true);
|
||||
} else if (stringId == R.string.history) {
|
||||
|
@ -39,6 +39,7 @@ public class HeaderSectionRecyclerViewAdapter extends RecyclerView.Adapter<Recyc
|
||||
private Resources resources;
|
||||
private RequestManager glide;
|
||||
private String accountName;
|
||||
private String accountQualifiedName;
|
||||
private String profileImageUrl;
|
||||
private String bannerImageUrl;
|
||||
private int karma;
|
||||
@ -50,7 +51,7 @@ public class HeaderSectionRecyclerViewAdapter extends RecyclerView.Adapter<Recyc
|
||||
private boolean hideKarma;
|
||||
|
||||
public HeaderSectionRecyclerViewAdapter(BaseActivity baseActivity, CustomThemeWrapper customThemeWrapper,
|
||||
RequestManager glide, String accountName,
|
||||
RequestManager glide, String accountName, String accountQualifiedName,
|
||||
SharedPreferences sharedPreferences,
|
||||
SharedPreferences navigationDrawerSharedPreferences,
|
||||
SharedPreferences securitySharedPreferences,
|
||||
@ -62,6 +63,7 @@ public class HeaderSectionRecyclerViewAdapter extends RecyclerView.Adapter<Recyc
|
||||
this.accountName = accountName;
|
||||
isLoggedIn = accountName != null;
|
||||
this.pageToggle = pageToggle;
|
||||
this.accountQualifiedName = accountQualifiedName;
|
||||
requireAuthToAccountSection = securitySharedPreferences.getBoolean(SharedPreferencesUtils.REQUIRE_AUTHENTICATION_TO_GO_TO_ACCOUNT_SECTION_IN_NAVIGATION_DRAWER, false);
|
||||
showAvatarOnTheRightInTheNavigationDrawer = sharedPreferences.getBoolean(SharedPreferencesUtils.SHOW_AVATAR_ON_THE_RIGHT, false);
|
||||
showAvatarOnTheRightInTheNavigationDrawer = navigationDrawerSharedPreferences.getBoolean(SharedPreferencesUtils.SHOW_AVATAR_ON_THE_RIGHT, false);
|
||||
@ -86,15 +88,11 @@ public class HeaderSectionRecyclerViewAdapter extends RecyclerView.Adapter<Recyc
|
||||
}
|
||||
((NavHeaderViewHolder) holder).profileImageView.setLayoutParams(params);
|
||||
if (isLoggedIn) {
|
||||
if (hideKarma) {
|
||||
int karmaTextHeight = ((NavHeaderViewHolder) holder).karmaTextView.getHeight();
|
||||
((NavHeaderViewHolder) holder).karmaTextView.setVisibility(View.GONE);
|
||||
((NavHeaderViewHolder) holder).accountNameTextView.setTranslationY(karmaTextHeight / 2);
|
||||
} else {
|
||||
((NavHeaderViewHolder) holder).karmaTextView.setVisibility(View.VISIBLE);
|
||||
((NavHeaderViewHolder) holder).karmaTextView.setText(baseActivity.getString(R.string.karma_info, karma));
|
||||
((NavHeaderViewHolder) holder).accountNameTextView.setTranslationY(0);
|
||||
}
|
||||
|
||||
((NavHeaderViewHolder) holder).karmaTextView.setVisibility(View.VISIBLE);
|
||||
((NavHeaderViewHolder) holder).karmaTextView.setText(accountQualifiedName);
|
||||
((NavHeaderViewHolder) holder).accountNameTextView.setTranslationY(0);
|
||||
|
||||
((NavHeaderViewHolder) holder).accountNameTextView.setText(accountName);
|
||||
if (profileImageUrl != null && !profileImageUrl.equals("")) {
|
||||
glide.load(profileImageUrl)
|
||||
|
@ -29,12 +29,12 @@ public class NavigationDrawerRecyclerViewMergedAdapter {
|
||||
SharedPreferences navigationDrawerSharedPreferences,
|
||||
SharedPreferences securitySharedPreferences,
|
||||
CustomThemeWrapper customThemeWrapper,
|
||||
String accountName,
|
||||
String accountName, String accountQualifiedName,
|
||||
ItemClickListener itemClickListener) {
|
||||
RequestManager glide = Glide.with(baseActivity);
|
||||
|
||||
headerSectionRecyclerViewAdapter = new HeaderSectionRecyclerViewAdapter(baseActivity, customThemeWrapper,
|
||||
glide, accountName, sharedPreferences, navigationDrawerSharedPreferences, securitySharedPreferences,
|
||||
glide, accountName, accountQualifiedName, sharedPreferences, navigationDrawerSharedPreferences, securitySharedPreferences,
|
||||
new HeaderSectionRecyclerViewAdapter.PageToggle() {
|
||||
@Override
|
||||
public void openAccountSection() {
|
||||
|
Loading…
Reference in New Issue
Block a user