I recently had a problem with smooth transition. Even though I am loading the lengthy tasks in AsyncTask, it still takes time to load, and the screen has to wait.
If you have a WebView, for example, that takes a while to load, and under the WebView, you have some TextViews and other things, supposedly a layout.
The layout will load first, and the WebView later, making the screen loading ackward.
A solution for this would be to set the Visibility to GONE on all the objects before it loads, and then set to VISIBLE after the WebView loads.
webView.setWebViewClient(new WebViewClient() {
public void onPageFinished(WebView view, String url) {
webView.setVisibility(View.VISIBLE);
LinearLayout ll_load_after_web_view_bottom = findViewById(R.id.ll_load_after_web_view_bottom);
LinearLayout ll_load_after_web_view_top = findViewById(R.id.ll_load_after_web_view_top);
ll_load_after_web_view_bottom.setVisibility(View.VISIBLE);
ll_load_after_web_view_top.setVisibility(View.VISIBLE);
}
});