Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Achieving content placeholders as progress indicators in Android

My question is quite similar to this question. I want to achieve progress indicators that use this style:

https://github.com/michalsnik/ember-content-placeholders

That is replacing content like text and images with grey rectangles that animate like here.

I have seen this quite a lot in the past, e.g. Facebook. I am pretty sure that the YouTube app used to have this style.

Questions devided

The obvious first question is on how to this on Android and especially if there is an idiomatic, standard or simple way of achieving this and the second one is closely connected to this because here is my

Problem

How would I ever achieve converting a TextView into such a loading rectangle. I could image replacing my whole view structure with this, but I also do not know where to start with the animation.

like image 840
creativecreatorormaybenot Avatar asked Mar 13 '18 13:03

creativecreatorormaybenot


People also ask

How to position the content view of a placeholder?

The content view is positioned using the layout of the parameters of the Placeholder (the Placeholder is simply constrained in the layout like any other view). Returns the behaviour of a placeholder when it contains no view.

What is placeholder in Salesforce?

A Placeholder provides a virtual object which can position an existing object. When the id of another view is set on a placeholder (using setContent () ), the placeholder effectively becomes the content view.

How do I use progress indicators?

Use progress indicators to show the proportion of a task that is complete. To show progress an indicator is animated along a circular track in a clockwise direction. You can apply progress indicators to components such as a play button. Create progress indicators with a gap to leave space for important information such as the time.

What is the difference between progress and progresstint in Android?

android: progress – It sets the default progress of the progress bar, which can be set from 0 to max. android:interpolar – It is used to set an acceleration curve for the indeterminate progress bars. android: min – It defines the minimum value for the progress bar. android: progressTint – It applies Tint on progress indicator in the progress bar.


1 Answers

Take a look at this library - ShimmerLayout

ShimmerLayout can be used to add shimmer effect (like the one used at Facebook or at LinkedIn) to your Android application.

Also, if you curious about how to implement animation, take a look at the library sources.

like image 165
Alexey Denysenko Avatar answered Oct 20 '22 09:10

Alexey Denysenko