diff options
author | ByteHamster <info@bytehamster.com> | 2022-08-07 11:25:51 +0200 |
---|---|---|
committer | ByteHamster <info@bytehamster.com> | 2022-09-18 19:12:41 +0200 |
commit | a524b810603a78afc6503d01e6aeb788ea14401a (patch) | |
tree | 9659721a6dbbfe853c50264668c0505891826fc1 | |
parent | e5d2d1b6ef6eec995e2ef7e714653567e349e59e (diff) | |
download | AntennaPod-a524b810603a78afc6503d01e6aeb788ea14401a.zip |
Expand app below system windows
19 files changed, 340 insertions, 341 deletions
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"> <com.google.android.material.appbar.MaterialToolbar diff --git a/app/src/main/res/layout/audioplayer_fragment.xml b/app/src/main/res/layout/audioplayer_fragment.xml index d8dfe2eb4..9b1650a76 100644 --- a/app/src/main/res/layout/audioplayer_fragment.xml +++ b/app/src/main/res/layout/audioplayer_fragment.xml @@ -1,276 +1,283 @@ <?xml version="1.0" encoding="utf-8"?> -<RelativeLayout +<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent"> - <com.google.android.material.appbar.MaterialToolbar - android:id="@+id/toolbar" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_alignParentTop="true" - android:minHeight="?attr/actionBarSize" - android:theme="?attr/actionBarTheme" - app:navigationContentDescription="@string/toolbar_back_button_content_description" - app:navigationIcon="@drawable/ic_arrow_down" /> - <androidx.fragment.app.FragmentContainerView android:id="@+id/playerFragment" android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_alignParentTop="true" + android:layout_gravity="top" android:background="?attr/background_elevated" android:elevation="8dp" tools:layout_height="@dimen/external_player_height" /> - <androidx.viewpager2.widget.ViewPager2 - android:id="@+id/pager" + <RelativeLayout android:layout_width="match_parent" - android:layout_height="0dp" - android:layout_above="@id/playtime_layout" - android:layout_below="@id/toolbar" - android:layout_marginBottom="12dp" - android:foreground="?android:windowContentOverlay" - android:orientation="vertical" /> + android:layout_height="match_parent" + android:fitsSystemWindows="true"> - <ImageView - android:layout_width="match_parent" - android:layout_height="8dp" - android:layout_alignBottom="@id/pager" - android:importantForAccessibility="no" - app:srcCompat="@drawable/bg_gradient" - app:tint="?android:attr/windowBackground" /> - - <androidx.cardview.widget.CardView - android:id="@+id/cardViewSeek" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - 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"> - - <TextView - android:id="@+id/txtvSeek" - android:layout_width="wrap_content" + <com.google.android.material.appbar.MaterialToolbar + android:id="@+id/toolbar" + android:layout_width="match_parent" android:layout_height="wrap_content" - android:gravity="center" - android:paddingLeft="24dp" - android:paddingTop="4dp" - android:paddingRight="24dp" - android:paddingBottom="4dp" - android:textColor="@color/white" - android:textSize="16sp" - tools:text="1:06:29" /> + android:layout_alignParentTop="true" + android:minHeight="?attr/actionBarSize" + android:theme="?attr/actionBarTheme" + app:navigationContentDescription="@string/toolbar_back_button_content_description" + app:navigationIcon="@drawable/ic_arrow_down" /> - </androidx.cardview.widget.CardView> - - <LinearLayout - android:id="@+id/playtime_layout" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_alignParentBottom="true" - android:layoutDirection="ltr" - android:orientation="vertical"> - - <de.danoeh.antennapod.view.ChapterSeekBar - android:id="@+id/sbPosition" + <androidx.viewpager2.widget.ViewPager2 + android:id="@+id/pager" android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginLeft="8dp" - android:layout_marginRight="8dp" - android:clickable="true" - android:max="500" - tools:progress="100" /> + android:layout_height="0dp" + android:layout_above="@id/playtime_layout" + android:layout_below="@id/toolbar" + android:layout_marginBottom="12dp" + android:foreground="?android:windowContentOverlay" + android:orientation="vertical" /> - <RelativeLayout + <ImageView android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginTop="4dp" - android:layout_marginBottom="4dp" - android:paddingLeft="8dp" - android:paddingRight="8dp"> + android:layout_height="8dp" + android:layout_alignBottom="@id/pager" + android:importantForAccessibility="no" + app:srcCompat="@drawable/bg_gradient" + app:tint="?android:attr/windowBackground" /> - <TextView - android:id="@+id/txtvPosition" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_alignParentStart="true" - android:layout_alignParentLeft="true" - android:layout_marginStart="16dp" - android:layout_marginLeft="16dp" - android:text="@string/position_default_label" - android:textColor="?android:attr/textColorSecondary" - android:textSize="@dimen/text_size_micro" /> + <androidx.cardview.widget.CardView + android:id="@+id/cardViewSeek" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + 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"> <TextView - android:id="@+id/txtvLength" + android:id="@+id/txtvSeek" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_alignParentEnd="true" - android:layout_alignParentRight="true" - android:layout_marginEnd="16dp" - android:layout_marginRight="16dp" - android:background="?android:attr/selectableItemBackground" - android:text="@string/position_default_label" - android:textColor="?android:attr/textColorSecondary" - android:textSize="@dimen/text_size_micro" /> + android:gravity="center" + android:paddingLeft="24dp" + android:paddingTop="4dp" + android:paddingRight="24dp" + android:paddingBottom="4dp" + android:textColor="@color/white" + android:textSize="16sp" + tools:text="1:06:29" /> - </RelativeLayout> + </androidx.cardview.widget.CardView> - <RelativeLayout - android:id="@+id/player_control" + <LinearLayout + android:id="@+id/playtime_layout" android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_marginBottom="24dp"> + android:layout_alignParentBottom="true" + android:layoutDirection="ltr" + android:orientation="vertical"> - <de.danoeh.antennapod.view.PlayButton - android:id="@+id/butPlay" - android:layout_width="@dimen/audioplayer_playercontrols_length_big" - android:layout_height="@dimen/audioplayer_playercontrols_length_big" - android:layout_centerHorizontal="true" - android:layout_centerVertical="true" - android:layout_marginStart="@dimen/audioplayer_playercontrols_margin" - android:layout_marginLeft="@dimen/audioplayer_playercontrols_margin" - android:layout_marginEnd="@dimen/audioplayer_playercontrols_margin" - android:layout_marginRight="@dimen/audioplayer_playercontrols_margin" - android:background="?attr/selectableItemBackgroundBorderless" - android:contentDescription="@string/pause_label" - android:padding="8dp" - android:scaleType="fitCenter" - app:srcCompat="@drawable/ic_play_48dp" - tools:srcCompat="@drawable/ic_play_48dp" /> + <de.danoeh.antennapod.view.ChapterSeekBar + android:id="@+id/sbPosition" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginLeft="8dp" + android:layout_marginRight="8dp" + android:clickable="true" + android:max="500" + tools:progress="100" /> - <de.danoeh.antennapod.ui.common.CircularProgressBar - android:layout_width="@dimen/audioplayer_playercontrols_length_big" - android:layout_height="@dimen/audioplayer_playercontrols_length_big" - android:layout_centerHorizontal="true" - android:layout_centerVertical="true" - android:layout_marginStart="16dp" - android:layout_marginLeft="16dp" - android:layout_marginEnd="16dp" - android:layout_marginRight="16dp" - app:foregroundColor="?attr/action_icon_color" /> + <RelativeLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginTop="4dp" + android:layout_marginBottom="4dp" + android:paddingLeft="8dp" + android:paddingRight="8dp"> - <ProgressBar - android:id="@+id/progLoading" - android:layout_width="@dimen/audioplayer_playercontrols_length_big" - android:layout_height="@dimen/audioplayer_playercontrols_length_big" - android:layout_centerHorizontal="true" - android:layout_centerVertical="true" - android:visibility="gone" - style="?android:attr/progressBarStyle" /> + <TextView + android:id="@+id/txtvPosition" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_alignParentStart="true" + android:layout_alignParentLeft="true" + android:layout_marginStart="16dp" + android:layout_marginLeft="16dp" + android:text="@string/position_default_label" + android:textColor="?android:attr/textColorSecondary" + android:textSize="@dimen/text_size_micro" /> - <ImageButton - android:id="@+id/butRev" - android:layout_width="@dimen/audioplayer_playercontrols_length" - android:layout_height="@dimen/audioplayer_playercontrols_length" - android:layout_centerVertical="true" - android:layout_marginStart="@dimen/audioplayer_playercontrols_margin" - android:layout_marginLeft="@dimen/audioplayer_playercontrols_margin" - android:layout_toStartOf="@id/butPlay" - android:layout_toLeftOf="@id/butPlay" - android:background="?attr/selectableItemBackgroundBorderless" - android:contentDescription="@string/rewind_label" - android:scaleType="fitCenter" - app:srcCompat="@drawable/ic_fast_rewind" - tools:srcCompat="@drawable/ic_fast_rewind" /> + <TextView + android:id="@+id/txtvLength" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_alignParentEnd="true" + android:layout_alignParentRight="true" + android:layout_marginEnd="16dp" + android:layout_marginRight="16dp" + android:background="?android:attr/selectableItemBackground" + android:text="@string/position_default_label" + android:textColor="?android:attr/textColorSecondary" + android:textSize="@dimen/text_size_micro" /> - <TextView - android:id="@+id/txtvRev" - android:layout_width="wrap_content" + </RelativeLayout> + + <RelativeLayout + android:id="@+id/player_control" + android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_below="@id/butRev" - android:layout_alignStart="@id/butRev" - android:layout_alignLeft="@id/butRev" - android:layout_alignEnd="@id/butRev" - android:layout_alignRight="@id/butRev" - android:clickable="false" - android:gravity="center" - android:text="30" - android:textColor="?android:attr/textColorSecondary" - android:textSize="12sp" /> + android:layout_marginBottom="24dp"> - <de.danoeh.antennapod.ui.common.PlaybackSpeedIndicatorView - android:id="@+id/butPlaybackSpeed" - android:layout_width="@dimen/audioplayer_playercontrols_length" - android:layout_height="@dimen/audioplayer_playercontrols_length" - android:layout_centerVertical="true" - android:layout_toStartOf="@id/butRev" - android:layout_toLeftOf="@id/butRev" - android:background="?attr/selectableItemBackgroundBorderless" - android:contentDescription="@string/playback_speed" - app:foregroundColor="?attr/action_icon_color" - tools:srcCompat="@drawable/ic_playback_speed" /> + <de.danoeh.antennapod.view.PlayButton + android:id="@+id/butPlay" + android:layout_width="@dimen/audioplayer_playercontrols_length_big" + android:layout_height="@dimen/audioplayer_playercontrols_length_big" + android:layout_centerHorizontal="true" + android:layout_centerVertical="true" + android:layout_marginStart="@dimen/audioplayer_playercontrols_margin" + android:layout_marginLeft="@dimen/audioplayer_playercontrols_margin" + android:layout_marginEnd="@dimen/audioplayer_playercontrols_margin" + android:layout_marginRight="@dimen/audioplayer_playercontrols_margin" + android:background="?attr/selectableItemBackgroundBorderless" + android:contentDescription="@string/pause_label" + android:padding="8dp" + android:scaleType="fitCenter" + app:srcCompat="@drawable/ic_play_48dp" + tools:srcCompat="@drawable/ic_play_48dp" /> - <TextView - android:id="@+id/txtvPlaybackSpeed" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_below="@id/butPlaybackSpeed" - android:layout_alignStart="@id/butPlaybackSpeed" - android:layout_alignLeft="@id/butPlaybackSpeed" - android:layout_alignEnd="@id/butPlaybackSpeed" - android:layout_alignRight="@id/butPlaybackSpeed" - android:clickable="false" - android:gravity="center" - android:text="1.00" - android:textColor="?android:attr/textColorSecondary" - android:textSize="12sp" /> + <de.danoeh.antennapod.ui.common.CircularProgressBar + android:layout_width="@dimen/audioplayer_playercontrols_length_big" + android:layout_height="@dimen/audioplayer_playercontrols_length_big" + android:layout_centerHorizontal="true" + android:layout_centerVertical="true" + android:layout_marginStart="16dp" + android:layout_marginLeft="16dp" + android:layout_marginEnd="16dp" + android:layout_marginRight="16dp" + app:foregroundColor="?attr/action_icon_color" /> - <ImageButton - android:id="@+id/butFF" - android:layout_width="@dimen/audioplayer_playercontrols_length" - android:layout_height="@dimen/audioplayer_playercontrols_length" - android:layout_centerVertical="true" - android:layout_marginEnd="@dimen/audioplayer_playercontrols_margin" - android:layout_marginRight="@dimen/audioplayer_playercontrols_margin" - android:layout_toEndOf="@id/butPlay" - android:layout_toRightOf="@id/butPlay" - android:background="?attr/selectableItemBackgroundBorderless" - android:contentDescription="@string/fast_forward_label" - android:scaleType="fitCenter" - app:srcCompat="@drawable/ic_fast_forward" - tools:srcCompat="@drawable/ic_fast_forward" /> + <ProgressBar + android:id="@+id/progLoading" + android:layout_width="@dimen/audioplayer_playercontrols_length_big" + android:layout_height="@dimen/audioplayer_playercontrols_length_big" + android:layout_centerHorizontal="true" + android:layout_centerVertical="true" + android:visibility="gone" + style="?android:attr/progressBarStyle" /> - <TextView - android:id="@+id/txtvFF" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_below="@id/butFF" - android:layout_alignStart="@id/butFF" - android:layout_alignLeft="@id/butFF" - android:layout_alignEnd="@id/butFF" - android:layout_alignRight="@id/butFF" - android:clickable="false" - android:gravity="center" - android:text="30" - android:textColor="?android:attr/textColorSecondary" - android:textSize="12sp" /> + <ImageButton + android:id="@+id/butRev" + android:layout_width="@dimen/audioplayer_playercontrols_length" + android:layout_height="@dimen/audioplayer_playercontrols_length" + android:layout_centerVertical="true" + android:layout_marginStart="@dimen/audioplayer_playercontrols_margin" + android:layout_marginLeft="@dimen/audioplayer_playercontrols_margin" + android:layout_toStartOf="@id/butPlay" + android:layout_toLeftOf="@id/butPlay" + android:background="?attr/selectableItemBackgroundBorderless" + android:contentDescription="@string/rewind_label" + android:scaleType="fitCenter" + app:srcCompat="@drawable/ic_fast_rewind" + tools:srcCompat="@drawable/ic_fast_rewind" /> + + <TextView + android:id="@+id/txtvRev" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_below="@id/butRev" + android:layout_alignStart="@id/butRev" + android:layout_alignLeft="@id/butRev" + android:layout_alignEnd="@id/butRev" + android:layout_alignRight="@id/butRev" + android:clickable="false" + android:gravity="center" + android:text="30" + android:textColor="?android:attr/textColorSecondary" + android:textSize="12sp" /> + + <de.danoeh.antennapod.ui.common.PlaybackSpeedIndicatorView + android:id="@+id/butPlaybackSpeed" + android:layout_width="@dimen/audioplayer_playercontrols_length" + android:layout_height="@dimen/audioplayer_playercontrols_length" + android:layout_centerVertical="true" + android:layout_toStartOf="@id/butRev" + android:layout_toLeftOf="@id/butRev" + android:background="?attr/selectableItemBackgroundBorderless" + android:contentDescription="@string/playback_speed" + app:foregroundColor="?attr/action_icon_color" + tools:srcCompat="@drawable/ic_playback_speed" /> + + <TextView + android:id="@+id/txtvPlaybackSpeed" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_below="@id/butPlaybackSpeed" + android:layout_alignStart="@id/butPlaybackSpeed" + android:layout_alignLeft="@id/butPlaybackSpeed" + android:layout_alignEnd="@id/butPlaybackSpeed" + android:layout_alignRight="@id/butPlaybackSpeed" + android:clickable="false" + android:gravity="center" + android:text="1.00" + android:textColor="?android:attr/textColorSecondary" + android:textSize="12sp" /> + + <ImageButton + android:id="@+id/butFF" + android:layout_width="@dimen/audioplayer_playercontrols_length" + android:layout_height="@dimen/audioplayer_playercontrols_length" + android:layout_centerVertical="true" + android:layout_marginEnd="@dimen/audioplayer_playercontrols_margin" + android:layout_marginRight="@dimen/audioplayer_playercontrols_margin" + android:layout_toEndOf="@id/butPlay" + android:layout_toRightOf="@id/butPlay" + android:background="?attr/selectableItemBackgroundBorderless" + android:contentDescription="@string/fast_forward_label" + android:scaleType="fitCenter" + app:srcCompat="@drawable/ic_fast_forward" + tools:srcCompat="@drawable/ic_fast_forward" /> + + <TextView + android:id="@+id/txtvFF" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_below="@id/butFF" + android:layout_alignStart="@id/butFF" + android:layout_alignLeft="@id/butFF" + android:layout_alignEnd="@id/butFF" + android:layout_alignRight="@id/butFF" + android:clickable="false" + android:gravity="center" + android:text="30" + android:textColor="?android:attr/textColorSecondary" + android:textSize="12sp" /> + + <ImageButton + android:id="@+id/butSkip" + android:layout_width="@dimen/audioplayer_playercontrols_length" + android:layout_height="@dimen/audioplayer_playercontrols_length" + android:layout_centerVertical="true" + android:layout_toEndOf="@id/butFF" + android:layout_toRightOf="@id/butFF" + android:background="?attr/selectableItemBackgroundBorderless" + android:contentDescription="@string/skip_episode_label" + android:scaleType="fitCenter" + app:srcCompat="@drawable/ic_skip_48dp" + tools:srcCompat="@drawable/ic_skip_48dp" /> - <ImageButton - android:id="@+id/butSkip" - android:layout_width="@dimen/audioplayer_playercontrols_length" - android:layout_height="@dimen/audioplayer_playercontrols_length" - android:layout_centerVertical="true" - android:layout_toEndOf="@id/butFF" - android:layout_toRightOf="@id/butFF" - android:background="?attr/selectableItemBackgroundBorderless" - android:contentDescription="@string/skip_episode_label" - android:scaleType="fitCenter" - app:srcCompat="@drawable/ic_skip_48dp" - tools:srcCompat="@drawable/ic_skip_48dp" /> + </RelativeLayout> - </RelativeLayout> + </LinearLayout> - </LinearLayout> + </RelativeLayout> -</RelativeLayout> +</FrameLayout> 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 @@ <com.google.android.material.appbar.AppBarLayout android:id="@+id/appbar" android:layout_width="match_parent" - android:layout_height="wrap_content"> + android:layout_height="wrap_content" + android:fitsSystemWindows="true"> <com.google.android.material.appbar.MaterialToolbar android:id="@+id/toolbar" diff --git a/app/src/main/res/layout/feed_item_list_fragment.xml b/app/src/main/res/layout/feed_item_list_fragment.xml index 6c950948d..043929e32 100644 --- a/app/src/main/res/layout/feed_item_list_fragment.xml +++ b/app/src/main/res/layout/feed_item_list_fragment.xml @@ -3,7 +3,8 @@ 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:layout_height="match_parent" + android:fitsSystemWindows="true"> <com.google.android.material.appbar.AppBarLayout android:id="@+id/appBar" diff --git a/app/src/main/res/layout/feedinfo.xml b/app/src/main/res/layout/feedinfo.xml index 5461d9276..af4aa2570 100644 --- a/app/src/main/res/layout/feedinfo.xml +++ b/app/src/main/res/layout/feedinfo.xml @@ -4,7 +4,8 @@ xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" - android:layout_height="match_parent"> + android:layout_height="match_parent" + android:fitsSystemWindows="true"> <com.google.android.material.appbar.AppBarLayout android:id="@+id/appBar" diff --git a/app/src/main/res/layout/feeditem_pager_fragment.xml b/app/src/main/res/layout/feeditem_pager_fragment.xml index 2c96e3721..604e7a703 100644 --- a/app/src/main/res/layout/feeditem_pager_fragment.xml +++ b/app/src/main/res/layout/feeditem_pager_fragment.xml @@ -1,23 +1,24 @@ <?xml version="1.0" encoding="utf-8"?> <LinearLayout - xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:app="http://schemas.android.com/apk/res-auto" - android:layout_height="match_parent" - android:layout_width="match_parent" - android:orientation="vertical"> + 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"> <com.google.android.material.appbar.MaterialToolbar - 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/toolbar"/> + 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" /> <androidx.viewpager2.widget.ViewPager2 - android:id="@+id/pager" - android:layout_width="match_parent" - android:layout_height="match_parent"/> + android:id="@+id/pager" + android:layout_width="match_parent" + android:layout_height="match_parent" /> -</LinearLayout>
\ No newline at end of file +</LinearLayout> 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 @@ <?xml version="1.0" encoding="utf-8"?> -<LinearLayout 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:orientation="vertical"> +<LinearLayout + 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"> <com.google.android.material.appbar.MaterialToolbar - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:minHeight="?attr/actionBarSize" - android:theme="?attr/actionBarTheme" - app:title="@string/feed_settings_label" - app:navigationContentDescription="@string/toolbar_back_button_content_description" - app:navigationIcon="?homeAsUpIndicator" - android:elevation="4dp" - android:id="@+id/toolbar"/> + 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" /> <androidx.fragment.app.FragmentContainerView - android:layout_width="match_parent" - android:layout_height="0dp" - android:layout_weight="1" - android:id="@+id/settings_fragment_container" /> + android:id="@+id/settings_fragment_container" + android:layout_width="match_parent" + android:layout_height="0dp" + android:layout_weight="1" /> -</LinearLayout>
\ No newline at end of file +</LinearLayout> 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"> <LinearLayout android:id="@+id/browsing" diff --git a/app/src/main/res/layout/fragment_subscriptions.xml b/app/src/main/res/layout/fragment_subscriptions.xml index 65ee34c53..b19387cb0 100644 --- a/app/src/main/res/layout/fragment_subscriptions.xml +++ b/app/src/main/res/layout/fragment_subscriptions.xml @@ -9,7 +9,8 @@ <com.google.android.material.appbar.AppBarLayout android:id="@+id/appbar" android:layout_width="match_parent" - android:layout_height="wrap_content"> + android:layout_height="wrap_content" + android:fitsSystemWindows="true"> <com.google.android.material.appbar.MaterialToolbar android:id="@+id/toolbar" diff --git a/app/src/main/res/layout/nav_list.xml b/app/src/main/res/layout/nav_list.xml index a24ea3fba..52fde0a5f 100644 --- a/app/src/main/res/layout/nav_list.xml +++ b/app/src/main/res/layout/nav_list.xml @@ -1,16 +1,19 @@ -<?xml version='1.0' encoding='utf-8'?> -<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" +<?xml version="1.0" encoding="utf-8"?> +<RelativeLayout + xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/nav_layout" android:layout_width="match_parent" android:layout_height="match_parent" + android:fitsSystemWindows="true" android:background="?android:attr/windowBackground"> <LinearLayout android:id="@+id/nav_settings" android:layout_width="match_parent" android:layout_height="@dimen/listitem_iconwithtext_height" + android:fitsSystemWindows="true" android:layout_alignParentBottom="true" android:background="?attr/selectableItemBackground" android:contentDescription="@string/settings_label" @@ -46,6 +49,7 @@ android:textColor="?android:attr/textColorPrimary" android:textSize="@dimen/text_size_navdrawer" tools:background="@android:color/holo_green_light" /> + </LinearLayout> <View @@ -73,9 +77,10 @@ tools:listitem="@layout/nav_listitem" /> <ProgressBar - style="?android:attr/progressBarStyle" + android:id="@+id/progressBar" android:layout_width="match_parent" android:layout_height="wrap_content" - android:id="@+id/progressBar" - android:layout_centerVertical="true"/> + android:layout_centerVertical="true" + style="?android:attr/progressBarStyle" /> + </RelativeLayout> 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"> <com.google.android.material.appbar.MaterialToolbar diff --git a/app/src/main/res/layout/search_fragment.xml b/app/src/main/res/layout/search_fragment.xml index daeb88528..3fded8725 100644 --- a/app/src/main/res/layout/search_fragment.xml +++ b/app/src/main/res/layout/search_fragment.xml @@ -3,7 +3,8 @@ 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:layout_height="match_parent" + android:fitsSystemWindows="true"> <com.google.android.material.appbar.MaterialToolbar android:id="@+id/toolbar" diff --git a/app/src/main/res/layout/share_episode_dialog.xml b/app/src/main/res/layout/share_episode_dialog.xml index 9d0a2f38d..7be941599 100644 --- a/app/src/main/res/layout/share_episode_dialog.xml +++ b/app/src/main/res/layout/share_episode_dialog.xml @@ -41,11 +41,10 @@ </RadioGroup> - <View + <com.google.android.material.divider.MaterialDivider android:layout_width="match_parent" - android:layout_height="1dp" - android:layout_marginVertical="8dp" - android:background="?attr/background_elevated" /> + android:layout_height="wrap_content" + android:layout_marginVertical="8dp" /> <CheckBox android:id="@+id/share_position_checkbox" diff --git a/app/src/main/res/layout/swipeactions_row.xml b/app/src/main/res/layout/swipeactions_row.xml index 7185d8238..2e5323e1a 100644 --- a/app/src/main/res/layout/swipeactions_row.xml +++ b/app/src/main/res/layout/swipeactions_row.xml @@ -45,10 +45,9 @@ </RelativeLayout> - <View + <com.google.android.material.divider.MaterialDivider android:layout_width="match_parent" - android:layout_height="1dp" - android:background="?attr/background_elevated" /> + android:layout_height="wrap_content" /> <LinearLayout android:id="@+id/previewContainer" @@ -77,9 +76,8 @@ </LinearLayout> - <View + <com.google.android.material.divider.MaterialDivider android:layout_width="match_parent" - android:layout_height="1dp" - android:background="?attr/background_elevated" /> + android:layout_height="wrap_content" /> </LinearLayout> 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 @@ -<?xml version="1.0" encoding="utf-8"?> -<resources> - <style name="Theme.AntennaPod.Light" parent="Theme.Base.AntennaPod.Light"> - <item name="android:windowContentTransitions">true</item> - <!-- To make icons visible --> - <item name="android:statusBarColor">@color/grey600</item> - <item name="android:navigationBarColor">@color/grey600</item> - </style> - - <style name="Theme.AntennaPod.Dark" parent="Theme.Base.AntennaPod.Dark"> - <item name="android:windowContentTransitions">true</item> - <item name="android:statusBarColor">@color/background_darktheme</item> - <item name="android:navigationBarColor">@color/background_darktheme</item> - </style> - - <style name="Theme.AntennaPod.TrueBlack" parent="Theme.Base.AntennaPod.TrueBlack"> - <item name="android:statusBarColor">@color/black</item> - <item name="android:navigationBarColor">@color/black</item> - </style> -</resources>
\ 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 @@ -<?xml version="1.0" encoding="utf-8"?> -<resources> - <style name="Theme.AntennaPod.Light" parent="Theme.Base.AntennaPod.Light"> - <item name="android:windowContentTransitions">true</item> - <item name="android:statusBarColor">@color/background_light</item> - <item name="android:windowLightStatusBar">true</item> - <item name="android:navigationBarColor">@color/grey600</item> - </style> - - <style name="Theme.AntennaPod.Dark" parent="Theme.Base.AntennaPod.Dark"> - <item name="android:windowContentTransitions">true</item> - <item name="android:statusBarColor">@color/background_darktheme</item> - <item name="android:windowLightStatusBar">false</item> - <item name="android:navigationBarColor">@color/background_darktheme</item> - </style> - - <style name="Theme.AntennaPod.TrueBlack" parent="Theme.Base.AntennaPod.TrueBlack"> - <item name="android:statusBarColor">@color/black</item> - <item name="android:navigationBarColor">@color/black</item> - </style> -</resources>
\ 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 @@ -<?xml version="1.0" encoding="utf-8"?> -<resources> - <style name="Theme.AntennaPod.Light" parent="Theme.Base.AntennaPod.Light"> - <item name="android:windowContentTransitions">true</item> - <item name="android:statusBarColor">@color/background_light</item> - <item name="android:windowLightStatusBar">true</item> - <item name="android:navigationBarColor">@color/background_light</item> - <item name="android:navigationBarDividerColor">@color/navigation_bar_divider_light</item> - <item name="android:windowLightNavigationBar">true</item> - </style> -</resources>
\ 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 @@ <item name="colorPrimaryContainer">@color/accent_light</item> <item name="colorOnPrimaryContainer">@color/white</item> <item name="android:windowBackground">@color/background_light</item> + <item name="colorSurface">@color/background_light</item> <item name="background_color">@color/background_light</item> <item name="actionBarStyle">@style/Widget.AntennaPod.ActionBar.Light</item> <item name="background_elevated">@color/background_elevated_light</item> @@ -36,6 +37,12 @@ <item name="icon_purple">#5F1984</item> <item name="icon_gray">#25365A</item> <item name="android:splitMotionEvents">false</item> + <item name="android:fitsSystemWindows">false</item> + <item name="android:statusBarColor" tools:targetApi="lollipop">@android:color/transparent</item> + <item name="android:navigationBarColor" tools:targetApi="lollipop">@android:color/transparent</item> + <item name="android:windowLightStatusBar" tools:targetApi="m">true</item> + <item name="android:windowLightNavigationBar" tools:targetApi="o_mr1">true</item> + <item name="android:windowContentTransitions" tools:targetApi="lollipop">true</item> </style> <style name="Theme.AntennaPod.Dark" parent="Theme.Base.AntennaPod.Dark"> @@ -51,6 +58,7 @@ <item name="colorPrimaryContainer">@color/accent_dark</item> <item name="colorOnPrimaryContainer">@color/black</item> <item name="android:windowBackground">@color/background_darktheme</item> + <item name="colorSurface">@color/background_darktheme</item> <item name="background_color">@color/background_darktheme</item> <item name="actionBarStyle">@style/Widget.AntennaPod.ActionBar.Dark</item> <item name="background_elevated">@color/background_elevated_darktheme</item> @@ -74,6 +82,12 @@ <item name="icon_purple">#AA55D8</item> <item name="icon_gray">#CDD9E4</item> <item name="android:splitMotionEvents">false</item> + <item name="android:fitsSystemWindows">false</item> + <item name="android:statusBarColor" tools:targetApi="lollipop">@android:color/transparent</item> + <item name="android:navigationBarColor" tools:targetApi="lollipop">@android:color/transparent</item> + <item name="android:windowLightStatusBar" tools:targetApi="m">false</item> + <item name="android:windowLightNavigationBar" tools:targetApi="o_mr1">false</item> + <item name="android:windowContentTransitions" tools:targetApi="lollipop">true</item> </style> <style name="Theme.AntennaPod.TrueBlack" parent="Theme.Base.AntennaPod.TrueBlack"> @@ -89,6 +103,7 @@ <item name="android:color">@color/white</item> <item name="android:colorBackground">@color/black</item> <item name="android:windowBackground">@color/black</item> + <item name="colorSurface">@color/black</item> <item name="background_color">@color/black</item> <item name="android:actionBarStyle">@color/black</item> <item name="background_elevated">@color/black</item> |