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"
a:color="?attr/colorControlHighlight">
<item a:drawable="@drawable/metro_button_green_shape" />
</ripple>

View File

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

View File

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

View File

@ -20,7 +20,14 @@
~ Site: http://se.solovyev.org
-->
<shape xmlns:a="http://schemas.android.com/apk/res/android">
<solid a:color="@color/cpp_wizard_button_normal"/>
<corners a:radius="1dp"/>
</shape>
<inset xmlns:a="http://schemas.android.com/apk/res/android"
a:insetBottom="@dimen/cpp_button_padding"
a:insetLeft="@dimen/cpp_button_padding"
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
-->
<shape xmlns:a="http://schemas.android.com/apk/res/android">
<solid a:color="@color/cpp_wizard_button_pressed"/>
<corners a:radius="1dp"/>
</shape>
<inset xmlns:a="http://schemas.android.com/apk/res/android"
a:insetBottom="@dimen/cpp_button_padding"
a:insetLeft="@dimen/cpp_button_padding"
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
-->
<shape xmlns:a="http://schemas.android.com/apk/res/android">
<gradient
a:startColor="#000000"
<inset xmlns:a="http://schemas.android.com/apk/res/android"
a:insetBottom="@dimen/cpp_button_padding"
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:angle="90"/>
<corners a:radius="0dp"/>
</shape>
a:startColor="#000000" />
<corners a:radius="0dp" />
</shape>
</inset>

View File

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

View File

@ -19,8 +19,13 @@
~ Email: se.solovyev@gmail.com
~ Site: http://se.solovyev.org
-->
<shape xmlns:a="http://schemas.android.com/apk/res/android">
<solid a:color="@color/cpp_metro_blue"/>
<corners a:radius="1dp"/>
</shape>
<inset xmlns:a="http://schemas.android.com/apk/res/android"
a:insetBottom="@dimen/cpp_button_padding"
a:insetLeft="@dimen/cpp_button_padding"
a:insetRight="@dimen/cpp_button_padding"
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
-->
<shape xmlns:a="http://schemas.android.com/apk/res/android">
<solid a:color="@color/cpp_metro_button"/>
<corners a:radius="1dp"/>
</shape>
<inset xmlns:a="http://schemas.android.com/apk/res/android"
a:insetBottom="@dimen/cpp_button_padding"
a:insetLeft="@dimen/cpp_button_padding"
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
-->
<shape xmlns:a="http://schemas.android.com/apk/res/android">
<solid a:color="@color/cpp_metro_green"/>
<corners a:radius="1dp"/>
</shape>
<inset xmlns:a="http://schemas.android.com/apk/res/android"
a:insetBottom="@dimen/cpp_button_padding"
a:insetLeft="@dimen/cpp_button_padding"
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
-->
<shape xmlns:a="http://schemas.android.com/apk/res/android">
<solid a:color="@color/cpp_metro_button_light"/>
<corners a:radius="1dp"/>
</shape>
<inset xmlns:a="http://schemas.android.com/apk/res/android"
a:insetBottom="@dimen/cpp_button_padding"
a:insetLeft="@dimen/cpp_button_padding"
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
-->
<shape xmlns:a="http://schemas.android.com/apk/res/android">
<solid a:color="#ff4d4d4d"/>
<corners a:radius="1dp"/>
</shape>
<inset xmlns:a="http://schemas.android.com/apk/res/android"
a:insetBottom="@dimen/cpp_button_padding"
a:insetLeft="@dimen/cpp_button_padding"
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
-->
<shape xmlns:a="http://schemas.android.com/apk/res/android">
<solid a:color="@color/cpp_metro_purple"/>
<corners a:radius="1dp"/>
</shape>
<inset xmlns:a="http://schemas.android.com/apk/res/android"
a:insetBottom="@dimen/cpp_button_padding"
a:insetLeft="@dimen/cpp_button_padding"
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">
<solid a:color="@color/cpp_pane_background"/>
<corners a:radius="1dp"/>
<corners a:radius="@dimen/cpp_button_corner"/>
</shape>

View File

@ -22,10 +22,16 @@
~ Site: http://se.solovyev.org
-->
<shape xmlns:a="http://schemas.android.com/apk/res/android">
<gradient
a:startColor="#2b0325"
<inset xmlns:a="http://schemas.android.com/apk/res/android"
a:insetBottom="@dimen/cpp_button_padding"
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:angle="90"/>
<corners a:radius="0dp"/>
</shape>
a:startColor="#2b0325" />
<corners a:radius="0dp" />
</shape>
</inset>

View File

@ -22,10 +22,16 @@
~ Site: http://se.solovyev.org
-->
<shape xmlns:a="http://schemas.android.com/apk/res/android">
<gradient
a:startColor="#520546"
<inset xmlns:a="http://schemas.android.com/apk/res/android"
a:insetBottom="@dimen/cpp_button_padding"
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:angle="90"/>
<corners a:radius="0dp"/>
</shape>
a:startColor="#520546" />
<corners a:radius="0dp" />
</shape>
</inset>

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -7,8 +7,8 @@
<dimen name="cpp_widget_margin">6dp</dimen>
<dimen name="min_expanded_height_lock_screen">300dp</dimen>
<dimen name="cpp_text_size">20sp</dimen>
<dimen name="cpp_button_margin">0.5dp</dimen>
<dimen name="cpp_display_margin_land">2.5dp</dimen>
<dimen name="cpp_button_padding">1px</dimen>
<dimen name="cpp_button_corner">1dp</dimen>
<dimen name="cpp_fragment_text_size">15sp</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:focusable">true</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:textColor">@color/cpp_button_text</item>
<item name="android:scaleType">centerInside</item>