Compare commits

...

7 Commits

Author SHA1 Message Date
69b5ed3a6d Merge branch 'hotfix/2.1.2' 2023-05-27 15:38:27 -05:00
8b2adbf301 GH Actions: Remove API 23 2023-05-27 13:26:11 -05:00
88cc3a2a12 Update CHANGELOG 2023-05-26 20:12:06 -05:00
26526a71a9 Update test screenshots 2023-05-26 19:56:01 -05:00
11eb3713e5 Reschedule reminders on resume 2023-05-26 19:55:53 -05:00
1df9cc7664 Widgets: Remove option to create StackWidgets
StackWidgets have been unfortunately been very unreliable on multiple phones,
and fixing it does not appear to be simple. This commit removes the ability
to create new StackWidgets, but existing ones should remain functional.
2023-05-01 18:52:53 -05:00
b76da35752 Widgets: Increase corner radius to match Android 12 2023-03-24 05:24:58 -05:00
17 changed files with 28 additions and 28 deletions

View File

@@ -17,7 +17,7 @@ jobs:
run: ./build.sh build run: ./build.sh build
- name: Run Android tests - name: Run Android tests
run: ./build.sh android-tests-parallel 23 24 25 26 28 30 31 run: ./build.sh android-tests-parallel 24 25 26 28 30 31
- name: Upload artifacts - name: Upload artifacts
if: always() if: always()

View File

@@ -1,5 +1,20 @@
# Changelog # Changelog
## [2.1.2] -- 2023-05-26
### Fixed
- Fix bug that caused widget to enter checkmark on wrong date (@iSoron, #1541)
- Fix widget corners on Android 12 (@iSoron)
- Fix bug that caused notes to be lost when editing a checkmark (@iSoron, #1566)
- Prevent soft keyboard from covering entry popup (@iSoron)
- Accept comma (instead of dot) in certain locales (@iSoron)
### Changed
- Remove update delay after entering a checkmark (@iSoron)
### Removed
- Remove stack widgets (@iSoron)
## [2.1.1] -- 2022-09-24 ## [2.1.1] -- 2022-09-24
### Fixed ### Fixed
- Fix Tasker plugin (@iSoron, #1503) - Fix Tasker plugin (@iSoron, #1503)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.6 KiB

After

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.9 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 16 KiB

View File

@@ -36,6 +36,7 @@ class CheckmarkWidgetViewTest : BaseViewTest() {
@Before @Before
override fun setUp() { override fun setUp() {
super.setUp() super.setUp()
similarityCutoff = 0.00025
setTheme(R.style.WidgetTheme) setTheme(R.style.WidgetTheme)
val habit = fixtures.createShortHabit() val habit = fixtures.createShortHabit()
val computedEntries = habit.computedEntries val computedEntries = habit.computedEntries

View File

@@ -101,6 +101,7 @@ class ListHabitsActivity : AppCompatActivity(), Preferences.Listener {
screen.onAttached() screen.onAttached()
rootView.postInvalidate() rootView.postInvalidate()
midnightTimer.onResume() midnightTimer.onResume()
appComponent.reminderScheduler.scheduleAll()
taskRunner.run { taskRunner.run {
try { try {
AutoBackup(this@ListHabitsActivity).run() AutoBackup(this@ListHabitsActivity).run()

View File

@@ -24,7 +24,6 @@ import android.appwidget.AppWidgetManager.EXTRA_APPWIDGET_ID
import android.appwidget.AppWidgetManager.INVALID_APPWIDGET_ID import android.appwidget.AppWidgetManager.INVALID_APPWIDGET_ID
import android.content.Intent import android.content.Intent
import android.os.Bundle import android.os.Bundle
import android.widget.AbsListView.CHOICE_MODE_MULTIPLE
import android.widget.ArrayAdapter import android.widget.ArrayAdapter
import android.widget.Button import android.widget.Button
import android.widget.ListView import android.widget.ListView
@@ -34,7 +33,6 @@ import org.isoron.uhabits.R
import org.isoron.uhabits.activities.AndroidThemeSwitcher import org.isoron.uhabits.activities.AndroidThemeSwitcher
import org.isoron.uhabits.core.preferences.WidgetPreferences import org.isoron.uhabits.core.preferences.WidgetPreferences
import org.isoron.uhabits.widgets.WidgetUpdater import org.isoron.uhabits.widgets.WidgetUpdater
import java.util.ArrayList
class BooleanHabitPickerDialog : HabitPickerDialog() { class BooleanHabitPickerDialog : HabitPickerDialog() {
override fun shouldHideNumerical() = true override fun shouldHideNumerical() = true
@@ -88,20 +86,12 @@ open class HabitPickerDialog : Activity() {
with(listView) { with(listView) {
adapter = ArrayAdapter( adapter = ArrayAdapter(
context, context,
android.R.layout.simple_list_item_multiple_choice, android.R.layout.simple_list_item_1,
habitNames habitNames
) )
choiceMode = CHOICE_MODE_MULTIPLE setOnItemClickListener { parent, view, position, id ->
itemsCanFocus = false confirm(mutableListOf(habitIds[position]))
}
saveButton.setOnClickListener {
val selectedIds = mutableListOf<Long>()
for (i in 0..listView.count) {
if (listView.isItemChecked(i)) {
selectedIds.add(habitIds[i])
}
} }
confirm(selectedIds)
} }
} }

View File

@@ -66,23 +66,21 @@ class CheckmarkWidgetView : HabitWidgetView {
val res = StyledResources(context) val res = StyledResources(context)
val bgColor: Int val bgColor: Int
val fgColor: Int val fgColor: Int
setShadowAlpha(0x4f)
when (entryState) { when (entryState) {
YES_MANUAL, SKIP -> { YES_MANUAL, SKIP -> {
bgColor = activeColor bgColor = activeColor
fgColor = res.getColor(R.attr.contrast0) fgColor = res.getColor(R.attr.contrast0)
setShadowAlpha(0x4f)
backgroundPaint!!.color = bgColor backgroundPaint!!.color = bgColor
frame!!.setBackgroundDrawable(background) frame!!.setBackgroundDrawable(background)
} }
YES_AUTO, NO, UNKNOWN -> { YES_AUTO, NO, UNKNOWN -> {
bgColor = res.getColor(R.attr.cardBgColor) bgColor = res.getColor(R.attr.cardBgColor)
fgColor = res.getColor(R.attr.contrast60) fgColor = res.getColor(R.attr.contrast60)
setShadowAlpha(0x00)
} }
else -> { else -> {
bgColor = res.getColor(R.attr.cardBgColor) bgColor = res.getColor(R.attr.cardBgColor)
fgColor = res.getColor(R.attr.contrast60) fgColor = res.getColor(R.attr.contrast60)
setShadowAlpha(0x00)
} }
} }
ring.setPercentage(percentage) ring.setPercentage(percentage)
@@ -126,7 +124,7 @@ class CheckmarkWidgetView : HabitWidgetView {
} else { } else {
width = min(width, height) width = min(width, height)
} }
val textSize = min(0.2f * width, getDimension(context, R.dimen.smallerTextSize)) val textSize = min(0.175f * width, getDimension(context, R.dimen.smallTextSize))
label.setTextSize(TypedValue.COMPLEX_UNIT_PX, textSize) label.setTextSize(TypedValue.COMPLEX_UNIT_PX, textSize)
if (isNumerical) { if (isNumerical) {
ring.setTextSize(textSize * 0.9f) ring.setTextSize(textSize * 0.9f)
@@ -141,7 +139,8 @@ class CheckmarkWidgetView : HabitWidgetView {
} }
private fun init() { private fun init() {
val appComponent: HabitsApplicationComponent = (context.applicationContext as HabitsApplication).component val appComponent: HabitsApplicationComponent =
(context.applicationContext as HabitsApplication).component
preferences = appComponent.preferences preferences = appComponent.preferences
ring = findViewById<View>(R.id.scoreRing) as RingView ring = findViewById<View>(R.id.scoreRing) as RingView
label = findViewById<View>(R.id.label) as TextView label = findViewById<View>(R.id.label) as TextView

View File

@@ -69,7 +69,7 @@ abstract class HabitWidgetView : FrameLayout {
val shadowRadius = dpToPixels(context, 2f).toInt() val shadowRadius = dpToPixels(context, 2f).toInt()
val shadowOffset = dpToPixels(context, 1f).toInt() val shadowOffset = dpToPixels(context, 1f).toInt()
val shadowColor = Color.argb(shadowAlpha, 0, 0, 0) val shadowColor = Color.argb(shadowAlpha, 0, 0, 0)
val cornerRadius = dpToPixels(context, 5f) val cornerRadius = dpToPixels(context, 12f)
val radii = FloatArray(8) val radii = FloatArray(8)
Arrays.fill(radii, cornerRadius) Arrays.fill(radii, cornerRadius)
val shape = RoundRectShape(radii, null, null) val shape = RoundRectShape(radii, null, null)

View File

@@ -28,7 +28,7 @@
<item android:id="@android:id/mask"> <item android:id="@android:id/mask">
<shape android:shape="rectangle"> <shape android:shape="rectangle">
<corners android:radius="5dp"/> <corners android:radius="12dp"/>
<solid android:color="?android:colorPrimary"/> <solid android:color="?android:colorPrimary"/>
</shape> </shape>
<color android:color="@color/white"/> <color android:color="@color/white"/>

View File

@@ -30,10 +30,4 @@
android:layout_weight="1"> android:layout_weight="1">
</ListView> </ListView>
<Button
android:id="@+id/buttonSave"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:text="@string/save"/>
</LinearLayout> </LinearLayout>

View File

@@ -35,7 +35,7 @@
android:paddingTop="4dp" android:paddingTop="4dp"
android:paddingLeft="8dp" android:paddingLeft="8dp"
android:paddingRight="8dp" android:paddingRight="8dp"
android:paddingBottom="4dp" android:paddingBottom="8dp"
tools:ignore="UselessParent"> tools:ignore="UselessParent">
<TextView <TextView