Skip to content

Commit 8cbe5a0

Browse files
feat: Add Ui module
1 parent a5dd406 commit 8cbe5a0

File tree

8 files changed

+279
-0
lines changed

8 files changed

+279
-0
lines changed

Ui/build.gradle.kts

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
plugins {
2+
id("com.android.library")
3+
alias(core.plugins.kotlin.android)
4+
alias(core.plugins.compose.compiler)
5+
}
6+
7+
val coreCompileSdk: Int by rootProject.extra
8+
val legacyMinSdk: Int by rootProject.extra
9+
val javaVersion: JavaVersion by rootProject.extra
10+
11+
android {
12+
13+
namespace = "com.infomaniak.core.ui"
14+
compileSdk = coreCompileSdk
15+
16+
defaultConfig {
17+
minSdk = legacyMinSdk
18+
19+
consumerProguardFiles("consumer-rules.pro")
20+
}
21+
22+
buildTypes {
23+
release {
24+
isMinifyEnabled = false
25+
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
26+
}
27+
}
28+
29+
compileOptions {
30+
sourceCompatibility = javaVersion
31+
targetCompatibility = javaVersion
32+
}
33+
34+
kotlinOptions {
35+
jvmTarget = javaVersion.toString()
36+
}
37+
38+
buildFeatures {
39+
compose = true
40+
}
41+
}
42+
43+
dependencies {
44+
45+
implementation(core.androidx.core.ktx)
46+
implementation(core.material)
47+
implementation(core.androidx.adaptive)
48+
49+
// Compose
50+
implementation(platform(core.compose.bom))
51+
implementation(core.compose.runtime)
52+
implementation(core.compose.material3)
53+
implementation(core.compose.ui)
54+
}

Ui/proguard-rules.pro

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: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/*
2+
* Infomaniak Core - Android
3+
* Copyright (C) 2025 Infomaniak Network SA
4+
*
5+
* This program is free software: you can redistribute it and/or modify
6+
* it under the terms of the GNU General Public License as published by
7+
* the Free Software Foundation, either version 3 of the License, or
8+
* (at your option) any later version.
9+
*
10+
* This program is distributed in the hope that it will be useful,
11+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
* GNU General Public License for more details.
14+
*
15+
* You should have received a copy of the GNU General Public License
16+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
17+
*/
18+
package com.infomaniak.core.ui.theme
19+
20+
import androidx.compose.foundation.shape.CircleShape
21+
import androidx.compose.foundation.shape.RoundedCornerShape
22+
import androidx.compose.ui.unit.dp
23+
24+
object CustomShapes {
25+
val NONE = RoundedCornerShape(0)
26+
val ROUNDED = CircleShape
27+
val EXTRA_SMALL = RoundedCornerShape(4.dp)
28+
val SMALL = RoundedCornerShape(8.dp)
29+
val MEDIUM = RoundedCornerShape(16.dp)
30+
val LARGE = RoundedCornerShape(24.dp)
31+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/*
2+
* Infomaniak Core - Android
3+
* Copyright (C) 2025 Infomaniak Network SA
4+
*
5+
* This program is free software: you can redistribute it and/or modify
6+
* it under the terms of the GNU General Public License as published by
7+
* the Free Software Foundation, either version 3 of the License, or
8+
* (at your option) any later version.
9+
*
10+
* This program is distributed in the hope that it will be useful,
11+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
* GNU General Public License for more details.
14+
*
15+
* You should have received a copy of the GNU General Public License
16+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
17+
*/
18+
package com.infomaniak.core.ui.theme
19+
20+
import androidx.compose.ui.unit.dp
21+
22+
object Dimens {
23+
24+
/** 16 dp */
25+
val smallIconSize = 16.dp
26+
/** 24 dp */
27+
val iconSize = 24.dp
28+
/** 8 dp */
29+
val smallCornerRadius = 8.dp
30+
/** 16 dp */
31+
val largeCornerRadius = 16.dp
32+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/*
2+
* Infomaniak Core - Android
3+
* Copyright (C) 2025 Infomaniak Network SA
4+
*
5+
* This program is free software: you can redistribute it and/or modify
6+
* it under the terms of the GNU General Public License as published by
7+
* the Free Software Foundation, either version 3 of the License, or
8+
* (at your option) any later version.
9+
*
10+
* This program is distributed in the hope that it will be useful,
11+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
* GNU General Public License for more details.
14+
*
15+
* You should have received a copy of the GNU General Public License
16+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
17+
*/
18+
package com.infomaniak.core.ui.theme
19+
20+
import androidx.compose.ui.unit.dp
21+
22+
object Margin {
23+
/** 4dp */
24+
val Micro = 4.dp
25+
/** 8dp */
26+
val Mini = 8.dp
27+
/** 12dp */
28+
val Small = 12.dp
29+
/** 16dp */
30+
val Medium = 16.dp
31+
/** 24dp */
32+
val Large = 24.dp
33+
/** 32dp */
34+
val Huge = 32.dp
35+
/** 48dp */
36+
val Giant = 48.dp
37+
}
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
/*
2+
* Infomaniak Core - Android
3+
* Copyright (C) 2025 Infomaniak Network SA
4+
*
5+
* This program is free software: you can redistribute it and/or modify
6+
* it under the terms of the GNU General Public License as published by
7+
* the Free Software Foundation, either version 3 of the License, or
8+
* (at your option) any later version.
9+
*
10+
* This program is distributed in the hope that it will be useful,
11+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
* GNU General Public License for more details.
14+
*
15+
* You should have received a copy of the GNU General Public License
16+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
17+
*/
18+
package com.infomaniak.core.ui.theme
19+
20+
import androidx.compose.ui.text.TextStyle
21+
import androidx.compose.ui.text.font.FontFamily
22+
import androidx.compose.ui.text.font.FontWeight
23+
import androidx.compose.ui.unit.sp
24+
25+
object Typography {
26+
27+
val h1 = TextStyle(
28+
fontFamily = FontFamily.Default,
29+
fontWeight = FontWeight.SemiBold,
30+
fontSize = 22.sp,
31+
lineHeight = 28.sp,
32+
)
33+
34+
val h2 = TextStyle(
35+
fontFamily = FontFamily.Default,
36+
fontWeight = FontWeight.SemiBold,
37+
fontSize = 18.sp,
38+
lineHeight = 24.sp,
39+
)
40+
41+
val bodyMedium = TextStyle(
42+
fontFamily = FontFamily.Default,
43+
fontWeight = FontWeight.Medium,
44+
fontSize = 16.sp,
45+
lineHeight = 20.sp,
46+
)
47+
48+
val bodyRegular = TextStyle(
49+
fontFamily = FontFamily.Default,
50+
fontWeight = FontWeight.Normal,
51+
fontSize = 16.sp,
52+
lineHeight = 20.sp,
53+
)
54+
55+
val bodySmallMedium = TextStyle(
56+
fontFamily = FontFamily.Default,
57+
fontWeight = FontWeight.Medium,
58+
fontSize = 14.sp,
59+
lineHeight = 20.sp,
60+
)
61+
62+
val bodySmallRegular = TextStyle(
63+
fontFamily = FontFamily.Default,
64+
fontWeight = FontWeight.Normal,
65+
fontSize = 14.sp,
66+
lineHeight = 20.sp,
67+
)
68+
69+
val labelMedium = TextStyle(
70+
fontFamily = FontFamily.Default,
71+
fontWeight = FontWeight.Medium,
72+
fontSize = 12.sp,
73+
lineHeight = 18.sp,
74+
)
75+
76+
val labelRegular = TextStyle(
77+
fontFamily = FontFamily.Default,
78+
fontWeight = FontWeight.Normal,
79+
fontSize = 12.sp,
80+
lineHeight = 18.sp,
81+
)
82+
}

Ui/src/main/res/values/strings.xml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<!--
2+
~ Infomaniak Core - Android
3+
~ Copyright (C) 2025 Infomaniak Network SA
4+
~
5+
~ This program is free software: you can redistribute it and/or modify
6+
~ it under the terms of the GNU General Public License as published by
7+
~ the Free Software Foundation, either version 3 of the License, or
8+
~ (at your option) any later version.
9+
~
10+
~ This program is distributed in the hope that it will be useful,
11+
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
~ GNU General Public License for more details.
14+
~
15+
~ You should have received a copy of the GNU General Public License
16+
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
17+
-->
18+
<resources>
19+
<string name="app_name">Ui</string>
20+
</resources>

gradle/core.versions.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
[versions]
22
activityCompose = "1.9.3" # TODO: Bump when compileSdk will be at least 35
3+
adaptiveLayout = "1.0.0"
34
androidxCore = "1.13.1" # Doesn't build when bumped to 1.15.0 (Waiting SDK 35)
45
coil = "3.0.2"
56
coilNetworkOkhttp = "3.0.4"
@@ -25,6 +26,7 @@ splitties = "3.0.0"
2526

2627
[libraries]
2728
activity-compose = { module = "androidx.activity:activity-compose", version.ref = "activityCompose" }
29+
androidx-adaptive = { module = "androidx.compose.material3.adaptive:adaptive", version.ref = "adaptiveLayout" }
2830
androidx-core = { group = "androidx.core", name = "core", version.ref = "androidxCore" }
2931
androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "androidxCore" }
3032
androidx-lifecycle-service = { group = "androidx.lifecycle", name = "lifecycle-service", version.ref = "lifecycleRuntimeKtx" }

0 commit comments

Comments
 (0)