mirror of
https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy.git
synced 2025-01-14 20:27:12 +01:00
Add an option for History in the navigation drawer.
This commit is contained in:
parent
e6acd1bafc
commit
0265ac6227
@ -733,13 +733,11 @@ public class MainActivity extends BaseActivity implements SortTypeSelectionCallb
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
navigationWrapper.floatingActionButton.setOnLongClickListener(view -> {
|
navigationWrapper.floatingActionButton.setOnLongClickListener(view -> {
|
||||||
/*FABMoreOptionsBottomSheetFragment fabMoreOptionsBottomSheetFragment= new FABMoreOptionsBottomSheetFragment();
|
FABMoreOptionsBottomSheetFragment fabMoreOptionsBottomSheetFragment= new FABMoreOptionsBottomSheetFragment();
|
||||||
Bundle bundle = new Bundle();
|
Bundle bundle = new Bundle();
|
||||||
bundle.putBoolean(FABMoreOptionsBottomSheetFragment.EXTRA_ANONYMOUS_MODE, mAccessToken == null);
|
bundle.putBoolean(FABMoreOptionsBottomSheetFragment.EXTRA_ANONYMOUS_MODE, mAccessToken == null);
|
||||||
fabMoreOptionsBottomSheetFragment.setArguments(bundle);
|
fabMoreOptionsBottomSheetFragment.setArguments(bundle);
|
||||||
fabMoreOptionsBottomSheetFragment.show(getSupportFragmentManager(), fabMoreOptionsBottomSheetFragment.getTag());*/
|
fabMoreOptionsBottomSheetFragment.show(getSupportFragmentManager(), fabMoreOptionsBottomSheetFragment.getTag());
|
||||||
Intent intent = new Intent(this, HistoryActivity.class);
|
|
||||||
startActivity(intent);
|
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
navigationWrapper.floatingActionButton.setVisibility(View.VISIBLE);
|
navigationWrapper.floatingActionButton.setVisibility(View.VISIBLE);
|
||||||
@ -762,6 +760,8 @@ public class MainActivity extends BaseActivity implements SortTypeSelectionCallb
|
|||||||
} else if (stringId == R.string.multi_reddit) {
|
} else if (stringId == R.string.multi_reddit) {
|
||||||
intent = new Intent(MainActivity.this, SubscribedThingListingActivity.class);
|
intent = new Intent(MainActivity.this, SubscribedThingListingActivity.class);
|
||||||
intent.putExtra(SubscribedThingListingActivity.EXTRA_SHOW_MULTIREDDITS, true);
|
intent.putExtra(SubscribedThingListingActivity.EXTRA_SHOW_MULTIREDDITS, true);
|
||||||
|
} else if (stringId == R.string.history) {
|
||||||
|
intent = new Intent(MainActivity.this, HistoryActivity.class);
|
||||||
} else if (stringId == R.string.rpan) {
|
} else if (stringId == R.string.rpan) {
|
||||||
intent = new Intent(MainActivity.this, RPANActivity.class);
|
intent = new Intent(MainActivity.this, RPANActivity.class);
|
||||||
} else if (stringId == R.string.trending) {
|
} else if (stringId == R.string.trending) {
|
||||||
|
@ -25,8 +25,8 @@ public class AccountSectionRecyclerViewAdapter extends RecyclerView.Adapter<Recy
|
|||||||
|
|
||||||
private static final int VIEW_TYPE_MENU_GROUP_TITLE = 1;
|
private static final int VIEW_TYPE_MENU_GROUP_TITLE = 1;
|
||||||
private static final int VIEW_TYPE_MENU_ITEM = 2;
|
private static final int VIEW_TYPE_MENU_ITEM = 2;
|
||||||
private static final int ACCOUNT_SECTION_ITEMS = 4;
|
private static final int ACCOUNT_SECTION_ITEMS = 5;
|
||||||
private static final int ANONYMOUS_ACCOUNT_SECTION_ITEMS = 2;
|
private static final int ANONYMOUS_ACCOUNT_SECTION_ITEMS = 3;
|
||||||
|
|
||||||
private BaseActivity baseActivity;
|
private BaseActivity baseActivity;
|
||||||
private int inboxCount;
|
private int inboxCount;
|
||||||
@ -105,7 +105,7 @@ public class AccountSectionRecyclerViewAdapter extends RecyclerView.Adapter<Recy
|
|||||||
stringId = R.string.multi_reddit;
|
stringId = R.string.multi_reddit;
|
||||||
drawableId = R.drawable.ic_multi_reddit_24dp;
|
drawableId = R.drawable.ic_multi_reddit_24dp;
|
||||||
break;
|
break;
|
||||||
default:
|
case 4:
|
||||||
setOnClickListener = false;
|
setOnClickListener = false;
|
||||||
if (inboxCount > 0) {
|
if (inboxCount > 0) {
|
||||||
((MenuItemViewHolder) holder).menuTextView.setText(baseActivity.getString(R.string.inbox_with_count, inboxCount));
|
((MenuItemViewHolder) holder).menuTextView.setText(baseActivity.getString(R.string.inbox_with_count, inboxCount));
|
||||||
@ -118,15 +118,24 @@ public class AccountSectionRecyclerViewAdapter extends RecyclerView.Adapter<Recy
|
|||||||
baseActivity.startActivity(intent);
|
baseActivity.startActivity(intent);
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
stringId = R.string.history;
|
||||||
|
drawableId = R.drawable.ic_history_24dp;
|
||||||
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (position == 1) {
|
switch (position) {
|
||||||
stringId = R.string.subscriptions;
|
case 1:
|
||||||
drawableId = R.drawable.ic_subscritptions_bottom_app_bar_24dp;
|
stringId = R.string.subscriptions;
|
||||||
} else {
|
drawableId = R.drawable.ic_subscritptions_bottom_app_bar_24dp;
|
||||||
stringId = R.string.multi_reddit;
|
break;
|
||||||
drawableId = R.drawable.ic_multi_reddit_24dp;
|
case 2:
|
||||||
|
stringId = R.string.multi_reddit;
|
||||||
|
drawableId = R.drawable.ic_multi_reddit_24dp;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
stringId = R.string.history;
|
||||||
|
drawableId = R.drawable.ic_history_24dp;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -135,6 +135,7 @@
|
|||||||
<string name="profile">Profile</string>
|
<string name="profile">Profile</string>
|
||||||
<string name="subscriptions">Subscriptions</string>
|
<string name="subscriptions">Subscriptions</string>
|
||||||
<string name="multi_reddit">Multireddit</string>
|
<string name="multi_reddit">Multireddit</string>
|
||||||
|
<string name="history">History</string>
|
||||||
<string name="inbox">Inbox</string>
|
<string name="inbox">Inbox</string>
|
||||||
<string name="inbox_with_count">Inbox (%1$,d)</string>
|
<string name="inbox_with_count">Inbox (%1$,d)</string>
|
||||||
<string name="rpan">RPAN</string>
|
<string name="rpan">RPAN</string>
|
||||||
|
Loading…
Reference in New Issue
Block a user