From acfd9621b75c052e68c1ab5a27201a6733f349ae Mon Sep 17 00:00:00 2001 From: Philoul Date: Mon, 15 Jun 2020 16:45:42 +0200 Subject: [PATCH] replace 4 LowRes Icons (add, remove, clone and as) For add, remove and clone I set width and height to 16dp (automatically scaled in Local Profile layout but not in automation) for as, I replaced low res icon by double arrows of overview fragment (size a little bit increased because in automation icons are very small) --- .../plugins/general/automation/triggers/Trigger.kt | 6 +++--- .../automation/triggers/TriggerAutosensValue.kt | 2 +- .../nightscout/androidaps/utils/TimeListEdit.java | 2 +- app/src/main/res/drawable/ic_add.xml | 10 ++++++++++ app/src/main/res/drawable/ic_as.xml | 10 ++++++++++ app/src/main/res/drawable/ic_clone.xml | 9 +++++++++ app/src/main/res/drawable/ic_remove.xml | 10 ++++++++++ app/src/main/res/layout/localprofile_fragment.xml | 8 +++++--- app/src/main/res/layout/timelistedit_element.xml | 4 ++-- .../res/layout/timelistedit_element_vertical.xml | 4 ++-- .../automation/triggers/TriggerAutosensValueTest.kt | 2 +- icons/add.svg | 12 ++++++++++++ icons/as.svg | 11 +++++++++++ icons/clone.svg | 11 +++++++++++ icons/remove.svg | 13 +++++++++++++ 15 files changed, 101 insertions(+), 13 deletions(-) create mode 100644 app/src/main/res/drawable/ic_add.xml create mode 100644 app/src/main/res/drawable/ic_as.xml create mode 100644 app/src/main/res/drawable/ic_clone.xml create mode 100644 app/src/main/res/drawable/ic_remove.xml create mode 100644 icons/add.svg create mode 100644 icons/as.svg create mode 100644 icons/clone.svg create mode 100644 icons/remove.svg diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/automation/triggers/Trigger.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/automation/triggers/Trigger.kt index 357e4b462d..fce6bb41c4 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/automation/triggers/Trigger.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/automation/triggers/Trigger.kt @@ -98,7 +98,7 @@ abstract class Trigger(val injector: HasAndroidInjector) { ) params.gravity = Gravity.CENTER buttonAdd.layoutParams = params - buttonAdd.setImageResource(R.drawable.add) + buttonAdd.setImageResource(R.drawable.ic_add) buttonAdd.contentDescription = resourceHelper.gs(R.string.add_short) buttonAdd.setOnClickListener { scanForActivity(context)?.supportFragmentManager?.let { @@ -124,7 +124,7 @@ abstract class Trigger(val injector: HasAndroidInjector) { ) params.gravity = Gravity.CENTER buttonRemove.layoutParams = params - buttonRemove.setImageResource(R.drawable.remove) + buttonRemove.setImageResource(R.drawable.ic_remove) buttonRemove.contentDescription = resourceHelper.gs(R.string.delete_short) buttonRemove.setOnClickListener { rxBus.send(EventTriggerRemove(trigger)) @@ -141,7 +141,7 @@ abstract class Trigger(val injector: HasAndroidInjector) { ) params.gravity = Gravity.CENTER buttonClone.layoutParams = params - buttonClone.setImageResource(R.drawable.clone) + buttonClone.setImageResource(R.drawable.ic_clone) buttonClone.contentDescription = resourceHelper.gs(R.string.copy_short) buttonClone.setOnClickListener { rxBus.send(EventTriggerClone(trigger)) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/automation/triggers/TriggerAutosensValue.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/automation/triggers/TriggerAutosensValue.kt index d6f8a607ff..3b3dbe1f68 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/automation/triggers/TriggerAutosensValue.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/automation/triggers/TriggerAutosensValue.kt @@ -68,7 +68,7 @@ class TriggerAutosensValue(injector: HasAndroidInjector) : Trigger(injector) { override fun friendlyDescription(): String = resourceHelper.gs(R.string.autosenscompared, resourceHelper.gs(comparator.value.stringRes), autosens.value) - override fun icon(): Optional = Optional.of(R.drawable.`as`) + override fun icon(): Optional = Optional.of(R.drawable.`ic_as`) override fun duplicate(): Trigger = TriggerAutosensValue(injector, this) diff --git a/app/src/main/java/info/nightscout/androidaps/utils/TimeListEdit.java b/app/src/main/java/info/nightscout/androidaps/utils/TimeListEdit.java index 3386dd9235..7010a82c12 100644 --- a/app/src/main/java/info/nightscout/androidaps/utils/TimeListEdit.java +++ b/app/src/main/java/info/nightscout/androidaps/utils/TimeListEdit.java @@ -111,7 +111,7 @@ public class TimeListEdit { // last "plus" to append new interval float factor = layout.getContext().getResources().getDisplayMetrics().density; finalAdd = new ImageView(context); - finalAdd.setImageResource(R.drawable.add); + finalAdd.setImageResource(R.drawable.ic_add); LinearLayout.LayoutParams illp = new LinearLayout.LayoutParams((int) (35d * factor), (int) (35 * factor)); illp.setMargins(0, 25, 0, 25); // llp.setMargins(left, top, right, bottom); illp.gravity = Gravity.CENTER; diff --git a/app/src/main/res/drawable/ic_add.xml b/app/src/main/res/drawable/ic_add.xml new file mode 100644 index 0000000000..d9bfc40f83 --- /dev/null +++ b/app/src/main/res/drawable/ic_add.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/drawable/ic_as.xml b/app/src/main/res/drawable/ic_as.xml new file mode 100644 index 0000000000..152a314c2d --- /dev/null +++ b/app/src/main/res/drawable/ic_as.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/drawable/ic_clone.xml b/app/src/main/res/drawable/ic_clone.xml new file mode 100644 index 0000000000..9f566e27cb --- /dev/null +++ b/app/src/main/res/drawable/ic_clone.xml @@ -0,0 +1,9 @@ + + + diff --git a/app/src/main/res/drawable/ic_remove.xml b/app/src/main/res/drawable/ic_remove.xml new file mode 100644 index 0000000000..e5b9715945 --- /dev/null +++ b/app/src/main/res/drawable/ic_remove.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/layout/localprofile_fragment.xml b/app/src/main/res/layout/localprofile_fragment.xml index 79ae5c862a..306d7bdcb4 100644 --- a/app/src/main/res/layout/localprofile_fragment.xml +++ b/app/src/main/res/layout/localprofile_fragment.xml @@ -63,7 +63,7 @@ android:layout_gravity="center_vertical" android:layout_marginStart="15dp" android:contentDescription="@string/addnew" - android:src="@drawable/add" /> + android:src="@drawable/ic_add" /> + android:src="@drawable/ic_clone" /> + android:scaleX="1" + android:scaleY="1" + android:src="@drawable/ic_remove" /> diff --git a/app/src/main/res/layout/timelistedit_element.xml b/app/src/main/res/layout/timelistedit_element.xml index a57dc29998..07c64a5ea4 100644 --- a/app/src/main/res/layout/timelistedit_element.xml +++ b/app/src/main/res/layout/timelistedit_element.xml @@ -37,7 +37,7 @@ android:layout_height="35dp" android:layout_gravity="center_vertical" android:layout_marginLeft="15dp" - android:src="@drawable/add" /> + android:src="@drawable/ic_add" /> + android:src="@drawable/ic_remove" /> diff --git a/app/src/main/res/layout/timelistedit_element_vertical.xml b/app/src/main/res/layout/timelistedit_element_vertical.xml index 7a92b77221..7ecb7d7956 100644 --- a/app/src/main/res/layout/timelistedit_element_vertical.xml +++ b/app/src/main/res/layout/timelistedit_element_vertical.xml @@ -37,7 +37,7 @@ android:layout_height="35dp" android:layout_gravity="center_vertical" android:layout_marginLeft="15dp" - android:src="@drawable/add" /> + android:src="@drawable/ic_add" /> + android:src="@drawable/ic_remove" /> diff --git a/app/src/test/java/info/nightscout/androidaps/plugins/general/automation/triggers/TriggerAutosensValueTest.kt b/app/src/test/java/info/nightscout/androidaps/plugins/general/automation/triggers/TriggerAutosensValueTest.kt index 27b042afa1..54c4381923 100644 --- a/app/src/test/java/info/nightscout/androidaps/plugins/general/automation/triggers/TriggerAutosensValueTest.kt +++ b/app/src/test/java/info/nightscout/androidaps/plugins/general/automation/triggers/TriggerAutosensValueTest.kt @@ -110,7 +110,7 @@ class TriggerAutosensValueTest : TriggerTestBase() { } @Test fun iconTest() { - Assert.assertEquals(Optional.of(R.drawable.`as`), TriggerAutosensValue(injector).icon()) + Assert.assertEquals(Optional.of(R.drawable.`ic_as`), TriggerAutosensValue(injector).icon()) } @Before diff --git a/icons/add.svg b/icons/add.svg new file mode 100644 index 0000000000..ee6825ecad --- /dev/null +++ b/icons/add.svg @@ -0,0 +1,12 @@ + + + + + + + + + diff --git a/icons/as.svg b/icons/as.svg new file mode 100644 index 0000000000..0ea0090571 --- /dev/null +++ b/icons/as.svg @@ -0,0 +1,11 @@ + + + + + + + + + diff --git a/icons/clone.svg b/icons/clone.svg new file mode 100644 index 0000000000..fadc866c1c --- /dev/null +++ b/icons/clone.svg @@ -0,0 +1,11 @@ + + + + + + + + diff --git a/icons/remove.svg b/icons/remove.svg new file mode 100644 index 0000000000..cf47d09ad1 --- /dev/null +++ b/icons/remove.svg @@ -0,0 +1,13 @@ + + + + + + + +