Browse Source

Move theme to its own module

pull/4/head
Benoit Marty 2 years ago
parent
commit
1020726780
  1. 1
      app/build.gradle
  2. 1
      libraries/ui/theme/.gitignore
  3. 53
      libraries/ui/theme/build.gradle
  4. 0
      libraries/ui/theme/consumer-rules.pro
  5. 21
      libraries/ui/theme/proguard-rules.pro
  6. 24
      libraries/ui/theme/src/androidTest/java/io/element/android/x/theme/ExampleInstrumentedTest.kt
  7. 4
      libraries/ui/theme/src/main/AndroidManifest.xml
  8. 0
      libraries/ui/theme/src/main/java/io/element/android/x/ui/theme/Color.kt
  9. 0
      libraries/ui/theme/src/main/java/io/element/android/x/ui/theme/Theme.kt
  10. 0
      libraries/ui/theme/src/main/java/io/element/android/x/ui/theme/Type.kt
  11. 0
      libraries/ui/theme/src/main/res/drawable-v24/ic_launcher_foreground.xml
  12. 0
      libraries/ui/theme/src/main/res/drawable/ic_launcher_background.xml
  13. 0
      libraries/ui/theme/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
  14. 0
      libraries/ui/theme/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
  15. 0
      libraries/ui/theme/src/main/res/mipmap-hdpi/ic_launcher.webp
  16. 0
      libraries/ui/theme/src/main/res/mipmap-hdpi/ic_launcher_round.webp
  17. 0
      libraries/ui/theme/src/main/res/mipmap-mdpi/ic_launcher.webp
  18. 0
      libraries/ui/theme/src/main/res/mipmap-mdpi/ic_launcher_round.webp
  19. 0
      libraries/ui/theme/src/main/res/mipmap-xhdpi/ic_launcher.webp
  20. 0
      libraries/ui/theme/src/main/res/mipmap-xhdpi/ic_launcher_round.webp
  21. 0
      libraries/ui/theme/src/main/res/mipmap-xxhdpi/ic_launcher.webp
  22. 0
      libraries/ui/theme/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp
  23. 0
      libraries/ui/theme/src/main/res/mipmap-xxxhdpi/ic_launcher.webp
  24. 0
      libraries/ui/theme/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp
  25. 0
      libraries/ui/theme/src/main/res/values/colors.xml
  26. 0
      libraries/ui/theme/src/main/res/values/strings.xml
  27. 0
      libraries/ui/theme/src/main/res/values/themes.xml
  28. 0
      libraries/ui/theme/src/main/res/xml/backup_rules.xml
  29. 0
      libraries/ui/theme/src/main/res/xml/data_extraction_rules.xml
  30. 17
      libraries/ui/theme/src/test/java/io/element/android/x/theme/ExampleUnitTest.kt
  31. 1
      settings.gradle

1
app/build.gradle

@ -47,6 +47,7 @@ android { @@ -47,6 +47,7 @@ android {
}
dependencies {
implementation project(":libraries:ui:theme")
implementation 'androidx.core:core-ktx:1.9.0'
implementation "androidx.compose.ui:ui:$compose_version"

1
libraries/ui/theme/.gitignore vendored

@ -0,0 +1 @@ @@ -0,0 +1 @@
/build

53
libraries/ui/theme/build.gradle

@ -0,0 +1,53 @@ @@ -0,0 +1,53 @@
plugins {
id 'com.android.library'
id 'org.jetbrains.kotlin.android'
}
android {
namespace 'io.element.android.x.theme'
compileSdk 33
defaultConfig {
minSdk 29
targetSdk 33
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles "consumer-rules.pro"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
buildFeatures {
compose true
}
composeOptions {
kotlinCompilerExtensionVersion compose_version
}
kotlinOptions {
jvmTarget = '1.8'
}
}
dependencies {
implementation 'androidx.core:core-ktx:1.9.0'
implementation 'androidx.appcompat:appcompat:1.5.1'
implementation 'com.google.android.material:material:1.6.1'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
implementation "androidx.compose.ui:ui:$compose_version"
implementation 'androidx.compose.material3:material3:1.0.0-rc01'
implementation "androidx.compose.ui:ui-tooling-preview:$compose_version"
androidTestImplementation "androidx.compose.ui:ui-test-junit4:$compose_version"
debugImplementation "androidx.compose.ui:ui-tooling:$compose_version"
debugImplementation "androidx.compose.ui:ui-test-manifest:$compose_version"
}

0
libraries/ui/theme/consumer-rules.pro

21
libraries/ui/theme/proguard-rules.pro vendored

@ -0,0 +1,21 @@ @@ -0,0 +1,21 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile

24
libraries/ui/theme/src/androidTest/java/io/element/android/x/theme/ExampleInstrumentedTest.kt

@ -0,0 +1,24 @@ @@ -0,0 +1,24 @@
package io.element.android.x.theme
import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.ext.junit.runners.AndroidJUnit4
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.Assert.*
/**
* Instrumented test, which will execute on an Android device.
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
@RunWith(AndroidJUnit4::class)
class ExampleInstrumentedTest {
@Test
fun useAppContext() {
// Context of the app under test.
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
assertEquals("io.element.android.x.theme.test", appContext.packageName)
}
}

4
libraries/ui/theme/src/main/AndroidManifest.xml

@ -0,0 +1,4 @@ @@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
</manifest>

0
app/src/main/java/io/element/android/x/ui/theme/Color.kt → libraries/ui/theme/src/main/java/io/element/android/x/ui/theme/Color.kt

0
app/src/main/java/io/element/android/x/ui/theme/Theme.kt → libraries/ui/theme/src/main/java/io/element/android/x/ui/theme/Theme.kt

0
app/src/main/java/io/element/android/x/ui/theme/Type.kt → libraries/ui/theme/src/main/java/io/element/android/x/ui/theme/Type.kt

0
app/src/main/res/drawable-v24/ic_launcher_foreground.xml → libraries/ui/theme/src/main/res/drawable-v24/ic_launcher_foreground.xml

0
app/src/main/res/drawable/ic_launcher_background.xml → libraries/ui/theme/src/main/res/drawable/ic_launcher_background.xml

0
app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml → libraries/ui/theme/src/main/res/mipmap-anydpi-v26/ic_launcher.xml

0
app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml → libraries/ui/theme/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml

0
app/src/main/res/mipmap-hdpi/ic_launcher.webp → libraries/ui/theme/src/main/res/mipmap-hdpi/ic_launcher.webp

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

0
app/src/main/res/mipmap-hdpi/ic_launcher_round.webp → libraries/ui/theme/src/main/res/mipmap-hdpi/ic_launcher_round.webp

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

0
app/src/main/res/mipmap-mdpi/ic_launcher.webp → libraries/ui/theme/src/main/res/mipmap-mdpi/ic_launcher.webp

Before

Width:  |  Height:  |  Size: 982 B

After

Width:  |  Height:  |  Size: 982 B

0
app/src/main/res/mipmap-mdpi/ic_launcher_round.webp → libraries/ui/theme/src/main/res/mipmap-mdpi/ic_launcher_round.webp

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

0
app/src/main/res/mipmap-xhdpi/ic_launcher.webp → libraries/ui/theme/src/main/res/mipmap-xhdpi/ic_launcher.webp

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

0
app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp → libraries/ui/theme/src/main/res/mipmap-xhdpi/ic_launcher_round.webp

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

0
app/src/main/res/mipmap-xxhdpi/ic_launcher.webp → libraries/ui/theme/src/main/res/mipmap-xxhdpi/ic_launcher.webp

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

0
app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp → libraries/ui/theme/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp

Before

Width:  |  Height:  |  Size: 5.8 KiB

After

Width:  |  Height:  |  Size: 5.8 KiB

0
app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp → libraries/ui/theme/src/main/res/mipmap-xxxhdpi/ic_launcher.webp

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

0
app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp → libraries/ui/theme/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp

Before

Width:  |  Height:  |  Size: 7.6 KiB

After

Width:  |  Height:  |  Size: 7.6 KiB

0
app/src/main/res/values/colors.xml → libraries/ui/theme/src/main/res/values/colors.xml

0
app/src/main/res/values/strings.xml → libraries/ui/theme/src/main/res/values/strings.xml

0
app/src/main/res/values/themes.xml → libraries/ui/theme/src/main/res/values/themes.xml

0
app/src/main/res/xml/backup_rules.xml → libraries/ui/theme/src/main/res/xml/backup_rules.xml

0
app/src/main/res/xml/data_extraction_rules.xml → libraries/ui/theme/src/main/res/xml/data_extraction_rules.xml

17
libraries/ui/theme/src/test/java/io/element/android/x/theme/ExampleUnitTest.kt

@ -0,0 +1,17 @@ @@ -0,0 +1,17 @@
package io.element.android.x.theme
import org.junit.Test
import org.junit.Assert.*
/**
* Example local unit test, which will execute on the development machine (host).
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
class ExampleUnitTest {
@Test
fun addition_isCorrect() {
assertEquals(4, 2 + 2)
}
}

1
settings.gradle

@ -14,3 +14,4 @@ dependencyResolutionManagement { @@ -14,3 +14,4 @@ dependencyResolutionManagement {
}
rootProject.name = "ElementX"
include ':app'
include ':libraries:ui:theme'

Loading…
Cancel
Save