Compare commits
4 Commits
v2.2.1
...
v2.2.2-bet
Author | SHA1 | Date | |
---|---|---|---|
24bb811f93 | |||
d2087d094f | |||
34fb35f2ab | |||
108ecdece0 |
BIN
.idea/caches/build_file_checksums.ser
generated
@ -22,8 +22,8 @@ android {
|
|||||||
applicationId "com.tommasoberlose.anotherwidget"
|
applicationId "com.tommasoberlose.anotherwidget"
|
||||||
minSdkVersion 23
|
minSdkVersion 23
|
||||||
targetSdkVersion 30
|
targetSdkVersion 30
|
||||||
versionCode 118
|
versionCode 120
|
||||||
versionName "2.2.1"
|
versionName "2.2.2"
|
||||||
|
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
buildConfigField("String", "GOOGLE_API_KEY", apikeyProperties['GOOGLE_API_KEY'])
|
buildConfigField("String", "GOOGLE_API_KEY", apikeyProperties['GOOGLE_API_KEY'])
|
||||||
|
@ -150,9 +150,10 @@
|
|||||||
</receiver>
|
</receiver>
|
||||||
|
|
||||||
<service
|
<service
|
||||||
android:name=".services.UpdateCalendarJob"
|
android:name=".services.UpdateCalendarService"
|
||||||
android:permission="android.permission.BIND_JOB_SERVICE"
|
android:enabled="true"
|
||||||
android:exported="true"/>
|
android:exported="false"
|
||||||
|
android:foregroundServiceType="dataSync" />
|
||||||
<service
|
<service
|
||||||
android:name=".services.LocationService"
|
android:name=".services.LocationService"
|
||||||
android:enabled="true"
|
android:enabled="true"
|
||||||
|
@ -1,29 +1,16 @@
|
|||||||
package com.tommasoberlose.anotherwidget.helpers
|
package com.tommasoberlose.anotherwidget.helpers
|
||||||
|
|
||||||
import android.Manifest
|
import android.Manifest
|
||||||
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.ContentUris
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.provider.CalendarContract
|
import android.provider.CalendarContract
|
||||||
import android.util.Log
|
|
||||||
import com.tommasoberlose.anotherwidget.services.EventListenerJob
|
import com.tommasoberlose.anotherwidget.services.EventListenerJob
|
||||||
import com.tommasoberlose.anotherwidget.db.EventRepository
|
|
||||||
import com.tommasoberlose.anotherwidget.models.Event
|
import com.tommasoberlose.anotherwidget.models.Event
|
||||||
import com.tommasoberlose.anotherwidget.global.Preferences
|
import com.tommasoberlose.anotherwidget.global.Preferences
|
||||||
import com.tommasoberlose.anotherwidget.receivers.UpdatesReceiver
|
import com.tommasoberlose.anotherwidget.services.UpdateCalendarService
|
||||||
import com.tommasoberlose.anotherwidget.services.UpdateCalendarJob
|
|
||||||
import com.tommasoberlose.anotherwidget.ui.fragments.MainFragment
|
|
||||||
import com.tommasoberlose.anotherwidget.ui.widgets.MainWidget
|
|
||||||
import com.tommasoberlose.anotherwidget.utils.checkGrantedPermission
|
import com.tommasoberlose.anotherwidget.utils.checkGrantedPermission
|
||||||
import me.everything.providers.android.calendar.CalendarProvider
|
import me.everything.providers.android.calendar.CalendarProvider
|
||||||
import org.greenrobot.eventbus.EventBus
|
|
||||||
import java.util.*
|
import java.util.*
|
||||||
import kotlin.Comparator
|
|
||||||
import kotlin.collections.ArrayList
|
import kotlin.collections.ArrayList
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -32,7 +19,7 @@ import kotlin.collections.ArrayList
|
|||||||
|
|
||||||
object CalendarHelper {
|
object CalendarHelper {
|
||||||
fun updateEventList(context: Context) {
|
fun updateEventList(context: Context) {
|
||||||
UpdateCalendarJob.enqueueWork(context, Intent())
|
UpdateCalendarService.enqueueWork(context)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getCalendarList(context: Context): List<me.everything.providers.android.calendar.Calendar> {
|
fun getCalendarList(context: Context): List<me.everything.providers.android.calendar.Calendar> {
|
||||||
|
@ -63,10 +63,20 @@ object SettingsStringHelper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun getVariantLabel(context: Context, variant: String): String = when {
|
fun getVariantLabel(context: Context, variant: String): String = when {
|
||||||
|
variant == "italic" -> context.getString(R.string.font_italic)
|
||||||
|
variant.contains("100") && variant.contains("italic") -> context.getString(R.string.font_100_italic)
|
||||||
|
variant.contains("200") && variant.contains("italic") -> context.getString(R.string.font_200_italic)
|
||||||
|
variant.contains("300") && variant.contains("italic") -> context.getString(R.string.font_300_italic)
|
||||||
|
variant.contains("400") && variant.contains("italic") -> context.getString(R.string.font_400_italic)
|
||||||
|
variant.contains("500") && variant.contains("italic") -> context.getString(R.string.font_500_italic)
|
||||||
|
variant.contains("600") && variant.contains("italic") -> context.getString(R.string.font_600_italic)
|
||||||
|
variant.contains("700") && variant.contains("italic") -> context.getString(R.string.font_700_italic)
|
||||||
|
variant.contains("800") && variant.contains("italic") -> context.getString(R.string.font_800_italic)
|
||||||
|
variant.contains("900") && variant.contains("italic") -> context.getString(R.string.font_900_italic)
|
||||||
|
variant == "regular" || variant.contains("400") -> context.getString(R.string.font_400)
|
||||||
variant.contains("100") -> context.getString(R.string.font_100)
|
variant.contains("100") -> context.getString(R.string.font_100)
|
||||||
variant.contains("200") -> context.getString(R.string.font_200)
|
variant.contains("200") -> context.getString(R.string.font_200)
|
||||||
variant.contains("300") -> context.getString(R.string.font_300)
|
variant.contains("300") -> context.getString(R.string.font_300)
|
||||||
variant.contains("regular") || variant.contains("400") -> context.getString(R.string.font_400)
|
|
||||||
variant.contains("500") -> context.getString(R.string.font_500)
|
variant.contains("500") -> context.getString(R.string.font_500)
|
||||||
variant.contains("600") -> context.getString(R.string.font_600)
|
variant.contains("600") -> context.getString(R.string.font_600)
|
||||||
variant.contains("700") -> context.getString(R.string.font_700)
|
variant.contains("700") -> context.getString(R.string.font_700)
|
||||||
|
@ -2,6 +2,7 @@ package com.tommasoberlose.anotherwidget.network
|
|||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.util.Log
|
import android.util.Log
|
||||||
|
import com.chibatching.kotpref.Kotpref
|
||||||
import com.google.gson.internal.LinkedTreeMap
|
import com.google.gson.internal.LinkedTreeMap
|
||||||
import com.haroldadmin.cnradapter.NetworkResponse
|
import com.haroldadmin.cnradapter.NetworkResponse
|
||||||
import com.haroldadmin.cnradapter.executeWithRetry
|
import com.haroldadmin.cnradapter.executeWithRetry
|
||||||
@ -26,6 +27,7 @@ import java.util.*
|
|||||||
|
|
||||||
class WeatherNetworkApi(val context: Context) {
|
class WeatherNetworkApi(val context: Context) {
|
||||||
suspend fun updateWeather() {
|
suspend fun updateWeather() {
|
||||||
|
Kotpref.init(context)
|
||||||
Preferences.weatherProviderError = "-"
|
Preferences.weatherProviderError = "-"
|
||||||
Preferences.weatherProviderLocationError = ""
|
Preferences.weatherProviderLocationError = ""
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ import kotlin.collections.ArrayList
|
|||||||
|
|
||||||
class LocationService : Service() {
|
class LocationService : Service() {
|
||||||
|
|
||||||
private val jobs: ArrayList<Job> = ArrayList()
|
private var job: Job? = null
|
||||||
|
|
||||||
override fun onCreate() {
|
override fun onCreate() {
|
||||||
super.onCreate()
|
super.onCreate()
|
||||||
@ -34,13 +34,13 @@ class LocationService : Service() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
|
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
|
||||||
if (ActivityCompat.checkSelfPermission(
|
job?.cancel()
|
||||||
this,
|
job = GlobalScope.launch(Dispatchers.IO) {
|
||||||
Manifest.permission.ACCESS_FINE_LOCATION
|
if (ActivityCompat.checkSelfPermission(
|
||||||
) == PackageManager.PERMISSION_GRANTED
|
this@LocationService,
|
||||||
) {
|
Manifest.permission.ACCESS_FINE_LOCATION
|
||||||
|
) == PackageManager.PERMISSION_GRANTED
|
||||||
jobs += GlobalScope.launch(Dispatchers.IO) {
|
) {
|
||||||
LocationServices.getFusedLocationProviderClient(this@LocationService).lastLocation.addOnCompleteListener { task ->
|
LocationServices.getFusedLocationProviderClient(this@LocationService).lastLocation.addOnCompleteListener { task ->
|
||||||
val networkApi = WeatherNetworkApi(this@LocationService)
|
val networkApi = WeatherNetworkApi(this@LocationService)
|
||||||
if (task.isSuccessful) {
|
if (task.isSuccessful) {
|
||||||
@ -67,18 +67,17 @@ class LocationService : Service() {
|
|||||||
EventBus.getDefault().post(MainFragment.UpdateUiMessageEvent())
|
EventBus.getDefault().post(MainFragment.UpdateUiMessageEvent())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
stopSelf()
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
stopSelf()
|
|
||||||
}
|
}
|
||||||
return START_STICKY
|
return START_STICKY
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onDestroy() {
|
override fun onDestroy() {
|
||||||
super.onDestroy()
|
super.onDestroy()
|
||||||
jobs.forEach {
|
job?.cancel()
|
||||||
it.cancel()
|
job = null
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
@ -116,7 +115,6 @@ class LocationService : Service() {
|
|||||||
val builder = NotificationCompat.Builder(this@LocationService, getString(R.string.location_access_notification_channel_id))
|
val builder = NotificationCompat.Builder(this@LocationService, getString(R.string.location_access_notification_channel_id))
|
||||||
.setSmallIcon(R.drawable.ic_stat_notification)
|
.setSmallIcon(R.drawable.ic_stat_notification)
|
||||||
.setContentTitle(getString(R.string.location_access_notification_title))
|
.setContentTitle(getString(R.string.location_access_notification_title))
|
||||||
.setStyle(NotificationCompat.BigTextStyle().bigText(getString(R.string.location_access_notification_subtitle)))
|
|
||||||
.setOngoing(true)
|
.setOngoing(true)
|
||||||
.setColor(ContextCompat.getColor(this@LocationService, R.color.colorAccent))
|
.setColor(ContextCompat.getColor(this@LocationService, R.color.colorAccent))
|
||||||
|
|
||||||
|
@ -1,153 +0,0 @@
|
|||||||
package com.tommasoberlose.anotherwidget.services
|
|
||||||
|
|
||||||
import android.Manifest
|
|
||||||
import android.content.Context
|
|
||||||
import android.content.Intent
|
|
||||||
import android.provider.CalendarContract
|
|
||||||
import android.util.Log
|
|
||||||
import androidx.core.app.JobIntentService
|
|
||||||
import com.tommasoberlose.anotherwidget.db.EventRepository
|
|
||||||
import com.tommasoberlose.anotherwidget.global.Preferences
|
|
||||||
import com.tommasoberlose.anotherwidget.helpers.CalendarHelper
|
|
||||||
import com.tommasoberlose.anotherwidget.helpers.CalendarHelper.applyFilters
|
|
||||||
import com.tommasoberlose.anotherwidget.helpers.CalendarHelper.sortEvents
|
|
||||||
import com.tommasoberlose.anotherwidget.models.Event
|
|
||||||
import com.tommasoberlose.anotherwidget.receivers.UpdatesReceiver
|
|
||||||
import com.tommasoberlose.anotherwidget.ui.fragments.MainFragment
|
|
||||||
import com.tommasoberlose.anotherwidget.ui.widgets.MainWidget
|
|
||||||
import com.tommasoberlose.anotherwidget.utils.checkGrantedPermission
|
|
||||||
import me.everything.providers.android.calendar.CalendarProvider
|
|
||||||
import org.greenrobot.eventbus.EventBus
|
|
||||||
import java.util.*
|
|
||||||
import kotlin.Comparator
|
|
||||||
import kotlin.collections.ArrayList
|
|
||||||
|
|
||||||
class UpdateCalendarJob : JobIntentService() {
|
|
||||||
|
|
||||||
companion object {
|
|
||||||
private const val jobId = 1200
|
|
||||||
|
|
||||||
fun enqueueWork(context: Context, work: Intent) {
|
|
||||||
enqueueWork(context, UpdateCalendarJob::class.java, jobId, work)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onHandleWork(intent: Intent) {
|
|
||||||
val eventRepository = EventRepository(this)
|
|
||||||
if (Preferences.showEvents) {
|
|
||||||
val eventList = ArrayList<Event>()
|
|
||||||
|
|
||||||
val now = Calendar.getInstance()
|
|
||||||
val begin = Calendar.getInstance().apply {
|
|
||||||
set(Calendar.MILLISECOND, 0)
|
|
||||||
set(Calendar.SECOND, 0)
|
|
||||||
set(Calendar.MINUTE, 0)
|
|
||||||
set(Calendar.HOUR_OF_DAY, 0)
|
|
||||||
}
|
|
||||||
val limit = Calendar.getInstance().apply {
|
|
||||||
when (Preferences.showUntil) {
|
|
||||||
0 -> add(Calendar.HOUR, 3)
|
|
||||||
1 -> add(Calendar.HOUR, 6)
|
|
||||||
2 -> add(Calendar.HOUR, 12)
|
|
||||||
3 -> add(Calendar.DAY_OF_MONTH, 1)
|
|
||||||
4 -> add(Calendar.DAY_OF_MONTH, 3)
|
|
||||||
5 -> add(Calendar.DAY_OF_MONTH, 7)
|
|
||||||
6 -> add(Calendar.MINUTE, 30)
|
|
||||||
7 -> add(Calendar.HOUR, 1)
|
|
||||||
else -> add(Calendar.HOUR, 6)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!checkGrantedPermission(
|
|
||||||
Manifest.permission.READ_CALENDAR
|
|
||||||
)
|
|
||||||
) {
|
|
||||||
eventRepository.resetNextEventData()
|
|
||||||
} else {
|
|
||||||
try {
|
|
||||||
val provider = CalendarProvider(this)
|
|
||||||
val data = provider.getInstances(begin.timeInMillis, limit.timeInMillis)
|
|
||||||
if (data != null) {
|
|
||||||
val instances = data.list
|
|
||||||
for (instance in instances) {
|
|
||||||
try {
|
|
||||||
val e = provider.getEvent(instance.eventId)
|
|
||||||
if (e != null && !e.deleted && instance.begin <= limit.timeInMillis && now.timeInMillis < instance.end && !CalendarHelper.getFilteredCalendarIdList()
|
|
||||||
.contains(e.calendarId)
|
|
||||||
) {
|
|
||||||
if (e.allDay) {
|
|
||||||
val start = Calendar.getInstance()
|
|
||||||
start.timeInMillis = instance.begin
|
|
||||||
val end = Calendar.getInstance()
|
|
||||||
end.timeInMillis = instance.end
|
|
||||||
instance.begin =
|
|
||||||
start.timeInMillis - start.timeZone.getOffset(start.timeInMillis)
|
|
||||||
instance.end =
|
|
||||||
end.timeInMillis - end.timeZone.getOffset(end.timeInMillis)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check all day events
|
|
||||||
val startDate = Calendar.getInstance()
|
|
||||||
startDate.timeInMillis = instance.begin
|
|
||||||
val endDate = Calendar.getInstance()
|
|
||||||
endDate.timeInMillis = instance.end
|
|
||||||
|
|
||||||
val isAllDay = e.allDay || (
|
|
||||||
startDate.get(Calendar.MILLISECOND) == 0
|
|
||||||
&& startDate.get(Calendar.SECOND) == 0
|
|
||||||
&& startDate.get(Calendar.MINUTE) == 0
|
|
||||||
&& startDate.get(Calendar.HOUR_OF_DAY) == 0
|
|
||||||
&& endDate.get(Calendar.MILLISECOND) == 0
|
|
||||||
&& endDate.get(Calendar.SECOND) == 0
|
|
||||||
&& endDate.get(Calendar.MINUTE) == 0
|
|
||||||
&& endDate.get(Calendar.HOUR_OF_DAY) == 0
|
|
||||||
)
|
|
||||||
|
|
||||||
eventList.add(
|
|
||||||
Event(
|
|
||||||
id = instance.id,
|
|
||||||
eventID = e.id,
|
|
||||||
title = e.title ?: "",
|
|
||||||
startDate = instance.begin,
|
|
||||||
endDate = instance.end,
|
|
||||||
calendarID = e.calendarId.toInt(),
|
|
||||||
allDay = isAllDay,
|
|
||||||
address = e.eventLocation ?: "",
|
|
||||||
selfAttendeeStatus = e.selfAttendeeStatus.toInt(),
|
|
||||||
availability = e.availability
|
|
||||||
)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
} catch (ignored: Exception) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
val sortedEvents = eventList.sortEvents()
|
|
||||||
val filteredEventList = sortedEvents
|
|
||||||
.applyFilters()
|
|
||||||
|
|
||||||
if (filteredEventList.isEmpty()) {
|
|
||||||
eventRepository.resetNextEventData()
|
|
||||||
eventRepository.clearEvents()
|
|
||||||
} else {
|
|
||||||
eventRepository.saveEvents(
|
|
||||||
sortedEvents
|
|
||||||
)
|
|
||||||
eventRepository.saveNextEventData(filteredEventList.first())
|
|
||||||
}
|
|
||||||
} catch (ignored: java.lang.Exception) {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
eventRepository.resetNextEventData()
|
|
||||||
}
|
|
||||||
|
|
||||||
UpdatesReceiver.setUpdates(this)
|
|
||||||
MainWidget.updateWidget(this)
|
|
||||||
|
|
||||||
EventBus.getDefault().post(MainFragment.UpdateUiMessageEvent())
|
|
||||||
eventRepository.close()
|
|
||||||
}
|
|
||||||
}
|
|
@ -0,0 +1,218 @@
|
|||||||
|
package com.tommasoberlose.anotherwidget.services
|
||||||
|
|
||||||
|
import android.Manifest
|
||||||
|
import android.app.*
|
||||||
|
import android.content.Context
|
||||||
|
import android.content.Intent
|
||||||
|
import android.os.IBinder
|
||||||
|
import android.util.Log
|
||||||
|
import androidx.core.app.NotificationCompat
|
||||||
|
import androidx.core.app.NotificationManagerCompat
|
||||||
|
import androidx.core.content.ContextCompat
|
||||||
|
import com.tommasoberlose.anotherwidget.R
|
||||||
|
import com.tommasoberlose.anotherwidget.db.EventRepository
|
||||||
|
import com.tommasoberlose.anotherwidget.global.Preferences
|
||||||
|
import com.tommasoberlose.anotherwidget.helpers.CalendarHelper
|
||||||
|
import com.tommasoberlose.anotherwidget.helpers.CalendarHelper.applyFilters
|
||||||
|
import com.tommasoberlose.anotherwidget.helpers.CalendarHelper.sortEvents
|
||||||
|
import com.tommasoberlose.anotherwidget.models.Event
|
||||||
|
import com.tommasoberlose.anotherwidget.receivers.UpdatesReceiver
|
||||||
|
import com.tommasoberlose.anotherwidget.ui.activities.MainActivity
|
||||||
|
import com.tommasoberlose.anotherwidget.ui.fragments.MainFragment
|
||||||
|
import com.tommasoberlose.anotherwidget.ui.widgets.MainWidget
|
||||||
|
import com.tommasoberlose.anotherwidget.utils.checkGrantedPermission
|
||||||
|
import kotlinx.coroutines.Dispatchers
|
||||||
|
import kotlinx.coroutines.GlobalScope
|
||||||
|
import kotlinx.coroutines.Job
|
||||||
|
import kotlinx.coroutines.launch
|
||||||
|
import me.everything.providers.android.calendar.CalendarProvider
|
||||||
|
import org.greenrobot.eventbus.EventBus
|
||||||
|
import java.util.*
|
||||||
|
import kotlin.collections.ArrayList
|
||||||
|
|
||||||
|
class UpdateCalendarService : Service() {
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
const val CALENDAR_SYNC_NOTIFICATION_ID = 28466
|
||||||
|
fun enqueueWork(context: Context) {
|
||||||
|
context.startService(Intent(context, UpdateCalendarService::class.java))
|
||||||
|
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
|
||||||
|
context.startForegroundService(Intent(context, UpdateCalendarService::class.java))
|
||||||
|
} else {
|
||||||
|
context.startService(Intent(context, UpdateCalendarService::class.java))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onCreate() {
|
||||||
|
super.onCreate()
|
||||||
|
startForeground(CALENDAR_SYNC_NOTIFICATION_ID, getCalendarSyncNotification())
|
||||||
|
}
|
||||||
|
|
||||||
|
private var job: Job? = null
|
||||||
|
|
||||||
|
override fun onBind(intent: Intent?): IBinder? {
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
|
||||||
|
job?.cancel()
|
||||||
|
job = GlobalScope.launch(Dispatchers.IO) {
|
||||||
|
|
||||||
|
val eventRepository = EventRepository(this@UpdateCalendarService)
|
||||||
|
if (Preferences.showEvents) {
|
||||||
|
val eventList = ArrayList<Event>()
|
||||||
|
|
||||||
|
val now = Calendar.getInstance()
|
||||||
|
val begin = Calendar.getInstance().apply {
|
||||||
|
set(Calendar.MILLISECOND, 0)
|
||||||
|
set(Calendar.SECOND, 0)
|
||||||
|
set(Calendar.MINUTE, 0)
|
||||||
|
set(Calendar.HOUR_OF_DAY, 0)
|
||||||
|
}
|
||||||
|
val limit = Calendar.getInstance().apply {
|
||||||
|
when (Preferences.showUntil) {
|
||||||
|
0 -> add(Calendar.HOUR, 3)
|
||||||
|
1 -> add(Calendar.HOUR, 6)
|
||||||
|
2 -> add(Calendar.HOUR, 12)
|
||||||
|
3 -> add(Calendar.DAY_OF_MONTH, 1)
|
||||||
|
4 -> add(Calendar.DAY_OF_MONTH, 3)
|
||||||
|
5 -> add(Calendar.DAY_OF_MONTH, 7)
|
||||||
|
6 -> add(Calendar.MINUTE, 30)
|
||||||
|
7 -> add(Calendar.HOUR, 1)
|
||||||
|
else -> add(Calendar.HOUR, 6)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!checkGrantedPermission(
|
||||||
|
Manifest.permission.READ_CALENDAR
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
eventRepository.resetNextEventData()
|
||||||
|
} else {
|
||||||
|
try {
|
||||||
|
val provider = CalendarProvider(this@UpdateCalendarService)
|
||||||
|
val data = provider.getInstances(begin.timeInMillis, limit.timeInMillis)
|
||||||
|
if (data != null) {
|
||||||
|
val instances = data.list
|
||||||
|
for (instance in instances) {
|
||||||
|
try {
|
||||||
|
val e = provider.getEvent(instance.eventId)
|
||||||
|
if (e != null && !e.deleted && instance.begin <= limit.timeInMillis && now.timeInMillis < instance.end && !CalendarHelper.getFilteredCalendarIdList()
|
||||||
|
.contains(e.calendarId)
|
||||||
|
) {
|
||||||
|
if (e.allDay) {
|
||||||
|
val start = Calendar.getInstance()
|
||||||
|
start.timeInMillis = instance.begin
|
||||||
|
val end = Calendar.getInstance()
|
||||||
|
end.timeInMillis = instance.end
|
||||||
|
instance.begin =
|
||||||
|
start.timeInMillis - start.timeZone.getOffset(start.timeInMillis)
|
||||||
|
instance.end =
|
||||||
|
end.timeInMillis - end.timeZone.getOffset(end.timeInMillis)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check all day events
|
||||||
|
val startDate = Calendar.getInstance()
|
||||||
|
startDate.timeInMillis = instance.begin
|
||||||
|
val endDate = Calendar.getInstance()
|
||||||
|
endDate.timeInMillis = instance.end
|
||||||
|
|
||||||
|
val isAllDay = e.allDay || (
|
||||||
|
startDate.get(Calendar.MILLISECOND) == 0
|
||||||
|
&& startDate.get(Calendar.SECOND) == 0
|
||||||
|
&& startDate.get(Calendar.MINUTE) == 0
|
||||||
|
&& startDate.get(Calendar.HOUR_OF_DAY) == 0
|
||||||
|
&& endDate.get(Calendar.MILLISECOND) == 0
|
||||||
|
&& endDate.get(Calendar.SECOND) == 0
|
||||||
|
&& endDate.get(Calendar.MINUTE) == 0
|
||||||
|
&& endDate.get(Calendar.HOUR_OF_DAY) == 0
|
||||||
|
)
|
||||||
|
|
||||||
|
eventList.add(
|
||||||
|
Event(
|
||||||
|
id = instance.id,
|
||||||
|
eventID = e.id,
|
||||||
|
title = e.title ?: "",
|
||||||
|
startDate = instance.begin,
|
||||||
|
endDate = instance.end,
|
||||||
|
calendarID = e.calendarId.toInt(),
|
||||||
|
allDay = isAllDay,
|
||||||
|
address = e.eventLocation ?: "",
|
||||||
|
selfAttendeeStatus = e.selfAttendeeStatus.toInt(),
|
||||||
|
availability = e.availability
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
} catch (ignored: Exception) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
val sortedEvents = eventList.sortEvents()
|
||||||
|
val filteredEventList = sortedEvents
|
||||||
|
.applyFilters()
|
||||||
|
|
||||||
|
if (filteredEventList.isEmpty()) {
|
||||||
|
eventRepository.resetNextEventData()
|
||||||
|
eventRepository.clearEvents()
|
||||||
|
} else {
|
||||||
|
eventRepository.saveEvents(
|
||||||
|
sortedEvents
|
||||||
|
)
|
||||||
|
eventRepository.saveNextEventData(filteredEventList.first())
|
||||||
|
}
|
||||||
|
} catch (ignored: java.lang.Exception) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
eventRepository.resetNextEventData()
|
||||||
|
}
|
||||||
|
|
||||||
|
UpdatesReceiver.setUpdates(this@UpdateCalendarService)
|
||||||
|
MainWidget.updateWidget(this@UpdateCalendarService)
|
||||||
|
|
||||||
|
EventBus.getDefault().post(MainFragment.UpdateUiMessageEvent())
|
||||||
|
eventRepository.close()
|
||||||
|
|
||||||
|
stopSelf()
|
||||||
|
}
|
||||||
|
|
||||||
|
return START_STICKY
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onDestroy() {
|
||||||
|
super.onDestroy()
|
||||||
|
job?.cancel()
|
||||||
|
job = null
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun getCalendarSyncNotification(): Notification {
|
||||||
|
with(NotificationManagerCompat.from(this)) {
|
||||||
|
// Create channel
|
||||||
|
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
|
||||||
|
createNotificationChannel(
|
||||||
|
NotificationChannel(
|
||||||
|
getString(R.string.calendar_sync_notification_channel_id),
|
||||||
|
getString(R.string.calendar_sync_notification_channel_name),
|
||||||
|
NotificationManager.IMPORTANCE_LOW
|
||||||
|
).apply {
|
||||||
|
description = getString(R.string.calendar_sync_notification_channel_description)
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
val builder = NotificationCompat.Builder(this@UpdateCalendarService, getString(R.string.calendar_sync_notification_channel_id))
|
||||||
|
.setSmallIcon(R.drawable.ic_stat_notification)
|
||||||
|
.setContentTitle(getString(R.string.calendar_sync_notification_title))
|
||||||
|
.setOngoing(true)
|
||||||
|
.setColor(ContextCompat.getColor(this@UpdateCalendarService, R.color.colorAccent))
|
||||||
|
|
||||||
|
// Main intent that open the activity
|
||||||
|
builder.setContentIntent(PendingIntent.getActivity(this@UpdateCalendarService, 0, Intent(this@UpdateCalendarService, MainActivity::class.java), PendingIntent.FLAG_UPDATE_CURRENT))
|
||||||
|
|
||||||
|
return builder.build()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -4,6 +4,7 @@ import android.Manifest
|
|||||||
import android.app.Activity
|
import android.app.Activity
|
||||||
import android.appwidget.AppWidgetManager
|
import android.appwidget.AppWidgetManager
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
|
import android.content.SharedPreferences
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import androidx.appcompat.app.AppCompatActivity
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
@ -22,9 +23,10 @@ import com.tommasoberlose.anotherwidget.global.Preferences
|
|||||||
import com.tommasoberlose.anotherwidget.global.RequestCode
|
import com.tommasoberlose.anotherwidget.global.RequestCode
|
||||||
import com.tommasoberlose.anotherwidget.ui.activities.tabs.WeatherProviderActivity
|
import com.tommasoberlose.anotherwidget.ui.activities.tabs.WeatherProviderActivity
|
||||||
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.utils.checkGrantedPermission
|
import com.tommasoberlose.anotherwidget.utils.checkGrantedPermission
|
||||||
|
|
||||||
class MainActivity : AppCompatActivity() {
|
class MainActivity : AppCompatActivity(), SharedPreferences.OnSharedPreferenceChangeListener {
|
||||||
|
|
||||||
private var mAppWidgetId: Int = -1
|
private var mAppWidgetId: Int = -1
|
||||||
private lateinit var viewModel: MainViewModel
|
private lateinit var viewModel: MainViewModel
|
||||||
@ -140,4 +142,18 @@ class MainActivity : AppCompatActivity() {
|
|||||||
Preferences.showEvents = false
|
Preferences.showEvents = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun onStart() {
|
||||||
|
Preferences.preferences.registerOnSharedPreferenceChangeListener(this)
|
||||||
|
super.onStart()
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onStop() {
|
||||||
|
super.onStop()
|
||||||
|
Preferences.preferences.unregisterOnSharedPreferenceChangeListener(this)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onSharedPreferenceChanged(p0: SharedPreferences?, p1: String?) {
|
||||||
|
MainWidget.updateWidget(this)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,6 +6,7 @@ import android.graphics.Typeface
|
|||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.os.Handler
|
import android.os.Handler
|
||||||
import android.os.HandlerThread
|
import android.os.HandlerThread
|
||||||
|
import android.util.Log
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import android.widget.TextView
|
import android.widget.TextView
|
||||||
@ -18,6 +19,7 @@ import androidx.lifecycle.ViewModelProvider
|
|||||||
import androidx.lifecycle.lifecycleScope
|
import androidx.lifecycle.lifecycleScope
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
import com.chibatching.kotpref.blockingBulk
|
import com.chibatching.kotpref.blockingBulk
|
||||||
|
import com.google.gson.Gson
|
||||||
import com.koolio.library.Font
|
import com.koolio.library.Font
|
||||||
import com.tommasoberlose.anotherwidget.R
|
import com.tommasoberlose.anotherwidget.R
|
||||||
import com.tommasoberlose.anotherwidget.components.BottomSheetMenu
|
import com.tommasoberlose.anotherwidget.components.BottomSheetMenu
|
||||||
@ -125,7 +127,7 @@ class CustomFontActivity : AppCompatActivity() {
|
|||||||
if (item.fontVariants.isEmpty()) {
|
if (item.fontVariants.isEmpty()) {
|
||||||
dialog.addItem(SettingsStringHelper.getVariantLabel(this, "regular"), -1)
|
dialog.addItem(SettingsStringHelper.getVariantLabel(this, "regular"), -1)
|
||||||
} else {
|
} else {
|
||||||
item.fontVariants.filter { !it.contains("italic") }
|
item.fontVariants
|
||||||
.forEachIndexed { index, s ->
|
.forEachIndexed { index, s ->
|
||||||
dialog.addItem(SettingsStringHelper.getVariantLabel(this, s), index)
|
dialog.addItem(SettingsStringHelper.getVariantLabel(this, s), index)
|
||||||
}
|
}
|
||||||
|
@ -63,8 +63,8 @@ class MainFragment : Fragment() {
|
|||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
|
|
||||||
enterTransition = MaterialSharedAxis(MaterialSharedAxis.X, true)
|
enterTransition = MaterialSharedAxis(MaterialSharedAxis.Y, true)
|
||||||
reenterTransition = MaterialSharedAxis(MaterialSharedAxis.X, false)
|
reenterTransition = MaterialSharedAxis(MaterialSharedAxis.Y, false)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onCreateView(
|
override fun onCreateView(
|
||||||
@ -102,9 +102,7 @@ class MainFragment : Fragment() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
binding.actionSettings.setOnClickListener {
|
binding.actionSettings.setOnClickListener {
|
||||||
Navigation.findNavController(it).navigate(R.id.action_appMainFragment_to_appSettingsFragment, null, null, FragmentNavigatorExtras(
|
Navigation.findNavController(it).navigate(R.id.action_appMainFragment_to_appSettingsFragment,)
|
||||||
binding.actionBack to "action_back"
|
|
||||||
))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
binding.preview.layoutParams = binding.preview.layoutParams.apply {
|
binding.preview.layoutParams = binding.preview.layoutParams.apply {
|
||||||
|
@ -52,9 +52,9 @@ class SettingsFragment : Fragment() {
|
|||||||
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
sharedElementEnterTransition = TransitionInflater.from(context).inflateTransition(android.R.transition.move)
|
// sharedElementEnterTransition = TransitionInflater.from(context).inflateTransition(android.R.transition.move)
|
||||||
enterTransition = MaterialSharedAxis(MaterialSharedAxis.X, true)
|
enterTransition = MaterialSharedAxis(MaterialSharedAxis.Y, true)
|
||||||
// returnTransition = MaterialSharedAxis(MaterialSharedAxis.X, false)
|
returnTransition = MaterialSharedAxis(MaterialSharedAxis.Y, false)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onCreateView(
|
override fun onCreateView(
|
||||||
|
@ -274,22 +274,23 @@ class GlanceTabFragment : Fragment() {
|
|||||||
}
|
}
|
||||||
Constants.GlanceProviderId.EVENTS -> {
|
Constants.GlanceProviderId.EVENTS -> {
|
||||||
isVisible =
|
isVisible =
|
||||||
Preferences.showEventsAsGlanceProvider && Preferences.showEvents && requireContext().checkGrantedPermission(
|
Preferences.showEventsAsGlanceProvider
|
||||||
Manifest.permission.READ_CALENDAR
|
val hasError = !Preferences.showEvents || !requireContext().checkGrantedPermission(
|
||||||
)
|
Manifest.permission.READ_CALENDAR
|
||||||
|
)
|
||||||
injector.text(
|
injector.text(
|
||||||
R.id.label,
|
R.id.label,
|
||||||
if (isVisible) getString(R.string.settings_visible) else getString(
|
if (isVisible && !hasError) getString(R.string.settings_visible) else getString(
|
||||||
R.string.settings_not_visible
|
R.string.settings_not_visible
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
injector.visibility(
|
injector.visibility(
|
||||||
R.id.error_icon,
|
R.id.error_icon,
|
||||||
if (isVisible) View.GONE else View.VISIBLE
|
if (isVisible && hasError) View.VISIBLE else View.GONE
|
||||||
)
|
)
|
||||||
injector.visibility(
|
injector.visibility(
|
||||||
R.id.info_icon,
|
R.id.info_icon,
|
||||||
if (isVisible) View.VISIBLE else View.GONE
|
if (!(isVisible && hasError)) View.VISIBLE else View.GONE
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,6 @@ import android.os.Bundle
|
|||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import androidx.databinding.DataBindingUtil
|
|
||||||
import androidx.fragment.app.Fragment
|
import androidx.fragment.app.Fragment
|
||||||
import androidx.lifecycle.ViewModelProvider
|
import androidx.lifecycle.ViewModelProvider
|
||||||
import androidx.lifecycle.lifecycleScope
|
import androidx.lifecycle.lifecycleScope
|
||||||
@ -29,7 +28,6 @@ import com.tommasoberlose.anotherwidget.ui.activities.tabs.CustomFontActivity
|
|||||||
import com.tommasoberlose.anotherwidget.ui.activities.MainActivity
|
import com.tommasoberlose.anotherwidget.ui.activities.MainActivity
|
||||||
import com.tommasoberlose.anotherwidget.ui.activities.tabs.CustomDateActivity
|
import com.tommasoberlose.anotherwidget.ui.activities.tabs.CustomDateActivity
|
||||||
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.utils.isDarkTheme
|
import com.tommasoberlose.anotherwidget.utils.isDarkTheme
|
||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
import kotlinx.coroutines.delay
|
import kotlinx.coroutines.delay
|
||||||
|
@ -96,7 +96,6 @@ class MainViewModel(context: Application) : AndroidViewModel(context) {
|
|||||||
val showWallpaper = Preferences.asLiveData(Preferences::showWallpaper)
|
val showWallpaper = Preferences.asLiveData(Preferences::showWallpaper)
|
||||||
val showPreview = Preferences.asLiveData(Preferences::showPreview)
|
val showPreview = Preferences.asLiveData(Preferences::showPreview)
|
||||||
val installedIntegrations = Preferences.asLiveData(Preferences::installedIntegrations)
|
val installedIntegrations = Preferences.asLiveData(Preferences::installedIntegrations)
|
||||||
var colorClipboard: ArrayList<String> = ArrayList()
|
|
||||||
|
|
||||||
// UI
|
// UI
|
||||||
val fragmentScrollY = MutableLiveData<Int>()
|
val fragmentScrollY = MutableLiveData<Int>()
|
||||||
@ -169,19 +168,4 @@ class MainViewModel(context: Application) : AndroidViewModel(context) {
|
|||||||
|
|
||||||
addSource(Preferences.asLiveData(Preferences::installedIntegrations)) { value = true }
|
addSource(Preferences.asLiveData(Preferences::installedIntegrations)) { value = true }
|
||||||
}
|
}
|
||||||
|
|
||||||
init {
|
|
||||||
with(context.getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager) {
|
|
||||||
if (hasPrimaryClip()) {
|
|
||||||
(0..primaryClip!!.itemCount).forEach {
|
|
||||||
try {
|
|
||||||
val color = primaryClip!!.getItemAt(it).text.toString()
|
|
||||||
if (color.isColor()) {
|
|
||||||
colorClipboard.add(color)
|
|
||||||
}
|
|
||||||
} catch (ex: Exception) {}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
BIN
app/src/main/res/drawable-night-hdpi/round_content_copy_24.png
Normal file
After Width: | Height: | Size: 285 B |
BIN
app/src/main/res/drawable-night-hdpi/round_content_paste_24.png
Normal file
After Width: | Height: | Size: 351 B |
Before Width: | Height: | Size: 249 B After Width: | Height: | Size: 249 B |
BIN
app/src/main/res/drawable-night-mdpi/round_content_copy_24.png
Normal file
After Width: | Height: | Size: 221 B |
BIN
app/src/main/res/drawable-night-mdpi/round_content_paste_24.png
Normal file
After Width: | Height: | Size: 253 B |
BIN
app/src/main/res/drawable-night-xhdpi/round_content_copy_24.png
Normal file
After Width: | Height: | Size: 344 B |
BIN
app/src/main/res/drawable-night-xhdpi/round_content_paste_24.png
Normal file
After Width: | Height: | Size: 434 B |
BIN
app/src/main/res/drawable-night-xxhdpi/round_content_copy_24.png
Normal file
After Width: | Height: | Size: 459 B |
After Width: | Height: | Size: 602 B |
After Width: | Height: | Size: 574 B |
After Width: | Height: | Size: 765 B |
10
app/src/main/res/drawable/round_content_copy_24.xml
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24"
|
||||||
|
android:tint="?attr/colorControlNormal">
|
||||||
|
<path
|
||||||
|
android:fillColor="@android:color/white"
|
||||||
|
android:pathData="M15,1L4,1c-1.1,0 -2,0.9 -2,2v13c0,0.55 0.45,1 1,1s1,-0.45 1,-1L4,4c0,-0.55 0.45,-1 1,-1h10c0.55,0 1,-0.45 1,-1s-0.45,-1 -1,-1zM19,5L8,5c-1.1,0 -2,0.9 -2,2v14c0,1.1 0.9,2 2,2h11c1.1,0 2,-0.9 2,-2L21,7c0,-1.1 -0.9,-2 -2,-2zM18,21L9,21c-0.55,0 -1,-0.45 -1,-1L8,8c0,-0.55 0.45,-1 1,-1h9c0.55,0 1,0.45 1,1v12c0,0.55 -0.45,1 -1,1z"/>
|
||||||
|
</vector>
|
10
app/src/main/res/drawable/round_content_paste_24.xml
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24"
|
||||||
|
android:tint="?attr/colorControlNormal">
|
||||||
|
<path
|
||||||
|
android:fillColor="@android:color/white"
|
||||||
|
android:pathData="M19,2h-4.18C14.4,0.84 13.3,0 12,0S9.6,0.84 9.18,2L5,2c-1.1,0 -2,0.9 -2,2v16c0,1.1 0.9,2 2,2h14c1.1,0 2,-0.9 2,-2L21,4c0,-1.1 -0.9,-2 -2,-2zM12,2c0.55,0 1,0.45 1,1s-0.45,1 -1,1 -1,-0.45 -1,-1 0.45,-1 1,-1zM18,20L6,20c-0.55,0 -1,-0.45 -1,-1L5,5c0,-0.55 0.45,-1 1,-1h1v1c0,1.1 0.9,2 2,2h6c1.1,0 2,-0.9 2,-2L17,4h1c0.55,0 1,0.45 1,1v14c0,0.55 -0.45,1 -1,1z"/>
|
||||||
|
</vector>
|
@ -38,7 +38,7 @@
|
|||||||
android:id="@+id/message"
|
android:id="@+id/message"
|
||||||
android:gravity="start"
|
android:gravity="start"
|
||||||
android:textAlignment="viewStart"
|
android:textAlignment="viewStart"
|
||||||
android:text="Messaggio molto lungo di cui voirre akjcbasaskdask flasdas fashbdfjah fahsbd ajsbd "
|
android:text=""
|
||||||
android:textColor="@color/colorPrimaryText"/>
|
android:textColor="@color/colorPrimaryText"/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
@ -24,6 +24,7 @@
|
|||||||
android:paddingRight="32dp"
|
android:paddingRight="32dp"
|
||||||
android:id="@+id/header_text"
|
android:id="@+id/header_text"
|
||||||
android:text=""
|
android:text=""
|
||||||
|
android:textSize="20sp"
|
||||||
android:textColor="@color/colorPrimaryText"/>
|
android:textColor="@color/colorPrimaryText"/>
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
android:textAppearance="@style/AnotherWidget.Settings.Subtitle"
|
android:textAppearance="@style/AnotherWidget.Settings.Subtitle"
|
||||||
|
@ -16,23 +16,32 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:id="@+id/header"
|
android:id="@+id/header"
|
||||||
android:visibility="gone"
|
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
<LinearLayout
|
||||||
android:textAppearance="@style/AnotherWidget.Settings.Title"
|
|
||||||
app:textAllCaps="false"
|
|
||||||
android:letterSpacing="0"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:paddingTop="16dp"
|
android:orientation="horizontal"
|
||||||
android:paddingBottom="8dp"
|
android:paddingLeft="16dp"
|
||||||
android:paddingLeft="32dp"
|
android:paddingRight="16dp"
|
||||||
android:paddingRight="32dp"
|
android:gravity="center_vertical">
|
||||||
android:gravity="start"
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
android:textAlignment="viewStart"
|
android:textAppearance="@style/AnotherWidget.Settings.Title"
|
||||||
android:id="@+id/header_text"
|
app:textAllCaps="false"
|
||||||
android:text=""
|
android:letterSpacing="0"
|
||||||
android:textColor="@color/colorPrimaryText"/>
|
android:layout_width="0dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingTop="16dp"
|
||||||
|
android:paddingBottom="8dp"
|
||||||
|
android:paddingLeft="16dp"
|
||||||
|
android:paddingRight="16dp"
|
||||||
|
android:gravity="start"
|
||||||
|
android:textSize="20sp"
|
||||||
|
android:textAlignment="viewStart"
|
||||||
|
android:id="@+id/header_text"
|
||||||
|
android:text="@string/settings_font_color_title"
|
||||||
|
android:textColor="@color/colorPrimaryText"/>
|
||||||
|
</LinearLayout>
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="1dp"
|
android:layout_height="1dp"
|
||||||
|
@ -31,7 +31,6 @@
|
|||||||
android:src="@drawable/round_arrow_back_24"
|
android:src="@drawable/round_arrow_back_24"
|
||||||
android:clickable="true"
|
android:clickable="true"
|
||||||
android:focusable="true"
|
android:focusable="true"
|
||||||
android:transitionName="action_back"
|
|
||||||
android:background="?attr/selectableItemBackgroundBorderless"
|
android:background="?attr/selectableItemBackgroundBorderless"
|
||||||
app:tint="@color/colorPrimaryText"
|
app:tint="@color/colorPrimaryText"
|
||||||
android:layout_centerVertical="true"
|
android:layout_centerVertical="true"
|
||||||
@ -65,6 +64,7 @@
|
|||||||
android:background="?attr/selectableItemBackgroundBorderless"
|
android:background="?attr/selectableItemBackgroundBorderless"
|
||||||
android:clickable="true"
|
android:clickable="true"
|
||||||
android:focusable="true"
|
android:focusable="true"
|
||||||
|
android:transitionName="action_back"
|
||||||
android:padding="8dp"
|
android:padding="8dp"
|
||||||
android:scaleX="-1"
|
android:scaleX="-1"
|
||||||
android:src="@drawable/round_short_text_24"
|
android:src="@drawable/round_short_text_24"
|
||||||
|
@ -40,6 +40,16 @@
|
|||||||
<string name="font_700" translatable="false">Bold</string>
|
<string name="font_700" translatable="false">Bold</string>
|
||||||
<string name="font_800" translatable="false">Black</string>
|
<string name="font_800" translatable="false">Black</string>
|
||||||
<string name="font_900" translatable="false">Heavy</string>
|
<string name="font_900" translatable="false">Heavy</string>
|
||||||
|
<string name="font_italic" translatable="false">Italic</string>
|
||||||
|
<string name="font_100_italic" translatable="false">Thin Italic</string>
|
||||||
|
<string name="font_200_italic" translatable="false">Light Italic</string>
|
||||||
|
<string name="font_300_italic" translatable="false">Book Italic</string>
|
||||||
|
<string name="font_400_italic" translatable="false">Regular Italic</string>
|
||||||
|
<string name="font_500_italic" translatable="false">Medium Italic</string>
|
||||||
|
<string name="font_600_italic" translatable="false">Semi-bold Italic</string>
|
||||||
|
<string name="font_700_italic" translatable="false">Bold Italic</string>
|
||||||
|
<string name="font_800_italic" translatable="false">Black Italic</string>
|
||||||
|
<string name="font_900_italic" translatable="false">Heavy Italic</string>
|
||||||
|
|
||||||
<!-- Calendar -->
|
<!-- Calendar -->
|
||||||
<string name="settings_calendar_title">Calendar</string>
|
<string name="settings_calendar_title">Calendar</string>
|
||||||
@ -93,6 +103,11 @@
|
|||||||
<string name="attendee_status_invited">Events invitations</string>
|
<string name="attendee_status_invited">Events invitations</string>
|
||||||
<string name="attendee_status_declined">Declined events</string>
|
<string name="attendee_status_declined">Declined events</string>
|
||||||
|
|
||||||
|
<string name="calendar_sync_notification_channel_id" translatable="false">calendar-sync</string>
|
||||||
|
<string name="calendar_sync_notification_channel_name">Events sync service</string>
|
||||||
|
<string name="calendar_sync_notification_channel_description">Service used to synchronize the calendar events.</string>
|
||||||
|
<string name="calendar_sync_notification_title">Syncing calendar events…</string>
|
||||||
|
|
||||||
<!-- Weather -->
|
<!-- Weather -->
|
||||||
<string name="settings_weather_title">Weather</string>
|
<string name="settings_weather_title">Weather</string>
|
||||||
<string name="title_permission_location">Show the weather</string>
|
<string name="title_permission_location">Show the weather</string>
|
||||||
@ -162,7 +177,7 @@
|
|||||||
<string name="weather_provider_activity_subtitle">Select a weather provider from the list.\nA few providers need a free personal account,\nbut they are usually more accurate.</string>
|
<string name="weather_provider_activity_subtitle">Select a weather provider from the list.\nA few providers need a free personal account,\nbut they are usually more accurate.</string>
|
||||||
|
|
||||||
<string name="location_access_notification_channel_id" translatable="false">location-access</string>
|
<string name="location_access_notification_channel_id" translatable="false">location-access</string>
|
||||||
<string name="location_access_notification_channel_name">Background service</string>
|
<string name="location_access_notification_channel_name">Weather update service</string>
|
||||||
<string name="location_access_notification_channel_description">Service used to update the weather based on the current location of the user.</string>
|
<string name="location_access_notification_channel_description">Service used to update the weather based on the current location of the user.</string>
|
||||||
<string name="location_access_notification_title">Updating the weather…</string>
|
<string name="location_access_notification_title">Updating the weather…</string>
|
||||||
<string name="location_access_notification_subtitle">We\'re updating the weather based on your current location.</string>
|
<string name="location_access_notification_subtitle">We\'re updating the weather based on your current location.</string>
|
||||||
|