TEST - Update androidx.navigation to 2.4.0-alpha07

This commit is contained in:
CappielloAntonio 2021-08-27 16:22:38 +02:00
parent fbb9536d7e
commit eb19f5f9c7
4 changed files with 7 additions and 11 deletions

View file

@ -41,8 +41,8 @@ dependencies {
implementation 'androidx.constraintlayout:constraintlayout:2.1.0'
implementation "androidx.coordinatorlayout:coordinatorlayout:1.1.0"
implementation 'androidx.preference:preference-ktx:1.1.1'
implementation 'androidx.navigation:navigation-fragment-ktx:2.3.5'
implementation 'androidx.navigation:navigation-ui-ktx:2.3.5'
implementation 'androidx.navigation:navigation-fragment-ktx:2.4.0-alpha07'
implementation 'androidx.navigation:navigation-ui-ktx:2.4.0-alpha07'
implementation 'androidx.recyclerview:recyclerview:1.2.1'
implementation "androidx.room:room-runtime:2.3.0"
implementation "androidx.cardview:cardview:1.0.0"

View file

@ -104,7 +104,7 @@ public class MainActivity extends BaseActivity {
private void initNavigation() {
bottomNavigationView = findViewById(R.id.bottom_navigation);
navHostFragment = (NavHostFragment) fragmentManager.findFragmentById(R.id.nav_host_fragment);
navController = navHostFragment.getNavController();
navController = Objects.requireNonNull(navHostFragment).getNavController();
/*
* In questo modo intercetto il cambio schermata tramite navbar e se il bottom sheet è aperto,
@ -139,7 +139,7 @@ public class MainActivity extends BaseActivity {
}
}
private BottomSheetBehavior.BottomSheetCallback bottomSheetCallback =
private final BottomSheetBehavior.BottomSheetCallback bottomSheetCallback =
new BottomSheetBehavior.BottomSheetCallback() {
@Override
public void onStateChanged(@NonNull View view, int state) {
@ -163,9 +163,7 @@ public class MainActivity extends BaseActivity {
@Override
public void onSlide(@NonNull View view, float slideOffset) {
PlayerBottomSheetFragment playerBottomSheetFragment = (PlayerBottomSheetFragment) getSupportFragmentManager().findFragmentByTag("PlayerBottomSheet");
if (playerBottomSheetFragment == null) {
return;
} else {
if (playerBottomSheetFragment != null) {
float condensedSlideOffset = Math.max(0.0f, Math.min(0.2f, slideOffset - 0.2f)) / 0.2f;
playerBottomSheetFragment.getPlayerHeader().setAlpha(1 - condensedSlideOffset);
playerBottomSheetFragment.getPlayerHeader().setVisibility(condensedSlideOffset > 0.99 ? View.GONE : View.VISIBLE);

View file

@ -8,8 +8,7 @@
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/ThemeOverlay.MaterialComponents.Dark.ActionBar"
app:elevation="0dp">
android:theme="@style/ThemeOverlay.MaterialComponents.Dark.ActionBar">
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"

View file

@ -8,8 +8,7 @@
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/ThemeOverlay.MaterialComponents.Dark.ActionBar"
app:elevation="0dp">
android:theme="@style/ThemeOverlay.MaterialComponents.Dark.ActionBar">
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"