Merge pull request #3927 from ByteHamster/player-page

Removed ActionBar background on player page
This commit is contained in:
H. Lehmann 2020-03-14 00:18:53 +01:00 committed by GitHub
commit 03d1f41e9b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 28 additions and 52 deletions

View File

@ -202,17 +202,13 @@ public class NavListAdapter extends BaseAdapter
v = getFeedView(position, convertView, parent); v = getFeedView(position, convertView, parent);
} }
if (v != null && viewType != VIEW_TYPE_SECTION_DIVIDER) { if (v != null && viewType != VIEW_TYPE_SECTION_DIVIDER) {
TextView txtvTitle = v.findViewById(R.id.txtvTitle);
TypedValue typedValue = new TypedValue(); TypedValue typedValue = new TypedValue();
if (position == itemAccess.getSelectedItemIndex()) { if (position == itemAccess.getSelectedItemIndex()) {
txtvTitle.setTypeface(null, Typeface.BOLD); v.getContext().getTheme().resolveAttribute(R.attr.drawer_activated_color, typedValue, true);
v.getContext().getTheme().resolveAttribute(de.danoeh.antennapod.core.R.attr.drawer_activated_color, typedValue, true);
v.setBackgroundResource(typedValue.resourceId); v.setBackgroundResource(typedValue.resourceId);
} else { } else {
txtvTitle.setTypeface(null, Typeface.NORMAL); v.getContext().getTheme().resolveAttribute(android.R.attr.windowBackground, typedValue, true);
v.getContext().getTheme().resolveAttribute(de.danoeh.antennapod.core.R.attr.nav_drawer_background, typedValue, true);
v.setBackgroundResource(typedValue.resourceId); v.setBackgroundResource(typedValue.resourceId);
} }
} }
@ -356,11 +352,6 @@ public class NavListAdapter extends BaseAdapter
if(counter > 0) { if(counter > 0) {
holder.count.setVisibility(View.VISIBLE); holder.count.setVisibility(View.VISIBLE);
holder.count.setText(String.valueOf(counter)); holder.count.setText(String.valueOf(counter));
if (itemAccess.getSelectedItemIndex() == position) {
holder.count.setTypeface(null, Typeface.BOLD);
} else {
holder.count.setTypeface(null, Typeface.NORMAL);
}
} else { } else {
holder.count.setVisibility(View.GONE); holder.count.setVisibility(View.GONE);
} }

View File

@ -86,11 +86,12 @@ public class PagerIndicatorView extends View {
} }
private void drawCircle(Canvas canvas, int position, float frac) { private void drawCircle(Canvas canvas, int position, float frac) {
float circleRadiusSmall = canvas.getHeight() * 0.26f; float availableHeight = canvas.getHeight() - getPaddingTop() - getPaddingBottom();
float circleRadiusBig = canvas.getHeight() * 0.35f; float circleRadiusSmall = availableHeight * 0.26f;
float circleRadiusBig = availableHeight * 0.35f;
float circleRadiusDelta = (circleRadiusBig - circleRadiusSmall); float circleRadiusDelta = (circleRadiusBig - circleRadiusSmall);
float start = 0.5f * (canvas.getWidth() - numPages * 1.5f * canvas.getHeight()); float start = 0.5f * (canvas.getWidth() - numPages * 1.5f * availableHeight);
paint.setStrokeWidth(canvas.getHeight() * 0.3f); paint.setStrokeWidth(availableHeight * 0.3f);
if (position == disabledPage) { if (position == disabledPage) {
paint.setStyle(Paint.Style.STROKE); paint.setStyle(Paint.Style.STROKE);
@ -99,7 +100,7 @@ public class PagerIndicatorView extends View {
} }
paint.setColor((Integer) new ArgbEvaluator().evaluate(frac, circleColor, circleColorHighlight)); paint.setColor((Integer) new ArgbEvaluator().evaluate(frac, circleColor, circleColorHighlight));
canvas.drawCircle(start + (position * 1.5f + 0.75f) * canvas.getHeight(), 0.5f * canvas.getHeight(), canvas.drawCircle(start + (position * 1.5f + 0.75f) * availableHeight, 0.5f * availableHeight + getPaddingTop(),
circleRadiusSmall + frac * circleRadiusDelta, paint); circleRadiusSmall + frac * circleRadiusDelta, paint);
} }
} }

View File

@ -43,7 +43,7 @@
android:gravity="center" android:gravity="center"
android:text="-" android:text="-"
android:textStyle="bold" android:textStyle="bold"
android:textColor="@color/status_progress" android:textColor="?attr/colorAccent"
android:textSize="24sp" android:textSize="24sp"
android:background="?attr/selectableItemBackgroundBorderless" /> android:background="?attr/selectableItemBackgroundBorderless" />
@ -62,7 +62,7 @@
android:gravity="center" android:gravity="center"
android:text="+" android:text="+"
android:textStyle="bold" android:textStyle="bold"
android:textColor="@color/status_progress" android:textColor="?attr/colorAccent"
android:textSize="24sp" android:textSize="24sp"
android:background="?attr/selectableItemBackgroundBorderless" /> android:background="?attr/selectableItemBackgroundBorderless" />
</LinearLayout> </LinearLayout>

View File

@ -4,44 +4,35 @@
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/drawer_layout" android:id="@+id/drawer_layout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent">
tools:background="@android:color/holo_red_dark">
<RelativeLayout <RelativeLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appBar"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<androidx.appcompat.widget.Toolbar <androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:background="?attr/colorPrimary"
android:minHeight="?attr/actionBarSize" android:minHeight="?attr/actionBarSize"
tools:background="@android:color/darker_gray"/> android:theme="?attr/actionBarTheme"
android:layout_alignParentTop="true"
android:id="@+id/toolbar"/>
<de.danoeh.antennapod.view.PagerIndicatorView <de.danoeh.antennapod.view.PagerIndicatorView
android:id="@+id/page_indicator" android:id="@+id/page_indicator"
android:layout_height="8dp" android:layout_height="16dp"
android:layout_width="40dp" android:layout_width="40dp"
android:layout_marginTop="-12dp" android:layout_marginTop="-12dp"
android:paddingBottom="4dp" android:padding="4dp"
android:layout_gravity="center" android:layout_below="@id/toolbar"
android:background="@android:color/transparent" /> android:layout_centerHorizontal="true"/>
</com.google.android.material.appbar.AppBarLayout>
<androidx.viewpager.widget.ViewPager <androidx.viewpager.widget.ViewPager
android:id="@+id/pager" android:id="@+id/pager"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="0dp" android:layout_height="0dp"
android:layout_above="@id/playtime_layout" android:layout_above="@id/playtime_layout"
android:layout_below="@id/appBar" android:layout_below="@id/toolbar"
android:foreground="?android:windowContentOverlay" android:foreground="?android:windowContentOverlay"
tools:background="@android:color/holo_orange_light" tools:background="@android:color/holo_orange_light"
android:layout_marginBottom="12dp" /> android:layout_marginBottom="12dp" />

View File

@ -5,7 +5,7 @@
android:layout_width="@dimen/drawer_width" android:layout_width="@dimen/drawer_width"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_gravity="start" android:layout_gravity="start"
android:background="?attr/nav_drawer_background" android:background="?android:attr/windowBackground"
android:orientation="vertical"> android:orientation="vertical">
<LinearLayout <LinearLayout

View File

@ -58,7 +58,6 @@
<attr name="currently_playing_background" format="color"/> <attr name="currently_playing_background" format="color"/>
<attr name="ic_bookmark" format="reference"/> <attr name="ic_bookmark" format="reference"/>
<attr name="ic_settings_speed" format="reference" /> <attr name="ic_settings_speed" format="reference" />
<attr name="nav_drawer_background" format="color"/>
<attr name="drawer_activated_color" format="color"/> <attr name="drawer_activated_color" format="color"/>
<attr name="batch_edit_fab_icon" format="reference"/> <attr name="batch_edit_fab_icon" format="reference"/>
<attr name="action_icon_color" format="color"/> <attr name="action_icon_color" format="color"/>

View File

@ -9,18 +9,13 @@
<color name="holo_blue_dark">#0099CC</color> <color name="holo_blue_dark">#0099CC</color>
<color name="download_success_green">#248800</color> <color name="download_success_green">#248800</color>
<color name="download_failed_red">#B00020</color> <color name="download_failed_red">#B00020</color>
<color name="status_progress">#E033B5E5</color>
<color name="overlay_dark">#2C2C2C</color>
<color name="overlay_light">#FFFFFF</color>
<color name="new_indicator_green">#669900</color> <color name="new_indicator_green">#669900</color>
<color name="image_readability_tint">#80000000</color> <color name="image_readability_tint">#80000000</color>
<color name="feed_image_bg">#50000000</color> <color name="feed_image_bg">#50000000</color>
<!-- Theme colors --> <!-- Theme colors -->
<color name="primary_light">#FFFFFF</color> <color name="primary_light">#FFFFFF</color>
<color name="primary_darktheme">#212121</color> <color name="primary_darktheme">#303030</color>
<color name="nav_drawer_background_dark">#3B3B3B</color>
<color name="nav_drawer_highlighted_dark">#212121</color>
<color name="highlight_light">#DDDDDD</color> <color name="highlight_light">#DDDDDD</color>
<color name="highlight_dark">#414141</color> <color name="highlight_dark">#414141</color>
<color name="highlight_trueblack">#414141</color> <color name="highlight_trueblack">#414141</color>

View File

@ -10,6 +10,7 @@
<item name="colorAccent">@color/holo_blue_light</item> <item name="colorAccent">@color/holo_blue_light</item>
<item name="progressBarTheme">@style/ProgressBarLight</item> <item name="progressBarTheme">@style/ProgressBarLight</item>
<item name="buttonStyle">@style/Widget.AntennaPod.Button</item> <item name="buttonStyle">@style/Widget.AntennaPod.Button</item>
<item name="android:windowBackground">@color/primary_light</item>
<item name="alertDialogTheme">@style/AntennaPod.Dialog.Light</item> <item name="alertDialogTheme">@style/AntennaPod.Dialog.Light</item>
<item name="action_bar_icon_color">@color/grey600</item> <item name="action_bar_icon_color">@color/grey600</item>
<item name="storage">@drawable/ic_sd_grey600_24dp</item> <item name="storage">@drawable/ic_sd_grey600_24dp</item>
@ -41,7 +42,6 @@
<item name="stat_playlist">@drawable/ic_list_grey600_24dp</item> <item name="stat_playlist">@drawable/ic_list_grey600_24dp</item>
<item name="type_video">@drawable/ic_videocam_grey600_24dp</item> <item name="type_video">@drawable/ic_videocam_grey600_24dp</item>
<item name="dragview_background">@drawable/ic_drag_vertical_grey600_48dp</item> <item name="dragview_background">@drawable/ic_drag_vertical_grey600_48dp</item>
<item name="nav_drawer_background">@color/white</item>
<item name="drawer_activated_color">@color/highlight_light</item> <item name="drawer_activated_color">@color/highlight_light</item>
<item name="ic_history">@drawable/ic_history_grey600_24dp</item> <item name="ic_history">@drawable/ic_history_grey600_24dp</item>
<item name="ic_folder">@drawable/ic_folder_grey600_24dp</item> <item name="ic_folder">@drawable/ic_folder_grey600_24dp</item>
@ -82,6 +82,7 @@
<item name="colorAccent">@color/holo_blue_dark</item> <item name="colorAccent">@color/holo_blue_dark</item>
<item name="colorPrimary">@color/primary_darktheme</item> <item name="colorPrimary">@color/primary_darktheme</item>
<item name="colorPrimaryDark">@color/primary_darktheme</item> <item name="colorPrimaryDark">@color/primary_darktheme</item>
<item name="android:windowBackground">@color/primary_darktheme</item>
<item name="colorControlNormal">@color/white</item> <item name="colorControlNormal">@color/white</item>
<item name="buttonStyle">@style/Widget.AntennaPod.Button</item> <item name="buttonStyle">@style/Widget.AntennaPod.Button</item>
<item name="progressBarTheme">@style/ProgressBarDark</item> <item name="progressBarTheme">@style/ProgressBarDark</item>
@ -116,8 +117,7 @@
<item name="stat_playlist">@drawable/ic_list_white_24dp</item> <item name="stat_playlist">@drawable/ic_list_white_24dp</item>
<item name="type_video">@drawable/ic_videocam_white_24dp</item> <item name="type_video">@drawable/ic_videocam_white_24dp</item>
<item name="dragview_background">@drawable/ic_drag_vertical_white_48dp</item> <item name="dragview_background">@drawable/ic_drag_vertical_white_48dp</item>
<item name="nav_drawer_background">@color/nav_drawer_background_dark</item> <item name="drawer_activated_color">@color/highlight_dark</item>
<item name="drawer_activated_color">@color/nav_drawer_highlighted_dark</item>
<item name="ic_history">@drawable/ic_history_white_24dp</item> <item name="ic_history">@drawable/ic_history_white_24dp</item>
<item name="ic_folder">@drawable/ic_folder_white_24dp</item> <item name="ic_folder">@drawable/ic_folder_white_24dp</item>
<item name="ic_settings_playback">@drawable/ic_av_play_white_24dp</item> <item name="ic_settings_playback">@drawable/ic_av_play_white_24dp</item>
@ -157,7 +157,6 @@
<item name="progressBarTheme">@style/ProgressBarTrueBlack</item> <item name="progressBarTheme">@style/ProgressBarTrueBlack</item>
<item name="dragview_background">@drawable/ic_drag_vertical_white_48dp</item> <item name="dragview_background">@drawable/ic_drag_vertical_white_48dp</item>
<item name="batch_edit_fab_icon">@drawable/ic_fab_edit_black</item> <item name="batch_edit_fab_icon">@drawable/ic_fab_edit_black</item>
<item name="nav_drawer_background">@color/black</item>
<item name="drawer_activated_color">@color/highlight_trueblack</item> <item name="drawer_activated_color">@color/highlight_trueblack</item>
<item name="android:textColorPrimary">@color/white</item> <item name="android:textColorPrimary">@color/white</item>
<item name="android:color">@color/white</item> <item name="android:color">@color/white</item>