From 50a60d3a6996b8d0d65c047ad8355d0c7e013f1c Mon Sep 17 00:00:00 2001 From: SlaVcE <102253539+SlaVcE14@users.noreply.github.com> Date: Fri, 2 Feb 2024 20:37:53 +0100 Subject: [PATCH] Fix some visual bugs --- app/src/main/java/com/sjapps/jsonlist/MainActivity.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/sjapps/jsonlist/MainActivity.java b/app/src/main/java/com/sjapps/jsonlist/MainActivity.java index afab2a3..e6a98a2 100644 --- a/app/src/main/java/com/sjapps/jsonlist/MainActivity.java +++ b/app/src/main/java/com/sjapps/jsonlist/MainActivity.java @@ -106,7 +106,9 @@ protected void onCreate(Bundle savedInstanceState) { autoTransition.setDuration(150); menuBtn.setOnClickListener(view -> open_closeMenu()); - backBtn.setOnClickListener(view -> getOnBackPressedDispatcher().onBackPressed()); + backBtn.setOnClickListener(view -> { + if(!data.isEmptyPath()) getOnBackPressedDispatcher().onBackPressed(); + }); openFileBtn.setOnClickListener(view -> ImportFromFile()); menu.findViewById(R.id.openFileBtn2).setOnClickListener(view -> { @@ -262,7 +264,7 @@ public void handleOnBackPressed() { .show(); return; } - + TransitionManager.endTransitions(viewGroup); TransitionManager.beginDelayedTransition(viewGroup, autoTransition); data.goBack(); open(JsonData.getPathFormat(data.getPath()), data.getPath(),-1); @@ -378,6 +380,7 @@ private void LoadData(String Data) { } public void open(String Title, String path, int previousPosition) { + TransitionManager.endTransitions(viewGroup); TransitionManager.beginDelayedTransition(viewGroup, autoTransition); if (isMenuOpen)