Update ui
This commit is contained in:
parent
5bb81772f4
commit
20c5ce61b4
BIN
.idea/caches/build_file_checksums.ser
generated
BIN
.idea/caches/build_file_checksums.ser
generated
Binary file not shown.
@ -94,7 +94,7 @@ dependencies {
|
|||||||
|
|
||||||
// Other
|
// Other
|
||||||
implementation 'androidx.multidex:multidex:2.0.1'
|
implementation 'androidx.multidex:multidex:2.0.1'
|
||||||
implementation 'joda-time:joda-time:2.10.6'
|
implementation 'net.danlew:android.joda:2.10.9'
|
||||||
implementation 'me.everything:providers-android:1.0.1'
|
implementation 'me.everything:providers-android:1.0.1'
|
||||||
implementation 'com.github.warkiz.widget:indicatorseekbar:2.1.2'
|
implementation 'com.github.warkiz.widget:indicatorseekbar:2.1.2'
|
||||||
|
|
||||||
|
@ -8,6 +8,7 @@ import com.google.firebase.crashlytics.FirebaseCrashlytics
|
|||||||
import com.tommasoberlose.anotherwidget.global.Preferences
|
import com.tommasoberlose.anotherwidget.global.Preferences
|
||||||
import io.realm.Realm
|
import io.realm.Realm
|
||||||
import io.realm.RealmConfiguration
|
import io.realm.RealmConfiguration
|
||||||
|
import net.danlew.android.joda.JodaTimeAndroid
|
||||||
|
|
||||||
class AWApplication : Application() {
|
class AWApplication : Application() {
|
||||||
override fun onCreate() {
|
override fun onCreate() {
|
||||||
|
@ -10,6 +10,7 @@ import android.os.Build
|
|||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import androidx.core.view.isVisible
|
import androidx.core.view.isVisible
|
||||||
|
import androidx.navigation.Navigation
|
||||||
import com.google.android.gms.auth.api.signin.GoogleSignIn
|
import com.google.android.gms.auth.api.signin.GoogleSignIn
|
||||||
import com.google.android.gms.auth.api.signin.GoogleSignInAccount
|
import com.google.android.gms.auth.api.signin.GoogleSignInAccount
|
||||||
import com.google.android.gms.auth.api.signin.GoogleSignInOptions
|
import com.google.android.gms.auth.api.signin.GoogleSignInOptions
|
||||||
|
@ -119,33 +119,43 @@ class MainFragment : Fragment(), SharedPreferences.OnSharedPreferenceChangeList
|
|||||||
binding.actionSettings.animate().alpha(if (!show) 1f else 0f).setDuration(200).translationX((if (!show) 0f else -4f).convertDpToPixel(requireContext())).start()
|
binding.actionSettings.animate().alpha(if (!show) 1f else 0f).setDuration(200).translationX((if (!show) 0f else -4f).convertDpToPixel(requireContext())).start()
|
||||||
binding.fragmentTitle.text = if (show) destination.label.toString() else getString(R.string.app_name)
|
binding.fragmentTitle.text = if (show) destination.label.toString() else getString(R.string.app_name)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
binding.actionSettings.setOnClickListener {
|
||||||
|
Navigation.findNavController(it).navigate(R.id.action_appMainFragment_to_appSettingsFragment, null, null, FragmentNavigatorExtras(
|
||||||
|
binding.actionBack to "action_back"
|
||||||
|
))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private var uiJob: Job? = null
|
private var uiJob: Job? = null
|
||||||
|
|
||||||
private fun updateUI() {
|
private fun updateUI() {
|
||||||
|
Log.d("ciao", "UPDATE UI")
|
||||||
uiJob?.cancel()
|
uiJob?.cancel()
|
||||||
|
|
||||||
binding.preview.clearAnimation()
|
binding.preview.clearAnimation()
|
||||||
binding.widgetDetail.timeContainer.clearAnimation()
|
binding.widgetDetail.timeContainer.clearAnimation()
|
||||||
binding.bottomPadding.isVisible = Preferences.showPreview
|
|
||||||
|
|
||||||
if (Preferences.showPreview) {
|
if (Preferences.showPreview) {
|
||||||
binding.preview.setCardBackgroundColor(
|
lifecycleScope.launch(Dispatchers.IO) {
|
||||||
ContextCompat.getColor(
|
val bgColor: Int = ContextCompat.getColor(
|
||||||
requireContext(),
|
requireContext(),
|
||||||
if (ColorHelper.getFontColor(requireActivity().isDarkTheme())
|
if (ColorHelper.getFontColor(requireActivity().isDarkTheme())
|
||||||
.isColorDark()
|
.isColorDark()
|
||||||
) android.R.color.white else R.color.colorAccent
|
) android.R.color.white else R.color.colorAccent
|
||||||
)
|
)
|
||||||
)
|
|
||||||
binding.widgetDetail.widgetShapeBackground.setImageDrawable(
|
val wallpaperDrawable = BitmapHelper.getTintedDrawable(
|
||||||
BitmapHelper.getTintedDrawable(
|
|
||||||
requireContext(),
|
requireContext(),
|
||||||
R.drawable.card_background,
|
R.drawable.card_background,
|
||||||
ColorHelper.getBackgroundColor(requireActivity().isDarkTheme())
|
ColorHelper.getBackgroundColor(requireActivity().isDarkTheme())
|
||||||
)
|
)
|
||||||
)
|
|
||||||
|
withContext(Dispatchers.Main) {
|
||||||
|
binding.preview.setCardBackgroundColor(bgColor)
|
||||||
|
binding.widgetDetail.widgetShapeBackground.setImageDrawable(wallpaperDrawable)
|
||||||
|
}
|
||||||
|
}
|
||||||
WidgetHelper.runWithCustomTypeface(requireContext()) { typeface ->
|
WidgetHelper.runWithCustomTypeface(requireContext()) { typeface ->
|
||||||
uiJob = lifecycleScope.launch(Dispatchers.IO) {
|
uiJob = lifecycleScope.launch(Dispatchers.IO) {
|
||||||
val generatedView = MainWidget.generateWidgetView(requireContext(), typeface).root
|
val generatedView = MainWidget.generateWidgetView(requireContext(), typeface).root
|
||||||
@ -269,18 +279,9 @@ class MainFragment : Fragment(), SharedPreferences.OnSharedPreferenceChangeList
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
ValueAnimator.ofInt(
|
binding.preview.layoutParams = binding.preview.layoutParams.apply {
|
||||||
binding.preview.height,
|
height = 0
|
||||||
0
|
|
||||||
).apply {
|
|
||||||
duration = 300L
|
|
||||||
addUpdateListener {
|
|
||||||
val animatedValue = animatedValue as Int
|
|
||||||
val layoutParams = binding.preview.layoutParams
|
|
||||||
layoutParams.height = animatedValue
|
|
||||||
binding.preview.layoutParams = layoutParams
|
|
||||||
}
|
}
|
||||||
}.start()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -312,10 +313,7 @@ class MainFragment : Fragment(), SharedPreferences.OnSharedPreferenceChangeList
|
|||||||
metrics.widthPixels to (wallpaper.intrinsicHeight) * metrics.widthPixels / (wallpaper.intrinsicWidth)
|
metrics.widthPixels to (wallpaper.intrinsicHeight) * metrics.widthPixels / (wallpaper.intrinsicWidth)
|
||||||
}
|
}
|
||||||
|
|
||||||
setMargins(
|
setMargins(0, (-80).toPixel(requireContext()), 0, 0
|
||||||
if (dimensions.first >= dimensions.second) (-80).toPixel(
|
|
||||||
requireContext()) else 0,
|
|
||||||
(-80).toPixel(requireContext()), 0, 0
|
|
||||||
)
|
)
|
||||||
|
|
||||||
width = dimensions.first
|
width = dimensions.first
|
||||||
@ -327,8 +325,8 @@ class MainFragment : Fragment(), SharedPreferences.OnSharedPreferenceChangeList
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
binding.actionSettings.setOnClickListener {
|
viewModel.fragmentScrollY.observe(viewLifecycleOwner) {
|
||||||
Navigation.findNavController(it).navigate(R.id.action_appMainFragment_to_appSettingsFragment)
|
binding.toolbar.cardElevation = if (it > 0) 24f else 0f
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -362,7 +360,7 @@ class MainFragment : Fragment(), SharedPreferences.OnSharedPreferenceChangeList
|
|||||||
class ChangeTabEvent(val page: Int)
|
class ChangeTabEvent(val page: Int)
|
||||||
|
|
||||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||||
fun onMessageEvent(ignore: UpdateUiMessageEvent?) {
|
fun onMessageEvent(ignore: UpdateUiMessageEvent) {
|
||||||
delayJob?.cancel()
|
delayJob?.cancel()
|
||||||
delayJob = lifecycleScope.launch(Dispatchers.IO) {
|
delayJob = lifecycleScope.launch(Dispatchers.IO) {
|
||||||
delay(300)
|
delay(300)
|
||||||
@ -371,4 +369,10 @@ class MainFragment : Fragment(), SharedPreferences.OnSharedPreferenceChangeList
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||||
|
fun onChangeTabEvent(ignore: ChangeTabEvent) {
|
||||||
|
val navHost = childFragmentManager.findFragmentById(R.id.settings_fragment) as? NavHostFragment?
|
||||||
|
navHost?.navController?.navigateUp()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -86,6 +86,10 @@ class SettingsFragment : Fragment() {
|
|||||||
setupListener()
|
setupListener()
|
||||||
|
|
||||||
binding.appVersion.text = "v%s (%s)".format(BuildConfig.VERSION_NAME, BuildConfig.VERSION_CODE)
|
binding.appVersion.text = "v%s (%s)".format(BuildConfig.VERSION_NAME, BuildConfig.VERSION_CODE)
|
||||||
|
|
||||||
|
binding.scrollView.viewTreeObserver.addOnScrollChangedListener {
|
||||||
|
binding.toolbar.cardElevation = if (binding.scrollView.scrollY > 0) 32f else 0f
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun subscribeUi(
|
private fun subscribeUi(
|
||||||
|
@ -175,7 +175,7 @@ class CalendarFragment : Fragment() {
|
|||||||
updateCalendar()
|
updateCalendar()
|
||||||
}.show()
|
}.show()
|
||||||
} else {
|
} else {
|
||||||
activity?.toast(getString(R.string.calendar_settings_list_error))
|
requireActivity().toast(getString(R.string.calendar_settings_list_error))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -275,7 +275,7 @@ class CalendarFragment : Fragment() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun updateCalendar() {
|
private fun updateCalendar() {
|
||||||
if (activity?.checkGrantedPermission(Manifest.permission.READ_CALENDAR) == true) {
|
if (requireActivity().checkGrantedPermission(Manifest.permission.READ_CALENDAR)) {
|
||||||
CalendarHelper.updateEventList(requireContext())
|
CalendarHelper.updateEventList(requireContext())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -127,28 +127,6 @@ class ClockFragment : Fragment() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
viewModel.clockTextAlpha.observe(viewLifecycleOwner) {
|
|
||||||
maintainScrollPosition {
|
|
||||||
if (Preferences.clockTextAlpha == "00") {
|
|
||||||
binding.clockTextColorLabel.text = getString(R.string.transparent)
|
|
||||||
} else {
|
|
||||||
binding.clockTextColorLabel.text =
|
|
||||||
"#%s".format(Integer.toHexString(ColorHelper.getClockFontColor(activity?.isDarkTheme() == true))).toUpperCase()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
viewModel.clockTextAlphaDark.observe(viewLifecycleOwner) {
|
|
||||||
maintainScrollPosition {
|
|
||||||
if (Preferences.clockTextAlphaDark == "00") {
|
|
||||||
binding.clockTextColorLabel.text = getString(R.string.transparent)
|
|
||||||
} else {
|
|
||||||
binding.clockTextColorLabel.text =
|
|
||||||
"#%s".format(Integer.toHexString(ColorHelper.getClockFontColor(activity?.isDarkTheme() == true))).toUpperCase()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun setupListener() {
|
private fun setupListener() {
|
||||||
|
@ -312,13 +312,11 @@ class GlanceTabFragment : Fragment() {
|
|||||||
if (isCurrentlyActive) {
|
if (isCurrentlyActive) {
|
||||||
ViewCompat.setElevation(view, 8f.convertDpToPixel(requireContext()))
|
ViewCompat.setElevation(view, 8f.convertDpToPixel(requireContext()))
|
||||||
view.setCardBackgroundColor(ContextCompat.getColor(requireContext(),
|
view.setCardBackgroundColor(ContextCompat.getColor(requireContext(),
|
||||||
R.color.colorPrimary))
|
R.color.cardBorder))
|
||||||
view.strokeWidth = 0
|
|
||||||
} else {
|
} else {
|
||||||
ViewCompat.setElevation(view, 0f)
|
ViewCompat.setElevation(view, 0f)
|
||||||
view.setCardBackgroundColor(ContextCompat.getColor(requireContext(),
|
view.setCardBackgroundColor(ContextCompat.getColor(requireContext(),
|
||||||
R.color.colorPrimaryDark))
|
R.color.colorPrimary))
|
||||||
view.strokeWidth = 1
|
|
||||||
}
|
}
|
||||||
|
|
||||||
val topEdge = if ((view.top == 0 && dY < 0) || ((view.top + view.height >= recyclerView.height - 32f.convertDpToPixel(requireContext())) && dY > 0)) 0f else dY
|
val topEdge = if ((view.top == 0 && dY < 0) || ((view.top + view.height >= recyclerView.height - 32f.convertDpToPixel(requireContext())) && dY > 0)) 0f else dY
|
||||||
|
@ -62,7 +62,7 @@ class LayoutFragment : Fragment() {
|
|||||||
|
|
||||||
binding.lifecycleOwner = this
|
binding.lifecycleOwner = this
|
||||||
binding.viewModel = viewModel
|
binding.viewModel = viewModel
|
||||||
binding.isDarkModeEnabled = activity?.isDarkTheme() == true
|
binding.isDarkModeEnabled = requireActivity().isDarkTheme()
|
||||||
|
|
||||||
return binding.root
|
return binding.root
|
||||||
}
|
}
|
||||||
@ -119,7 +119,7 @@ class LayoutFragment : Fragment() {
|
|||||||
binding.backgroundColorLabel.text = getString(R.string.transparent)
|
binding.backgroundColorLabel.text = getString(R.string.transparent)
|
||||||
} else {
|
} else {
|
||||||
binding.backgroundColorLabel.text =
|
binding.backgroundColorLabel.text =
|
||||||
"#%s".format(Integer.toHexString(ColorHelper.getBackgroundColor(activity?.isDarkTheme() == true))).toUpperCase()
|
"#%s".format(Integer.toHexString(ColorHelper.getBackgroundColor(requireActivity().isDarkTheme()))).toUpperCase()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -130,29 +130,7 @@ class LayoutFragment : Fragment() {
|
|||||||
binding.backgroundColorLabel.text = getString(R.string.transparent)
|
binding.backgroundColorLabel.text = getString(R.string.transparent)
|
||||||
} else {
|
} else {
|
||||||
binding.backgroundColorLabel.text =
|
binding.backgroundColorLabel.text =
|
||||||
"#%s".format(Integer.toHexString(ColorHelper.getBackgroundColor(activity?.isDarkTheme() == true))).toUpperCase()
|
"#%s".format(Integer.toHexString(ColorHelper.getBackgroundColor(requireActivity().isDarkTheme()))).toUpperCase()
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
viewModel.backgroundCardAlpha.observe(viewLifecycleOwner) {
|
|
||||||
maintainScrollPosition {
|
|
||||||
if (Preferences.backgroundCardAlpha == "00") {
|
|
||||||
binding.backgroundColorLabel.text = getString(R.string.transparent)
|
|
||||||
} else {
|
|
||||||
binding.backgroundColorLabel.text =
|
|
||||||
"#%s".format(Integer.toHexString(ColorHelper.getBackgroundColor(activity?.isDarkTheme() == true))).toUpperCase()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
viewModel.backgroundCardAlphaDark.observe(viewLifecycleOwner) {
|
|
||||||
maintainScrollPosition {
|
|
||||||
if (Preferences.backgroundCardAlphaDark == "00") {
|
|
||||||
binding.backgroundColorLabel.text = getString(R.string.transparent)
|
|
||||||
} else {
|
|
||||||
binding.backgroundColorLabel.text =
|
|
||||||
"#%s".format(Integer.toHexString(ColorHelper.getBackgroundColor(activity?.isDarkTheme() == true))).toUpperCase()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -223,10 +201,10 @@ class LayoutFragment : Fragment() {
|
|||||||
BottomSheetColorPicker(requireContext(),
|
BottomSheetColorPicker(requireContext(),
|
||||||
colors = colors,
|
colors = colors,
|
||||||
header = getString(R.string.settings_background_color_title),
|
header = getString(R.string.settings_background_color_title),
|
||||||
getSelected = { ColorHelper.getBackgroundColorRgb(activity?.isDarkTheme() == true) },
|
getSelected = { ColorHelper.getBackgroundColorRgb(requireActivity().isDarkTheme()) },
|
||||||
onColorSelected = { color: Int ->
|
onColorSelected = { color: Int ->
|
||||||
val colorString = Integer.toHexString(color)
|
val colorString = Integer.toHexString(color)
|
||||||
if (activity?.isDarkTheme() == true) {
|
if (requireActivity().isDarkTheme()) {
|
||||||
Preferences.backgroundCardColorDark =
|
Preferences.backgroundCardColorDark =
|
||||||
"#" + if (colorString.length > 6) colorString.substring(2) else colorString
|
"#" + if (colorString.length > 6) colorString.substring(2) else colorString
|
||||||
} else {
|
} else {
|
||||||
@ -235,9 +213,9 @@ class LayoutFragment : Fragment() {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
showAlphaSelector = true,
|
showAlphaSelector = true,
|
||||||
alpha = if (activity?.isDarkTheme() == true) Preferences.backgroundCardAlphaDark.toIntValue() else Preferences.backgroundCardAlpha.toIntValue(),
|
alpha = if (requireActivity().isDarkTheme()) Preferences.backgroundCardAlphaDark.toIntValue() else Preferences.backgroundCardAlpha.toIntValue(),
|
||||||
onAlphaChangeListener = { alpha ->
|
onAlphaChangeListener = { alpha ->
|
||||||
if (activity?.isDarkTheme() == true) {
|
if (requireActivity().isDarkTheme()) {
|
||||||
Preferences.backgroundCardAlphaDark = alpha.toHexValue()
|
Preferences.backgroundCardAlphaDark = alpha.toHexValue()
|
||||||
} else {
|
} else {
|
||||||
Preferences.backgroundCardAlpha = alpha.toHexValue()
|
Preferences.backgroundCardAlpha = alpha.toHexValue()
|
||||||
|
@ -66,6 +66,10 @@ class PreferencesFragment : Fragment() {
|
|||||||
|
|
||||||
setupListener()
|
setupListener()
|
||||||
|
|
||||||
|
binding.showEventsSwitch.setCheckedImmediatelyNoEvent(Preferences.showEvents)
|
||||||
|
binding.showWeatherSwitch.setCheckedImmediatelyNoEvent(Preferences.showWeather)
|
||||||
|
binding.showClockSwitch.setCheckedImmediatelyNoEvent(Preferences.showClock)
|
||||||
|
|
||||||
binding.scrollView.viewTreeObserver.addOnScrollChangedListener {
|
binding.scrollView.viewTreeObserver.addOnScrollChangedListener {
|
||||||
viewModel.fragmentScrollY.value = binding.scrollView.scrollY
|
viewModel.fragmentScrollY.value = binding.scrollView.scrollY
|
||||||
}
|
}
|
||||||
@ -74,9 +78,6 @@ class PreferencesFragment : Fragment() {
|
|||||||
private fun subscribeUi(
|
private fun subscribeUi(
|
||||||
viewModel: MainViewModel
|
viewModel: MainViewModel
|
||||||
) {
|
) {
|
||||||
binding.isCalendarEnabled = Preferences.showEvents
|
|
||||||
binding.isWeatherVisible = Preferences.showWeather
|
|
||||||
binding.isClockVisible = Preferences.showClock
|
|
||||||
|
|
||||||
viewModel.showEvents.observe(viewLifecycleOwner) {
|
viewModel.showEvents.observe(viewLifecycleOwner) {
|
||||||
maintainScrollPosition {
|
maintainScrollPosition {
|
||||||
|
@ -111,7 +111,7 @@ class TypographyFragment : Fragment() {
|
|||||||
binding.fontColorLabel.text = getString(R.string.transparent)
|
binding.fontColorLabel.text = getString(R.string.transparent)
|
||||||
} else {
|
} else {
|
||||||
binding.fontColorLabel.text =
|
binding.fontColorLabel.text =
|
||||||
"#%s".format(Integer.toHexString(ColorHelper.getFontColor(activity?.isDarkTheme() == true))).toUpperCase()
|
"#%s".format(Integer.toHexString(ColorHelper.getFontColor(requireActivity().isDarkTheme()))).toUpperCase()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -122,29 +122,7 @@ class TypographyFragment : Fragment() {
|
|||||||
binding.fontColorLabelDark.text = getString(R.string.transparent)
|
binding.fontColorLabelDark.text = getString(R.string.transparent)
|
||||||
} else {
|
} else {
|
||||||
binding.fontColorLabelDark.text =
|
binding.fontColorLabelDark.text =
|
||||||
"#%s".format(Integer.toHexString(ColorHelper.getFontColor(activity?.isDarkTheme() == true))).toUpperCase()
|
"#%s".format(Integer.toHexString(ColorHelper.getFontColor(requireActivity().isDarkTheme()))).toUpperCase()
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
viewModel.textGlobalAlpha.observe(viewLifecycleOwner) {
|
|
||||||
maintainScrollPosition {
|
|
||||||
if (Preferences.textGlobalAlpha == "00") {
|
|
||||||
binding.fontColorLabel.text = getString(R.string.transparent)
|
|
||||||
} else {
|
|
||||||
binding.fontColorLabel.text =
|
|
||||||
"#%s".format(Integer.toHexString(ColorHelper.getFontColor(activity?.isDarkTheme() == true))).toUpperCase()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
viewModel.textGlobalAlphaDark.observe(viewLifecycleOwner) {
|
|
||||||
maintainScrollPosition {
|
|
||||||
if (Preferences.textGlobalAlphaDark == "00") {
|
|
||||||
binding.fontColorLabelDark.text = getString(R.string.transparent)
|
|
||||||
} else {
|
|
||||||
binding.fontColorLabelDark.text =
|
|
||||||
"#%s".format(Integer.toHexString(ColorHelper.getFontColor(activity?.isDarkTheme() == true))).toUpperCase()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -155,7 +133,7 @@ class TypographyFragment : Fragment() {
|
|||||||
binding.secondaryFontColorLabel.text = getString(R.string.transparent)
|
binding.secondaryFontColorLabel.text = getString(R.string.transparent)
|
||||||
} else {
|
} else {
|
||||||
binding.secondaryFontColorLabel.text =
|
binding.secondaryFontColorLabel.text =
|
||||||
"#%s".format(Integer.toHexString(ColorHelper.getSecondaryFontColor(activity?.isDarkTheme() == true))).toUpperCase()
|
"#%s".format(Integer.toHexString(ColorHelper.getSecondaryFontColor(requireActivity().isDarkTheme()))).toUpperCase()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -166,29 +144,7 @@ class TypographyFragment : Fragment() {
|
|||||||
binding.secondaryFontColorLabelDark.text = getString(R.string.transparent)
|
binding.secondaryFontColorLabelDark.text = getString(R.string.transparent)
|
||||||
} else {
|
} else {
|
||||||
binding.secondaryFontColorLabelDark.text =
|
binding.secondaryFontColorLabelDark.text =
|
||||||
"#%s".format(Integer.toHexString(ColorHelper.getSecondaryFontColor(activity?.isDarkTheme() == true))).toUpperCase()
|
"#%s".format(Integer.toHexString(ColorHelper.getSecondaryFontColor(requireActivity().isDarkTheme()))).toUpperCase()
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
viewModel.textSecondaryAlpha.observe(viewLifecycleOwner) {
|
|
||||||
maintainScrollPosition {
|
|
||||||
if (Preferences.textSecondaryAlpha == "00") {
|
|
||||||
binding.secondaryFontColorLabel.text = getString(R.string.transparent)
|
|
||||||
} else {
|
|
||||||
binding.secondaryFontColorLabel.text =
|
|
||||||
"#%s".format(Integer.toHexString(ColorHelper.getSecondaryFontColor(activity?.isDarkTheme() == true))).toUpperCase()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
viewModel.textSecondaryAlphaDark.observe(viewLifecycleOwner) {
|
|
||||||
maintainScrollPosition {
|
|
||||||
if (Preferences.textSecondaryAlphaDark == "00") {
|
|
||||||
binding.secondaryFontColorLabelDark.text = getString(R.string.transparent)
|
|
||||||
} else {
|
|
||||||
binding.secondaryFontColorLabelDark.text =
|
|
||||||
"#%s".format(Integer.toHexString(ColorHelper.getSecondaryFontColor(activity?.isDarkTheme() == true))).toUpperCase()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -204,38 +160,16 @@ class TypographyFragment : Fragment() {
|
|||||||
|
|
||||||
viewModel.textShadowDark.observe(viewLifecycleOwner) {
|
viewModel.textShadowDark.observe(viewLifecycleOwner) {
|
||||||
maintainScrollPosition {
|
maintainScrollPosition {
|
||||||
if (activity?.isDarkTheme() == true) {
|
if (requireActivity().isDarkTheme()) {
|
||||||
binding.textShadowLabelDark.text =
|
binding.textShadowLabelDark.text =
|
||||||
getString(SettingsStringHelper.getTextShadowString(it))
|
getString(SettingsStringHelper.getTextShadowString(it))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
viewModel.customFont.observe(viewLifecycleOwner) {
|
viewModel.font.observe(viewLifecycleOwner) {
|
||||||
maintainScrollPosition {
|
|
||||||
binding.customFontLabel.text = SettingsStringHelper.getCustomFontLabel(requireContext(), it)
|
|
||||||
MainWidget.updateWidget(requireContext())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
viewModel.customFontFile.observe(viewLifecycleOwner) {
|
|
||||||
maintainScrollPosition {
|
maintainScrollPosition {
|
||||||
binding.customFontLabel.text = SettingsStringHelper.getCustomFontLabel(requireContext(), Preferences.customFont)
|
binding.customFontLabel.text = SettingsStringHelper.getCustomFontLabel(requireContext(), Preferences.customFont)
|
||||||
MainWidget.updateWidget(requireContext())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
viewModel.customFontName.observe(viewLifecycleOwner) {
|
|
||||||
maintainScrollPosition {
|
|
||||||
binding.customFontLabel.text = SettingsStringHelper.getCustomFontLabel(requireContext(), Preferences.customFont)
|
|
||||||
MainWidget.updateWidget(requireContext())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
viewModel.customFontVariant.observe(viewLifecycleOwner) {
|
|
||||||
maintainScrollPosition {
|
|
||||||
binding.customFontLabel.text = SettingsStringHelper.getCustomFontLabel(requireContext(), Preferences.customFont)
|
|
||||||
MainWidget.updateWidget(requireContext())
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -273,19 +207,19 @@ class TypographyFragment : Fragment() {
|
|||||||
BottomSheetColorPicker(requireContext(),
|
BottomSheetColorPicker(requireContext(),
|
||||||
colors = colors,
|
colors = colors,
|
||||||
header = getString(R.string.settings_font_color_title),
|
header = getString(R.string.settings_font_color_title),
|
||||||
getSelected = { ColorHelper.getFontColorRgb(activity?.isDarkTheme() == true) },
|
getSelected = { ColorHelper.getFontColorRgb(requireActivity().isDarkTheme()) },
|
||||||
onColorSelected = { color: Int ->
|
onColorSelected = { color: Int ->
|
||||||
val colorString = Integer.toHexString(color)
|
val colorString = Integer.toHexString(color)
|
||||||
if (activity?.isDarkTheme() == true) {
|
if (requireActivity().isDarkTheme()) {
|
||||||
Preferences.textGlobalColorDark = "#" + if (colorString.length > 6) colorString.substring(2) else colorString
|
Preferences.textGlobalColorDark = "#" + if (colorString.length > 6) colorString.substring(2) else colorString
|
||||||
} else {
|
} else {
|
||||||
Preferences.textGlobalColor = "#" + if (colorString.length > 6) colorString.substring(2) else colorString
|
Preferences.textGlobalColor = "#" + if (colorString.length > 6) colorString.substring(2) else colorString
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
showAlphaSelector = true,
|
showAlphaSelector = true,
|
||||||
alpha = if (activity?.isDarkTheme() == true) Preferences.textGlobalAlphaDark.toIntValue() else Preferences.textGlobalAlpha.toIntValue(),
|
alpha = if (requireActivity().isDarkTheme()) Preferences.textGlobalAlphaDark.toIntValue() else Preferences.textGlobalAlpha.toIntValue(),
|
||||||
onAlphaChangeListener = { alpha ->
|
onAlphaChangeListener = { alpha ->
|
||||||
if (activity?.isDarkTheme() == true) {
|
if (requireActivity().isDarkTheme()) {
|
||||||
Preferences.textGlobalAlphaDark = alpha.toHexValue()
|
Preferences.textGlobalAlphaDark = alpha.toHexValue()
|
||||||
} else {
|
} else {
|
||||||
Preferences.textGlobalAlpha = alpha.toHexValue()
|
Preferences.textGlobalAlpha = alpha.toHexValue()
|
||||||
@ -298,10 +232,10 @@ class TypographyFragment : Fragment() {
|
|||||||
BottomSheetColorPicker(requireContext(),
|
BottomSheetColorPicker(requireContext(),
|
||||||
colors = colors,
|
colors = colors,
|
||||||
header = getString(R.string.settings_secondary_font_color_title),
|
header = getString(R.string.settings_secondary_font_color_title),
|
||||||
getSelected = { ColorHelper.getSecondaryFontColorRgb(activity?.isDarkTheme() == true) },
|
getSelected = { ColorHelper.getSecondaryFontColorRgb(requireActivity().isDarkTheme()) },
|
||||||
onColorSelected = { color: Int ->
|
onColorSelected = { color: Int ->
|
||||||
val colorString = Integer.toHexString(color)
|
val colorString = Integer.toHexString(color)
|
||||||
if (activity?.isDarkTheme() == true) {
|
if (requireActivity().isDarkTheme()) {
|
||||||
Preferences.textSecondaryColorDark =
|
Preferences.textSecondaryColorDark =
|
||||||
"#" + if (colorString.length > 6) colorString.substring(2) else colorString
|
"#" + if (colorString.length > 6) colorString.substring(2) else colorString
|
||||||
} else {
|
} else {
|
||||||
@ -310,9 +244,9 @@ class TypographyFragment : Fragment() {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
showAlphaSelector = true,
|
showAlphaSelector = true,
|
||||||
alpha = if (activity?.isDarkTheme() == true) Preferences.textSecondaryAlphaDark.toIntValue() else Preferences.textSecondaryAlpha.toIntValue(),
|
alpha = if (requireActivity().isDarkTheme()) Preferences.textSecondaryAlphaDark.toIntValue() else Preferences.textSecondaryAlpha.toIntValue(),
|
||||||
onAlphaChangeListener = { alpha ->
|
onAlphaChangeListener = { alpha ->
|
||||||
if (activity?.isDarkTheme() == true) {
|
if (requireActivity().isDarkTheme()) {
|
||||||
Preferences.textSecondaryAlphaDark = alpha.toHexValue()
|
Preferences.textSecondaryAlphaDark = alpha.toHexValue()
|
||||||
} else {
|
} else {
|
||||||
Preferences.textSecondaryAlpha = alpha.toHexValue()
|
Preferences.textSecondaryAlpha = alpha.toHexValue()
|
||||||
@ -322,12 +256,12 @@ class TypographyFragment : Fragment() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
binding.actionTextShadow.setOnClickListener {
|
binding.actionTextShadow.setOnClickListener {
|
||||||
val dialog = BottomSheetMenu<Int>(requireContext(), header = getString(R.string.title_text_shadow)).setSelectedValue(if (activity?.isDarkTheme() == true) Preferences.textShadowDark else Preferences.textShadow)
|
val dialog = BottomSheetMenu<Int>(requireContext(), header = getString(R.string.title_text_shadow)).setSelectedValue(if (requireActivity().isDarkTheme()) Preferences.textShadowDark else Preferences.textShadow)
|
||||||
(2 downTo 0).forEach {
|
(2 downTo 0).forEach {
|
||||||
dialog.addItem(getString(SettingsStringHelper.getTextShadowString(it)), it)
|
dialog.addItem(getString(SettingsStringHelper.getTextShadowString(it)), it)
|
||||||
}
|
}
|
||||||
dialog.addOnSelectItemListener { value ->
|
dialog.addOnSelectItemListener { value ->
|
||||||
if (activity?.isDarkTheme() == true) {
|
if (requireActivity().isDarkTheme()) {
|
||||||
Preferences.textShadowDark = value
|
Preferences.textShadowDark = value
|
||||||
} else {
|
} else {
|
||||||
Preferences.textShadow = value
|
Preferences.textShadow = value
|
||||||
|
@ -7,26 +7,41 @@ import com.tommasoberlose.anotherwidget.global.Preferences
|
|||||||
class MainViewModel : ViewModel() {
|
class MainViewModel : ViewModel() {
|
||||||
|
|
||||||
// General Settings
|
// General Settings
|
||||||
val textGlobalColor = Preferences.asLiveData(Preferences::textGlobalColor)
|
val textGlobalColor = MediatorLiveData<Boolean>().apply {
|
||||||
val textGlobalAlpha = Preferences.asLiveData(Preferences::textGlobalAlpha)
|
addSource(Preferences.asLiveData(Preferences::textGlobalColor)) { value = true }
|
||||||
val textSecondaryColor = Preferences.asLiveData(Preferences::textSecondaryColor)
|
addSource(Preferences.asLiveData(Preferences::textGlobalAlpha)) { value = true }
|
||||||
val textSecondaryAlpha = Preferences.asLiveData(Preferences::textSecondaryAlpha)
|
}
|
||||||
val backgroundCardColor = Preferences.asLiveData(Preferences::backgroundCardColor)
|
val textSecondaryColor = MediatorLiveData<Boolean>().apply {
|
||||||
val backgroundCardAlpha = Preferences.asLiveData(Preferences::backgroundCardAlpha)
|
addSource(Preferences.asLiveData(Preferences::textSecondaryColor)) { value = true }
|
||||||
val textGlobalColorDark = Preferences.asLiveData(Preferences::textGlobalColorDark)
|
addSource(Preferences.asLiveData(Preferences::textSecondaryAlpha)) { value = true }
|
||||||
val textGlobalAlphaDark = Preferences.asLiveData(Preferences::textGlobalAlphaDark)
|
}
|
||||||
val textSecondaryColorDark = Preferences.asLiveData(Preferences::textSecondaryColorDark)
|
val backgroundCardColor = MediatorLiveData<Boolean>().apply {
|
||||||
val textSecondaryAlphaDark = Preferences.asLiveData(Preferences::textSecondaryAlphaDark)
|
addSource(Preferences.asLiveData(Preferences::backgroundCardColor)) { value = true }
|
||||||
val backgroundCardColorDark = Preferences.asLiveData(Preferences::backgroundCardColorDark)
|
addSource(Preferences.asLiveData(Preferences::backgroundCardAlpha)) { value = true }
|
||||||
val backgroundCardAlphaDark = Preferences.asLiveData(Preferences::backgroundCardAlphaDark)
|
}
|
||||||
|
val textGlobalColorDark = MediatorLiveData<Boolean>().apply {
|
||||||
|
addSource(Preferences.asLiveData(Preferences::textGlobalColorDark)) { value = true }
|
||||||
|
addSource(Preferences.asLiveData(Preferences::textGlobalAlphaDark)) { value = true }
|
||||||
|
}
|
||||||
|
val textSecondaryColorDark = MediatorLiveData<Boolean>().apply {
|
||||||
|
addSource(Preferences.asLiveData(Preferences::textSecondaryColorDark)) { value = true }
|
||||||
|
addSource(Preferences.asLiveData(Preferences::textSecondaryAlphaDark)) { value = true }
|
||||||
|
}
|
||||||
|
val backgroundCardColorDark = MediatorLiveData<Boolean>().apply {
|
||||||
|
addSource(Preferences.asLiveData(Preferences::backgroundCardColorDark)) { value = true }
|
||||||
|
addSource(Preferences.asLiveData(Preferences::backgroundCardAlphaDark)) { value = true }
|
||||||
|
}
|
||||||
val textMainSize = Preferences.asLiveData(Preferences::textMainSize)
|
val textMainSize = Preferences.asLiveData(Preferences::textMainSize)
|
||||||
val textSecondSize = Preferences.asLiveData(Preferences::textSecondSize)
|
val textSecondSize = Preferences.asLiveData(Preferences::textSecondSize)
|
||||||
val textShadow = Preferences.asLiveData(Preferences::textShadow)
|
val textShadow = Preferences.asLiveData(Preferences::textShadow)
|
||||||
val textShadowDark = Preferences.asLiveData(Preferences::textShadowDark)
|
val textShadowDark = Preferences.asLiveData(Preferences::textShadowDark)
|
||||||
val customFont = Preferences.asLiveData(Preferences::customFont)
|
val font = MediatorLiveData<Boolean>().apply {
|
||||||
val customFontFile = Preferences.asLiveData(Preferences::customFontFile)
|
addSource(Preferences.asLiveData(Preferences::customFont)) { value = true }
|
||||||
val customFontName = Preferences.asLiveData(Preferences::customFontName)
|
addSource(Preferences.asLiveData(Preferences::customFontFile)) { value = true }
|
||||||
val customFontVariant = Preferences.asLiveData(Preferences::customFontVariant)
|
addSource(Preferences.asLiveData(Preferences::customFontName)) { value = true }
|
||||||
|
addSource(Preferences.asLiveData(Preferences::customFontVariant)) { value = true }
|
||||||
|
}
|
||||||
|
|
||||||
val secondRowInformation = Preferences.asLiveData(Preferences::secondRowInformation)
|
val secondRowInformation = Preferences.asLiveData(Preferences::secondRowInformation)
|
||||||
val showDividers = Preferences.asLiveData(Preferences::showDividers)
|
val showDividers = Preferences.asLiveData(Preferences::showDividers)
|
||||||
val secondRowTopMargin = Preferences.asLiveData(Preferences::secondRowTopMargin)
|
val secondRowTopMargin = Preferences.asLiveData(Preferences::secondRowTopMargin)
|
||||||
@ -36,52 +51,42 @@ class MainViewModel : ViewModel() {
|
|||||||
val calendarAllDay = Preferences.asLiveData(Preferences::calendarAllDay)
|
val calendarAllDay = Preferences.asLiveData(Preferences::calendarAllDay)
|
||||||
val showUntil = Preferences.asLiveData(Preferences::showUntil)
|
val showUntil = Preferences.asLiveData(Preferences::showUntil)
|
||||||
val showDiffTime = Preferences.asLiveData(Preferences::showDiffTime)
|
val showDiffTime = Preferences.asLiveData(Preferences::showDiffTime)
|
||||||
val showDeclinedEvents = Preferences.asLiveData(Preferences::showDeclinedEvents)
|
|
||||||
val showNextEvent = Preferences.asLiveData(Preferences::showNextEvent)
|
val showNextEvent = Preferences.asLiveData(Preferences::showNextEvent)
|
||||||
val openEventDetails = Preferences.asLiveData(Preferences::openEventDetails)
|
val openEventDetails = Preferences.asLiveData(Preferences::openEventDetails)
|
||||||
val calendarAppName = Preferences.asLiveData(Preferences::calendarAppName)
|
val calendarAppName = Preferences.asLiveData(Preferences::calendarAppName)
|
||||||
val widgetUpdateFrequency = Preferences.asLiveData(Preferences::widgetUpdateFrequency)
|
val widgetUpdateFrequency = Preferences.asLiveData(Preferences::widgetUpdateFrequency)
|
||||||
val showOnlyBusyEvents = Preferences.asLiveData(Preferences::showOnlyBusyEvents)
|
|
||||||
|
|
||||||
// Clock Settings
|
// Clock Settings
|
||||||
val showClock = Preferences.asLiveData(Preferences::showClock)
|
val showClock = Preferences.asLiveData(Preferences::showClock)
|
||||||
val clockTextSize = Preferences.asLiveData(Preferences::clockTextSize)
|
val clockTextSize = Preferences.asLiveData(Preferences::clockTextSize)
|
||||||
val clockTextColor = Preferences.asLiveData(Preferences::clockTextColor)
|
val clockTextColor = MediatorLiveData<Boolean>().apply {
|
||||||
val clockTextAlpha = Preferences.asLiveData(Preferences::clockTextAlpha)
|
addSource(Preferences.asLiveData(Preferences::clockTextColor)) { value = true }
|
||||||
val clockTextColorDark = Preferences.asLiveData(Preferences::clockTextColorDark)
|
addSource(Preferences.asLiveData(Preferences::clockTextAlpha)) { value = true }
|
||||||
val clockTextAlphaDark = Preferences.asLiveData(Preferences::clockTextAlphaDark)
|
}
|
||||||
|
val clockTextColorDark = MediatorLiveData<Boolean>().apply {
|
||||||
|
addSource(Preferences.asLiveData(Preferences::clockTextColorDark)) { value = true }
|
||||||
|
addSource(Preferences.asLiveData(Preferences::clockTextAlphaDark)) { value = true }
|
||||||
|
}
|
||||||
val showAMPMIndicator = Preferences.asLiveData(Preferences::showAMPMIndicator)
|
val showAMPMIndicator = Preferences.asLiveData(Preferences::showAMPMIndicator)
|
||||||
|
|
||||||
val clockAppName = Preferences.asLiveData(Preferences::clockAppName)
|
val clockAppName = Preferences.asLiveData(Preferences::clockAppName)
|
||||||
val dateFormat = Preferences.asLiveData(Preferences::dateFormat)
|
val dateFormat = Preferences.asLiveData(Preferences::dateFormat)
|
||||||
val clockBottomMargin = Preferences.asLiveData(Preferences::clockBottomMargin)
|
val clockBottomMargin = Preferences.asLiveData(Preferences::clockBottomMargin)
|
||||||
|
|
||||||
val showBigClockWarning = Preferences.asLiveData(Preferences::showBigClockWarning)
|
|
||||||
|
|
||||||
// Weather Settings
|
// Weather Settings
|
||||||
val showWeather = Preferences.asLiveData(Preferences::showWeather)
|
val showWeather = Preferences.asLiveData(Preferences::showWeather)
|
||||||
val weatherTempUnit = Preferences.asLiveData(Preferences::weatherTempUnit)
|
val weatherTempUnit = Preferences.asLiveData(Preferences::weatherTempUnit)
|
||||||
val weatherRefreshPeriod = Preferences.asLiveData(Preferences::weatherRefreshPeriod)
|
val weatherRefreshPeriod = Preferences.asLiveData(Preferences::weatherRefreshPeriod)
|
||||||
|
|
||||||
val weatherAppName = Preferences.asLiveData(Preferences::weatherAppName)
|
val weatherAppName = Preferences.asLiveData(Preferences::weatherAppName)
|
||||||
val weatherProviderApi = Preferences.asLiveData(Preferences::weatherProviderApiOpen)
|
|
||||||
|
|
||||||
val customLocationAdd = Preferences.asLiveData(Preferences::customLocationAdd)
|
val customLocationAdd = Preferences.asLiveData(Preferences::customLocationAdd)
|
||||||
|
|
||||||
val showWeatherWarning = Preferences.asLiveData(Preferences::showWeatherWarning)
|
|
||||||
val weatherIconPack = Preferences.asLiveData(Preferences::weatherIconPack)
|
val weatherIconPack = Preferences.asLiveData(Preferences::weatherIconPack)
|
||||||
val weatherProvider = Preferences.asLiveData(Preferences::weatherProvider)
|
val weatherProvider = Preferences.asLiveData(Preferences::weatherProvider)
|
||||||
val weatherProviderError = Preferences.asLiveData(Preferences::weatherProviderError)
|
val weatherProviderError = Preferences.asLiveData(Preferences::weatherProviderError)
|
||||||
val weatherProviderLocationError = Preferences.asLiveData(Preferences::weatherProviderLocationError)
|
val weatherProviderLocationError = Preferences.asLiveData(Preferences::weatherProviderLocationError)
|
||||||
|
|
||||||
// Glance
|
|
||||||
val showMusic = Preferences.asLiveData(Preferences::showMusic)
|
|
||||||
val showNextAlarm = Preferences.asLiveData(Preferences::showNextAlarm)
|
|
||||||
val showBatteryCharging = Preferences.asLiveData(Preferences::showBatteryCharging)
|
|
||||||
val showDailySteps = Preferences.asLiveData(Preferences::showDailySteps)
|
|
||||||
val customInfo = Preferences.asLiveData(Preferences::customNotes)
|
|
||||||
val musicPlayersFilter = Preferences.asLiveData(Preferences::musicPlayersFilter)
|
|
||||||
|
|
||||||
// Advanced Settings
|
// Advanced Settings
|
||||||
val darkThemePreference = Preferences.asLiveData(Preferences::darkThemePreference)
|
val darkThemePreference = Preferences.asLiveData(Preferences::darkThemePreference)
|
||||||
val showWallpaper = Preferences.asLiveData(Preferences::showWallpaper)
|
val showWallpaper = Preferences.asLiveData(Preferences::showWallpaper)
|
||||||
|
@ -4,13 +4,13 @@
|
|||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="?android:attr/colorPrimaryDark"
|
android:background="?android:attr/colorPrimary"
|
||||||
tools:context=".ui.activities.MainActivity">
|
tools:context=".ui.activities.MainActivity">
|
||||||
<androidx.fragment.app.FragmentContainerView
|
<androidx.fragment.app.FragmentContainerView
|
||||||
android:id="@+id/content_fragment"
|
android:id="@+id/content_fragment"
|
||||||
android:name="androidx.navigation.fragment.NavHostFragment"
|
android:name="androidx.navigation.fragment.NavHostFragment"
|
||||||
app:defaultNavHost="true"
|
app:defaultNavHost="true"
|
||||||
android:background="@color/colorPrimaryDark"
|
android:background="@color/colorPrimary"
|
||||||
app:navGraph="@navigation/nav_graph"
|
app:navGraph="@navigation/nav_graph"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"/>
|
android:layout_height="match_parent"/>
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
app:cardElevation="4dp"
|
app:cardElevation="0dp"
|
||||||
app:cardCornerRadius="0dp"
|
app:cardCornerRadius="0dp"
|
||||||
android:id="@+id/toolbar"
|
android:id="@+id/toolbar"
|
||||||
android:transitionName="toolbar"
|
android:transitionName="toolbar"
|
||||||
@ -32,6 +32,7 @@
|
|||||||
android:src="@drawable/round_arrow_back_24"
|
android:src="@drawable/round_arrow_back_24"
|
||||||
android:clickable="true"
|
android:clickable="true"
|
||||||
android:focusable="true"
|
android:focusable="true"
|
||||||
|
android:transitionName="action_back"
|
||||||
android:background="?attr/selectableItemBackgroundBorderless"
|
android:background="?attr/selectableItemBackgroundBorderless"
|
||||||
app:tint="@color/colorPrimaryText"
|
app:tint="@color/colorPrimaryText"
|
||||||
android:layout_centerVertical="true"
|
android:layout_centerVertical="true"
|
||||||
@ -51,9 +52,9 @@
|
|||||||
android:text="@string/app_name"
|
android:text="@string/app_name"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
android:transitionName="title"
|
|
||||||
android:id="@+id/fragment_title"
|
android:id="@+id/fragment_title"
|
||||||
android:layout_marginBottom="1dp"
|
android:transitionName="fragment_title"
|
||||||
|
android:layout_marginBottom="6dp"
|
||||||
style="@style/AnotherWidget.Main.Title"/>
|
style="@style/AnotherWidget.Main.Title"/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
<ImageView
|
<ImageView
|
||||||
@ -76,10 +77,8 @@
|
|||||||
android:id="@+id/preview"
|
android:id="@+id/preview"
|
||||||
android:animateLayoutChanges="true"
|
android:animateLayoutChanges="true"
|
||||||
app:cardBackgroundColor="@color/colorPrimary"
|
app:cardBackgroundColor="@color/colorPrimary"
|
||||||
android:layout_marginRight="16dp"
|
|
||||||
android:layout_marginLeft="16dp"
|
|
||||||
android:layout_marginBottom="4dp"
|
android:layout_marginBottom="4dp"
|
||||||
app:cardCornerRadius="9dp"
|
app:cardCornerRadius="0dp"
|
||||||
app:cardElevation="0dp">
|
app:cardElevation="0dp">
|
||||||
<androidx.appcompat.widget.AppCompatImageView
|
<androidx.appcompat.widget.AppCompatImageView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@ -110,11 +109,6 @@
|
|||||||
android:id="@+id/widget_loader" />
|
android:id="@+id/widget_loader" />
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
</com.google.android.material.card.MaterialCardView>
|
</com.google.android.material.card.MaterialCardView>
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="16dp"
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:id="@+id/bottom_padding" />
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</com.google.android.material.card.MaterialCardView>
|
</com.google.android.material.card.MaterialCardView>
|
||||||
<com.google.android.material.card.MaterialCardView
|
<com.google.android.material.card.MaterialCardView
|
||||||
@ -125,7 +119,7 @@
|
|||||||
app:cardElevation="0dp"
|
app:cardElevation="0dp"
|
||||||
app:cardPreventCornerOverlap="true"
|
app:cardPreventCornerOverlap="true"
|
||||||
app:cardCornerRadius="0dp"
|
app:cardCornerRadius="0dp"
|
||||||
app:cardBackgroundColor="@color/colorPrimaryDark"
|
app:cardBackgroundColor="@color/colorPrimary"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
<androidx.fragment.app.FragmentContainerView
|
<androidx.fragment.app.FragmentContainerView
|
||||||
android:id="@+id/settings_fragment"
|
android:id="@+id/settings_fragment"
|
||||||
|
@ -16,24 +16,26 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="56dp"
|
android:layout_height="56dp"
|
||||||
app:cardBackgroundColor="@color/colorPrimary"
|
app:cardBackgroundColor="@color/colorPrimary"
|
||||||
app:cardElevation="2dp"
|
app:cardElevation="0dp"
|
||||||
app:cardCornerRadius="0dp"
|
app:cardCornerRadius="0dp"
|
||||||
android:background="@color/colorPrimary"
|
android:background="@color/colorPrimary"
|
||||||
android:transitionName="toolbar"
|
android:transitionName="toolbar"
|
||||||
android:id="@+id/toolbar">
|
android:id="@+id/toolbar">
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="56dp">
|
android:layout_height="56dp"
|
||||||
|
android:gravity="center_vertical">
|
||||||
<ImageView
|
<ImageView
|
||||||
android:layout_width="48dp"
|
android:layout_width="48dp"
|
||||||
android:layout_height="48dp"
|
android:layout_height="48dp"
|
||||||
android:padding="12dp"
|
android:padding="12dp"
|
||||||
android:layout_marginTop="2dp"
|
android:layout_marginTop="4dp"
|
||||||
android:src="@drawable/round_arrow_back_24"
|
android:src="@drawable/round_arrow_back_24"
|
||||||
app:tint="@color/colorPrimaryText"
|
app:tint="@color/colorPrimaryText"
|
||||||
android:layout_centerVertical="true"
|
android:layout_centerVertical="true"
|
||||||
android:clickable="true"
|
android:clickable="true"
|
||||||
android:focusable="true"
|
android:focusable="true"
|
||||||
|
android:transitionName="action_back"
|
||||||
android:layout_marginEnd="8dp"
|
android:layout_marginEnd="8dp"
|
||||||
android:layout_alignParentLeft="true"
|
android:layout_alignParentLeft="true"
|
||||||
android:layout_marginStart="8dp"
|
android:layout_marginStart="8dp"
|
||||||
@ -46,7 +48,8 @@
|
|||||||
android:text="@string/settings_title"
|
android:text="@string/settings_title"
|
||||||
android:textColor="@color/colorPrimaryText"
|
android:textColor="@color/colorPrimaryText"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:transitionName="settings_title"
|
android:paddingBottom="6dp"
|
||||||
|
android:transitionName="fragment_title"
|
||||||
android:textAppearance="@style/AnotherWidget.Main.Title"
|
android:textAppearance="@style/AnotherWidget.Main.Title"
|
||||||
tools:ignore="RelativeOverlap" />
|
tools:ignore="RelativeOverlap" />
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
@ -56,13 +59,13 @@
|
|||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:id="@+id/scrollView"
|
android:id="@+id/scrollView"
|
||||||
android:scrollbarThumbVertical="@color/colorPrimary"
|
android:scrollbarThumbVertical="@color/colorPrimary"
|
||||||
android:background="@color/colorPrimaryDark">
|
android:background="@color/colorPrimary">
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:paddingTop="8dp"
|
android:paddingTop="8dp"
|
||||||
android:paddingBottom="8dp">
|
android:paddingBottom="48dp">
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:paddingTop="8dp"
|
android:paddingTop="8dp"
|
||||||
android:paddingBottom="8dp"
|
android:paddingBottom="48dp"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:paddingTop="8dp"
|
android:paddingTop="8dp"
|
||||||
android:paddingBottom="8dp"
|
android:paddingBottom="48dp"
|
||||||
android:focusable="true"
|
android:focusable="true"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:paddingTop="8dp"
|
android:paddingTop="8dp"
|
||||||
android:paddingBottom="8dp"
|
android:paddingBottom="48dp"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:paddingTop="8dp"
|
android:paddingTop="8dp"
|
||||||
android:paddingBottom="8dp"
|
android:paddingBottom="48dp"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:paddingTop="8dp"
|
android:paddingTop="8dp"
|
||||||
android:paddingBottom="8dp"
|
android:paddingBottom="48dp"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:paddingTop="8dp"
|
android:paddingTop="8dp"
|
||||||
android:paddingBottom="8dp"
|
android:paddingBottom="48dp"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:paddingTop="8dp"
|
android:paddingTop="8dp"
|
||||||
android:paddingBottom="8dp"
|
android:paddingBottom="48dp"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
android:layout_marginRight="16dp"
|
android:layout_marginRight="16dp"
|
||||||
app:strokeColor="@color/cardBorder"
|
app:strokeColor="@color/cardBorder"
|
||||||
android:foreground="?android:attr/selectableItemBackground"
|
android:foreground="?android:attr/selectableItemBackground"
|
||||||
app:cardBackgroundColor="@color/colorPrimaryDark"
|
app:cardBackgroundColor="@color/colorPrimary"
|
||||||
app:cardCornerRadius="8dp">
|
app:cardCornerRadius="8dp">
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
<fragment
|
<fragment
|
||||||
android:id="@+id/generalTabFragment"
|
android:id="@+id/generalTabFragment"
|
||||||
android:name="com.tommasoberlose.anotherwidget.ui.fragments.tabs.LayoutFragment"
|
android:name="com.tommasoberlose.anotherwidget.ui.fragments.tabs.LayoutFragment"
|
||||||
android:label="GeneralTabFragment" />
|
android:label="@string/layout_settings_title" />
|
||||||
<fragment
|
<fragment
|
||||||
android:id="@+id/weatherTabFragment"
|
android:id="@+id/weatherTabFragment"
|
||||||
android:name="com.tommasoberlose.anotherwidget.ui.fragments.tabs.WeatherFragment"
|
android:name="com.tommasoberlose.anotherwidget.ui.fragments.tabs.WeatherFragment"
|
||||||
@ -52,9 +52,9 @@
|
|||||||
<fragment
|
<fragment
|
||||||
android:id="@+id/typographyTabFragment"
|
android:id="@+id/typographyTabFragment"
|
||||||
android:name="com.tommasoberlose.anotherwidget.ui.fragments.tabs.TypographyFragment"
|
android:name="com.tommasoberlose.anotherwidget.ui.fragments.tabs.TypographyFragment"
|
||||||
android:label="TypographyTabFragment" />
|
android:label="@string/typography_settings_title" />
|
||||||
<fragment
|
<fragment
|
||||||
android:id="@+id/gesturesFragment"
|
android:id="@+id/gesturesFragment"
|
||||||
android:name="com.tommasoberlose.anotherwidget.ui.fragments.tabs.GesturesFragment"
|
android:name="com.tommasoberlose.anotherwidget.ui.fragments.tabs.GesturesFragment"
|
||||||
android:label="GesturesFragment" />
|
android:label="@string/gestures_settings_title" />
|
||||||
</navigation>
|
</navigation>
|
Loading…
x
Reference in New Issue
Block a user