mirror of
https://github.com/iSoron/uhabits.git
synced 2025-12-06 09:08:52 -06:00
Merge branch 'master' into release/2.2.0
This commit is contained in:
@@ -2,11 +2,13 @@ package org.isoron.uhabits.activities.common.dialogs
|
||||
|
||||
import android.app.Dialog
|
||||
import android.os.Bundle
|
||||
import android.provider.Settings
|
||||
import android.text.method.DigitsKeyListener
|
||||
import android.view.KeyEvent
|
||||
import android.view.LayoutInflater
|
||||
import android.view.MotionEvent
|
||||
import android.view.View
|
||||
import android.view.inputmethod.EditorInfo
|
||||
import androidx.appcompat.app.AppCompatDialogFragment
|
||||
import org.isoron.uhabits.HabitsApplication
|
||||
import org.isoron.uhabits.R
|
||||
@@ -65,7 +67,7 @@ class NumberDialog : AppCompatDialogFragment() {
|
||||
save()
|
||||
}
|
||||
view.skipBtnNumber.setOnClickListener {
|
||||
view.value.setText((Entry.SKIP.toDouble() / 1000).toString())
|
||||
view.value.setText(DecimalFormat("#.###").format((Entry.SKIP.toDouble() / 1000)))
|
||||
save()
|
||||
}
|
||||
view.notes.setOnEditorActionListener { v, actionId, event ->
|
||||
@@ -86,6 +88,15 @@ class NumberDialog : AppCompatDialogFragment() {
|
||||
// https://stackoverflow.com/a/34256139
|
||||
val separator = DecimalFormatSymbols.getInstance().decimalSeparator
|
||||
view.value.keyListener = DigitsKeyListener.getInstance("0123456789$separator")
|
||||
|
||||
// https://github.com/flutter/flutter/issues/61175
|
||||
val currKeyboard = Settings.Secure.getString(
|
||||
requireContext().contentResolver,
|
||||
Settings.Secure.DEFAULT_INPUT_METHOD
|
||||
)
|
||||
if (currKeyboard.contains("swiftkey") || currKeyboard.contains("samsung")) {
|
||||
view.value.inputType = EditorInfo.TYPE_CLASS_TEXT
|
||||
}
|
||||
}
|
||||
|
||||
fun save() {
|
||||
|
||||
@@ -25,6 +25,7 @@ import android.app.AlarmManager.RTC_WAKEUP
|
||||
import android.app.PendingIntent
|
||||
import android.content.Context
|
||||
import android.content.Context.ALARM_SERVICE
|
||||
import android.os.Build
|
||||
import android.util.Log
|
||||
import org.isoron.uhabits.core.AppScope
|
||||
import org.isoron.uhabits.core.models.Habit
|
||||
@@ -56,6 +57,10 @@ class IntentScheduler
|
||||
)
|
||||
return SchedulerResult.IGNORED
|
||||
}
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S && !manager.canScheduleExactAlarms()) {
|
||||
Log.e("IntentScheduler", "No permission to schedule exact alarms")
|
||||
return SchedulerResult.IGNORED
|
||||
}
|
||||
manager.setExactAndAllowWhileIdle(alarmType, timestamp, intent)
|
||||
return SchedulerResult.OK
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:inputType="textCapSentences"
|
||||
android:inputType="textCapSentences|textMultiLine"
|
||||
android:textSize="@dimen/smallTextSize"
|
||||
android:padding="4dp"
|
||||
android:background="@color/transparent"
|
||||
|
||||
@@ -44,6 +44,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:textSize="@dimen/smallTextSize"
|
||||
android:maxLines="2"
|
||||
android:textColor="@color/white"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
Reference in New Issue
Block a user