Notification buttons size fix
This commit is contained in:
parent
159123f51f
commit
26d85b44ce
7 changed files with 52 additions and 46 deletions
|
|
@ -74,11 +74,11 @@ public class NotificationHelper {
|
|||
return;
|
||||
}
|
||||
if (notificationLayout != null) {
|
||||
notificationLayout.setImageViewResource(R.id.button_toggle_playpause,
|
||||
notificationLayout.setImageViewResource(R.id.button_toggle_play_pause,
|
||||
isPlaying ? R.drawable.ic_pause_white_48dp : R.drawable.ic_play_arrow_white_48dp);
|
||||
}
|
||||
if (notificationLayoutExpanded != null) {
|
||||
notificationLayoutExpanded.setImageViewResource(R.id.button_toggle_playpause,
|
||||
notificationLayoutExpanded.setImageViewResource(R.id.button_toggle_play_pause,
|
||||
isPlaying ? R.drawable.ic_pause_white_48dp : R.drawable.ic_play_arrow_white_48dp);
|
||||
}
|
||||
notificationManager.notify(NOTIFICATION_ID, notification);
|
||||
|
|
@ -93,7 +93,7 @@ public class NotificationHelper {
|
|||
}
|
||||
|
||||
private void setUpExpandedPlaybackActions(boolean isPlaying) {
|
||||
notificationLayoutExpanded.setOnClickPendingIntent(R.id.button_toggle_playpause,
|
||||
notificationLayoutExpanded.setOnClickPendingIntent(R.id.button_toggle_play_pause,
|
||||
retrievePlaybackActions(1));
|
||||
|
||||
notificationLayoutExpanded.setOnClickPendingIntent(R.id.button_next,
|
||||
|
|
@ -105,12 +105,12 @@ public class NotificationHelper {
|
|||
notificationLayoutExpanded.setOnClickPendingIntent(R.id.button_quit,
|
||||
retrievePlaybackActions(4));
|
||||
|
||||
notificationLayoutExpanded.setImageViewResource(R.id.button_toggle_playpause,
|
||||
notificationLayoutExpanded.setImageViewResource(R.id.button_toggle_play_pause,
|
||||
isPlaying ? R.drawable.ic_pause_white_48dp : R.drawable.ic_play_arrow_white_48dp);
|
||||
}
|
||||
|
||||
private void setUpPlaybackActions(boolean isPlaying) {
|
||||
notificationLayout.setOnClickPendingIntent(R.id.button_toggle_playpause,
|
||||
notificationLayout.setOnClickPendingIntent(R.id.button_toggle_play_pause,
|
||||
retrievePlaybackActions(1));
|
||||
|
||||
notificationLayout.setOnClickPendingIntent(R.id.button_next,
|
||||
|
|
@ -119,7 +119,7 @@ public class NotificationHelper {
|
|||
notificationLayout.setOnClickPendingIntent(R.id.button_quit,
|
||||
retrievePlaybackActions(4));
|
||||
|
||||
notificationLayout.setImageViewResource(R.id.button_toggle_playpause,
|
||||
notificationLayout.setImageViewResource(R.id.button_toggle_play_pause,
|
||||
isPlaying ? R.drawable.ic_pause_white_48dp : R.drawable.ic_play_arrow_white_48dp);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -36,29 +36,29 @@
|
|||
/>
|
||||
|
||||
<LinearLayout
|
||||
android:gravity="center_vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="fill_vertical"
|
||||
android:paddingLeft="@dimen/notification_info_container_padding_left"
|
||||
android:paddingBottom="@dimen/notification_info_container_padding_bottom"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_vertical"
|
||||
android:minHeight="@dimen/notification_big_icon_height"
|
||||
android:orientation="vertical">
|
||||
android:orientation="vertical"
|
||||
android:paddingBottom="@dimen/notification_info_container_padding_bottom"
|
||||
android:paddingLeft="@dimen/notification_info_container_padding_left">
|
||||
|
||||
<TextView
|
||||
android:textAppearance="@style/Theme.MaterialMusic.Notification.Title"
|
||||
android:singleLine="true"
|
||||
android:id="@+id/song_title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"/>
|
||||
android:layout_height="wrap_content"
|
||||
android:singleLine="true"
|
||||
android:textAppearance="@style/Theme.MaterialMusic.Notification.Title"/>
|
||||
|
||||
<TextView
|
||||
android:singleLine="true"
|
||||
android:textAppearance="@style/Theme.MaterialMusic.Notification"
|
||||
android:id="@+id/song_artist"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"/>
|
||||
android:layout_height="wrap_content"
|
||||
android:singleLine="true"
|
||||
android:textAppearance="@style/Theme.MaterialMusic.Notification"/>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
|
|
@ -66,30 +66,30 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginRight="6dp"
|
||||
android:layout_marginLeft="6dp"
|
||||
android:layout_marginRight="6dp"
|
||||
android:orientation="horizontal"
|
||||
>
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/button_toggle_playpause"
|
||||
android:id="@+id/button_toggle_play_pause"
|
||||
style="@style/NotificationButton"
|
||||
android:paddingTop="16dp"
|
||||
android:paddingBottom="16dp"
|
||||
android:src="@drawable/ic_play_arrow_white_48dp"
|
||||
/>
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/button_next"
|
||||
style="@style/NotificationButton"
|
||||
android:src="@drawable/ic_skip_next_white_48dp"/>
|
||||
android:paddingTop="16dp"
|
||||
android:paddingBottom="16dp"
|
||||
android:src="@drawable/ic_skip_next_white_48dp"
|
||||
/>
|
||||
|
||||
<ImageButton
|
||||
android:tint="@color/notification_buttons_tint"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/notification_selector"
|
||||
android:id="@+id/button_quit"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center"
|
||||
style="@style/NotificationButton"
|
||||
android:padding="16dp"
|
||||
android:src="@drawable/close"/>
|
||||
</LinearLayout>
|
||||
|
|
|
|||
|
|
@ -87,17 +87,20 @@
|
|||
<ImageButton
|
||||
android:id="@+id/button_prev"
|
||||
style="@style/NotificationButton"
|
||||
android:padding="8dp"
|
||||
android:src="@drawable/ic_skip_previous_white_48dp"/>
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/button_toggle_playpause"
|
||||
android:id="@+id/button_toggle_play_pause"
|
||||
style="@style/NotificationButton"
|
||||
android:padding="8dp"
|
||||
android:src="@drawable/ic_play_arrow_white_48dp"
|
||||
/>
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/button_next"
|
||||
style="@style/NotificationButton"
|
||||
android:padding="8dp"
|
||||
android:src="@drawable/ic_skip_next_white_48dp"/>
|
||||
</LinearLayout>
|
||||
|
||||
|
|
|
|||
|
|
@ -36,30 +36,30 @@
|
|||
/>
|
||||
|
||||
<LinearLayout
|
||||
android:gravity="center_vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="fill_vertical"
|
||||
android:paddingLeft="@dimen/notification_info_container_padding_left"
|
||||
android:paddingBottom="@dimen/notification_info_container_padding_bottom"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_vertical"
|
||||
android:minHeight="@dimen/notification_big_icon_height"
|
||||
android:orientation="vertical"
|
||||
android:paddingBottom="@dimen/notification_info_container_padding_bottom"
|
||||
android:paddingLeft="@dimen/notification_info_container_padding_left"
|
||||
>
|
||||
|
||||
<TextView
|
||||
android:textAppearance="@style/Theme.MaterialMusic.Notification.Title"
|
||||
android:singleLine="true"
|
||||
android:id="@+id/song_title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"/>
|
||||
android:layout_height="wrap_content"
|
||||
android:singleLine="true"
|
||||
android:textAppearance="@style/Theme.MaterialMusic.Notification.Title"/>
|
||||
|
||||
<TextView
|
||||
android:singleLine="true"
|
||||
android:textAppearance="@style/Theme.MaterialMusic.Notification"
|
||||
android:id="@+id/song_artist"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"/>
|
||||
android:layout_height="wrap_content"
|
||||
android:singleLine="true"
|
||||
android:textAppearance="@style/Theme.MaterialMusic.Notification"/>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
|
|
@ -67,29 +67,30 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginRight="6dp"
|
||||
android:layout_marginLeft="6dp"
|
||||
android:layout_marginRight="6dp"
|
||||
android:orientation="horizontal"
|
||||
>
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/button_toggle_playpause"
|
||||
android:id="@+id/button_toggle_play_pause"
|
||||
style="@style/NotificationButton"
|
||||
android:paddingTop="16dp"
|
||||
android:paddingBottom="16dp"
|
||||
android:src="@drawable/ic_play_arrow_white_48dp"
|
||||
/>
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/button_next"
|
||||
style="@style/NotificationButton"
|
||||
android:src="@drawable/ic_skip_next_white_48dp"/>
|
||||
android:paddingTop="16dp"
|
||||
android:paddingBottom="16dp"
|
||||
android:src="@drawable/ic_skip_next_white_48dp"
|
||||
/>
|
||||
|
||||
<ImageButton
|
||||
android:layout_weight="1"
|
||||
android:background="?android:selectableItemBackground"
|
||||
android:id="@+id/button_quit"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center"
|
||||
style="@style/NotificationButton"
|
||||
android:padding="16dp"
|
||||
android:src="@drawable/close"/>
|
||||
</LinearLayout>
|
||||
|
|
|
|||
|
|
@ -86,17 +86,20 @@
|
|||
<ImageButton
|
||||
android:id="@+id/button_prev"
|
||||
style="@style/NotificationButton"
|
||||
android:padding="8dp"
|
||||
android:src="@drawable/ic_skip_previous_white_48dp"/>
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/button_toggle_playpause"
|
||||
android:id="@+id/button_toggle_play_pause"
|
||||
style="@style/NotificationButton"
|
||||
android:padding="8dp"
|
||||
android:src="@drawable/ic_play_arrow_white_48dp"
|
||||
/>
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/button_next"
|
||||
style="@style/NotificationButton"
|
||||
android:padding="8dp"
|
||||
android:src="@drawable/ic_skip_next_white_48dp"/>
|
||||
</LinearLayout>
|
||||
|
||||
|
|
|
|||
|
|
@ -19,5 +19,6 @@
|
|||
|
||||
<style name="NotificationButton" parent="NotificationButtonParent">
|
||||
<item name="android:background">@drawable/notification_selector</item>
|
||||
<item name="android:tint">@color/notification_buttons_tint</item>
|
||||
</style>
|
||||
</resources>
|
||||
|
|
|
|||
|
|
@ -60,9 +60,7 @@
|
|||
<item name="android:layout_width">wrap_content</item>
|
||||
<item name="android:layout_height">match_parent</item>
|
||||
<item name="android:scaleType">fitCenter</item>
|
||||
<item name="android:padding">8dp</item>
|
||||
<item name="android:layout_gravity">center</item>
|
||||
<item name="android:layout_weight">1</item>
|
||||
<item name="android:tint">@color/notification_buttons_tint</item>
|
||||
</style>
|
||||
</resources>
|
||||
Loading…
Add table
Add a link
Reference in a new issue