mirror of
https://github.com/antebudimir/tempus.git
synced 2026-01-01 18:03:33 +00:00
TEST - Update androidx.navigation to 2.4.0-alpha07
This commit is contained in:
parent
fbb9536d7e
commit
eb19f5f9c7
4 changed files with 7 additions and 11 deletions
|
|
@ -41,8 +41,8 @@ dependencies {
|
||||||
implementation 'androidx.constraintlayout:constraintlayout:2.1.0'
|
implementation 'androidx.constraintlayout:constraintlayout:2.1.0'
|
||||||
implementation "androidx.coordinatorlayout:coordinatorlayout:1.1.0"
|
implementation "androidx.coordinatorlayout:coordinatorlayout:1.1.0"
|
||||||
implementation 'androidx.preference:preference-ktx:1.1.1'
|
implementation 'androidx.preference:preference-ktx:1.1.1'
|
||||||
implementation 'androidx.navigation:navigation-fragment-ktx:2.3.5'
|
implementation 'androidx.navigation:navigation-fragment-ktx:2.4.0-alpha07'
|
||||||
implementation 'androidx.navigation:navigation-ui-ktx:2.3.5'
|
implementation 'androidx.navigation:navigation-ui-ktx:2.4.0-alpha07'
|
||||||
implementation 'androidx.recyclerview:recyclerview:1.2.1'
|
implementation 'androidx.recyclerview:recyclerview:1.2.1'
|
||||||
implementation "androidx.room:room-runtime:2.3.0"
|
implementation "androidx.room:room-runtime:2.3.0"
|
||||||
implementation "androidx.cardview:cardview:1.0.0"
|
implementation "androidx.cardview:cardview:1.0.0"
|
||||||
|
|
|
||||||
|
|
@ -104,7 +104,7 @@ public class MainActivity extends BaseActivity {
|
||||||
private void initNavigation() {
|
private void initNavigation() {
|
||||||
bottomNavigationView = findViewById(R.id.bottom_navigation);
|
bottomNavigationView = findViewById(R.id.bottom_navigation);
|
||||||
navHostFragment = (NavHostFragment) fragmentManager.findFragmentById(R.id.nav_host_fragment);
|
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,
|
* 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() {
|
new BottomSheetBehavior.BottomSheetCallback() {
|
||||||
@Override
|
@Override
|
||||||
public void onStateChanged(@NonNull View view, int state) {
|
public void onStateChanged(@NonNull View view, int state) {
|
||||||
|
|
@ -163,9 +163,7 @@ public class MainActivity extends BaseActivity {
|
||||||
@Override
|
@Override
|
||||||
public void onSlide(@NonNull View view, float slideOffset) {
|
public void onSlide(@NonNull View view, float slideOffset) {
|
||||||
PlayerBottomSheetFragment playerBottomSheetFragment = (PlayerBottomSheetFragment) getSupportFragmentManager().findFragmentByTag("PlayerBottomSheet");
|
PlayerBottomSheetFragment playerBottomSheetFragment = (PlayerBottomSheetFragment) getSupportFragmentManager().findFragmentByTag("PlayerBottomSheet");
|
||||||
if (playerBottomSheetFragment == null) {
|
if (playerBottomSheetFragment != null) {
|
||||||
return;
|
|
||||||
} else {
|
|
||||||
float condensedSlideOffset = Math.max(0.0f, Math.min(0.2f, slideOffset - 0.2f)) / 0.2f;
|
float condensedSlideOffset = Math.max(0.0f, Math.min(0.2f, slideOffset - 0.2f)) / 0.2f;
|
||||||
playerBottomSheetFragment.getPlayerHeader().setAlpha(1 - condensedSlideOffset);
|
playerBottomSheetFragment.getPlayerHeader().setAlpha(1 - condensedSlideOffset);
|
||||||
playerBottomSheetFragment.getPlayerHeader().setVisibility(condensedSlideOffset > 0.99 ? View.GONE : View.VISIBLE);
|
playerBottomSheetFragment.getPlayerHeader().setVisibility(condensedSlideOffset > 0.99 ? View.GONE : View.VISIBLE);
|
||||||
|
|
|
||||||
|
|
@ -8,8 +8,7 @@
|
||||||
android:id="@+id/appbar"
|
android:id="@+id/appbar"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:theme="@style/ThemeOverlay.MaterialComponents.Dark.ActionBar"
|
android:theme="@style/ThemeOverlay.MaterialComponents.Dark.ActionBar">
|
||||||
app:elevation="0dp">
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.Toolbar
|
<androidx.appcompat.widget.Toolbar
|
||||||
android:id="@+id/toolbar"
|
android:id="@+id/toolbar"
|
||||||
|
|
|
||||||
|
|
@ -8,8 +8,7 @@
|
||||||
android:id="@+id/appbar"
|
android:id="@+id/appbar"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:theme="@style/ThemeOverlay.MaterialComponents.Dark.ActionBar"
|
android:theme="@style/ThemeOverlay.MaterialComponents.Dark.ActionBar">
|
||||||
app:elevation="0dp">
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.Toolbar
|
<androidx.appcompat.widget.Toolbar
|
||||||
android:id="@+id/toolbar"
|
android:id="@+id/toolbar"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue