mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-11-28 22:18:46 +03:00
Merge pull request #6047 from chagai95/add-presence-indicator-busy-and-away
add presence indicator busy and away
This commit is contained in:
commit
90035de5f2
11 changed files with 75 additions and 3 deletions
1
changelog.d/6047.feature
Normal file
1
changelog.d/6047.feature
Normal file
|
@ -0,0 +1 @@
|
|||
Add presence indicator busy and away.
|
|
@ -126,6 +126,14 @@
|
|||
<color name="vctr_presence_indicator_online_light">@color/palette_element_green</color>
|
||||
<color name="vctr_presence_indicator_online_dark">@color/palette_element_green</color>
|
||||
|
||||
<attr name="vctr_presence_indicator_busy" format="color" />
|
||||
<color name="vctr_presence_indicator_busy_light">@color/element_alert_light</color>
|
||||
<color name="vctr_presence_indicator_busy_dark">@color/element_alert_dark</color>
|
||||
|
||||
<attr name="vctr_presence_indicator_away" format="color" />
|
||||
<color name="vctr_presence_indicator_away_light">@color/palette_element_orange</color>
|
||||
<color name="vctr_presence_indicator_away_dark">@color/palette_element_orange</color>
|
||||
|
||||
<!-- Location sharing colors -->
|
||||
<attr name="vctr_live_location" format="color" />
|
||||
<color name="vctr_live_location_light">@color/palette_prune</color>
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
<color name="palette_melon">#FF812D</color>
|
||||
|
||||
<color name="palette_element_green">#0DBD8B</color>
|
||||
<color name="palette_element_orange">#D9B072</color>
|
||||
<color name="palette_white">#FFFFFF</color>
|
||||
<color name="palette_vermilion">#FF5B55</color>
|
||||
<!-- (unused) -->
|
||||
|
|
|
@ -44,6 +44,8 @@
|
|||
<!-- Presence Indicator colors -->
|
||||
<item name="vctr_presence_indicator_offline">@color/vctr_presence_indicator_offline_dark</item>
|
||||
<item name="vctr_presence_indicator_online">@color/vctr_presence_indicator_online_dark</item>
|
||||
<item name="vctr_presence_indicator_busy">@color/vctr_presence_indicator_busy_dark</item>
|
||||
<item name="vctr_presence_indicator_away">@color/vctr_presence_indicator_away_dark</item>
|
||||
|
||||
<!-- Some aliases -->
|
||||
<item name="vctr_header_background">?vctr_system</item>
|
||||
|
|
|
@ -44,6 +44,8 @@
|
|||
<!-- Presence Indicator colors -->
|
||||
<item name="vctr_presence_indicator_offline">@color/vctr_presence_indicator_offline_light</item>
|
||||
<item name="vctr_presence_indicator_online">@color/vctr_presence_indicator_online_light</item>
|
||||
<item name="vctr_presence_indicator_busy">@color/vctr_presence_indicator_busy_light</item>
|
||||
<item name="vctr_presence_indicator_away">@color/vctr_presence_indicator_away_light</item>
|
||||
|
||||
<!-- Some aliases -->
|
||||
<item name="vctr_header_background">?vctr_system</item>
|
||||
|
|
|
@ -28,7 +28,10 @@ enum class PresenceEnum(val value: String) {
|
|||
OFFLINE("offline"),
|
||||
|
||||
@Json(name = "unavailable")
|
||||
UNAVAILABLE("unavailable");
|
||||
UNAVAILABLE("unavailable"),
|
||||
|
||||
@Json(name = "org.matrix.msc3026.busy")
|
||||
BUSY("busy");
|
||||
|
||||
companion object {
|
||||
fun from(s: String): PresenceEnum? = values().find { it.value == s }
|
||||
|
|
|
@ -29,6 +29,7 @@ import org.matrix.android.sdk.api.session.presence.model.PresenceEnum
|
|||
internal enum class SyncPresence(val value: String) {
|
||||
Offline("offline"),
|
||||
Online("online"),
|
||||
Busy("busy"),
|
||||
Unavailable("unavailable");
|
||||
|
||||
companion object {
|
||||
|
@ -36,6 +37,7 @@ internal enum class SyncPresence(val value: String) {
|
|||
return when (presenceEnum) {
|
||||
PresenceEnum.ONLINE -> Online
|
||||
PresenceEnum.OFFLINE -> Offline
|
||||
PresenceEnum.BUSY -> Busy
|
||||
PresenceEnum.UNAVAILABLE -> Unavailable
|
||||
}
|
||||
}
|
||||
|
|
|
@ -42,13 +42,17 @@ class PresenceStateImageView @JvmOverloads constructor(
|
|||
contentDescription = context.getString(R.string.a11y_presence_online)
|
||||
}
|
||||
PresenceEnum.UNAVAILABLE -> {
|
||||
setImageResource(R.drawable.ic_presence_offline)
|
||||
setImageResource(R.drawable.ic_presence_away)
|
||||
contentDescription = context.getString(R.string.a11y_presence_unavailable)
|
||||
}
|
||||
PresenceEnum.OFFLINE -> {
|
||||
setImageResource(R.drawable.ic_presence_offline)
|
||||
contentDescription = context.getString(R.string.a11y_presence_offline)
|
||||
}
|
||||
PresenceEnum.BUSY -> {
|
||||
setImageResource(R.drawable.ic_presence_busy)
|
||||
contentDescription = context.getString(R.string.a11y_presence_busy)
|
||||
}
|
||||
null -> Unit
|
||||
}
|
||||
}
|
||||
|
|
24
vector/src/main/res/drawable/ic_presence_away.xml
Normal file
24
vector/src/main/res/drawable/ic_presence_away.xml
Normal file
|
@ -0,0 +1,24 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<vector
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:aapt="http://schemas.android.com/aapt"
|
||||
android:width="11.89dp"
|
||||
android:height="12dp"
|
||||
android:viewportWidth="11.89"
|
||||
android:viewportHeight="12"
|
||||
>
|
||||
|
||||
<group>
|
||||
|
||||
<clip-path
|
||||
android:pathData="M11.8857 6C11.8857 9.31371 9.225 12 5.94286 12C2.66071 12 0 9.31371 0 6C0 2.68629 2.66071 0 5.94286 0C9.225 0 11.8857 2.68629 11.8857 6Z"
|
||||
/>
|
||||
|
||||
<path
|
||||
android:pathData="M0 0V12H11.8857V0"
|
||||
android:fillColor="?vctr_presence_indicator_away"
|
||||
/>
|
||||
|
||||
</group>
|
||||
|
||||
</vector>
|
24
vector/src/main/res/drawable/ic_presence_busy.xml
Normal file
24
vector/src/main/res/drawable/ic_presence_busy.xml
Normal file
|
@ -0,0 +1,24 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<vector
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:aapt="http://schemas.android.com/aapt"
|
||||
android:width="11.89dp"
|
||||
android:height="12dp"
|
||||
android:viewportWidth="11.89"
|
||||
android:viewportHeight="12"
|
||||
>
|
||||
|
||||
<group>
|
||||
|
||||
<clip-path
|
||||
android:pathData="M11.8857 6C11.8857 9.31371 9.225 12 5.94286 12C2.66071 12 0 9.31371 0 6C0 2.68629 2.66071 0 5.94286 0C9.225 0 11.8857 2.68629 11.8857 6Z"
|
||||
/>
|
||||
|
||||
<path
|
||||
android:pathData="M0 0V12H11.8857V0"
|
||||
android:fillColor="?vctr_presence_indicator_busy"
|
||||
/>
|
||||
|
||||
</group>
|
||||
|
||||
</vector>
|
|
@ -2730,7 +2730,8 @@
|
|||
<string name="a11y_public_room">Public room</string>
|
||||
<string name="a11y_presence_online">Online</string>
|
||||
<string name="a11y_presence_offline">Offline</string>
|
||||
<string name="a11y_presence_unavailable">Unavailable</string>
|
||||
<string name="a11y_presence_busy">Busy</string>
|
||||
<string name="a11y_presence_unavailable">Away</string>
|
||||
|
||||
<string name="dev_tools_menu_name">Dev Tools</string>
|
||||
<string name="dev_tools_explore_room_state">Explore Room State</string>
|
||||
|
|
Loading…
Reference in a new issue