Skip to content

Commit 0087b43

Browse files
committed
Add designsystem module.
1 parent d2d7a1d commit 0087b43

File tree

16 files changed

+899
-11
lines changed

16 files changed

+899
-11
lines changed

Jetcaster/app/build.gradle.kts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ dependencies {
101101

102102
implementation(libs.androidx.compose.foundation)
103103
implementation(libs.androidx.compose.material)
104+
implementation(libs.androidx.compose.material3)
104105
implementation(libs.androidx.compose.materialWindow)
105106
implementation(libs.androidx.compose.material.iconsExtended)
106107
implementation(libs.androidx.compose.ui.tooling.preview)
@@ -118,6 +119,7 @@ dependencies {
118119
implementation(libs.coil.kt.compose)
119120

120121
implementation(project(":core"))
122+
implementation(project(":designsystem"))
121123

122124
coreLibraryDesugaring(libs.core.jdk.desugaring)
123125
}

Jetcaster/app/src/main/java/com/example/jetcaster/ui/theme/Theme.kt

Lines changed: 496 additions & 0 deletions
Large diffs are not rendered by default.

Jetcaster/app/src/main/java/com/example/jetcaster/ui/theme/Type.kt

Lines changed: 103 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,9 @@ package com.example.jetcaster.ui.theme
1818

1919
import androidx.compose.material.Typography
2020
import androidx.compose.ui.text.TextStyle
21-
import androidx.compose.ui.text.font.Font
22-
import androidx.compose.ui.text.font.FontFamily
2321
import androidx.compose.ui.text.font.FontWeight
2422
import androidx.compose.ui.unit.sp
25-
import com.example.jetcaster.R
26-
27-
private val Montserrat = FontFamily(
28-
Font(R.font.montserrat_light, FontWeight.Light),
29-
Font(R.font.montserrat_regular, FontWeight.Normal),
30-
Font(R.font.montserrat_medium, FontWeight.Medium),
31-
Font(R.font.montserrat_semibold, FontWeight.SemiBold)
32-
)
23+
import com.example.jetcaster.designsystem.theme.Montserrat
3324

3425
val JetcasterTypography = Typography(
3526
h1 = TextStyle(
@@ -120,3 +111,105 @@ val JetcasterTypography = Typography(
120111
letterSpacing = 1.sp
121112
)
122113
)
114+
115+
val JetcasterTypographyM3 = androidx.compose.material3.Typography(
116+
displayLarge = TextStyle(
117+
fontFamily = Montserrat,
118+
fontSize = 57.sp,
119+
fontWeight = FontWeight.W400,
120+
lineHeight = 64.sp,
121+
letterSpacing = (-0.25).sp
122+
),
123+
displayMedium = TextStyle(
124+
fontFamily = Montserrat,
125+
fontSize = 45.sp,
126+
fontWeight = FontWeight.W400,
127+
lineHeight = 52.sp
128+
),
129+
displaySmall = TextStyle(
130+
fontFamily = Montserrat,
131+
fontSize = 36.sp,
132+
fontWeight = FontWeight.W400,
133+
lineHeight = 44.sp
134+
),
135+
headlineLarge = TextStyle(
136+
fontFamily = Montserrat,
137+
fontSize = 32.sp,
138+
fontWeight = FontWeight.W500,
139+
lineHeight = 40.sp
140+
),
141+
headlineMedium = TextStyle(
142+
fontFamily = Montserrat,
143+
fontSize = 28.sp,
144+
fontWeight = FontWeight.W500,
145+
lineHeight = 36.sp
146+
),
147+
headlineSmall = TextStyle(
148+
fontFamily = Montserrat,
149+
fontSize = 24.sp,
150+
fontWeight = FontWeight.W500,
151+
lineHeight = 32.sp
152+
),
153+
titleLarge = TextStyle(
154+
fontFamily = Montserrat,
155+
fontSize = 22.sp,
156+
fontWeight = FontWeight.W400,
157+
lineHeight = 28.sp
158+
),
159+
titleMedium = TextStyle(
160+
fontFamily = Montserrat,
161+
fontSize = 16.sp,
162+
fontWeight = FontWeight.W500,
163+
lineHeight = 24.sp,
164+
letterSpacing = 0.15.sp
165+
),
166+
titleSmall = TextStyle(
167+
fontFamily = Montserrat,
168+
fontSize = 14.sp,
169+
fontWeight = FontWeight.W500,
170+
lineHeight = 20.sp,
171+
letterSpacing = 0.1.sp
172+
),
173+
labelLarge = TextStyle(
174+
fontFamily = Montserrat,
175+
fontSize = 14.sp,
176+
fontWeight = FontWeight.W500,
177+
lineHeight = 20.sp,
178+
letterSpacing = 0.1.sp
179+
),
180+
labelMedium = TextStyle(
181+
fontFamily = Montserrat,
182+
fontSize = 12.sp,
183+
fontWeight = FontWeight.W500,
184+
lineHeight = 16.sp,
185+
letterSpacing = 0.5.sp
186+
),
187+
labelSmall = TextStyle(
188+
fontFamily = Montserrat,
189+
fontSize = 11.sp,
190+
fontWeight = FontWeight.W500,
191+
lineHeight = 16.sp,
192+
letterSpacing = 0.5.sp
193+
),
194+
bodyLarge = TextStyle(
195+
fontFamily = Montserrat,
196+
fontSize = 16.sp,
197+
fontWeight = FontWeight.W500,
198+
lineHeight = 24.sp,
199+
letterSpacing = 0.5.sp
200+
),
201+
bodyMedium = TextStyle(
202+
fontFamily = Montserrat,
203+
fontSize = 14.sp,
204+
fontWeight = FontWeight.W500,
205+
lineHeight = 20.sp,
206+
letterSpacing = 0.25.sp
207+
),
208+
bodySmall = TextStyle(
209+
fontFamily = Montserrat,
210+
fontSize = 12.sp,
211+
fontWeight = FontWeight.W500,
212+
lineHeight = 16.sp,
213+
letterSpacing = 0.4.sp
214+
),
215+
)

Jetcaster/designsystem/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
plugins {
2+
alias(libs.plugins.android.library)
3+
alias(libs.plugins.kotlin.android)
4+
}
5+
6+
// TODO(chris): Set up convention plugin
7+
android {
8+
namespace = "com.example.jetcaster.designsystem"
9+
compileSdk = libs.versions.compileSdk.get().toInt()
10+
11+
defaultConfig {
12+
minSdk = libs.versions.minSdk.get().toInt()
13+
14+
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
15+
consumerProguardFiles("consumer-rules.pro")
16+
}
17+
18+
buildTypes {
19+
release {
20+
isMinifyEnabled = false
21+
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
22+
}
23+
}
24+
compileOptions {
25+
sourceCompatibility = JavaVersion.VERSION_17
26+
targetCompatibility = JavaVersion.VERSION_17
27+
}
28+
}
29+
30+
dependencies {
31+
val composeBom = platform(libs.androidx.compose.bom)
32+
implementation(composeBom)
33+
implementation(libs.androidx.compose.ui.graphics)
34+
implementation(libs.androidx.compose.ui.text)
35+
36+
implementation(libs.androidx.core.ktx)
37+
implementation(libs.androidx.appcompat)
38+
}

Jetcaster/designsystem/consumer-rules.pro

Whitespace-only changes.
Lines changed: 21 additions & 0 deletions
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
Lines changed: 4 additions & 0 deletions
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)