improve animation of bottom nav when leaving chat + fix rare crash when switching to land mode

This commit is contained in:
12aw 2023-12-17 11:39:39 +01:00
parent 06499d1597
commit 059a844ffd
6 changed files with 12 additions and 3 deletions

View file

@ -1421,7 +1421,6 @@ public class ConversationFragment extends XmppFragment
public void onDetach() {
super.onDetach();
this.activity = null; //TODO maybe not a good idea since some callbacks really need it
ConversationsActivity.bottomNavigationView.setVisibility(VISIBLE);
}
@Override
@ -2993,7 +2992,7 @@ public class ConversationFragment extends XmppFragment
}
if (!activity.xmppConnectionService.getBooleanPreference("show_thread_feature", R.bool.show_thread_feature)) return;
}
if (activity.xmppConnectionService != null && activity.xmppConnectionService.getBooleanPreference("show_thread_feature", R.bool.show_thread_feature)) {
if (activity != null && activity.xmppConnectionService.getBooleanPreference("show_thread_feature", R.bool.show_thread_feature)) {
setThread(message.getThread());
}
}

View file

@ -29,6 +29,8 @@
package eu.siacs.conversations.ui;
import static android.view.View.VISIBLE;
import android.animation.Animator;
import android.animation.AnimatorInflater;
import android.app.Activity;
@ -45,6 +47,8 @@ import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import static androidx.recyclerview.widget.ItemTouchHelper.RIGHT;
import static eu.siacs.conversations.ui.ConversationsActivity.bottomNavigationView;
import android.app.AlertDialog;
import android.graphics.Canvas;
import android.graphics.Paint;
@ -449,6 +453,7 @@ public class ConversationsOverviewFragment extends XmppFragment {
if (activity.xmppConnectionService != null) {
refresh();
}
bottomNavigationView.setVisibility(VISIBLE);
}
@Override

View file

@ -1,5 +1,6 @@
package eu.siacs.conversations.ui;
import static android.view.View.VISIBLE;
import static eu.siacs.conversations.ui.SettingsActivity.REQUEST_CREATE_BACKUP;
import static eu.siacs.conversations.utils.PermissionUtils.allGranted;
import static eu.siacs.conversations.utils.PermissionUtils.readGranted;
@ -196,6 +197,7 @@ public class ManageAccountActivity extends XmppActivity implements OnAccountUpda
}
}
});
bottomNavigationView.setVisibility(VISIBLE);
}
@Override

View file

@ -1,5 +1,6 @@
package eu.siacs.conversations.ui;
import static android.view.View.VISIBLE;
import static eu.siacs.conversations.utils.AccountUtils.MANAGE_ACCOUNT_ACTIVITY;
import android.Manifest;
@ -490,7 +491,7 @@ public class StartConversationActivity extends XmppActivity implements XmppConne
}
}
});
bottomNavigationView.setVisibility(VISIBLE);
}
@Override

View file

@ -40,6 +40,7 @@
app:labelVisibilityMode="labeled"
app:itemActiveIndicatorStyle="@style/monocles.Active.Indicator"
app:menu="@menu/bottom_navigation_menu"
android:visibility="gone"
android:animateLayoutChanges="true" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>
</layout>

View file

@ -54,6 +54,7 @@
app:labelVisibilityMode="labeled"
app:itemActiveIndicatorStyle="@style/monocles.Active.Indicator"
app:menu="@menu/bottom_navigation_menu"
android:visibility="gone"
android:animateLayoutChanges="true" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>
</layout>