Compare commits
2 Commits
v2.2.2-bet
...
v2.2.2-bet
Author | SHA1 | Date | |
---|---|---|---|
57eecd630d | |||
cce86a970c |
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 30
|
targetSdkVersion 30
|
||||||
versionCode 127
|
versionCode 128
|
||||||
versionName "2.2.2"
|
versionName "2.2.2"
|
||||||
|
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
|
@ -57,8 +57,6 @@ class UpdatesReceiver : BroadcastReceiver() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Actions.ACTION_REFRESH -> {
|
Actions.ACTION_REFRESH -> {
|
||||||
ActiveNotificationsHelper.clearLastNotification(context)
|
|
||||||
|
|
||||||
GlobalScope.launch(Dispatchers.IO) {
|
GlobalScope.launch(Dispatchers.IO) {
|
||||||
CalendarHelper.updateEventList(context)
|
CalendarHelper.updateEventList(context)
|
||||||
MediaPlayerHelper.updatePlayingMediaInfo(context)
|
MediaPlayerHelper.updatePlayingMediaInfo(context)
|
||||||
|
@ -34,6 +34,7 @@ class LocationService : Service() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
|
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
|
||||||
|
startForeground(LOCATION_ACCESS_NOTIFICATION_ID, getLocationAccessNotification())
|
||||||
job?.cancel()
|
job?.cancel()
|
||||||
job = GlobalScope.launch(Dispatchers.IO) {
|
job = GlobalScope.launch(Dispatchers.IO) {
|
||||||
if (ActivityCompat.checkSelfPermission(
|
if (ActivityCompat.checkSelfPermission(
|
||||||
@ -85,11 +86,7 @@ class LocationService : Service() {
|
|||||||
|
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
fun requestNewLocation(context: Context) {
|
fun requestNewLocation(context: Context) {
|
||||||
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
|
ContextCompat.startForegroundService(context, Intent(context, LocationService::class.java))
|
||||||
context.startForegroundService(Intent(context, LocationService::class.java))
|
|
||||||
} else {
|
|
||||||
context.startService(Intent(context, LocationService::class.java))
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -35,11 +35,7 @@ class UpdateCalendarService : Service() {
|
|||||||
companion object {
|
companion object {
|
||||||
const val CALENDAR_SYNC_NOTIFICATION_ID = 28468
|
const val CALENDAR_SYNC_NOTIFICATION_ID = 28468
|
||||||
fun enqueueWork(context: Context) {
|
fun enqueueWork(context: Context) {
|
||||||
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
|
ContextCompat.startForegroundService(context, Intent(context, UpdateCalendarService::class.java))
|
||||||
context.startForegroundService(Intent(context, UpdateCalendarService::class.java))
|
|
||||||
} else {
|
|
||||||
context.startService(Intent(context, UpdateCalendarService::class.java))
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -55,6 +51,7 @@ class UpdateCalendarService : Service() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
|
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
|
||||||
|
startForeground(CALENDAR_SYNC_NOTIFICATION_ID, getCalendarSyncNotification())
|
||||||
job?.cancel()
|
job?.cancel()
|
||||||
job = GlobalScope.launch(Dispatchers.IO) {
|
job = GlobalScope.launch(Dispatchers.IO) {
|
||||||
|
|
||||||
|
@ -19,6 +19,7 @@ import com.google.android.material.card.MaterialCardView
|
|||||||
import com.tommasoberlose.anotherwidget.databinding.ActivityChooseApplicationBinding
|
import com.tommasoberlose.anotherwidget.databinding.ActivityChooseApplicationBinding
|
||||||
import com.tommasoberlose.anotherwidget.global.Constants
|
import com.tommasoberlose.anotherwidget.global.Constants
|
||||||
import com.tommasoberlose.anotherwidget.helpers.IntentHelper
|
import com.tommasoberlose.anotherwidget.helpers.IntentHelper
|
||||||
|
import com.tommasoberlose.anotherwidget.helpers.MediaPlayerHelper
|
||||||
import com.tommasoberlose.anotherwidget.ui.viewmodels.tabs.ChooseApplicationViewModel
|
import com.tommasoberlose.anotherwidget.ui.viewmodels.tabs.ChooseApplicationViewModel
|
||||||
import kotlinx.coroutines.*
|
import kotlinx.coroutines.*
|
||||||
import net.idik.lib.slimadapter.SlimAdapter
|
import net.idik.lib.slimadapter.SlimAdapter
|
||||||
@ -171,6 +172,18 @@ class ChooseApplicationActivity : AppCompatActivity() {
|
|||||||
list.filter {
|
list.filter {
|
||||||
it.loadLabel(viewModel.pm).contains(search, true)
|
it.loadLabel(viewModel.pm).contains(search, true)
|
||||||
}
|
}
|
||||||
|
}.sortedWith { app1, app2 ->
|
||||||
|
when (selectedPackage) {
|
||||||
|
app1.activityInfo.packageName -> {
|
||||||
|
-1
|
||||||
|
}
|
||||||
|
app2.activityInfo.packageName -> {
|
||||||
|
1
|
||||||
|
}
|
||||||
|
else -> {
|
||||||
|
app1.loadLabel(viewModel.pm).toString().compareTo(app2.loadLabel(viewModel.pm).toString(), ignoreCase = true)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
withContext(Dispatchers.Main) {
|
withContext(Dispatchers.Main) {
|
||||||
adapter.updateData(listOf(IntentHelper.DO_NOTHING_OPTION, IntentHelper.DEFAULT_OPTION, IntentHelper.REFRESH_WIDGET_OPTION) + filteredList)
|
adapter.updateData(listOf(IntentHelper.DO_NOTHING_OPTION, IntentHelper.DEFAULT_OPTION, IntentHelper.REFRESH_WIDGET_OPTION) + filteredList)
|
||||||
|
Reference in New Issue
Block a user