Skip to content

Commit d9b87a6

Browse files
authored
feat: Foundation concept (#2)
* Added theme concept Added accessors for the theme, including typography, dimensions, density, elevation and color * Added 'theme' package, added internal visibility modifier * Updated files to match the latest theme builder export
1 parent 637a53c commit d9b87a6

File tree

33 files changed

+2031
-9
lines changed

33 files changed

+2031
-9
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
*.iml
22
.gradle
33
.idea
4+
.vscode
5+
.kotlin
46
/local.properties
57
.DS_Store
68
/build
File renamed without changes.

components/README.md

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# :components module
2+
## Dependency graph
3+
4+
![Dependency graph](../docs/images/dependencies/dep_graph_components.svg)

components/build.gradle.kts

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
plugins {
2+
alias(libs.plugins.com.android.library)
3+
alias(libs.plugins.jetbrains.kotlin.android)
4+
alias(libs.plugins.compose.compiler)
5+
}
6+
7+
android {
8+
namespace = "com.dbsystel.designsystem.components"
9+
compileSdk = 34
10+
11+
defaultConfig {
12+
minSdk = 30
13+
14+
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
15+
consumerProguardFiles("consumer-rules.pro")
16+
}
17+
18+
buildTypes {
19+
release {
20+
isMinifyEnabled = false
21+
proguardFiles(
22+
getDefaultProguardFile("proguard-android-optimize.txt"),
23+
"proguard-rules.pro"
24+
)
25+
}
26+
}
27+
compileOptions {
28+
sourceCompatibility = JavaVersion.VERSION_1_8
29+
targetCompatibility = JavaVersion.VERSION_1_8
30+
}
31+
buildFeatures {
32+
compose = true
33+
}
34+
kotlinOptions {
35+
jvmTarget = "1.8"
36+
}
37+
}
38+
39+
dependencies {
40+
implementation(libs.androidx.core.ktx)
41+
implementation(libs.androidx.appcompat)
42+
implementation(libs.material)
43+
implementation(platform(libs.androidx.compose.bom))
44+
implementation(libs.androidx.ui)
45+
implementation(libs.androidx.material3)
46+
implementation(project(":foundation"))
47+
testImplementation(libs.junit)
48+
androidTestImplementation(libs.androidx.junit)
49+
androidTestImplementation(libs.androidx.espresso.core)
50+
}
File renamed without changes.

app/src/androidTest/java/com/dbsystel/dbuxds/ExampleInstrumentedTest.kt renamed to components/src/androidTest/java/com/dbsystel/designsystem/components/ExampleInstrumentedTest.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.dbsystel.dbuxds
1+
package com.dbsystel.designsystem.components
22

33
import androidx.test.platform.app.InstrumentationRegistry
44
import androidx.test.ext.junit.runners.AndroidJUnit4
@@ -19,6 +19,6 @@ class ExampleInstrumentedTest {
1919
fun useAppContext() {
2020
// Context of the app under test.
2121
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
22-
assertEquals("com.dbsystel.dbuxds", appContext.packageName)
22+
assertEquals("com.dbsystel.designsystem.components.test", appContext.packageName)
2323
}
2424
}
+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
3+
4+
</manifest>

app/src/test/java/com/dbsystel/dbuxds/ExampleUnitTest.kt renamed to components/src/test/java/com/dbsystel/designsystem/components/ExampleUnitTest.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.dbsystel.dbuxds
1+
package com.dbsystel.designsystem.components
22

33
import org.junit.Test
44

Loading
Loading

foundation/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build

foundation/README.md

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# :foundation module
2+
## Dependency graph
3+
4+
![Dependency graph](../docs/images/dependencies/dep_graph_foundation.svg)

app/build.gradle.kts renamed to foundation/build.gradle.kts

+9-3
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,19 @@ plugins {
55
}
66

77
android {
8-
namespace = "com.dbsystel.dbuxds"
8+
namespace = "com.dbsystel.designsystem.foundation"
99
compileSdk = 34
1010

1111
defaultConfig {
1212
minSdk = 30
13+
1314
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
15+
consumerProguardFiles("consumer-rules.pro")
1416
}
1517

1618
buildTypes {
1719
release {
18-
isMinifyEnabled = true
20+
isMinifyEnabled = false
1921
proguardFiles(
2022
getDefaultProguardFile("proguard-android-optimize.txt"),
2123
"proguard-rules.pro"
@@ -26,6 +28,9 @@ android {
2628
sourceCompatibility = JavaVersion.VERSION_1_8
2729
targetCompatibility = JavaVersion.VERSION_1_8
2830
}
31+
buildFeatures {
32+
compose = true
33+
}
2934
kotlinOptions {
3035
jvmTarget = "1.8"
3136
}
@@ -37,7 +42,8 @@ dependencies {
3742
implementation(libs.material)
3843
implementation(platform(libs.androidx.compose.bom))
3944
implementation(libs.androidx.ui)
45+
implementation(libs.androidx.material3)
4046
testImplementation(libs.junit)
4147
androidTestImplementation(libs.androidx.junit)
4248
androidTestImplementation(libs.androidx.espresso.core)
43-
}
49+
}
File renamed without changes.

foundation/proguard-rules.pro

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package com.dbsystel.designsystem.foundation
2+
3+
import androidx.test.platform.app.InstrumentationRegistry
4+
import androidx.test.ext.junit.runners.AndroidJUnit4
5+
6+
import org.junit.Test
7+
import org.junit.runner.RunWith
8+
9+
import org.junit.Assert.*
10+
11+
/**
12+
* Instrumented test, which will execute on an Android device.
13+
*
14+
* See [testing documentation](http://d.android.com/tools/testing).
15+
*/
16+
@RunWith(AndroidJUnit4::class)
17+
class ExampleInstrumentedTest {
18+
@Test
19+
fun useAppContext() {
20+
// Context of the app under test.
21+
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
22+
assertEquals("com.dbsystel.designsystem.foundation.test", appContext.packageName)
23+
}
24+
}
+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
3+
4+
</manifest>

0 commit comments

Comments
 (0)