diff --git a/app/src/main/java/de/danoeh/antennapod/activity/MainActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/MainActivity.java index 6abecef57..450a99873 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/MainActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/MainActivity.java @@ -19,6 +19,9 @@ import android.widget.EditText; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.appcompat.app.ActionBarDrawerToggle; +import androidx.core.view.ViewCompat; +import androidx.core.view.WindowCompat; +import androidx.core.view.WindowInsetsCompat; import com.google.android.material.appbar.MaterialToolbar; import androidx.core.content.ContextCompat; import androidx.drawerlayout.widget.DrawerLayout; @@ -104,6 +107,7 @@ public class MainActivity extends CastEnabledActivity { if (savedInstanceState != null) { ensureGeneratedViewIdGreaterThan(savedInstanceState.getInt(KEY_GENERATED_VIEW_ID, 0)); } + WindowCompat.setDecorFitsSystemWindows(getWindow(), false); super.onCreate(savedInstanceState); setContentView(R.layout.main); recycledViewPool.setMaxRecycledViews(R.id.view_type_episode_item, 25); @@ -144,11 +148,17 @@ public class MainActivity extends CastEnabledActivity { PreferenceUpgrader.checkUpgrades(this); View bottomSheet = findViewById(R.id.audioplayerFragment); sheetBehavior = (LockableBottomSheetBehavior) BottomSheetBehavior.from(bottomSheet); - sheetBehavior.setPeekHeight((int) getResources().getDimension(R.dimen.external_player_height)); sheetBehavior.setHideable(false); sheetBehavior.setBottomSheetCallback(bottomSheetCallback); } + @Override + public void onAttachedToWindow() { + super.onAttachedToWindow(); + int playerHeight = (int) getResources().getDimension(R.dimen.external_player_height); + sheetBehavior.setPeekHeight(playerHeight + getBottomInset()); + } + /** * View.generateViewId stores the current ID in a static variable. * When the process is killed, the variable gets reset. @@ -238,6 +248,11 @@ public class MainActivity extends CastEnabledActivity { return sheetBehavior; } + private int getBottomInset() { + WindowInsetsCompat insets = ViewCompat.getRootWindowInsets(getWindow().getDecorView()); + return insets == null ? 0 : insets.getInsets(WindowInsetsCompat.Type.systemBars()).bottom; + } + public void setPlayerVisible(boolean visible) { getBottomSheet().setLocked(!visible); if (visible) { @@ -247,7 +262,8 @@ public class MainActivity extends CastEnabledActivity { } FragmentContainerView mainView = findViewById(R.id.main_view); ViewGroup.MarginLayoutParams params = (ViewGroup.MarginLayoutParams) mainView.getLayoutParams(); - params.setMargins(0, 0, 0, visible ? (int) getResources().getDimension(R.dimen.external_player_height) : 0); + int externalPlayerHeight = (int) getResources().getDimension(R.dimen.external_player_height); + params.setMargins(0, 0, 0, getBottomInset() + (visible ? externalPlayerHeight : 0)); mainView.setLayoutParams(params); findViewById(R.id.audioplayerFragment).setVisibility(visible ? View.VISIBLE : View.GONE); } diff --git a/app/src/main/res/layout/addfeed.xml b/app/src/main/res/layout/addfeed.xml index 26bc9aa21..30c1a463d 100644 --- a/app/src/main/res/layout/addfeed.xml +++ b/app/src/main/res/layout/addfeed.xml @@ -4,6 +4,7 @@ xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" + android:fitsSystemWindows="true" android:orientation="vertical"> - - - - + android:layout_height="match_parent" + android:fitsSystemWindows="true"> - + - + - + + + android:layout_alignBottom="@+id/pager" + android:layout_centerHorizontal="true" + android:layout_marginLeft="16dp" + android:layout_marginRight="16dp" + android:layout_marginBottom="12dp" + android:alpha="0" + app:cardBackgroundColor="?attr/seek_background" + app:cardCornerRadius="8dp" + app:cardElevation="0dp" + tools:alpha="1"> - + - + - + android:layout_alignParentBottom="true" + android:layoutDirection="ltr" + android:orientation="vertical"> - - - + android:layout_marginLeft="8dp" + android:layout_marginRight="8dp" + android:clickable="true" + android:max="500" + tools:progress="100" /> - + android:layout_marginTop="4dp" + android:layout_marginBottom="4dp" + android:paddingLeft="8dp" + android:paddingRight="8dp"> - + - + - + - - - - - - - + android:layout_marginBottom="24dp"> - + - + - + - + - + - + - + - + + + + + + + + + + + + + diff --git a/app/src/main/res/layout/episodes_list_fragment.xml b/app/src/main/res/layout/episodes_list_fragment.xml index 7ad7e5d21..bfe7581fe 100644 --- a/app/src/main/res/layout/episodes_list_fragment.xml +++ b/app/src/main/res/layout/episodes_list_fragment.xml @@ -9,7 +9,8 @@ + android:layout_height="wrap_content" + android:fitsSystemWindows="true"> + android:layout_height="match_parent" + android:fitsSystemWindows="true"> + android:layout_height="match_parent" + android:fitsSystemWindows="true"> + xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:fitsSystemWindows="true" + android:orientation="vertical"> + android:id="@+id/toolbar" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:minHeight="?attr/actionBarSize" + android:theme="?attr/actionBarTheme" + app:navigationContentDescription="@string/toolbar_back_button_content_description" + app:navigationIcon="?homeAsUpIndicator" /> + android:id="@+id/pager" + android:layout_width="match_parent" + android:layout_height="match_parent" /> - \ No newline at end of file + diff --git a/app/src/main/res/layout/feedsettings.xml b/app/src/main/res/layout/feedsettings.xml index beadf7c75..b9a220a02 100644 --- a/app/src/main/res/layout/feedsettings.xml +++ b/app/src/main/res/layout/feedsettings.xml @@ -1,25 +1,27 @@ - + + android:id="@+id/toolbar" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:minHeight="?attr/actionBarSize" + android:theme="?attr/actionBarTheme" + android:elevation="4dp" + app:title="@string/feed_settings_label" + app:navigationContentDescription="@string/toolbar_back_button_content_description" + app:navigationIcon="?homeAsUpIndicator" /> + android:id="@+id/settings_fragment_container" + android:layout_width="match_parent" + android:layout_height="0dp" + android:layout_weight="1" /> - \ No newline at end of file + diff --git a/app/src/main/res/layout/fragment_itunes_search.xml b/app/src/main/res/layout/fragment_itunes_search.xml index 35472fbde..369928d1d 100644 --- a/app/src/main/res/layout/fragment_itunes_search.xml +++ b/app/src/main/res/layout/fragment_itunes_search.xml @@ -4,7 +4,8 @@ xmlns:tools="http://schemas.android.com/tools" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" - android:layout_height="match_parent"> + android:layout_height="match_parent" + android:fitsSystemWindows="true"> + android:layout_height="wrap_content" + android:fitsSystemWindows="true"> - + + + android:layout_centerVertical="true" + style="?android:attr/progressBarStyle" /> + diff --git a/app/src/main/res/layout/queue_fragment.xml b/app/src/main/res/layout/queue_fragment.xml index 9bc4e0fa5..0845044f0 100644 --- a/app/src/main/res/layout/queue_fragment.xml +++ b/app/src/main/res/layout/queue_fragment.xml @@ -10,6 +10,7 @@ android:id="@+id/appbar" android:layout_width="match_parent" android:layout_height="wrap_content" + android:fitsSystemWindows="true" android:elevation="0dp"> + android:layout_height="match_parent" + android:fitsSystemWindows="true"> - + android:layout_height="wrap_content" + android:layout_marginVertical="8dp" /> - + android:layout_height="wrap_content" /> - + android:layout_height="wrap_content" /> diff --git a/core/src/main/res/values-v21/styles.xml b/core/src/main/res/values-v21/styles.xml deleted file mode 100644 index 349ca3213..000000000 --- a/core/src/main/res/values-v21/styles.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/core/src/main/res/values-v23/styles.xml b/core/src/main/res/values-v23/styles.xml deleted file mode 100644 index 33c64ad4a..000000000 --- a/core/src/main/res/values-v23/styles.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/core/src/main/res/values-v27/styles.xml b/core/src/main/res/values-v27/styles.xml deleted file mode 100644 index a28090155..000000000 --- a/core/src/main/res/values-v27/styles.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - \ No newline at end of file diff --git a/core/src/main/res/values/styles.xml b/core/src/main/res/values/styles.xml index a1e93aad3..f8bae33f3 100644 --- a/core/src/main/res/values/styles.xml +++ b/core/src/main/res/values/styles.xml @@ -15,6 +15,7 @@ @color/accent_light @color/white @color/background_light + @color/background_light @color/background_light @style/Widget.AntennaPod.ActionBar.Light @color/background_elevated_light @@ -36,6 +37,12 @@ #5F1984 #25365A false + false + @android:color/transparent + @android:color/transparent + true + true + true