Skip to content

Commit

Permalink
Release 4.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
qhy040404 committed Jun 5, 2023
1 parent 56fef08 commit bd173ac
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 11 deletions.
7 changes: 7 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

v4.2.1

* 修复了晚上程序会一直卡在一个地方的bug
* 更新依赖

---

v4.2.0

* 修复了晚上程序会一直卡在一个地方的bug
Expand Down
2 changes: 1 addition & 1 deletion app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ plugins {
id("org.jetbrains.kotlin.android")
}

val baseVersionName = "4.2.0"
val baseVersionName = "4.2.1"
val commitsCount by lazy { "git rev-list --count HEAD".exec().toInt() }

android {
Expand Down
13 changes: 4 additions & 9 deletions app/src/main/java/com/qhy040404/libraryonetap/utils/TimeUtils.kt
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
package com.qhy040404.libraryonetap.utils

import com.qhy040404.datetime.Datetime
import com.qhy040404.libraryonetap.utils.extensions.one2two

object TimeUtils {
fun getToday(separator: String, doubleNum: Boolean): String {
val now = Datetime.now()
val year = now.year.toString()
val month = if (doubleNum) {
timeSingleToDouble(now.month)
now.month.one2two()
} else {
now.month.toString()
}
val day = if (doubleNum) {
timeSingleToDouble(now.day)
now.day.one2two()
} else {
now.day.toString()
}
Expand All @@ -26,12 +27,6 @@ object TimeUtils {
}

fun isServerAvailableTime(): Boolean {
return Datetime.now().hour in 6..23
}

private fun timeSingleToDouble(sTime: Int) = if (sTime >= 10) {
sTime.toString()
} else {
"0$sTime"
return Datetime.now().hour in 6 until 23
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,14 @@ fun Int.getDrawable(context: Context): Drawable? {
fun Int.getDimen(): Float {
return LibraryOneTapApp.app.resources.getDimension(this)
}

/**
* Convert an Integer from one digit to two digits
*/
fun Int.one2two(): String {
return if (this >= 10) {
"$this"
} else {
"0$this"
}
}
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ rikka-borderview = "dev.rikka.rikkax.widget:borderview:1.1.0"

drakeet-about = "com.drakeet.about:about:2.5.2"
drakeet-multitype = "com.drakeet.multitype:multitype:4.3.0"
datetime = "com.github.qhy040404:datetime:1.3.2"
datetime = "com.github.qhy040404:datetime:1.3.8"
ab-utils = "com.github.zhaobozhen.libraries:utils:1.1.4"
material = "com.google.android.material:material:1.9.0"
once = "com.jonathanfinerty.once:once:1.3.1"
Expand Down

0 comments on commit bd173ac

Please sign in to comment.