talk-android
talk-android copied to clipboard
Fix transitions between views.
Now that conductor is mostly being replaced, new transitions need to be added to the switch between activities.
Is there any transition in particular? Android supports 3 transitions
- explode: moves views in toward or out from the center of the scene.
- slide: moves views in or out from one of the edges of the scene.
- fade: adds or removes a view from the scene by changing its opacity.
Also is this for all activities or just the ones that were recently converted to native from conductor?
So far I've seen
- SettingsActivity
- ChatActivity
- ProfileActivity
- ConversationsListActivity
- ConversationInfoActivity
- LocationPickerActivity
- GeocodingActivity
are there any that I'm missing?
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.
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
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..
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..
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..
@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 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