Compare commits

...

5 Commits

10 changed files with 196 additions and 61 deletions

View File

@@ -1,32 +1,54 @@
# Changelog
## [2.3.1] -- 2025-08-13
### Changed
- Add notes to exported CSV files (@iSoron)
### Fixed
- Prevent some views from being obscured by system UI (@iSoron, #2171)
- Disable confetti if animations are disabled globally (@iSoron, #2170)
- Make symbols easier to distinguish in "pure black" dark mode (powerjungle, #2136)
- Trim unit labels when necessary (@hiqua, @iSoron, #2158)
## [2.3.0] -- 2025-06-23
### Added
- Add support for Android 15 and 16 (@iSoron)
- Show confetti animation (@gokulk16, @iSoron, #1743)
- Show streaks for measurable habits (@teckwarz, #2059)
- Allow user to unset measurable habits (@leontodd, @kalina559, #1899, #2109)
### Changed
- Change background widget color for habits with implicit checks (@wobbba, #1915)
### Fixed
- Fix notification when goal type is set to maximum (@manish99verma, #1931)
- Never mark "at most" habits as completed for the day (@kalina559, #2077)
- Increase minimum widget size (@iSoron, #2118)
- Improve Gradle configuration (@jimlyas, #2108)
## [2.2.0] -- 2024-01-30
### Added
- Add support for Android 14 (@iSoron, @hiqua)
- Allow user to change app language (@leondzn)
### Fixed
- Implement workaround to make notifications non-dismissible in Android 14 (@iSoron, #1872)
- Fix splash screen background color in dark mode (@SIKV, #1888)
## [2.1.3] -- 2023-08-28
### Fixed
- Use text input on Samsung devices (@iSoron, #1719)
- Prevent crash if alarm permission is revoked (@iSoron)
- Adjust widget colors (@iSoron)
@@ -34,7 +56,9 @@
- Fix skip button in locales that use comma instead of dot (@iSoron, #1721)
## [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)
@@ -42,18 +66,23 @@
- 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
### Fixed
- Fix Tasker plugin (@iSoron, #1503)
## [2.1.0] -- 2022-09-10
### Added
- Allow user to add notes to specific dates (@vbh, #1103)
- Allow user to track "at most" numerical habits (@KristianTashkov, #1101)
- Allow user to add skips to measurable habits (@kalina559, #1319)
@@ -64,10 +93,12 @@
- Add support for Android 13 themed icons (@cheeeeer, #1497)
### Removed
- Hide snooze button Android 12 notifications (@hiqua, #1226)
- Remove preference to set LED lights (@iSoron)
### Changed
- Hide failed habits along with completed ones (@hiqua, #1052)
- Cycle through all checkmark states when toggling (@iSoron)
- Add delay after toggling a habit (@hiqua, @kalina559, #1147)
@@ -76,6 +107,7 @@
- Increase target SDK to 31 (@hiqua)
### Fixed
- Fix small dialog buttons (@kalina559, #1096)
- Fix invalid CSV files (@hiqua, #1177)
- Fix small issues in calendar chart (@kalina559, #1314)
@@ -84,13 +116,16 @@
- Fix widgets not working correctly on API 33 (@iSoron, #1488)
### Refactoring & Testing
- Replace raster icons by vector assets (@kalina559)
- Remove JVM dependencies from uhabits-core module (@sgallese)
- Add various missing tests (@sgallese)
- Upgrade project dependencies (@hiqua, @sgallese)
## [2.0.3] - 2021-08-21
### Fixed
- Improve automatic checkmarks for monthly habits (@iSoron, #947)
- Fix small theme issues (@iSoron)
- Fix ANR on some Samsung phones (@iSoron, #962)
@@ -102,9 +137,11 @@
## [2.0.2] - 2021-05-23
### Changed
- Make checkmark widget resizable
### Fixed
- Fix crash caused by numerical habits with zero target (@iSoron, #903)
- Fix small issues with font size (@iSoron)
- Allow fractional target values (@sumanabhi, #911)
@@ -115,18 +152,22 @@
## [2.0.1] - 2021-05-09
### Added
- Make midnight delay optional and disabled by default (@hiqua)
- Add arrows to sort menu (@iSoron)
### Removed
- Temporarily remove experimental device sync functionality. This feature will be re-added in
Loop 2.1.
### Changed
- Make implicit checkmarks easier to read (@iSoron)
- Update and improve list of translators (@hiqua, @iSoron)
### Fixed
- Disable transparency for stacked widgets (@hiqua)
- Fix various color issues on the dark theme (@hiqua, @iSoron)
- Fix "customize notifications" on older devices (@hiqua)
@@ -135,6 +176,7 @@
- Fix checkmark widget not rendering properly on some Samsung phones (@iSoron)
### Refactoring & Testing
- Finish conversion of the entire project to Kotlin (@hiqua, @iSoron, @MarKco)
- Automatically run large tests on GitHub Actions (@iSoron)
- Remove unused v21 resources (@hiqua)
@@ -142,6 +184,7 @@
## [2.0.0-alpha] - 2020-11-29
### Added
- Track numeric habits (@iSoron, @namnl)
- Skip days without breaking streak (@KristianTashkov)
- Sort habits by status (@hiqua)
@@ -152,15 +195,18 @@
- Export backups daily (@iSoron)
### Removed
- Drop support to devices older than Android 6.0 (API 23)
### Fixed
- Reset chart offset when switching scale (@alxmjo)
- Don't show reminders from archived habits (@KristianTashkov)
- Lapses on non-daily habits decrease the score too much (@iSoron)
- Update widgets at midnight (@KristianTashkov)
### Refactoring
- Convert files to Kotlin (@olegivo)
## [1.8.12] - 2021-01-30
@@ -185,13 +231,15 @@
## [1.8.8] - 2020-06-21
- Make small changes to the habit scheduling algorithm, so that "1 time every x days" habits work more predictably.
- Make small changes to the habit scheduling algorithm, so that "1 time every x days" habits work
more predictably.
- Fix crash when saving habit
## [1.8.0] - 2020-01-01
- New bar chart showing number of repetitions performed in each week, month, quarter or year.
- Improved calculation of streaks for non-daily habits: performing habits on irregular weekdays will no longer break your streak.
- Improved calculation of streaks for non-daily habits: performing habits on irregular weekdays will
no longer break your streak.
- Many more colors to choose from (now 20 in total).
- Ability to customize how transparent the widgets are on your home screen.
- Ability to customize the first day of the week.

View File

@@ -44,8 +44,8 @@ android {
compileSdk = 36
defaultConfig {
versionCode = 20300
versionName = "2.3.0"
versionCode = 20301
versionName = "2.3.1"
minSdk = 28
targetSdk = 36
applicationId = "org.isoron.uhabits"

View File

@@ -26,6 +26,7 @@ import org.isoron.uhabits.BuildConfig
import org.isoron.uhabits.R
import org.isoron.uhabits.core.models.PaletteColor
import org.isoron.uhabits.databinding.AboutBinding
import org.isoron.uhabits.utils.applyBottomInset
import org.isoron.uhabits.utils.applyRootViewInsets
import org.isoron.uhabits.utils.currentTheme
import org.isoron.uhabits.utils.setupToolbar
@@ -55,6 +56,7 @@ class AboutView(
binding.tvTranslate.setOnClickListener { screen.showTranslationWebsite() }
binding.tvVersion.setOnClickListener { screen.onPressDeveloperCountdown() }
binding.tvVersion.text = String.format(version, BuildConfig.VERSION_NAME)
binding.outerLinearLayout.applyBottomInset()
applyRootViewInsets()
}
}

View File

@@ -20,11 +20,14 @@
package org.isoron.uhabits.activities.habits.list.views
import android.content.Context
import android.graphics.Rect
import android.os.Bundle
import android.os.Parcelable
import android.view.GestureDetector
import android.view.MotionEvent
import android.view.View
import androidx.core.view.ViewCompat
import androidx.core.view.WindowInsetsCompat
import androidx.recyclerview.widget.ItemTouchHelper
import androidx.recyclerview.widget.ItemTouchHelper.DOWN
import androidx.recyclerview.widget.ItemTouchHelper.END
@@ -57,6 +60,7 @@ class HabitCardListView(
) : RecyclerView(context, null, R.attr.scrollableRecyclerViewStyle) {
var checkmarkCount: Int = 0
private var insetDecorationsAdded: Boolean = false
var dataOffset: Int = 0
set(value) {
@@ -75,9 +79,32 @@ class HabitCardListView(
setHasFixedSize(true)
isLongClickable = true
layoutManager = LinearLayoutManager(context)
applyBottomInset()
super.setAdapter(adapter)
}
private fun applyBottomInset() {
ViewCompat.setOnApplyWindowInsetsListener(this) { _, insets ->
if (insetDecorationsAdded) return@setOnApplyWindowInsetsListener insets
insetDecorationsAdded = true
val systemBarsInsets = insets.getInsets(WindowInsetsCompat.Type.systemBars())
addItemDecoration(object : ItemDecoration() {
override fun getItemOffsets(
outRect: Rect,
view: View,
parent: RecyclerView,
state: State
) {
val itemCount = parent.adapter?.itemCount
if (parent.getChildAdapterPosition(view) == itemCount?.minus(1)) {
outRect.bottom = systemBarsInsets.bottom
}
}
})
insets
}
}
fun createHabitCardView(): HabitCardView {
return cardViewFactory.create()
}

View File

@@ -238,17 +238,18 @@ class HabitCardView(
private fun getAbsoluteButtonLocation(timestamp: Timestamp): PointF {
val containerLocation = IntArray(2)
this.getLocationOnScreen(containerLocation)
this.getLocationInWindow(containerLocation)
val relButtonLocation = getRelativeButtonLocation(timestamp)
val windowInsets = rootWindowInsets
val statusBarHeight = if (SDK_INT <= Build.VERSION_CODES.VANILLA_ICE_CREAM) {
val xInset = windowInsets?.displayCutout?.safeInsetLeft ?: 0
val yInset = if (SDK_INT <= Build.VERSION_CODES.VANILLA_ICE_CREAM) {
windowInsets?.systemWindowInsetTop ?: 0
} else {
0
}
return PointF(
containerLocation[0].toFloat() + relButtonLocation.x,
containerLocation[1].toFloat() + relButtonLocation.y - statusBarHeight
containerLocation[0].toFloat() + relButtonLocation.x - xInset,
containerLocation[1].toFloat() + relButtonLocation.y - yInset
)
}

View File

@@ -25,6 +25,7 @@ import android.widget.FrameLayout
import org.isoron.uhabits.core.ui.screens.habits.show.ShowHabitPresenter
import org.isoron.uhabits.core.ui.screens.habits.show.ShowHabitState
import org.isoron.uhabits.databinding.ShowHabitBinding
import org.isoron.uhabits.utils.applyBottomInset
import org.isoron.uhabits.utils.applyToolbarInsets
import org.isoron.uhabits.utils.setupToolbar
@@ -57,6 +58,7 @@ class ShowHabitView(context: Context) : FrameLayout(context) {
} else {
binding.targetCard.visibility = GONE
}
binding.linearLayout.applyBottomInset()
}
fun setListener(presenter: ShowHabitPresenter) {

View File

@@ -26,6 +26,7 @@ import org.isoron.uhabits.R
import org.isoron.uhabits.activities.AndroidThemeSwitcher
import org.isoron.uhabits.core.models.PaletteColor
import org.isoron.uhabits.databinding.SettingsActivityBinding
import org.isoron.uhabits.utils.applyBottomInset
import org.isoron.uhabits.utils.applyRootViewInsets
import org.isoron.uhabits.utils.setupToolbar
@@ -44,6 +45,7 @@ class SettingsActivity : AppCompatActivity() {
theme = themeSwitcher.currentTheme
)
binding.root.applyRootViewInsets()
binding.root.applyBottomInset()
setContentView(binding.root)
}
}

View File

@@ -260,6 +260,14 @@ fun View.applyRootViewInsets() {
}
}
fun View.applyBottomInset() {
ViewCompat.setOnApplyWindowInsetsListener(this) { view, insets ->
val systemBarsInsets = insets.getInsets(WindowInsetsCompat.Type.systemBars())
view.setPadding(0, 0, 0, systemBarsInsets.bottom)
insets
}
}
fun View.applyToolbarInsets() {
ViewCompat.setOnApplyWindowInsetsListener(this) { view, insets ->
val systemBarsInsets = insets.getInsets(WindowInsetsCompat.Type.systemBars())

View File

@@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
<?xml version="1.0" encoding="utf-8"?><!--
~ Copyright (C) 2016-2021 Álinson Santos Xavier <git@axavier.org>
~
~ This file is part of Loop Habit Tracker.
@@ -19,16 +18,16 @@
-->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="?windowBackgroundColor"
android:fillViewport="true">
android:layout_width="fill_parent"
android:layout_height="fill_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="?windowBackgroundColor"
android:fillViewport="true">
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
app:popupTheme="?toolbarPopupTheme"
style="@style/Toolbar"/>
style="@style/Toolbar" />
<ScrollView
android:id="@+id/scrollView"
@@ -37,6 +36,7 @@
android:layout_below="@id/toolbar">
<LinearLayout
android:id="@+id/outerLinearLayout"
style="@style/CardList">
<LinearLayout
@@ -47,7 +47,7 @@
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_margin="6dp"
android:src="@drawable/intro_icon_1"/>
android:src="@drawable/intro_icon_1" />
<TextView
android:layout_width="wrap_content"
@@ -57,14 +57,14 @@
android:textSize="16sp"
android:layout_margin="6dp"
android:textColor="?aboutScreenColor"
android:text="@string/app_name"/>
android:text="@string/app_name" />
<TextView
android:id="@+id/tvVersion"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text=""/>
android:text="" />
</LinearLayout>
@@ -75,32 +75,32 @@
<TextView
style="@style/CardHeader"
android:text="@string/links"
android:textColor="?aboutScreenColor"/>
android:textColor="?aboutScreenColor" />
<TextView
android:id="@+id/tvRate"
style="@style/About.Item.Clickable"
android:text="@string/pref_rate_this_app"/>
android:text="@string/pref_rate_this_app" />
<TextView
android:id="@+id/tvFeedback"
style="@style/About.Item.Clickable"
android:text="@string/pref_send_feedback"/>
android:text="@string/pref_send_feedback" />
<TextView
android:id="@+id/tvTranslate"
style="@style/About.Item.Clickable"
android:text="@string/help_translate"/>
android:text="@string/help_translate" />
<TextView
android:id="@+id/tvSource"
style="@style/About.Item.Clickable"
android:text="@string/pref_view_source_code"/>
android:text="@string/pref_view_source_code" />
<TextView
android:id="@+id/tvPrivacy"
style="@style/About.Item.Clickable"
android:text="@string/pref_view_privacy"/>
android:id="@+id/tvPrivacy"
style="@style/About.Item.Clickable"
android:text="@string/pref_view_privacy" />
</LinearLayout>
@@ -111,7 +111,7 @@
<TextView
style="@style/CardHeader"
android:text="@string/developers"
android:textColor="?aboutScreenColor"/>
android:textColor="?aboutScreenColor" />
<!--
This file lists developers who contributed with at least 100 lines
@@ -120,31 +120,76 @@
linked at the bottom of the list. If you qualify, please feel free to
submit a pull request adding yourself here.
-->
<TextView style="@style/About.Item" android:text="Álinson S. Xavier (@iSoron)"/>
<TextView style="@style/About.Item" android:text="Quentin Hibon (@hiqua)"/>
<TextView style="@style/About.Item" android:text="Oleg Ivashchenko (@olegivo)"/>
<TextView style="@style/About.Item" android:text="Kristian Tashkov (@KristianTashkov)"/>
<TextView style="@style/About.Item" android:text="Jakub Kalinowski (@kalina559)"/>
<TextView style="@style/About.Item" android:text="Rechee Jozil (@recheej)"/>
<TextView style="@style/About.Item" android:text="Sebastian Gallese (@sgallese)"/>
<TextView style="@style/About.Item" android:text="Luboš Luňák (@llunak)"/>
<TextView style="@style/About.Item" android:text="Bindu (@vbh)"/>
<TextView style="@style/About.Item" android:text="Victor Yu (@vyu1)"/>
<TextView style="@style/About.Item" android:text="Christoph Hennemann (@chennemann)"/>
<TextView style="@style/About.Item" android:text="Денис (@sciamano)"/>
<TextView style="@style/About.Item" android:text="Joseph Tran (@JotraN)"/>
<TextView style="@style/About.Item" android:text="Nikhil (@regularcoder)"/>
<TextView style="@style/About.Item" android:text="JanetQC"/>
<TextView
android:id="@+id/tvContributors"
style="@style/About.Item.Clickable"
android:text="@string/view_all_contributors"/>
style="@style/About.Item"
android:text="Álinson S. Xavier (@iSoron)" />
<TextView
style="@style/About.Item"
android:text="Quentin Hibon (@hiqua)" />
<TextView
style="@style/About.Item"
android:text="Oleg Ivashchenko (@olegivo)" />
<TextView
style="@style/About.Item"
android:text="Kristian Tashkov (@KristianTashkov)" />
<TextView
style="@style/About.Item"
android:text="Jakub Kalinowski (@kalina559)" />
<TextView
style="@style/About.Item"
android:text="Rechee Jozil (@recheej)" />
<TextView
style="@style/About.Item"
android:text="Sebastian Gallese (@sgallese)" />
<TextView
style="@style/About.Item"
android:text="Luboš Luňák (@llunak)" />
<TextView
style="@style/About.Item"
android:text="Bindu (@vbh)" />
<TextView
style="@style/About.Item"
android:text="Victor Yu (@vyu1)" />
<TextView
style="@style/About.Item"
android:text="Christoph Hennemann (@chennemann)" />
<TextView
style="@style/About.Item"
android:text="Денис (@sciamano)" />
<TextView
style="@style/About.Item"
android:text="Joseph Tran (@JotraN)" />
<TextView
style="@style/About.Item"
android:text="Nikhil (@regularcoder)" />
<TextView
style="@style/About.Item"
android:text="JanetQC" />
<TextView
android:id="@+id/tvContributors"
style="@style/About.Item.Clickable"
android:text="@string/view_all_contributors" />
</LinearLayout>
<include layout="@layout/about_translators"/>
<include layout="@layout/about_translators" />
>
>
</LinearLayout>
</ScrollView>

View File

@@ -17,8 +17,7 @@
~ with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<RelativeLayout
android:id="@+id/container"
<RelativeLayout android:id="@+id/container"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
@@ -29,7 +28,7 @@
android:id="@+id/toolbar"
style="@style/Toolbar"
app:popupTheme="?toolbarPopupTheme"
android:layout_alignParentTop="true"/>
android:layout_alignParentTop="true" />
<ScrollView
android:id="@+id/scrollView"
@@ -41,11 +40,12 @@
<LinearLayout
style="@style/CardList"
android:id="@+id/linearLayout"
android:clipToPadding="false">
<org.isoron.uhabits.activities.habits.show.views.SubtitleCardView
android:id="@+id/subtitleCard"
style="@style/ShowHabit.Subtitle"/>
style="@style/ShowHabit.Subtitle" />
<org.isoron.uhabits.activities.habits.show.views.NotesCardView
android:id="@+id/notesCard"
@@ -55,36 +55,36 @@
<org.isoron.uhabits.activities.habits.show.views.OverviewCardView
android:id="@+id/overviewCard"
style="@style/Card"
android:paddingTop="12dp"/>
android:paddingTop="12dp" />
<org.isoron.uhabits.activities.habits.show.views.TargetCardView
android:id="@+id/targetCard"
style="@style/Card"
android:paddingTop="12dp"/>
android:paddingTop="12dp" />
<org.isoron.uhabits.activities.habits.show.views.ScoreCardView
android:id="@+id/scoreCard"
style="@style/Card"
android:gravity="center"/>
android:gravity="center" />
<org.isoron.uhabits.activities.habits.show.views.BarCardView
android:id="@+id/barCard"
style="@style/Card"
android:gravity="center"/>
android:gravity="center" />
<org.isoron.uhabits.activities.habits.show.views.HistoryCardView
android:id="@+id/historyCard"
style="@style/Card"
android:gravity="center"
android:paddingBottom="0dp"/>
android:paddingBottom="0dp" />
<org.isoron.uhabits.activities.habits.show.views.StreakCardView
android:id="@+id/streakCard"
style="@style/Card"/>
style="@style/Card" />
<org.isoron.uhabits.activities.habits.show.views.FrequencyCardView
android:id="@+id/frequencyCard"
style="@style/Card"/>
style="@style/Card" />
</LinearLayout>
</ScrollView>