1862

Android: How to create the Google Plus login animation?

Question:

Does anyone know how to create a similar animation to the login animation used in the Google Plus Android app?

Is there something similar in the Android SDK that I can use? Or should I just build it from scratch? I'm interested especially in the fact that the UI behind the modal animation is dimmed and disabled.

Thank you.

<img alt="enter image description here" class="b-lazy" data-src="https://i.stack.imgur.com/O8QSl.png" data-original="https://i.stack.imgur.com/O8QSl.png" src="https://etrip.eimg.top/images/2019/05/07/timg.gif" />

Answer1:

Are you taking about that progress dialog spinning thingy that says "signing in"? That's not a custom animation at all, it's a common widget.

Here's the code:

ProgressDialog progressDialog = new ProgressDialog(this); progressDialog.setMessage("Signing in..."); progressDialog.show(); //... complete sign in...then progressDialog.dismiss();

A ProgressDialog done this way, automatically takes care of dimming/blurring the background. You should really read about dialogs: <a href="http://developer.android.com/guide/topics/ui/dialogs.html" rel="nofollow">http://developer.android.com/guide/topics/ui/dialogs.html</a>

Answer2:

To show the progression with an animated progress bar:

1- Initialize the ProgressDialog with the class constructor, ProgressDialog(Context). Set the progress style to "STYLE_HORIZONTAL" with setProgressStyle(int) and set any other properties, such as the message.

2- When you're ready to show the dialog, call show() or return the ProgressDialog from the onCreateDialog(int) callback.

3- You can increment the amount of progress displayed in the bar by calling either setProgress(int) with a value for the total percentage completed so far or incrementProgressBy(int) with an incremental value to add to the total percentage completed so far.

For example, your setup might look like this:

ProgressDialog progressDialog; progressDialog = new ProgressDialog(mContext); progressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL); progressDialog.setMessage("Loading..."); progressDialog.setCancelable(false);

The setup is simple. Most of the code needed to create a progress dialog is actually involved in the process that updates it. You might find that it's necessary to create a second thread in your application for this work and then report the progress back to the Activity's UI thread with a Handler object. If you're not familiar with using additional threads with a Handler, see the example Activity below that uses a second thread to increment a progress dialog managed by the Activity.

Recommend

  • How to dim everything on a webpage apart from a div - to bring attention
  • How to return data in Android LocationListener
  • how to get json data from framework (Yii)
  • How to get respective text and image from the respective recyclerview item in floaty upon clicking a
  • Bootstrap 4 Modal Not Closing Properly On Hide
  • Small Style Custom rating bar (readonly custom rating bar)
  • how to keep a control disabled till a thread ends
  • Flash and HTTP Status Code 207
  • ProgressDialog setProgress and setMessage inside asyncTask don't work
  • Eclipse e4 tool Control in trimbars
  • Clear modal fields after close it
  • Is there a way to synchronize ajax calls
  • Master of threads under DigitalMicrograph
  • How to connect to a GitHub repo using libgit2?
  • can't get In-App-Purchase hosted content to be actually hosted
  • Why isn't RAD (Eclipse) able to properly detect WAS server startup?
  • Composer error [UnexpectedValueException]
  • .htaccess mod rewriterule and ampersands
  • Store additional information during registration with Firebase in Android
  • “[CALayer release]: message sent to deallocated instance” when dismissing modal view controller
  • Play Framework nested form errors missing
  • Download/Save/Write a file on the client's hard disk using flash/flex
  • CSS: How to fix overlapping divs
  • dismiss Progress Dialog in another Activity … Android
  • How to synchronize two scrollview in Android?
  • Creating a Multi-Step Modal Using Jquery
  • How do you create a Fuseki SPARQL server using the Apache Jena Java API?
  • SSL client cert authentication for only some URLs?
  • File extension of zlib zipped html page?
  • Failed to find version-tag string. File must be updated
  • Alamofire and Reachability.swift not working on xCode8-beta5
  • Ajax calls do not work in IE unless you fiddle with security settings
  • ADO and msqli connections very slow
  • Marklogic : Query response time is very high
  • How to use remove-erase idiom for removing empty vectors in a vector?
  • What is Eclipse's Declaration View used for?
  • swift auto completion not working in Xcode6-Beta
  • Excel - Autoshape get it's name from cell (value)
  • Redux, normalised entities and lodash merge
  • File upload with ng-file-upload throwing error