From 2bf5e9efde28cce8186b2cdf75d8fafb6c9125ad Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Sun, 9 Jul 2017 00:46:24 -0700 Subject: Clean up and optimize --- kpref-activity/build.gradle | 10 +-------- .../ca/allanwang/kau/ExampleInstrumentedTest.java | 26 ---------------------- .../kau/kpref/activity/items/KPrefItemBase.kt | 2 +- .../kau/kpref/activity/items/KPrefItemCore.kt | 2 +- .../kau/kpref/activity/items/KPrefPlainText.kt | 2 +- .../kau/kpref/activity/items/KPrefSeekbar.kt | 2 +- .../kau/kpref/activity/items/KPrefSubItems.kt | 2 +- .../kau/kpref/activity/items/KPrefText.kt | 2 +- kpref-activity/src/main/res/values/strings.xml | 3 --- .../java/ca/allanwang/kau/ExampleUnitTest.java | 17 -------------- 10 files changed, 7 insertions(+), 61 deletions(-) delete mode 100644 kpref-activity/src/androidTest/java/ca/allanwang/kau/ExampleInstrumentedTest.java delete mode 100644 kpref-activity/src/main/res/values/strings.xml delete mode 100644 kpref-activity/src/test/java/ca/allanwang/kau/ExampleUnitTest.java (limited to 'kpref-activity') diff --git a/kpref-activity/build.gradle b/kpref-activity/build.gradle index dac2b69..80be774 100644 --- a/kpref-activity/build.gradle +++ b/kpref-activity/build.gradle @@ -1,23 +1,15 @@ -apply from: '../android.gradle' +apply from: '../android-lib.gradle' android { resourcePrefix "kau_" } dependencies { - compile fileTree(dir: 'libs', include: ['*.jar']) - androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { - exclude group: 'com.android.support', module: 'support-annotations' - }) - testCompile 'junit:junit:4.12' compile project(':core-ui') compile project(':adapter') compile project(':colorpicker') - compile "org.jetbrains.kotlin:kotlin-stdlib:${KOTLIN}" - testCompile "org.jetbrains.kotlin:kotlin-test-junit:${KOTLIN}" - } apply from: '../artifacts.gradle' diff --git a/kpref-activity/src/androidTest/java/ca/allanwang/kau/ExampleInstrumentedTest.java b/kpref-activity/src/androidTest/java/ca/allanwang/kau/ExampleInstrumentedTest.java deleted file mode 100644 index 7b079b2..0000000 --- a/kpref-activity/src/androidTest/java/ca/allanwang/kau/ExampleInstrumentedTest.java +++ /dev/null @@ -1,26 +0,0 @@ -package ca.allanwang.kau; - -import android.content.Context; -import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; - -import org.junit.Test; -import org.junit.runner.RunWith; - -import static org.junit.Assert.*; - -/** - * Instrumentation test, which will execute on an Android device. - * - * @see Testing documentation - */ -@RunWith(AndroidJUnit4.class) -public class ExampleInstrumentedTest { - @Test - public void useAppContext() throws Exception { - // Context of the app under test. - Context appContext = InstrumentationRegistry.getTargetContext(); - - assertEquals("ca.allanwang.kau.test", appContext.getPackageName()); - } -} diff --git a/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefItemBase.kt b/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefItemBase.kt index ac54cb0..e21d483 100644 --- a/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefItemBase.kt +++ b/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefItemBase.kt @@ -2,8 +2,8 @@ package ca.allanwang.kau.kpref.activity.items import android.support.annotation.CallSuper import android.view.View -import ca.allanwang.kau.kpref.activity.R import ca.allanwang.kau.kpref.activity.GlobalOptions +import ca.allanwang.kau.kpref.activity.R import ca.allanwang.kau.utils.resolveDrawable /** diff --git a/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefItemCore.kt b/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefItemCore.kt index 61d5ea3..908c139 100644 --- a/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefItemCore.kt +++ b/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefItemCore.kt @@ -11,11 +11,11 @@ import android.view.ViewGroup import android.widget.ImageView import android.widget.LinearLayout import android.widget.TextView -import ca.allanwang.kau.kpref.activity.R import ca.allanwang.kau.adapters.ThemableIItem import ca.allanwang.kau.adapters.ThemableIItemDelegate import ca.allanwang.kau.kpref.activity.GlobalOptions import ca.allanwang.kau.kpref.activity.KPrefMarker +import ca.allanwang.kau.kpref.activity.R import ca.allanwang.kau.utils.* import com.mikepenz.fastadapter.items.AbstractItem import com.mikepenz.iconics.typeface.IIcon diff --git a/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefPlainText.kt b/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefPlainText.kt index c0afe13..b83df69 100644 --- a/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefPlainText.kt +++ b/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefPlainText.kt @@ -1,8 +1,8 @@ package ca.allanwang.kau.kpref.activity.items import android.view.View -import ca.allanwang.kau.kpref.activity.R import ca.allanwang.kau.kpref.activity.GlobalOptions +import ca.allanwang.kau.kpref.activity.R /** * Created by Allan Wang on 2017-06-14. diff --git a/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefSeekbar.kt b/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefSeekbar.kt index 6ca7fcd..f1429e7 100644 --- a/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefSeekbar.kt +++ b/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefSeekbar.kt @@ -3,9 +3,9 @@ package ca.allanwang.kau.kpref.activity.items import android.view.View import android.widget.SeekBar import android.widget.TextView -import ca.allanwang.kau.kpref.activity.R import ca.allanwang.kau.kpref.KPrefException import ca.allanwang.kau.kpref.activity.GlobalOptions +import ca.allanwang.kau.kpref.activity.R import ca.allanwang.kau.utils.tint /** diff --git a/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefSubItems.kt b/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefSubItems.kt index 9081ec8..9313a3f 100644 --- a/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefSubItems.kt +++ b/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefSubItems.kt @@ -1,9 +1,9 @@ package ca.allanwang.kau.kpref.activity.items import android.view.View -import ca.allanwang.kau.kpref.activity.R import ca.allanwang.kau.kpref.activity.GlobalOptions import ca.allanwang.kau.kpref.activity.KPrefAdapterBuilder +import ca.allanwang.kau.kpref.activity.R /** * Created by Allan Wang on 2017-06-14. diff --git a/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefText.kt b/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefText.kt index a1603ce..277a842 100644 --- a/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefText.kt +++ b/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefText.kt @@ -2,8 +2,8 @@ package ca.allanwang.kau.kpref.activity.items import android.view.View import android.widget.TextView -import ca.allanwang.kau.kpref.activity.R import ca.allanwang.kau.kpref.activity.GlobalOptions +import ca.allanwang.kau.kpref.activity.R import ca.allanwang.kau.utils.toast /** diff --git a/kpref-activity/src/main/res/values/strings.xml b/kpref-activity/src/main/res/values/strings.xml deleted file mode 100644 index 0402364..0000000 --- a/kpref-activity/src/main/res/values/strings.xml +++ /dev/null @@ -1,3 +0,0 @@ - - kpref-activity - diff --git a/kpref-activity/src/test/java/ca/allanwang/kau/ExampleUnitTest.java b/kpref-activity/src/test/java/ca/allanwang/kau/ExampleUnitTest.java deleted file mode 100644 index a29b447..0000000 --- a/kpref-activity/src/test/java/ca/allanwang/kau/ExampleUnitTest.java +++ /dev/null @@ -1,17 +0,0 @@ -package ca.allanwang.kau; - -import org.junit.Test; - -import static org.junit.Assert.*; - -/** - * Example local unit test, which will execute on the development machine (host). - * - * @see Testing documentation - */ -public class ExampleUnitTest { - @Test - public void addition_isCorrect() throws Exception { - assertEquals(4, 2 + 2); - } -} \ No newline at end of file -- cgit v1.2.3