-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Apollo: Release source code for 52.1
- Loading branch information
Showing
67 changed files
with
1,117 additions
and
873 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
android/apollo/src/main/java/io/muun/apollo/data/os/DateTimeZoneProvider.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package io.muun.apollo.data.os | ||
|
||
import android.content.Context | ||
import android.provider.Settings | ||
import java.util.TimeZone | ||
import javax.inject.Inject | ||
|
||
class DateTimeZoneProvider @Inject constructor(private val context: Context) { | ||
|
||
val autoTimeZone: Int | ||
get() { | ||
return Settings.Global.getInt( | ||
context.contentResolver, | ||
Settings.Global.AUTO_TIME_ZONE, | ||
-1 | ||
) | ||
} | ||
|
||
val autoDateTime: Int | ||
get() { | ||
return Settings.Global.getInt( | ||
context.contentResolver, | ||
Settings.Global.AUTO_TIME, | ||
-1 | ||
) | ||
} | ||
|
||
val timeZoneId: String | ||
get() { | ||
return TimeZone.getDefault().id.take(100) | ||
} | ||
|
||
val timeZoneOffsetSeconds: Long | ||
get() { | ||
return TimeZone.getDefault().rawOffset / 1000L | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.