Merge branch 'iSoron:dev' into dev

pull/1356/head
Jakub Kalinowski 4 years ago committed by GitHub
commit 5744587f60
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -99,7 +99,7 @@ class NumberPickerFactory
picker.clearFocus()
picker2.clearFocus()
val v = picker.value + 0.01 * picker2.value
val note = etNotes.text.toString()
val note = etNotes.text.toString().trim()
callback.onNumberPicked(v, note)
}
.setNegativeButton(android.R.string.cancel) { _, _ ->

@ -83,7 +83,6 @@ class CheckmarkButtonView(
private var drawer = Drawer()
init {
isFocusable = false
setOnClickListener(this)
setOnLongClickListener(this)
}

@ -306,7 +306,7 @@ class HabitCardView(
}
companion object {
const val TOGGLE_DELAY_MILLIS = 2000L
const val TOGGLE_DELAY_MILLIS = 1000L
fun (() -> Unit).delay(delayInMillis: Long) {
Handler(Looper.getMainLooper()).postDelayed(this, delayInMillis)

@ -25,7 +25,6 @@ import android.app.NotificationChannel
import android.app.NotificationManager
import android.content.Context
import android.graphics.BitmapFactory.decodeResource
import android.graphics.Color
import android.os.Build
import android.os.Build.VERSION.SDK_INT
import android.util.Log
@ -150,9 +149,6 @@ class AndroidNotificationTray
if (!disableSound)
builder.setSound(ringtoneManager.getURI())
if (preferences.shouldMakeNotificationsLed())
builder.setLights(Color.RED, 1000, 1000)
if (SDK_INT < Build.VERSION_CODES.S) {
val snoozeAction = Action(
R.drawable.ic_action_snooze,

@ -90,8 +90,6 @@ class SharedPreferencesStorage
preferences.isMidnightDelayEnabled = getBoolean(key, false)
"pref_sticky_notifications" ->
preferences.setNotificationsSticky(getBoolean(key, false))
"pref_led_notifications" ->
preferences.setNotificationsLed(getBoolean(key, false))
"pref_unknown_enabled" -> {
preferences.areQuestionMarksEnabled = getBoolean(key, false)
}

@ -99,13 +99,6 @@
android:title="@string/sticky_notifications"
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
android:key="reminderCustomize"
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()
}
fun setNotificationsLed(enabled: Boolean) {
storage.putBoolean("pref_led_notifications", enabled)
for (l in listeners) l.onNotificationsChanged()
}
fun shouldMakeNotificationsSticky(): Boolean {
return storage.getBoolean("pref_sticky_notifications", false)
}
fun shouldMakeNotificationsLed(): Boolean {
return storage.getBoolean("pref_led_notifications", false)
}
open var isCheckmarkSequenceReversed: Boolean
get() {
if (shouldReverseCheckmarks == null) shouldReverseCheckmarks =

@ -87,7 +87,7 @@ class HistoryChart(
val col = ((x - padding) / squareSize).toInt()
val row = ((y - padding) / squareSize).toInt()
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)
if (clickedDate.isNewerThan(today)) return
if (isLongClick) {

@ -116,9 +116,6 @@ class PreferencesTest : BaseUnitTest() {
assertFalse(prefs.shouldMakeNotificationsSticky())
prefs.setNotificationsSticky(true)
assertTrue(prefs.shouldMakeNotificationsSticky())
assertFalse(prefs.shouldMakeNotificationsLed())
prefs.setNotificationsLed(true)
assertTrue(prefs.shouldMakeNotificationsLed())
}
@Test

@ -61,7 +61,7 @@
00C0C6BA22465F65003D8AF0 /* fonts */ = {isa = PBXFileReference; lastKnownFileType = folder; path = fonts; sourceTree = "<group>"; };
00C0C6BB22465F65003D8AF0 /* databases */ = {isa = PBXFileReference; lastKnownFileType = folder; path = databases; 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>"; };
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>"; };
@ -157,7 +157,7 @@
00C0C6BC22465F65003D8AF0 /* migrations */,
);
name = Assets;
path = ../core/assets/main;
path = "../uhabits-core-legacy/assets/main";
sourceTree = "<group>";
};
00C0C6D622471BA3003D8AF0 /* Platform */ = {
@ -285,7 +285,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "cd ../core\n./gradlew linkDebugFrameworkIos\n";
shellScript = "cd ../uhabits-core-legacy\n../gradlew linkDebugFrameworkIos\n";
};
/* End PBXShellScriptBuildPhase section */
@ -451,10 +451,10 @@
DEVELOPMENT_TEAM = R5YTHGE3PS;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(PROJECT_DIR)/../core/build/bin/ios/debugFramework/",
"$(PROJECT_DIR)/../uhabits-core-legacy/build/bin/ios/debugFramework/",
"$(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;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
@ -479,10 +479,10 @@
DEVELOPMENT_TEAM = R5YTHGE3PS;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(PROJECT_DIR)/../core/build/bin/ios/debugFramework/",
"$(PROJECT_DIR)/../uhabits-core-legacy/build/bin/ios/debugFramework/",
"$(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;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",

Loading…
Cancel
Save