mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-17 11:28:06 +00:00
Updated chat message in progress status icon (now animated)
This commit is contained in:
parent
f1eca63b5a
commit
5cc8407077
7 changed files with 49 additions and 28 deletions
|
|
@ -154,13 +154,7 @@ class ChatMessageModel @WorkerThread constructor(
|
|||
private val chatMessageListener = object : ChatMessageListenerStub() {
|
||||
@WorkerThread
|
||||
override fun onMsgStateChanged(message: ChatMessage, messageState: ChatMessage.State?) {
|
||||
if (
|
||||
messageState == ChatMessage.State.FileTransferInProgress ||
|
||||
messageState == ChatMessage.State.FileTransferDone ||
|
||||
messageState == ChatMessage.State.FileTransferError
|
||||
) {
|
||||
statusIcon.postValue(LinphoneUtils.getChatIconResId(chatMessage.state))
|
||||
}
|
||||
statusIcon.postValue(LinphoneUtils.getChatIconResId(chatMessage.state))
|
||||
|
||||
if (messageState == ChatMessage.State.FileTransferDone) {
|
||||
Log.i("$TAG File transfer is done")
|
||||
|
|
|
|||
|
|
@ -193,7 +193,7 @@ class LinphoneUtils {
|
|||
@IntegerRes
|
||||
fun getChatIconResId(chatState: ChatMessage.State): Int {
|
||||
return when (chatState) {
|
||||
ChatMessage.State.Displayed -> {
|
||||
ChatMessage.State.Displayed, ChatMessage.State.FileTransferDone -> {
|
||||
R.drawable.checks
|
||||
}
|
||||
ChatMessage.State.DeliveredToUser -> {
|
||||
|
|
@ -202,14 +202,14 @@ class LinphoneUtils {
|
|||
ChatMessage.State.Delivered -> {
|
||||
R.drawable.envelope_simple
|
||||
}
|
||||
ChatMessage.State.InProgress -> {
|
||||
R.drawable.in_progress
|
||||
}
|
||||
ChatMessage.State.NotDelivered -> {
|
||||
ChatMessage.State.NotDelivered, ChatMessage.State.FileTransferError -> {
|
||||
R.drawable.warning_circle
|
||||
}
|
||||
ChatMessage.State.InProgress, ChatMessage.State.FileTransferInProgress -> {
|
||||
R.drawable.animated_in_progress
|
||||
}
|
||||
else -> {
|
||||
R.drawable.not_trusted
|
||||
R.drawable.animated_in_progress
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
7
app/src/main/res/animator/rotation.xml
Normal file
7
app/src/main/res/animator/rotation.xml
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<objectAnimator xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:duration="3000"
|
||||
android:propertyName="rotation"
|
||||
android:valueFrom="0"
|
||||
android:valueTo="360"
|
||||
android:repeatCount="infinite"/>
|
||||
6
app/src/main/res/drawable/animated_in_progress.xml
Normal file
6
app/src/main/res/drawable/animated_in_progress.xml
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
<animated-vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:drawable="@drawable/in_progress" >
|
||||
<target
|
||||
android:name="rotationGroup"
|
||||
android:animation="@animator/rotation" />
|
||||
</animated-vector>
|
||||
|
|
@ -3,7 +3,13 @@
|
|||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:pathData="M12.692,3.692V6.462C12.692,6.645 12.619,6.821 12.49,6.951C12.36,7.081 12.184,7.154 12,7.154C11.816,7.154 11.64,7.081 11.51,6.951C11.381,6.821 11.308,6.645 11.308,6.462V3.692C11.308,3.509 11.381,3.333 11.51,3.203C11.64,3.073 11.816,3 12,3C12.184,3 12.36,3.073 12.49,3.203C12.619,3.333 12.692,3.509 12.692,3.692ZM15.916,8.776C16.007,8.776 16.097,8.758 16.181,8.724C16.265,8.689 16.341,8.637 16.406,8.573L18.364,6.616C18.494,6.486 18.567,6.309 18.567,6.126C18.567,5.942 18.494,5.766 18.364,5.636C18.234,5.506 18.058,5.433 17.874,5.433C17.691,5.433 17.514,5.506 17.384,5.636L15.427,7.594C15.33,7.691 15.264,7.814 15.237,7.949C15.21,8.083 15.224,8.222 15.276,8.349C15.329,8.475 15.417,8.583 15.531,8.66C15.645,8.736 15.779,8.776 15.916,8.776ZM20.308,11.308H17.538C17.355,11.308 17.179,11.381 17.049,11.51C16.919,11.64 16.846,11.816 16.846,12C16.846,12.184 16.919,12.36 17.049,12.49C17.179,12.619 17.355,12.692 17.538,12.692H20.308C20.491,12.692 20.667,12.619 20.797,12.49C20.927,12.36 21,12.184 21,12C21,11.816 20.927,11.64 20.797,11.51C20.667,11.381 20.491,11.308 20.308,11.308ZM16.406,15.427C16.275,15.303 16.101,15.234 15.92,15.237C15.739,15.239 15.567,15.312 15.439,15.439C15.312,15.567 15.239,15.739 15.237,15.92C15.234,16.101 15.303,16.275 15.427,16.406L17.384,18.364C17.514,18.494 17.691,18.567 17.874,18.567C18.058,18.567 18.234,18.494 18.364,18.364C18.494,18.234 18.567,18.058 18.567,17.874C18.567,17.691 18.494,17.514 18.364,17.384L16.406,15.427ZM12,16.846C11.816,16.846 11.64,16.919 11.51,17.049C11.381,17.179 11.308,17.355 11.308,17.538V20.308C11.308,20.491 11.381,20.667 11.51,20.797C11.64,20.927 11.816,21 12,21C12.184,21 12.36,20.927 12.49,20.797C12.619,20.667 12.692,20.491 12.692,20.308V17.538C12.692,17.355 12.619,17.179 12.49,17.049C12.36,16.919 12.184,16.846 12,16.846ZM7.594,15.427L5.636,17.384C5.506,17.514 5.433,17.691 5.433,17.874C5.433,18.058 5.506,18.234 5.636,18.364C5.766,18.494 5.942,18.567 6.126,18.567C6.309,18.567 6.486,18.494 6.616,18.364L8.573,16.406C8.697,16.275 8.766,16.101 8.763,15.92C8.761,15.739 8.688,15.567 8.561,15.439C8.433,15.312 8.261,15.239 8.08,15.237C7.899,15.234 7.725,15.303 7.594,15.427ZM7.154,12C7.154,11.816 7.081,11.64 6.951,11.51C6.821,11.381 6.645,11.308 6.462,11.308H3.692C3.509,11.308 3.333,11.381 3.203,11.51C3.073,11.64 3,11.816 3,12C3,12.184 3.073,12.36 3.203,12.49C3.333,12.619 3.509,12.692 3.692,12.692H6.462C6.645,12.692 6.821,12.619 6.951,12.49C7.081,12.36 7.154,12.184 7.154,12ZM6.616,5.636C6.486,5.506 6.309,5.433 6.126,5.433C5.942,5.433 5.766,5.506 5.636,5.636C5.506,5.766 5.433,5.942 5.433,6.126C5.433,6.309 5.506,6.486 5.636,6.616L7.594,8.573C7.725,8.697 7.899,8.766 8.08,8.763C8.261,8.761 8.433,8.688 8.561,8.561C8.688,8.433 8.761,8.261 8.763,8.08C8.766,7.899 8.697,7.725 8.573,7.594L6.616,5.636Z"
|
||||
android:fillColor="#FE5E00"/>
|
||||
<group
|
||||
android:name="rotationGroup"
|
||||
android:pivotX="12.0"
|
||||
android:pivotY="12.0"
|
||||
android:rotation="0" >
|
||||
<path
|
||||
android:pathData="M12.692,3.692V6.462C12.692,6.645 12.619,6.821 12.49,6.951C12.36,7.081 12.184,7.154 12,7.154C11.816,7.154 11.64,7.081 11.51,6.951C11.381,6.821 11.308,6.645 11.308,6.462V3.692C11.308,3.509 11.381,3.333 11.51,3.203C11.64,3.073 11.816,3 12,3C12.184,3 12.36,3.073 12.49,3.203C12.619,3.333 12.692,3.509 12.692,3.692ZM15.916,8.776C16.007,8.776 16.097,8.758 16.181,8.724C16.265,8.689 16.341,8.637 16.406,8.573L18.364,6.616C18.494,6.486 18.567,6.309 18.567,6.126C18.567,5.942 18.494,5.766 18.364,5.636C18.234,5.506 18.058,5.433 17.874,5.433C17.691,5.433 17.514,5.506 17.384,5.636L15.427,7.594C15.33,7.691 15.264,7.814 15.237,7.949C15.21,8.083 15.224,8.222 15.276,8.349C15.329,8.475 15.417,8.583 15.531,8.66C15.645,8.736 15.779,8.776 15.916,8.776ZM20.308,11.308H17.538C17.355,11.308 17.179,11.381 17.049,11.51C16.919,11.64 16.846,11.816 16.846,12C16.846,12.184 16.919,12.36 17.049,12.49C17.179,12.619 17.355,12.692 17.538,12.692H20.308C20.491,12.692 20.667,12.619 20.797,12.49C20.927,12.36 21,12.184 21,12C21,11.816 20.927,11.64 20.797,11.51C20.667,11.381 20.491,11.308 20.308,11.308ZM16.406,15.427C16.275,15.303 16.101,15.234 15.92,15.237C15.739,15.239 15.567,15.312 15.439,15.439C15.312,15.567 15.239,15.739 15.237,15.92C15.234,16.101 15.303,16.275 15.427,16.406L17.384,18.364C17.514,18.494 17.691,18.567 17.874,18.567C18.058,18.567 18.234,18.494 18.364,18.364C18.494,18.234 18.567,18.058 18.567,17.874C18.567,17.691 18.494,17.514 18.364,17.384L16.406,15.427ZM12,16.846C11.816,16.846 11.64,16.919 11.51,17.049C11.381,17.179 11.308,17.355 11.308,17.538V20.308C11.308,20.491 11.381,20.667 11.51,20.797C11.64,20.927 11.816,21 12,21C12.184,21 12.36,20.927 12.49,20.797C12.619,20.667 12.692,20.491 12.692,20.308V17.538C12.692,17.355 12.619,17.179 12.49,17.049C12.36,16.919 12.184,16.846 12,16.846ZM7.594,15.427L5.636,17.384C5.506,17.514 5.433,17.691 5.433,17.874C5.433,18.058 5.506,18.234 5.636,18.364C5.766,18.494 5.942,18.567 6.126,18.567C6.309,18.567 6.486,18.494 6.616,18.364L8.573,16.406C8.697,16.275 8.766,16.101 8.763,15.92C8.761,15.739 8.688,15.567 8.561,15.439C8.433,15.312 8.261,15.239 8.08,15.237C7.899,15.234 7.725,15.303 7.594,15.427ZM7.154,12C7.154,11.816 7.081,11.64 6.951,11.51C6.821,11.381 6.645,11.308 6.462,11.308H3.692C3.509,11.308 3.333,11.381 3.203,11.51C3.073,11.64 3,11.816 3,12C3,12.184 3.073,12.36 3.203,12.49C3.333,12.619 3.509,12.692 3.692,12.692H6.462C6.645,12.692 6.821,12.619 6.951,12.49C7.081,12.36 7.154,12.184 7.154,12ZM6.616,5.636C6.486,5.506 6.309,5.433 6.126,5.433C5.942,5.433 5.766,5.506 5.636,5.636C5.506,5.766 5.433,5.942 5.433,6.126C5.433,6.309 5.506,6.486 5.636,6.616L7.594,8.573C7.725,8.697 7.899,8.766 8.08,8.763C8.261,8.761 8.433,8.688 8.561,8.561C8.688,8.433 8.761,8.261 8.763,8.08C8.766,7.899 8.697,7.725 8.573,7.594L6.616,5.636Z"
|
||||
android:fillColor="#FE5E00"/>
|
||||
</group>
|
||||
</vector>
|
||||
|
|
|
|||
|
|
@ -1,12 +1,20 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="100dp"
|
||||
android:height="102dp"
|
||||
android:viewportWidth="100"
|
||||
android:viewportHeight="102">
|
||||
<path
|
||||
android:pathData="M8.69,20.03C8.69,20.03 -1.4,33.94 0.17,40.21C0.11,39.96 6.77,32.9 6.77,32.9C7.12,34.81 23.3,39.51 23.3,39.51C25.44,40.88 26.19,41.86 26.6,44.03V52.38C32.19,55.86 37.32,57.01 49.73,57.77C62.92,57.21 68.37,56.04 73.21,52.38C73.21,52.38 72.69,45.94 73.21,43.68C73.74,41.42 74.89,40.13 76.69,39.51C83.4,37.97 86.72,36.29 93.04,33.07L100,40.21C98.94,32.36 97.13,28.02 91.65,20.38C87.31,15.41 84.52,12.81 78.78,8.55C72.54,4.86 69.08,3.46 62.95,1.77C52.32,-0.41 46.45,-0.4 36.17,1.77C29.87,3.67 26.73,5.1 22.08,8.55C22.08,8.55 4.51,-1.54 2.25,0.2C-0.01,1.94 8.69,20.03 8.69,20.03Z"
|
||||
android:fillColor="#FF5E00"/>
|
||||
<path
|
||||
android:pathData="M20.7,73.92C12.62,70.38 8.24,67.71 0.7,61.74C2.51,69.25 4.2,73.21 8.35,79.83C12.77,85.81 15.48,88.48 20.7,92.18C26.34,96.05 29.72,97.74 36.18,99.83C41.98,101.23 45.22,101.67 50.96,101.75C56.82,101.46 59.86,100.82 64.88,99.66C70.41,97.46 73.23,96.06 77.92,93.4C85.7,97.79 95.31,102.79 96.7,100.71C98.1,98.62 90.44,81.75 90.44,81.75C95.55,74.44 97.63,69.51 99.66,61.22C92.67,66.7 88.14,69.9 79.49,73.92C68.79,78.14 62.55,79.5 50.96,79.83C37.46,79.6 30.86,78.26 20.7,73.92Z"
|
||||
android:fillColor="#FF5E00"/>
|
||||
<vector
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:name="vector"
|
||||
android:width="60dp"
|
||||
android:height="60dp"
|
||||
android:viewportWidth="60"
|
||||
android:viewportHeight="60">
|
||||
<group
|
||||
android:name="group"
|
||||
android:translateX="15"
|
||||
android:translateY="15"
|
||||
android:scaleX="0.5"
|
||||
android:scaleY="0.5">
|
||||
<path
|
||||
android:name="path"
|
||||
android:pathData="M 53.893 48.839 C 56.543 45.357 58.459 41.276 59.39 36.828 C 51.515 43.716 41.339 47.882 30.236 47.882 C 19.111 47.882 9.047 43.873 1.173 36.976 C 4.074 50.479 15.993 60.599 30.266 60.599 C 36.279 60.598 41.87 58.797 46.551 55.708 C 49.343 57.294 56.667 61.285 57.624 60.051 C 58.282 59.201 56.671 55.692 56.671 55.692 L 53.893 48.839 Z M 59.301 21.99 C 59.189 21.455 58.702 20.063 58.702 20.063 C 54.383 8.89 42.981 0.963 30.318 0.963 L 30.245 0.963 C 24.273 0.963 18.582 2.728 13.782 5.763 C 11.591 4.504 3.17 -0.209 2.138 1.115 C 1.48 1.962 3.092 5.461 3.092 5.461 L 6.052 12.731 C 4.31 14.952 2.884 17.415 1.86 20.063 C 1.86 20.063 1.373 21.455 1.261 21.99 C 1.101 22.752 0.883 24.274 0.883 24.274 L 4.937 20.151 C 4.937 20.151 7.942 21.927 10.81 22.819 C 11.936 23.168 13.046 23.566 14.185 23.852 C 15.909 24.285 16.698 25.828 16.693 27.244 C 16.688 28.443 16.696 29.639 16.689 30.838 C 16.688 31.38 16.879 31.784 17.365 32.067 C 18.49 32.72 19.705 33.117 20.955 33.44 C 24.199 34.277 26.923 34.736 30.245 34.701 L 30.318 34.701 C 33.64 34.736 36.364 34.277 39.608 33.44 C 40.858 33.117 42.072 32.72 43.198 32.067 C 43.684 31.784 43.874 31.38 43.873 30.838 C 43.866 29.639 43.874 28.443 43.869 27.244 C 43.864 25.828 44.653 24.285 46.377 23.852 C 47.516 23.566 48.628 23.168 49.752 22.819 C 52.62 21.927 55.626 20.151 55.626 20.151 L 59.68 24.274 C 59.68 24.274 59.462 22.752 59.301 21.99"
|
||||
android:fillColor="@color/orange_main_500"
|
||||
android:strokeWidth="1"/>
|
||||
</group>
|
||||
</vector>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<resources>
|
||||
<!-- Base application theme. -->
|
||||
<style name="AppSplashScreenTheme" parent="Theme.SplashScreen">
|
||||
<item name="windowSplashScreenBackground">@color/black</item>
|
||||
<item name="windowSplashScreenBackground">@color/white</item>
|
||||
<item name="windowSplashScreenAnimatedIcon">@drawable/linphone</item>
|
||||
<item name="postSplashScreenTheme">@style/Theme.Linphone</item>
|
||||
</style>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue