SlideShare a Scribd company logo
Android Content
Placeholder Animation Like
Facebook Using Shimmer
 Today, to replicate Facebook Shimmer
animation here is a simple app that hits any
URL and downloads its JSON data and it is
visible in grid view. This app shows the
shimmering effect instead of showing the
progress during loading and preventing the
effect in case of success or error.
 Talking about Facebook Shimmer, this Facebook
Shimmer library allows you to create loading
animation on all your Android activity before
loading your data in the correct list view or
your app layout. The Shimmer effect on
Facebook was designed to show significant
loading status.
<com.facebook.shimmer.ShimmerFrameLayout
android:id=“@+id/shimmer_view_container”
android:layout_width=“wrap_content”
android:layout_height="wrap_content“
shimmer:duration="1200">
<View
android:layout_width="120dp“
android:layout_height=“9dp“
android:background="#iiiiii" />
</com.facebook.shimmer.ShimmerFrameLayout>
Layout Example
JSON is a lightweight data-interchange
format that is easy to read and write for all
users. It is very easy to parse and generate
all machines. JSON is considered an ideal
data-interchange language for
communicating data with a minimum It is
considered as a form that is used to transmit
user's data between servers and web
applications in the alternative of XML data.
[{
"id": 2,
"name": “Hiren Patel",
"description": "Put the ginger and garlic into a bowl and mix with the soy sauce,
maple syrup, mirin and a drizzle of olive oil",
"price": 100,
"chef": “Mayur Patel",
"thumbnail": "/images/food/3.jpg",
"timestamp": “8 min ago“
}, {
"id": 3,
"name": “Jay Patel",
"description": "Combine butter, dill and garlic salt, brush over mushrooms.",
"price": 120,
"chef": "Raj Patel",
"thumbnail": "/images/food/4.jpg",
"timestamp": “12 min ago"
}
]
Figure 1: Install Android Studio Figure 2: Open a New Project
Figure 4: Target Android DevicesFigure 3: Configure Your New Project
Figure 6: FinishFigure 5: Add activity
When your shimmer loader is ready, let's see
how the JSON feed loads in the recursive
view and hide the shimmer loader after the
user list is presented. Through this article,
you will be able to understand how to apply
the Shimmer effect properly in the real
world.
Class Description
Shimmer It has just one shimmer detailing all the configuration options
available for ShimmerFrameLayout
Shimmer.AlphaHighligtBuilder
Shimmer.Builder<T extends
Shimmer.Builder<T>>
Shimmer.ColorHighlightBuilder
ShimmerDrawable
ShimmerFrameLayout Shimmer is a kind of Android library capable of providing easy ways
to add better effects to all android.view.View.
• Clip to Children: - To make an effect clip shimmering young children, either use it better to draw the shimmer like
children.
• Colored: - If you wish, shimmer like this can affect only one alpha or you can draw colors on the children.
• Base Color: - The base color of the material if your color is fully specified.
• Highlight Color: - The highlight color of the shimmer if your color is fully specified.
• Highlight Alpha: - If your color is completely specified, you can use alpha to render the base view. In your language,
an unhealthy view above which the highlight is drawn so that the alpha is highlighted.
• Auto Star: - When you are shown all the scenes, then you decide whether to start the animation automatically or
not.
• Duration: - If you want to go from one end of the layout to the other, then you will take time.
• Repeat Count: - This will repeat the number of times of all the current animation for you.
• Repeat Delay: - This will repeat the current animation after a delay.
• Repeat Mode: - What should you do after you reach the end of the animation? You can start from the
beginning or you can reverse back
• Direction: - If you are looking at the direction of travel of the shimmer then you can do it from left to
right, right to left, top to bottom or bottom to top.
• Dropoff: - This helps control the shape of the fading edge of your highlight.
• Intensity: - This helps control the brightness of your highlight in the center.
• Shape: - This is the shape of your highlight mask either linear or with a circular gradient.
• Till: - It measures your angle at which the highlight is tilted in degrees.
• Fixed Width, Height: - If you set the fixed size highlight mask it overrides the relative size value.
• Width, Height Ratio: - It decides the size of the highlight mask and relative to the layout to which it is
applied.
class ShimmerActivity : AppCompatActivity() {
/** Declare variables **/
private var list: MutableList<User> = ArrayList<User>()
lateinit var adapter: RecyclerAdapter
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.shimmer_layout)
shimmerLayout.startShimmerAnimation()
Handler().postDelayed( {
shimmerLayout.stopShimmerAnimation()
shimmerLayout.visibility = View.GONE
setValues()
},5000) }
private fun setValues() {
/** Adding values **/
list.add(User("Jeniffer Aniston"))
list.add(User("Lara Craft"))
list.add(User("Yamilet"))
list.add(User("Percy Jackson"))
list.add(User("Leo"))
list.add(User("Piper Jason"))
list.add(User("Thalia Grace"))
list.add(User("Frank"))
Log.v("list","list=="+list);
recyclerView.layoutManager = LinearLayoutManager(this, LinearLayout.VERTICAL, false)
adapter = RecyclerAdapter(this@ShimmerActivity, list); recyclerView.adapter = adapter
}
}
Contact Us
info@nexmobility.com
+91 80009 20081
https://www.nexmobility.com/
"Royal Square“ 1st Floor, Off No. 110, Nr.
Shilp Tower, Tagore Road, Rajkot - 360 001,
Gujarat - INDIA
How to create content placeholder animations for Android using shimmer effects?

More Related Content

What's hot

Stop motion animation guide
Stop motion animation guideStop motion animation guide
Stop motion animation guide
lukebiley
 
Tutorial 2 - Lightsaber
Tutorial 2 - LightsaberTutorial 2 - Lightsaber
Tutorial 2 - Lightsaber
joaodias4994
 
P 13 Spolight
P 13 SpolightP 13 Spolight
P 13 Spolightsumidahilo
 
Camera work
Camera workCamera work
Camera work
romarab3
 
Tutorial 3 - Lightsabre Glow
Tutorial 3 - Lightsabre GlowTutorial 3 - Lightsabre Glow
Tutorial 3 - Lightsabre Glow
joaodias4994
 

What's hot (6)

Stop motion animation guide
Stop motion animation guideStop motion animation guide
Stop motion animation guide
 
Tutorial 2 - Lightsaber
Tutorial 2 - LightsaberTutorial 2 - Lightsaber
Tutorial 2 - Lightsaber
 
Task 1
Task 1Task 1
Task 1
 
P 13 Spolight
P 13 SpolightP 13 Spolight
P 13 Spolight
 
Camera work
Camera workCamera work
Camera work
 
Tutorial 3 - Lightsabre Glow
Tutorial 3 - Lightsabre GlowTutorial 3 - Lightsabre Glow
Tutorial 3 - Lightsabre Glow
 

Similar to How to create content placeholder animations for Android using shimmer effects?

EN How to Tell When a Function is Increasing_Decreasing Using its Derivative ...
EN How to Tell When a Function is Increasing_Decreasing Using its Derivative ...EN How to Tell When a Function is Increasing_Decreasing Using its Derivative ...
EN How to Tell When a Function is Increasing_Decreasing Using its Derivative ...
ssuser1e1bab
 
Devops RACI Matrix Ppt Powerpoint Presentation File Format
Devops RACI Matrix Ppt Powerpoint Presentation File FormatDevops RACI Matrix Ppt Powerpoint Presentation File Format
Devops RACI Matrix Ppt Powerpoint Presentation File Format
SlideTeam
 
Why design matters?
Why design matters?Why design matters?
Why design matters?
Ozlem Bilis
 
Business Plan Executive Summary Drivers Challenges
Business Plan Executive Summary Drivers ChallengesBusiness Plan Executive Summary Drivers Challenges
Business Plan Executive Summary Drivers Challenges
SlideTeam
 
Seven Peaks Speaks - Android Jetpack Compose Animation
Seven Peaks Speaks - Android Jetpack Compose AnimationSeven Peaks Speaks - Android Jetpack Compose Animation
Seven Peaks Speaks - Android Jetpack Compose Animation
Seven Peaks Speaks
 
Four Levels Org Chart Matrix Structure With Names And Profile
Four Levels Org Chart Matrix Structure With Names And ProfileFour Levels Org Chart Matrix Structure With Names And Profile
Four Levels Org Chart Matrix Structure With Names And Profile
SlideTeam
 
Supercharge your ui
Supercharge your uiSupercharge your ui
Supercharge your ui
Dominik Helleberg
 
Android session 2-behestee
Android session 2-behesteeAndroid session 2-behestee
Android session 2-behestee
Hussain Behestee
 
Four Pillars Of Business Growth Showing Brand Value Sales Channels And Market...
Four Pillars Of Business Growth Showing Brand Value Sales Channels And Market...Four Pillars Of Business Growth Showing Brand Value Sales Channels And Market...
Four Pillars Of Business Growth Showing Brand Value Sales Channels And Market...
SlideTeam
 
Go To Market Plan Roadmap With Product Capabilities Sales Performance
Go To Market Plan Roadmap With Product Capabilities Sales PerformanceGo To Market Plan Roadmap With Product Capabilities Sales Performance
Go To Market Plan Roadmap With Product Capabilities Sales Performance
SlideTeam
 
Material Design Android
Material Design AndroidMaterial Design Android
Material Design Android
Samiullah Farooqui
 
SDN Mentor Hands On - Exercise 2
SDN Mentor Hands On - Exercise 2SDN Mentor Hands On - Exercise 2
SDN Mentor Hands On - Exercise 2
dan_mcweeney
 
Project Updates Ppt Visual Aids Layouts
Project Updates Ppt Visual Aids LayoutsProject Updates Ppt Visual Aids Layouts
Project Updates Ppt Visual Aids Layouts
SlideTeam
 
PEKAN PRODUKTIF.pptx
PEKAN PRODUKTIF.pptxPEKAN PRODUKTIF.pptx
PEKAN PRODUKTIF.pptx
nadab10
 
Animation
AnimationAnimation
Animation
marwa_ma
 
Kano Model Process
Kano Model ProcessKano Model Process
Kano Model Process
SlideTeam
 
Six Months Technology Security Service Quality Operations Timeline
Six Months Technology Security Service Quality Operations TimelineSix Months Technology Security Service Quality Operations Timeline
Six Months Technology Security Service Quality Operations Timeline
SlideTeam
 
Warranty Process Showing Process Automation And Process Streamline
Warranty Process Showing Process Automation And Process StreamlineWarranty Process Showing Process Automation And Process Streamline
Warranty Process Showing Process Automation And Process Streamline
SlideTeam
 
Android 2D Drawing and Animation Framework
Android 2D Drawing and Animation FrameworkAndroid 2D Drawing and Animation Framework
Android 2D Drawing and Animation FrameworkJussi Pohjolainen
 
management coach equipe de france.pptx
management coach equipe de france.pptxmanagement coach equipe de france.pptx
management coach equipe de france.pptx
ssusercbac2e
 

Similar to How to create content placeholder animations for Android using shimmer effects? (20)

EN How to Tell When a Function is Increasing_Decreasing Using its Derivative ...
EN How to Tell When a Function is Increasing_Decreasing Using its Derivative ...EN How to Tell When a Function is Increasing_Decreasing Using its Derivative ...
EN How to Tell When a Function is Increasing_Decreasing Using its Derivative ...
 
Devops RACI Matrix Ppt Powerpoint Presentation File Format
Devops RACI Matrix Ppt Powerpoint Presentation File FormatDevops RACI Matrix Ppt Powerpoint Presentation File Format
Devops RACI Matrix Ppt Powerpoint Presentation File Format
 
Why design matters?
Why design matters?Why design matters?
Why design matters?
 
Business Plan Executive Summary Drivers Challenges
Business Plan Executive Summary Drivers ChallengesBusiness Plan Executive Summary Drivers Challenges
Business Plan Executive Summary Drivers Challenges
 
Seven Peaks Speaks - Android Jetpack Compose Animation
Seven Peaks Speaks - Android Jetpack Compose AnimationSeven Peaks Speaks - Android Jetpack Compose Animation
Seven Peaks Speaks - Android Jetpack Compose Animation
 
Four Levels Org Chart Matrix Structure With Names And Profile
Four Levels Org Chart Matrix Structure With Names And ProfileFour Levels Org Chart Matrix Structure With Names And Profile
Four Levels Org Chart Matrix Structure With Names And Profile
 
Supercharge your ui
Supercharge your uiSupercharge your ui
Supercharge your ui
 
Android session 2-behestee
Android session 2-behesteeAndroid session 2-behestee
Android session 2-behestee
 
Four Pillars Of Business Growth Showing Brand Value Sales Channels And Market...
Four Pillars Of Business Growth Showing Brand Value Sales Channels And Market...Four Pillars Of Business Growth Showing Brand Value Sales Channels And Market...
Four Pillars Of Business Growth Showing Brand Value Sales Channels And Market...
 
Go To Market Plan Roadmap With Product Capabilities Sales Performance
Go To Market Plan Roadmap With Product Capabilities Sales PerformanceGo To Market Plan Roadmap With Product Capabilities Sales Performance
Go To Market Plan Roadmap With Product Capabilities Sales Performance
 
Material Design Android
Material Design AndroidMaterial Design Android
Material Design Android
 
SDN Mentor Hands On - Exercise 2
SDN Mentor Hands On - Exercise 2SDN Mentor Hands On - Exercise 2
SDN Mentor Hands On - Exercise 2
 
Project Updates Ppt Visual Aids Layouts
Project Updates Ppt Visual Aids LayoutsProject Updates Ppt Visual Aids Layouts
Project Updates Ppt Visual Aids Layouts
 
PEKAN PRODUKTIF.pptx
PEKAN PRODUKTIF.pptxPEKAN PRODUKTIF.pptx
PEKAN PRODUKTIF.pptx
 
Animation
AnimationAnimation
Animation
 
Kano Model Process
Kano Model ProcessKano Model Process
Kano Model Process
 
Six Months Technology Security Service Quality Operations Timeline
Six Months Technology Security Service Quality Operations TimelineSix Months Technology Security Service Quality Operations Timeline
Six Months Technology Security Service Quality Operations Timeline
 
Warranty Process Showing Process Automation And Process Streamline
Warranty Process Showing Process Automation And Process StreamlineWarranty Process Showing Process Automation And Process Streamline
Warranty Process Showing Process Automation And Process Streamline
 
Android 2D Drawing and Animation Framework
Android 2D Drawing and Animation FrameworkAndroid 2D Drawing and Animation Framework
Android 2D Drawing and Animation Framework
 
management coach equipe de france.pptx
management coach equipe de france.pptxmanagement coach equipe de france.pptx
management coach equipe de france.pptx
 

More from Nex Mobility

What Did You Miss to Notice in iOS 13?
What Did You Miss to Notice in iOS 13?What Did You Miss to Notice in iOS 13?
What Did You Miss to Notice in iOS 13?
Nex Mobility
 
Why React Native is the Future?
Why React Native is the Future?Why React Native is the Future?
Why React Native is the Future?
Nex Mobility
 
Get all features in iOS 13 in detail
Get all features in iOS 13 in detailGet all features in iOS 13 in detail
Get all features in iOS 13 in detail
Nex Mobility
 
Apple iOS 13 release date and new features in iPhone iPad
Apple iOS 13 release date and new features in iPhone iPadApple iOS 13 release date and new features in iPhone iPad
Apple iOS 13 release date and new features in iPhone iPad
Nex Mobility
 
Ultimate guide, tips, and tricks of using iPhone
Ultimate guide, tips, and tricks of using iPhoneUltimate guide, tips, and tricks of using iPhone
Ultimate guide, tips, and tricks of using iPhone
Nex Mobility
 
Android services & lifecycle: How to implement it in the android application
Android services & lifecycle: How to implement it in the android applicationAndroid services & lifecycle: How to implement it in the android application
Android services & lifecycle: How to implement it in the android application
Nex Mobility
 
10 Best iOS app for boosting your Business
10 Best iOS app for boosting your Business10 Best iOS app for boosting your Business
10 Best iOS app for boosting your Business
Nex Mobility
 
Enterprise mobility solution
Enterprise mobility solutionEnterprise mobility solution
Enterprise mobility solution
Nex Mobility
 

More from Nex Mobility (8)

What Did You Miss to Notice in iOS 13?
What Did You Miss to Notice in iOS 13?What Did You Miss to Notice in iOS 13?
What Did You Miss to Notice in iOS 13?
 
Why React Native is the Future?
Why React Native is the Future?Why React Native is the Future?
Why React Native is the Future?
 
Get all features in iOS 13 in detail
Get all features in iOS 13 in detailGet all features in iOS 13 in detail
Get all features in iOS 13 in detail
 
Apple iOS 13 release date and new features in iPhone iPad
Apple iOS 13 release date and new features in iPhone iPadApple iOS 13 release date and new features in iPhone iPad
Apple iOS 13 release date and new features in iPhone iPad
 
Ultimate guide, tips, and tricks of using iPhone
Ultimate guide, tips, and tricks of using iPhoneUltimate guide, tips, and tricks of using iPhone
Ultimate guide, tips, and tricks of using iPhone
 
Android services & lifecycle: How to implement it in the android application
Android services & lifecycle: How to implement it in the android applicationAndroid services & lifecycle: How to implement it in the android application
Android services & lifecycle: How to implement it in the android application
 
10 Best iOS app for boosting your Business
10 Best iOS app for boosting your Business10 Best iOS app for boosting your Business
10 Best iOS app for boosting your Business
 
Enterprise mobility solution
Enterprise mobility solutionEnterprise mobility solution
Enterprise mobility solution
 

Recently uploaded

UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
Ralf Eggert
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
Elena Simperl
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 

Recently uploaded (20)

UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 

How to create content placeholder animations for Android using shimmer effects?

  • 1. Android Content Placeholder Animation Like Facebook Using Shimmer
  • 2.  Today, to replicate Facebook Shimmer animation here is a simple app that hits any URL and downloads its JSON data and it is visible in grid view. This app shows the shimmering effect instead of showing the progress during loading and preventing the effect in case of success or error.  Talking about Facebook Shimmer, this Facebook Shimmer library allows you to create loading animation on all your Android activity before loading your data in the correct list view or your app layout. The Shimmer effect on Facebook was designed to show significant loading status.
  • 4. JSON is a lightweight data-interchange format that is easy to read and write for all users. It is very easy to parse and generate all machines. JSON is considered an ideal data-interchange language for communicating data with a minimum It is considered as a form that is used to transmit user's data between servers and web applications in the alternative of XML data.
  • 5. [{ "id": 2, "name": “Hiren Patel", "description": "Put the ginger and garlic into a bowl and mix with the soy sauce, maple syrup, mirin and a drizzle of olive oil", "price": 100, "chef": “Mayur Patel", "thumbnail": "/images/food/3.jpg", "timestamp": “8 min ago“ }, { "id": 3, "name": “Jay Patel", "description": "Combine butter, dill and garlic salt, brush over mushrooms.", "price": 120, "chef": "Raj Patel", "thumbnail": "/images/food/4.jpg", "timestamp": “12 min ago" } ]
  • 6. Figure 1: Install Android Studio Figure 2: Open a New Project
  • 7. Figure 4: Target Android DevicesFigure 3: Configure Your New Project
  • 8. Figure 6: FinishFigure 5: Add activity
  • 9. When your shimmer loader is ready, let's see how the JSON feed loads in the recursive view and hide the shimmer loader after the user list is presented. Through this article, you will be able to understand how to apply the Shimmer effect properly in the real world.
  • 10. Class Description Shimmer It has just one shimmer detailing all the configuration options available for ShimmerFrameLayout Shimmer.AlphaHighligtBuilder Shimmer.Builder<T extends Shimmer.Builder<T>> Shimmer.ColorHighlightBuilder ShimmerDrawable ShimmerFrameLayout Shimmer is a kind of Android library capable of providing easy ways to add better effects to all android.view.View.
  • 11. • Clip to Children: - To make an effect clip shimmering young children, either use it better to draw the shimmer like children. • Colored: - If you wish, shimmer like this can affect only one alpha or you can draw colors on the children. • Base Color: - The base color of the material if your color is fully specified. • Highlight Color: - The highlight color of the shimmer if your color is fully specified. • Highlight Alpha: - If your color is completely specified, you can use alpha to render the base view. In your language, an unhealthy view above which the highlight is drawn so that the alpha is highlighted. • Auto Star: - When you are shown all the scenes, then you decide whether to start the animation automatically or not. • Duration: - If you want to go from one end of the layout to the other, then you will take time. • Repeat Count: - This will repeat the number of times of all the current animation for you.
  • 12. • Repeat Delay: - This will repeat the current animation after a delay. • Repeat Mode: - What should you do after you reach the end of the animation? You can start from the beginning or you can reverse back • Direction: - If you are looking at the direction of travel of the shimmer then you can do it from left to right, right to left, top to bottom or bottom to top. • Dropoff: - This helps control the shape of the fading edge of your highlight. • Intensity: - This helps control the brightness of your highlight in the center. • Shape: - This is the shape of your highlight mask either linear or with a circular gradient. • Till: - It measures your angle at which the highlight is tilted in degrees. • Fixed Width, Height: - If you set the fixed size highlight mask it overrides the relative size value. • Width, Height Ratio: - It decides the size of the highlight mask and relative to the layout to which it is applied.
  • 13. class ShimmerActivity : AppCompatActivity() { /** Declare variables **/ private var list: MutableList<User> = ArrayList<User>() lateinit var adapter: RecyclerAdapter override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.shimmer_layout) shimmerLayout.startShimmerAnimation() Handler().postDelayed( { shimmerLayout.stopShimmerAnimation() shimmerLayout.visibility = View.GONE setValues() },5000) }
  • 14. private fun setValues() { /** Adding values **/ list.add(User("Jeniffer Aniston")) list.add(User("Lara Craft")) list.add(User("Yamilet")) list.add(User("Percy Jackson")) list.add(User("Leo")) list.add(User("Piper Jason")) list.add(User("Thalia Grace")) list.add(User("Frank")) Log.v("list","list=="+list); recyclerView.layoutManager = LinearLayoutManager(this, LinearLayout.VERTICAL, false) adapter = RecyclerAdapter(this@ShimmerActivity, list); recyclerView.adapter = adapter } }
  • 15. Contact Us info@nexmobility.com +91 80009 20081 https://www.nexmobility.com/ "Royal Square“ 1st Floor, Off No. 110, Nr. Shilp Tower, Tagore Road, Rajkot - 360 001, Gujarat - INDIA