Skip to content

Commit

Permalink
VersionCode: 0.5.8
Browse files Browse the repository at this point in the history
Added night mode support to splash screen
Optimize widgets
  • Loading branch information
Z-Siqi committed Apr 11, 2024
1 parent 4e912d4 commit 5a9e1f3
Show file tree
Hide file tree
Showing 11 changed files with 50 additions and 68 deletions.
4 changes: 2 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 29
targetSdk 34
versionCode 55
versionName "0.5.8-beta2"
versionCode 58
versionName "0.5.8"
}

buildTypes {
Expand Down
Binary file modified app/release/app-release.apk
Binary file not shown.
4 changes: 2 additions & 2 deletions app/release/output-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"type": "SINGLE",
"filters": [],
"attributes": [],
"versionCode": 55,
"versionName": "0.5.8-beta2",
"versionCode": 58,
"versionName": "0.5.8",
"outputFile": "app-release.apk"
}
],
Expand Down
73 changes: 32 additions & 41 deletions app/src/main/java/com/sqz/writingboard/glance/WritingBoardWidget.kt
Original file line number Diff line number Diff line change
Expand Up @@ -78,28 +78,28 @@ class WritingBoardWidget : GlanceAppWidget() {
modifier = modifier.size(size.width - 12.dp, size.height - 8.dp)
) {
item {
Text(
text = savedText(context),
style = TextStyle(
color = GlanceTheme.colors.onSurfaceVariant,
fontWeight = if (fontFamily != 1) {
androidx.glance.text.FontWeight.Bold
} else {
androidx.glance.text.FontWeight.Medium
},
fontFamily = when (fontFamily) {
0 -> FontFamily.Monospace
1 -> null
2 -> FontFamily.Serif
3 -> FontFamily.Cursive
else -> null
}
),
modifier = modifier.fillMaxSize()
)
}
item {
Spacer(modifier = modifier.size(size.width, 45.dp))
Column {
Text(
text = savedText(context),
style = TextStyle(
color = GlanceTheme.colors.onSurfaceVariant,
fontWeight = if (fontFamily != 1) {
androidx.glance.text.FontWeight.Bold
} else {
androidx.glance.text.FontWeight.Medium
},
fontFamily = when (fontFamily) {
0 -> FontFamily.Monospace
1 -> null
2 -> FontFamily.Serif
3 -> FontFamily.Cursive
else -> null
}
),
modifier = modifier.fillMaxSize()
)
Spacer(modifier = modifier.size(size.width, 45.dp))
}
}
}
}
Expand All @@ -108,22 +108,13 @@ class WritingBoardWidget : GlanceAppWidget() {
horizontalAlignment = Alignment.End,
modifier = modifier.fillMaxSize().padding(8.dp)
) {
LazyColumn {
item {
Column(
horizontalAlignment = Alignment.End,
modifier = modifier.fillMaxWidth()
) {
Image(
provider = ImageProvider(R.drawable.widget_button),
contentDescription = LocalContext.current.getString(R.string.edit),
modifier = modifier.size(45.dp)
.clickable { openAppAction(context) },
contentScale = ContentScale.FillBounds
)
}
}
}
Image(
provider = ImageProvider(R.drawable.widget_button),
contentDescription = LocalContext.current.getString(R.string.edit),
modifier = modifier.size(45.dp).cornerRadius(12.dp)
.clickable { openAppAction(context) },
contentScale = ContentScale.FillBounds
)
}
}
}
Expand Down Expand Up @@ -156,14 +147,14 @@ class WritingBoardTextOnlyWidget : GlanceAppWidget() {

Column(
modifier = modifier
.size(size.width - 12.dp, size.height - 8.dp)
.size(size.width - 8.dp, size.height - 8.dp)
.clickable { openAppAction(context) }
) {
LazyColumn {
LazyColumn(modifier = modifier.cornerRadius(15.dp)) {
item {
Text(
text = savedText(context),
modifier = modifier.fillMaxWidth()
modifier = modifier.fillMaxWidth().padding(2.dp)
.clickable { openAppAction(context) },
style = TextStyle(
color = GlanceTheme.colors.onSurfaceVariant,
Expand Down
4 changes: 4 additions & 0 deletions app/src/main/res/values-night-v31/colors.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="SplashScreenBackground">@android:color/system_accent3_500</color>
</resources>
4 changes: 4 additions & 0 deletions app/src/main/res/values-night/colors.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="SplashScreenBackground">#FF4E616C</color>
</resources>
4 changes: 4 additions & 0 deletions app/src/main/res/values-v31/colors.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="SplashScreenBackground">@android:color/system_accent2_100</color>
</resources>
11 changes: 0 additions & 11 deletions app/src/main/res/values-v31/splashs.xml

This file was deleted.

6 changes: 0 additions & 6 deletions app/src/main/res/values-v31/strings.xml

This file was deleted.

6 changes: 1 addition & 5 deletions app/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="purple_200">#FFBB86FC</color>
<color name="purple_500">#FF6200EE</color>
<color name="purple_700">#FF3700B3</color>
<color name="teal_200">#FF03DAC5</color>
<color name="teal_700">#FF018786</color>
<color name="black">#FF000000</color>
<color name="white">#FFFFFFFF</color>
<color name="SplashScreenBackground">#FFD3E2F0</color>
</resources>
2 changes: 1 addition & 1 deletion app/src/main/res/values/splashs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<resources>
<style name="Theme.WritingBoard.Starting" parent="Theme.SplashScreen">
<item name="windowSplashScreenAnimatedIcon">@drawable/ic_launcher_foreground</item>
<item name="windowSplashScreenBackground">#D3E2F0</item>
<item name="windowSplashScreenBackground">@color/SplashScreenBackground</item>
<item name="postSplashScreenTheme">@style/Theme.WritingBoard</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowActionBar">false</item>
Expand Down

0 comments on commit 5a9e1f3

Please sign in to comment.