Compare commits
6 Commits
v2.2.2-bet
...
v2.2.2-bet
Author | SHA1 | Date | |
---|---|---|---|
57eecd630d | |||
cce86a970c | |||
6ea40a51fe | |||
1721dff3cf | |||
c389d50b09 | |||
0ea55db4b1 |
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"
|
||||
minSdkVersion 23
|
||||
targetSdkVersion 30
|
||||
versionCode 125
|
||||
versionCode 128
|
||||
versionName "2.2.2"
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
|
@ -40,6 +40,7 @@ object IntentHelper {
|
||||
private fun getWidgetRefreshIntent(context: Context): Intent {
|
||||
return Intent(context, UpdatesReceiver::class.java).apply {
|
||||
action = Actions.ACTION_REFRESH
|
||||
flags = Intent.FLAG_ACTIVITY_NEW_TASK
|
||||
}
|
||||
}
|
||||
|
||||
@ -65,6 +66,7 @@ object IntentHelper {
|
||||
flags = Intent.FLAG_ACTIVITY_NEW_TASK
|
||||
data = Uri.parse("dynact://velour/weather/ProxyActivity")
|
||||
component = ComponentName("com.google.android.googlequicksearchbox", "com.google.android.apps.gsa.velour.DynamicActivityTrampoline")
|
||||
setClassName("com.google.android.googlequicksearchbox", "com.google.android.apps.gsa.velour.DynamicActivityTrampoline")
|
||||
}
|
||||
}
|
||||
DO_NOTHING_OPTION -> {
|
||||
|
@ -57,8 +57,6 @@ class UpdatesReceiver : BroadcastReceiver() {
|
||||
}
|
||||
|
||||
Actions.ACTION_REFRESH -> {
|
||||
ActiveNotificationsHelper.clearLastNotification(context)
|
||||
|
||||
GlobalScope.launch(Dispatchers.IO) {
|
||||
CalendarHelper.updateEventList(context)
|
||||
MediaPlayerHelper.updatePlayingMediaInfo(context)
|
||||
|
@ -6,6 +6,7 @@ import android.content.Intent
|
||||
import android.net.Uri
|
||||
import com.tommasoberlose.anotherwidget.R
|
||||
import com.tommasoberlose.anotherwidget.global.Actions
|
||||
import com.tommasoberlose.anotherwidget.global.Preferences
|
||||
import com.tommasoberlose.anotherwidget.helpers.IntentHelper
|
||||
import com.tommasoberlose.anotherwidget.utils.toast
|
||||
|
||||
@ -15,19 +16,20 @@ class WidgetClickListenerReceiver : BroadcastReceiver() {
|
||||
override fun onReceive(context: Context, intent: Intent) {
|
||||
if (intent.action == Actions.ACTION_OPEN_WEATHER_INTENT) {
|
||||
try {
|
||||
context.startActivity(IntentHelper.getWeatherIntent(context))
|
||||
if (Preferences.weatherAppPackage == IntentHelper.REFRESH_WIDGET_OPTION) {
|
||||
context.sendBroadcast(IntentHelper.getWeatherIntent(context))
|
||||
} else {
|
||||
context.startActivity(IntentHelper.getWeatherIntent(context))
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
val uri = Uri.parse("http://www.google.com/search?q=weather")
|
||||
val i = Intent(Intent.ACTION_VIEW, uri)
|
||||
i.flags = Intent.FLAG_ACTIVITY_NEW_TASK
|
||||
try {
|
||||
context.applicationContext.startActivity(IntentHelper.getWeatherIntent(context.applicationContext))
|
||||
} catch (e: Exception) {
|
||||
val uri = Uri.parse("http://www.google.com/#q=weather")
|
||||
val i = Intent(Intent.ACTION_VIEW, uri)
|
||||
i.flags = Intent.FLAG_ACTIVITY_NEW_TASK
|
||||
try {
|
||||
context.startActivity(i)
|
||||
} catch (ignored: Exception) {
|
||||
context.toast(context.getString(R.string.error_opening_app))
|
||||
}
|
||||
context.startActivity(i)
|
||||
} catch (ignored: Exception) {
|
||||
context.toast(context.getString(R.string.error_opening_app))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -34,6 +34,7 @@ class LocationService : Service() {
|
||||
}
|
||||
|
||||
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
|
||||
startForeground(LOCATION_ACCESS_NOTIFICATION_ID, getLocationAccessNotification())
|
||||
job?.cancel()
|
||||
job = GlobalScope.launch(Dispatchers.IO) {
|
||||
if (ActivityCompat.checkSelfPermission(
|
||||
@ -85,11 +86,7 @@ class LocationService : Service() {
|
||||
|
||||
@JvmStatic
|
||||
fun requestNewLocation(context: Context) {
|
||||
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
|
||||
context.startForegroundService(Intent(context, LocationService::class.java))
|
||||
} else {
|
||||
context.startService(Intent(context, LocationService::class.java))
|
||||
}
|
||||
ContextCompat.startForegroundService(context, Intent(context, LocationService::class.java))
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -35,12 +35,7 @@ class UpdateCalendarService : Service() {
|
||||
companion object {
|
||||
const val CALENDAR_SYNC_NOTIFICATION_ID = 28468
|
||||
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))
|
||||
}
|
||||
ContextCompat.startForegroundService(context, Intent(context, UpdateCalendarService::class.java))
|
||||
}
|
||||
}
|
||||
|
||||
@ -56,6 +51,7 @@ class UpdateCalendarService : Service() {
|
||||
}
|
||||
|
||||
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
|
||||
startForeground(CALENDAR_SYNC_NOTIFICATION_ID, getCalendarSyncNotification())
|
||||
job?.cancel()
|
||||
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.global.Constants
|
||||
import com.tommasoberlose.anotherwidget.helpers.IntentHelper
|
||||
import com.tommasoberlose.anotherwidget.helpers.MediaPlayerHelper
|
||||
import com.tommasoberlose.anotherwidget.ui.viewmodels.tabs.ChooseApplicationViewModel
|
||||
import kotlinx.coroutines.*
|
||||
import net.idik.lib.slimadapter.SlimAdapter
|
||||
@ -171,6 +172,18 @@ class ChooseApplicationActivity : AppCompatActivity() {
|
||||
list.filter {
|
||||
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) {
|
||||
adapter.updateData(listOf(IntentHelper.DO_NOTHING_OPTION, IntentHelper.DEFAULT_OPTION, IntentHelper.REFRESH_WIDGET_OPTION) + filteredList)
|
||||
|
@ -97,7 +97,11 @@ class MainFragment : Fragment() {
|
||||
binding.actionBack.setOnClickListener {
|
||||
controller.navigateUp()
|
||||
}
|
||||
binding.actionBack.isClickable = show
|
||||
binding.actionBack.isFocusable = show
|
||||
binding.actionSettings.animate().alpha(if (!show) 1f else 0f).setDuration(200).translationX((if (!show) 0f else -4f).convertDpToPixel(requireContext())).start()
|
||||
binding.actionSettings.isClickable = !show
|
||||
binding.actionSettings.isFocusable = !show
|
||||
binding.fragmentTitle.text = if (show) destination.label.toString() else getString(R.string.app_name)
|
||||
}
|
||||
|
||||
|
@ -24,7 +24,7 @@
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Spacing"
|
||||
android:text="@string/spacing_settings_header"
|
||||
android:paddingTop="16dp"
|
||||
android:paddingLeft="20dp"
|
||||
android:paddingRight="20dp"
|
||||
|
@ -196,7 +196,7 @@
|
||||
<string name="settings_clock_bottom_margin_subtitle_small">Small</string>
|
||||
<string name="settings_clock_bottom_margin_subtitle_medium">Medium</string>
|
||||
<string name="settings_clock_bottom_margin_subtitle_large">Large</string>
|
||||
<string name="clock_warning">Due to technological limitations, the clock won\'t have the custom font and the text shadows selected in the Display section.</string>
|
||||
<string name="clock_warning">Due to technological limitations, the clock won\'t have the custom font and the text shadows selected in the typography section.</string>
|
||||
<string name="settings_clock_text_color_title">Text color</string>
|
||||
<string name="settings_ampm_indicator_title">Show AM/PM indicator</string>
|
||||
<string name="clock_text_header">Clock text style</string>
|
||||
@ -357,4 +357,5 @@
|
||||
<string name="clock_settings_subtitle">Set size, color and time zones</string>
|
||||
<string name="layout_settings_subtitle">Widget spacing and tweaks</string>
|
||||
<string name="smart_content_header">Smart content</string>
|
||||
<string name="spacing_settings_header">Spacing</string>
|
||||
</resources>
|
||||
|
Reference in New Issue
Block a user