Skip to content

Commit

Permalink
Fixed font style not work with edit mode
Browse files Browse the repository at this point in the history
Added splash screen
  • Loading branch information
Z-Siqi committed Sep 14, 2023
1 parent c827e36 commit 0987691
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 4 deletions.
6 changes: 4 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ android {
applicationId "com.sqz.writingboard"
minSdk 31
targetSdk 34
versionCode 13
versionName "0.1.0"
versionCode 15
versionName "0.1.5"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
Expand Down Expand Up @@ -70,4 +70,6 @@ dependencies {
implementation "androidx.navigation:navigation-compose:2.7.2"
//datastore
implementation "androidx.datastore:datastore-preferences:1.0.0"
//splashscreen
implementation "androidx.core:core-splashscreen:1.0.1"
}
4 changes: 2 additions & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.WritingBoard"
android:theme="@style/Theme.WritingBoard.Starting"
android:localeConfig="@xml/locales_config"
tools:targetApi="31">
<activity
android:name=".MainActivity"
android:exported="true"
android:label="@string/app_name"
android:theme="@style/Theme.WritingBoard">
android:theme="@style/Theme.WritingBoard.Starting">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

Expand Down
7 changes: 7 additions & 0 deletions app/src/main/java/com/sqz/writingboard/ui/WritingBoardText.kt
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,13 @@ fun WritingBoardText(
style = TextStyle.Default.copy(
fontSize = fontSize,
fontWeight = FontWeight.SemiBold,
fontFamily = when (settingState.readSegmentedButtonState("font_style", context)) {
0 -> FontFamily.Monospace
1 -> FontFamily.Default
2 -> FontFamily.Serif
3 -> FontFamily.Cursive
else -> FontFamily.Default
},
color = MaterialTheme.colorScheme.secondary
)
)
Expand Down
10 changes: 10 additions & 0 deletions app/src/main/res/values/splashs.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Theme.WritingBoard.Starting" parent="Theme.SplashScreen">
<item name="windowSplashScreenAnimatedIcon">@drawable/ic_launcher_foreground</item>
<item name="windowSplashScreenBackground">@android:color/system_accent2_100</item>
<item name="postSplashScreenTheme">@style/Theme.WritingBoard</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowActionBar">false</item>
</style>
</resources>

0 comments on commit 0987691

Please sign in to comment.