mirror of
https://github.com/iSoron/uhabits.git
synced 2025-12-06 09:08:52 -06:00
@@ -27,13 +27,13 @@ plugins {
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdkVersion(29)
|
||||
compileSdkVersion(30)
|
||||
|
||||
defaultConfig {
|
||||
versionCode(20001)
|
||||
versionName("2.0.1-alpha")
|
||||
minSdkVersion(23)
|
||||
targetSdkVersion(29)
|
||||
targetSdkVersion(30)
|
||||
applicationId("org.isoron.uhabits")
|
||||
testInstrumentationRunner("androidx.test.runner.AndroidJUnitRunner")
|
||||
}
|
||||
|
||||
@@ -156,7 +156,7 @@ class ScoreChart : ScrollableChart {
|
||||
drawMarker(activeCanvas, prevRect)
|
||||
}
|
||||
if (k == nColumns - 1) drawMarker(activeCanvas, rect)
|
||||
prevRect!!.set(rect)
|
||||
prevRect!!.set(rect!!)
|
||||
rect!![0f, 0f, columnWidth] = columnHeight.toFloat()
|
||||
rect!!.offset(k * columnWidth, internalPaddingTop.toFloat())
|
||||
drawFooter(activeCanvas, rect, timestamp)
|
||||
|
||||
@@ -147,7 +147,7 @@ class SettingsFragment : PreferenceFragmentCompat(), OnSharedPreferenceChangeLis
|
||||
|
||||
override fun onSharedPreferenceChanged(
|
||||
sharedPreferences: SharedPreferences,
|
||||
key: String
|
||||
key: String?
|
||||
) {
|
||||
if (key == "pref_widget_opacity" && widgetUpdater != null) {
|
||||
Log.d("SettingsFragment", "updating widgets")
|
||||
|
||||
@@ -45,12 +45,16 @@ class SnoozeDelayPickerActivity : FragmentActivity(), OnItemClickListener {
|
||||
super.onCreate(bundle)
|
||||
val intent = intent
|
||||
if (intent == null) finish()
|
||||
if (intent.data == null) finish()
|
||||
val app = applicationContext as HabitsApplication
|
||||
val appComponent = app.component
|
||||
reminderController = appComponent.reminderController
|
||||
habit = appComponent.habitList.getById(ContentUris.parseId(intent.data))
|
||||
val data = intent.data
|
||||
if (data == null) {
|
||||
finish()
|
||||
} else {
|
||||
habit = appComponent.habitList.getById(ContentUris.parseId(data))
|
||||
}
|
||||
if (habit == null) finish()
|
||||
reminderController = appComponent.reminderController
|
||||
val theme = R.style.Theme_AppCompat_Light_Dialog_Alert
|
||||
dialog = AlertDialog.Builder(ContextThemeWrapper(this, theme))
|
||||
.setTitle(R.string.select_snooze_delay)
|
||||
|
||||
@@ -79,7 +79,7 @@ class SharedPreferencesStorage
|
||||
|
||||
override fun onSharedPreferenceChanged(
|
||||
sharedPreferences: SharedPreferences,
|
||||
key: String
|
||||
key: String?
|
||||
) {
|
||||
val preferences = this.preferences ?: return
|
||||
sharedPreferences.unregisterOnSharedPreferenceChangeListener(this)
|
||||
|
||||
@@ -46,7 +46,8 @@ class ReminderReceiver : BroadcastReceiver() {
|
||||
Log.i(TAG, String.format("Received intent: %s", intent.toString()))
|
||||
var habit: Habit? = null
|
||||
val today: Long = getStartOfTodayWithOffset()
|
||||
if (intent.data != null) habit = habits.getById(ContentUris.parseId(intent.data))
|
||||
val data = intent.data
|
||||
if (data != null) habit = habits.getById(ContentUris.parseId(data))
|
||||
val timestamp = intent.getLongExtra("timestamp", today)
|
||||
val reminderTime = intent.getLongExtra("reminderTime", today)
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user