├── app ├── .gitignore ├── src │ └── main │ │ ├── res │ │ ├── values │ │ │ ├── strings.xml │ │ │ ├── styles.xml │ │ │ └── colors.xml │ │ ├── mipmap-hdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ ├── mipmap-mdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ ├── mipmap-xhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ ├── navigation │ │ │ └── mobile_navigation.xml │ │ ├── mipmap-anydpi-v26 │ │ │ ├── ic_launcher.xml │ │ │ └── ic_launcher_round.xml │ │ ├── layout │ │ │ ├── activity_main2.xml │ │ │ └── activity_main.xml │ │ ├── drawable-v24 │ │ │ └── ic_launcher_foreground.xml │ │ └── drawable │ │ │ └── ic_launcher_background.xml │ │ ├── java │ │ └── daio │ │ │ └── io │ │ │ └── sampledresscodeapp │ │ │ ├── App.kt │ │ │ ├── MainActivity.kt │ │ │ └── Main2Activity.kt │ │ └── AndroidManifest.xml ├── proguard-rules.pro └── build.gradle ├── dresscode ├── .gitignore ├── src │ └── main │ │ ├── AndroidManifest.xml │ │ └── java │ │ └── daio │ │ └── io │ │ └── dresscode │ │ ├── DressCodeExceptions.kt │ │ ├── LifeCycleListener.kt │ │ └── DressCode.kt ├── proguard-rules.pro ├── build.gradle └── config │ └── detekt │ └── detekt.yml ├── dresscodetests ├── .gitignore ├── src │ ├── main │ │ ├── res │ │ │ ├── values │ │ │ │ ├── strings.xml │ │ │ │ ├── colors.xml │ │ │ │ └── styles.xml │ │ │ ├── mipmap-hdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-mdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-anydpi-v26 │ │ │ │ ├── ic_launcher.xml │ │ │ │ └── ic_launcher_round.xml │ │ │ ├── layout │ │ │ │ └── activity_main.xml │ │ │ ├── drawable-v24 │ │ │ │ └── ic_launcher_foreground.xml │ │ │ └── drawable │ │ │ │ └── ic_launcher_background.xml │ │ ├── java │ │ │ └── daio │ │ │ │ └── io │ │ │ │ └── dresscodetests │ │ │ │ └── DressCodeActivity.kt │ │ └── AndroidManifest.xml │ ├── androidTest │ │ └── java │ │ │ └── daio │ │ │ └── io │ │ │ └── dresscodetests │ │ │ ├── util │ │ │ └── DressCodeTestRunner.kt │ │ │ └── DressCodeThemeChangeTests.kt │ └── test │ │ └── java │ │ └── daio │ │ └── io │ │ └── dresscodetests │ │ └── DressCodeInitialiseTests.kt └── build.gradle ├── settings.gradle ├── jitpack.yml ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── .gitignore ├── .travis.yml ├── gradle.properties ├── README.md ├── gradlew.bat ├── gradlew └── LICENSE /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /dresscode/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /dresscodetests/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app', ':dresscode', ':dresscodetests' 2 | -------------------------------------------------------------------------------- /jitpack.yml: -------------------------------------------------------------------------------- 1 | jdk: 2 | - openjdk7 3 | install: 4 | - ./gradlew dresscode:detekt 5 | - ./gradlew install 6 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Daio-io/dresscode/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | SampleDressCodeApp 3 | 4 | -------------------------------------------------------------------------------- /dresscodetests/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | DressCode Test 3 | 4 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Daio-io/dresscode/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Daio-io/dresscode/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Daio-io/dresscode/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Daio-io/dresscode/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Daio-io/dresscode/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Daio-io/dresscode/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Daio-io/dresscode/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /dresscode/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Daio-io/dresscode/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Daio-io/dresscode/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Daio-io/dresscode/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /dresscodetests/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Daio-io/dresscode/HEAD/dresscodetests/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /dresscodetests/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Daio-io/dresscode/HEAD/dresscodetests/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /dresscodetests/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Daio-io/dresscode/HEAD/dresscodetests/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /dresscodetests/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Daio-io/dresscode/HEAD/dresscodetests/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /dresscodetests/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Daio-io/dresscode/HEAD/dresscodetests/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /dresscodetests/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Daio-io/dresscode/HEAD/dresscodetests/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /dresscodetests/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Daio-io/dresscode/HEAD/dresscodetests/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /dresscodetests/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Daio-io/dresscode/HEAD/dresscodetests/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /dresscodetests/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Daio-io/dresscode/HEAD/dresscodetests/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /dresscodetests/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Daio-io/dresscode/HEAD/dresscodetests/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/navigation/mobile_navigation.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Sun Jun 07 21:47:40 BST 2020 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-milestone-1-bin.zip 7 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/caches/build_file_checksums.ser 5 | /.idea/libraries 6 | /.idea/modules.xml 7 | /.idea/workspace.xml 8 | /.idea/navEditor.xml 9 | /.idea/assetWizardSettings.xml 10 | .DS_Store 11 | /build 12 | /captures 13 | .externalNativeBuild 14 | *.idea -------------------------------------------------------------------------------- /dresscode/src/main/java/daio/io/dresscode/DressCodeExceptions.kt: -------------------------------------------------------------------------------- 1 | package daio.io.dresscode 2 | 3 | import kotlin.RuntimeException 4 | 5 | class DressCodeNotRegisteredException(message: String) : RuntimeException(message) 6 | class DressCodeAlreadyInitialisedException(message: String) : RuntimeException(message) 7 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /dresscodetests/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /dresscodetests/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: android 2 | jdk: oraclejdk8 3 | 4 | android: 5 | components: 6 | - tools 7 | - platform-tools 8 | - tools 9 | - build-tools-28.0.0 10 | - build-tools-28.0.1 11 | - build-tools-28.0.2 12 | - android-28 13 | licenses: 14 | - android-sdk-preview-license-.+ 15 | - android-sdk-license-.+ 16 | - google-gdk-license-.+ 17 | 18 | script: ./gradlew dresscodetests:test dresscode:build dresscode:install dresscode:detektCheck 19 | -------------------------------------------------------------------------------- /app/src/main/java/daio/io/sampledresscodeapp/App.kt: -------------------------------------------------------------------------------- 1 | package daio.io.sampledresscodeapp 2 | 3 | import android.app.Application 4 | import daio.io.dresscode.DressCode 5 | import daio.io.dresscode.declareDressCode 6 | 7 | class App : Application() { 8 | 9 | override fun onCreate() { 10 | super.onCreate() 11 | 12 | declareDressCode( 13 | DressCode("ThemeOne", R.style.ThemeOne), 14 | DressCode("ThemeTwo", R.style.ThemeTwo) 15 | ) 16 | } 17 | } -------------------------------------------------------------------------------- /dresscodetests/src/main/java/daio/io/dresscodetests/DressCodeActivity.kt: -------------------------------------------------------------------------------- 1 | package daio.io.dresscodetests 2 | 3 | import androidx.appcompat.app.AppCompatActivity 4 | import android.os.Bundle 5 | import daio.io.dresscode.matchDressCode 6 | 7 | class DressCodeActivity : AppCompatActivity() { 8 | 9 | override fun onCreate(savedInstanceState: Bundle?) { 10 | matchDressCode() 11 | super.onCreate(savedInstanceState) 12 | setContentView(R.layout.activity_main) 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /app/src/main/java/daio/io/sampledresscodeapp/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package daio.io.sampledresscodeapp 2 | 3 | import android.content.Intent 4 | import android.os.Bundle 5 | import androidx.appcompat.app.AppCompatActivity 6 | import daio.io.dresscode.matchDressCode 7 | import kotlinx.android.synthetic.main.activity_main.* 8 | 9 | class MainActivity : AppCompatActivity() { 10 | 11 | override fun onCreate(savedInstanceState: Bundle?) { 12 | matchDressCode() 13 | super.onCreate(savedInstanceState) 14 | setContentView(R.layout.activity_main) 15 | 16 | button.setOnClickListener { 17 | Intent(this, Main2Activity::class.java) 18 | .apply(::startActivity) 19 | } 20 | 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /app/src/main/java/daio/io/sampledresscodeapp/Main2Activity.kt: -------------------------------------------------------------------------------- 1 | package daio.io.sampledresscodeapp 2 | 3 | import androidx.appcompat.app.AppCompatActivity 4 | import android.os.Bundle 5 | import daio.io.dresscode.dressCodeStyleId 6 | import daio.io.dresscode.matchDressCode 7 | import kotlinx.android.synthetic.main.activity_main2.* 8 | 9 | class Main2Activity : AppCompatActivity() { 10 | 11 | override fun onCreate(savedInstanceState: Bundle?) { 12 | matchDressCode() 13 | super.onCreate(savedInstanceState) 14 | setContentView(R.layout.activity_main2) 15 | 16 | button.setOnClickListener { 17 | dressCodeStyleId = if (dressCodeStyleId == R.style.ThemeOne) R.style.ThemeTwo else R.style.ThemeOne 18 | } 19 | } 20 | 21 | 22 | } 23 | -------------------------------------------------------------------------------- /dresscodetests/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /dresscode/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main2.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 |