Add am/pm indicator, add tab badges, add widget background, add text color alpha

This commit is contained in:
Tommaso Berlose 2020-05-06 12:52:25 +02:00
parent f13cee24d5
commit e2503decd2
77 changed files with 582 additions and 205 deletions

Binary file not shown.

View File

@ -18,7 +18,7 @@ android {
applicationId "com.tommasoberlose.anotherwidget"
minSdkVersion 23
targetSdkVersion 29
versionCode 68
versionCode 69
versionName "2.0.5"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
@ -90,6 +90,7 @@ dependencies {
implementation 'androidx.multidex:multidex:2.0.1'
implementation 'joda-time:joda-time:2.9.9'
implementation 'me.everything:providers-android:1.0.1'
implementation 'com.github.warkiz.widget:indicatorseekbar:2.1.2'
//Glide
implementation 'com.github.bumptech.glide:glide:4.11.0'

Binary file not shown.

View File

@ -8,6 +8,7 @@ import android.text.TextWatcher
import android.util.Log
import android.view.View
import android.widget.GridLayout
import android.widget.SeekBar
import androidx.annotation.ColorInt
import androidx.core.content.ContextCompat
import androidx.core.view.isVisible
@ -19,6 +20,9 @@ import com.tommasoberlose.anotherwidget.helpers.ColorHelper
import com.tommasoberlose.anotherwidget.helpers.ColorHelper.isColorDark
import com.tommasoberlose.anotherwidget.utils.expand
import com.tommasoberlose.anotherwidget.utils.reveal
import com.warkiz.widget.IndicatorSeekBar
import com.warkiz.widget.OnSeekChangeListener
import com.warkiz.widget.SeekParams
import kotlinx.android.synthetic.main.bottom_sheet_menu_hor.*
import kotlinx.android.synthetic.main.bottom_sheet_menu_hor.view.*
import kotlinx.android.synthetic.main.bottom_sheet_menu_hor.view.color_loader
@ -32,7 +36,10 @@ class BottomSheetColorPicker(
private val colors: IntArray = intArrayOf(),
private val selected: Int? = null,
private val header: String? = null,
private val onColorSelected: ((selectedValue: Int) -> Unit)? = null
private val onColorSelected: ((selectedValue: Int) -> Unit)? = null,
private val showAlphaSelector: Boolean = false,
private val alpha: Int = 0,
private val onAlphaChangeListener: ((alpha: Int) -> Unit)? = null
) : BottomSheetDialog(context, R.style.BottomSheetDialogTheme) {
private val loadingJob: Job? = null
@ -44,6 +51,22 @@ class BottomSheetColorPicker(
view.header.isVisible = header != null
view.header_text.text = header ?: ""
view.alpha_selector_container.isVisible = showAlphaSelector
view.alpha_selector.setProgress(alpha.toFloat())
view.text_alpha.text = "%s: %s%%".format(context.getString(R.string.alpha), alpha)
view.alpha_selector.onSeekChangeListener = object : OnSeekChangeListener {
override fun onSeeking(seekParams: SeekParams?) {
seekParams?.let {
view.text_alpha.text = "%s: %s%%".format(context.getString(R.string.alpha), it.progress)
onAlphaChangeListener?.invoke(it.progress)
}
}
override fun onStartTrackingTouch(seekBar: IndicatorSeekBar?) {
}
override fun onStopTrackingTouch(seekBar: IndicatorSeekBar?) {
}
}
val itemViews: ArrayList<View> = ArrayList()
GlobalScope.launch(Dispatchers.IO) {

View File

@ -40,6 +40,11 @@ object Preferences : KotprefModel() {
var eventAppPackage by stringPref(key = "PREF_EVENT_APP_PACKAGE", default = "")
var openEventDetails by booleanPref(default = true)
var textGlobalColor by stringPref(key = "PREF_TEXT_COLOR", default = "#FFFFFF")
var textGlobalAlpha by stringPref(default = "FF")
var backgroundCardColor by stringPref(default = "#000000")
var backgroundCardAlpha by stringPref(default = "00")
var textMainSize by floatPref(key = "PREF_TEXT_MAIN_SIZE", default = 26f)
var textSecondSize by floatPref(key = "PREF_TEXT_SECOND_SIZE", default = 18f)
var clockTextSize by floatPref(key = "PREF_TEXT_CLOCK_SIZE", default = 90f)

View File

@ -3,6 +3,7 @@ package com.tommasoberlose.anotherwidget.helpers
import android.app.AlarmManager
import android.content.Context
import android.text.format.DateFormat
import android.util.Log
import java.text.SimpleDateFormat
import java.util.*

View File

@ -2,14 +2,14 @@ package com.tommasoberlose.anotherwidget.helpers
import android.content.Context
import android.graphics.*
import android.graphics.drawable.BitmapDrawable
import android.graphics.drawable.Drawable
import android.util.Log
import android.view.View
import androidx.core.content.ContextCompat
import androidx.core.graphics.drawable.DrawableCompat
import androidx.core.view.drawToBitmap
import com.google.firebase.crashlytics.FirebaseCrashlytics
import java.lang.Exception
object BitmapHelper {
@ -26,9 +26,9 @@ object BitmapHelper {
val btm = Bitmap.createBitmap(
view.measuredWidth,
view.measuredHeight,
if (draw) Bitmap.Config.ARGB_8888 else Bitmap.Config.ALPHA_8
if (true || draw) Bitmap.Config.ARGB_8888 else Bitmap.Config.ALPHA_8
)
if (draw) {
if (true || draw) {
//Bind a canvas to it
val canvas = Canvas(btm)
// draw the view on the canvas
@ -76,4 +76,30 @@ object BitmapHelper {
return resultBitmap
}
fun drawableToBitmap(drawable: Drawable): Bitmap? {
var bitmap: Bitmap? = null
if (drawable is BitmapDrawable) {
if (drawable.bitmap != null) {
return drawable.bitmap
}
}
bitmap = if (drawable.intrinsicWidth <= 0 || drawable.intrinsicHeight <= 0) {
Bitmap.createBitmap(
1,
1,
Bitmap.Config.ARGB_8888
) // Single color bitmap will be created of 1x1 pixel
} else {
Bitmap.createBitmap(
drawable.intrinsicWidth,
drawable.intrinsicHeight,
Bitmap.Config.ARGB_8888
)
}
val canvas = Canvas(bitmap)
drawable.setBounds(0, 0, canvas.width, canvas.height)
drawable.draw(canvas)
return bitmap
}
}

View File

@ -1,14 +1,41 @@
package com.tommasoberlose.anotherwidget.helpers
import android.annotation.SuppressLint
import android.graphics.Color
import android.util.Log
import com.tommasoberlose.anotherwidget.global.Preferences
import kotlin.math.roundToInt
object ColorHelper {
fun getFontColor(): Int {
return try {
Color.parseColor(Preferences.textGlobalColor)
Color.parseColor("#%s%s".format(Preferences.textGlobalAlpha, Preferences.textGlobalColor.replace("#", "")))
} catch (e: Exception) {
Color.parseColor("#FFFFFF")
Color.parseColor("#FFFFFFFF")
}
}
fun getBackgroundColor(): Int {
return try {
Color.parseColor("#%s%s".format(Preferences.backgroundCardAlpha, Preferences.backgroundCardColor.replace("#", "")))
} catch (e: Exception) {
Color.parseColor("#00000000")
}
}
fun getBackgroundAlpha(): Int {
return try {
Preferences.backgroundCardAlpha.toIntValue().toDouble() * 255 / 100
} catch (e: Exception) {
"00".toIntValue().toDouble() * 255 / 100
}.roundToInt()
}
fun getBackgroundColorRgb(): Int {
return try {
Color.parseColor(Preferences.backgroundCardColor)
} catch (e: Exception) {
Color.parseColor("#000000")
}
}
@ -20,4 +47,16 @@ object ColorHelper {
1 - (0.299 * Color.red(this) + 0.587 * Color.green(this) + 0.114 * Color.blue(this)) / 255
return darkness >= threshold
}
@SuppressLint("DefaultLocale")
fun Int.toHexValue(): String {
val intValue = (this * 255 / 100).toDouble().roundToInt()
val hexValue = intValue.toString(16)
return hexValue.padStart(2, '0').toUpperCase()
}
fun String.toIntValue(): Int {
val hexValue = this.toInt(16).toDouble()
return (hexValue * 100 / 255).roundToInt()
}
}

View File

@ -43,7 +43,7 @@ object WeatherHelper {
fun removeWeather(context: Context) {
Preferences.remove(Preferences::weatherTemp)
Preferences.remove(Preferences::weatherTempUnit)
Preferences.remove(Preferences::weatherRealTempUnit)
MainWidget.updateWidget(context)
}

View File

@ -16,6 +16,7 @@ import java.util.concurrent.TimeUnit
class WeatherWorker(appContext: Context, workerParams: WorkerParameters) : Worker(appContext, workerParams) {
override fun doWork(): Result {
Log.d("ciao1", "weather ok")
WeatherHelper.updateWeather(applicationContext)
return Result.success()
}

View File

@ -1,24 +1,27 @@
package com.tommasoberlose.anotherwidget.ui.activities
import android.Manifest
import android.animation.ValueAnimator
import android.app.Activity
import android.appwidget.AppWidgetManager
import android.content.Intent
import android.content.SharedPreferences
import android.graphics.drawable.BitmapDrawable
import android.net.Uri
import android.os.Build
import android.os.Bundle
import android.provider.Settings
import android.util.TypedValue
import android.view.Gravity
import android.view.View
import android.widget.RelativeLayout
import androidx.appcompat.app.AppCompatActivity
import androidx.core.animation.addListener
import androidx.core.content.ContextCompat
import androidx.core.view.isVisible
import androidx.lifecycle.Observer
import androidx.lifecycle.ViewModelProvider
import androidx.lifecycle.lifecycleScope
import com.google.android.material.badge.BadgeDrawable
import com.google.android.material.tabs.TabLayoutMediator
import com.tommasoberlose.anotherwidget.R
import com.tommasoberlose.anotherwidget.components.MaterialBottomSheetDialog
@ -33,6 +36,7 @@ import com.tommasoberlose.anotherwidget.helpers.WeatherHelper
import com.tommasoberlose.anotherwidget.ui.adapters.ViewPagerAdapter
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.getCurrentWallpaper
import com.tommasoberlose.anotherwidget.utils.toPixel
import kotlinx.android.synthetic.main.activity_main.*
@ -73,7 +77,9 @@ class MainActivity : AppCompatActivity(), SharedPreferences.OnSharedPreferenceCh
// Init clock
time.setTextColor(ColorHelper.getFontColor())
time.setTextSize(TypedValue.COMPLEX_UNIT_SP, Preferences.clockTextSize.toPixel(this@MainActivity))
time.isVisible = Preferences.showClock
time_am_pm.setTextColor(ColorHelper.getFontColor())
time_am_pm.setTextSize(TypedValue.COMPLEX_UNIT_SP, Preferences.clockTextSize.toPixel(this@MainActivity) / 5 * 2)
time_container.isVisible = Preferences.showClock
preview.layoutParams = preview.layoutParams.apply {
height = 160.toPixel(this@MainActivity) + if (Preferences.showClock) 100.toPixel(this@MainActivity) else 0
@ -85,6 +91,8 @@ class MainActivity : AppCompatActivity(), SharedPreferences.OnSharedPreferenceCh
WeatherHelper.updateWeather(this)
// Warnings
if (getString(R.string.xiaomi_manufacturer).equals(Build.MANUFACTURER, ignoreCase = true) && Preferences.showXiaomiWarning) {
MaterialBottomSheetDialog(this, getString(R.string.xiaomi_warning_title), getString(R.string.xiaomi_warning_message))
.setNegativeButton(getString(R.string.action_ignore)) {
@ -114,6 +122,7 @@ class MainActivity : AppCompatActivity(), SharedPreferences.OnSharedPreferenceCh
) android.R.color.white else R.color.colorAccent
)
)
widget_shape_background.setImageDrawable(BitmapHelper.getTintedDrawable(this, R.drawable.card_background, ColorHelper.getBackgroundColor()))
uiJob = lifecycleScope.launch(Dispatchers.IO) {
delay(200)
val generatedView = MainWidget.generateWidgetView(this@MainActivity)
@ -131,11 +140,15 @@ class MainActivity : AppCompatActivity(), SharedPreferences.OnSharedPreferenceCh
withContext(Dispatchers.Main) {
// Clock
time.setTextColor(ColorHelper.getFontColor())
time_am_pm.setTextColor(ColorHelper.getFontColor())
time.setTextSize(
TypedValue.COMPLEX_UNIT_SP,
Preferences.clockTextSize.toPixel(this@MainActivity)
)
time.format12Hour = "hh:mm"
time_am_pm.setTextSize(
TypedValue.COMPLEX_UNIT_SP,
Preferences.clockTextSize.toPixel(this@MainActivity) / 5 * 2
)
// Clock bottom margin
clock_bottom_margin_none.isVisible =
@ -147,14 +160,14 @@ class MainActivity : AppCompatActivity(), SharedPreferences.OnSharedPreferenceCh
clock_bottom_margin_large.isVisible =
Preferences.showClock && Preferences.clockBottomMargin == Constants.ClockBottomMargin.LARGE.value
if ((Preferences.showClock && !time.isVisible) || (!Preferences.showClock && time.isVisible)) {
if ((Preferences.showClock && !time_container.isVisible) || (!Preferences.showClock && time_container.isVisible)) {
if (Preferences.showClock) {
time.layoutParams = time.layoutParams.apply {
time_container.layoutParams = time_container.layoutParams.apply {
height = RelativeLayout.LayoutParams.WRAP_CONTENT
}
time.measure(0, 0)
time_container.measure(0, 0)
}
val initialHeight = time.measuredHeight
val initialHeight = time_container.measuredHeight
ValueAnimator.ofFloat(
if (Preferences.showClock) 0f else 1f,
if (Preferences.showClock) 1f else 0f
@ -162,19 +175,19 @@ class MainActivity : AppCompatActivity(), SharedPreferences.OnSharedPreferenceCh
duration = 500L
addUpdateListener {
val animatedValue = animatedValue as Float
time.layoutParams = time.layoutParams.apply {
time_container.layoutParams = time_container.layoutParams.apply {
height = (initialHeight * animatedValue).toInt()
}
}
addListener(
onStart = {
if (Preferences.showClock) {
time.isVisible = true
time_container.isVisible = true
}
},
onEnd = {
if (!Preferences.showClock) {
time.isVisible = false
time_container.isVisible = false
}
}
)
@ -195,10 +208,10 @@ class MainActivity : AppCompatActivity(), SharedPreferences.OnSharedPreferenceCh
}
}.start()
} else {
time.layoutParams = time.layoutParams.apply {
time_container.layoutParams = time_container.layoutParams.apply {
height = RelativeLayout.LayoutParams.WRAP_CONTENT
}
time.measure(0, 0)
time_container.measure(0, 0)
}
if (preview.height == 0) {
@ -237,6 +250,19 @@ class MainActivity : AppCompatActivity(), SharedPreferences.OnSharedPreferenceCh
}
}.start()
}
// Calendar error indicator
tabs.getTabAt(1)?.orCreateBadge?.apply {
backgroundColor = ContextCompat.getColor(this@MainActivity, R.color.errorColorText)
badgeGravity = BadgeDrawable.TOP_END
}?.isVisible = Preferences.showEvents && !checkGrantedPermission(Manifest.permission.READ_CALENDAR)
// Weather error indicator
tabs.getTabAt(2)?.orCreateBadge?.apply {
backgroundColor = ContextCompat.getColor(this@MainActivity, R.color.errorColorText)
badgeGravity = BadgeDrawable.TOP_END
}?.isVisible = Preferences.showWeather && (Preferences.weatherProviderApi == "" || (Preferences.customLocationAdd == "" && !checkGrantedPermission(if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) Manifest.permission.ACCESS_BACKGROUND_LOCATION else Manifest.permission.ACCESS_FINE_LOCATION)))
}
private fun subscribeUi(viewModel: MainViewModel) {

View File

@ -79,21 +79,31 @@ class AdvancedSettingsFragment : Fragment() {
) {
viewModel.darkThemePreference.observe(viewLifecycleOwner, Observer {
AppCompatDelegate.setDefaultNightMode(it)
theme?.text = when (it) {
AppCompatDelegate.MODE_NIGHT_NO -> getString(R.string.settings_subtitle_dark_theme_light)
AppCompatDelegate.MODE_NIGHT_YES -> getString(R.string.settings_subtitle_dark_theme_dark)
AppCompatDelegate.MODE_NIGHT_AUTO_BATTERY -> getString(R.string.settings_subtitle_dark_theme_by_battery_saver)
AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM -> getString(R.string.settings_subtitle_dark_theme_follow_system)
else -> ""
maintainScrollPosition {
theme?.text = when (it) {
AppCompatDelegate.MODE_NIGHT_NO -> getString(R.string.settings_subtitle_dark_theme_light)
AppCompatDelegate.MODE_NIGHT_YES -> getString(R.string.settings_subtitle_dark_theme_dark)
AppCompatDelegate.MODE_NIGHT_AUTO_BATTERY -> getString(R.string.settings_subtitle_dark_theme_by_battery_saver)
AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM -> getString(R.string.settings_subtitle_dark_theme_follow_system)
else -> ""
}
}
})
viewModel.showPreview.observe(viewLifecycleOwner, Observer {
show_widget_preview_label?.text = if (it) getString(R.string.settings_visible) else getString(R.string.settings_not_visible)
maintainScrollPosition {
show_widget_preview_label?.text =
if (it) getString(R.string.settings_visible) else getString(R.string.settings_not_visible)
}
})
viewModel.showWallpaper.observe(viewLifecycleOwner, Observer {
show_wallpaper_label?.text = if (it && activity?.checkGrantedPermission(Manifest.permission.READ_EXTERNAL_STORAGE) == true) getString(R.string.settings_visible) else getString(R.string.settings_not_visible)
maintainScrollPosition {
show_wallpaper_label?.text =
if (it && activity?.checkGrantedPermission(Manifest.permission.READ_EXTERNAL_STORAGE) == true) getString(
R.string.settings_visible
) else getString(R.string.settings_not_visible)
}
})
}

View File

@ -2,14 +2,12 @@ package com.tommasoberlose.anotherwidget.ui.fragments
import android.Manifest
import android.app.Activity
import android.content.DialogInterface
import android.content.Intent
import android.os.Bundle
import android.util.Log
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.appcompat.app.AlertDialog
import androidx.core.content.ContextCompat
import androidx.core.view.isVisible
import androidx.databinding.DataBindingUtil
import androidx.fragment.app.Fragment
@ -42,7 +40,6 @@ import kotlinx.android.synthetic.main.fragment_calendar_settings.*
import kotlinx.android.synthetic.main.fragment_calendar_settings.scrollView
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
import java.text.SimpleDateFormat
import java.util.*
import kotlin.Comparator
@ -89,7 +86,6 @@ class CalendarSettingsFragment : Fragment() {
binding.isCalendarEnabled = it
if (it) {
requirePermission()
CalendarHelper.setEventUpdatesAndroidN(requireContext())
} else {
CalendarHelper.removeEventUpdatesAndroidN(requireContext())
@ -321,12 +317,12 @@ class CalendarSettingsFragment : Fragment() {
private fun checkReadEventsPermission(showEvents: Boolean = Preferences.showEvents) {
if (activity?.checkGrantedPermission(Manifest.permission.READ_CALENDAR) == true) {
show_events_label?.text = if (showEvents) getString(R.string.show_events_visible) else getString(R.string.show_events_not_visible)
read_calendar_permission_alert_icon?.isVisible = false
read_calendar_permission_alert?.isVisible = false
CalendarHelper.updateEventList(requireContext())
} else {
show_events_label?.text = if (showEvents) getString(R.string.description_permission_calendar) else getString(R.string.show_events_not_visible)
read_calendar_permission_alert_icon?.isVisible = showEvents
read_calendar_permission_alert_icon?.setOnClickListener {
read_calendar_permission_alert?.isVisible = showEvents
read_calendar_permission_alert?.setOnClickListener {
requirePermission()
}
}

View File

@ -1,9 +1,11 @@
package com.tommasoberlose.anotherwidget.ui.fragments
import android.annotation.SuppressLint
import android.app.Activity
import android.content.Intent
import android.graphics.Color
import android.os.Bundle
import android.util.Log
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
@ -18,6 +20,9 @@ import com.tommasoberlose.anotherwidget.components.BottomSheetMenu
import com.tommasoberlose.anotherwidget.databinding.FragmentGeneralSettingsBinding
import com.tommasoberlose.anotherwidget.global.Preferences
import com.tommasoberlose.anotherwidget.global.RequestCode
import com.tommasoberlose.anotherwidget.helpers.ColorHelper
import com.tommasoberlose.anotherwidget.helpers.ColorHelper.toHexValue
import com.tommasoberlose.anotherwidget.helpers.ColorHelper.toIntValue
import com.tommasoberlose.anotherwidget.helpers.SettingsStringHelper
import com.tommasoberlose.anotherwidget.ui.activities.MainActivity
import com.tommasoberlose.anotherwidget.ui.viewmodels.MainViewModel
@ -71,6 +76,7 @@ class GeneralSettingsFragment : Fragment() {
}
@SuppressLint("DefaultLocale")
private fun subscribeUi(
viewModel: MainViewModel
) {
@ -89,12 +95,45 @@ class GeneralSettingsFragment : Fragment() {
viewModel.textGlobalColor.observe(viewLifecycleOwner, Observer {
maintainScrollPosition {
try {
Color.parseColor(it)
} catch (e: Exception) {
Preferences.textGlobalColor = "#FFFFFF"
if (Preferences.textGlobalAlpha == "00") {
font_color_label?.text = getString(R.string.transparent)
} else {
font_color_label?.text =
"#%s".format(Integer.toHexString(ColorHelper.getFontColor())).toUpperCase()
}
}
})
viewModel.textGlobalAlpha.observe(viewLifecycleOwner, Observer {
maintainScrollPosition {
if (Preferences.textGlobalAlpha == "00") {
font_color_label?.text = getString(R.string.transparent)
} else {
font_color_label?.text =
"#%s".format(Integer.toHexString(ColorHelper.getFontColor())).toUpperCase()
}
}
})
viewModel.backgroundCardColor.observe(viewLifecycleOwner, Observer {
maintainScrollPosition {
if (Preferences.backgroundCardAlpha == "00") {
background_color_label?.text = getString(R.string.transparent)
} else {
background_color_label?.text =
"#%s".format(Integer.toHexString(ColorHelper.getBackgroundColor())).toUpperCase()
}
}
})
viewModel.backgroundCardAlpha.observe(viewLifecycleOwner, Observer {
maintainScrollPosition {
if (Preferences.backgroundCardAlpha == "00") {
background_color_label?.text = getString(R.string.transparent)
} else {
background_color_label?.text =
"#%s".format(Integer.toHexString(ColorHelper.getBackgroundColor())).toUpperCase()
}
font_color_label?.text = it.toUpperCase()
}
})
@ -142,19 +181,35 @@ class GeneralSettingsFragment : Fragment() {
}
action_font_color.setOnClickListener {
val textColor = try {
Color.parseColor(Preferences.textGlobalColor)
} catch (e: Exception) {
Preferences.textGlobalColor = "#FFFFFF"
Color.parseColor(Preferences.textGlobalColor)
}
BottomSheetColorPicker(requireContext(),
colors = colors,
header = getString(R.string.settings_font_color_title),
selected = textColor,
selected = ColorHelper.getFontColor(),
onColorSelected = { color: Int ->
val colorString = Integer.toHexString(color)
Preferences.textGlobalColor = "#" + if (colorString.length > 6) colorString.substring(2) else colorString
},
showAlphaSelector = true,
alpha = Preferences.textGlobalAlpha.toIntValue(),
onAlphaChangeListener = { alpha ->
Preferences.textGlobalAlpha = alpha.toHexValue()
}
).show()
}
action_background_color.setOnClickListener {
BottomSheetColorPicker(requireContext(),
colors = colors,
header = getString(R.string.settings_background_color_title),
selected = ColorHelper.getBackgroundColor(),
onColorSelected = { color: Int ->
val colorString = Integer.toHexString(color)
Preferences.backgroundCardColor = "#" + if (colorString.length > 6) colorString.substring(2) else colorString
},
showAlphaSelector = true,
alpha = Preferences.backgroundCardAlpha.toIntValue(),
onAlphaChangeListener = { alpha ->
Preferences.backgroundCardAlpha = alpha.toHexValue()
}
).show()
}

View File

@ -8,6 +8,7 @@ import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.core.content.ContextCompat
import androidx.core.view.isVisible
import androidx.databinding.DataBindingUtil
import androidx.fragment.app.Fragment
@ -98,7 +99,7 @@ class WeatherSettingsFragment : Fragment() {
if (it == "") getString(R.string.settings_weather_provider_api_key_subtitle_not_set) else getString(
R.string.settings_weather_provider_api_key_subtitle_all_set
)
api_key_alert_icon?.isVisible = it == ""
label_weather_provider_api_key?.setTextColor(ContextCompat.getColor(requireContext(), if (it == "") R.color.errorColorText else R.color.colorSecondaryText))
}
checkLocationPermission()
})
@ -135,12 +136,17 @@ class WeatherSettingsFragment : Fragment() {
}
private fun checkLocationPermission() {
// Background permission
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q && activity?.checkGrantedPermission(Manifest.permission.ACCESS_FINE_LOCATION) == true) {
requirePermission()
}
if (activity?.checkGrantedPermission(if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) Manifest.permission.ACCESS_BACKGROUND_LOCATION else Manifest.permission.ACCESS_FINE_LOCATION) == true) {
location_permission_alert_icon?.isVisible = false
location_permission_alert?.isVisible = false
WeatherWorker.setUpdates(requireContext())
} else if (Preferences.showWeather && Preferences.customLocationAdd == "") {
location_permission_alert_icon?.isVisible = true
location_permission_alert_icon?.setOnClickListener {
location_permission_alert?.isVisible = true
location_permission_alert?.setOnClickListener {
requirePermission()
}
}

View File

@ -8,6 +8,9 @@ class MainViewModel : ViewModel() {
// General Settings
val textGlobalColor = Preferences.asLiveData(Preferences::textGlobalColor)
val textGlobalAlpha = Preferences.asLiveData(Preferences::textGlobalAlpha)
val backgroundCardColor = Preferences.asLiveData(Preferences::backgroundCardColor)
val backgroundCardAlpha = Preferences.asLiveData(Preferences::backgroundCardAlpha)
val textMainSize = Preferences.asLiveData(Preferences::textMainSize)
val textSecondSize = Preferences.asLiveData(Preferences::textSecondSize)
val textShadow = Preferences.asLiveData(Preferences::textShadow)

View File

@ -12,6 +12,7 @@ import android.graphics.Color
import android.graphics.Typeface
import android.os.Bundle
import android.text.format.DateUtils
import android.util.Log
import android.util.TypedValue
import android.view.View
import android.widget.ImageView
@ -35,6 +36,7 @@ import com.tommasoberlose.anotherwidget.utils.checkGrantedPermission
import com.tommasoberlose.anotherwidget.utils.getCapWordString
import com.tommasoberlose.anotherwidget.utils.toPixel
import kotlinx.android.synthetic.main.the_widget.view.*
import kotlinx.android.synthetic.main.the_widget_sans.*
import java.lang.Exception
import java.text.DateFormat
import java.util.*
@ -95,7 +97,7 @@ class MainWidget : AppWidgetProvider() {
val displayMetrics = Resources.getSystem().displayMetrics
val width = displayMetrics.widthPixels
val dimensions = WidgetHelper.WidgetSizeProvider(context, appWidgetManager).getWidgetsSize(appWidgetId).reduceDimensionWithMaxWidth(1200)
val dimensions = WidgetHelper.WidgetSizeProvider(context, appWidgetManager).getWidgetsSize(appWidgetId)
generateWidgetView(context, appWidgetId, appWidgetManager, dimensions.first - 8.toPixel(context) /*width - 16.toPixel(context)*/)
}
@ -105,6 +107,10 @@ class MainWidget : AppWidgetProvider() {
val generatedView = generateWidgetView(context)
views.setImageViewBitmap(R.id.bitmap_container, BitmapHelper.getBitmapFromView(generatedView, width = w))
// Background
views.setInt(R.id.widget_shape_background, "setColorFilter", ColorHelper.getBackgroundColorRgb())
views.setInt(R.id.widget_shape_background, "setImageAlpha", ColorHelper.getBackgroundAlpha())
// Clock
views = updateClockView(context, views, appWidgetId)
@ -262,6 +268,7 @@ class MainWidget : AppWidgetProvider() {
views.setViewVisibility(R.id.calendar_layout_rect, View.VISIBLE)
}
} catch (ex: Exception) {
ex.printStackTrace()
FirebaseCrashlytics.getInstance().recordException(ex)
}
@ -295,6 +302,7 @@ class MainWidget : AppWidgetProvider() {
views.setViewVisibility(R.id.calendar_weather_rect, View.GONE)
}
} catch (ex: Exception) {
ex.printStackTrace()
FirebaseCrashlytics.getInstance().recordException(ex)
}
return views
@ -304,17 +312,24 @@ class MainWidget : AppWidgetProvider() {
try {
if (!Preferences.showClock) {
views.setViewVisibility(R.id.time, View.GONE)
views.setViewVisibility(R.id.time_am_pm, View.GONE)
views.setViewVisibility(R.id.clock_bottom_margin_none, View.GONE)
views.setViewVisibility(R.id.clock_bottom_margin_small, View.GONE)
views.setViewVisibility(R.id.clock_bottom_margin_medium, View.GONE)
views.setViewVisibility(R.id.clock_bottom_margin_large, View.GONE)
} else {
views.setTextColor(R.id.time, ColorHelper.getFontColor())
views.setTextColor(R.id.time_am_pm, ColorHelper.getFontColor())
views.setTextViewTextSize(
R.id.time,
TypedValue.COMPLEX_UNIT_SP,
Preferences.clockTextSize.toPixel(context)
)
views.setTextViewTextSize(
R.id.time_am_pm,
TypedValue.COMPLEX_UNIT_SP,
Preferences.clockTextSize.toPixel(context) / 5 * 2
)
val clockPIntent = PendingIntent.getActivity(
context,
widgetID,
@ -322,7 +337,9 @@ class MainWidget : AppWidgetProvider() {
0
)
views.setOnClickPendingIntent(R.id.time, clockPIntent)
views.setOnClickPendingIntent(R.id.time_am_pm, clockPIntent)
views.setViewVisibility(R.id.time, View.VISIBLE)
views.setViewVisibility(R.id.time_am_pm, View.VISIBLE)
views.setViewVisibility(
R.id.clock_bottom_margin_none,
@ -342,6 +359,7 @@ class MainWidget : AppWidgetProvider() {
)
}
} catch (ex: Exception) {
ex.printStackTrace()
FirebaseCrashlytics.getInstance().recordException(ex)
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 327 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 192 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 214 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 279 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 254 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 233 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 306 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 319 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 228 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 151 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 139 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 214 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 184 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 145 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 233 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 228 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 417 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 214 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 228 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 327 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 233 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 228 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 319 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 399 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 590 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 279 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 327 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 499 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 306 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 319 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 494 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 540 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 723 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 327 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 417 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 590 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 319 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 399 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 540 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 684 B

View File

@ -3,10 +3,9 @@
<item>
<shape android:shape="rectangle">
<corners
android:radius="3dp" />
<stroke
android:color="@android:color/white"
android:width="2dp"/>
android:radius="9dp" />
<solid
android:color="@android:color/white"/>
</shape>
</item>
</selector>

View 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,4L5,4c-1.1,0 -2,0.9 -2,2v12c0,1.1 0.9,2 2,2h14c1.1,0 2,-0.9 2,-2L21,6c0,-1.1 -0.9,-2 -2,-2zM18,18L6,18c-0.55,0 -1,-0.45 -1,-1L5,7c0,-0.55 0.45,-1 1,-1h12c0.55,0 1,0.45 1,1v10c0,0.55 -0.45,1 -1,1z"/>
</vector>

View 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="M11,9h2v2h-2L11,9zM9,11h2v2L9,13v-2zM13,11h2v2h-2v-2zM15,9h2v2h-2L15,9zM7,9h2v2L7,11L7,9zM19,3L5,3c-1.1,0 -2,0.9 -2,2v14c0,1.1 0.9,2 2,2h14c1.1,0 2,-0.9 2,-2L21,5c0,-1.1 -0.9,-2 -2,-2zM9,18L7,18v-2h2v2zM13,18h-2v-2h2v2zM17,18h-2v-2h2v2zM19,11h-2v2h2v2h-2v-2h-2v2h-2v-2h-2v2L9,15v-2L7,13v2L5,15v-2h2v-2L5,11L5,6c0,-0.55 0.45,-1 1,-1h12c0.55,0 1,0.45 1,1v5z"/>
</vector>

View File

@ -35,24 +35,77 @@
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content">
<RelativeLayout
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<GridLayout
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/menu"
android:visibility="gone"
android:layout_margin="16dp"
android:columnCount="6"/>
<ProgressBar
android:layout_width="32dp"
android:layout_height="32dp"
android:indeterminateTint="@color/colorPrimaryText"
android:indeterminate="true"
android:layout_margin="32dp"
android:layout_centerInParent="true"
android:id="@+id/color_loader" />
</RelativeLayout>
android:paddingTop="16dp"
android:paddingBottom="16dp"
android:paddingRight="16dp"
android:paddingLeft="16dp"
android:id="@+id/alpha_selector_container"
android:gravity="center_vertical"
android:orientation="vertical">
<androidx.appcompat.widget.AppCompatTextView
android:textAppearance="@style/TextAppearance.MaterialComponents.Button"
app:textAllCaps="false"
android:letterSpacing="0"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="16dp"
android:paddingBottom="16dp"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:textSize="15sp"
android:gravity="start"
android:textAlignment="viewStart"
android:id="@+id/text_alpha"
android:text="Alpha : 20%"
android:textColor="@color/colorSecondaryText"/>
<com.warkiz.widget.IndicatorSeekBar
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:isb_max="100"
app:isb_min="0"
app:isb_seek_smoothly="true"
app:isb_show_thumb_text="false"
app:isb_thumb_adjust_auto="true"
app:isb_track_rounded_corners="true"
app:isb_thumb_text_color="@color/colorAccent"
app:isb_progress_value_float="false"
app:isb_show_tick_texts="false"
app:isb_show_indicator="none"
app:isb_thumb_color="@color/colorAccent"
app:isb_thumb_size="12dp"
android:id="@+id/alpha_selector"
app:isb_track_background_color="@color/disabledButtonBackground"
app:isb_track_background_size="4dp"
app:isb_track_progress_color="@color/disabledButtonBackground"
app:isb_track_progress_size="4dp"
app:isb_only_thumb_draggable="false"/>
</LinearLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<GridLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/menu"
android:visibility="gone"
android:layout_margin="16dp"
android:columnCount="6"/>
<ProgressBar
android:layout_width="32dp"
android:layout_height="32dp"
android:indeterminateTint="@color/colorPrimaryText"
android:indeterminate="true"
android:layout_margin="32dp"
android:layout_centerInParent="true"
android:id="@+id/color_loader" />
</RelativeLayout>
</LinearLayout>
</androidx.core.widget.NestedScrollView>
</LinearLayout>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<layout>
<layout xmlns:app="http://schemas.android.com/apk/res-auto">
<data>
<variable
name="viewModel"
@ -59,15 +59,22 @@
android:id="@+id/show_events_label"
android:text="@string/description_permission_calendar"
style="@style/AnotherWidget.Settings.Subtitle"/>
<com.google.android.material.button.MaterialButton
android:layout_width="wrap_content"
android:layout_height="36dp"
style="@style/Widget.MaterialComponents.Button.TextButton"
android:letterSpacing="0"
android:textAllCaps="false"
android:clickable="true"
android:layout_marginStart="-8dp"
android:layout_marginBottom="-8dp"
android:paddingBottom="0dp"
android:paddingTop="0dp"
android:focusable="true"
android:id="@+id/read_calendar_permission_alert"
android:textColor="@color/errorColorText"
android:text="@string/action_grant_permission"/>
</LinearLayout>
<ImageView
android:layout_width="48dp"
android:layout_height="48dp"
android:padding="12dp"
android:visibility="gone"
android:id="@+id/read_calendar_permission_alert_icon"
android:src="@drawable/round_error"
android:tint="@color/errorColorText"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"

View File

@ -129,6 +129,43 @@
style="@style/AnotherWidget.Settings.Subtitle"/>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="16dp"
android:paddingBottom="16dp"
android:paddingLeft="8dp"
android:paddingRight="8dp"
android:clickable="true"
android:focusable="true"
android:background="?android:attr/selectableItemBackground"
android:gravity="center_vertical"
android:id="@+id/action_background_color"
android:orientation="horizontal">
<ImageView
android:layout_width="48dp"
android:layout_height="48dp"
android:padding="12dp"
android:src="@drawable/round_crop_3_2"
android:tint="@color/colorPrimaryText"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="8dp"
android:paddingRight="8dp"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@style/AnotherWidget.Settings.Title"
android:text="@string/settings_background_color_title"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/background_color_label"
style="@style/AnotherWidget.Settings.Subtitle"/>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"

View File

@ -186,15 +186,22 @@
android:layout_height="wrap_content"
android:id="@+id/label_custom_location"
style="@style/AnotherWidget.Settings.Subtitle"/>
<com.google.android.material.button.MaterialButton
android:layout_width="wrap_content"
android:layout_height="36dp"
style="@style/Widget.MaterialComponents.Button.TextButton"
android:letterSpacing="0"
android:textAllCaps="false"
android:clickable="true"
android:layout_marginStart="-8dp"
android:layout_marginBottom="-8dp"
android:paddingBottom="0dp"
android:paddingTop="0dp"
android:focusable="true"
android:id="@+id/location_permission_alert"
android:textColor="@color/errorColorText"
android:text="@string/action_grant_permission"/>
</LinearLayout>
<ImageView
android:layout_width="48dp"
android:layout_height="48dp"
android:padding="12dp"
android:visibility="gone"
android:id="@+id/location_permission_alert_icon"
android:src="@drawable/round_error"
android:tint="@color/errorColorText"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"

View File

@ -48,7 +48,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@style/AnotherWidget.Date.Big"
android:ellipsize="marquee"
android:maxLines="1"
android:includeFontPadding="false"
android:id="@+id/temp"/>
</LinearLayout>

View File

@ -1,139 +1,171 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:gravity="center"
android:paddingLeft="8dp"
android:paddingRight="8dp"
android:id="@+id/main_layout">
<TextClock
android:id="@+id/time"
android:layout_height="match_parent">
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="match_parent"
android:layout_margin="8dp"
android:scaleType="fitXY"
android:id="@+id/widget_shape_background"
android:src="@drawable/card_background" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:gravity="center"
android:lineSpacingMultiplier="1"
android:lineSpacingExtra="0dp"
android:includeFontPadding="false"
android:format12Hour="hh:mm"
android:padding="0dp"
android:visibility="gone"
android:lines="1"
android:maxLines="1"
style="@style/AnotherWidget.Title"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="2dp"
android:layout_marginTop="-16dp"
android:orientation="horizontal"
android:id="@+id/clock_bottom_margin_none" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="2dp"
android:layout_marginTop="-8dp"
android:visibility="gone"
android:orientation="horizontal"
android:id="@+id/clock_bottom_margin_small" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="2dp"
android:visibility="gone"
android:orientation="horizontal"
android:id="@+id/clock_bottom_margin_medium" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="10dp"
android:visibility="gone"
android:orientation="horizontal"
android:id="@+id/clock_bottom_margin_large" />
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
android:paddingLeft="8dp"
android:paddingRight="8dp"
android:id="@+id/main_layout">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:alpha="0"
android:layout_centerHorizontal="true"
android:orientation="horizontal"
android:id="@+id/time_container"
android:gravity="center_horizontal"
android:layoutDirection="locale"
android:id="@+id/empty_layout_rect">
<ImageView
android:orientation="horizontal">
<TextClock
android:id="@+id/time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/empty_date_rect"/>
<ImageView
android:gravity="center"
android:lineSpacingMultiplier="1"
android:lineSpacingExtra="0dp"
android:includeFontPadding="false"
android:format12Hour="h:mm"
android:padding="0dp"
android:lines="1"
android:maxLines="1"
style="@style/AnotherWidget.Title"/>
<TextClock
android:id="@+id/time_am_pm"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/weather_rect" />
android:gravity="center"
android:lineSpacingMultiplier="1"
android:lineSpacingExtra="0dp"
android:includeFontPadding="false"
android:format12Hour="a"
android:format24Hour=""
android:padding="0dp"
android:lines="1"
android:maxLines="1"
style="@style/AnotherWidget.Title"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_centerHorizontal="true"
android:id="@+id/calendar_layout_rect"
android:alpha="0"
android:gravity="center">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layoutDirection="locale"
android:orientation="horizontal">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:id="@+id/action_previous_rect" />
<ImageView
android:layout_height="wrap_content"
android:layout_width="0dp"
android:layout_weight="1"
android:id="@+id/next_event_rect" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/next_event_difference_time_rect" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:id="@+id/action_next_rect" />
</LinearLayout>
android:layout_height="2dp"
android:layout_marginTop="-16dp"
android:orientation="horizontal"
android:id="@+id/clock_bottom_margin_none" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="2dp"
android:layout_marginTop="-8dp"
android:visibility="gone"
android:orientation="horizontal"
android:id="@+id/clock_bottom_margin_small" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="2dp"
android:visibility="gone"
android:orientation="horizontal"
android:id="@+id/clock_bottom_margin_medium" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="10dp"
android:visibility="gone"
android:orientation="horizontal"
android:id="@+id/clock_bottom_margin_large" />
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:alpha="0"
android:layout_centerHorizontal="true"
android:orientation="horizontal"
android:layoutDirection="locale"
android:id="@+id/empty_layout_rect">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/empty_date_rect"/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/weather_rect" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_centerHorizontal="true"
android:id="@+id/calendar_layout_rect"
android:alpha="0"
android:gravity="center">
<LinearLayout
android:layout_width="0dp"
android:layout_weight="1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:layoutDirection="locale"
android:orientation="horizontal">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/second_row_rect" />
</LinearLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center">
android:layout_gravity="center_vertical"
android:id="@+id/action_previous_rect" />
<ImageView
android:layout_height="wrap_content"
android:layout_width="0dp"
android:layout_weight="1"
android:id="@+id/next_event_rect" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/calendar_weather_rect" />
android:id="@+id/next_event_difference_time_rect" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:id="@+id/action_next_rect" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layoutDirection="locale"
android:gravity="center">
<LinearLayout
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/second_row_rect" />
</LinearLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/calendar_weather_rect" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:scaleType="fitCenter"
android:id="@+id/bitmap_container"/>
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:scaleType="fitCenter"
android:id="@+id/bitmap_container"/>
</RelativeLayout>
</LinearLayout>
</RelativeLayout>
</LinearLayout>
</RelativeLayout>

View File

@ -202,4 +202,7 @@
<string name="xiaomi_warning_message">Enable the permission to display pop-up windows when running in the background inside the "Other permission" section of the app settings. Otherwise, you will not able to open any applications tapping on the widget.</string>
<string name="action_ignore">Ignore</string>
<string name="action_grant_permission">Grant permission</string>
<string name="alpha">Alpha</string>
<string name="settings_background_color_title">Background color</string>
<string name="transparent">Transparent</string>
</resources>

View File

@ -182,4 +182,7 @@
<string name="xiaomi_warning_message">Enable the permission to display pop-up windows when running in the background inside the "Other permission" section of the app settings. Otherwise, you will not able to open any applications tapping on the widget.</string>
<string name="action_ignore">Ignore</string>
<string name="action_grant_permission">Grant permission</string>
<string name="alpha">Alpha</string>
<string name="settings_background_color_title">Background color</string>
<string name="transparent">Transparent</string>
</resources>

View File

@ -181,4 +181,7 @@
<string name="xiaomi_warning_message">Concedi il permesso per mostrare finstre pop-up quando l\'applicazione è in background. Puoi trovare l\'impostazione nella sezione Altri permessi nei dettagli dell\'app. Nel caso non fosse attivata non sarà possibile aprire applicazioni cliccando sul widget.</string>
<string name="action_ignore">Ignora</string>
<string name="action_grant_permission">Concedi permesso</string>
<string name="alpha">Trasparenza</string>
<string name="settings_background_color_title">Colore background</string>
<string name="transparent">Trasparente</string>
</resources>

View File

@ -51,7 +51,7 @@
<string name="custom_location_gps">Use geolocation</string>
<string name="action_refresh_widget">Refresh widget</string>
<string name="show_events_visible">Events are visible</string>
<string name="show_events_not_visible">Events are not visible</string>
<string name="show_events_not_visible">Events are hidden</string>
<string name="show_weather_visible">Weather info is visible</string>
<string name="show_weather_not_visible">Weather info is hidden</string>
<string name="settings_show_until_subtitle_0">3 hours later</string>
@ -105,6 +105,7 @@
<string name="settings_second_row_info_subtitle_0">Event time</string>
<string name="settings_second_row_info_subtitle_2">Show next alarm time</string>
<string name="settings_font_color_title">Text color</string>
<string name="settings_background_color_title">Background color</string>
<string name="title_main_text_size">First row text size</string>
<string name="title_second_text_size">Second row text size</string>
<string name="provider_open_weather" translatable="false">OpenWeather</string>
@ -193,4 +194,6 @@
<string name="xiaomi_warning_message">Enable the permission to display pop-up windows when running in the background inside the "Other permission" section of the app settings. Otherwise, you will not able to open any applications tapping on the widget.</string>
<string name="action_ignore">Ignore</string>
<string name="action_grant_permission">Grant permission</string>
<string name="alpha">Alpha</string>
<string name="transparent">Transparent</string>
</resources>

View File

@ -3,7 +3,7 @@
xmlns:dist="http://schemas.android.com/apk/distribution"
featureSplit="tasksintegration"
package="com.tommasoberlose.anotherwidget"
android:versionCode="67"
android:versionCode="68"
android:versionName="2.0.5" >
<uses-sdk

View File

@ -1,4 +1,4 @@
#Tue May 05 19:30:12 CEST 2020
#Wed May 06 11:30:08 CEST 2020
base.0=/Users/tommaso/Documents/MyCode/another-widget/tasksintegration/build/intermediates/dex/debug/mergeProjectDexDebug/out/classes.dex
path.0=classes.dex
renamed.0=classes.dex

View File

@ -4,7 +4,7 @@
featureSplit="tasksintegration"
package="com.tommasoberlose.anotherwidget"
android:targetSandboxVersion="2"
android:versionCode="67"
android:versionCode="68"
android:versionName="2.0.5" >
<uses-sdk

View File

@ -3,7 +3,7 @@
3 xmlns:dist="http://schemas.android.com/apk/distribution"
4 featureSplit="tasksintegration"
5 package="com.tommasoberlose.anotherwidget"
6 android:versionCode="67"
6 android:versionCode="68"
7 android:versionName="2.0.5" >
8
9 <uses-sdk

View File

@ -3,7 +3,7 @@
xmlns:dist="http://schemas.android.com/apk/distribution"
featureSplit="tasksintegration"
package="com.tommasoberlose.anotherwidget"
android:versionCode="67"
android:versionCode="68"
android:versionName="2.0.5" >
<uses-sdk

View File

@ -3,7 +3,7 @@
xmlns:dist="http://schemas.android.com/apk/distribution"
featureSplit="tasksintegration"
package="com.tommasoberlose.anotherwidget"
android:versionCode="67"
android:versionCode="68"
android:versionName="2.0.5" >
<uses-sdk android:targetSdkVersion="29" />