support for different display densities

This commit is contained in:
serso 2011-10-22 14:14:17 +04:00
parent c554cfc9f3
commit 3ca76ddaae
28 changed files with 311 additions and 105 deletions

BIN
res/drawable-hdpi/copy.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

BIN
res/drawable-hdpi/heart.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

BIN
res/drawable-hdpi/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

BIN
res/drawable-hdpi/paste.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

BIN
res/drawable-ldpi/copy.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

BIN
res/drawable-ldpi/heart.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

BIN
res/drawable-ldpi/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

BIN
res/drawable-ldpi/paste.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

BIN
res/drawable-mdpi/copy.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

BIN
res/drawable-mdpi/heart.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

BIN
res/drawable-mdpi/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

BIN
res/drawable-mdpi/paste.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@ -12,6 +12,5 @@
calc:textUp="@string/c_undo"
calc:textDown="@string/c_redo"
style="?controlButtonStyle"
a:textSize="18dp"
a:textStyle="bold"
a:onClick="historyButtonClickHandler"/>

View File

@ -14,16 +14,11 @@
<TextView a:id="@+id/history_time"
a:layout_width="fill_parent"
a:layout_height="fill_parent"
a:textColor="@android:color/white"
a:paddingLeft="6dp"
a:paddingRight="6dp"
a:textStyle="bold"/>
style="@style/history_time"/>
<TextView a:id="@+id/history_item"
a:layout_width="fill_parent"
a:layout_height="fill_parent"
a:paddingBottom="6dp"
a:paddingLeft="6dp"
a:paddingRight="6dp"/>
style="@style/history_item"/>
</LinearLayout>

View File

@ -19,13 +19,7 @@
<TextView a:id="@+id/var_text"
a:layout_width="fill_parent"
a:layout_height="fill_parent"
a:textSize="20dp"
a:textColor="@android:color/white"
a:paddingBottom="3dp"
a:paddingLeft="6dp"
a:paddingRight="6dp"
a:paddingTop="6dp"
a:textStyle="bold">
style="@style/var_text">
</TextView>
</LinearLayout>
@ -33,10 +27,7 @@
<TextView a:id="@+id/var_description"
a:layout_width="fill_parent"
a:layout_height="fill_parent"
a:paddingBottom="6dp"
a:paddingLeft="6dp"
a:paddingRight="6dp"
a:paddingTop="0dp">
style="@style/var_description">
</TextView>
</LinearLayout>

View File

@ -21,16 +21,18 @@
<TextView a:layout_height="fill_parent"
a:layout_width="wrap_content"
a:padding="6dp"
style="@style/default_text_size"
a:text="@string/c_var_name"/>
<EditText a:id="@+id/var_edit_name"
a:layout_width="fill_parent"
a:layout_height="wrap_content"
a:textSize="20dp">
style="@style/default_text_size">
</EditText>
<TextView a:layout_height="fill_parent"
a:layout_width="wrap_content"
style="@style/default_text_size"
a:padding="6dp"
a:text="@string/c_var_value"/>
@ -38,18 +40,19 @@
a:layout_width="fill_parent"
a:layout_height="wrap_content"
a:inputType="numberDecimal"
a:textSize="20dp">
style="@style/default_text_size">
</EditText>
<TextView a:layout_height="fill_parent"
a:layout_width="wrap_content"
a:padding="6dp"
style="@style/default_text_size"
a:text="@string/c_var_description"/>
<EditText a:id="@+id/var_edit_description"
a:layout_width="fill_parent"
a:layout_height="wrap_content"
a:textSize="20dp">
style="@style/default_text_size">
</EditText>
</LinearLayout>

View File

@ -22,8 +22,7 @@
a:layout_height="wrap_content"
a:layout_gravity="center_horizontal"
a:text="@string/c_add"
a:paddingLeft="40dp"
a:paddingRight="40dp"
style="@style/add_var_button"
a:onClick="addVarButtonClickHandler"/>
</LinearLayout>

View File

@ -0,0 +1,44 @@
<!--
~ Copyright (c) 2009-2011. Created by serso aka se.solovyev.
~ For more information, please, contact se.solovyev@gmail.com
~ or visit http://se.solovyev.org
-->
<resources>
<style name="default_text_size">
<item name="android:textSize">20dp</item>
</style>
<style name="button_style_parent" parent="default_text_size">
<item name="android:textColor">@color/button_text_color</item>
</style>
<style name="display_style_parent" parent="default_text">
<item name="android:textSize">25dp</item>
<item name="android:padding">5dp</item>
</style>
<style name="editor_style_parent" parent="default_text">
<item name="android:textSize">25dp</item>
<item name="android:padding">5dp</item>
</style>
<style name="about_style_parent" parent="default_text">
<item name="android:textSize">15dp</item>
<item name="android:padding">5dp</item>
</style>
<style name="var_text_parent" parent="default_text_size">
</style>
<style name="var_description_parent">
<item name="android:textSize">15dp</item>
</style>
<style name="add_var_button_parent">
<item name="android:paddingLeft">40dp</item>
<item name="android:paddingRight">40dp</item>
</style>
</resources>

View File

@ -0,0 +1,44 @@
<!--
~ Copyright (c) 2009-2011. Created by serso aka se.solovyev.
~ For more information, please, contact se.solovyev@gmail.com
~ or visit http://se.solovyev.org
-->
<resources>
<style name="button_style_parent">
<item name="android:textSize">40dp</item>
<item name="android:textColor">@color/button_text_color</item>
</style>
<style name="display_style_parent" parent="default_text">
<item name="android:textSize">50dp</item>
<item name="android:padding">10dp</item>
</style>
<style name="editor_style_parent" parent="default_text">
<item name="android:textSize">50dp</item>
<item name="android:padding">10dp</item>
</style>
<style name="about_style_parent" parent="default_text">
<item name="android:textSize">30dp</item>
<item name="android:padding">10dp</item>
</style>
<style name="var_text_parent">
<item name="android:textSize">40dp</item>
</style>
<style name="var_description_parent">
<item name="android:textSize">30dp</item>
</style>
<style name="add_var_button_parent">
<item name="android:paddingLeft">80dp</item>
<item name="android:paddingRight">80dp</item>
</style>
</resources>

View File

@ -0,0 +1,43 @@
<!--
~ Copyright (c) 2009-2011. Created by serso aka se.solovyev.
~ For more information, please, contact se.solovyev@gmail.com
~ or visit http://se.solovyev.org
-->
<resources>
<style name="button_style_parent">
<item name="android:textSize">30dp</item>
<item name="android:textColor">@color/button_text_color</item>
</style>
<style name="display_style_parent" parent="default_text">
<item name="android:textSize">37dp</item>
<item name="android:padding">7dp</item>
</style>
<style name="editor_style_parent" parent="default_text">
<item name="android:textSize">37dp</item>
<item name="android:padding">7dp</item>
</style>
<style name="about_style_parent" parent="default_text">
<item name="android:textSize">23dp</item>
<item name="android:padding">7dp</item>
</style>
<style name="var_text_parent">
<item name="android:textSize">30dp</item>
</style>
<style name="var_description_parent">
<item name="android:textSize">23dp</item>
</style>
<style name="add_var_button_parent">
<item name="android:paddingLeft">60dp</item>
<item name="android:paddingRight">60dp</item>
</style>
</resources>

View File

@ -1,5 +1,12 @@
<!--
~ Copyright (c) 2009-2011. Created by serso aka se.solovyev.
~ For more information, please, contact se.solovyev@gmail.com
~ or visit http://se.solovyev.org
-->
<resources>
<color name="magic_flame">#00ffffff</color>
<color name="button_text_color">#ffffffff</color>
<color name="text_color">#ffffffff</color>
<color name="magic_flame">#00ffffff</color>
<color name="button_text_color">#ffffffff</color>
<color name="default_text_color">#ffffffff</color>
<color name="default_background">#ff000000</color>
</resources>

View File

@ -0,0 +1,15 @@
<!--
~ Copyright (c) 2009-2011. Created by serso aka se.solovyev.
~ For more information, please, contact se.solovyev@gmail.com
~ or visit http://se.solovyev.org
-->
<resources>
<style name="history_time" parent="var_text">
</style>
<style name="history_item" parent="var_description">
</style>
</resources>

View File

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (c) 2009-2011. Created by serso aka se.solovyev.
~ For more information, please, contact se.solovyev@gmail.com
~ or visit http://se.solovyev.org
-->
<resources>
<style name="var_text" parent="var_text_parent">
<item name="android:paddingTop">6dp</item>
<item name="android:paddingLeft">6dp</item>
<item name="android:paddingRight">6dp</item>
<item name="android:paddingBottom">3dp</item>
<item name="android:textStyle">bold</item>
<item name="android:textColor">@android:color/white</item>
</style>
<style name="var_description" parent="var_description_parent">
<item name="android:paddingTop">0dp</item>
<item name="android:paddingLeft">6dp</item>
<item name="android:paddingRight">6dp</item>
<item name="android:paddingBottom">6dp</item>
<item name="android:textColor">#bebebe</item>
</style>
<style name="add_var_button" parent="add_var_button_parent">
</style>
</resources>

View File

@ -0,0 +1,95 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (c) 2009-2011. Created by serso aka se.solovyev.
~ For more information, please, contact se.solovyev@gmail.com
~ or visit http://se.solovyev.org
-->
<resources>
<style name="button_style" parent="button_style_parent">
<item name="android:layout_width">fill_parent</item>
<item name="android:layout_height">fill_parent</item>
<item name="android:layout_weight">1</item>
<item name="android:focusable">true</item>
<item name="android:background">@drawable/button</item>
<item name="android:layout_marginLeft">1dp</item>
<item name="android:layout_marginBottom">1dp</item>
</style>
<style name="default_digit_button_style" parent="button_style">
<item name="android:background">@drawable/blue_button</item>
</style>
<style name="violet_digit_button_style" parent="button_style">
<item name="android:background">@drawable/violet_button</item>
</style>
<style name="light_blue_digit_button_style" parent="button_style">
<item name="android:background">@drawable/light_blue_button</item>
</style>
<style name="default_control_button_style" parent="button_style"/>
<style name="violet_control_button_style" parent="button_style">
<item name="android:background">@drawable/dark_violet_button</item>
</style>
<style name="light_blue_control_button_style" parent="button_style">
<item name="android:background">@drawable/dark_blue_button</item>
</style>
<style name="default_control_image_button_style" parent="default_control_button_style">
<item name="android:padding">6dp</item>
</style>
<style name="violet_control_image_button_style" parent="violet_control_button_style">
<item name="android:padding">6dp</item>
</style>
<style name="light_blue_control_image_button_style" parent="light_blue_control_button_style">
<item name="android:padding">6dp</item>
</style>
<style name="editor_style" parent="editor_style_parent">
<item name="android:gravity">left|top</item>
<item name="android:layout_width">fill_parent</item>
<item name="android:layout_height">fill_parent</item>
</style>
<style name="display_style" parent="display_style_parent">
<item name="android:gravity">right|center_vertical</item>
<item name="android:layout_width">fill_parent</item>
<item name="android:layout_height">fill_parent</item>
</style>
<style name="about_style" parent="about_style_parent">
<item name="android:gravity">center</item>
<item name="android:layout_width">fill_parent</item>
<item name="android:layout_height">fill_parent</item>
</style>
<style name="default_theme">
<item name="digitButtonStyle">@style/default_digit_button_style</item>
<item name="controlButtonStyle">@style/default_control_button_style</item>
<item name="controlImageButtonStyle">@style/default_control_image_button_style</item>
</style>
<style name="violet_theme">
<item name="digitButtonStyle">@style/violet_digit_button_style</item>
<item name="controlButtonStyle">@style/violet_control_button_style</item>
<item name="controlImageButtonStyle">@style/violet_control_image_button_style</item>
</style>
<style name="light_blue_theme">
<item name="digitButtonStyle">@style/light_blue_digit_button_style</item>
<item name="controlButtonStyle">@style/light_blue_control_button_style</item>
<item name="controlImageButtonStyle">@style/light_blue_control_image_button_style</item>
</style>
<style name="default_text">
<item name="android:background">@color/default_background</item>
<item name="android:textColor">@color/default_text_color</item>
</style>
</resources>

View File

@ -1,103 +1,44 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (c) 2009-2011. Created by serso aka se.solovyev.
~ For more information, please, contact se.solovyev@gmail.com
~ or visit http://se.solovyev.org
-->
<resources>
<style name="editTextInputStyle">
<item name="android:layout_width">fill_parent</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:typeface">monospace</item>
</style>
<style name="button_style">
<item name="android:layout_width">fill_parent</item>
<item name="android:layout_height">fill_parent</item>
<item name="android:layout_weight">1</item>
<item name="android:focusable">true</item>
<style name="default_text_size">
<item name="android:textSize">20dp</item>
<item name="android:background">@drawable/button</item>
<item name="android:layout_marginLeft">1dp</item>
<item name="android:layout_marginBottom">1dp</item>
</style>
<style name="default_digit_button_style" parent="button_style">
<item name="android:background">@drawable/blue_button</item>
<style name="button_style_parent" parent="default_text_size">
<item name="android:textColor">@color/button_text_color</item>
</style>
<style name="violet_digit_button_style" parent="button_style">
<item name="android:background">@drawable/violet_button</item>
</style>
<style name="light_blue_digit_button_style" parent="button_style">
<item name="android:background">@drawable/light_blue_button</item>
</style>
<style name="default_control_button_style" parent="button_style"/>
<style name="violet_control_button_style" parent="button_style">
<item name="android:background">@drawable/dark_violet_button</item>
</style>
<style name="light_blue_control_button_style" parent="button_style">
<item name="android:background">@drawable/dark_blue_button</item>
</style>
<style name="default_control_image_button_style" parent="default_control_button_style">
<item name="android:padding">6dp</item>
</style>
<style name="violet_control_image_button_style" parent="violet_control_button_style">
<item name="android:padding">6dp</item>
</style>
<style name="light_blue_control_image_button_style" parent="light_blue_control_button_style">
<item name="android:padding">6dp</item>
</style>
<style name="editor_style">
<style name="display_style_parent" parent="default_text">
<item name="android:textSize">25dp</item>
<item name="android:background">#000000</item>
<item name="android:textColor">@color/text_color</item>
<item name="android:gravity">left|top</item>
<item name="android:padding">5dp</item>
<item name="android:layout_width">fill_parent</item>
<item name="android:layout_height">fill_parent</item>
</style>
<style name="display_style">
<style name="editor_style_parent" parent="default_text">
<item name="android:textSize">25dp</item>
<item name="android:background">#000000</item>
<item name="android:textColor">@color/text_color</item>
<item name="android:gravity">right|center_vertical</item>
<item name="android:padding">5dp</item>
<item name="android:layout_width">fill_parent</item>
<item name="android:layout_height">fill_parent</item>
</style>
<style name="about_style">
<style name="about_style_parent" parent="default_text">
<item name="android:textSize">15dp</item>
<item name="android:background">#000000</item>
<item name="android:textColor">@color/text_color</item>
<item name="android:gravity">center</item>
<item name="android:padding">5dp</item>
<item name="android:layout_width">fill_parent</item>
<item name="android:layout_height">fill_parent</item>
</style>
<style name="default_theme">
<item name="digitButtonStyle">@style/default_digit_button_style</item>
<item name="controlButtonStyle">@style/default_control_button_style</item>
<item name="controlImageButtonStyle">@style/default_control_image_button_style</item>
<style name="var_text_parent" parent="default_text_size">
</style>
<style name="violet_theme">
<item name="digitButtonStyle">@style/violet_digit_button_style</item>
<item name="controlButtonStyle">@style/violet_control_button_style</item>
<item name="controlImageButtonStyle">@style/violet_control_image_button_style</item>
<style name="var_description_parent">
<item name="android:textSize">15dp</item>
</style>
<style name="light_blue_theme">
<item name="digitButtonStyle">@style/light_blue_digit_button_style</item>
<item name="controlButtonStyle">@style/light_blue_control_button_style</item>
<item name="controlImageButtonStyle">@style/light_blue_control_image_button_style</item>
<style name="add_var_button_parent">
<item name="android:paddingLeft">40dp</item>
<item name="android:paddingRight">40dp</item>
</style>
</resources>