mirror of
https://github.com/iSoron/uhabits.git
synced 2025-12-15 05:28:51 -06:00
Merge branch 'iSoron:dev' into dev
This commit is contained in:
@@ -99,7 +99,7 @@ class NumberPickerFactory
|
|||||||
picker.clearFocus()
|
picker.clearFocus()
|
||||||
picker2.clearFocus()
|
picker2.clearFocus()
|
||||||
val v = picker.value + 0.01 * picker2.value
|
val v = picker.value + 0.01 * picker2.value
|
||||||
val note = etNotes.text.toString()
|
val note = etNotes.text.toString().trim()
|
||||||
callback.onNumberPicked(v, note)
|
callback.onNumberPicked(v, note)
|
||||||
}
|
}
|
||||||
.setNegativeButton(android.R.string.cancel) { _, _ ->
|
.setNegativeButton(android.R.string.cancel) { _, _ ->
|
||||||
|
|||||||
@@ -83,7 +83,6 @@ class CheckmarkButtonView(
|
|||||||
private var drawer = Drawer()
|
private var drawer = Drawer()
|
||||||
|
|
||||||
init {
|
init {
|
||||||
isFocusable = false
|
|
||||||
setOnClickListener(this)
|
setOnClickListener(this)
|
||||||
setOnLongClickListener(this)
|
setOnLongClickListener(this)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -306,7 +306,7 @@ class HabitCardView(
|
|||||||
}
|
}
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
const val TOGGLE_DELAY_MILLIS = 2000L
|
const val TOGGLE_DELAY_MILLIS = 1000L
|
||||||
|
|
||||||
fun (() -> Unit).delay(delayInMillis: Long) {
|
fun (() -> Unit).delay(delayInMillis: Long) {
|
||||||
Handler(Looper.getMainLooper()).postDelayed(this, delayInMillis)
|
Handler(Looper.getMainLooper()).postDelayed(this, delayInMillis)
|
||||||
|
|||||||
@@ -25,7 +25,6 @@ import android.app.NotificationChannel
|
|||||||
import android.app.NotificationManager
|
import android.app.NotificationManager
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.graphics.BitmapFactory.decodeResource
|
import android.graphics.BitmapFactory.decodeResource
|
||||||
import android.graphics.Color
|
|
||||||
import android.os.Build
|
import android.os.Build
|
||||||
import android.os.Build.VERSION.SDK_INT
|
import android.os.Build.VERSION.SDK_INT
|
||||||
import android.util.Log
|
import android.util.Log
|
||||||
@@ -150,9 +149,6 @@ class AndroidNotificationTray
|
|||||||
if (!disableSound)
|
if (!disableSound)
|
||||||
builder.setSound(ringtoneManager.getURI())
|
builder.setSound(ringtoneManager.getURI())
|
||||||
|
|
||||||
if (preferences.shouldMakeNotificationsLed())
|
|
||||||
builder.setLights(Color.RED, 1000, 1000)
|
|
||||||
|
|
||||||
if (SDK_INT < Build.VERSION_CODES.S) {
|
if (SDK_INT < Build.VERSION_CODES.S) {
|
||||||
val snoozeAction = Action(
|
val snoozeAction = Action(
|
||||||
R.drawable.ic_action_snooze,
|
R.drawable.ic_action_snooze,
|
||||||
|
|||||||
@@ -90,8 +90,6 @@ class SharedPreferencesStorage
|
|||||||
preferences.isMidnightDelayEnabled = getBoolean(key, false)
|
preferences.isMidnightDelayEnabled = getBoolean(key, false)
|
||||||
"pref_sticky_notifications" ->
|
"pref_sticky_notifications" ->
|
||||||
preferences.setNotificationsSticky(getBoolean(key, false))
|
preferences.setNotificationsSticky(getBoolean(key, false))
|
||||||
"pref_led_notifications" ->
|
|
||||||
preferences.setNotificationsLed(getBoolean(key, false))
|
|
||||||
"pref_unknown_enabled" -> {
|
"pref_unknown_enabled" -> {
|
||||||
preferences.areQuestionMarksEnabled = getBoolean(key, false)
|
preferences.areQuestionMarksEnabled = getBoolean(key, false)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -99,13 +99,6 @@
|
|||||||
android:title="@string/sticky_notifications"
|
android:title="@string/sticky_notifications"
|
||||||
app:iconSpaceReserved="false" />
|
app:iconSpaceReserved="false" />
|
||||||
|
|
||||||
<SwitchPreferenceCompat
|
|
||||||
android:defaultValue="false"
|
|
||||||
android:key="pref_led_notifications"
|
|
||||||
android:summary="@string/led_notifications_description"
|
|
||||||
android:title="@string/led_notifications"
|
|
||||||
app:iconSpaceReserved="false" />
|
|
||||||
|
|
||||||
<Preference
|
<Preference
|
||||||
android:key="reminderCustomize"
|
android:key="reminderCustomize"
|
||||||
android:summary="@string/customize_notification_summary"
|
android:summary="@string/customize_notification_summary"
|
||||||
|
|||||||
@@ -7,5 +7,3 @@ pluginManagement {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
enableFeaturePreview("GRADLE_METADATA")
|
|
||||||
@@ -152,19 +152,10 @@ open class Preferences(private val storage: Storage) {
|
|||||||
for (l in listeners) l.onNotificationsChanged()
|
for (l in listeners) l.onNotificationsChanged()
|
||||||
}
|
}
|
||||||
|
|
||||||
fun setNotificationsLed(enabled: Boolean) {
|
|
||||||
storage.putBoolean("pref_led_notifications", enabled)
|
|
||||||
for (l in listeners) l.onNotificationsChanged()
|
|
||||||
}
|
|
||||||
|
|
||||||
fun shouldMakeNotificationsSticky(): Boolean {
|
fun shouldMakeNotificationsSticky(): Boolean {
|
||||||
return storage.getBoolean("pref_sticky_notifications", false)
|
return storage.getBoolean("pref_sticky_notifications", false)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun shouldMakeNotificationsLed(): Boolean {
|
|
||||||
return storage.getBoolean("pref_led_notifications", false)
|
|
||||||
}
|
|
||||||
|
|
||||||
open var isCheckmarkSequenceReversed: Boolean
|
open var isCheckmarkSequenceReversed: Boolean
|
||||||
get() {
|
get() {
|
||||||
if (shouldReverseCheckmarks == null) shouldReverseCheckmarks =
|
if (shouldReverseCheckmarks == null) shouldReverseCheckmarks =
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ class HistoryChart(
|
|||||||
val col = ((x - padding) / squareSize).toInt()
|
val col = ((x - padding) / squareSize).toInt()
|
||||||
val row = ((y - padding) / squareSize).toInt()
|
val row = ((y - padding) / squareSize).toInt()
|
||||||
val offset = col * 7 + (row - 1)
|
val offset = col * 7 + (row - 1)
|
||||||
if (row == 0 || col == nColumns) return
|
if (x - padding < 0 || row == 0 || row > 7 || col == nColumns) return
|
||||||
val clickedDate = topLeftDate.plus(offset)
|
val clickedDate = topLeftDate.plus(offset)
|
||||||
if (clickedDate.isNewerThan(today)) return
|
if (clickedDate.isNewerThan(today)) return
|
||||||
if (isLongClick) {
|
if (isLongClick) {
|
||||||
|
|||||||
@@ -116,9 +116,6 @@ class PreferencesTest : BaseUnitTest() {
|
|||||||
assertFalse(prefs.shouldMakeNotificationsSticky())
|
assertFalse(prefs.shouldMakeNotificationsSticky())
|
||||||
prefs.setNotificationsSticky(true)
|
prefs.setNotificationsSticky(true)
|
||||||
assertTrue(prefs.shouldMakeNotificationsSticky())
|
assertTrue(prefs.shouldMakeNotificationsSticky())
|
||||||
assertFalse(prefs.shouldMakeNotificationsLed())
|
|
||||||
prefs.setNotificationsLed(true)
|
|
||||||
assertTrue(prefs.shouldMakeNotificationsLed())
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|||||||
@@ -61,7 +61,7 @@
|
|||||||
00C0C6BA22465F65003D8AF0 /* fonts */ = {isa = PBXFileReference; lastKnownFileType = folder; path = fonts; sourceTree = "<group>"; };
|
00C0C6BA22465F65003D8AF0 /* fonts */ = {isa = PBXFileReference; lastKnownFileType = folder; path = fonts; sourceTree = "<group>"; };
|
||||||
00C0C6BB22465F65003D8AF0 /* databases */ = {isa = PBXFileReference; lastKnownFileType = folder; path = databases; sourceTree = "<group>"; };
|
00C0C6BB22465F65003D8AF0 /* databases */ = {isa = PBXFileReference; lastKnownFileType = folder; path = databases; sourceTree = "<group>"; };
|
||||||
00C0C6BC22465F65003D8AF0 /* migrations */ = {isa = PBXFileReference; lastKnownFileType = folder; path = migrations; sourceTree = "<group>"; };
|
00C0C6BC22465F65003D8AF0 /* migrations */ = {isa = PBXFileReference; lastKnownFileType = folder; path = migrations; sourceTree = "<group>"; };
|
||||||
00C0C6C92246E543003D8AF0 /* LoopHabitTracker.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = LoopHabitTracker.framework; path = ../core/build/bin/ios/debugFramework/LoopHabitTracker.framework; sourceTree = "<group>"; };
|
00C0C6C92246E543003D8AF0 /* LoopHabitTracker.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = LoopHabitTracker.framework; path = "../uhabits-core-legacy/build/bin/ios/debugFramework/LoopHabitTracker.framework"; sourceTree = "<group>"; };
|
||||||
00C0C6D022470705003D8AF0 /* ComponentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ComponentView.swift; sourceTree = "<group>"; };
|
00C0C6D022470705003D8AF0 /* ComponentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ComponentView.swift; sourceTree = "<group>"; };
|
||||||
00C0C6DE224A35FC003D8AF0 /* DetailScreenController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DetailScreenController.swift; sourceTree = "<group>"; };
|
00C0C6DE224A35FC003D8AF0 /* DetailScreenController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DetailScreenController.swift; sourceTree = "<group>"; };
|
||||||
00D48BD02200A31300CC4527 /* Launch.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = Launch.storyboard; sourceTree = "<group>"; };
|
00D48BD02200A31300CC4527 /* Launch.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = Launch.storyboard; sourceTree = "<group>"; };
|
||||||
@@ -157,7 +157,7 @@
|
|||||||
00C0C6BC22465F65003D8AF0 /* migrations */,
|
00C0C6BC22465F65003D8AF0 /* migrations */,
|
||||||
);
|
);
|
||||||
name = Assets;
|
name = Assets;
|
||||||
path = ../core/assets/main;
|
path = "../uhabits-core-legacy/assets/main";
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
};
|
};
|
||||||
00C0C6D622471BA3003D8AF0 /* Platform */ = {
|
00C0C6D622471BA3003D8AF0 /* Platform */ = {
|
||||||
@@ -285,7 +285,7 @@
|
|||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
shellPath = /bin/sh;
|
shellPath = /bin/sh;
|
||||||
shellScript = "cd ../core\n./gradlew linkDebugFrameworkIos\n";
|
shellScript = "cd ../uhabits-core-legacy\n../gradlew linkDebugFrameworkIos\n";
|
||||||
};
|
};
|
||||||
/* End PBXShellScriptBuildPhase section */
|
/* End PBXShellScriptBuildPhase section */
|
||||||
|
|
||||||
@@ -451,10 +451,10 @@
|
|||||||
DEVELOPMENT_TEAM = R5YTHGE3PS;
|
DEVELOPMENT_TEAM = R5YTHGE3PS;
|
||||||
ENABLE_BITCODE = NO;
|
ENABLE_BITCODE = NO;
|
||||||
FRAMEWORK_SEARCH_PATHS = (
|
FRAMEWORK_SEARCH_PATHS = (
|
||||||
"$(PROJECT_DIR)/../core/build/bin/ios/debugFramework/",
|
"$(PROJECT_DIR)/../uhabits-core-legacy/build/bin/ios/debugFramework/",
|
||||||
"$(PROJECT_DIR)",
|
"$(PROJECT_DIR)",
|
||||||
);
|
);
|
||||||
HEADER_SEARCH_PATHS = "$(PROJECT_DIR)/../core/build/bin/ios/debugFramework/LoopHabitTracker.framework/Headers/";
|
HEADER_SEARCH_PATHS = "$(PROJECT_DIR)/../uhabits-core-legacy/build/bin/ios/debugFramework/LoopHabitTracker.framework/Headers/";
|
||||||
INFOPLIST_FILE = Application/Info.plist;
|
INFOPLIST_FILE = Application/Info.plist;
|
||||||
LD_RUNPATH_SEARCH_PATHS = (
|
LD_RUNPATH_SEARCH_PATHS = (
|
||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
@@ -479,10 +479,10 @@
|
|||||||
DEVELOPMENT_TEAM = R5YTHGE3PS;
|
DEVELOPMENT_TEAM = R5YTHGE3PS;
|
||||||
ENABLE_BITCODE = NO;
|
ENABLE_BITCODE = NO;
|
||||||
FRAMEWORK_SEARCH_PATHS = (
|
FRAMEWORK_SEARCH_PATHS = (
|
||||||
"$(PROJECT_DIR)/../core/build/bin/ios/debugFramework/",
|
"$(PROJECT_DIR)/../uhabits-core-legacy/build/bin/ios/debugFramework/",
|
||||||
"$(PROJECT_DIR)",
|
"$(PROJECT_DIR)",
|
||||||
);
|
);
|
||||||
HEADER_SEARCH_PATHS = "$(PROJECT_DIR)/../core/build/bin/ios/debugFramework/LoopHabitTracker.framework/Headers/";
|
HEADER_SEARCH_PATHS = "$(PROJECT_DIR)/../uhabits-core-legacy/build/bin/ios/debugFramework/LoopHabitTracker.framework/Headers/";
|
||||||
INFOPLIST_FILE = Application/Info.plist;
|
INFOPLIST_FILE = Application/Info.plist;
|
||||||
LD_RUNPATH_SEARCH_PATHS = (
|
LD_RUNPATH_SEARCH_PATHS = (
|
||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
|
|||||||
Reference in New Issue
Block a user