From f3979fef897f645e9df913dda44fdd1bee42cebb Mon Sep 17 00:00:00 2001 From: Alexey Pelykh Date: Thu, 5 Feb 2015 14:56:46 +0200 Subject: [PATCH 01/26] Plugins --- .gitignore | 3 ++ .../res/color/switch_ex_button_text_dark.xml | 6 ++++ .../res/color/switch_ex_button_text_light.xml | 5 +++ OsmAnd/res/color/switch_ex_text_color.xml | 19 ------------ OsmAnd/res/drawable-large/Thumbs.db | Bin 7680 -> 0 bytes .../drawable/bg_plugin_logo_disabled_dark.xml | 7 +++++ .../bg_plugin_logo_disabled_light.xml | 7 +++++ ...in_logo.xml => bg_plugin_logo_enabled.xml} | 0 OsmAnd/res/drawable/get_button_background.xml | 15 +++++++++ .../res/drawable/ic_plugin_options_dark.xml | 6 ++-- .../res/drawable/ic_plugin_options_light.xml | 6 ++-- ...ound.xml => switch_ex_background_dark.xml} | 4 +-- .../drawable/switch_ex_background_light.xml | 29 ++++++++++++++++++ OsmAnd/res/layout/dash_plugin_item.xml | 6 ++-- OsmAnd/res/layout/plugin.xml | 15 +++++---- OsmAnd/res/layout/plugins_list_item.xml | 14 ++++----- OsmAnd/res/values/attrs.xml | 3 ++ OsmAnd/res/values/colors.xml | 2 ++ OsmAnd/res/values/styles.xml | 6 ++++ .../plus/activities/PluginsActivity.java | 19 ++++++++++-- .../plus/dashboard/DashPluginsFragment.java | 13 +------- 21 files changed, 123 insertions(+), 62 deletions(-) create mode 100644 OsmAnd/res/color/switch_ex_button_text_dark.xml create mode 100644 OsmAnd/res/color/switch_ex_button_text_light.xml delete mode 100644 OsmAnd/res/color/switch_ex_text_color.xml delete mode 100644 OsmAnd/res/drawable-large/Thumbs.db create mode 100644 OsmAnd/res/drawable/bg_plugin_logo_disabled_dark.xml create mode 100644 OsmAnd/res/drawable/bg_plugin_logo_disabled_light.xml rename OsmAnd/res/drawable/{bg_plugin_logo.xml => bg_plugin_logo_enabled.xml} (100%) create mode 100644 OsmAnd/res/drawable/get_button_background.xml rename OsmAnd/res/drawable/{switch_ex_background.xml => switch_ex_background_dark.xml} (84%) create mode 100644 OsmAnd/res/drawable/switch_ex_background_light.xml diff --git a/.gitignore b/.gitignore index 4f90608b8a..5fe2a52529 100644 --- a/.gitignore +++ b/.gitignore @@ -29,5 +29,8 @@ out/ # MacOSX .DS_Store +# Windows +Thumbs.db + # Output files /build diff --git a/OsmAnd/res/color/switch_ex_button_text_dark.xml b/OsmAnd/res/color/switch_ex_button_text_dark.xml new file mode 100644 index 0000000000..2f3ae3f24b --- /dev/null +++ b/OsmAnd/res/color/switch_ex_button_text_dark.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/OsmAnd/res/color/switch_ex_button_text_light.xml b/OsmAnd/res/color/switch_ex_button_text_light.xml new file mode 100644 index 0000000000..c9eea81473 --- /dev/null +++ b/OsmAnd/res/color/switch_ex_button_text_light.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/OsmAnd/res/color/switch_ex_text_color.xml b/OsmAnd/res/color/switch_ex_text_color.xml deleted file mode 100644 index fdba9c612f..0000000000 --- a/OsmAnd/res/color/switch_ex_text_color.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - diff --git a/OsmAnd/res/drawable-large/Thumbs.db b/OsmAnd/res/drawable-large/Thumbs.db deleted file mode 100644 index c3d48fe3570d53804d631317e00c7dd7e80dfdbe..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 7680 zcmeI0c|6qL{>KMpUkce}AC$%z``BU#S&AaE8>283M#&OoOSbG;vxmNvZ7dPlvNuRV zNOmPVA?A1HTiwTf+{eB5@qIjgzklxUanI-RoX`23b3W&NKIeTt=lz-w;qCEH*=1Z) zkbg+35DLg4kp@EfcjaUtPvXyX3<4ns8PfG3kx2Ym2!Vj?f75@^3><*5lKe;F2yo(2 z0LkZ60BQgYfEGXppa(DjNNxX{{(sDXG2{j~a1efo7Q_vlJs@|0hyQwF11skDO#E$c z_!qZ-vRO~}At#VgfchrZpN$X@S%@6O2I2rg0PG;V5Noq~{) z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kd*-62V@yje zi!@gvmw28Xg4md`pk27I|6_M!r?j^~yH0I$y=mP`U%q&%vhlXvKT3Dm#3a#L zc7{qmNK4wWKjO!+i~+I&f<((~1ua|ZhEe>oPttOxf_t-49FG}#V04u0%izOM5bS2> z`!WWfq=+z>PNT8LFBJG_ckLYg!Wel^J@^)wcB+s6mYdlkZ&%=HTta8AWp9k*c7lu< z`y1MWjrq4<{OMN$ezXKKMSM5KyvqowD&6Gzl7xnMdA(f;mlOJ;T!d4!gFho&EZ6C(P#o6WO=WiHPNoXl?2nl0 + + + + diff --git a/OsmAnd/res/drawable/bg_plugin_logo_disabled_light.xml b/OsmAnd/res/drawable/bg_plugin_logo_disabled_light.xml new file mode 100644 index 0000000000..5db5edda16 --- /dev/null +++ b/OsmAnd/res/drawable/bg_plugin_logo_disabled_light.xml @@ -0,0 +1,7 @@ + + + + + diff --git a/OsmAnd/res/drawable/bg_plugin_logo.xml b/OsmAnd/res/drawable/bg_plugin_logo_enabled.xml similarity index 100% rename from OsmAnd/res/drawable/bg_plugin_logo.xml rename to OsmAnd/res/drawable/bg_plugin_logo_enabled.xml diff --git a/OsmAnd/res/drawable/get_button_background.xml b/OsmAnd/res/drawable/get_button_background.xml new file mode 100644 index 0000000000..0108b26e23 --- /dev/null +++ b/OsmAnd/res/drawable/get_button_background.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/OsmAnd/res/drawable/ic_plugin_options_dark.xml b/OsmAnd/res/drawable/ic_plugin_options_dark.xml index 0d038d3b4a..fe9d4f25d2 100644 --- a/OsmAnd/res/drawable/ic_plugin_options_dark.xml +++ b/OsmAnd/res/drawable/ic_plugin_options_dark.xml @@ -1,10 +1,8 @@ - + + android:gravity="center" /> diff --git a/OsmAnd/res/drawable/ic_plugin_options_light.xml b/OsmAnd/res/drawable/ic_plugin_options_light.xml index 44e717630a..3da3249d32 100644 --- a/OsmAnd/res/drawable/ic_plugin_options_light.xml +++ b/OsmAnd/res/drawable/ic_plugin_options_light.xml @@ -1,10 +1,8 @@ - + + android:gravity="center" /> diff --git a/OsmAnd/res/drawable/switch_ex_background.xml b/OsmAnd/res/drawable/switch_ex_background_dark.xml similarity index 84% rename from OsmAnd/res/drawable/switch_ex_background.xml rename to OsmAnd/res/drawable/switch_ex_background_dark.xml index 0e0733261a..3964927081 100644 --- a/OsmAnd/res/drawable/switch_ex_background.xml +++ b/OsmAnd/res/drawable/switch_ex_background_dark.xml @@ -4,21 +4,19 @@ - - - + diff --git a/OsmAnd/res/drawable/switch_ex_background_light.xml b/OsmAnd/res/drawable/switch_ex_background_light.xml new file mode 100644 index 0000000000..4c1034023e --- /dev/null +++ b/OsmAnd/res/drawable/switch_ex_background_light.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/OsmAnd/res/layout/dash_plugin_item.xml b/OsmAnd/res/layout/dash_plugin_item.xml index 24058a989a..a3470e2b21 100644 --- a/OsmAnd/res/layout/dash_plugin_item.xml +++ b/OsmAnd/res/layout/dash_plugin_item.xml @@ -22,7 +22,7 @@ android:layout_width="32dp" android:layout_height="32dp" android:layout_margin="11dp" - android:background="@drawable/bg_plugin_logo" + android:background="@drawable/bg_plugin_logo_enabled" android:scaleType="center" tools:src="@drawable/ic_extension_dark"/> @@ -52,7 +52,7 @@ android:layout_marginStart="6dp" android:layout_marginRight="16dp" android:layout_marginEnd="16dp" - android:background="@drawable/switch_ex_background" + android:background="?attr/switch_ex_background" android:minHeight="0dp" android:minWidth="0dp" android:paddingTop="8dp" @@ -60,7 +60,7 @@ android:paddingLeft="9.5dp" android:paddingRight="9.5dp" osmand:textAllCapsCompat="true" - android:textColor="@color/switch_ex_text_color" + android:textColor="?attr/switch_ex_text_color" android:textOff="@string/enable_plugin" android:textOn="@string/disable_plugin" android:textSize="12sp" diff --git a/OsmAnd/res/layout/plugin.xml b/OsmAnd/res/layout/plugin.xml index 9d806bac2c..6da9611e0d 100644 --- a/OsmAnd/res/layout/plugin.xml +++ b/OsmAnd/res/layout/plugin.xml @@ -4,8 +4,7 @@ xmlns:osmand="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" - android:layout_height="match_parent" - android:layout_marginTop="?attr/actionBarSize"> + android:layout_height="match_parent"> + android:background="@drawable/bg_plugin_logo_enabled" + android:scaleType="center" + android:src="@drawable/ic_extension_dark"/> - @@ -29,8 +29,8 @@ android:layout_marginBottom="8dp" android:layout_marginLeft="6dp" android:layout_marginStart="6dp" - android:layout_marginRight="16dp" - android:layout_marginEnd="16dp" + android:layout_marginRight="36dp" + android:layout_marginEnd="36dp" android:layout_marginTop="8dp" android:layout_weight="1" android:orientation="vertical"> @@ -40,8 +40,6 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginBottom="4dp" - android:layout_marginRight="50dp" - android:layout_marginEnd="50dp" android:ellipsize="end" android:lines="1" android:maxLines="1" @@ -68,12 +66,13 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="top|end" - android:orientation="horizontal"> + android:orientation="vertical"> diff --git a/OsmAnd/res/values/attrs.xml b/OsmAnd/res/values/attrs.xml index fd3cbb783a..925e7940a8 100644 --- a/OsmAnd/res/values/attrs.xml +++ b/OsmAnd/res/values/attrs.xml @@ -23,6 +23,9 @@ + + + diff --git a/OsmAnd/res/values/colors.xml b/OsmAnd/res/values/colors.xml index 9e7d0e14b0..c36424128a 100644 --- a/OsmAnd/res/values/colors.xml +++ b/OsmAnd/res/values/colors.xml @@ -101,4 +101,6 @@ #ffffff #333b40 + + #ffffff \ No newline at end of file diff --git a/OsmAnd/res/values/styles.xml b/OsmAnd/res/values/styles.xml index cad2190d54..1194cfef17 100644 --- a/OsmAnd/res/values/styles.xml +++ b/OsmAnd/res/values/styles.xml @@ -158,6 +158,9 @@ @style/WhiteActionMode @color/color_white @color/color_white + @drawable/switch_ex_background_light + @color/switch_ex_button_text_light + @drawable/bg_plugin_logo_disabled_light