this commit fixes bugs from d3056ff2825e53040ca49b86b84f91f73a3eb11c and 1185dcf17a99ca62efd32f8a53c298ec4fd6c4d0
fix onBackPressed handling to use OnBackPressedCallback
remove unnecessary onBackPressedCallback's when they only finished the activity
replaced some finishAffinity methods with finish
...
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
Fields should be declared at the top of the class, before any method declarations, constructors, initializers or inner classes.
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
..."Resource IDs will be non-final by default in Android Gradle Plugin version 8.0, avoid using them as annotation attributes" by using @KeyByString
keys were also wrong by copy&paste and are now fixed
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
Without this refreshing of capabilites, depending settings (for now read privacy) were never updated until app was started again because the user still contained old capabilities.
This fix will also be necessary for the typing indicator setting.
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
Although listening from the signaling was working fine and this
unfortunately adds a lot of extra code it is conceptually "more
correct", as the UI should not directly deal with the signaling if there
is a higher abstraction available. Nevertheless, this should ease adding
other similar changes, like reactions.
Note that although there were already listeners for
CallParticipantModel.Observer in the CallActivity they were not reused,
as they handle totally unrelated things.
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
The CallParticipantModel observer now also emits one-time events that
are not reflected in the model state.
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
hide delete option from conversation info edit view if no custom avatar is set
remove themed avatars (This is the price of being able to have emoji avatars)
fix dark mode url
remove avatarVersion from url if it's null
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
Since most controllers were replaced by activities, the screen locking was temporarily broken. This commit fixes the screen locking to also work with the activities.
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
only show users avatars.
conversation avatars were removed again for now, because this would need more work to add custom view to the supportActionBar in order to show themed drawables.
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
otherwise:
E FATAL EXCEPTION: main
Process: com.nextcloud.talk2, PID: 13169
io.reactivex.exceptions.UndeliverableException: The exception could not be delivered to the consumer because it has already canceled/disposed the flow or the exception has nowhere to go to begin with. Further reading: https://github.com/ReactiveX/RxJava/wiki/What's-different-in-2.0#error-handling | kotlin.UninitializedPropertyAccessException: lateinit property optionsMenu has not been initialized
at io.reactivex.plugins.RxJavaPlugins.onError(RxJavaPlugins.java:367)
at io.reactivex.android.schedulers.HandlerScheduler$ScheduledRunnable.run(HandlerScheduler.java:126)
at android.os.Handler.handleCallback(Handler.java:942)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:226)
at android.os.Looper.loop(Looper.java:313)
at android.app.ActivityThread.main(ActivityThread.java:8757)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1067)
Caused by: kotlin.UninitializedPropertyAccessException: lateinit property optionsMenu has not been initialized
at com.nextcloud.talk.conversation.info.ConversationInfoActivity.showOptionsMenu(ConversationInfoActivity.kt:214)
at com.nextcloud.talk.conversation.info.ConversationInfoActivity$fetchRoomInfo$1.onNext(ConversationInfoActivity.kt:670)
at com.nextcloud.talk.conversation.info.ConversationInfoActivity$fetchRoomInfo$1.onNext(ConversationInfoActivity.kt:652)
at io.reactivex.internal.operators.observable.ObservableObserveOn$ObserveOnObserver.drainNormal(ObservableObserveOn.java:201)
at io.reactivex.internal.operators.observable.ObservableObserveOn$ObserveOnObserver.run(ObservableObserveOn.java:255)
at io.reactivex.android.schedulers.HandlerScheduler$ScheduledRunnable.run(HandlerScheduler.java:124)
at android.os.Handler.handleCallback(Handler.java:942)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:226)
at android.os.Looper.loop(Looper.java:313)
at android.app.ActivityThread.main(ActivityThread.java:8757)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1067)
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
this looks smoother when loading the avatars (less flickering)
"error" and "fallback" take over if something goes wrong.
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
Placeholder avatars now also come from the server. This means themed avatars from the android app itself are no longer used here. The static placeholder icons defined in loadConversationAvatar are only used when the http request fails completely.
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
Placeholder avatars now also come from the server. This means themed avatars from the android app itself are no longer used here. The static placeholder icons defined in loadConversationAvatar are only used when the http request fails completely.
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
Problem:
i want to load avatars and if no avatar is received, i want to show the placeholder.
However with coil it's not possible to make the placeholders rounded. See https://github.com/coil-kt/coil/issues/37
I could just set the old rounded drawables that we have, but then theming wouldn't work!
So i ask myself what the best solution could be:
- Somehow check beforehand if an avatar is set at all? and then choose between loading the avatar or loading the the static drawables in their own loading request.
- Somehow check if the avatar response is empty. And if yes, make another request to load the static drawables.
- Use jetpack compose instead of coil to clip the image? See https://stackoverflow.com/questions/66014834/how-to-draw-a-circular-image-in-android-jetpack-compose
- create new svg's? Somehow it should be possible to invert a circle and just overlay it over an image..?
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
Because of "supported-reactions" and "predefined-backgrounds" the capabilities cannot be parsed with
`var config: HashMap<String, HashMap<String, String>>?`
As a result it was not possible to login into the app.
This is now
`var config: HashMap<String, HashMap<String, @RawValue @Contextual Any>>?` while always checking for the type when accessing the values.
"supported-reactions" and "predefined-backgrounds" are not handled yet.
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
for now the message is shown empty. should be improved!
D/AndroidRuntime: Shutting down VM
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.nextcloud.talk2, PID: 29567
java.lang.NullPointerException
at com.nextcloud.talk.models.json.chat.ChatMessage.getText(ChatMessage.kt:264)
at com.nextcloud.talk.adapters.messages.OutcomingTextMessageViewHolder.processParentMessage(OutcomingTextMessageViewHolder.kt:168)
at com.nextcloud.talk.adapters.messages.OutcomingTextMessageViewHolder.onBind(OutcomingTextMessageViewHolder.kt:100)
at com.nextcloud.talk.adapters.messages.OutcomingTextMessageViewHolder.onBind(OutcomingTextMessageViewHolder.kt:54)
at com.stfalcon.chatkit.messages.MessageHolders.bind(MessageHolders.java:596)
at com.stfalcon.chatkit.messages.MessagesListAdapter.onBindViewHolder(MessagesListAdapter.java:110)
at com.nextcloud.talk.adapters.messages.TalkMessagesListAdapter.onBindViewHolder(TalkMessagesListAdapter.java:50)
at com.nextcloud.talk.adapters.messages.TalkMessagesListAdapter.onBindViewHolder(TalkMessagesListAdapter.java:32)
at androidx.recyclerview.widget.RecyclerView$Adapter.onBindViewHolder(RecyclerView.java:7678)
at androidx.recyclerview.widget.RecyclerView$Adapter.bindViewHolder(RecyclerView.java:7761)
at androidx.recyclerview.widget.RecyclerView$Recycler.tryBindViewHolderByDeadline(RecyclerView.java:6582)
at androidx.recyclerview.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(RecyclerView.java:6848)
at androidx.recyclerview.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:6688)
at androidx.recyclerview.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:6684)
at androidx.recyclerview.widget.LinearLayoutManager$LayoutState.next(LinearLayoutManager.java:2362)
at androidx.recyclerview.widget.LinearLayoutManager.layoutChunk(LinearLayoutManager.java:1662)
at androidx.recyclerview.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1622)
at androidx.recyclerview.widget.LinearLayoutManager.scrollBy(LinearLayoutManager.java:1425)
at androidx.recyclerview.widget.LinearLayoutManager.scrollVerticallyBy(LinearLayoutManager.java:1158)
at androidx.recyclerview.widget.RecyclerView.scrollStep(RecyclerView.java:2009)
at androidx.recyclerview.widget.RecyclerView$ViewFlinger.run(RecyclerView.java:5789)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1301)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1309)
at android.view.Choreographer.doCallbacks(Choreographer.java:923)
at android.view.Choreographer.doFrame(Choreographer.java:847)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1283)
at android.os.Handler.handleCallback(Handler.java:942)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:226)
at android.os.Looper.loop(Looper.java:313)
at android.app.ActivityThread.main(ActivityThread.java:8741)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1067)
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
With this, it's not opened again with onBackPressed in location view. But it still opens again when app was interrupted and being shown again.
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>