Add new dark icons
5
.gitignore
vendored
@ -8,4 +8,7 @@
|
||||
.externalNativeBuild
|
||||
/tasksintegration/build
|
||||
/app/google-services.json
|
||||
apikey.properties
|
||||
apikey.properties
|
||||
./.idea/*
|
||||
app/release/*
|
||||
/app/release/*
|
BIN
.idea/caches/build_file_checksums.ser
generated
@ -23,8 +23,8 @@ android {
|
||||
applicationId "com.tommasoberlose.anotherwidget"
|
||||
minSdkVersion 23
|
||||
targetSdkVersion 30
|
||||
versionCode 114
|
||||
versionName "2.1.0"
|
||||
versionCode 115
|
||||
versionName "2.1.1"
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
buildConfigField("String", "GOOGLE_API_KEY", apikeyProperties['GOOGLE_API_KEY'])
|
||||
|
@ -13,7 +13,6 @@
|
||||
<uses-permission android:name="android.gms.permission.ACTIVITY_RECOGNITION"/>
|
||||
<uses-permission android:name="com.google.android.gms.permission.ACTIVITY_RECOGNITION" />
|
||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
|
||||
<uses-permission android:name="android.permission.QUERY_ALL_PACKAGES"/>
|
||||
|
||||
<application
|
||||
android:allowBackup="true"
|
||||
|
@ -137,7 +137,7 @@ class GlanceSettingsDialog(val context: Activity, val provider: Constants.Glance
|
||||
}
|
||||
|
||||
/* TOGGLE */
|
||||
view.provider_switch.isChecked = when (provider) {
|
||||
view.provider_switch.setCheckedImmediatelyNoEvent(when (provider) {
|
||||
Constants.GlanceProviderId.PLAYING_SONG -> Preferences.showMusic
|
||||
Constants.GlanceProviderId.NEXT_CLOCK_ALARM -> Preferences.showNextAlarm
|
||||
Constants.GlanceProviderId.BATTERY_LEVEL_LOW -> Preferences.showBatteryCharging
|
||||
@ -146,7 +146,7 @@ class GlanceSettingsDialog(val context: Activity, val provider: Constants.Glance
|
||||
Constants.GlanceProviderId.NOTIFICATIONS -> Preferences.showNotifications
|
||||
Constants.GlanceProviderId.GREETINGS -> Preferences.showGreetings
|
||||
Constants.GlanceProviderId.EVENTS -> Preferences.showEventsAsGlanceProvider
|
||||
}
|
||||
})
|
||||
|
||||
var job: Job? = null
|
||||
|
||||
|
@ -68,12 +68,8 @@ class CustomLocationActivity : AppCompatActivity() {
|
||||
.register<String>(R.layout.custom_location_item) { _, injector ->
|
||||
injector
|
||||
.text(R.id.text, getString(R.string.custom_location_gps))
|
||||
.clicked(R.id.item) {
|
||||
MaterialBottomSheetDialog(this, message = getString(R.string.background_location_warning))
|
||||
.setPositiveButton(getString(android.R.string.ok)) {
|
||||
requirePermission()
|
||||
}
|
||||
.show()
|
||||
.clicked(R.id.text) {
|
||||
requirePermission()
|
||||
}
|
||||
}
|
||||
.register<Address>(R.layout.custom_location_item) { item, injector ->
|
||||
|
@ -51,6 +51,7 @@ import com.tommasoberlose.anotherwidget.utils.checkGrantedPermission
|
||||
import com.tommasoberlose.anotherwidget.utils.getCurrentWallpaper
|
||||
import com.tommasoberlose.anotherwidget.utils.toPixel
|
||||
import kotlinx.android.synthetic.main.activity_main.*
|
||||
import kotlinx.android.synthetic.main.fragment_tab_selector.*
|
||||
import kotlinx.android.synthetic.main.the_widget_sans.*
|
||||
import kotlinx.coroutines.*
|
||||
import org.greenrobot.eventbus.EventBus
|
||||
@ -96,6 +97,8 @@ class MainActivity : AppCompatActivity() {
|
||||
setResult(Activity.RESULT_OK)
|
||||
finish()
|
||||
}
|
||||
} else {
|
||||
viewModel.fragmentScrollY.value = 0
|
||||
}
|
||||
} else {
|
||||
super.onBackPressed()
|
||||
|
@ -320,7 +320,7 @@ class GlanceTabFragment : Fragment() {
|
||||
) {
|
||||
val view = viewHolder.itemView as MaterialCardView
|
||||
if (isCurrentlyActive) {
|
||||
ViewCompat.setElevation(view, 2f.convertDpToPixel(requireContext()))
|
||||
ViewCompat.setElevation(view, 8f.convertDpToPixel(requireContext()))
|
||||
view.setCardBackgroundColor(ContextCompat.getColor(requireContext(),
|
||||
R.color.colorPrimary))
|
||||
view.strokeWidth = 0
|
||||
|
@ -111,10 +111,6 @@ class MainFragment : Fragment(), SharedPreferences.OnSharedPreferenceChangeList
|
||||
// action_back?.isVisible = destination.id != R.id.tabSelectorFragment
|
||||
// Log.d("ciao", "${controller.currentDestination?.displayName} ${destination.id} - ${R.id.tabSelectorFragment}")
|
||||
// }
|
||||
|
||||
viewModel.fragmentScrollY.observe(viewLifecycleOwner) {
|
||||
toolbar?.cardElevation = if (it > 0) 24f else 0f
|
||||
}
|
||||
}
|
||||
|
||||
private var uiJob: Job? = null
|
||||
@ -325,7 +321,7 @@ class MainFragment : Fragment(), SharedPreferences.OnSharedPreferenceChangeList
|
||||
})
|
||||
|
||||
action_settings.setOnClickListener {
|
||||
Navigation.findNavController(it).navigate(R.id.action_appMainFragment_to_appSettingsFragment, null, null, FragmentNavigatorExtras(fragment_title to "settings_title"))
|
||||
Navigation.findNavController(it).navigate(R.id.action_appMainFragment_to_appSettingsFragment)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4,6 +4,7 @@ import android.Manifest
|
||||
import android.content.Intent
|
||||
import android.os.Build
|
||||
import android.os.Bundle
|
||||
import android.util.Log
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
@ -37,6 +38,7 @@ import com.tommasoberlose.anotherwidget.ui.viewmodels.MainViewModel
|
||||
import com.tommasoberlose.anotherwidget.utils.checkGrantedPermission
|
||||
import com.tommasoberlose.anotherwidget.utils.openURI
|
||||
import kotlinx.android.synthetic.main.fragment_settings.*
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.delay
|
||||
import kotlinx.coroutines.launch
|
||||
|
||||
@ -82,16 +84,12 @@ class SettingsFragment : Fragment() {
|
||||
Navigation.findNavController(it).popBackStack()
|
||||
}
|
||||
|
||||
show_widget_preview_toggle.isChecked = Preferences.showPreview
|
||||
show_wallpaper_toggle.isChecked = Preferences.showWallpaper
|
||||
show_widget_preview_toggle.setCheckedImmediatelyNoEvent(Preferences.showPreview)
|
||||
show_wallpaper_toggle.setCheckedImmediatelyNoEvent(Preferences.showWallpaper)
|
||||
|
||||
setupListener()
|
||||
|
||||
app_version.text = "v%s (%s)".format(BuildConfig.VERSION_NAME, BuildConfig.VERSION_CODE)
|
||||
|
||||
scrollView.viewTreeObserver.addOnScrollChangedListener {
|
||||
toolbar?.cardElevation = if (scrollView.scrollY > 0) 24f else 0f
|
||||
}
|
||||
}
|
||||
|
||||
private fun subscribeUi(
|
||||
@ -202,12 +200,18 @@ class SettingsFragment : Fragment() {
|
||||
}
|
||||
|
||||
action_refresh_widget.setOnClickListener {
|
||||
viewLifecycleOwner.lifecycleScope.launch {
|
||||
WeatherHelper.updateWeather(requireContext())
|
||||
}
|
||||
CalendarHelper.updateEventList(requireContext())
|
||||
MediaPlayerHelper.updatePlayingMediaInfo(requireContext())
|
||||
ActiveNotificationsHelper.clearLastNotification(requireContext())
|
||||
action_refresh_icon
|
||||
.animate()
|
||||
.rotation((action_refresh_icon.rotation - action_refresh_icon.rotation % 360f) + 360f)
|
||||
.withEndAction {
|
||||
viewLifecycleOwner.lifecycleScope.launch(Dispatchers.IO) {
|
||||
WeatherHelper.updateWeather(requireContext())
|
||||
CalendarHelper.updateEventList(requireContext())
|
||||
MediaPlayerHelper.updatePlayingMediaInfo(requireContext())
|
||||
ActiveNotificationsHelper.clearLastNotification(requireContext())
|
||||
}
|
||||
}
|
||||
.start()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -106,7 +106,6 @@ class TabSelectorFragment : Fragment() {
|
||||
}
|
||||
}
|
||||
checkReadEventsPermission()
|
||||
updateCalendar()
|
||||
})
|
||||
|
||||
viewModel.showWeather.observe(viewLifecycleOwner, Observer {
|
||||
@ -225,28 +224,6 @@ class TabSelectorFragment : Fragment() {
|
||||
}
|
||||
}
|
||||
|
||||
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
|
||||
if (resultCode == Activity.RESULT_OK) {
|
||||
when (requestCode) {
|
||||
RequestCode.CALENDAR_APP_REQUEST_CODE.code -> {
|
||||
Preferences.bulk {
|
||||
calendarAppName = data?.getStringExtra(Constants.RESULT_APP_NAME) ?: getString(
|
||||
R.string.default_calendar_app)
|
||||
calendarAppPackage = data?.getStringExtra(Constants.RESULT_APP_PACKAGE) ?: ""
|
||||
}
|
||||
}
|
||||
RequestCode.EVENT_APP_REQUEST_CODE.code -> {
|
||||
Preferences.bulk {
|
||||
eventAppName = data?.getStringExtra(Constants.RESULT_APP_NAME) ?: getString(
|
||||
R.string.default_event_app)
|
||||
eventAppPackage = data?.getStringExtra(Constants.RESULT_APP_PACKAGE) ?: ""
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
super.onActivityResult(requestCode, resultCode, data)
|
||||
}
|
||||
|
||||
private fun maintainScrollPosition(callback: () -> Unit) {
|
||||
scrollView.isScrollable = false
|
||||
callback.invoke()
|
||||
|
@ -114,7 +114,6 @@ class WeatherTabFragment : Fragment() {
|
||||
|
||||
viewModel.customLocationAdd.observe(viewLifecycleOwner, Observer {
|
||||
maintainScrollPosition {
|
||||
background_location_warning.isVisible = it == ""
|
||||
label_custom_location?.text =
|
||||
if (it == "") getString(R.string.custom_location_gps) else it
|
||||
}
|
||||
@ -160,11 +159,9 @@ class WeatherTabFragment : Fragment() {
|
||||
private fun checkLocationPermission() {
|
||||
if (requireActivity().checkGrantedPermission(Manifest.permission.ACCESS_FINE_LOCATION)) {
|
||||
location_permission_alert?.isVisible = false
|
||||
background_location_warning.isVisible = Preferences.customLocationAdd == ""
|
||||
WeatherReceiver.setUpdates(requireContext())
|
||||
} else if (Preferences.showWeather && Preferences.customLocationAdd == "") {
|
||||
location_permission_alert?.isVisible = true
|
||||
background_location_warning.isVisible = true
|
||||
location_permission_alert?.setOnClickListener {
|
||||
MaterialBottomSheetDialog(requireContext(), message = getString(R.string.background_location_warning))
|
||||
.setPositiveButton(getString(android.R.string.ok)) {
|
||||
|
BIN
app/src/main/res/drawable-night-hdpi/ic_day_night.png
Normal file
After Width: | Height: | Size: 319 B |
BIN
app/src/main/res/drawable-night-hdpi/outline_info_24.png
Normal file
After Width: | Height: | Size: 294 B |
BIN
app/src/main/res/drawable-night-hdpi/round_access_alarm_24.png
Normal file
After Width: | Height: | Size: 556 B |
After Width: | Height: | Size: 271 B |
BIN
app/src/main/res/drawable-night-hdpi/round_arrow_back_24.png
Normal file
After Width: | Height: | Size: 193 B |
After Width: | Height: | Size: 404 B |
After Width: | Height: | Size: 250 B |
BIN
app/src/main/res/drawable-night-hdpi/round_brightness_5_24.png
Normal file
After Width: | Height: | Size: 289 B |
BIN
app/src/main/res/drawable-night-hdpi/round_clear_all_24.png
Normal file
After Width: | Height: | Size: 157 B |
BIN
app/src/main/res/drawable-night-hdpi/round_close.png
Normal file
After Width: | Height: | Size: 232 B |
BIN
app/src/main/res/drawable-night-hdpi/round_code_24.png
Normal file
After Width: | Height: | Size: 219 B |
BIN
app/src/main/res/drawable-night-hdpi/round_compare_24.png
Normal file
After Width: | Height: | Size: 295 B |
BIN
app/src/main/res/drawable-night-hdpi/round_date_range_24.png
Normal file
After Width: | Height: | Size: 227 B |
After Width: | Height: | Size: 472 B |
BIN
app/src/main/res/drawable-night-hdpi/round_drag.png
Normal file
After Width: | Height: | Size: 205 B |
BIN
app/src/main/res/drawable-night-hdpi/round_drag_handle_24.png
Normal file
After Width: | Height: | Size: 133 B |
BIN
app/src/main/res/drawable-night-hdpi/round_error.png
Normal file
After Width: | Height: | Size: 291 B |
BIN
app/src/main/res/drawable-night-hdpi/round_event_busy_24.png
Normal file
After Width: | Height: | Size: 310 B |
BIN
app/src/main/res/drawable-night-hdpi/round_event_note_24.png
Normal file
After Width: | Height: | Size: 223 B |
BIN
app/src/main/res/drawable-night-hdpi/round_filter_list_24.png
Normal file
After Width: | Height: | Size: 154 B |
BIN
app/src/main/res/drawable-night-hdpi/round_group_work_24.png
Normal file
After Width: | Height: | Size: 352 B |
BIN
app/src/main/res/drawable-night-hdpi/round_help_outline_24.png
Normal file
After Width: | Height: | Size: 523 B |
BIN
app/src/main/res/drawable-night-hdpi/round_history_edu_24.png
Normal file
After Width: | Height: | Size: 416 B |
BIN
app/src/main/res/drawable-night-hdpi/round_language_24.png
Normal file
After Width: | Height: | Size: 428 B |
BIN
app/src/main/res/drawable-night-hdpi/round_launch_24.png
Normal file
After Width: | Height: | Size: 283 B |
BIN
app/src/main/res/drawable-night-hdpi/round_low_priority_24.png
Normal file
After Width: | Height: | Size: 363 B |
BIN
app/src/main/res/drawable-night-hdpi/round_music_note_24.png
Normal file
After Width: | Height: | Size: 246 B |
BIN
app/src/main/res/drawable-night-hdpi/round_notifications_24.png
Normal file
After Width: | Height: | Size: 257 B |
BIN
app/src/main/res/drawable-night-hdpi/round_pageview.png
Normal file
After Width: | Height: | Size: 331 B |
BIN
app/src/main/res/drawable-night-hdpi/round_palette_24.png
Normal file
After Width: | Height: | Size: 403 B |
BIN
app/src/main/res/drawable-night-hdpi/round_place_24.png
Normal file
After Width: | Height: | Size: 356 B |
BIN
app/src/main/res/drawable-night-hdpi/round_privacy_tip_24.png
Normal file
After Width: | Height: | Size: 368 B |
BIN
app/src/main/res/drawable-night-hdpi/round_redo_24.png
Normal file
After Width: | Height: | Size: 309 B |
BIN
app/src/main/res/drawable-night-hdpi/round_refresh.png
Normal file
After Width: | Height: | Size: 410 B |
BIN
app/src/main/res/drawable-night-hdpi/round_schedule_24.png
Normal file
After Width: | Height: | Size: 464 B |
BIN
app/src/main/res/drawable-night-hdpi/round_settings_24.png
Normal file
After Width: | Height: | Size: 330 B |
BIN
app/src/main/res/drawable-night-hdpi/round_short_text_24.png
Normal file
After Width: | Height: | Size: 131 B |
BIN
app/src/main/res/drawable-night-hdpi/round_sticky_note_2_24.png
Normal file
After Width: | Height: | Size: 236 B |
BIN
app/src/main/res/drawable-night-hdpi/round_timelapse.png
Normal file
After Width: | Height: | Size: 443 B |
BIN
app/src/main/res/drawable-night-hdpi/round_today_24.png
Normal file
After Width: | Height: | Size: 239 B |
BIN
app/src/main/res/drawable-night-hdpi/round_translate_24.png
Normal file
After Width: | Height: | Size: 520 B |
BIN
app/src/main/res/drawable-night-hdpi/round_update.png
Normal file
After Width: | Height: | Size: 570 B |
BIN
app/src/main/res/drawable-night-hdpi/round_wallpaper.png
Normal file
After Width: | Height: | Size: 328 B |
BIN
app/src/main/res/drawable-night-hdpi/round_work_outline_24.png
Normal file
After Width: | Height: | Size: 231 B |
BIN
app/src/main/res/drawable-night-mdpi/ic_day_night.png
Normal file
After Width: | Height: | Size: 223 B |
BIN
app/src/main/res/drawable-night-mdpi/outline_info_24.png
Normal file
After Width: | Height: | Size: 206 B |
BIN
app/src/main/res/drawable-night-mdpi/round_access_alarm_24.png
Normal file
After Width: | Height: | Size: 357 B |
After Width: | Height: | Size: 186 B |
BIN
app/src/main/res/drawable-night-mdpi/round_arrow_back_24.png
Normal file
After Width: | Height: | Size: 160 B |
After Width: | Height: | Size: 266 B |
After Width: | Height: | Size: 182 B |
BIN
app/src/main/res/drawable-night-mdpi/round_brightness_5_24.png
Normal file
After Width: | Height: | Size: 220 B |
BIN
app/src/main/res/drawable-night-mdpi/round_clear_all_24.png
Normal file
After Width: | Height: | Size: 163 B |
BIN
app/src/main/res/drawable-night-mdpi/round_close.png
Normal file
After Width: | Height: | Size: 196 B |
BIN
app/src/main/res/drawable-night-mdpi/round_code_24.png
Normal file
After Width: | Height: | Size: 164 B |
BIN
app/src/main/res/drawable-night-mdpi/round_compare_24.png
Normal file
After Width: | Height: | Size: 204 B |
BIN
app/src/main/res/drawable-night-mdpi/round_date_range_24.png
Normal file
After Width: | Height: | Size: 144 B |
After Width: | Height: | Size: 339 B |
BIN
app/src/main/res/drawable-night-mdpi/round_drag.png
Normal file
After Width: | Height: | Size: 139 B |
BIN
app/src/main/res/drawable-night-mdpi/round_drag_handle_24.png
Normal file
After Width: | Height: | Size: 94 B |
BIN
app/src/main/res/drawable-night-mdpi/round_error.png
Normal file
After Width: | Height: | Size: 200 B |
BIN
app/src/main/res/drawable-night-mdpi/round_event_busy_24.png
Normal file
After Width: | Height: | Size: 192 B |
BIN
app/src/main/res/drawable-night-mdpi/round_event_note_24.png
Normal file
After Width: | Height: | Size: 145 B |
BIN
app/src/main/res/drawable-night-mdpi/round_filter_list_24.png
Normal file
After Width: | Height: | Size: 106 B |
BIN
app/src/main/res/drawable-night-mdpi/round_group_work_24.png
Normal file
After Width: | Height: | Size: 234 B |
BIN
app/src/main/res/drawable-night-mdpi/round_help_outline_24.png
Normal file
After Width: | Height: | Size: 336 B |
BIN
app/src/main/res/drawable-night-mdpi/round_history_edu_24.png
Normal file
After Width: | Height: | Size: 279 B |
BIN
app/src/main/res/drawable-night-mdpi/round_language_24.png
Normal file
After Width: | Height: | Size: 302 B |
BIN
app/src/main/res/drawable-night-mdpi/round_launch_24.png
Normal file
After Width: | Height: | Size: 191 B |
BIN
app/src/main/res/drawable-night-mdpi/round_low_priority_24.png
Normal file
After Width: | Height: | Size: 234 B |
BIN
app/src/main/res/drawable-night-mdpi/round_music_note_24.png
Normal file
After Width: | Height: | Size: 160 B |
BIN
app/src/main/res/drawable-night-mdpi/round_notifications_24.png
Normal file
After Width: | Height: | Size: 198 B |
BIN
app/src/main/res/drawable-night-mdpi/round_pageview.png
Normal file
After Width: | Height: | Size: 218 B |
BIN
app/src/main/res/drawable-night-mdpi/round_palette_24.png
Normal file
After Width: | Height: | Size: 244 B |
BIN
app/src/main/res/drawable-night-mdpi/round_place_24.png
Normal file
After Width: | Height: | Size: 257 B |
BIN
app/src/main/res/drawable-night-mdpi/round_privacy_tip_24.png
Normal file
After Width: | Height: | Size: 254 B |
BIN
app/src/main/res/drawable-night-mdpi/round_redo_24.png
Normal file
After Width: | Height: | Size: 215 B |
BIN
app/src/main/res/drawable-night-mdpi/round_refresh.png
Normal file
After Width: | Height: | Size: 277 B |
BIN
app/src/main/res/drawable-night-mdpi/round_schedule_24.png
Normal file
After Width: | Height: | Size: 325 B |
BIN
app/src/main/res/drawable-night-mdpi/round_settings_24.png
Normal file
After Width: | Height: | Size: 236 B |
BIN
app/src/main/res/drawable-night-mdpi/round_short_text_24.png
Normal file
After Width: | Height: | Size: 94 B |
BIN
app/src/main/res/drawable-night-mdpi/round_sticky_note_2_24.png
Normal file
After Width: | Height: | Size: 154 B |
BIN
app/src/main/res/drawable-night-mdpi/round_timelapse.png
Normal file
After Width: | Height: | Size: 299 B |
BIN
app/src/main/res/drawable-night-mdpi/round_today_24.png
Normal file
After Width: | Height: | Size: 150 B |
BIN
app/src/main/res/drawable-night-mdpi/round_translate_24.png
Normal file
After Width: | Height: | Size: 339 B |
BIN
app/src/main/res/drawable-night-mdpi/round_update.png
Normal file
After Width: | Height: | Size: 378 B |
BIN
app/src/main/res/drawable-night-mdpi/round_wallpaper.png
Normal file
After Width: | Height: | Size: 220 B |