Skip to content

Commit

Permalink
feat: 完善统计功能,增加多时段报告
Browse files Browse the repository at this point in the history
  • Loading branch information
MeanZhang committed Jan 4, 2025
2 parents c406e78 + 386d09a commit 14a7ad3
Show file tree
Hide file tree
Showing 33 changed files with 1,827 additions and 680 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/android-build-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ jobs:
- name: 构建检查
env:
KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
KEY_ALIAS: ${{ secrets.ALIAS }}
KEY_ALIAS: ${{ vars.KEY_ALIAS }}
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
run: chmod +x gradlew && ./gradlew assembleDebug
7 changes: 2 additions & 5 deletions .github/workflows/android-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,10 @@ jobs:
- name: 构建并签名
env:
KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
KEY_ALIAS: ${{ secrets.ALIAS }}
KEY_ALIAS: ${{ vars.KEY_ALIAS }}
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
run: chmod +x gradlew && ./gradlew assembleRelease

- name: 重命名 APK
run: python3 ci.py rename

- name: 上传 APK
uses: actions/upload-artifact@v4
with:
Expand All @@ -42,6 +39,6 @@ jobs:
- name: 发送 APK 到企业微信
uses: MeanZhang/[email protected]
with:
key: ${{ secrets.KEY }}
key: ${{ secrets.WEWORK_BOT_KEY }}
msgtype: "file"
content: composeApp/build/outputs/apk/release/*.apk
2 changes: 1 addition & 1 deletion .github/workflows/android-format-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@ jobs:
- name: 格式检查
env:
KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
KEY_ALIAS: ${{ secrets.ALIAS }}
KEY_ALIAS: ${{ vars.KEY_ALIAS }}
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
run: chmod +x gradlew && ./gradlew spotlessCheck
8 changes: 8 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions .idea/runConfigurations.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@
- [x] 数据持久化保存,重启后可继续计时
- [x] 数据可备份和恢复
- [x] 适配深色模式
- [x] 数据统计
- [ ] 快捷方式(Shortcuts)
- [ ] 微件
- [ ] 数据统计
- [ ] ……

## 平台支持
Expand Down Expand Up @@ -77,8 +77,8 @@
### 统计

<div align="center">
<img src="docs/images/ui/desktop-statistics.webp" width="64%"alt="桌面-s" />
<img src="docs/images/ui/android-statistics.webp" width="23.2%" alt="Android-统计" />
<img src="docs/images/ui/desktop-statistics.webp" width="65.6%"alt="桌面-统计" />
<img src="docs/images/ui/android-statistics.webp" width="21.5%" alt="Android-统计" />
</div>

### 设置
Expand Down
26 changes: 18 additions & 8 deletions composeApp/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ plugins {
alias(libs.plugins.compose.compiler)
alias(libs.plugins.ksp)
alias(libs.plugins.room)
alias(libs.plugins.hilt)
}

kotlin {
Expand All @@ -18,7 +17,6 @@ kotlin {
}

androidTarget {
@OptIn(ExperimentalKotlinGradlePluginApi::class)
compilerOptions {
jvmTarget.set(JvmTarget.JVM_17)
}
Expand All @@ -36,6 +34,8 @@ kotlin {
implementation(libs.accompanist.permissions)
// material-components
implementation(libs.androidx.material)
// Lets-Plot
// implementation(libs.skiko.android)
}
commonMain.dependencies {
implementation(compose.runtime)
Expand All @@ -57,12 +57,11 @@ kotlin {
implementation(libs.sqlite.bundled)
// Coil(Compose的Image会缺角)
implementation(libs.coil.compose)
implementation(libs.coil.svg)
// DataStore
implementation(libs.datastore.preferences.core)
// Kermit日志
implementation(libs.kermit)
// Hilt
implementation(libs.hilt.android)
// TimePicker
implementation(project(":timepicker"))
// FileKit
Expand All @@ -71,10 +70,16 @@ kotlin {
implementation(libs.vico.compose)
// Koala Plot
implementation(libs.koalaplot.core)
// Lets-Plot
// implementation(libs.lets.plot.kotlin.kernel)
// implementation(libs.lets.plot.common)
// implementation(libs.lets.plot.compose)
}
desktopMain.dependencies {
implementation(compose.desktop.currentOs)
implementation(libs.kotlinx.coroutines.swing)
// Lets-Plot
// implementation(libs.platf.awt)
}
}
}
Expand All @@ -91,8 +96,8 @@ android {
applicationId = "com.mean.traclock"
minSdk = libs.versions.android.minSdk.get().toInt()
targetSdk = libs.versions.android.targetSdk.get().toInt()
versionCode = 3
versionName = "1.0.0"
versionCode = 4
versionName = "1.3.0"
vectorDrawables {
useSupportLibrary = true
}
Expand Down Expand Up @@ -134,6 +139,13 @@ android {
signingConfig = signingConfigs.getByName("debug-mean")
}
}
applicationVariants.configureEach {
outputs.configureEach {
val newFileName = "${rootProject.name.replace(" ", "_")}-${name}-${versionName}.apk"
(this as com.android.build.gradle.internal.api.BaseVariantOutputImpl).outputFileName =
newFileName
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
Expand Down Expand Up @@ -175,8 +187,6 @@ compose.desktop {
dependencies {
// Room
add("kspCommonMainMetadata", libs.room.compiler)
// Hilt
add("kspCommonMainMetadata", libs.hilt.android.compiler)
}

tasks.withType<org.jetbrains.kotlin.gradle.dsl.KotlinCompile<*>>().configureEach {
Expand Down
Loading

0 comments on commit 14a7ad3

Please sign in to comment.