Add material colors, fix text font size, fix missing intents
This commit is contained in:
@ -3,6 +3,7 @@ package com.tommasoberlose.anotherwidget
|
||||
import android.app.Application
|
||||
import androidx.appcompat.app.AppCompatDelegate
|
||||
import com.chibatching.kotpref.Kotpref
|
||||
import com.google.firebase.crashlytics.FirebaseCrashlytics
|
||||
import com.tommasoberlose.anotherwidget.global.Preferences
|
||||
import io.realm.Realm
|
||||
import io.realm.RealmConfiguration
|
||||
@ -11,6 +12,9 @@ class AWApplication : Application() {
|
||||
override fun onCreate() {
|
||||
super.onCreate()
|
||||
|
||||
// Firebase crashlitycs
|
||||
FirebaseCrashlytics.getInstance().setCrashlyticsCollectionEnabled(!BuildConfig.DEBUG)
|
||||
|
||||
// Preferences
|
||||
Kotpref.init(this)
|
||||
|
||||
|
@ -6,6 +6,7 @@ import com.tommasoberlose.anotherwidget.R
|
||||
import android.content.Intent
|
||||
import android.content.pm.ApplicationInfo
|
||||
import android.content.pm.ResolveInfo
|
||||
import android.util.Log
|
||||
import android.view.View
|
||||
import android.widget.ImageView
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
@ -111,18 +112,26 @@ class ChooseApplicationActivity : AppCompatActivity() {
|
||||
|
||||
}
|
||||
})
|
||||
|
||||
// viewModel.filterSettingsApp.observe(this, Observer {
|
||||
// action_filter.alpha = if (it) 1f else 0.5f
|
||||
// })
|
||||
}
|
||||
|
||||
private fun setupListener() {
|
||||
action_back.setOnClickListener {
|
||||
onBackPressed()
|
||||
}
|
||||
|
||||
// action_filter.setOnClickListener {
|
||||
// viewModel.toggleFilter()
|
||||
// }
|
||||
}
|
||||
|
||||
private fun saveApp(app: ResolveInfo) {
|
||||
val resultIntent = Intent()
|
||||
resultIntent.putExtra(Constants.RESULT_APP_NAME, app.loadLabel(pm))
|
||||
resultIntent.putExtra(Constants.RESULT_APP_PACKAGE, app.resolvePackageName)
|
||||
resultIntent.putExtra(Constants.RESULT_APP_PACKAGE, app.activityInfo.packageName)
|
||||
setResult(Activity.RESULT_OK, resultIntent)
|
||||
finish()
|
||||
}
|
||||
|
@ -148,6 +148,11 @@ class MainActivity : AppCompatActivity(), SharedPreferences.OnSharedPreferenceCh
|
||||
preview.layoutParams = layoutParams
|
||||
}
|
||||
}.start()
|
||||
} else {
|
||||
clock.layoutParams = clock.layoutParams.apply {
|
||||
height = RelativeLayout.LayoutParams.WRAP_CONTENT
|
||||
}
|
||||
clock.measure(0, 0)
|
||||
}
|
||||
|
||||
widget_bitmap.setImageBitmap(bitmap)
|
||||
|
@ -108,7 +108,7 @@ class ClockSettingsFragment : Fragment() {
|
||||
|
||||
action_clock_text_size.setOnClickListener {
|
||||
val dialog = BottomSheetMenu<Float>(requireContext(), header = getString(R.string.settings_clock_text_size_title)).setSelectedValue(Preferences.clockTextSize)
|
||||
(46 downTo 28).filter { it % 2 == 0 }.forEach {
|
||||
(46 downTo 12).filter { it % 2 == 0 }.forEach {
|
||||
dialog.addItem("${it}sp", it.toFloat())
|
||||
}
|
||||
dialog.addOnSelectItemListener { value ->
|
||||
|
@ -123,7 +123,7 @@ class GeneralSettingsFragment : Fragment() {
|
||||
private fun setupListener() {
|
||||
action_main_text_size.setOnClickListener {
|
||||
val dialog = BottomSheetMenu<Float>(requireContext(), header = getString(R.string.title_main_text_size)).setSelectedValue(Preferences.textMainSize)
|
||||
(32 downTo 20).filter { it % 2 == 0 }.forEach {
|
||||
(32 downTo 10).filter { it % 2 == 0 }.forEach {
|
||||
dialog.addItem("${it}sp", it.toFloat())
|
||||
}
|
||||
dialog.addOnSelectItemListener { value ->
|
||||
@ -133,7 +133,7 @@ class GeneralSettingsFragment : Fragment() {
|
||||
|
||||
action_second_text_size.setOnClickListener {
|
||||
val dialog = BottomSheetMenu<Float>(requireContext(), header = getString(R.string.title_second_text_size)).setSelectedValue(Preferences.textSecondSize)
|
||||
(24 downTo 12).filter { it % 2 == 0 }.forEach {
|
||||
(28 downTo 10).filter { it % 2 == 0 }.forEach {
|
||||
dialog.addItem("${it}sp", it.toFloat())
|
||||
}
|
||||
dialog.addOnSelectItemListener { value ->
|
||||
|
@ -4,6 +4,7 @@ import android.Manifest
|
||||
import android.app.Activity
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import android.util.Log
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
|
Reference in New Issue
Block a user