Simplify onNavigationClick

This commit is contained in:
tarsin committed 2023-01-02 10:56:20 +08:00
1 parent d9959bbcb2
commit cd9b5e5a44
5 files changed
+3 -18

No files matched your search

@@ -266,11 +266,6 @@ public final class GalleryCommentsScene extends ToolbarScene
setNavigationIcon(R.drawable.v_arrow_left_dark_x24);
}
@Override
public void onNavigationClick() {
requireActivity().getOnBackPressedDispatcher().onBackPressed();
}
private void showFilterCommenterDialog(String commenter, int position) {
Context context = getContext();
if (context == null || commenter == null) {
@@ -471,12 +471,6 @@ public class GalleryDetailScene extends CollapsingToolbarScene implements View.O
setNavigationIcon(R.drawable.v_arrow_left_dark_x24);
}
@Override
public void onNavigationClick() {
requireActivity().getOnBackPressedDispatcher().onBackPressed();
super.onNavigationClick();
}
@Override
public boolean onMenuItemClick(MenuItem item) {
int itemId = item.getItemId();
@@ -218,11 +218,6 @@ public class GalleryPreviewsScene extends ToolbarScene {
return false;
}
@Override
public void onNavigationClick() {
requireActivity().getOnBackPressedDispatcher().onBackPressed();
}
public boolean onItemClick(int position) {
Context context = getContext();
if (null != context && null != mHelper && null != mGalleryInfo) {
@@ -189,7 +189,6 @@ class HistoryScene : ToolbarScene() {
mRecyclerView = null
}
@SuppressLint("RtlHardcoded")
override fun onNavigationClick() {
toggleDrawer(GravityCompat.START)
}
@@ -86,7 +86,9 @@ abstract class ToolbarScene : BaseScene() {
return false
}
open fun onNavigationClick() {}
open fun onNavigationClick() {
requireActivity().onBackPressedDispatcher.onBackPressed()
}
fun setNavigationIcon(@DrawableRes resId: Int) {
mToolbar?.setNavigationIcon(resId)