nextcloud / talk-android

📱😀 Video & audio calls through Nextcloud on Android
Other
527 stars 226 forks source link

Fix transitions between views. #2957

Open mahibi opened 1 year ago

mahibi commented 1 year ago

Now that conductor is mostly being replaced, new transitions need to be added to the switch between activities.

rapterjet2004 commented 1 year ago

Is there any transition in particular? Android supports 3 transitions

Also is this for all activities or just the ones that were recently converted to native from conductor?

So far I've seen

are there any that I'm missing?

AndyScherzinger commented 1 year ago

From my perspective, the correct transition would be a slide in/out depending on the direction of navigation, see https://m3.material.io/styles/motion/transitions/transition-patterns#df9c7d76-1454-47f3-ad1c-268a31f58bad for details to basically transition forward or backward.

mahibi commented 1 year ago

this will be solved when there is a better solution for

android:launchMode="singleInstance"
android:noHistory="true"

see https://github.com/nextcloud/talk-android/pull/3008#issuecomment-1542232274

mahibi commented 1 year ago

Okay lesson learned after the RC3 release: Default activity transistions seems to be different between manufacturers (or maybe Android Version?). On my Samsung (android 13) transistions are always from bottom to top which is not nice, on my redmi (Android 10) always horizontal like expected.

So i guess we should indeed change this another time..

mahibi commented 1 year ago

i guess it might be best to define custom transitions like here: https://developer.android.com/develop/ui/views/animations/transitions/start-activity#custom-trans

and maybe some stuff like requestFeature only has to be defined for BaseActivity..

mahibi commented 1 year ago

and i guess

    override fun onBackPressed() {
        val intent = Intent(this, ConversationsListActivity::class.java)
        intent.putExtras(Bundle())
        startActivity(intent)
    }

in ChatActivity could have an impact on the transitions. Iirc i introduced this to go back to ConversationsListActivity when opening the chat from notification. However it might require some extra work regarding transitions..

AndyScherzinger commented 1 year ago

@mahibi I think you could peek the back stack and decide to act according to it, launching an activity or just doing a back pressed.

mahibi commented 1 year ago

@mahibi I think you could peek the back stack and decide to act according to it, launching an activity or just doing a back pressed.

i like that idea :+1: btw onBackPressed handling will change with https://github.com/nextcloud/talk-android/pull/3036

@rapterjet2004 feel free give it a try but let's focus on the transitions first