Compare commits
3 Commits
v2.0.9-bet
...
v2.0.9-bet
Author | SHA1 | Date | |
---|---|---|---|
06443ddddb | |||
233761a169 | |||
b81461f725 |
BIN
.idea/caches/build_file_checksums.ser
generated
BIN
.idea/caches/build_file_checksums.ser
generated
Binary file not shown.
@ -22,7 +22,7 @@ android {
|
|||||||
applicationId "com.tommasoberlose.anotherwidget"
|
applicationId "com.tommasoberlose.anotherwidget"
|
||||||
minSdkVersion 23
|
minSdkVersion 23
|
||||||
targetSdkVersion 29
|
targetSdkVersion 29
|
||||||
versionCode 90
|
versionCode 92
|
||||||
versionName "2.0.9"
|
versionName "2.0.9"
|
||||||
|
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
|
Binary file not shown.
@ -17,7 +17,6 @@
|
|||||||
|
|
||||||
<application
|
<application
|
||||||
android:allowBackup="true"
|
android:allowBackup="true"
|
||||||
android:fullBackupContent="@xml/my_backup_rules"
|
|
||||||
android:icon="@mipmap/ic_launcher"
|
android:icon="@mipmap/ic_launcher"
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
android:name=".AWApplication"
|
android:name=".AWApplication"
|
||||||
@ -25,7 +24,7 @@
|
|||||||
android:supportsRtl="true"
|
android:supportsRtl="true"
|
||||||
android:theme="@style/AppTheme"
|
android:theme="@style/AppTheme"
|
||||||
tools:ignore="LockedOrientationActivity">
|
tools:ignore="LockedOrientationActivity">
|
||||||
<activity android:name=".ui.activities.MainActivity" android:launchMode="singleInstance" android:theme="@style/AppTheme.Main">
|
<activity android:name=".ui.activities.MainActivity" android:launchMode="singleInstance" android:theme="@style/AppTheme.Main" android:screenOrientation="portrait">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN" />
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
|
||||||
@ -116,6 +115,8 @@
|
|||||||
|
|
||||||
<service android:name=".services.EventListenerJob" android:permission="android.permission.BIND_JOB_SERVICE" />
|
<service android:name=".services.EventListenerJob" android:permission="android.permission.BIND_JOB_SERVICE" />
|
||||||
|
|
||||||
|
<service android:name=".services.BatteryListenerJob" android:permission="android.permission.BIND_JOB_SERVICE" />
|
||||||
|
|
||||||
<service android:name=".receivers.MusicNotificationListener"
|
<service android:name=".receivers.MusicNotificationListener"
|
||||||
android:permission="android.permission.BIND_NOTIFICATION_LISTENER_SERVICE">
|
android:permission="android.permission.BIND_NOTIFICATION_LISTENER_SERVICE">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
@ -131,6 +132,7 @@
|
|||||||
<action android:name="android.intent.action.ACTION_POWER_DISCONNECTED"/>
|
<action android:name="android.intent.action.ACTION_POWER_DISCONNECTED"/>
|
||||||
<action android:name="android.intent.action.BATTERY_LOW"/>
|
<action android:name="android.intent.action.BATTERY_LOW"/>
|
||||||
<action android:name="android.intent.action.BATTERY_OKAY"/>
|
<action android:name="android.intent.action.BATTERY_OKAY"/>
|
||||||
|
<action android:name="android.intent.action.BATTERY_CHANGED"/>
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</receiver>
|
</receiver>
|
||||||
|
|
||||||
|
@ -22,6 +22,12 @@ class EventRepository(val context: Context) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun clearEvents() {
|
||||||
|
realm.executeTransaction { realm ->
|
||||||
|
realm.where(Event::class.java).findAll().deleteAllFromRealm()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fun resetNextEventData() {
|
fun resetNextEventData() {
|
||||||
Preferences.bulk {
|
Preferences.bulk {
|
||||||
remove(Preferences::nextEventId)
|
remove(Preferences::nextEventId)
|
||||||
|
@ -91,6 +91,7 @@ object Preferences : KotprefModel() {
|
|||||||
var showNextAlarm by booleanPref(default = true)
|
var showNextAlarm by booleanPref(default = true)
|
||||||
var showBatteryCharging by booleanPref(default = false)
|
var showBatteryCharging by booleanPref(default = false)
|
||||||
var isBatteryLevelLow by booleanPref(default = false)
|
var isBatteryLevelLow by booleanPref(default = false)
|
||||||
|
var isCharging by booleanPref(default = false)
|
||||||
var googleFitSteps by longPref(default = -1)
|
var googleFitSteps by longPref(default = -1)
|
||||||
var showDailySteps by booleanPref(default = false)
|
var showDailySteps by booleanPref(default = false)
|
||||||
|
|
||||||
|
@ -0,0 +1,23 @@
|
|||||||
|
package com.tommasoberlose.anotherwidget.helpers
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import android.content.Context.BATTERY_SERVICE
|
||||||
|
import android.os.BatteryManager
|
||||||
|
import androidx.core.content.ContextCompat.getSystemService
|
||||||
|
import com.tommasoberlose.anotherwidget.global.Preferences
|
||||||
|
|
||||||
|
|
||||||
|
object BatteryHelper {
|
||||||
|
fun updateBatteryInfo(context: Context) {
|
||||||
|
with(context.getSystemService(BATTERY_SERVICE) as BatteryManager) {
|
||||||
|
Preferences.isBatteryLevelLow = getIntProperty(BatteryManager.BATTERY_PROPERTY_CAPACITY) <= 15
|
||||||
|
Preferences.isCharging = isCharging
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun getBatteryLevel(context: Context): Int {
|
||||||
|
with(context.getSystemService(BATTERY_SERVICE) as BatteryManager) {
|
||||||
|
return getIntProperty(BatteryManager.BATTERY_PROPERTY_CAPACITY)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -102,6 +102,7 @@ object CalendarHelper {
|
|||||||
|
|
||||||
if (eventList.isEmpty()) {
|
if (eventList.isEmpty()) {
|
||||||
eventRepository.resetNextEventData()
|
eventRepository.resetNextEventData()
|
||||||
|
eventRepository.clearEvents()
|
||||||
} else {
|
} else {
|
||||||
eventList.sortWith(Comparator { event: Event, event1: Event ->
|
eventList.sortWith(Comparator { event: Event, event1: Event ->
|
||||||
if (event.allDay && event1.allDay) {
|
if (event.allDay && event1.allDay) {
|
||||||
@ -134,6 +135,7 @@ object CalendarHelper {
|
|||||||
MainWidget.updateWidget(context)
|
MainWidget.updateWidget(context)
|
||||||
|
|
||||||
EventBus.getDefault().post(MainFragment.UpdateUiMessageEvent())
|
EventBus.getDefault().post(MainFragment.UpdateUiMessageEvent())
|
||||||
|
eventRepository.close()
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getCalendarList(context: Context): List<me.everything.providers.android.calendar.Calendar> {
|
fun getCalendarList(context: Context): List<me.everything.providers.android.calendar.Calendar> {
|
||||||
|
@ -14,7 +14,6 @@ object GlanceProviderHelper {
|
|||||||
val enabledProviders = Preferences.enabledGlanceProviderOrder.split(",").filter { it != "" }
|
val enabledProviders = Preferences.enabledGlanceProviderOrder.split(",").filter { it != "" }
|
||||||
|
|
||||||
val providers = Constants.GlanceProviderId.values()
|
val providers = Constants.GlanceProviderId.values()
|
||||||
.filter { it != Constants.GlanceProviderId.BATTERY_LEVEL_LOW }
|
|
||||||
.filter {
|
.filter {
|
||||||
context.checkIfFitInstalled() || it != Constants.GlanceProviderId.GOOGLE_FIT_STEPS
|
context.checkIfFitInstalled() || it != Constants.GlanceProviderId.GOOGLE_FIT_STEPS
|
||||||
}.toTypedArray()
|
}.toTypedArray()
|
||||||
@ -68,7 +67,7 @@ object GlanceProviderHelper {
|
|||||||
Constants.GlanceProviderId.GOOGLE_FIT_STEPS -> {
|
Constants.GlanceProviderId.GOOGLE_FIT_STEPS -> {
|
||||||
GlanceProvider(providerId.id,
|
GlanceProvider(providerId.id,
|
||||||
context.getString(R.string.settings_daily_steps_title),
|
context.getString(R.string.settings_daily_steps_title),
|
||||||
R.drawable.round_steps
|
R.drawable.round_directions_walk
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -79,12 +78,16 @@ object GlanceProviderHelper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun showGlanceProviders(context: Context): Boolean {
|
fun showGlanceProviders(context: Context): Boolean {
|
||||||
return Preferences.showGlance && EventRepository(context).getEventsCount() == 0 && (
|
val eventRepository = EventRepository(context)
|
||||||
|
BatteryHelper.updateBatteryInfo(context)
|
||||||
|
val showGlance = Preferences.showGlance && eventRepository.getEventsCount() == 0 && (
|
||||||
(Preferences.showNextAlarm && AlarmHelper.getNextAlarm(context) != "") ||
|
(Preferences.showNextAlarm && AlarmHelper.getNextAlarm(context) != "") ||
|
||||||
(MediaPlayerHelper.isSomeonePlaying(context)) ||
|
(MediaPlayerHelper.isSomeonePlaying(context)) ||
|
||||||
(Preferences.isBatteryLevelLow) ||
|
(Preferences.showBatteryCharging && Preferences.isCharging || Preferences.isBatteryLevelLow) ||
|
||||||
(Preferences.customNotes.isNotEmpty()) ||
|
(Preferences.customNotes.isNotEmpty()) ||
|
||||||
(Preferences.showDailySteps && Preferences.googleFitSteps > 0)
|
(Preferences.showDailySteps && Preferences.googleFitSteps > 0)
|
||||||
)
|
)
|
||||||
|
eventRepository.close()
|
||||||
|
return showGlance
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -182,6 +182,10 @@ object IntentHelper {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun getBatteryIntent(context: Context): Intent {
|
||||||
|
return Intent(Intent.ACTION_POWER_USAGE_SUMMARY)
|
||||||
|
}
|
||||||
|
|
||||||
fun getMusicIntent(context: Context): Intent {
|
fun getMusicIntent(context: Context): Intent {
|
||||||
return when (Preferences.mediaPlayerPackage) {
|
return when (Preferences.mediaPlayerPackage) {
|
||||||
"" -> {
|
"" -> {
|
||||||
|
@ -86,7 +86,22 @@ object SettingsStringHelper {
|
|||||||
return context.getString(R.string.now)
|
return context.getString(R.string.now)
|
||||||
}
|
}
|
||||||
TimeUnit.MILLISECONDS.toHours(difference) < 12 -> {
|
TimeUnit.MILLISECONDS.toHours(difference) < 12 -> {
|
||||||
return DateUtils.getRelativeTimeSpanString(start, now, DateUtils.HOUR_IN_MILLIS, DateUtils.FORMAT_ABBREV_RELATIVE).toString()
|
val minutes = TimeUnit.MILLISECONDS.toMinutes(difference) - 60 * TimeUnit.MILLISECONDS.toHours(difference)
|
||||||
|
return if (minutes < 1 || minutes > 30) {
|
||||||
|
DateUtils.getRelativeTimeSpanString(
|
||||||
|
start,
|
||||||
|
now - 1000 * 60 * 40,
|
||||||
|
DateUtils.HOUR_IN_MILLIS,
|
||||||
|
DateUtils.FORMAT_ABBREV_RELATIVE
|
||||||
|
).toString()
|
||||||
|
} else {
|
||||||
|
DateUtils.getRelativeTimeSpanString(
|
||||||
|
start,
|
||||||
|
now,
|
||||||
|
DateUtils.HOUR_IN_MILLIS,
|
||||||
|
DateUtils.FORMAT_ABBREV_RELATIVE
|
||||||
|
).toString()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
eventDate.dayOfYear == nowDate.plusDays(1).dayOfYear -> {
|
eventDate.dayOfYear == nowDate.plusDays(1).dayOfYear -> {
|
||||||
return String.format("%s", context.getString(R.string.tomorrow))
|
return String.format("%s", context.getString(R.string.tomorrow))
|
||||||
|
@ -5,7 +5,6 @@ import android.content.Context
|
|||||||
import android.os.Build
|
import android.os.Build
|
||||||
import com.google.android.gms.location.LocationServices
|
import com.google.android.gms.location.LocationServices
|
||||||
import com.tommasoberlose.anotherwidget.R
|
import com.tommasoberlose.anotherwidget.R
|
||||||
import com.tommasoberlose.anotherwidget.db.EventRepository
|
|
||||||
import com.tommasoberlose.anotherwidget.global.Constants
|
import com.tommasoberlose.anotherwidget.global.Constants
|
||||||
import com.tommasoberlose.anotherwidget.global.Preferences
|
import com.tommasoberlose.anotherwidget.global.Preferences
|
||||||
import com.tommasoberlose.anotherwidget.network.WeatherNetworkApi
|
import com.tommasoberlose.anotherwidget.network.WeatherNetworkApi
|
||||||
|
@ -7,12 +7,15 @@ import android.os.BatteryManager
|
|||||||
import android.util.Log
|
import android.util.Log
|
||||||
import com.tommasoberlose.anotherwidget.global.Preferences
|
import com.tommasoberlose.anotherwidget.global.Preferences
|
||||||
import com.tommasoberlose.anotherwidget.ui.widgets.MainWidget
|
import com.tommasoberlose.anotherwidget.ui.widgets.MainWidget
|
||||||
|
import com.tommasoberlose.anotherwidget.utils.toast
|
||||||
|
|
||||||
class BatteryLevelReceiver : BroadcastReceiver() {
|
class BatteryLevelReceiver : BroadcastReceiver() {
|
||||||
override fun onReceive(context: Context, intent: Intent) {
|
override fun onReceive(context: Context, intent: Intent) {
|
||||||
when(intent.action) {
|
when(intent.action) {
|
||||||
Intent.ACTION_BATTERY_LOW -> Preferences.isBatteryLevelLow = true
|
Intent.ACTION_BATTERY_LOW -> Preferences.isBatteryLevelLow = true
|
||||||
Intent.ACTION_BATTERY_OKAY -> Preferences.isBatteryLevelLow = false
|
Intent.ACTION_BATTERY_OKAY -> Preferences.isBatteryLevelLow = false
|
||||||
|
Intent.ACTION_POWER_CONNECTED -> Preferences.isCharging = true
|
||||||
|
Intent.ACTION_POWER_DISCONNECTED -> Preferences.isCharging = false
|
||||||
}
|
}
|
||||||
MainWidget.updateWidget(context)
|
MainWidget.updateWidget(context)
|
||||||
}
|
}
|
||||||
|
@ -24,5 +24,6 @@ class NewCalendarEventReceiver : BroadcastReceiver() {
|
|||||||
eventRepository.goToPreviousEvent()
|
eventRepository.goToPreviousEvent()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
eventRepository.close()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -12,6 +12,7 @@ import com.tommasoberlose.anotherwidget.db.EventRepository
|
|||||||
import com.tommasoberlose.anotherwidget.global.Actions
|
import com.tommasoberlose.anotherwidget.global.Actions
|
||||||
import com.tommasoberlose.anotherwidget.global.Constants
|
import com.tommasoberlose.anotherwidget.global.Constants
|
||||||
import com.tommasoberlose.anotherwidget.global.Preferences
|
import com.tommasoberlose.anotherwidget.global.Preferences
|
||||||
|
import com.tommasoberlose.anotherwidget.helpers.BatteryHelper
|
||||||
import com.tommasoberlose.anotherwidget.helpers.CalendarHelper
|
import com.tommasoberlose.anotherwidget.helpers.CalendarHelper
|
||||||
import com.tommasoberlose.anotherwidget.models.Event
|
import com.tommasoberlose.anotherwidget.models.Event
|
||||||
import com.tommasoberlose.anotherwidget.ui.widgets.MainWidget
|
import com.tommasoberlose.anotherwidget.ui.widgets.MainWidget
|
||||||
@ -28,7 +29,9 @@ class UpdatesReceiver : BroadcastReceiver() {
|
|||||||
Intent.ACTION_TIME_CHANGED,
|
Intent.ACTION_TIME_CHANGED,
|
||||||
Intent.ACTION_TIMEZONE_CHANGED,
|
Intent.ACTION_TIMEZONE_CHANGED,
|
||||||
Intent.ACTION_LOCALE_CHANGED,
|
Intent.ACTION_LOCALE_CHANGED,
|
||||||
Actions.ACTION_CALENDAR_UPDATE -> CalendarHelper.updateEventList(context)
|
Actions.ACTION_CALENDAR_UPDATE -> {
|
||||||
|
CalendarHelper.updateEventList(context)
|
||||||
|
}
|
||||||
|
|
||||||
"com.sec.android.widgetapp.APPWIDGET_RESIZE",
|
"com.sec.android.widgetapp.APPWIDGET_RESIZE",
|
||||||
Intent.ACTION_DATE_CHANGED,
|
Intent.ACTION_DATE_CHANGED,
|
||||||
@ -59,6 +62,7 @@ class UpdatesReceiver : BroadcastReceiver() {
|
|||||||
setEventUpdate(context, event)
|
setEventUpdate(context, event)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
eventRepository.close()
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun setEventUpdate(context: Context, event: Event) {
|
private fun setEventUpdate(context: Context, event: Event) {
|
||||||
@ -101,7 +105,7 @@ class UpdatesReceiver : BroadcastReceiver() {
|
|||||||
} else {
|
} else {
|
||||||
setExact(
|
setExact(
|
||||||
AlarmManager.RTC,
|
AlarmManager.RTC,
|
||||||
event.startDate - diff.hours * 1000 * 60 * 60,
|
event.startDate - diff.hours * 1000 * 60 * 60 + if (diff.minutes > 30) (- 30) else (+ 30),
|
||||||
PendingIntent.getBroadcast(
|
PendingIntent.getBroadcast(
|
||||||
context,
|
context,
|
||||||
event.eventID.toInt(),
|
event.eventID.toInt(),
|
||||||
@ -135,9 +139,11 @@ class UpdatesReceiver : BroadcastReceiver() {
|
|||||||
|
|
||||||
fun removeUpdates(context: Context) {
|
fun removeUpdates(context: Context) {
|
||||||
with(context.getSystemService(Context.ALARM_SERVICE) as AlarmManager) {
|
with(context.getSystemService(Context.ALARM_SERVICE) as AlarmManager) {
|
||||||
EventRepository(context).getEvents().forEach {
|
val eventRepository = EventRepository(context)
|
||||||
|
eventRepository.getEvents().forEach {
|
||||||
cancel(PendingIntent.getBroadcast(context, it.eventID.toInt(), Intent(context, UpdatesReceiver::class.java), 0))
|
cancel(PendingIntent.getBroadcast(context, it.eventID.toInt(), Intent(context, UpdatesReceiver::class.java), 0))
|
||||||
}
|
}
|
||||||
|
eventRepository.close()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,61 @@
|
|||||||
|
package com.tommasoberlose.anotherwidget.services
|
||||||
|
|
||||||
|
import android.app.job.JobInfo
|
||||||
|
import android.app.job.JobParameters
|
||||||
|
import android.app.job.JobScheduler
|
||||||
|
import android.app.job.JobService
|
||||||
|
import android.content.ComponentName
|
||||||
|
import android.content.Context
|
||||||
|
import android.os.Build
|
||||||
|
import android.provider.CalendarContract
|
||||||
|
import com.tommasoberlose.anotherwidget.helpers.CalendarHelper
|
||||||
|
import com.tommasoberlose.anotherwidget.ui.widgets.MainWidget
|
||||||
|
|
||||||
|
class BatteryListenerJob : JobService() {
|
||||||
|
override fun onStartJob(params: JobParameters): Boolean {
|
||||||
|
MainWidget.updateWidget(this)
|
||||||
|
schedule(
|
||||||
|
this
|
||||||
|
)
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
@Synchronized
|
||||||
|
override fun onStopJob(params: JobParameters): Boolean {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
private const val chargingJobId = 1006
|
||||||
|
private const val notChargingJobId = 1007
|
||||||
|
fun schedule(context: Context) {
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||||
|
remove(context)
|
||||||
|
val componentName = ComponentName(
|
||||||
|
context,
|
||||||
|
EventListenerJob::class.java
|
||||||
|
)
|
||||||
|
with(context.getSystemService(Context.JOB_SCHEDULER_SERVICE) as JobScheduler) {
|
||||||
|
schedule(
|
||||||
|
JobInfo.Builder(chargingJobId, componentName)
|
||||||
|
.setRequiresCharging(true)
|
||||||
|
.setPersisted(true)
|
||||||
|
.build()
|
||||||
|
)
|
||||||
|
schedule(
|
||||||
|
JobInfo.Builder(notChargingJobId, componentName)
|
||||||
|
.setRequiresCharging(false)
|
||||||
|
.setPersisted(true)
|
||||||
|
.build()
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun remove(context: Context) {
|
||||||
|
val js = context.getSystemService(JobScheduler::class.java)
|
||||||
|
js?.cancel(chargingJobId)
|
||||||
|
js?.cancel(notChargingJobId)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -76,7 +76,9 @@ class MainActivity : AppCompatActivity() {
|
|||||||
viewModel = ViewModelProvider(this).get(MainViewModel::class.java)
|
viewModel = ViewModelProvider(this).get(MainViewModel::class.java)
|
||||||
|
|
||||||
controlExtras(intent)
|
controlExtras(intent)
|
||||||
requirePermission()
|
if (Preferences.showWallpaper) {
|
||||||
|
requirePermission()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onBackPressed() {
|
override fun onBackPressed() {
|
||||||
|
@ -321,7 +321,7 @@ class GeneralTabFragment : Fragment() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
action_show_dividers.setOnClickListener {
|
action_show_dividers.setOnClickListener {
|
||||||
BottomSheetMenu<Boolean>(requireContext(), header = getString(R.string.settings_show_multiple_events_title)).setSelectedValue(Preferences.showDividers)
|
BottomSheetMenu<Boolean>(requireContext(), header = getString(R.string.settings_show_dividers_title)).setSelectedValue(Preferences.showDividers)
|
||||||
.addItem(getString(R.string.settings_visible), true)
|
.addItem(getString(R.string.settings_visible), true)
|
||||||
.addItem(getString(R.string.settings_not_visible), false)
|
.addItem(getString(R.string.settings_not_visible), false)
|
||||||
.addOnSelectItemListener { value ->
|
.addOnSelectItemListener { value ->
|
||||||
|
@ -36,6 +36,7 @@ import com.tommasoberlose.anotherwidget.helpers.BitmapHelper
|
|||||||
import com.tommasoberlose.anotherwidget.helpers.ColorHelper
|
import com.tommasoberlose.anotherwidget.helpers.ColorHelper
|
||||||
import com.tommasoberlose.anotherwidget.helpers.ColorHelper.isColorDark
|
import com.tommasoberlose.anotherwidget.helpers.ColorHelper.isColorDark
|
||||||
import com.tommasoberlose.anotherwidget.ui.activities.MainActivity
|
import com.tommasoberlose.anotherwidget.ui.activities.MainActivity
|
||||||
|
import com.tommasoberlose.anotherwidget.ui.activities.SupportDevActivity
|
||||||
import com.tommasoberlose.anotherwidget.ui.adapters.ViewPagerAdapter
|
import com.tommasoberlose.anotherwidget.ui.adapters.ViewPagerAdapter
|
||||||
import com.tommasoberlose.anotherwidget.ui.viewmodels.MainViewModel
|
import com.tommasoberlose.anotherwidget.ui.viewmodels.MainViewModel
|
||||||
import com.tommasoberlose.anotherwidget.ui.widgets.MainWidget
|
import com.tommasoberlose.anotherwidget.ui.widgets.MainWidget
|
||||||
@ -145,7 +146,7 @@ class MainFragment : Fragment(), SharedPreferences.OnSharedPreferenceChangeList
|
|||||||
ColorHelper.getBackgroundColor()
|
ColorHelper.getBackgroundColor()
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
uiJob = viewLifecycleOwner.lifecycleScope.launch(Dispatchers.IO) {
|
uiJob = lifecycleScope.launch(Dispatchers.IO) {
|
||||||
val generatedView = MainWidget.generateWidgetView(requireContext())
|
val generatedView = MainWidget.generateWidgetView(requireContext())
|
||||||
|
|
||||||
withContext(Dispatchers.Main) {
|
withContext(Dispatchers.Main) {
|
||||||
@ -230,10 +231,12 @@ class MainFragment : Fragment(), SharedPreferences.OnSharedPreferenceChangeList
|
|||||||
).apply {
|
).apply {
|
||||||
duration = 500L
|
duration = 500L
|
||||||
addUpdateListener {
|
addUpdateListener {
|
||||||
val animatedValue = animatedValue as Int
|
if (preview != null) {
|
||||||
val layoutParams = preview.layoutParams
|
val animatedValue = animatedValue as Int
|
||||||
layoutParams.height = animatedValue
|
val layoutParams = preview.layoutParams
|
||||||
preview.layoutParams = layoutParams
|
layoutParams.height = animatedValue
|
||||||
|
preview.layoutParams = layoutParams
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}.start()
|
}.start()
|
||||||
}
|
}
|
||||||
@ -253,10 +256,12 @@ class MainFragment : Fragment(), SharedPreferences.OnSharedPreferenceChangeList
|
|||||||
).apply {
|
).apply {
|
||||||
duration = 300L
|
duration = 300L
|
||||||
addUpdateListener {
|
addUpdateListener {
|
||||||
val animatedValue = animatedValue as Int
|
if (preview != null) {
|
||||||
val layoutParams = preview.layoutParams
|
val animatedValue = animatedValue as Int
|
||||||
layoutParams.height = animatedValue
|
val layoutParams = preview.layoutParams
|
||||||
preview?.layoutParams = layoutParams
|
layoutParams.height = animatedValue
|
||||||
|
preview?.layoutParams = layoutParams
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}.start()
|
}.start()
|
||||||
}
|
}
|
||||||
@ -278,10 +283,12 @@ class MainFragment : Fragment(), SharedPreferences.OnSharedPreferenceChangeList
|
|||||||
).apply {
|
).apply {
|
||||||
duration = 300L
|
duration = 300L
|
||||||
addUpdateListener {
|
addUpdateListener {
|
||||||
val animatedValue = animatedValue as Int
|
if (preview != null) {
|
||||||
val layoutParams = preview.layoutParams
|
val animatedValue = animatedValue as Int
|
||||||
layoutParams.height = animatedValue
|
val layoutParams = preview.layoutParams
|
||||||
preview.layoutParams = layoutParams
|
layoutParams.height = animatedValue
|
||||||
|
preview.layoutParams = layoutParams
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}.start()
|
}.start()
|
||||||
}
|
}
|
||||||
|
@ -36,6 +36,7 @@ import java.text.DateFormat
|
|||||||
import java.util.*
|
import java.util.*
|
||||||
import java.util.concurrent.TimeUnit
|
import java.util.concurrent.TimeUnit
|
||||||
import kotlin.math.min
|
import kotlin.math.min
|
||||||
|
import kotlin.math.roundToInt
|
||||||
|
|
||||||
|
|
||||||
class MainWidget : AppWidgetProvider() {
|
class MainWidget : AppWidgetProvider() {
|
||||||
@ -140,9 +141,8 @@ class MainWidget : AppWidgetProvider() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun updateCalendarView(context: Context, v: View, views: RemoteViews, widgetID: Int): RemoteViews {
|
private fun updateCalendarView(context: Context, v: View, views: RemoteViews, widgetID: Int): RemoteViews {
|
||||||
|
val eventRepository = EventRepository(context)
|
||||||
try {
|
try {
|
||||||
val eventRepository = EventRepository(context)
|
|
||||||
|
|
||||||
views.setImageViewBitmap(
|
views.setImageViewBitmap(
|
||||||
R.id.empty_date_rect,
|
R.id.empty_date_rect,
|
||||||
BitmapHelper.getBitmapFromView(v.empty_date, draw = false)
|
BitmapHelper.getBitmapFromView(v.empty_date, draw = false)
|
||||||
@ -291,15 +291,18 @@ class MainWidget : AppWidgetProvider() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
Constants.GlanceProviderId.BATTERY_LEVEL_LOW -> {
|
Constants.GlanceProviderId.BATTERY_LEVEL_LOW -> {
|
||||||
if (Preferences.isBatteryLevelLow) {
|
if (Preferences.showBatteryCharging) {
|
||||||
val alarmIntent = PendingIntent.getActivity(
|
BatteryHelper.updateBatteryInfo(context)
|
||||||
context,
|
if (Preferences.isCharging || Preferences.isBatteryLevelLow) {
|
||||||
widgetID,
|
val batteryIntent = PendingIntent.getActivity(
|
||||||
IntentHelper.getClockIntent(context),
|
context,
|
||||||
0
|
widgetID,
|
||||||
)
|
IntentHelper.getBatteryIntent(context),
|
||||||
views.setOnClickPendingIntent(R.id.second_row_rect, alarmIntent)
|
0
|
||||||
break@loop
|
)
|
||||||
|
views.setOnClickPendingIntent(R.id.second_row_rect, batteryIntent)
|
||||||
|
break@loop
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Constants.GlanceProviderId.CUSTOM_INFO -> {
|
Constants.GlanceProviderId.CUSTOM_INFO -> {
|
||||||
@ -340,6 +343,8 @@ class MainWidget : AppWidgetProvider() {
|
|||||||
} catch (ex: Exception) {
|
} catch (ex: Exception) {
|
||||||
ex.printStackTrace()
|
ex.printStackTrace()
|
||||||
CrashlyticsReceiver.sendCrash(context, ex)
|
CrashlyticsReceiver.sendCrash(context, ex)
|
||||||
|
} finally {
|
||||||
|
eventRepository.close()
|
||||||
}
|
}
|
||||||
|
|
||||||
return views
|
return views
|
||||||
@ -560,33 +565,37 @@ class MainWidget : AppWidgetProvider() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
Constants.GlanceProviderId.BATTERY_LEVEL_LOW -> {
|
Constants.GlanceProviderId.BATTERY_LEVEL_LOW -> {
|
||||||
if (Preferences.isBatteryLevelLow) {
|
if (Preferences.showBatteryCharging) {
|
||||||
v.second_row_icon.setImageDrawable(
|
BatteryHelper.updateBatteryInfo(context)
|
||||||
ContextCompat.getDrawable(
|
if (Preferences.isCharging) {
|
||||||
context,
|
v.second_row_icon.isVisible = false
|
||||||
R.drawable.round_battery_charging_full
|
val batteryLevel = BatteryHelper.getBatteryLevel(context)
|
||||||
)
|
if (batteryLevel == 100) {
|
||||||
)
|
v.next_event_date.text = "%s - %d%%".format(context.getString(R.string.charging), batteryLevel)
|
||||||
v.next_event_date.text = context.getString(R.string.battery_low_warning)
|
} else {
|
||||||
break@loop
|
v.next_event_date.text = context.getString(R.string.charging)
|
||||||
|
}
|
||||||
|
break@loop
|
||||||
|
} else if (Preferences.isBatteryLevelLow) {
|
||||||
|
v.second_row_icon.isVisible = false
|
||||||
|
v.next_event_date.text =
|
||||||
|
context.getString(R.string.battery_low_warning)
|
||||||
|
break@loop
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Constants.GlanceProviderId.CUSTOM_INFO -> {
|
Constants.GlanceProviderId.CUSTOM_INFO -> {
|
||||||
if (Preferences.customNotes.isNotEmpty()) {
|
if (Preferences.customNotes.isNotEmpty()) {
|
||||||
v.second_row_icon.isVisible = false
|
v.second_row_icon.isVisible = false
|
||||||
v.next_event_date.text = Preferences.customNotes
|
v.next_event_date.text = Preferences.customNotes
|
||||||
|
v.next_event_date.gravity
|
||||||
v.next_event_date.maxLines = 2
|
v.next_event_date.maxLines = 2
|
||||||
break@loop
|
break@loop
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Constants.GlanceProviderId.GOOGLE_FIT_STEPS -> {
|
Constants.GlanceProviderId.GOOGLE_FIT_STEPS -> {
|
||||||
if (Preferences.showDailySteps && Preferences.googleFitSteps > 0) {
|
if (Preferences.showDailySteps && Preferences.googleFitSteps > 0) {
|
||||||
v.second_row_icon.setImageDrawable(
|
v.second_row_icon.isVisible = false
|
||||||
ContextCompat.getDrawable(
|
|
||||||
context,
|
|
||||||
R.drawable.round_steps
|
|
||||||
)
|
|
||||||
)
|
|
||||||
v.next_event_date.text = context.getString(R.string.daily_steps_counter).format(Preferences.googleFitSteps)
|
v.next_event_date.text = context.getString(R.string.daily_steps_counter).format(Preferences.googleFitSteps)
|
||||||
break@loop
|
break@loop
|
||||||
}
|
}
|
||||||
@ -698,7 +707,7 @@ class MainWidget : AppWidgetProvider() {
|
|||||||
v.weather.visibility = View.VISIBLE
|
v.weather.visibility = View.VISIBLE
|
||||||
v.calendar_weather.visibility = View.VISIBLE
|
v.calendar_weather.visibility = View.VISIBLE
|
||||||
v.special_weather.visibility = View.VISIBLE
|
v.special_weather.visibility = View.VISIBLE
|
||||||
val currentTemp = String.format(Locale.getDefault(), "%.0f °%s", Preferences.weatherTemp, Preferences.weatherRealTempUnit)
|
val currentTemp = String.format(Locale.getDefault(), "%d °%s", Preferences.weatherTemp.roundToInt(), Preferences.weatherRealTempUnit)
|
||||||
|
|
||||||
val icon: String = Preferences.weatherIcon
|
val icon: String = Preferences.weatherIcon
|
||||||
if (icon == "") {
|
if (icon == "") {
|
||||||
@ -734,6 +743,8 @@ class MainWidget : AppWidgetProvider() {
|
|||||||
it.isVisible = Preferences.showDividers
|
it.isVisible = Preferences.showDividers
|
||||||
}
|
}
|
||||||
|
|
||||||
|
eventRepository.close()
|
||||||
|
|
||||||
return v
|
return v
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
android:paddingBottom="8dp"
|
android:paddingBottom="8dp"
|
||||||
android:paddingLeft="32dp"
|
android:paddingLeft="32dp"
|
||||||
android:paddingRight="32dp"
|
android:paddingRight="32dp"
|
||||||
android:textSize="16sp"
|
android:textSize="18sp"
|
||||||
android:gravity="start"
|
android:gravity="start"
|
||||||
android:textAlignment="viewStart"
|
android:textAlignment="viewStart"
|
||||||
android:id="@+id/header_text"
|
android:id="@+id/header_text"
|
||||||
|
@ -89,6 +89,18 @@
|
|||||||
android:id="@+id/calendar_settings"
|
android:id="@+id/calendar_settings"
|
||||||
android:alpha="@{isCalendarEnabled ? 1f : 0.2f, default=1}"
|
android:alpha="@{isCalendarEnabled ? 1f : 0.2f, default=1}"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingTop="16dp"
|
||||||
|
android:text="@string/filters_header"
|
||||||
|
android:textAlignment="viewStart"
|
||||||
|
android:paddingLeft="20dp"
|
||||||
|
android:paddingRight="20dp"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:textColor="@color/colorAccent"
|
||||||
|
android:textAppearance="@style/AnotherWidget.Settings.Header"
|
||||||
|
app:textAllCaps="false" />
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
@ -237,6 +249,18 @@
|
|||||||
style="@style/AnotherWidget.Settings.Subtitle"/>
|
style="@style/AnotherWidget.Settings.Subtitle"/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingTop="16dp"
|
||||||
|
android:text="@string/event_detail_header"
|
||||||
|
android:textAlignment="viewStart"
|
||||||
|
android:paddingLeft="20dp"
|
||||||
|
android:paddingRight="20dp"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:textColor="@color/colorAccent"
|
||||||
|
android:textAppearance="@style/AnotherWidget.Settings.Header"
|
||||||
|
app:textAllCaps="false" />
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
@ -348,6 +372,18 @@
|
|||||||
style="@style/AnotherWidget.Settings.Subtitle"/>
|
style="@style/AnotherWidget.Settings.Subtitle"/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingTop="16dp"
|
||||||
|
android:text="@string/actions_header"
|
||||||
|
android:textAlignment="viewStart"
|
||||||
|
android:paddingLeft="20dp"
|
||||||
|
android:paddingRight="20dp"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:textColor="@color/colorAccent"
|
||||||
|
android:textAppearance="@style/AnotherWidget.Settings.Header"
|
||||||
|
app:textAllCaps="false" />
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
@ -112,6 +112,18 @@
|
|||||||
android:id="@+id/clock_settings"
|
android:id="@+id/clock_settings"
|
||||||
android:alpha="@{isClockVisible ? 1f : 0.2f, default=1}"
|
android:alpha="@{isClockVisible ? 1f : 0.2f, default=1}"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingTop="16dp"
|
||||||
|
android:text="@string/clock_text_header"
|
||||||
|
android:textAlignment="viewStart"
|
||||||
|
android:paddingLeft="20dp"
|
||||||
|
android:paddingRight="20dp"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:textColor="@color/colorAccent"
|
||||||
|
android:textAppearance="@style/AnotherWidget.Settings.Header"
|
||||||
|
app:textAllCaps="false" />
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
@ -186,6 +198,18 @@
|
|||||||
style="@style/AnotherWidget.Settings.Subtitle"/>
|
style="@style/AnotherWidget.Settings.Subtitle"/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingTop="16dp"
|
||||||
|
android:text="@string/style_header"
|
||||||
|
android:textAlignment="viewStart"
|
||||||
|
android:paddingLeft="20dp"
|
||||||
|
android:paddingRight="20dp"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:textColor="@color/colorAccent"
|
||||||
|
android:textAppearance="@style/AnotherWidget.Settings.Header"
|
||||||
|
app:textAllCaps="false" />
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
@ -261,6 +285,18 @@
|
|||||||
style="@style/AnotherWidget.Settings.Subtitle"/>
|
style="@style/AnotherWidget.Settings.Subtitle"/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingTop="16dp"
|
||||||
|
android:text="@string/actions_header"
|
||||||
|
android:textAlignment="viewStart"
|
||||||
|
android:paddingLeft="20dp"
|
||||||
|
android:paddingRight="20dp"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:textColor="@color/colorAccent"
|
||||||
|
android:textAppearance="@style/AnotherWidget.Settings.Header"
|
||||||
|
app:textAllCaps="false" />
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
@ -298,27 +334,27 @@
|
|||||||
style="@style/AnotherWidget.Settings.Subtitle"/>
|
style="@style/AnotherWidget.Settings.Subtitle"/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</LinearLayout>
|
<LinearLayout
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:id="@+id/small_clock_warning"
|
|
||||||
android:orientation="vertical">
|
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:paddingTop="16dp"
|
android:id="@+id/small_clock_warning"
|
||||||
android:paddingLeft="24dp"
|
android:orientation="vertical">
|
||||||
android:paddingRight="24dp"
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
android:paddingBottom="32dp"
|
android:layout_width="match_parent"
|
||||||
android:duplicateParentState="true"
|
android:layout_height="wrap_content"
|
||||||
android:textSize="14sp"
|
android:paddingTop="16dp"
|
||||||
android:text="@string/clock_warning"
|
android:paddingLeft="24dp"
|
||||||
android:textColor="@color/colorPrimaryText"
|
android:paddingRight="24dp"
|
||||||
android:letterSpacing="0"
|
android:paddingBottom="32dp"
|
||||||
android:fontFamily="@font/product_sans"
|
android:duplicateParentState="true"
|
||||||
android:textAppearance="@style/TextAppearance.AppCompat.Medium"
|
android:textSize="14sp"
|
||||||
app:textAllCaps="false" />
|
android:text="@string/clock_warning"
|
||||||
|
android:textColor="@color/colorPrimaryText"
|
||||||
|
android:letterSpacing="0"
|
||||||
|
android:fontFamily="@font/product_sans"
|
||||||
|
android:textAppearance="@style/TextAppearance.AppCompat.Medium"
|
||||||
|
app:textAllCaps="false" />
|
||||||
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
|
@ -18,6 +18,18 @@
|
|||||||
android:paddingTop="8dp"
|
android:paddingTop="8dp"
|
||||||
android:paddingBottom="8dp"
|
android:paddingBottom="8dp"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/first_row_header"
|
||||||
|
android:paddingTop="16dp"
|
||||||
|
android:textAlignment="viewStart"
|
||||||
|
android:paddingLeft="20dp"
|
||||||
|
android:paddingRight="20dp"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:textColor="@color/colorAccent"
|
||||||
|
android:textAppearance="@style/AnotherWidget.Settings.Header"
|
||||||
|
app:textAllCaps="false" />
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
@ -92,6 +104,18 @@
|
|||||||
style="@style/AnotherWidget.Settings.Subtitle"/>
|
style="@style/AnotherWidget.Settings.Subtitle"/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingTop="16dp"
|
||||||
|
android:text="@string/second_row_header"
|
||||||
|
android:textAlignment="viewStart"
|
||||||
|
android:paddingLeft="20dp"
|
||||||
|
android:paddingRight="20dp"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:textColor="@color/colorAccent"
|
||||||
|
android:textAppearance="@style/AnotherWidget.Settings.Header"
|
||||||
|
app:textAllCaps="false" />
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
@ -166,6 +190,18 @@
|
|||||||
style="@style/AnotherWidget.Settings.Subtitle"/>
|
style="@style/AnotherWidget.Settings.Subtitle"/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingTop="16dp"
|
||||||
|
android:text="@string/global_style_header"
|
||||||
|
android:textAlignment="viewStart"
|
||||||
|
android:paddingLeft="20dp"
|
||||||
|
android:paddingRight="20dp"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:textColor="@color/colorAccent"
|
||||||
|
android:textAppearance="@style/AnotherWidget.Settings.Header"
|
||||||
|
app:textAllCaps="false" />
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
@ -74,6 +74,18 @@
|
|||||||
android:id="@+id/calendar_settings"
|
android:id="@+id/calendar_settings"
|
||||||
android:alpha="@{isGlanceVisible ? 1f : 0.2f, default=1}"
|
android:alpha="@{isGlanceVisible ? 1f : 0.2f, default=1}"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingTop="16dp"
|
||||||
|
android:text="@string/providers"
|
||||||
|
android:textAlignment="viewStart"
|
||||||
|
android:paddingLeft="20dp"
|
||||||
|
android:paddingRight="20dp"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:textColor="@color/colorAccent"
|
||||||
|
android:textAppearance="@style/AnotherWidget.Settings.Header"
|
||||||
|
app:textAllCaps="false" />
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
@ -189,7 +201,7 @@
|
|||||||
android:layout_width="48dp"
|
android:layout_width="48dp"
|
||||||
android:layout_height="48dp"
|
android:layout_height="48dp"
|
||||||
android:padding="10dp"
|
android:padding="10dp"
|
||||||
android:src="@drawable/round_steps"
|
android:src="@drawable/round_directions_walk"
|
||||||
android:tint="@color/colorPrimaryText"/>
|
android:tint="@color/colorPrimaryText"/>
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@ -234,7 +246,6 @@
|
|||||||
android:paddingRight="8dp"
|
android:paddingRight="8dp"
|
||||||
android:clickable="true"
|
android:clickable="true"
|
||||||
android:focusable="true"
|
android:focusable="true"
|
||||||
android:visibility="gone"
|
|
||||||
android:background="?android:attr/selectableItemBackground"
|
android:background="?android:attr/selectableItemBackground"
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:id="@+id/action_show_low_battery_level_warning"
|
android:id="@+id/action_show_low_battery_level_warning"
|
||||||
@ -300,42 +311,54 @@
|
|||||||
style="@style/AnotherWidget.Settings.Subtitle"/>
|
style="@style/AnotherWidget.Settings.Subtitle"/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
</LinearLayout>
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingTop="16dp"
|
||||||
|
android:text="@string/preferences_header"
|
||||||
|
android:textAlignment="viewStart"
|
||||||
|
android:paddingLeft="20dp"
|
||||||
|
android:paddingRight="20dp"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:textColor="@color/colorAccent"
|
||||||
|
android:textAppearance="@style/AnotherWidget.Settings.Header"
|
||||||
|
app:textAllCaps="false" />
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingTop="16dp"
|
||||||
|
android:paddingBottom="16dp"
|
||||||
|
android:paddingLeft="8dp"
|
||||||
|
android:paddingRight="8dp"
|
||||||
|
android:clickable="true"
|
||||||
|
android:focusable="true"
|
||||||
|
android:background="?android:attr/selectableItemBackground"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:id="@+id/action_sort_glance_providers"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="48dp"
|
||||||
|
android:layout_height="48dp"
|
||||||
|
android:padding="10dp"
|
||||||
|
android:src="@drawable/round_flip_to_front"
|
||||||
|
android:tint="@color/colorPrimaryText"/>
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:paddingTop="16dp"
|
|
||||||
android:paddingBottom="16dp"
|
|
||||||
android:paddingLeft="8dp"
|
android:paddingLeft="8dp"
|
||||||
android:paddingRight="8dp"
|
android:paddingRight="8dp"
|
||||||
android:clickable="true"
|
android:orientation="vertical">
|
||||||
android:focusable="true"
|
<TextView
|
||||||
android:background="?android:attr/selectableItemBackground"
|
android:layout_width="wrap_content"
|
||||||
android:gravity="center_vertical"
|
|
||||||
android:id="@+id/action_sort_glance_providers"
|
|
||||||
android:orientation="horizontal">
|
|
||||||
<ImageView
|
|
||||||
android:layout_width="48dp"
|
|
||||||
android:layout_height="48dp"
|
|
||||||
android:padding="10dp"
|
|
||||||
android:src="@drawable/round_flip_to_front"
|
|
||||||
android:tint="@color/colorPrimaryText"/>
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:paddingLeft="8dp"
|
style="@style/AnotherWidget.Settings.Title"
|
||||||
android:paddingRight="8dp"
|
android:text="@string/settings_sort_glance_providers_title"/>
|
||||||
android:orientation="vertical">
|
<TextView
|
||||||
<TextView
|
android:layout_width="wrap_content"
|
||||||
android:layout_width="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:text="@string/settings_sort_glance_providers_subtitle"
|
||||||
style="@style/AnotherWidget.Settings.Title"
|
style="@style/AnotherWidget.Settings.Subtitle"/>
|
||||||
android:text="@string/settings_sort_glance_providers_title"/>
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/settings_sort_glance_providers_subtitle"
|
|
||||||
style="@style/AnotherWidget.Settings.Subtitle"/>
|
|
||||||
</LinearLayout>
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
@ -112,6 +112,18 @@
|
|||||||
android:id="@+id/weather_settings"
|
android:id="@+id/weather_settings"
|
||||||
android:alpha="@{isWeatherVisible ? 1f : 0.2f, default=1}"
|
android:alpha="@{isWeatherVisible ? 1f : 0.2f, default=1}"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingTop="16dp"
|
||||||
|
android:text="@string/provider_header"
|
||||||
|
android:textAlignment="viewStart"
|
||||||
|
android:paddingLeft="20dp"
|
||||||
|
android:paddingRight="20dp"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:textColor="@color/colorAccent"
|
||||||
|
android:textAppearance="@style/AnotherWidget.Settings.Header"
|
||||||
|
app:textAllCaps="false" />
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
@ -212,43 +224,6 @@
|
|||||||
android:text="@string/action_grant_permission"/>
|
android:text="@string/action_grant_permission"/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:paddingTop="16dp"
|
|
||||||
android:paddingBottom="16dp"
|
|
||||||
android:paddingLeft="8dp"
|
|
||||||
android:paddingRight="8dp"
|
|
||||||
android:clickable="true"
|
|
||||||
android:focusable="true"
|
|
||||||
android:background="?android:attr/selectableItemBackground"
|
|
||||||
android:gravity="center_vertical"
|
|
||||||
android:id="@+id/action_change_unit"
|
|
||||||
android:orientation="horizontal">
|
|
||||||
<ImageView
|
|
||||||
android:layout_width="48dp"
|
|
||||||
android:layout_height="48dp"
|
|
||||||
android:padding="10dp"
|
|
||||||
android:src="@drawable/round_text_format"
|
|
||||||
android:tint="@color/colorPrimaryText"/>
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:paddingLeft="8dp"
|
|
||||||
android:paddingRight="8dp"
|
|
||||||
android:orientation="vertical">
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
style="@style/AnotherWidget.Settings.Title"
|
|
||||||
android:text="@string/settings_unit_title"/>
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:id="@+id/temp_unit"
|
|
||||||
style="@style/AnotherWidget.Settings.Subtitle"/>
|
|
||||||
</LinearLayout>
|
|
||||||
</LinearLayout>
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
@ -286,6 +261,55 @@
|
|||||||
style="@style/AnotherWidget.Settings.Subtitle"/>
|
style="@style/AnotherWidget.Settings.Subtitle"/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingTop="16dp"
|
||||||
|
android:paddingBottom="16dp"
|
||||||
|
android:paddingLeft="8dp"
|
||||||
|
android:paddingRight="8dp"
|
||||||
|
android:clickable="true"
|
||||||
|
android:focusable="true"
|
||||||
|
android:background="?android:attr/selectableItemBackground"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:id="@+id/action_change_unit"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="48dp"
|
||||||
|
android:layout_height="48dp"
|
||||||
|
android:padding="10dp"
|
||||||
|
android:src="@drawable/round_text_format"
|
||||||
|
android:tint="@color/colorPrimaryText"/>
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingLeft="8dp"
|
||||||
|
android:paddingRight="8dp"
|
||||||
|
android:orientation="vertical">
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
style="@style/AnotherWidget.Settings.Title"
|
||||||
|
android:text="@string/settings_unit_title"/>
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:id="@+id/temp_unit"
|
||||||
|
style="@style/AnotherWidget.Settings.Subtitle"/>
|
||||||
|
</LinearLayout>
|
||||||
|
</LinearLayout>
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingTop="16dp"
|
||||||
|
android:text="@string/style_header"
|
||||||
|
android:textAlignment="viewStart"
|
||||||
|
android:paddingLeft="20dp"
|
||||||
|
android:paddingRight="20dp"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:textColor="@color/colorAccent"
|
||||||
|
android:textAppearance="@style/AnotherWidget.Settings.Header"
|
||||||
|
app:textAllCaps="false" />
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
@ -323,6 +347,18 @@
|
|||||||
style="@style/AnotherWidget.Settings.Subtitle"/>
|
style="@style/AnotherWidget.Settings.Subtitle"/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingTop="16dp"
|
||||||
|
android:text="@string/actions_header"
|
||||||
|
android:textAlignment="viewStart"
|
||||||
|
android:paddingLeft="20dp"
|
||||||
|
android:paddingRight="20dp"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:textColor="@color/colorAccent"
|
||||||
|
android:textAppearance="@style/AnotherWidget.Settings.Header"
|
||||||
|
app:textAllCaps="false" />
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
android:paddingBottom="8dp"
|
android:paddingBottom="8dp"
|
||||||
android:paddingLeft="32dp"
|
android:paddingLeft="32dp"
|
||||||
android:paddingRight="32dp"
|
android:paddingRight="32dp"
|
||||||
android:textSize="16sp"
|
android:textSize="18sp"
|
||||||
android:gravity="start"
|
android:gravity="start"
|
||||||
android:textAlignment="viewStart"
|
android:textAlignment="viewStart"
|
||||||
android:id="@+id/header_text"
|
android:id="@+id/header_text"
|
||||||
|
@ -118,7 +118,7 @@
|
|||||||
<string name="show_clock_visible">Clock visibility</string>
|
<string name="show_clock_visible">Clock visibility</string>
|
||||||
<string name="show_clock_not_visible">Clock is hidden</string>
|
<string name="show_clock_not_visible">Clock is hidden</string>
|
||||||
<string name="settings_clock_text_size_title">Clock text size</string>
|
<string name="settings_clock_text_size_title">Clock text size</string>
|
||||||
<string name="settings_show_next_alarm_title">Next clock Alarm</string>
|
<string name="settings_show_next_alarm_title">Next clock alarm</string>
|
||||||
<string name="settings_show_next_alarm_subtitle">Show the next clock alarm</string>
|
<string name="settings_show_next_alarm_subtitle">Show the next clock alarm</string>
|
||||||
<string name="title_text_shadow">Text shadow</string>
|
<string name="title_text_shadow">Text shadow</string>
|
||||||
<string name="settings_text_shadow_subtitle_none">None</string>
|
<string name="settings_text_shadow_subtitle_none">None</string>
|
||||||
@ -213,14 +213,15 @@
|
|||||||
<string name="settings_title_integrations">Integrations</string>
|
<string name="settings_title_integrations">Integrations</string>
|
||||||
<string name="label_count_installed_integrations">%d installed integrations</string>
|
<string name="label_count_installed_integrations">%d installed integrations</string>
|
||||||
<string name="title_show_glance">Show at a glance info</string>
|
<string name="title_show_glance">Show at a glance info</string>
|
||||||
<string name="description_show_glance">Show multiple provider data when there are no events displayed.</string>
|
<string name="description_show_glance">Show some useful info</string>
|
||||||
<string name="settings_show_dividers_title">Show text dividers</string>
|
<string name="settings_show_dividers_title">Show text dividers</string>
|
||||||
<string name="settings_sort_glance_providers_title">Data source priority</string>
|
<string name="settings_sort_glance_providers_title">Data source priority</string>
|
||||||
<string name="settings_sort_glance_providers_subtitle">Change the data provider importance</string>
|
<string name="settings_sort_glance_providers_subtitle">Change the data provider importance</string>
|
||||||
<string name="settings_custom_notes_title">Custom notes</string>
|
<string name="settings_custom_notes_title">Custom notes</string>
|
||||||
<string name="settings_low_battery_level_title">Battery level</string>
|
<string name="settings_low_battery_level_title">Battery</string>
|
||||||
<string name="settings_daily_steps_title">Daily steps</string>
|
<string name="settings_daily_steps_title">Daily steps</string>
|
||||||
<string name="battery_low_warning">Low battery level</string>
|
<string name="battery_low_warning">Low battery level</string>
|
||||||
|
<string name="charging">Charging</string>
|
||||||
<string name="settings_ampm_indicator_title">Show AM/PM Indicator</string>
|
<string name="settings_ampm_indicator_title">Show AM/PM Indicator</string>
|
||||||
<string name="daily_steps_counter">%d steps so far</string>
|
<string name="daily_steps_counter">%d steps so far</string>
|
||||||
<string name="soon">soon</string>
|
<string name="soon">soon</string>
|
||||||
@ -234,4 +235,15 @@
|
|||||||
<string name="settings_weather_icon_pack_default">Default</string>
|
<string name="settings_weather_icon_pack_default">Default</string>
|
||||||
<string name="settings_weather_icon_pack_minimal">Minimal</string>
|
<string name="settings_weather_icon_pack_minimal">Minimal</string>
|
||||||
<string name="action_capitalize_the_date">Capitalize the date</string>
|
<string name="action_capitalize_the_date">Capitalize the date</string>
|
||||||
|
<string name="providers">Providers</string>
|
||||||
|
<string name="first_row_header">First row style</string>
|
||||||
|
<string name="second_row_header">Second row style</string>
|
||||||
|
<string name="global_style_header">Global style</string>
|
||||||
|
<string name="style_header">Style</string>
|
||||||
|
<string name="filters_header">Event filters</string>
|
||||||
|
<string name="event_detail_header">Event detail</string>
|
||||||
|
<string name="actions_header">Actions</string>
|
||||||
|
<string name="provider_header">Provider</string>
|
||||||
|
<string name="clock_text_header">Clock text</string>
|
||||||
|
<string name="preferences_header">Preferences</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
4
app/src/main/res/xml/backup_descriptor.xml
Normal file
4
app/src/main/res/xml/backup_descriptor.xml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<full-backup-content>
|
||||||
|
<include domain="sharedpref" path="." />
|
||||||
|
</full-backup-content>
|
@ -1,4 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<full-backup-content>
|
|
||||||
<include domain="sharedpref" path="."/>
|
|
||||||
</full-backup-content>
|
|
Reference in New Issue
Block a user