Add material colors, fix text font size, fix missing intents

This commit is contained in:
Tommaso Berlose 2020-05-04 02:27:13 +02:00
parent 55b3a02da5
commit 864978e5d3
39 changed files with 55 additions and 18 deletions

Binary file not shown.

View File

@ -18,8 +18,8 @@ android {
applicationId "com.tommasoberlose.anotherwidget"
minSdkVersion 23
targetSdkVersion 29
versionCode 54
versionName "2.0.3"
versionCode 58
versionName "2.0.4"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
@ -43,6 +43,7 @@ android {
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8.toString()
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
}

BIN
app/release/app-release.aab Normal file

Binary file not shown.

View File

@ -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)

View File

@ -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()
}

View File

@ -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)

View File

@ -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 ->

View File

@ -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 ->

View File

@ -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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 226 B

After

Width:  |  Height:  |  Size: 189 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 160 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 250 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 225 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 165 B

After

Width:  |  Height:  |  Size: 111 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 128 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 189 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 167 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 271 B

After

Width:  |  Height:  |  Size: 167 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 189 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 225 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 271 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 390 B

After

Width:  |  Height:  |  Size: 225 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 250 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 400 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 392 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 478 B

After

Width:  |  Height:  |  Size: 271 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 225 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 392 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 478 B

View File

@ -44,6 +44,17 @@
android:text="@string/action_choose_application"
android:gravity="center"
style="@style/AnotherWidget.Main.Title"/>
<androidx.appcompat.widget.AppCompatImageView
android:layout_width="48dp"
android:layout_height="48dp"
android:padding="10dp"
android:background="?attr/selectableItemBackgroundBorderless"
android:layout_centerVertical="true"
android:id="@+id/action_filter"
android:layout_alignParentRight="true"
android:visibility="gone"
android:tint="@color/colorPrimaryText"
android:src="@drawable/round_filter_list" />
</RelativeLayout>
</com.google.android.material.card.MaterialCardView>
<com.google.android.material.card.MaterialCardView

View File

@ -12,6 +12,12 @@ android {
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}

View File

@ -3,8 +3,8 @@
xmlns:dist="http://schemas.android.com/apk/distribution"
featureSplit="tasksintegration"
package="com.tommasoberlose.anotherwidget"
android:versionCode="54"
android:versionName="2.0.3" >
android:versionCode="56"
android:versionName="2.0.4" >
<uses-sdk
android:minSdkVersion="23"

View File

@ -1 +1 @@
#Sun May 03 20:05:32 CEST 2020
#Mon May 04 02:02:08 CEST 2020

View File

@ -1,4 +1,4 @@
#Sun May 03 21:21:10 CEST 2020
#Mon May 04 02:19:12 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,8 +4,8 @@
featureSplit="tasksintegration"
package="com.tommasoberlose.anotherwidget"
android:targetSandboxVersion="2"
android:versionCode="54"
android:versionName="2.0.3" >
android:versionCode="56"
android:versionName="2.0.4" >
<uses-sdk
android:minSdkVersion="23"

View File

@ -3,8 +3,8 @@
3 xmlns:dist="http://schemas.android.com/apk/distribution"
4 featureSplit="tasksintegration"
5 package="com.tommasoberlose.anotherwidget"
6 android:versionCode="54"
7 android:versionName="2.0.3" >
6 android:versionCode="56"
7 android:versionName="2.0.4" >
8
9 <uses-sdk
10 android:minSdkVersion="23"

View File

@ -3,8 +3,8 @@
xmlns:dist="http://schemas.android.com/apk/distribution"
featureSplit="tasksintegration"
package="com.tommasoberlose.anotherwidget"
android:versionCode="54"
android:versionName="2.0.3" >
android:versionCode="56"
android:versionName="2.0.4" >
<uses-sdk
android:minSdkVersion="23"

View File

@ -3,8 +3,8 @@
xmlns:dist="http://schemas.android.com/apk/distribution"
featureSplit="tasksintegration"
package="com.tommasoberlose.anotherwidget"
android:versionCode="54"
android:versionName="2.0.3" >
android:versionCode="56"
android:versionName="2.0.4" >
<uses-sdk android:targetSdkVersion="29" />