How to show content of Activity in full screen without flicker - android

how to make activity full screen and navigate back to previous activity without any UI flicker.

full screen activity
use Theme
<activity android:name"MainActivity"
android:theme="#android:style/Theme.NoTitleBar.Fullscreen">
and navigate back to previous activity without any UI flicker
is mean how to make back button?

You can choose between two options
Apply new exit animation of Activity, such as fade out, scale out, .... It will reduce the lagging-effect to the eyes.
Use Fragment instead. Fragment transition is smoother than activity transition.
Try both ways and compare them to get the better options. I recommend you the second :D

Related

Previous activity finishes without completing exit transition

I have a splash screen activity which is supposed to launch a landing activity and finish itself. When I enable activity transitions, with a simple slide animation as both enter and exit animations, I see that the splash activity finishes before the landing activity slides up completely. This causes an intermediate phase when users see the Android launcher screen.
I tried using finishAfterTransition() as suggested here, but no luck. Is this a bug in the support library? Or am I not supposed to use transitions on activities which may finish after launching a new activity?
The method overridePendingTransition() and animation parameters R.animator.fade_in, R.animator.fade_out have worked for some.
It is described here

Bottom Navigation with Activity

I have an application where it is required to persist the bottom navigation across multiple screen. Now naturally bottom navigation works well with fragments but the problem is that my other fragments also have other screens to call which is usually delegated back to the handling activity.
With said, when i tried implementing the bottom navigation with fragments the activity becomes a God Activity where it handles all fragments.
So my solution was to start an activity instead. But the problem with this approach is that every start of the activity the activity transition makes it obvious an activity is being started. I tried setting off the activity transition to avoid this but now Im left with a very static page which just suddenly changes. I still want my views to animate smoothly between screen changes.
Can someone give me an advice here. Heres what I would want to achieve in summary:
1) make it seem the bottom navigation was not changed/moved (and hopefull still have the shifting animation if possible)
2) animate smoothly between screen changes
3) also still have the capability of having shared element transition if possible.
Please help me here. Thank you so much in advance.

Lollipop shared element transition on reentering activity with keyboard resize

I'm working with Lollipop transitions between two activities. I have a shared element which I animate with a transition to and from activities A and B. In activity B a keyboard pops up and resizes the window. The animation looks great when going into activity B. The problem is when returning back to activity A the shared element transition looks bad because the windows size is still based on what the keyboard resized it to (even though the keyboard minimizes automatically when going back to A and eventually the window is the correct size).
I have tried manually hiding the soft input before leaving activity B and calling finishAfterTransition. Unfortunately no luck! I have also tried postponing the shared element transition, but that also didn't work well. One solution would be to have a tiny delay (10ms) when the user presses back to finish activity B in order to give the window time to resize itself before leaving, but that feels hacky to me.
Any ideas greatly appreciated!

Maintaining stack of the android application's activities

Will be obliged if someone can help me with this.We were working on some android application,while designing its prototype we came across some issues.A little description of the application's prototype is as follows:
A Log in screen
a Home screen with logout at its top right
Every other activity is having a home button on top right corner.
Now going from one activity to the other in my application, I just called finished on the current activity and started the other(so there is no stack of the activities is being created) and when home button present on each activity's top corner is pressed i finish the current activity and move to the home screen.
More precisely,i can say that i am overriding every activty's onBackPressed() method
.By doing this i am not letting android to keep a stack of the activity's but by doing this I have a feeling that, I am loosing efficiency and degrading performance.Because on every backpress or home button click one activity is finished and the other is created.Hence some lag can be seen as the acivity is recreated.
Please suggest that should I continue WITH THIS or there is some other way out to handle this
Thank you for Giving your time
It is depends.
If you are giving option on each screen to to go home this approach is good.
Because if you are keep activities in stack it will be in RAM which is limited so it may create memory issue if to many activities in stack.
I would like to suggest one more thing.
As you say you have overridden onBackPressed() method in each activity.
Rather doing this there is a option you can specify parent activity in manifest tag.
So you no need to manually handle by overriding onBackPressed() method.
EG.
<activity
android:name="com.xxx.DetailActivity"
android:parentActivityName="com.xxx.src.ListActivity"
android:screenOrientation="portrait"
android:theme="#android:style/Theme.Translucent.NoTitleBar.Fullscreen" />

how to dim the current activity?

Is there a way to dim the Current activity when calling the new activity? as in the new activity should be above the previous activity. The new activity that i have is a gallery. It comes when the finish button in the previous activity is clicked. So i want this gallery to be placed above the previous activity
Try setting the background of your gallery Activity to a transparent color. You might need to create a custom theme and more details can be found here: http://developer.android.com/guide/topics/ui/themes.html
This is probably going to be completely transparent, so not quite what you want. But, for example:
<activity android:theme="#android:style/Theme.Translucent">
I doubt if you could overlay two activities on top of each other. However, in order to achieve the effect that you mentioned, you could use a customized dialog to popup within your main gallery activity, and then set the rest of the screen as blurred, with the use of window manager. For an example of this, you can see: http://www.stealthcopter.com/blog/2010/01/android-blurring-and-dimming-background-windows-from-dialogs/

Categories

Resources