mirror of
https://github.com/iSoron/uhabits.git
synced 2025-12-10 11:08:52 -06:00
Compare commits
3 Commits
8b55ffb147
...
d4f4f8b4a9
| Author | SHA1 | Date | |
|---|---|---|---|
|
d4f4f8b4a9
|
|||
|
9ca1aa911a
|
|||
|
ba57ebad31
|
@@ -25,6 +25,7 @@ import android.app.AlarmManager.RTC_WAKEUP
|
|||||||
import android.app.PendingIntent
|
import android.app.PendingIntent
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.content.Context.ALARM_SERVICE
|
import android.content.Context.ALARM_SERVICE
|
||||||
|
import android.os.Build
|
||||||
import android.util.Log
|
import android.util.Log
|
||||||
import org.isoron.uhabits.core.AppScope
|
import org.isoron.uhabits.core.AppScope
|
||||||
import org.isoron.uhabits.core.models.Habit
|
import org.isoron.uhabits.core.models.Habit
|
||||||
@@ -56,6 +57,10 @@ class IntentScheduler
|
|||||||
)
|
)
|
||||||
return SchedulerResult.IGNORED
|
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)
|
manager.setExactAndAllowWhileIdle(alarmType, timestamp, intent)
|
||||||
return SchedulerResult.OK
|
return SchedulerResult.OK
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,7 +36,7 @@
|
|||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:inputType="textCapSentences"
|
android:inputType="textCapSentences|textMultiLine"
|
||||||
android:textSize="@dimen/smallTextSize"
|
android:textSize="@dimen/smallTextSize"
|
||||||
android:padding="4dp"
|
android:padding="4dp"
|
||||||
android:background="@color/transparent"
|
android:background="@color/transparent"
|
||||||
|
|||||||
@@ -44,6 +44,7 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:textSize="@dimen/smallTextSize"
|
android:textSize="@dimen/smallTextSize"
|
||||||
|
android:maxLines="2"
|
||||||
android:textColor="@color/white"/>
|
android:textColor="@color/white"/>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|||||||
@@ -125,4 +125,30 @@ class WidgetTheme : LightTheme() {
|
|||||||
override val highContrastTextColor = Color.WHITE
|
override val highContrastTextColor = Color.WHITE
|
||||||
override val mediumContrastTextColor = Color.WHITE.withAlpha(0.50)
|
override val mediumContrastTextColor = Color.WHITE.withAlpha(0.50)
|
||||||
override val lowContrastTextColor = Color.WHITE.withAlpha(0.10)
|
override val lowContrastTextColor = Color.WHITE.withAlpha(0.10)
|
||||||
|
|
||||||
|
override fun color(paletteIndex: Int): Color {
|
||||||
|
return when (paletteIndex) {
|
||||||
|
0 -> Color(0xD32F2F)
|
||||||
|
1 -> Color(0xE64A19)
|
||||||
|
2 -> Color(0xF57C00)
|
||||||
|
3 -> Color(0xFF8F00)
|
||||||
|
4 -> Color(0xF9A825)
|
||||||
|
5 -> Color(0xAFB42B)
|
||||||
|
6 -> Color(0x7CB342)
|
||||||
|
7 -> Color(0x388E3C)
|
||||||
|
8 -> Color(0x00897B)
|
||||||
|
9 -> Color(0x00ACC1)
|
||||||
|
10 -> Color(0x039BE5)
|
||||||
|
11 -> Color(0x1976D2)
|
||||||
|
12 -> Color(0x6275f0)
|
||||||
|
13 -> Color(0x5E35B1)
|
||||||
|
14 -> Color(0x8E24AA)
|
||||||
|
15 -> Color(0xD81B60)
|
||||||
|
16 -> Color(0x5D4037)
|
||||||
|
17 -> Color(0x757575)
|
||||||
|
18 -> Color(0x757575)
|
||||||
|
19 -> Color(0x9E9E9E)
|
||||||
|
else -> Color(0x000000)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user