Skip to content

Commit b423652

Browse files
authored
Theme Patch (#1)
1 parent 5627685 commit b423652

27 files changed

+88
-242
lines changed

app/src/main/AndroidManifest.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,8 @@
1313
android:theme="@style/Theme.Catppuccin"
1414
tools:targetApi="31">
1515
<activity
16-
android:name=".MainActivity"
16+
android:name=".CatppuccinActivity"
1717
android:exported="true"
18-
android:label="@string/app_name"
1918
android:theme="@style/Theme.Catppuccin">
2019
<intent-filter>
2120
<action android:name="android.intent.action.MAIN" />
36.5 KB
Loading

app/src/main/java/com/shifthackz/catppuccin/app/MainActivity.kt renamed to app/src/main/java/com/shifthackz/catppuccin/app/CatppuccinActivity.kt

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,31 @@ import androidx.compose.foundation.layout.fillMaxSize
77
import androidx.compose.material3.Surface
88
import androidx.compose.material3.Text
99
import androidx.compose.runtime.Composable
10+
import androidx.compose.runtime.getValue
11+
import androidx.compose.runtime.mutableStateOf
12+
import androidx.compose.runtime.remember
13+
import androidx.compose.runtime.setValue
1014
import androidx.compose.ui.Modifier
1115
import com.shifthackz.catppuccin.app.ui.ButtonsExample
12-
import com.shifthackz.catppuccin.app.ui.TypographyExample
1316
import com.shifthackz.catppuccin.palette.Catppuccin
1417
import com.shifthackz.catppuccin.compose.CatppuccinTheme
18+
import com.shifthackz.catppuccin.palette.CatppuccinPalette
19+
20+
class CatppuccinActivity : ComponentActivity() {
1521

16-
class MainActivity : ComponentActivity() {
1722
override fun onCreate(savedInstanceState: Bundle?) {
1823
super.onCreate(savedInstanceState)
1924
setContent {
20-
CatppuccinTheme {
25+
var palette by remember {
26+
mutableStateOf<CatppuccinPalette>(Catppuccin.Latte)
27+
}
28+
CatppuccinTheme.Palette(
29+
palette = palette,
30+
) {
31+
palette = Catppuccin.Mocha
2132
Surface {
2233
ButtonsExample(
23-
palette = Catppuccin.Latte,
34+
palette = palette,
2435
)
2536
}
2637
}
@@ -39,4 +50,3 @@ fun Greeting(name: String, modifier: Modifier = Modifier) {
3950
)
4051
}
4152
}
42-

app/src/main/java/com/shifthackz/catppuccin/app/ui/ButtonsExample.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import com.shifthackz.catppuccin.palette.CatppuccinPalette
2727
fun ButtonsExample(
2828
palette: CatppuccinPalette,
2929
) {
30-
CatppuccinTheme(palette = palette) {
30+
CatppuccinTheme.Palette(palette = palette) {
3131
Surface(
3232
modifier = Modifier.fillMaxSize(),
3333
color = MaterialTheme.colorScheme.background,

app/src/main/java/com/shifthackz/catppuccin/app/ui/TypographyExample.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import com.shifthackz.catppuccin.palette.CatppuccinPalette
1919
fun TypographyExample(
2020
palette: CatppuccinPalette,
2121
) {
22-
CatppuccinTheme(palette = palette) {
22+
CatppuccinTheme.Palette(palette = palette) {
2323
Surface(
2424
modifier = Modifier.fillMaxSize(),
2525
color = MaterialTheme.colorScheme.background,

app/src/main/res/drawable-v24/ic_launcher_foreground.xml

Lines changed: 0 additions & 30 deletions
This file was deleted.

app/src/main/res/drawable/ic_launcher_background.xml

Lines changed: 0 additions & 170 deletions
This file was deleted.
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
3-
<background android:drawable="@drawable/ic_launcher_background" />
4-
<foreground android:drawable="@drawable/ic_launcher_foreground" />
5-
<monochrome android:drawable="@drawable/ic_launcher_foreground" />
3+
<background android:drawable="@color/ic_launcher_background"/>
4+
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
65
</adaptive-icon>
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
3-
<background android:drawable="@drawable/ic_launcher_background" />
4-
<foreground android:drawable="@drawable/ic_launcher_foreground" />
5-
<monochrome android:drawable="@drawable/ic_launcher_foreground" />
3+
<background android:drawable="@color/ic_launcher_background"/>
4+
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
65
</adaptive-icon>
1.38 KB
Loading

0 commit comments

Comments
 (0)