Commit 6a7b8d8f authored by Danny Baumann's avatar Danny Baumann Committed by Steve Kondik
Browse files

Make buttons more touch friendly.

Do this by replacing margins and empty space around buttons by padding.
Doing this also makes the ripple touch feedback look better.

Change-Id: I7f2e933b9f7b481c9456f56860483c2e5e96b67b
parent 81e13fbe
......@@ -146,20 +146,20 @@
<!-- divider -->
<View
android:id="@+id/action_button_left_top_divider"
android:layout_height="@dimen/audio_player_divider_height"
android:layout_width="@dimen/audio_player_divider_length"
android:layout_marginRight="@dimen/audio_player_divider_horizontal_offset"
android:layout_marginBottom="@dimen/audio_player_divider_vertical_offset"
android:layout_alignParentRight="true"
android:layout_above="@id/audio_player_current_time"
android:background="@color/now_playing_divider" />
<!-- divider -->
<View
android:id="@+id/action_button_left_bottom_divider"
android:layout_height="@dimen/audio_player_divider_height"
android:layout_width="@dimen/audio_player_divider_length"
android:layout_marginRight="@dimen/audio_player_divider_horizontal_offset"
android:layout_marginTop="@dimen/audio_player_divider_vertical_offset"
android:layout_alignParentRight="true"
android:layout_below="@id/audio_player_current_time"
android:background="@color/now_playing_divider" />
......@@ -168,10 +168,9 @@
android:id="@+id/action_button_browse"
android:layout_width="@dimen/audio_player_controls_end_button_width"
android:layout_height="@dimen/audio_player_controls_end_button_height"
android:layout_above="@id/action_button_previous"
android:layout_above="@id/action_button_left_top_divider"
android:layout_alignLeft="@id/action_button_previous"
android:layout_marginLeft="@dimen/audio_player_controls_end_button_half_width"
android:layout_marginBottom="@dimen/audio_player_secondary_control_offset"
android:contentDescription="@string/accessibility_browse"
android:focusable="true"
android:scaleType="fitCenter"
......@@ -181,10 +180,9 @@
android:id="@+id/action_button_shuffle"
android:layout_width="@dimen/audio_player_controls_end_button_width"
android:layout_height="@dimen/audio_player_controls_end_button_height"
android:layout_below="@id/action_button_previous"
android:layout_below="@id/action_button_left_bottom_divider"
android:layout_alignLeft="@id/action_button_previous"
android:layout_marginLeft="@dimen/audio_player_controls_end_button_half_width"
android:layout_marginTop="@dimen/audio_player_secondary_control_offset"
android:contentDescription="@string/accessibility_shuffle"
android:scaleType="fitCenter"
android:src="@drawable/btn_playback_shuffle_all" />
......@@ -220,20 +218,20 @@
<!-- divider -->
<View
android:id="@+id/action_button_right_top_divider"
android:layout_height="@dimen/audio_player_divider_height"
android:layout_width="@dimen/audio_player_divider_length"
android:layout_marginLeft="@dimen/audio_player_divider_horizontal_offset"
android:layout_marginBottom="@dimen/audio_player_divider_vertical_offset"
android:layout_alignParentLeft="true"
android:layout_above="@id/audio_player_total_time"
android:background="@color/now_playing_divider" />
<!-- divider -->
<View
android:id="@+id/action_button_right_bottom_divider"
android:layout_height="@dimen/audio_player_divider_height"
android:layout_width="@dimen/audio_player_divider_length"
android:layout_marginLeft="@dimen/audio_player_divider_horizontal_offset"
android:layout_marginTop="@dimen/audio_player_divider_vertical_offset"
android:layout_alignParentLeft="true"
android:layout_below="@id/audio_player_total_time"
android:background="@color/now_playing_divider" />
......@@ -242,10 +240,9 @@
android:id="@+id/action_button_queue"
android:layout_width="@dimen/audio_player_controls_end_button_width"
android:layout_height="@dimen/audio_player_controls_end_button_height"
android:layout_above="@id/action_button_next"
android:layout_above="@id/action_button_right_top_divider"
android:layout_alignRight="@id/action_button_next"
android:layout_marginRight="@dimen/audio_player_controls_end_button_half_width"
android:layout_marginBottom="@dimen/audio_player_secondary_control_offset"
android:contentDescription="@string/accessibility_queue"
android:focusable="true"
android:scaleType="fitCenter"
......@@ -255,10 +252,9 @@
android:id="@+id/action_button_repeat"
android:layout_width="@dimen/audio_player_controls_end_button_width"
android:layout_height="@dimen/audio_player_controls_end_button_height"
android:layout_below="@id/action_button_next"
android:layout_below="@id/action_button_right_bottom_divider"
android:layout_alignRight="@id/action_button_next"
android:layout_marginRight="@dimen/audio_player_controls_end_button_half_width"
android:layout_marginTop="@dimen/audio_player_secondary_control_offset"
android:contentDescription="@string/accessibility_repeat"
android:focusable="true"
android:scaleType="fitCenter"
......
......@@ -20,7 +20,6 @@
android:layout_height="@dimen/header_bar_height"
android:orientation="horizontal"
android:paddingStart="@dimen/header_bar_padding_left"
android:paddingEnd="@dimen/header_bar_padding_right"
android:elevation="@dimen/action_bar_elevation"
android:background="@android:color/transparent">
......@@ -35,11 +34,9 @@
<ImageView
android:id="@+id/header_bar_add_button"
android:layout_width="@dimen/header_bar_custom_button_width"
android:layout_height="@dimen/header_bar_custom_button_height"
android:layout_height="@dimen/header_bar_button_height"
android:layout_gravity="center_vertical"
android:layout_weight="0"
android:layout_marginStart="@dimen/header_bar_button_padding"
android:layout_marginEnd="@dimen/header_bar_button_padding"
android:background="@drawable/selectable_background"
android:src="@drawable/btn_add_to_playlist"
android:scaleType="centerInside" />
......@@ -47,11 +44,9 @@
<ImageView
android:id="@+id/header_bar_search_button"
android:layout_width="@dimen/header_bar_custom_button_width"
android:layout_height="@dimen/header_bar_custom_button_height"
android:layout_height="@dimen/header_bar_button_height"
android:layout_gravity="center_vertical"
android:layout_weight="0"
android:layout_marginStart="@dimen/header_bar_button_padding"
android:layout_marginEnd="@dimen/header_bar_button_padding"
android:background="@drawable/selectable_background"
android:src="@drawable/ic_action_search"
android:scaleType="centerInside" />
......@@ -59,11 +54,10 @@
<ImageView
android:id="@+id/header_bar_menu_button"
android:layout_width="@dimen/header_bar_menu_button_width"
android:layout_height="@dimen/header_bar_menu_button_height"
android:layout_height="@dimen/header_bar_button_height"
android:layout_gravity="center_vertical"
android:layout_weight="0"
android:scaleType="centerInside"
android:layout_marginStart="@dimen/header_bar_button_padding"
android:background="@drawable/selectable_background"
android:src="@drawable/menu_button_light"/>
</LinearLayout>
......
......@@ -33,8 +33,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@+id/edit_track_list_item_handle"
android:gravity="center_vertical"
android:paddingRight="@dimen/list_item_general_margin" >
android:gravity="center_vertical">
<include layout="@layout/list_item_queue" />
</FrameLayout>
......@@ -45,4 +44,4 @@
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:src="@drawable/dnd_list_divider_light" />
</RelativeLayout>
\ No newline at end of file
</RelativeLayout>
......@@ -59,8 +59,7 @@
<com.cyanogenmod.eleven.widgets.PopupMenuButton
android:id="@+id/popup_menu_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_height="match_parent"
android:paddingRight="@dimen/grid_item_padding_right"
android:src="@drawable/menu_button" />
......
......@@ -21,7 +21,6 @@
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingStart="@dimen/drag_and_drop_width"
android:paddingEnd="@dimen/header_bar_padding_right"
android:background="@color/header_action_bar_color"
android:elevation="@dimen/action_bar_elevation"
android:theme="@android:style/ThemeOverlay.Material.Dark.ActionBar">
......@@ -29,10 +28,9 @@
<ImageView
android:id="@+id/header_bar_up"
android:layout_width="@dimen/header_bar_up_width"
android:layout_height="@dimen/header_bar_up_height"
android:layout_height="@dimen/header_bar_button_height"
android:layout_gravity="center_vertical"
android:layout_weight="0"
android:layout_marginRight="@dimen/header_bar_button_padding"
android:scaleType="centerCrop"
android:background="@drawable/selectable_background"
android:src="@drawable/btn_header_collapse"/>
......@@ -52,11 +50,9 @@
<ImageView
android:id="@+id/header_bar_search_button"
android:layout_width="@dimen/header_bar_custom_button_width"
android:layout_height="@dimen/header_bar_custom_button_height"
android:layout_height="@dimen/header_bar_button_height"
android:layout_gravity="center_vertical"
android:layout_weight="0"
android:layout_marginStart="@dimen/header_bar_button_padding"
android:layout_marginEnd="@dimen/header_bar_button_padding"
android:src="@drawable/ic_action_search"
android:background="@drawable/selectable_background"
android:scaleType="centerInside" />
......@@ -64,11 +60,10 @@
<ImageView
android:id="@+id/header_bar_menu_button"
android:layout_width="@dimen/header_bar_menu_button_width"
android:layout_height="@dimen/header_bar_menu_button_height"
android:layout_height="@dimen/header_bar_button_height"
android:layout_gravity="center_vertical"
android:layout_weight="0"
android:scaleType="centerInside"
android:layout_marginStart="@dimen/header_bar_button_padding"
android:background="@drawable/selectable_background"
android:src="@drawable/menu_button_light"/>
......
......@@ -68,8 +68,8 @@
<com.cyanogenmod.eleven.widgets.PopupMenuButton
android:id="@id/popup_menu_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_width="@dimen/overflow_width"
android:layout_height="@dimen/overflow_height"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:src="@drawable/menu_button_light" />
......
......@@ -61,8 +61,8 @@
<com.cyanogenmod.eleven.widgets.PopupMenuButton
android:id="@id/popup_menu_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_width="@dimen/overflow_width"
android:layout_height="@dimen/overflow_height"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:src="@drawable/menu_button" />
......@@ -74,4 +74,4 @@
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:src="@drawable/inset_list_divider" />
</RelativeLayout>
\ No newline at end of file
</RelativeLayout>
......@@ -29,8 +29,8 @@
<dimen name="standard_padding">16.0dip</dimen>
<!-- overflow menu used on page headers and in list items -->
<dimen name="overflow_height">30.0dip</dimen>
<dimen name="overflow_width">24.0dip</dimen>
<dimen name="overflow_height">48.0dip</dimen>
<dimen name="overflow_width">38.0dip</dimen>
<!-- List and grid view padding -->
<dimen name="list_preferred_item_padding">14.0dip</dimen>
......@@ -112,16 +112,16 @@
<dimen name="playlist_detail_header_bottom_height">40.0dip</dimen>
<!-- Audio player Buttons (play/pause/shuffle/repeat/next/previous)-->
<dimen name="audio_player_controls_end_button_width">34.0dip</dimen>
<dimen name="audio_player_controls_end_button_height">34.0dip</dimen>
<dimen name="audio_player_controls_end_button_half_width">17.0dip</dimen>
<dimen name="audio_player_controls_end_button_width">50.0dip</dimen>
<dimen name="audio_player_controls_end_button_height">50.0dip</dimen>
<dimen name="audio_player_controls_end_button_half_width">25.0dip</dimen>
<dimen name="audio_player_controls_end_button_padding">8.0dip</dimen>
<dimen name="audio_player_controls_main_button_width">100.0dip</dimen>
<dimen name="audio_player_controls_main_button_height">100.0dip</dimen>
<dimen name="audio_player_controls_top_button_width">26.0dip</dimen>
<dimen name="audio_player_controls_top_button_height">30.0dip</dimen>
<dimen name="audio_player_controls_side_width">83.0dip</dimen>
<dimen name="audio_player_control_padding_top">26.0dip</dimen>
<dimen name="audio_player_secondary_control_offset">16dp</dimen>
<!-- Audio player track text settings-->
<dimen name="audio_player_track_name_padding_side">36.0dip</dimen>
......@@ -134,7 +134,6 @@
<dimen name="audio_player_divider_length">86.0dip</dimen>
<dimen name="audio_player_divider_height">1.0dip</dimen>
<dimen name="audio_player_divider_vertical_offset">8.0dip</dimen>
<dimen name="audio_player_divider_horizontal_offset">8.0dip</dimen>
<!-- App Widgets -->
......@@ -175,17 +174,13 @@
<!-- Header Bar -->
<dimen name="header_bar_height">56.0dip</dimen>
<dimen name="header_bar_up_width">30.0dip</dimen>
<dimen name="header_bar_up_height">30.0dip</dimen>
<dimen name="header_bar_menu_button_width">24.0dip</dimen>
<dimen name="header_bar_menu_button_height">30.0dip</dimen>
<dimen name="header_bar_custom_button_width">30.0dip</dimen>
<dimen name="header_bar_custom_button_height">30.0dip</dimen>
<dimen name="header_bar_menu_button_width">38.0dip</dimen>
<dimen name="header_bar_custom_button_width">48.0dip</dimen>
<dimen name="header_bar_button_height">48.0dip</dimen>
<dimen name="header_bar_button_padding_small">5.0dip</dimen>
<dimen name="header_bar_button_padding_large">10.0dip</dimen>
<dimen name="header_bar_padding_left">16.0dp</dimen>
<dimen name="header_bar_padding_right">16.0dp</dimen>
<dimen name="header_bar_button_container_padding">8.0dp</dimen>
<dimen name="header_bar_button_padding">16.0dp</dimen>
<!-- Title Page Indicator Settings -->
<dimen name="tpi_height">48dp</dimen>
......
......@@ -31,6 +31,7 @@ public class PopupMenuButton extends ImageView implements IPopupMenuCallback,
public PopupMenuButton(Context context, AttributeSet attrs) {
super(context, attrs);
setScaleType(ScaleType.CENTER_INSIDE);
setBackground(getResources().getDrawable(R.drawable.selectable_background_light));
setOnClickListener(this);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment