From 40bb4fa03ebcadb7c1d7a5ee60523cfde10c23ca Mon Sep 17 00:00:00 2001 From: vokod Date: Wed, 15 May 2019 15:57:53 +0200 Subject: [PATCH] - renamed resources - added prefix --- .../ButtonSettingAttributesTests.kt | 12 ++--- .../ButtonSettingDefaultValuesTests.kt | 8 ++-- .../ButtonSettingSaveStateTests.kt | 10 ++-- .../ButtonSettingSetFromCodeTests.kt | 25 +++++----- .../RadiogroupSettingAttributesTests.kt | 20 ++++---- .../RadiogroupSettingDefaultValuesTests.kt | 10 ++-- .../RadiogroupSettingSaveStateTests.kt | 11 ++--- .../RadiogroupSettingSetFromCodeTests.kt | 46 +++++++++---------- .../SeekbarSettingAttributesTests.kt | 16 +++---- .../SeekbarSettingDefaultValuesTests.kt | 8 ++-- .../SeekbarSettingSaveStateTests.kt | 13 ++---- .../SeekbarSettingSetFromCodeTests.kt | 24 +++++----- .../SwitchSettingAttributesTests.kt | 13 +++--- .../SwitchSettingDefaultValuesTests.kt | 9 ++-- .../SwitchSettingSaveStateTests.kt | 14 ++---- .../SwitchSettingSetFromCodeTests.kt | 24 +++++----- .../com/awolity/settingviews/ButtonSetting.kt | 7 ++- .../awolity/settingviews/RadiogroupSetting.kt | 10 ++-- .../awolity/settingviews/SeekbarSetting.kt | 6 +-- .../com/awolity/settingviews/SwitchSetting.kt | 6 +-- .../layout/activity_mock_attributes_bs.xml | 10 ++-- .../layout/activity_mock_attributes_rs.xml | 16 +++---- .../layout/activity_mock_attributes_ses.xml | 14 +++--- .../layout/activity_mock_attributes_ss.xml | 10 ++-- settingviews/src/main/res/values/colors.xml | 20 ++++---- settingviews/src/main/res/values/integers.xml | 4 +- settingviews/src/main/res/values/strings.xml | 16 +++---- settingviews/src/main/res/values/styles.xml | 14 +++--- 28 files changed, 186 insertions(+), 210 deletions(-) diff --git a/settingviews/src/androidTest/java/com/awolity/settingviews/ButtonSettingAttributesTests.kt b/settingviews/src/androidTest/java/com/awolity/settingviews/ButtonSettingAttributesTests.kt index 2c3361f..6406600 100644 --- a/settingviews/src/androidTest/java/com/awolity/settingviews/ButtonSettingAttributesTests.kt +++ b/settingviews/src/androidTest/java/com/awolity/settingviews/ButtonSettingAttributesTests.kt @@ -29,34 +29,34 @@ class ButtonSettingAttributesTests { @Test fun test_titleText_SetFromAttributes() { - onView(withId(R.id.tv_title)).check(matches(withText(R.string.test_title))) + onView(withId(R.id.tv_title)).check(matches(withText(R.string.SettingViews_test_title))) } @Test fun test_Description_TextSetFromAttributes() { - onView(withId(R.id.tv_desc)).check(matches(withText(R.string.test_description))) + onView(withId(R.id.tv_desc)).check(matches(withText(R.string.SettingViews_test_description))) } @Test fun test_TitleColor_SetFromAttributes() { - onView(withId(R.id.tv_title)).check(matches(withTextColor(R.color.test_text_title, activityRule.activity.resources))) + onView(withId(R.id.tv_title)).check(matches(withTextColor(R.color.color_SettingViews_test_text_title, activityRule.activity.resources))) } @Test fun test_DescriptionColor_SetFromAttributes() { - onView(withId(R.id.tv_desc)).check(matches(withTextColor(R.color.test_text_description, activityRule.activity.resources))) + onView(withId(R.id.tv_desc)).check(matches(withTextColor(R.color.color_SettingViews_test_text_description, activityRule.activity.resources))) } @Test fun test_DisabledTitleColor_SetFromAttribute() { activityRule.runOnUiThread { activityRule.activity.bs.isEnabled = false } - onView(withId(R.id.tv_title)).check(matches(withTextColor(R.color.test_text_disabled, activityRule.activity.resources))) + onView(withId(R.id.tv_title)).check(matches(withTextColor(R.color.color_SettingViews_test_text_disabled, activityRule.activity.resources))) } @Test fun test_DisabledDescriptionColor_SetFromAttribute() { activityRule.runOnUiThread { activityRule.activity.bs.isEnabled = false } - onView(withId(R.id.tv_desc)).check(matches(withTextColor(R.color.test_text_disabled, activityRule.activity.resources))) + onView(withId(R.id.tv_desc)).check(matches(withTextColor(R.color.color_SettingViews_test_text_disabled, activityRule.activity.resources))) } @Test diff --git a/settingviews/src/androidTest/java/com/awolity/settingviews/ButtonSettingDefaultValuesTests.kt b/settingviews/src/androidTest/java/com/awolity/settingviews/ButtonSettingDefaultValuesTests.kt index f986c0a..efddad9 100644 --- a/settingviews/src/androidTest/java/com/awolity/settingviews/ButtonSettingDefaultValuesTests.kt +++ b/settingviews/src/androidTest/java/com/awolity/settingviews/ButtonSettingDefaultValuesTests.kt @@ -41,7 +41,7 @@ class ButtonSettingDefaultValuesTests { Espresso.onView(ViewMatchers.withId(R.id.tv_title)).check( ViewAssertions.matches( TextColorMatcher.withTextColor( - R.color.text_title, + R.color.color_SettingViews_text_title, activityRule.activity.resources ) ) @@ -53,7 +53,7 @@ class ButtonSettingDefaultValuesTests { Espresso.onView(ViewMatchers.withId(R.id.tv_desc)).check( ViewAssertions.matches( TextColorMatcher.withTextColor( - R.color.text_description, + R.color.color_SettingViews_text_description, activityRule.activity.resources ) ) @@ -84,7 +84,7 @@ class ButtonSettingDefaultValuesTests { Espresso.onView(ViewMatchers.withId(R.id.tv_title)).check( ViewAssertions.matches( TextColorMatcher.withTextColor( - R.color.text_disabled, + R.color.color_SettingViews_text_disabled, activityRule.activity.resources ) ) @@ -97,7 +97,7 @@ class ButtonSettingDefaultValuesTests { Espresso.onView(ViewMatchers.withId(R.id.tv_desc)).check( ViewAssertions.matches( TextColorMatcher.withTextColor( - R.color.text_disabled, + R.color.color_SettingViews_text_disabled, activityRule.activity.resources ) ) diff --git a/settingviews/src/androidTest/java/com/awolity/settingviews/ButtonSettingSaveStateTests.kt b/settingviews/src/androidTest/java/com/awolity/settingviews/ButtonSettingSaveStateTests.kt index fa6848b..a847d52 100644 --- a/settingviews/src/androidTest/java/com/awolity/settingviews/ButtonSettingSaveStateTests.kt +++ b/settingviews/src/androidTest/java/com/awolity/settingviews/ButtonSettingSaveStateTests.kt @@ -13,8 +13,6 @@ import org.junit.Test import org.junit.runner.RunWith import com.awolity.settingviews.TextColorMatcher.withTextColor import kotlinx.android.synthetic.main.activity_mock_defaults_bs.* -import org.hamcrest.CoreMatchers.not -import java.lang.IllegalStateException @RunWith(AndroidJUnit4::class) class ButtonSettingSaveStateTests { @@ -41,13 +39,13 @@ class ButtonSettingSaveStateTests { @Test fun setTitleColor_Rotate_lookTitleColor() { activityRule.runOnUiThread { - activityRule.activity.bs.setTitleTextColor(activityRule.activity.getColor(R.color.test_text_title)) + activityRule.activity.bs.setTitleTextColor(activityRule.activity.getColor(R.color.color_SettingViews_test_text_title)) rotate() } onView(withId(R.id.tv_title)).check( matches( withTextColor( - R.color.test_text_title, + R.color.color_SettingViews_test_text_title, activityRule.activity.resources ) ) @@ -66,13 +64,13 @@ class ButtonSettingSaveStateTests { @Test fun setDescriptionColor_Rotate_lookDescriptionColor() { activityRule.runOnUiThread { - activityRule.activity.bs.setDescriptionTextColor(activityRule.activity.getColor(R.color.test_text_description)) + activityRule.activity.bs.setDescriptionTextColor(activityRule.activity.getColor(R.color.color_SettingViews_test_text_description)) rotate() } onView(withId(R.id.tv_desc)).check( matches( withTextColor( - R.color.test_text_description, + R.color.color_SettingViews_test_text_description, activityRule.activity.resources ) ) diff --git a/settingviews/src/androidTest/java/com/awolity/settingviews/ButtonSettingSetFromCodeTests.kt b/settingviews/src/androidTest/java/com/awolity/settingviews/ButtonSettingSetFromCodeTests.kt index 0685466..519ac93 100644 --- a/settingviews/src/androidTest/java/com/awolity/settingviews/ButtonSettingSetFromCodeTests.kt +++ b/settingviews/src/androidTest/java/com/awolity/settingviews/ButtonSettingSetFromCodeTests.kt @@ -13,7 +13,6 @@ import org.junit.runner.RunWith import com.awolity.settingviews.TextColorMatcher.withTextColor import kotlinx.android.synthetic.main.activity_mock_defaults_bs.* import org.hamcrest.CoreMatchers.not -import java.lang.IllegalStateException // TODO: checkable teszt (ha chekable, akkor a checkable-iv-nek kell a hely @@ -44,7 +43,7 @@ class ButtonSettingSetFromCodeTests { onView(withId(R.id.tv_title)).check( matches( withTextColor( - R.color.text_disabled, + R.color.color_SettingViews_text_disabled, activityRule.activity.resources ) ) @@ -57,7 +56,7 @@ class ButtonSettingSetFromCodeTests { onView(withId(R.id.tv_desc)).check( matches( withTextColor( - R.color.text_disabled, + R.color.color_SettingViews_text_disabled, activityRule.activity.resources ) ) @@ -79,7 +78,7 @@ class ButtonSettingSetFromCodeTests { activityRule.activity.bs.isEnabled = false activityRule.activity.bs.isEnabled = true } - onView(withId(R.id.tv_title)).check(matches(withTextColor(R.color.text_title, activityRule.activity.resources))) + onView(withId(R.id.tv_title)).check(matches(withTextColor(R.color.color_SettingViews_text_title, activityRule.activity.resources))) } @Test @@ -91,7 +90,7 @@ class ButtonSettingSetFromCodeTests { onView(withId(R.id.tv_desc)).check( matches( withTextColor( - R.color.text_description, + R.color.color_SettingViews_text_description, activityRule.activity.resources ) ) @@ -119,13 +118,13 @@ class ButtonSettingSetFromCodeTests { @Test fun setTitleColor_lookTitleColor() { activityRule.runOnUiThread { - activityRule.activity.bs.setTitleTextColor(activityRule.activity.getColor(R.color.test_text_title)) + activityRule.activity.bs.setTitleTextColor(activityRule.activity.getColor(R.color.color_SettingViews_test_text_title)) activityRule.activity.bs.setTitle(title) } onView(withId(R.id.tv_title)).check( matches( withTextColor( - R.color.test_text_title, + R.color.color_SettingViews_test_text_title, activityRule.activity.resources ) ) @@ -135,13 +134,13 @@ class ButtonSettingSetFromCodeTests { @Test fun setDescriptionColor_lookDescriptionColor() { activityRule.runOnUiThread { - activityRule.activity.bs.setDescriptionTextColor(activityRule.activity.getColor(R.color.test_text_description)) + activityRule.activity.bs.setDescriptionTextColor(activityRule.activity.getColor(R.color.color_SettingViews_test_text_description)) activityRule.activity.bs.setDescription(description) } onView(withId(R.id.tv_desc)).check( matches( withTextColor( - R.color.test_text_description, + R.color.color_SettingViews_test_text_description, activityRule.activity.resources ) ) @@ -153,12 +152,12 @@ class ButtonSettingSetFromCodeTests { activityRule.runOnUiThread { activityRule.activity.bs.setTitle(title) activityRule.activity.bs.isEnabled = false - activityRule.activity.bs.setDisabledTextColor(activityRule.activity.getColor(R.color.test_text_disabled)) + activityRule.activity.bs.setDisabledTextColor(activityRule.activity.getColor(R.color.color_SettingViews_test_text_disabled)) } onView(withId(R.id.tv_title)).check( matches( withTextColor( - R.color.test_text_disabled, + R.color.color_SettingViews_test_text_disabled, activityRule.activity.resources ) ) @@ -168,14 +167,14 @@ class ButtonSettingSetFromCodeTests { @Test fun setDisabledColorDescription_lookDisabledColorDescription() { activityRule.runOnUiThread { - activityRule.activity.bs.setDisabledTextColor(activityRule.activity.getColor(R.color.test_text_disabled)) + activityRule.activity.bs.setDisabledTextColor(activityRule.activity.getColor(R.color.color_SettingViews_test_text_disabled)) activityRule.activity.bs.isEnabled = false activityRule.activity.bs.setDescription(description) } onView(withId(R.id.tv_desc)).check( matches( withTextColor( - R.color.test_text_disabled, + R.color.color_SettingViews_test_text_disabled, activityRule.activity.resources ) ) diff --git a/settingviews/src/androidTest/java/com/awolity/settingviews/RadiogroupSettingAttributesTests.kt b/settingviews/src/androidTest/java/com/awolity/settingviews/RadiogroupSettingAttributesTests.kt index 0aa48be..2073a03 100644 --- a/settingviews/src/androidTest/java/com/awolity/settingviews/RadiogroupSettingAttributesTests.kt +++ b/settingviews/src/androidTest/java/com/awolity/settingviews/RadiogroupSettingAttributesTests.kt @@ -30,51 +30,51 @@ class RadiogroupSettingAttributesTests { @Test fun test_titleText_SetFromAttributes() { - onView(withId(R.id.tv_title)).check(matches(withText(R.string.test_title))) + onView(withId(R.id.tv_title)).check(matches(withText(R.string.SettingViews_test_title))) } @Test fun test_Description_TextSetFromAttributes() { - onView(withId(R.id.tv_desc)).check(matches(withText(R.string.test_description))) + onView(withId(R.id.tv_desc)).check(matches(withText(R.string.SettingViews_test_description))) } @Test fun test_Radiobutton1Label_TextSetFromAttributes() { - onView(withId(R.id.rb_one)).check(matches(withText(R.string.test_text_1))) + onView(withId(R.id.rb_one)).check(matches(withText(R.string.SettingViews_test_text_1))) } @Test fun test_Radiobutton2Label_TextSetFromAttributes() { - onView(withId(R.id.rb_two)).check(matches(withText(R.string.test_text_2))) + onView(withId(R.id.rb_two)).check(matches(withText(R.string.SettingViews_test_text_2))) } @Test fun test_TitleColor_SetFromAttributes() { - onView(withId(R.id.tv_title)).check(matches(withTextColor(R.color.test_text_title, activityRule.activity.resources))) + onView(withId(R.id.tv_title)).check(matches(withTextColor(R.color.color_SettingViews_test_text_title, activityRule.activity.resources))) } @Test fun test_DescriptionColor_SetFromAttributes() { - onView(withId(R.id.tv_desc)).check(matches(withTextColor(R.color.test_text_description, activityRule.activity.resources))) + onView(withId(R.id.tv_desc)).check(matches(withTextColor(R.color.color_SettingViews_test_text_description, activityRule.activity.resources))) } @Test fun test_DisabledTitleColor_SetFromAttribute() { activityRule.runOnUiThread { activityRule.activity.rs.isEnabled = false } - onView(withId(R.id.tv_title)).check(matches(withTextColor(R.color.test_text_disabled, activityRule.activity.resources))) + onView(withId(R.id.tv_title)).check(matches(withTextColor(R.color.color_SettingViews_test_text_disabled, activityRule.activity.resources))) } @Test fun test_DisabledDescriptionColor_SetFromAttribute() { activityRule.runOnUiThread { activityRule.activity.rs.isEnabled = false } - onView(withId(R.id.tv_desc)).check(matches(withTextColor(R.color.test_text_disabled, activityRule.activity.resources))) + onView(withId(R.id.tv_desc)).check(matches(withTextColor(R.color.color_SettingViews_test_text_disabled, activityRule.activity.resources))) } @Test fun test_DisabledRadioButtonLabelColor_SetFromAttribute() { activityRule.runOnUiThread { activityRule.activity.rs.isEnabled = false } - onView(withId(R.id.rb_one)).check(matches(withTextColor(R.color.test_text_disabled, activityRule.activity.resources))) - onView(withId(R.id.rb_two)).check(matches(withTextColor(R.color.test_text_disabled, activityRule.activity.resources))) + onView(withId(R.id.rb_one)).check(matches(withTextColor(R.color.color_SettingViews_test_text_disabled, activityRule.activity.resources))) + onView(withId(R.id.rb_two)).check(matches(withTextColor(R.color.color_SettingViews_test_text_disabled, activityRule.activity.resources))) } @Test diff --git a/settingviews/src/androidTest/java/com/awolity/settingviews/RadiogroupSettingDefaultValuesTests.kt b/settingviews/src/androidTest/java/com/awolity/settingviews/RadiogroupSettingDefaultValuesTests.kt index 814e713..da9a468 100644 --- a/settingviews/src/androidTest/java/com/awolity/settingviews/RadiogroupSettingDefaultValuesTests.kt +++ b/settingviews/src/androidTest/java/com/awolity/settingviews/RadiogroupSettingDefaultValuesTests.kt @@ -50,7 +50,7 @@ class RadiogroupSettingDefaultValuesTests { onView(withId(R.id.tv_title)).check( matches( TextColorMatcher.withTextColor( - R.color.text_title, + R.color.color_SettingViews_text_title, activityRule.activity.resources ) ) @@ -62,7 +62,7 @@ class RadiogroupSettingDefaultValuesTests { onView(withId(R.id.rb_one)).check( matches( TextColorMatcher.withTextColor( - R.color.text_description, + R.color.color_SettingViews_text_description, activityRule.activity.resources ) ) @@ -92,7 +92,7 @@ class RadiogroupSettingDefaultValuesTests { onView(withId(R.id.tv_desc)).check( matches( TextColorMatcher.withTextColor( - R.color.text_description, + R.color.color_SettingViews_text_description, activityRule.activity.resources ) ) @@ -111,7 +111,7 @@ class RadiogroupSettingDefaultValuesTests { onView(withId(R.id.tv_title)).check( matches( TextColorMatcher.withTextColor( - R.color.text_disabled, + R.color.color_SettingViews_text_disabled, activityRule.activity.resources ) ) @@ -124,7 +124,7 @@ class RadiogroupSettingDefaultValuesTests { onView(withId(R.id.tv_desc)).check( matches( TextColorMatcher.withTextColor( - R.color.text_disabled, + R.color.color_SettingViews_text_disabled, activityRule.activity.resources ) ) diff --git a/settingviews/src/androidTest/java/com/awolity/settingviews/RadiogroupSettingSaveStateTests.kt b/settingviews/src/androidTest/java/com/awolity/settingviews/RadiogroupSettingSaveStateTests.kt index 978e8a8..f7d42a8 100644 --- a/settingviews/src/androidTest/java/com/awolity/settingviews/RadiogroupSettingSaveStateTests.kt +++ b/settingviews/src/androidTest/java/com/awolity/settingviews/RadiogroupSettingSaveStateTests.kt @@ -13,10 +13,7 @@ import org.junit.Rule import org.junit.Test import org.junit.runner.RunWith import com.awolity.settingviews.TextColorMatcher.withTextColor -import kotlinx.android.synthetic.main.activity_mock_defaults_bs.* import kotlinx.android.synthetic.main.activity_mock_defaults_rs.* -import org.hamcrest.CoreMatchers.not -import java.lang.IllegalStateException @RunWith(AndroidJUnit4::class) class RadiogroupSettingSaveStateTests { @@ -43,13 +40,13 @@ class RadiogroupSettingSaveStateTests { @Test fun setTitleColor_Rotate_lookTitleColor() { activityRule.runOnUiThread { - activityRule.activity.rs.setTitleTextColor(activityRule.activity.getColor(R.color.test_text_title)) + activityRule.activity.rs.setTitleTextColor(activityRule.activity.getColor(R.color.color_SettingViews_test_text_title)) rotate() } onView(withId(R.id.tv_title)).check( matches( withTextColor( - R.color.test_text_title, + R.color.color_SettingViews_test_text_title, activityRule.activity.resources ) ) @@ -68,13 +65,13 @@ class RadiogroupSettingSaveStateTests { @Test fun setDescriptionColor_Rotate_lookDescriptionColor() { activityRule.runOnUiThread { - activityRule.activity.rs.setDescriptionTextColor(activityRule.activity.getColor(R.color.test_text_description)) + activityRule.activity.rs.setDescriptionTextColor(activityRule.activity.getColor(R.color.color_SettingViews_test_text_description)) rotate() } onView(withId(R.id.tv_desc)).check( matches( withTextColor( - R.color.test_text_description, + R.color.color_SettingViews_test_text_description, activityRule.activity.resources ) ) diff --git a/settingviews/src/androidTest/java/com/awolity/settingviews/RadiogroupSettingSetFromCodeTests.kt b/settingviews/src/androidTest/java/com/awolity/settingviews/RadiogroupSettingSetFromCodeTests.kt index e5dac53..49d6dff 100644 --- a/settingviews/src/androidTest/java/com/awolity/settingviews/RadiogroupSettingSetFromCodeTests.kt +++ b/settingviews/src/androidTest/java/com/awolity/settingviews/RadiogroupSettingSetFromCodeTests.kt @@ -8,7 +8,6 @@ import androidx.test.espresso.matcher.ViewMatchers.* import androidx.test.rule.ActivityTestRule import androidx.test.runner.AndroidJUnit4 import com.awolity.settingviews.TextColorMatcher.withTextColor -import junit.framework.Assert.fail import kotlinx.android.synthetic.main.activity_mock_defaults_rs.* import org.hamcrest.CoreMatchers.not import org.junit.Before @@ -16,7 +15,6 @@ import org.junit.Rule import org.junit.Test import org.junit.runner.RunWith import java.lang.IllegalArgumentException -import java.lang.IllegalStateException // TODO: listener invocation test @@ -47,7 +45,7 @@ class RadiogroupSettingSetFromCodeTests { onView(withId(R.id.tv_title)).check( matches( withTextColor( - R.color.text_disabled, + R.color.color_SettingViews_text_disabled, activityRule.activity.resources ) ) @@ -60,7 +58,7 @@ class RadiogroupSettingSetFromCodeTests { onView(withId(R.id.tv_desc)).check( matches( withTextColor( - R.color.text_disabled, + R.color.color_SettingViews_text_disabled, activityRule.activity.resources ) ) @@ -73,7 +71,7 @@ class RadiogroupSettingSetFromCodeTests { onView(withId(R.id.rb_one)).check( matches( withTextColor( - R.color.text_disabled, + R.color.color_SettingViews_text_disabled, activityRule.activity.resources ) ) @@ -81,7 +79,7 @@ class RadiogroupSettingSetFromCodeTests { onView(withId(R.id.rb_two)).check( matches( withTextColor( - R.color.text_disabled, + R.color.color_SettingViews_text_disabled, activityRule.activity.resources ) ) @@ -103,7 +101,7 @@ class RadiogroupSettingSetFromCodeTests { activityRule.activity.rs.isEnabled = false activityRule.activity.rs.isEnabled = true } - onView(withId(R.id.tv_title)).check(matches(withTextColor(R.color.text_title, activityRule.activity.resources))) + onView(withId(R.id.tv_title)).check(matches(withTextColor(R.color.color_SettingViews_text_title, activityRule.activity.resources))) } @Test @@ -115,7 +113,7 @@ class RadiogroupSettingSetFromCodeTests { onView(withId(R.id.tv_desc)).check( matches( withTextColor( - R.color.text_description, + R.color.color_SettingViews_text_description, activityRule.activity.resources ) ) @@ -131,7 +129,7 @@ class RadiogroupSettingSetFromCodeTests { onView(withId(R.id.rb_one)).check( matches( withTextColor( - R.color.text_description, + R.color.color_SettingViews_text_description, activityRule.activity.resources ) ) @@ -139,7 +137,7 @@ class RadiogroupSettingSetFromCodeTests { onView(withId(R.id.rb_two)).check( matches( withTextColor( - R.color.text_description, + R.color.color_SettingViews_text_description, activityRule.activity.resources ) ) @@ -175,13 +173,13 @@ class RadiogroupSettingSetFromCodeTests { @Test fun setTitleColor_lookTitleColor() { activityRule.runOnUiThread { - activityRule.activity.rs.setTitleTextColor(activityRule.activity.getColor(R.color.test_text_title)) + activityRule.activity.rs.setTitleTextColor(activityRule.activity.getColor(R.color.color_SettingViews_test_text_title)) activityRule.activity.rs.setTitle(title) } onView(withId(R.id.tv_title)).check( matches( withTextColor( - R.color.test_text_title, + R.color.color_SettingViews_test_text_title, activityRule.activity.resources ) ) @@ -191,12 +189,12 @@ class RadiogroupSettingSetFromCodeTests { @Test fun setDescriptionColor_lookDescriptionColor() { activityRule.runOnUiThread { - activityRule.activity.rs.setDescriptionTextColor(activityRule.activity.getColor(R.color.test_text_description)) + activityRule.activity.rs.setDescriptionTextColor(activityRule.activity.getColor(R.color.color_SettingViews_test_text_description)) } onView(withId(R.id.tv_desc)).check( matches( withTextColor( - R.color.test_text_description, + R.color.color_SettingViews_test_text_description, activityRule.activity.resources ) ) @@ -206,12 +204,12 @@ class RadiogroupSettingSetFromCodeTests { @Test fun setRadiobuttonLabelColor_lookRadiobuttonLabelColor() { activityRule.runOnUiThread { - activityRule.activity.rs.setRadioButtonLabelColor(activityRule.activity.getColor(R.color.test_text_description)) + activityRule.activity.rs.setRadioButtonLabelColor(activityRule.activity.getColor(R.color.color_SettingViews_test_text_description)) } onView(withId(R.id.rb_one)).check( matches( withTextColor( - R.color.test_text_description, + R.color.color_SettingViews_test_text_description, activityRule.activity.resources ) ) @@ -219,7 +217,7 @@ class RadiogroupSettingSetFromCodeTests { onView(withId(R.id.rb_two)).check( matches( withTextColor( - R.color.test_text_description, + R.color.color_SettingViews_test_text_description, activityRule.activity.resources ) ) @@ -231,12 +229,12 @@ class RadiogroupSettingSetFromCodeTests { activityRule.runOnUiThread { activityRule.activity.rs.setTitle(title) activityRule.activity.rs.isEnabled = false - activityRule.activity.rs.setDisabledTextColor(activityRule.activity.getColor(R.color.test_text_disabled)) + activityRule.activity.rs.setDisabledTextColor(activityRule.activity.getColor(R.color.color_SettingViews_test_text_disabled)) } onView(withId(R.id.tv_title)).check( matches( withTextColor( - R.color.test_text_disabled, + R.color.color_SettingViews_test_text_disabled, activityRule.activity.resources ) ) @@ -246,14 +244,14 @@ class RadiogroupSettingSetFromCodeTests { @Test fun setDisabledColorDescription_lookDisabledColorDescription() { activityRule.runOnUiThread { - activityRule.activity.rs.setDisabledTextColor(activityRule.activity.getColor(R.color.test_text_disabled)) + activityRule.activity.rs.setDisabledTextColor(activityRule.activity.getColor(R.color.color_SettingViews_test_text_disabled)) activityRule.activity.rs.isEnabled = false activityRule.activity.rs.setDescription(description) } onView(withId(R.id.tv_desc)).check( matches( withTextColor( - R.color.test_text_disabled, + R.color.color_SettingViews_test_text_disabled, activityRule.activity.resources ) ) @@ -263,14 +261,14 @@ class RadiogroupSettingSetFromCodeTests { @Test fun setDisabledRadioButtonLabelColor_lookDisabledRadioButtonLabelColor() { activityRule.runOnUiThread { - activityRule.activity.rs.setDisabledTextColor(activityRule.activity.getColor(R.color.test_text_disabled)) + activityRule.activity.rs.setDisabledTextColor(activityRule.activity.getColor(R.color.color_SettingViews_test_text_disabled)) activityRule.activity.rs.isEnabled = false activityRule.activity.rs.setDescription(description) } onView(withId(R.id.rb_one)).check( matches( withTextColor( - R.color.test_text_disabled, + R.color.color_SettingViews_test_text_disabled, activityRule.activity.resources ) ) @@ -278,7 +276,7 @@ class RadiogroupSettingSetFromCodeTests { onView(withId(R.id.rb_one)).check( matches( withTextColor( - R.color.test_text_disabled, + R.color.color_SettingViews_test_text_disabled, activityRule.activity.resources ) ) diff --git a/settingviews/src/androidTest/java/com/awolity/settingviews/SeekbarSettingAttributesTests.kt b/settingviews/src/androidTest/java/com/awolity/settingviews/SeekbarSettingAttributesTests.kt index 7e77248..51714a3 100644 --- a/settingviews/src/androidTest/java/com/awolity/settingviews/SeekbarSettingAttributesTests.kt +++ b/settingviews/src/androidTest/java/com/awolity/settingviews/SeekbarSettingAttributesTests.kt @@ -28,12 +28,12 @@ class SeekbarSettingAttributesTests { @Test fun test_titleText_SetFromAttributes() { - onView(withId(R.id.tv_title)).check(matches(withText(R.string.test_title))) + onView(withId(R.id.tv_title)).check(matches(withText(R.string.SettingViews_test_title))) } @Test fun test_Description_TextSetFromAttributes() { - onView(withId(R.id.tv_desc)).check(matches(withText(R.string.test_description))) + onView(withId(R.id.tv_desc)).check(matches(withText(R.string.SettingViews_test_description))) } @Test @@ -41,7 +41,7 @@ class SeekbarSettingAttributesTests { onView(withId(R.id.tv_title)).check( matches( withTextColor( - R.color.test_text_title, + R.color.color_SettingViews_test_text_title, activityRule.activity.resources ) ) @@ -53,7 +53,7 @@ class SeekbarSettingAttributesTests { onView(withId(R.id.tv_desc)).check( matches( withTextColor( - R.color.test_text_description, + R.color.color_SettingViews_test_text_description, activityRule.activity.resources ) ) @@ -66,7 +66,7 @@ class SeekbarSettingAttributesTests { onView(withId(R.id.tv_title)).check( matches( withTextColor( - R.color.test_text_disabled, + R.color.color_SettingViews_test_text_disabled, activityRule.activity.resources ) ) @@ -79,7 +79,7 @@ class SeekbarSettingAttributesTests { onView(withId(R.id.tv_desc)).check( matches( withTextColor( - R.color.test_text_disabled, + R.color.color_SettingViews_test_text_disabled, activityRule.activity.resources ) ) @@ -95,7 +95,7 @@ class SeekbarSettingAttributesTests { fun test_Seekbar_Max_SetFromAttributes() { activityRule.runOnUiThread { assert(activityRule.activity.ses.getMax() - == activityRule.activity.resources.getInteger(R.integer.test_seekbar_max)) + == activityRule.activity.resources.getInteger(R.integer.SettingViews_test_seekbar_max)) } } @@ -103,7 +103,7 @@ class SeekbarSettingAttributesTests { fun test_Seekbar_Progress_SetFromAttributes() { activityRule.runOnUiThread { assert(activityRule.activity.ses.getPosition() - == activityRule.activity.resources.getInteger(R.integer.test_seekbar_progress)) + == activityRule.activity.resources.getInteger(R.integer.SettingViews_test_seekbar_progress)) } } diff --git a/settingviews/src/androidTest/java/com/awolity/settingviews/SeekbarSettingDefaultValuesTests.kt b/settingviews/src/androidTest/java/com/awolity/settingviews/SeekbarSettingDefaultValuesTests.kt index 009f9c3..d4ae2cd 100644 --- a/settingviews/src/androidTest/java/com/awolity/settingviews/SeekbarSettingDefaultValuesTests.kt +++ b/settingviews/src/androidTest/java/com/awolity/settingviews/SeekbarSettingDefaultValuesTests.kt @@ -40,7 +40,7 @@ class SeekbarSettingDefaultValuesTests { onView(withId(R.id.tv_title)).check( matches( TextColorMatcher.withTextColor( - R.color.text_title, + R.color.color_SettingViews_text_title, activityRule.activity.resources ) ) @@ -52,7 +52,7 @@ class SeekbarSettingDefaultValuesTests { onView(withId(R.id.tv_desc)).check( matches( TextColorMatcher.withTextColor( - R.color.text_description, + R.color.color_SettingViews_text_description, activityRule.activity.resources ) ) @@ -71,7 +71,7 @@ class SeekbarSettingDefaultValuesTests { onView(withId(R.id.tv_title)).check( matches( TextColorMatcher.withTextColor( - R.color.text_disabled, + R.color.color_SettingViews_text_disabled, activityRule.activity.resources ) ) @@ -84,7 +84,7 @@ class SeekbarSettingDefaultValuesTests { onView(withId(R.id.tv_desc)).check( matches( TextColorMatcher.withTextColor( - R.color.text_disabled, + R.color.color_SettingViews_text_disabled, activityRule.activity.resources ) ) diff --git a/settingviews/src/androidTest/java/com/awolity/settingviews/SeekbarSettingSaveStateTests.kt b/settingviews/src/androidTest/java/com/awolity/settingviews/SeekbarSettingSaveStateTests.kt index d7d5cf9..3ced7e3 100644 --- a/settingviews/src/androidTest/java/com/awolity/settingviews/SeekbarSettingSaveStateTests.kt +++ b/settingviews/src/androidTest/java/com/awolity/settingviews/SeekbarSettingSaveStateTests.kt @@ -3,7 +3,6 @@ package com.awolity.settingviews import android.content.Intent import android.content.pm.ActivityInfo import androidx.test.espresso.Espresso.onView -import androidx.test.espresso.action.ViewActions.click import androidx.test.espresso.assertion.ViewAssertions.matches import androidx.test.espresso.matcher.ViewMatchers.* import androidx.test.rule.ActivityTestRule @@ -13,11 +12,7 @@ import org.junit.Rule import org.junit.Test import org.junit.runner.RunWith import com.awolity.settingviews.TextColorMatcher.withTextColor -import kotlinx.android.synthetic.main.activity_mock_defaults_bs.* -import kotlinx.android.synthetic.main.activity_mock_defaults_rs.* import kotlinx.android.synthetic.main.activity_mock_defaults_ses.* -import org.hamcrest.CoreMatchers.not -import java.lang.IllegalStateException @RunWith(AndroidJUnit4::class) class SeekbarSettingSaveStateTests { @@ -44,13 +39,13 @@ class SeekbarSettingSaveStateTests { @Test fun setTitleColor_Rotate_lookTitleColor() { activityRule.runOnUiThread { - activityRule.activity.ses.setTitleTextColor(activityRule.activity.getColor(R.color.test_text_title)) + activityRule.activity.ses.setTitleTextColor(activityRule.activity.getColor(R.color.color_SettingViews_test_text_title)) rotate() } onView(withId(R.id.tv_title)).check( matches( withTextColor( - R.color.test_text_title, + R.color.color_SettingViews_test_text_title, activityRule.activity.resources ) ) @@ -69,13 +64,13 @@ class SeekbarSettingSaveStateTests { @Test fun setDescriptionColor_Rotate_lookDescriptionColor() { activityRule.runOnUiThread { - activityRule.activity.ses.setDescriptionTextColor(activityRule.activity.getColor(R.color.test_text_description)) + activityRule.activity.ses.setDescriptionTextColor(activityRule.activity.getColor(R.color.color_SettingViews_test_text_description)) rotate() } onView(withId(R.id.tv_desc)).check( matches( withTextColor( - R.color.test_text_description, + R.color.color_SettingViews_test_text_description, activityRule.activity.resources ) ) diff --git a/settingviews/src/androidTest/java/com/awolity/settingviews/SeekbarSettingSetFromCodeTests.kt b/settingviews/src/androidTest/java/com/awolity/settingviews/SeekbarSettingSetFromCodeTests.kt index ffeeb4a..084dfde 100644 --- a/settingviews/src/androidTest/java/com/awolity/settingviews/SeekbarSettingSetFromCodeTests.kt +++ b/settingviews/src/androidTest/java/com/awolity/settingviews/SeekbarSettingSetFromCodeTests.kt @@ -43,7 +43,7 @@ class SeekbarSettingSetFromCodeTests { onView(withId(R.id.tv_title)).check( matches( withTextColor( - R.color.text_disabled, + R.color.color_SettingViews_text_disabled, activityRule.activity.resources ) ) @@ -56,7 +56,7 @@ class SeekbarSettingSetFromCodeTests { onView(withId(R.id.tv_desc)).check( matches( withTextColor( - R.color.text_disabled, + R.color.color_SettingViews_text_disabled, activityRule.activity.resources ) ) @@ -86,7 +86,7 @@ class SeekbarSettingSetFromCodeTests { activityRule.activity.ses.isEnabled = false activityRule.activity.ses.isEnabled = true } - onView(withId(R.id.tv_title)).check(matches(withTextColor(R.color.text_title, activityRule.activity.resources))) + onView(withId(R.id.tv_title)).check(matches(withTextColor(R.color.color_SettingViews_text_title, activityRule.activity.resources))) } @Test @@ -98,7 +98,7 @@ class SeekbarSettingSetFromCodeTests { onView(withId(R.id.tv_desc)).check( matches( withTextColor( - R.color.text_description, + R.color.color_SettingViews_text_description, activityRule.activity.resources ) ) @@ -126,13 +126,13 @@ class SeekbarSettingSetFromCodeTests { @Test fun setTitleColor_lookTitleColor() { activityRule.runOnUiThread { - activityRule.activity.ses.setTitleTextColor(activityRule.activity.getColor(R.color.test_text_title)) + activityRule.activity.ses.setTitleTextColor(activityRule.activity.getColor(R.color.color_SettingViews_test_text_title)) activityRule.activity.ses.setTitle(title) } onView(withId(R.id.tv_title)).check( matches( withTextColor( - R.color.test_text_title, + R.color.color_SettingViews_test_text_title, activityRule.activity.resources ) ) @@ -142,12 +142,12 @@ class SeekbarSettingSetFromCodeTests { @Test fun setDescriptionColor_lookDescriptionColor() { activityRule.runOnUiThread { - activityRule.activity.ses.setDescriptionTextColor(activityRule.activity.getColor(R.color.test_text_description)) + activityRule.activity.ses.setDescriptionTextColor(activityRule.activity.getColor(R.color.color_SettingViews_test_text_description)) } onView(withId(R.id.tv_desc)).check( matches( withTextColor( - R.color.test_text_description, + R.color.color_SettingViews_test_text_description, activityRule.activity.resources ) ) @@ -159,12 +159,12 @@ class SeekbarSettingSetFromCodeTests { activityRule.runOnUiThread { activityRule.activity.ses.setTitle(title) activityRule.activity.ses.isEnabled = false - activityRule.activity.ses.setDisabledTextColor(activityRule.activity.getColor(R.color.test_text_disabled)) + activityRule.activity.ses.setDisabledTextColor(activityRule.activity.getColor(R.color.color_SettingViews_test_text_disabled)) } onView(withId(R.id.tv_title)).check( matches( withTextColor( - R.color.test_text_disabled, + R.color.color_SettingViews_test_text_disabled, activityRule.activity.resources ) ) @@ -174,14 +174,14 @@ class SeekbarSettingSetFromCodeTests { @Test fun setDisabledColorDescription_lookDisabledColorDescription() { activityRule.runOnUiThread { - activityRule.activity.ses.setDisabledTextColor(activityRule.activity.getColor(R.color.test_text_disabled)) + activityRule.activity.ses.setDisabledTextColor(activityRule.activity.getColor(R.color.color_SettingViews_test_text_disabled)) activityRule.activity.ses.isEnabled = false activityRule.activity.ses.setDescription(description) } onView(withId(R.id.tv_desc)).check( matches( withTextColor( - R.color.test_text_disabled, + R.color.color_SettingViews_test_text_disabled, activityRule.activity.resources ) ) diff --git a/settingviews/src/androidTest/java/com/awolity/settingviews/SwitchSettingAttributesTests.kt b/settingviews/src/androidTest/java/com/awolity/settingviews/SwitchSettingAttributesTests.kt index b7601ce..e2ea92c 100644 --- a/settingviews/src/androidTest/java/com/awolity/settingviews/SwitchSettingAttributesTests.kt +++ b/settingviews/src/androidTest/java/com/awolity/settingviews/SwitchSettingAttributesTests.kt @@ -8,7 +8,6 @@ import androidx.test.rule.ActivityTestRule import androidx.test.runner.AndroidJUnit4 import com.awolity.settingviews.TextColorMatcher.withTextColor import kotlinx.android.synthetic.main.activity_mock_attributes_ss.* -import kotlinx.android.synthetic.main.activity_mock_defaults_ses.* import org.junit.Before import org.junit.Rule import org.junit.Test @@ -29,12 +28,12 @@ class SwitchSettingAttributesTests { @Test fun test_titleText_SetFromAttributes() { - onView(withId(R.id.tv_title)).check(matches(withText(R.string.test_title))) + onView(withId(R.id.tv_title)).check(matches(withText(R.string.SettingViews_test_title))) } @Test fun test_Description_TextSetFromAttributes() { - onView(withId(R.id.tv_desc)).check(matches(withText(R.string.test_description))) + onView(withId(R.id.tv_desc)).check(matches(withText(R.string.SettingViews_test_description))) } @Test @@ -42,7 +41,7 @@ class SwitchSettingAttributesTests { onView(withId(R.id.tv_title)).check( matches( withTextColor( - R.color.test_text_title, + R.color.color_SettingViews_test_text_title, activityRule.activity.resources ) ) @@ -54,7 +53,7 @@ class SwitchSettingAttributesTests { onView(withId(R.id.tv_desc)).check( matches( withTextColor( - R.color.test_text_description, + R.color.color_SettingViews_test_text_description, activityRule.activity.resources ) ) @@ -67,7 +66,7 @@ class SwitchSettingAttributesTests { onView(withId(R.id.tv_title)).check( matches( withTextColor( - R.color.test_text_disabled, + R.color.color_SettingViews_test_text_disabled, activityRule.activity.resources ) ) @@ -80,7 +79,7 @@ class SwitchSettingAttributesTests { onView(withId(R.id.tv_desc)).check( matches( withTextColor( - R.color.test_text_disabled, + R.color.color_SettingViews_test_text_disabled, activityRule.activity.resources ) ) diff --git a/settingviews/src/androidTest/java/com/awolity/settingviews/SwitchSettingDefaultValuesTests.kt b/settingviews/src/androidTest/java/com/awolity/settingviews/SwitchSettingDefaultValuesTests.kt index dac630e..00efbd5 100644 --- a/settingviews/src/androidTest/java/com/awolity/settingviews/SwitchSettingDefaultValuesTests.kt +++ b/settingviews/src/androidTest/java/com/awolity/settingviews/SwitchSettingDefaultValuesTests.kt @@ -6,7 +6,6 @@ import androidx.test.espresso.assertion.ViewAssertions.matches import androidx.test.espresso.matcher.ViewMatchers.* import androidx.test.rule.ActivityTestRule import androidx.test.runner.AndroidJUnit4 -import kotlinx.android.synthetic.main.activity_mock_defaults_ses.* import kotlinx.android.synthetic.main.activity_mock_defaults_ss.* import org.junit.Before import org.junit.Rule @@ -41,7 +40,7 @@ class SwitchSettingDefaultValuesTests { onView(withId(R.id.tv_title)).check( matches( TextColorMatcher.withTextColor( - R.color.text_title, + R.color.color_SettingViews_text_title, activityRule.activity.resources ) ) @@ -53,7 +52,7 @@ class SwitchSettingDefaultValuesTests { onView(withId(R.id.tv_desc)).check( matches( TextColorMatcher.withTextColor( - R.color.text_description, + R.color.color_SettingViews_text_description, activityRule.activity.resources ) ) @@ -72,7 +71,7 @@ class SwitchSettingDefaultValuesTests { onView(withId(R.id.tv_title)).check( matches( TextColorMatcher.withTextColor( - R.color.text_disabled, + R.color.color_SettingViews_text_disabled, activityRule.activity.resources ) ) @@ -85,7 +84,7 @@ class SwitchSettingDefaultValuesTests { onView(withId(R.id.tv_desc)).check( matches( TextColorMatcher.withTextColor( - R.color.text_disabled, + R.color.color_SettingViews_text_disabled, activityRule.activity.resources ) ) diff --git a/settingviews/src/androidTest/java/com/awolity/settingviews/SwitchSettingSaveStateTests.kt b/settingviews/src/androidTest/java/com/awolity/settingviews/SwitchSettingSaveStateTests.kt index 3998ba2..2a95f7c 100644 --- a/settingviews/src/androidTest/java/com/awolity/settingviews/SwitchSettingSaveStateTests.kt +++ b/settingviews/src/androidTest/java/com/awolity/settingviews/SwitchSettingSaveStateTests.kt @@ -3,7 +3,6 @@ package com.awolity.settingviews import android.content.Intent import android.content.pm.ActivityInfo import androidx.test.espresso.Espresso.onView -import androidx.test.espresso.action.ViewActions.click import androidx.test.espresso.assertion.ViewAssertions.matches import androidx.test.espresso.matcher.ViewMatchers.* import androidx.test.rule.ActivityTestRule @@ -13,12 +12,7 @@ import org.junit.Rule import org.junit.Test import org.junit.runner.RunWith import com.awolity.settingviews.TextColorMatcher.withTextColor -import kotlinx.android.synthetic.main.activity_mock_defaults_bs.* -import kotlinx.android.synthetic.main.activity_mock_defaults_rs.* -import kotlinx.android.synthetic.main.activity_mock_defaults_ses.* import kotlinx.android.synthetic.main.activity_mock_defaults_ss.* -import org.hamcrest.CoreMatchers.not -import java.lang.IllegalStateException @RunWith(AndroidJUnit4::class) class SwitchSettingSaveStateTests { @@ -45,13 +39,13 @@ class SwitchSettingSaveStateTests { @Test fun setTitleColor_Rotate_lookTitleColor() { activityRule.runOnUiThread { - activityRule.activity.ss.setTitleTextColor(activityRule.activity.getColor(R.color.test_text_title)) + activityRule.activity.ss.setTitleTextColor(activityRule.activity.getColor(R.color.color_SettingViews_test_text_title)) rotate() } onView(withId(R.id.tv_title)).check( matches( withTextColor( - R.color.test_text_title, + R.color.color_SettingViews_test_text_title, activityRule.activity.resources ) ) @@ -70,13 +64,13 @@ class SwitchSettingSaveStateTests { @Test fun setDescriptionColor_Rotate_lookDescriptionColor() { activityRule.runOnUiThread { - activityRule.activity.ss.setDescriptionTextColor(activityRule.activity.getColor(R.color.test_text_description)) + activityRule.activity.ss.setDescriptionTextColor(activityRule.activity.getColor(R.color.color_SettingViews_test_text_description)) rotate() } onView(withId(R.id.tv_desc)).check( matches( withTextColor( - R.color.test_text_description, + R.color.color_SettingViews_test_text_description, activityRule.activity.resources ) ) diff --git a/settingviews/src/androidTest/java/com/awolity/settingviews/SwitchSettingSetFromCodeTests.kt b/settingviews/src/androidTest/java/com/awolity/settingviews/SwitchSettingSetFromCodeTests.kt index fdf16c7..28830fa 100644 --- a/settingviews/src/androidTest/java/com/awolity/settingviews/SwitchSettingSetFromCodeTests.kt +++ b/settingviews/src/androidTest/java/com/awolity/settingviews/SwitchSettingSetFromCodeTests.kt @@ -44,7 +44,7 @@ class SwitchSettingSetFromCodeTests { onView(withId(R.id.tv_title)).check( matches( withTextColor( - R.color.text_disabled, + R.color.color_SettingViews_text_disabled, activityRule.activity.resources ) ) @@ -57,7 +57,7 @@ class SwitchSettingSetFromCodeTests { onView(withId(R.id.tv_desc)).check( matches( withTextColor( - R.color.text_disabled, + R.color.color_SettingViews_text_disabled, activityRule.activity.resources ) ) @@ -87,7 +87,7 @@ class SwitchSettingSetFromCodeTests { activityRule.activity.ss.isEnabled = false activityRule.activity.ss.isEnabled = true } - onView(withId(R.id.tv_title)).check(matches(withTextColor(R.color.text_title, activityRule.activity.resources))) + onView(withId(R.id.tv_title)).check(matches(withTextColor(R.color.color_SettingViews_text_title, activityRule.activity.resources))) } @Test @@ -99,7 +99,7 @@ class SwitchSettingSetFromCodeTests { onView(withId(R.id.tv_desc)).check( matches( withTextColor( - R.color.text_description, + R.color.color_SettingViews_text_description, activityRule.activity.resources ) ) @@ -127,13 +127,13 @@ class SwitchSettingSetFromCodeTests { @Test fun setTitleColor_lookTitleColor() { activityRule.runOnUiThread { - activityRule.activity.ss.setTitleTextColor(activityRule.activity.getColor(R.color.test_text_title)) + activityRule.activity.ss.setTitleTextColor(activityRule.activity.getColor(R.color.color_SettingViews_test_text_title)) activityRule.activity.ss.setTitle(title) } onView(withId(R.id.tv_title)).check( matches( withTextColor( - R.color.test_text_title, + R.color.color_SettingViews_test_text_title, activityRule.activity.resources ) ) @@ -143,12 +143,12 @@ class SwitchSettingSetFromCodeTests { @Test fun setDescriptionColor_lookDescriptionColor() { activityRule.runOnUiThread { - activityRule.activity.ss.setDescriptionTextColor(activityRule.activity.getColor(R.color.test_text_description)) + activityRule.activity.ss.setDescriptionTextColor(activityRule.activity.getColor(R.color.color_SettingViews_test_text_description)) } onView(withId(R.id.tv_desc)).check( matches( withTextColor( - R.color.test_text_description, + R.color.color_SettingViews_test_text_description, activityRule.activity.resources ) ) @@ -160,12 +160,12 @@ class SwitchSettingSetFromCodeTests { activityRule.runOnUiThread { activityRule.activity.ss.setTitle(title) activityRule.activity.ss.isEnabled = false - activityRule.activity.ss.setDisabledTextColor(activityRule.activity.getColor(R.color.test_text_disabled)) + activityRule.activity.ss.setDisabledTextColor(activityRule.activity.getColor(R.color.color_SettingViews_test_text_disabled)) } onView(withId(R.id.tv_title)).check( matches( withTextColor( - R.color.test_text_disabled, + R.color.color_SettingViews_test_text_disabled, activityRule.activity.resources ) ) @@ -175,14 +175,14 @@ class SwitchSettingSetFromCodeTests { @Test fun setDisabledColorDescription_lookDisabledColorDescription() { activityRule.runOnUiThread { - activityRule.activity.ss.setDisabledTextColor(activityRule.activity.getColor(R.color.test_text_disabled)) + activityRule.activity.ss.setDisabledTextColor(activityRule.activity.getColor(R.color.color_SettingViews_test_text_disabled)) activityRule.activity.ss.isEnabled = false activityRule.activity.ss.setDescription(description) } onView(withId(R.id.tv_desc)).check( matches( withTextColor( - R.color.test_text_disabled, + R.color.color_SettingViews_test_text_disabled, activityRule.activity.resources ) ) diff --git a/settingviews/src/main/java/com/awolity/settingviews/ButtonSetting.kt b/settingviews/src/main/java/com/awolity/settingviews/ButtonSetting.kt index 0364cd3..d0d4c89 100644 --- a/settingviews/src/main/java/com/awolity/settingviews/ButtonSetting.kt +++ b/settingviews/src/main/java/com/awolity/settingviews/ButtonSetting.kt @@ -12,7 +12,6 @@ import android.view.animation.DecelerateInterpolator import android.widget.FrameLayout import android.widget.ImageView import android.widget.TextView -import androidx.annotation.StyleRes import androidx.constraintlayout.widget.ConstraintLayout import androidx.core.content.ContextCompat.getColor @@ -92,18 +91,18 @@ class ButtonSetting @JvmOverloads constructor( private fun setColorsFromAttributes(a: TypedArray) { disabledTextColor = a.getColor( R.styleable.ButtonSetting_disabledColor, - getColor(context, R.color.text_disabled) + getColor(context, R.color.color_SettingViews_text_disabled) ) titleTextColor = a.getColor( R.styleable.ButtonSetting_titleTextColor, - getColor(context, R.color.text_title) + getColor(context, R.color.color_SettingViews_text_title) ) titleTextView!!.setTextColor(titleTextColor) descriptionTextColor = a.getColor( R.styleable.ButtonSetting_descriptionTextColor, - getColor(context, R.color.text_description) + getColor(context, R.color.color_SettingViews_text_description) ) descriptionTextView!!.setTextColor(descriptionTextColor) } diff --git a/settingviews/src/main/java/com/awolity/settingviews/RadiogroupSetting.kt b/settingviews/src/main/java/com/awolity/settingviews/RadiogroupSetting.kt index a80a832..1e6f428 100644 --- a/settingviews/src/main/java/com/awolity/settingviews/RadiogroupSetting.kt +++ b/settingviews/src/main/java/com/awolity/settingviews/RadiogroupSetting.kt @@ -56,24 +56,24 @@ class RadiogroupSetting @JvmOverloads constructor( private fun setColorsFromAttributes(a: TypedArray) { disabledTextColor = a.getColor( R.styleable.RadiogroupSetting_disabledColor, - getColor(context, R.color.text_disabled) + getColor(context, R.color.color_SettingViews_text_disabled) ) titleTextColor = a.getColor( R.styleable.RadiogroupSetting_titleTextColor, - getColor(context, R.color.text_title) + getColor(context, R.color.color_SettingViews_text_title) ) titleTextView!!.setTextColor(titleTextColor) descriptionTextColor = a.getColor( R.styleable.RadiogroupSetting_descriptionTextColor, - getColor(context, R.color.text_description) + getColor(context, R.color.color_SettingViews_text_description) ) descriptionTextView!!.setTextColor(descriptionTextColor) radioButtonLabelTextColor = a.getColor( R.styleable.RadiogroupSetting_radioButtonLabelTextColor, - getColor(context, R.color.text_description) + getColor(context, R.color.color_SettingViews_text_description) ) setRadioButtonLabelColor(radioButtonLabelTextColor) } @@ -155,7 +155,7 @@ class RadiogroupSetting @JvmOverloads constructor( firstButton!!.isChecked = false secondButton!!.isChecked = true } else { - throw IllegalArgumentException(context.getString(R.string.radiogroup_setting_illegal_selected)) + throw IllegalArgumentException(context.getString(R.string.SettingViews_radiogroup_setting_illegal_selected)) } } diff --git a/settingviews/src/main/java/com/awolity/settingviews/SeekbarSetting.kt b/settingviews/src/main/java/com/awolity/settingviews/SeekbarSetting.kt index 26a81a1..091487b 100644 --- a/settingviews/src/main/java/com/awolity/settingviews/SeekbarSetting.kt +++ b/settingviews/src/main/java/com/awolity/settingviews/SeekbarSetting.kt @@ -54,18 +54,18 @@ class SeekbarSetting @JvmOverloads constructor( private fun setColorsFromAttributes(a: TypedArray) { disabledTextColor = a.getColor( R.styleable.SeekbarSetting_disabledColor, - getColor(context, R.color.text_disabled) + getColor(context, R.color.color_SettingViews_text_disabled) ) titleTextColor = a.getColor( R.styleable.SeekbarSetting_titleTextColor, - getColor(context, R.color.text_title) + getColor(context, R.color.color_SettingViews_text_title) ) titleTextView!!.setTextColor(titleTextColor) descriptionTextColor = a.getColor( R.styleable.SeekbarSetting_descriptionTextColor, - getColor(context, R.color.text_description) + getColor(context, R.color.color_SettingViews_text_description) ) descriptionTextView!!.setTextColor(descriptionTextColor) } diff --git a/settingviews/src/main/java/com/awolity/settingviews/SwitchSetting.kt b/settingviews/src/main/java/com/awolity/settingviews/SwitchSetting.kt index 5955939..c710912 100644 --- a/settingviews/src/main/java/com/awolity/settingviews/SwitchSetting.kt +++ b/settingviews/src/main/java/com/awolity/settingviews/SwitchSetting.kt @@ -59,17 +59,17 @@ class SwitchSetting @JvmOverloads constructor( private fun setColorsFromAttributes(a: TypedArray) { disabledTextColor = a.getColor( R.styleable.SwitchSetting_disabledColor, - getColor(context, R.color.text_disabled) + getColor(context, R.color.color_SettingViews_text_disabled) ) titleTextColor = a.getColor( R.styleable.SwitchSetting_titleTextColor, - getColor(context, R.color.text_title) + getColor(context, R.color.color_SettingViews_text_title) ) titleTextView!!.setTextColor(titleTextColor) descriptionTextColor = a.getColor( R.styleable.SwitchSetting_descriptionTextColor, - getColor(context, R.color.text_description) + getColor(context, R.color.color_SettingViews_text_description) ) descriptionTextView!!.setTextColor(descriptionTextColor) } diff --git a/settingviews/src/main/res/layout/activity_mock_attributes_bs.xml b/settingviews/src/main/res/layout/activity_mock_attributes_bs.xml index 46e3856..862f936 100644 --- a/settingviews/src/main/res/layout/activity_mock_attributes_bs.xml +++ b/settingviews/src/main/res/layout/activity_mock_attributes_bs.xml @@ -9,12 +9,12 @@ android:id="@+id/bs" android:layout_width="match_parent" android:layout_height="wrap_content" - custom:titleText="@string/test_title" - custom:descriptionText="@string/test_description" + custom:titleText="@string/SettingViews_test_title" + custom:descriptionText="@string/SettingViews_test_description" custom:iconDrawableResource="@drawable/test_ic_android" - custom:disabledColor="@color/test_text_disabled" - custom:titleTextColor="@color/test_text_title" - custom:descriptionTextColor="@color/test_text_description" + custom:disabledColor="@color/color_SettingViews_test_text_disabled" + custom:titleTextColor="@color/color_SettingViews_test_text_title" + custom:descriptionTextColor="@color/color_SettingViews_test_text_description" custom:checkmarkDrawableResource="@drawable/test_ic_check_red" custom:isCheckable="true" custom:checked="true"/> diff --git a/settingviews/src/main/res/layout/activity_mock_attributes_rs.xml b/settingviews/src/main/res/layout/activity_mock_attributes_rs.xml index bdd17b1..6f11053 100644 --- a/settingviews/src/main/res/layout/activity_mock_attributes_rs.xml +++ b/settingviews/src/main/res/layout/activity_mock_attributes_rs.xml @@ -9,14 +9,14 @@ android:id="@+id/rs" android:layout_width="match_parent" android:layout_height="wrap_content" - custom:titleText="@string/test_title" - custom:descriptionText="@string/test_description" + custom:titleText="@string/SettingViews_test_title" + custom:descriptionText="@string/SettingViews_test_description" custom:iconDrawableResource="@drawable/test_ic_android" - custom:disabledColor="@color/test_text_disabled" - custom:titleTextColor="@color/test_text_title" - custom:descriptionTextColor="@color/test_text_description" + custom:disabledColor="@color/color_SettingViews_test_text_disabled" + custom:titleTextColor="@color/color_SettingViews_test_text_title" + custom:descriptionTextColor="@color/color_SettingViews_test_text_description" custom:selected="1" - custom:radioButtonLabelTextColor="@color/test_text_radiobutton_label" - custom:firstRadioButtonText="@string/test_text_1" - custom:secondRadioButtonText="@string/test_text_2"/> + custom:radioButtonLabelTextColor="@color/color_SettingViews_test_text_radiobutton_label" + custom:firstRadioButtonText="@string/SettingViews_test_text_1" + custom:secondRadioButtonText="@string/SettingViews_test_text_2"/> \ No newline at end of file diff --git a/settingviews/src/main/res/layout/activity_mock_attributes_ses.xml b/settingviews/src/main/res/layout/activity_mock_attributes_ses.xml index 4969349..82115ef 100644 --- a/settingviews/src/main/res/layout/activity_mock_attributes_ses.xml +++ b/settingviews/src/main/res/layout/activity_mock_attributes_ses.xml @@ -9,12 +9,12 @@ android:id="@+id/ses" android:layout_width="match_parent" android:layout_height="wrap_content" - custom:titleText="@string/test_title" - custom:descriptionText="@string/test_description" + custom:titleText="@string/SettingViews_test_title" + custom:descriptionText="@string/SettingViews_test_description" custom:iconDrawableResource="@drawable/test_ic_android" - custom:disabledColor="@color/test_text_disabled" - custom:titleTextColor="@color/test_text_title" - custom:descriptionTextColor="@color/test_text_description" - custom:seekbarMax="@integer/test_seekbar_max" - custom:seekbarProgress="@integer/test_seekbar_progress"/> + custom:disabledColor="@color/color_SettingViews_test_text_disabled" + custom:titleTextColor="@color/color_SettingViews_test_text_title" + custom:descriptionTextColor="@color/color_SettingViews_test_text_description" + custom:seekbarMax="@integer/SettingViews_test_seekbar_max" + custom:seekbarProgress="@integer/SettingViews_test_seekbar_progress"/> \ No newline at end of file diff --git a/settingviews/src/main/res/layout/activity_mock_attributes_ss.xml b/settingviews/src/main/res/layout/activity_mock_attributes_ss.xml index 64e8600..4839d32 100644 --- a/settingviews/src/main/res/layout/activity_mock_attributes_ss.xml +++ b/settingviews/src/main/res/layout/activity_mock_attributes_ss.xml @@ -9,12 +9,12 @@ android:id="@+id/ss" android:layout_width="match_parent" android:layout_height="wrap_content" - custom:titleText="@string/test_title" - custom:descriptionText="@string/test_description" + custom:titleText="@string/SettingViews_test_title" + custom:descriptionText="@string/SettingViews_test_description" custom:iconDrawableResource="@drawable/test_ic_android" - custom:disabledColor="@color/test_text_disabled" - custom:titleTextColor="@color/test_text_title" - custom:descriptionTextColor="@color/test_text_description" + custom:disabledColor="@color/color_SettingViews_test_text_disabled" + custom:titleTextColor="@color/color_SettingViews_test_text_title" + custom:descriptionTextColor="@color/color_SettingViews_test_text_description" custom:checkmarkDrawableResource="@drawable/test_ic_check_red" custom:checked="true"/> diff --git a/settingviews/src/main/res/values/colors.xml b/settingviews/src/main/res/values/colors.xml index 7fb4906..5684171 100644 --- a/settingviews/src/main/res/values/colors.xml +++ b/settingviews/src/main/res/values/colors.xml @@ -1,15 +1,15 @@ - #9E9E9E - #616161 - #00BCD4 + #9E9E9E + #616161 + #00BCD4 - @android:color/secondary_text_light - @android:color/tertiary_text_light - @android:color/primary_text_light + @android:color/secondary_text_light + @android:color/tertiary_text_light + @android:color/primary_text_light - #FF0000 - #00FF00 - #0000FF - #00ffFF + #FF0000 + #00FF00 + #0000FF + #00ffFF diff --git a/settingviews/src/main/res/values/integers.xml b/settingviews/src/main/res/values/integers.xml index d91e349..f35a526 100644 --- a/settingviews/src/main/res/values/integers.xml +++ b/settingviews/src/main/res/values/integers.xml @@ -1,5 +1,5 @@ - 200 - 99 + 200 + 99 \ No newline at end of file diff --git a/settingviews/src/main/res/values/strings.xml b/settingviews/src/main/res/values/strings.xml index 64f2aed..1730d68 100644 --- a/settingviews/src/main/res/values/strings.xml +++ b/settingviews/src/main/res/values/strings.xml @@ -1,12 +1,10 @@ - Icon of setting - Checkmark of setting - Illegal value for selected radiobutton - - Title text - Description text, a little longer, can be multiple lines, lorem ipsum dolor sit amet - text 1 - text 2 - + Icon of setting + Checkmark of setting + Illegal value for selected radiobutton + Title text + Description text, a little longer, can be multiple lines, lorem ipsum dolor sit amet + text 1 + text 2 diff --git a/settingviews/src/main/res/values/styles.xml b/settingviews/src/main/res/values/styles.xml index 40835ac..d3ee3ad 100644 --- a/settingviews/src/main/res/values/styles.xml +++ b/settingviews/src/main/res/values/styles.xml @@ -2,9 +2,9 @@ com.awolity.SettingViews.