diff --git a/app/release/app-release.aab b/app/release/app-release.aab deleted file mode 100644 index 69c35d8..0000000 Binary files a/app/release/app-release.aab and /dev/null differ diff --git a/app/src/main/java/com/tommasoberlose/anotherwidget/components/MaterialBottomSheetDialog.kt b/app/src/main/java/com/tommasoberlose/anotherwidget/components/MaterialBottomSheetDialog.kt index 2170d08..945b6a7 100644 --- a/app/src/main/java/com/tommasoberlose/anotherwidget/components/MaterialBottomSheetDialog.kt +++ b/app/src/main/java/com/tommasoberlose/anotherwidget/components/MaterialBottomSheetDialog.kt @@ -11,8 +11,8 @@ typealias DialogCallback = () -> Unit class MaterialBottomSheetDialog( context: Context, - private val title: String? = "", - private val message: String? = "" + private val title: String? = null, + private val message: String? = null ) : BottomSheetDialog(context, R.style.BottomSheetDialogTheme) { private var positiveButtonLabel: String? = null @@ -36,7 +36,7 @@ class MaterialBottomSheetDialog( val view = View.inflate(context, R.layout.bottom_sheet_dialog, null) // Header - view.message.isVisible = title != null + view.title.isVisible = title != null view.title.text = title ?: "" view.message.isVisible = message != null diff --git a/app/src/main/java/com/tommasoberlose/anotherwidget/helpers/AlarmHelper.kt b/app/src/main/java/com/tommasoberlose/anotherwidget/helpers/AlarmHelper.kt index 484652a..e4ec0d5 100644 --- a/app/src/main/java/com/tommasoberlose/anotherwidget/helpers/AlarmHelper.kt +++ b/app/src/main/java/com/tommasoberlose/anotherwidget/helpers/AlarmHelper.kt @@ -12,8 +12,7 @@ object AlarmHelper { val alarm = nextAlarmClock return if ( alarm != null - && alarm.triggerTime - Calendar.getInstance().timeInMillis > 10 * 60 * 1000 - && alarm.triggerTime - Calendar.getInstance().timeInMillis < 12 * 60 * 60 * 1000 + && alarm.triggerTime - Calendar.getInstance().timeInMillis > 5 * 60 * 1000 ) { "%s %s".format( SimpleDateFormat("EEE", Locale.getDefault()).format(alarm.triggerTime), diff --git a/app/src/main/java/com/tommasoberlose/anotherwidget/ui/fragments/GlanceTabFragment.kt b/app/src/main/java/com/tommasoberlose/anotherwidget/ui/fragments/GlanceTabFragment.kt index c9edcd1..c8902e1 100644 --- a/app/src/main/java/com/tommasoberlose/anotherwidget/ui/fragments/GlanceTabFragment.kt +++ b/app/src/main/java/com/tommasoberlose/anotherwidget/ui/fragments/GlanceTabFragment.kt @@ -8,8 +8,10 @@ import android.content.Context import android.content.Intent import android.content.IntentFilter import android.content.pm.PackageManager +import android.net.Uri import android.os.Build import android.os.Bundle +import android.provider.Settings import android.util.Log import android.view.LayoutInflater import android.view.View @@ -34,6 +36,7 @@ import com.tommasoberlose.anotherwidget.R import com.tommasoberlose.anotherwidget.components.BottomSheetMenu import com.tommasoberlose.anotherwidget.components.CustomNotesDialog import com.tommasoberlose.anotherwidget.components.GlanceProviderSortMenu +import com.tommasoberlose.anotherwidget.components.MaterialBottomSheetDialog import com.tommasoberlose.anotherwidget.databinding.FragmentGlanceSettingsBinding import com.tommasoberlose.anotherwidget.global.Preferences import com.tommasoberlose.anotherwidget.helpers.AlarmHelper @@ -188,7 +191,9 @@ class GlanceTabFragment : Fragment() { } catch (e: Exception) { alarm.showIntent?.creatorPackage ?: "" } - activity?.toast(getString(R.string.next_alarm_warning).format(appNameOrPackage), long = true) + MaterialBottomSheetDialog(requireContext(), message = getString(R.string.next_alarm_warning).format(appNameOrPackage)) + .setPositiveButton(getString(android.R.string.ok)) + .show() } } true @@ -274,19 +279,23 @@ class GlanceTabFragment : Fragment() { } private fun checkNotificationPermission() { - if (NotificationManagerCompat.getEnabledListenerPackages(requireContext()).contains(requireContext().packageName)) { - notification_permission_alert?.isVisible = false - MediaPlayerHelper.updatePlayingMediaInfo(requireContext()) - show_music_label?.text = if (Preferences.showMusic) getString(R.string.settings_visible) else getString(R.string.settings_not_visible) - } else if (Preferences.showMusic) { - notification_permission_alert?.isVisible = true - show_music_label?.text = getString(R.string.settings_request_notification_access) - notification_permission_alert?.setOnClickListener { - activity?.startActivity(Intent("android.settings.ACTION_NOTIFICATION_LISTENER_SETTINGS")) + when { + NotificationManagerCompat.getEnabledListenerPackages(requireContext()).contains(requireContext().packageName) -> { + notification_permission_alert?.isVisible = false + MediaPlayerHelper.updatePlayingMediaInfo(requireContext()) + show_music_label?.text = if (Preferences.showMusic) getString(R.string.settings_visible) else getString(R.string.settings_not_visible) + } + Preferences.showMusic -> { + notification_permission_alert?.isVisible = true + show_music_label?.text = getString(R.string.settings_request_notification_access) + notification_permission_alert?.setOnClickListener { + activity?.startActivity(Intent("android.settings.ACTION_NOTIFICATION_LISTENER_SETTINGS")) + } + } + else -> { + show_music_label?.text = getString(R.string.settings_not_visible) + notification_permission_alert?.isVisible = false } - } else { - show_music_label?.text = getString(R.string.settings_not_visible) - notification_permission_alert?.isVisible = false } } diff --git a/app/src/main/res/drawable-hdpi/round_style_black_18.png b/app/src/main/res/drawable-hdpi/round_style_black_18.png new file mode 100644 index 0000000..ba2d3f8 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/round_style_black_18.png differ diff --git a/app/src/main/res/drawable-hdpi/round_style_black_24.png b/app/src/main/res/drawable-hdpi/round_style_black_24.png new file mode 100644 index 0000000..61c6eec Binary files /dev/null and b/app/src/main/res/drawable-hdpi/round_style_black_24.png differ diff --git a/app/src/main/res/drawable-hdpi/round_style_black_36.png b/app/src/main/res/drawable-hdpi/round_style_black_36.png new file mode 100644 index 0000000..c93b26f Binary files /dev/null and b/app/src/main/res/drawable-hdpi/round_style_black_36.png differ diff --git a/app/src/main/res/drawable-hdpi/round_style_black_48.png b/app/src/main/res/drawable-hdpi/round_style_black_48.png new file mode 100644 index 0000000..ac26562 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/round_style_black_48.png differ diff --git a/app/src/main/res/drawable-mdpi/round_style_black_18.png b/app/src/main/res/drawable-mdpi/round_style_black_18.png new file mode 100644 index 0000000..14375fd Binary files /dev/null and b/app/src/main/res/drawable-mdpi/round_style_black_18.png differ diff --git a/app/src/main/res/drawable-mdpi/round_style_black_24.png b/app/src/main/res/drawable-mdpi/round_style_black_24.png new file mode 100644 index 0000000..0d68a22 Binary files /dev/null and b/app/src/main/res/drawable-mdpi/round_style_black_24.png differ diff --git a/app/src/main/res/drawable-mdpi/round_style_black_36.png b/app/src/main/res/drawable-mdpi/round_style_black_36.png new file mode 100644 index 0000000..61c6eec Binary files /dev/null and b/app/src/main/res/drawable-mdpi/round_style_black_36.png differ diff --git a/app/src/main/res/drawable-mdpi/round_style_black_48.png b/app/src/main/res/drawable-mdpi/round_style_black_48.png new file mode 100644 index 0000000..2232cbb Binary files /dev/null and b/app/src/main/res/drawable-mdpi/round_style_black_48.png differ diff --git a/app/src/main/res/drawable-xhdpi/round_style_black_18.png b/app/src/main/res/drawable-xhdpi/round_style_black_18.png new file mode 100644 index 0000000..61c6eec Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/round_style_black_18.png differ diff --git a/app/src/main/res/drawable-xhdpi/round_style_black_24.png b/app/src/main/res/drawable-xhdpi/round_style_black_24.png new file mode 100644 index 0000000..2232cbb Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/round_style_black_24.png differ diff --git a/app/src/main/res/drawable-xhdpi/round_style_black_36.png b/app/src/main/res/drawable-xhdpi/round_style_black_36.png new file mode 100644 index 0000000..ac26562 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/round_style_black_36.png differ diff --git a/app/src/main/res/drawable-xhdpi/round_style_black_48.png b/app/src/main/res/drawable-xhdpi/round_style_black_48.png new file mode 100644 index 0000000..64520ef Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/round_style_black_48.png differ diff --git a/app/src/main/res/drawable-xxhdpi/round_style_black_18.png b/app/src/main/res/drawable-xxhdpi/round_style_black_18.png new file mode 100644 index 0000000..c93b26f Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/round_style_black_18.png differ diff --git a/app/src/main/res/drawable-xxhdpi/round_style_black_24.png b/app/src/main/res/drawable-xxhdpi/round_style_black_24.png new file mode 100644 index 0000000..ac26562 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/round_style_black_24.png differ diff --git a/app/src/main/res/drawable-xxhdpi/round_style_black_36.png b/app/src/main/res/drawable-xxhdpi/round_style_black_36.png new file mode 100644 index 0000000..f6a9ca3 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/round_style_black_36.png differ diff --git a/app/src/main/res/drawable-xxhdpi/round_style_black_48.png b/app/src/main/res/drawable-xxhdpi/round_style_black_48.png new file mode 100644 index 0000000..993dc85 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/round_style_black_48.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/round_style_black_18.png b/app/src/main/res/drawable-xxxhdpi/round_style_black_18.png new file mode 100644 index 0000000..ac26562 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/round_style_black_18.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/round_style_black_24.png b/app/src/main/res/drawable-xxxhdpi/round_style_black_24.png new file mode 100644 index 0000000..64520ef Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/round_style_black_24.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/round_style_black_36.png b/app/src/main/res/drawable-xxxhdpi/round_style_black_36.png new file mode 100644 index 0000000..993dc85 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/round_style_black_36.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/round_style_black_48.png b/app/src/main/res/drawable-xxxhdpi/round_style_black_48.png new file mode 100644 index 0000000..f446f86 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/round_style_black_48.png differ diff --git a/app/src/main/res/drawable/round_style.xml b/app/src/main/res/drawable/round_style.xml new file mode 100644 index 0000000..8420955 --- /dev/null +++ b/app/src/main/res/drawable/round_style.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/layout/bottom_sheet_dialog.xml b/app/src/main/res/layout/bottom_sheet_dialog.xml index d04ae80..0c2d505 100644 --- a/app/src/main/res/layout/bottom_sheet_dialog.xml +++ b/app/src/main/res/layout/bottom_sheet_dialog.xml @@ -59,6 +59,8 @@ android:id="@+id/action_negative" android:letterSpacing="0" android:text="Dismiss" + android:fontFamily="@font/product_sans" + android:textStyle="bold" app:textAllCaps="false" /> \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_weather_settings.xml b/app/src/main/res/layout/fragment_weather_settings.xml index 30816b8..23ccac0 100644 --- a/app/src/main/res/layout/fragment_weather_settings.xml +++ b/app/src/main/res/layout/fragment_weather_settings.xml @@ -224,6 +224,18 @@ android:text="@string/action_grant_permission"/> + - Settings Style Actions - Setup + Provider Appearance Preferences