Buttons now use drawable padding (via InsetDrawable) to have some margins between them

This commit is contained in:
serso 2015-02-05 14:39:16 +01:00
parent c85f5a2f25
commit c5748e2d94
26 changed files with 178 additions and 101 deletions

View File

@ -25,5 +25,4 @@
<ripple xmlns:a="http://schemas.android.com/apk/res/android" <ripple xmlns:a="http://schemas.android.com/apk/res/android"
a:color="?attr/colorControlHighlight"> a:color="?attr/colorControlHighlight">
<item a:drawable="@drawable/metro_button_green_shape" /> <item a:drawable="@drawable/metro_button_green_shape" />
</ripple> </ripple>

View File

@ -22,10 +22,16 @@
~ Site: http://se.solovyev.org ~ Site: http://se.solovyev.org
--> -->
<shape xmlns:a="http://schemas.android.com/apk/res/android"> <inset xmlns:a="http://schemas.android.com/apk/res/android"
<gradient a:insetBottom="@dimen/cpp_button_padding"
a:startColor="#000d1f" a:insetLeft="@dimen/cpp_button_padding"
a:insetRight="@dimen/cpp_button_padding"
a:insetTop="@dimen/cpp_button_padding">
<shape>
<gradient
a:angle="90"
a:endColor="#002255" a:endColor="#002255"
a:angle="90"/> a:startColor="#000d1f" />
<corners a:radius="0dp"/> <corners a:radius="0dp" />
</shape> </shape>
</inset>

View File

@ -22,10 +22,16 @@
~ Site: http://se.solovyev.org ~ Site: http://se.solovyev.org
--> -->
<shape xmlns:a="http://schemas.android.com/apk/res/android"> <inset xmlns:a="http://schemas.android.com/apk/res/android"
<gradient a:insetBottom="@dimen/cpp_button_padding"
a:startColor="#001c45" a:insetLeft="@dimen/cpp_button_padding"
a:insetRight="@dimen/cpp_button_padding"
a:insetTop="@dimen/cpp_button_padding">
<shape>
<gradient
a:angle="90"
a:endColor="#003481" a:endColor="#003481"
a:angle="90"/> a:startColor="#001c45" />
<corners a:radius="0dp"/> <corners a:radius="0dp" />
</shape> </shape>
</inset>

View File

@ -20,7 +20,14 @@
~ Site: http://se.solovyev.org ~ Site: http://se.solovyev.org
--> -->
<shape xmlns:a="http://schemas.android.com/apk/res/android"> <inset xmlns:a="http://schemas.android.com/apk/res/android"
<solid a:color="@color/cpp_wizard_button_normal"/> a:insetBottom="@dimen/cpp_button_padding"
<corners a:radius="1dp"/> a:insetLeft="@dimen/cpp_button_padding"
</shape> a:insetRight="@dimen/cpp_button_padding"
a:insetTop="@dimen/cpp_button_padding">
<shape>
<solid a:color="@color/cpp_wizard_button_normal" />
<corners a:radius="@dimen/cpp_button_corner" />
</shape>
</inset>

View File

@ -20,7 +20,13 @@
~ Site: http://se.solovyev.org ~ Site: http://se.solovyev.org
--> -->
<shape xmlns:a="http://schemas.android.com/apk/res/android"> <inset xmlns:a="http://schemas.android.com/apk/res/android"
<solid a:color="@color/cpp_wizard_button_pressed"/> a:insetBottom="@dimen/cpp_button_padding"
<corners a:radius="1dp"/> a:insetLeft="@dimen/cpp_button_padding"
</shape> a:insetRight="@dimen/cpp_button_padding"
a:insetTop="@dimen/cpp_button_padding">
<shape>
<solid a:color="@color/cpp_wizard_button_pressed" />
<corners a:radius="@dimen/cpp_button_corner" />
</shape>
</inset>

View File

@ -22,10 +22,16 @@
~ Site: http://se.solovyev.org ~ Site: http://se.solovyev.org
--> -->
<shape xmlns:a="http://schemas.android.com/apk/res/android"> <inset xmlns:a="http://schemas.android.com/apk/res/android"
<gradient a:insetBottom="@dimen/cpp_button_padding"
a:startColor="#000000" a:insetLeft="@dimen/cpp_button_padding"
a:insetRight="@dimen/cpp_button_padding"
a:insetTop="@dimen/cpp_button_padding">
<shape>
<gradient
a:angle="90"
a:endColor="#333333" a:endColor="#333333"
a:angle="90"/> a:startColor="#000000" />
<corners a:radius="0dp"/> <corners a:radius="0dp" />
</shape> </shape>
</inset>

View File

@ -22,10 +22,16 @@
~ Site: http://se.solovyev.org ~ Site: http://se.solovyev.org
--> -->
<shape xmlns:a="http://schemas.android.com/apk/res/android"> <inset xmlns:a="http://schemas.android.com/apk/res/android"
<gradient a:insetBottom="@dimen/cpp_button_padding"
a:startColor="#071622" a:insetLeft="@dimen/cpp_button_padding"
a:insetRight="@dimen/cpp_button_padding"
a:insetTop="@dimen/cpp_button_padding">
<shape>
<gradient
a:angle="90"
a:endColor="#253541" a:endColor="#253541"
a:angle="90"/> a:startColor="#071622" />
<corners a:radius="0dp"/> <corners a:radius="0dp" />
</shape> </shape>
</inset>

View File

@ -19,8 +19,13 @@
~ Email: se.solovyev@gmail.com ~ Email: se.solovyev@gmail.com
~ Site: http://se.solovyev.org ~ Site: http://se.solovyev.org
--> -->
<inset xmlns:a="http://schemas.android.com/apk/res/android"
<shape xmlns:a="http://schemas.android.com/apk/res/android"> a:insetBottom="@dimen/cpp_button_padding"
<solid a:color="@color/cpp_metro_blue"/> a:insetLeft="@dimen/cpp_button_padding"
<corners a:radius="1dp"/> a:insetRight="@dimen/cpp_button_padding"
</shape> a:insetTop="@dimen/cpp_button_padding">
<shape>
<solid a:color="@color/cpp_metro_blue" />
<corners a:radius="@dimen/cpp_button_corner" />
</shape>
</inset>

View File

@ -20,7 +20,14 @@
~ Site: http://se.solovyev.org ~ Site: http://se.solovyev.org
--> -->
<shape xmlns:a="http://schemas.android.com/apk/res/android"> <inset xmlns:a="http://schemas.android.com/apk/res/android"
<solid a:color="@color/cpp_metro_button"/> a:insetBottom="@dimen/cpp_button_padding"
<corners a:radius="1dp"/> a:insetLeft="@dimen/cpp_button_padding"
</shape> a:insetRight="@dimen/cpp_button_padding"
a:insetTop="@dimen/cpp_button_padding">
<shape>
<solid a:color="@color/cpp_metro_button" />
<corners a:radius="@dimen/cpp_button_corner" />
</shape>
</inset>

View File

@ -20,7 +20,13 @@
~ Site: http://se.solovyev.org ~ Site: http://se.solovyev.org
--> -->
<shape xmlns:a="http://schemas.android.com/apk/res/android"> <inset xmlns:a="http://schemas.android.com/apk/res/android"
<solid a:color="@color/cpp_metro_green"/> a:insetBottom="@dimen/cpp_button_padding"
<corners a:radius="1dp"/> a:insetLeft="@dimen/cpp_button_padding"
</shape> a:insetRight="@dimen/cpp_button_padding"
a:insetTop="@dimen/cpp_button_padding">
<shape>
<solid a:color="@color/cpp_metro_green" />
<corners a:radius="@dimen/cpp_button_corner" />
</shape>
</inset>

View File

@ -20,7 +20,13 @@
~ Site: http://se.solovyev.org ~ Site: http://se.solovyev.org
--> -->
<shape xmlns:a="http://schemas.android.com/apk/res/android"> <inset xmlns:a="http://schemas.android.com/apk/res/android"
<solid a:color="@color/cpp_metro_button_light"/> a:insetBottom="@dimen/cpp_button_padding"
<corners a:radius="1dp"/> a:insetLeft="@dimen/cpp_button_padding"
</shape> a:insetRight="@dimen/cpp_button_padding"
a:insetTop="@dimen/cpp_button_padding">
<shape>
<solid a:color="@color/cpp_metro_button_light" />
<corners a:radius="@dimen/cpp_button_corner" />
</shape>
</inset>

View File

@ -20,7 +20,13 @@
~ Site: http://se.solovyev.org ~ Site: http://se.solovyev.org
--> -->
<shape xmlns:a="http://schemas.android.com/apk/res/android"> <inset xmlns:a="http://schemas.android.com/apk/res/android"
<solid a:color="#ff4d4d4d"/> a:insetBottom="@dimen/cpp_button_padding"
<corners a:radius="1dp"/> a:insetLeft="@dimen/cpp_button_padding"
</shape> a:insetRight="@dimen/cpp_button_padding"
a:insetTop="@dimen/cpp_button_padding">
<shape>
<solid a:color="#ff4d4d4d" />
<corners a:radius="@dimen/cpp_button_corner" />
</shape>
</inset>

View File

@ -20,7 +20,13 @@
~ Site: http://se.solovyev.org ~ Site: http://se.solovyev.org
--> -->
<shape xmlns:a="http://schemas.android.com/apk/res/android"> <inset xmlns:a="http://schemas.android.com/apk/res/android"
<solid a:color="@color/cpp_metro_purple"/> a:insetBottom="@dimen/cpp_button_padding"
<corners a:radius="1dp"/> a:insetLeft="@dimen/cpp_button_padding"
</shape> a:insetRight="@dimen/cpp_button_padding"
a:insetTop="@dimen/cpp_button_padding">
<shape>
<solid a:color="@color/cpp_metro_purple" />
<corners a:radius="@dimen/cpp_button_corner" />
</shape>
</inset>

View File

@ -22,5 +22,5 @@
<shape xmlns:a="http://schemas.android.com/apk/res/android"> <shape xmlns:a="http://schemas.android.com/apk/res/android">
<solid a:color="@color/cpp_pane_background"/> <solid a:color="@color/cpp_pane_background"/>
<corners a:radius="1dp"/> <corners a:radius="@dimen/cpp_button_corner"/>
</shape> </shape>

View File

@ -22,10 +22,16 @@
~ Site: http://se.solovyev.org ~ Site: http://se.solovyev.org
--> -->
<shape xmlns:a="http://schemas.android.com/apk/res/android"> <inset xmlns:a="http://schemas.android.com/apk/res/android"
<gradient a:insetBottom="@dimen/cpp_button_padding"
a:startColor="#2b0325" a:insetLeft="@dimen/cpp_button_padding"
a:insetRight="@dimen/cpp_button_padding"
a:insetTop="@dimen/cpp_button_padding">
<shape>
<gradient
a:angle="90"
a:endColor="#4f1c47" a:endColor="#4f1c47"
a:angle="90"/> a:startColor="#2b0325" />
<corners a:radius="0dp"/> <corners a:radius="0dp" />
</shape> </shape>
</inset>

View File

@ -22,10 +22,16 @@
~ Site: http://se.solovyev.org ~ Site: http://se.solovyev.org
--> -->
<shape xmlns:a="http://schemas.android.com/apk/res/android"> <inset xmlns:a="http://schemas.android.com/apk/res/android"
<gradient a:insetBottom="@dimen/cpp_button_padding"
a:startColor="#520546" a:insetLeft="@dimen/cpp_button_padding"
a:insetRight="@dimen/cpp_button_padding"
a:insetTop="@dimen/cpp_button_padding">
<shape>
<gradient
a:angle="90"
a:endColor="#8a307c" a:endColor="#8a307c"
a:angle="90"/> a:startColor="#520546" />
<corners a:radius="0dp"/> <corners a:radius="0dp" />
</shape> </shape>
</inset>

View File

@ -31,44 +31,43 @@
a:id="@+id/editorContainer" a:id="@+id/editorContainer"
a:layout_weight="2" a:layout_weight="2"
a:layout_width="match_parent" a:layout_width="match_parent"
a:layout_height="0dp"/> a:layout_height="0dp"
a:orientation="horizontal"/>
<LinearLayout <LinearLayout
a:layout_weight="1" a:layout_weight="1"
a:layout_width="match_parent" a:layout_width="match_parent"
a:layout_height="0dp"> a:layout_height="0dp"
a:baselineAligned="false"
a:orientation="horizontal">
<include <include
layout="@layout/cpp_drag_button_left" layout="@layout/cpp_drag_button_left"
a:layout_margin="@dimen/cpp_button_margin"
a:layout_width="0dp" a:layout_width="0dp"
a:layout_height="match_parent" a:layout_height="match_parent"
a:layout_weight="1"/> a:layout_weight="1"/>
<include <include
layout="@layout/cpp_app_button_erase" layout="@layout/cpp_app_button_erase"
a:layout_margin="@dimen/cpp_button_margin"
a:layout_width="0dp" a:layout_width="0dp"
a:layout_height="match_parent" a:layout_height="match_parent"
a:layout_weight="1"/> a:layout_weight="1"/>
<LinearLayout <LinearLayout
a:id="@+id/displayContainer" a:id="@+id/displayContainer"
a:layout_height="match_parent" a:layout_width="0dp"
a:layout_width="0dp" a:layout_height="match_parent"
a:layout_weight="4" a:layout_weight="4"
a:layout_margin="@dimen/cpp_display_margin_land"/> a:orientation="horizontal" />
<include <include
layout="@layout/cpp_drag_button_clear" layout="@layout/cpp_drag_button_clear"
a:layout_margin="@dimen/cpp_button_margin"
a:layout_width="0dp" a:layout_width="0dp"
a:layout_height="match_parent" a:layout_height="match_parent"
a:layout_weight="1"/> a:layout_weight="1"/>
<include <include
layout="@layout/cpp_drag_button_right" layout="@layout/cpp_drag_button_right"
a:layout_margin="@dimen/cpp_button_margin"
a:layout_width="0dp" a:layout_width="0dp"
a:layout_height="match_parent" a:layout_height="match_parent"
a:layout_weight="1"/> a:layout_weight="1"/>
@ -79,7 +78,8 @@
a:id="@+id/keyboardContainer" a:id="@+id/keyboardContainer"
a:layout_weight="3" a:layout_weight="3"
a:layout_width="match_parent" a:layout_width="match_parent"
a:layout_height="0dp"/> a:layout_height="0dp"
a:orientation="horizontal"/>
</LinearLayout> </LinearLayout>

View File

@ -40,14 +40,12 @@
<include <include
layout="@layout/cpp_drag_button_left" layout="@layout/cpp_drag_button_left"
a:layout_margin="@dimen/cpp_button_margin"
a:layout_width="0dp" a:layout_width="0dp"
a:layout_height="match_parent" a:layout_height="match_parent"
a:layout_weight="1"/> a:layout_weight="1"/>
<include <include
layout="@layout/cpp_app_button_erase" layout="@layout/cpp_app_button_erase"
a:layout_margin="@dimen/cpp_button_margin"
a:layout_width="0dp" a:layout_width="0dp"
a:layout_height="match_parent" a:layout_height="match_parent"
a:layout_weight="1"/> a:layout_weight="1"/>
@ -56,19 +54,16 @@
a:id="@+id/displayContainer" a:id="@+id/displayContainer"
a:layout_height="match_parent" a:layout_height="match_parent"
a:layout_width="0dp" a:layout_width="0dp"
a:layout_weight="4" a:layout_weight="4"/>
a:layout_margin="@dimen/cpp_display_margin_land"/>
<include <include
layout="@layout/cpp_drag_button_clear" layout="@layout/cpp_drag_button_clear"
a:layout_margin="@dimen/cpp_button_margin"
a:layout_width="0dp" a:layout_width="0dp"
a:layout_height="match_parent" a:layout_height="match_parent"
a:layout_weight="1"/> a:layout_weight="1"/>
<include <include
layout="@layout/cpp_drag_button_right" layout="@layout/cpp_drag_button_right"
a:layout_margin="@dimen/cpp_button_margin"
a:layout_width="0dp" a:layout_width="0dp"
a:layout_height="match_parent" a:layout_height="match_parent"
a:layout_weight="1"/> a:layout_weight="1"/>

View File

@ -42,7 +42,6 @@
<include <include
layout="@layout/cpp_drag_button_equals" layout="@layout/cpp_drag_button_equals"
a:layout_margin="@dimen/cpp_button_margin"
a:layout_weight="1" a:layout_weight="1"
a:layout_width="0dp" a:layout_width="0dp"
a:layout_height="match_parent"/> a:layout_height="match_parent"/>

View File

@ -33,7 +33,8 @@
a:id="@+id/editorContainer" a:id="@+id/editorContainer"
a:layout_weight="2" a:layout_weight="2"
a:layout_width="match_parent" a:layout_width="match_parent"
a:layout_height="0dp"/> a:layout_height="0dp"
a:orientation="horizontal" />
<LinearLayout <LinearLayout
a:layout_weight="1" a:layout_weight="1"
@ -42,7 +43,6 @@
<include <include
layout="@layout/cpp_drag_button_equals" layout="@layout/cpp_drag_button_equals"
a:layout_margin="@dimen/cpp_button_margin"
a:layout_weight="1" a:layout_weight="1"
a:layout_width="0dp" a:layout_width="0dp"
a:layout_height="match_parent"/> a:layout_height="match_parent"/>
@ -51,7 +51,8 @@
a:id="@+id/displayContainer" a:id="@+id/displayContainer"
a:layout_weight="4" a:layout_weight="4"
a:layout_width="0dp" a:layout_width="0dp"
a:layout_height="match_parent"/> a:layout_height="match_parent"
a:orientation="horizontal" />
</LinearLayout> </LinearLayout>
@ -59,6 +60,7 @@
a:id="@+id/keyboardContainer" a:id="@+id/keyboardContainer"
a:layout_weight="5" a:layout_weight="5"
a:layout_width="match_parent" a:layout_width="match_parent"
a:layout_height="0dp"/> a:layout_height="0dp"
a:orientation="vertical" />
</LinearLayout> </LinearLayout>

View File

@ -26,7 +26,6 @@
<include <include
layout="@layout/cpp_simple_button_equals" layout="@layout/cpp_simple_button_equals"
a:layout_margin="@dimen/cpp_button_margin"
a:layout_weight="1" a:layout_weight="1"
a:layout_width="0dp" a:layout_width="0dp"
a:layout_height="match_parent"/> a:layout_height="match_parent"/>

View File

@ -19,7 +19,6 @@
<include <include
layout="@layout/cpp_simple_button_equals" layout="@layout/cpp_simple_button_equals"
a:layout_margin="@dimen/cpp_button_margin"
a:layout_weight="1" a:layout_weight="1"
a:layout_width="0dp" a:layout_width="0dp"
a:layout_height="match_parent"/> a:layout_height="match_parent"/>

View File

@ -19,7 +19,6 @@
<include <include
layout="@layout/cpp_simple_button_equals" layout="@layout/cpp_simple_button_equals"
a:layout_margin="@dimen/cpp_button_margin"
a:layout_weight="1" a:layout_weight="1"
a:layout_width="0dp" a:layout_width="0dp"
a:layout_height="match_parent" /> a:layout_height="match_parent" />

View File

@ -30,7 +30,6 @@
<include <include
layout="@layout/cpp_simple_button_equals" layout="@layout/cpp_simple_button_equals"
a:layout_margin="@dimen/cpp_button_margin"
a:layout_weight="1" a:layout_weight="1"
a:layout_width="0dp" a:layout_width="0dp"
a:layout_height="match_parent" /> a:layout_height="match_parent" />

View File

@ -7,8 +7,8 @@
<dimen name="cpp_widget_margin">6dp</dimen> <dimen name="cpp_widget_margin">6dp</dimen>
<dimen name="min_expanded_height_lock_screen">300dp</dimen> <dimen name="min_expanded_height_lock_screen">300dp</dimen>
<dimen name="cpp_text_size">20sp</dimen> <dimen name="cpp_text_size">20sp</dimen>
<dimen name="cpp_button_margin">0.5dp</dimen> <dimen name="cpp_button_padding">1px</dimen>
<dimen name="cpp_display_margin_land">2.5dp</dimen> <dimen name="cpp_button_corner">1dp</dimen>
<dimen name="cpp_fragment_text_size">15sp</dimen> <dimen name="cpp_fragment_text_size">15sp</dimen>
<dimen name="cpp_fragment_title_text_size">20sp</dimen> <dimen name="cpp_fragment_title_text_size">20sp</dimen>

View File

@ -55,7 +55,8 @@
<item name="android:layout_weight">1</item> <item name="android:layout_weight">1</item>
<item name="android:focusable">true</item> <item name="android:focusable">true</item>
<item name="android:background">@drawable/metro_button_dark</item> <item name="android:background">@drawable/metro_button_dark</item>
<item name="android:layout_margin">@dimen/cpp_button_margin</item> <item name="android:layout_margin">0dp</item>
<item name="android:padding">@dimen/cpp_button_padding</item>
<item name="android:textSize">@dimen/cpp_keyboard_button_text_size</item> <item name="android:textSize">@dimen/cpp_keyboard_button_text_size</item>
<item name="android:textColor">@color/cpp_button_text</item> <item name="android:textColor">@color/cpp_button_text</item>
<item name="android:scaleType">centerInside</item> <item name="android:scaleType">centerInside</item>