Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Podpora starších verzí Android (5.1+) #27

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ android {

defaultConfig {
applicationId "cz.skaut.srs.ticketsreader"
minSdk 26
minSdk 22
targetSdk 34
versionCode 4
versionName "1.1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,16 @@ import cz.skaut.srs.ticketsreader.api.ApiSerializationException
import cz.skaut.srs.ticketsreader.api.ApiUnknownErrorException
import cz.skaut.srs.ticketsreader.api.dto.TicketCheckInfo
import kotlinx.coroutines.runBlocking
import kotlinx.datetime.toJavaInstant
import org.slf4j.LoggerFactory
import java.time.ZoneId
import java.time.format.DateTimeFormatter
import java.text.SimpleDateFormat
import java.util.Locale

private const val COLOR_ORANGE = 0xffffa500;

class TicketQrProcessor(context: FragmentActivity) : QrProcessor(context) {
private val log = LoggerFactory.getLogger(this.javaClass)
private val dateTimeFormatter: DateTimeFormatter =
DateTimeFormatter.ofPattern("d. M. yyyy H:mm:ss").withZone(ZoneId.systemDefault())
private val dateTimeFormatter: SimpleDateFormat =
SimpleDateFormat("d. M. yyyy H:mm:ss", Locale.getDefault())

override fun process(value: String) {
try {
Expand Down Expand Up @@ -98,7 +97,7 @@ class TicketQrProcessor(context: FragmentActivity) : QrProcessor(context) {
.map { it.name }
.joinToString(", ")
tvChecks.text = ticketInfo.subeventChecks
.map { dateTimeFormatter.format(it.toJavaInstant()) }
.map { dateTimeFormatter.format(it.toEpochMilliseconds()) }
.joinToString("\n")

MaterialAlertDialogBuilder(context)
Expand Down
Loading