From 841f084c8bc6c03c75f666c14c6576b3e8945866 Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 27 Dec 2016 22:23:55 +0100 Subject: [PATCH] removing and updating a couple resources --- .../calendar/extensions/Activity.kt | 19 ---------- .../calendar/extensions/Cursor.kt | 7 ---- .../calendar/extensions/EditText.kt | 5 --- .../calendar/extensions/Int.kt | 11 ------ app/src/main/res/drawable/button_pressed.xml | 2 +- app/src/main/res/layout/activity_day.xml | 4 +-- app/src/main/res/layout/activity_main.xml | 4 +-- app/src/main/res/layout/activity_settings.xml | 4 +-- app/src/main/res/layout/event_item.xml | 4 +-- app/src/main/res/layout/event_list_item.xml | 4 +-- .../main/res/layout/event_list_section.xml | 2 +- .../res/layout/event_list_section_widget.xml | 2 +- .../main/res/layout/widget_config_list.xml | 2 +- .../main/res/layout/widget_config_monthly.xml | 2 +- app/src/main/res/values-sw600dp/dimens.xml | 5 +-- app/src/main/res/values/colors.xml | 8 ----- app/src/main/res/values/dimens.xml | 14 +------- app/src/main/res/values/styles.xml | 35 +++---------------- 18 files changed, 21 insertions(+), 113 deletions(-) delete mode 100644 app/src/main/kotlin/com/simplemobiletools/calendar/extensions/Activity.kt delete mode 100644 app/src/main/kotlin/com/simplemobiletools/calendar/extensions/Cursor.kt delete mode 100644 app/src/main/kotlin/com/simplemobiletools/calendar/extensions/EditText.kt delete mode 100644 app/src/main/kotlin/com/simplemobiletools/calendar/extensions/Int.kt diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/extensions/Activity.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/extensions/Activity.kt deleted file mode 100644 index 17daa4691..000000000 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/extensions/Activity.kt +++ /dev/null @@ -1,19 +0,0 @@ -package com.simplemobiletools.calendar.extensions - -import android.app.Activity -import android.content.Context -import android.view.View -import android.view.WindowManager -import android.view.inputmethod.InputMethodManager -import android.widget.EditText - -fun Activity.hideKeyboard() { - val inputMethodManager = getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager - inputMethodManager.hideSoftInputFromWindow((currentFocus ?: View(this)).windowToken, 0) - window!!.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN) -} - -fun Activity.showKeyboard(et: EditText) { - val imm = getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager - imm.showSoftInput(et, InputMethodManager.SHOW_IMPLICIT) -} diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/extensions/Cursor.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/extensions/Cursor.kt deleted file mode 100644 index 9edb567b2..000000000 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/extensions/Cursor.kt +++ /dev/null @@ -1,7 +0,0 @@ -package com.simplemobiletools.calendar.extensions - -import android.database.Cursor - -fun Cursor.getStringValue(key: String) = getString(getColumnIndex(key)) - -fun Cursor.getIntValue(key: String) = getInt(getColumnIndex(key)) diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/extensions/EditText.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/extensions/EditText.kt deleted file mode 100644 index b2f7b51ca..000000000 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/extensions/EditText.kt +++ /dev/null @@ -1,5 +0,0 @@ -package com.simplemobiletools.calendar.extensions - -import android.widget.EditText - -val EditText.value: String get() = text.toString().trim() diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/extensions/Int.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/extensions/Int.kt deleted file mode 100644 index 094db2b98..000000000 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/extensions/Int.kt +++ /dev/null @@ -1,11 +0,0 @@ -package com.simplemobiletools.calendar.extensions - -import android.graphics.Color - -fun Int.adjustAlpha(factor: Float): Int { - val alpha = Math.round(Color.alpha(this) * factor) - val red = Color.red(this) - val green = Color.green(this) - val blue = Color.blue(this) - return Color.argb(alpha, red, green, blue) -} diff --git a/app/src/main/res/drawable/button_pressed.xml b/app/src/main/res/drawable/button_pressed.xml index e5cc99ba3..e6fe04b7a 100644 --- a/app/src/main/res/drawable/button_pressed.xml +++ b/app/src/main/res/drawable/button_pressed.xml @@ -2,5 +2,5 @@ + android:color="@color/pressed_item_foreground"/> diff --git a/app/src/main/res/layout/activity_day.xml b/app/src/main/res/layout/activity_day.xml index ad7a1d46a..166d033d1 100644 --- a/app/src/main/res/layout/activity_day.xml +++ b/app/src/main/res/layout/activity_day.xml @@ -19,7 +19,7 @@ android:layout_gravity="bottom|end" android:layout_margin="@dimen/activity_margin" android:src="@mipmap/plus" - app:backgroundTint="@color/colorPrimary" - app:rippleColor="@color/mediumGrey"/> + app:backgroundTint="@color/color_primary" + app:rippleColor="@color/pressed_item_foreground"/> diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index b2209010f..510611fbb 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -24,7 +24,7 @@ android:layout_gravity="bottom|end" android:layout_margin="@dimen/activity_margin" android:src="@mipmap/plus" - app:backgroundTint="@color/colorPrimary" - app:rippleColor="@color/mediumGrey"/> + app:backgroundTint="@color/color_primary" + app:rippleColor="@color/pressed_item_foreground"/> diff --git a/app/src/main/res/layout/activity_settings.xml b/app/src/main/res/layout/activity_settings.xml index c06f524d5..47db473dc 100644 --- a/app/src/main/res/layout/activity_settings.xml +++ b/app/src/main/res/layout/activity_settings.xml @@ -146,8 +146,8 @@ android:layout_height="wrap_content" android:layout_alignParentEnd="true" android:layout_alignParentRight="true" - android:layout_marginEnd="@dimen/tiny_margin" - android:layout_marginRight="@dimen/tiny_margin" + android:layout_marginEnd="@dimen/small_margin" + android:layout_marginRight="@dimen/small_margin" android:background="@null" android:clickable="false"/> diff --git a/app/src/main/res/layout/event_item.xml b/app/src/main/res/layout/event_item.xml index 5e8afff53..f02619da1 100644 --- a/app/src/main/res/layout/event_item.xml +++ b/app/src/main/res/layout/event_item.xml @@ -11,8 +11,8 @@ android:id="@+id/event_item_holder" android:layout_width="match_parent" android:layout_height="wrap_content" - android:paddingBottom="@dimen/event_padding" - android:paddingTop="@dimen/event_padding"> + android:paddingBottom="@dimen/medium_margin" + android:paddingTop="@dimen/medium_margin"> + android:paddingTop="@dimen/small_margin"> diff --git a/app/src/main/res/layout/event_list_section_widget.xml b/app/src/main/res/layout/event_list_section_widget.xml index 5a1d657c7..174ecde77 100644 --- a/app/src/main/res/layout/event_list_section_widget.xml +++ b/app/src/main/res/layout/event_list_section_widget.xml @@ -6,6 +6,6 @@ android:layout_height="wrap_content" android:drawablePadding="1dp" android:drawableTop="@drawable/divider" - android:paddingTop="@dimen/tiny_margin" + android:paddingTop="@dimen/small_margin" android:textSize="@dimen/normal_text_size" android:textStyle="bold"/> diff --git a/app/src/main/res/layout/widget_config_list.xml b/app/src/main/res/layout/widget_config_list.xml index 4aa113eb4..94dca7670 100644 --- a/app/src/main/res/layout/widget_config_list.xml +++ b/app/src/main/res/layout/widget_config_list.xml @@ -57,5 +57,5 @@ android:paddingRight="@dimen/activity_margin" android:text="@android:string/ok" android:textColor="@android:color/white" - android:textSize="@dimen/config_text_size"/> + android:textSize="@dimen/big_text_size"/> diff --git a/app/src/main/res/layout/widget_config_monthly.xml b/app/src/main/res/layout/widget_config_monthly.xml index 701183798..19f1654ab 100644 --- a/app/src/main/res/layout/widget_config_monthly.xml +++ b/app/src/main/res/layout/widget_config_monthly.xml @@ -54,5 +54,5 @@ android:paddingRight="@dimen/activity_margin" android:text="@android:string/ok" android:textColor="@android:color/white" - android:textSize="@dimen/config_text_size" /> + android:textSize="@dimen/big_text_size" /> diff --git a/app/src/main/res/values-sw600dp/dimens.xml b/app/src/main/res/values-sw600dp/dimens.xml index 948ae2483..a7289b61d 100644 --- a/app/src/main/res/values-sw600dp/dimens.xml +++ b/app/src/main/res/values-sw600dp/dimens.xml @@ -1,7 +1,4 @@ - 12dp - 50dp - 320dp 320dp @@ -9,5 +6,5 @@ 24sp 34sp 30sp - 22sp + 22sp diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index 205307acf..6b931d645 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -1,12 +1,4 @@ - #fff68630 - #ffe27725 - @color/colorPrimary - - #08000000 - #44888888 - #18000000 - #44cccccc #ff333333 diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml index 43de6a3f3..7f9d2cf79 100644 --- a/app/src/main/res/values/dimens.xml +++ b/app/src/main/res/values/dimens.xml @@ -1,13 +1,4 @@ - 16dp - 24dp - 4dp - 8dp - 8dp - 40dp - 8dp - 8dp - 8dp 10dp 3dp 6dp @@ -15,10 +6,7 @@ 250dp 250dp - 9sp - 14sp 16sp - 26sp 22sp - 18sp + 26sp diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index 9857661d5..3ff7de047 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -1,9 +1,9 @@ - - - - - @@ -75,8 +50,6 @@ 20sp -