mirror of
https://github.com/Kunzisoft/KeePassDX.git
synced 2026-11-26 20:06:37 -08:00
fix: Remove AndroidX dependency and format code
This commit is contained in:
1 parent
e1ecebb4a0
commit
81930bf3a1
12 files changed
+88
-69
No files matched your search
@@ -19,16 +19,20 @@
|
||||
*/
|
||||
package com.kunzisoft.keepass.database.element
|
||||
|
||||
import android.content.res.Resources
|
||||
import android.os.Parcel
|
||||
import android.os.Parcelable
|
||||
import androidx.core.os.ConfigurationCompat
|
||||
import com.kunzisoft.keepass.utils.readEnum
|
||||
import com.kunzisoft.keepass.utils.writeEnum
|
||||
import org.joda.time.*
|
||||
import java.text.DateFormat
|
||||
import org.joda.time.Duration
|
||||
import org.joda.time.Instant
|
||||
import org.joda.time.LocalDate
|
||||
import org.joda.time.LocalDateTime
|
||||
import org.joda.time.LocalTime
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.*
|
||||
import java.util.Calendar
|
||||
import java.util.Date
|
||||
import java.util.Locale
|
||||
import java.util.TimeZone
|
||||
|
||||
class DateInstant : Parcelable {
|
||||
|
||||
@@ -122,25 +126,6 @@ class DateInstant : Parcelable {
|
||||
dest.writeEnum(mType)
|
||||
}
|
||||
|
||||
fun getDateTimeString(resources: Resources): String {
|
||||
val locale = ConfigurationCompat.getLocales(resources.configuration)[0] ?: Locale.ROOT
|
||||
return when (mType) {
|
||||
Type.DATE -> DateFormat.getDateInstance(
|
||||
DateFormat.MEDIUM,
|
||||
locale)
|
||||
.format(jDate)
|
||||
Type.TIME -> DateFormat.getTimeInstance(
|
||||
DateFormat.SHORT,
|
||||
locale)
|
||||
.format(jDate)
|
||||
else -> DateFormat.getDateTimeInstance(
|
||||
DateFormat.MEDIUM,
|
||||
DateFormat.SHORT,
|
||||
locale)
|
||||
.format(jDate)
|
||||
}
|
||||
}
|
||||
|
||||
fun getYearInt(): Int {
|
||||
val dateFormat = SimpleDateFormat("yyyy", Locale.ENGLISH)
|
||||
return dateFormat.format(date).toInt()
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
package com.kunzisoft.keepass.model
|
||||
|
||||
import androidx.annotation.StringRes
|
||||
|
||||
data class ProgressMessage(
|
||||
@StringRes
|
||||
var titleId: Int,
|
||||
@StringRes
|
||||
var messageId: Int? = null,
|
||||
@StringRes
|
||||
var warningId: Int? = null,
|
||||
var cancelable: (() -> Unit)? = null
|
||||
)
|
||||
@@ -19,12 +19,12 @@
|
||||
*/
|
||||
package com.kunzisoft.keepass.utils;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import static com.kunzisoft.keepass.utils.StreamBytesUtilsKt.uuidTo16Bytes;
|
||||
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public class UuidUtil {
|
||||
|
||||
public static @Nullable String toHexString(@Nullable UUID uuid) {
|
||||
|
||||
Reference in new issue
Block a user