InsLoadingAnimation


Source link: https://github.com/qintong91/InsLoadingAnimation

????

InsLoadingAnimation

Introduction

InsLoadingAnimation is imitation of instagram and weibo avator animation of loading for Android. More information and code analysis please see blog: http://www.jianshu.com/p/a0e2dbeef88a

Demo

Usage

Step 1

Add dependencies in build.gradle.

dependencies {

compile 'com.qintong:insLoadingAnimation:1.1.0' 
}
 

Step 2

InsLoadingView is extands ImageView, it can be used like ImageView simply.

<com.qintong.library.InsLoadingView
  android:layout_centerInParent="true"
  android:id="@+id/loading_view"
  android:layout_width="wrap_content"
  android:layout_height="wrap_content"
  android:src="@mipmap/pink"/>

Step 3

Set status of InsLoadingView

You can change the status of InsLoadingView manually to match up it's status in your context. The status of InsLoadingView: LOADING: to show this InsLoadingView has been clicked and before it has been loaded, animation of circle is running. UNCLICKED: to show this InsLoadingView neither has been clicked nor loaded, the animation of circle is stopped. CLICKED: to show this InsLoadingView has been clicked and loaded, the animation of circle is stopped and the color of the circle is gray. The default status is LOADING. Set status of InsLoadingView only requires the following code:

xml:

  app:status="loading" //or "clicked",or "clicked"

java:

  mInsLoadingView.setStatus(InsLoadingView.Status.LOADING);
 //Or InsLoadingView.Status.CLICKED, InsLoadingView.Status.UNCLICKED

Set the color of InsLoadingView

You can set the start color and end color, the circle of InsLoadingView will show the transition of this two colors:

xml:

  app:start_color="#FFF700C2" //or your color
app:end_color="#FFFFD900" //or your color

java:

  mInsLoadingView.setStartColor(Color.YELLOW);
 //or your color
mInsLoadingView.setEndColor(Color.BLUE);
 //or your color

The default start color and end color is #FFF700C2 and #FFFFD900.

Set the speed of InsLoadingView.

You can change the speed of animation by set the circle animation duration or whole animation rotating duration(MS):

xml:

  app:circle_duration="2000"
app:rotate_duration="10000"

java:

  mInsLoadingView.setCircleDuration(2000);

mInsLoadingView.setRotateDuration(10000);

The default circle duration and rotate duration is 2000ms and 10000ms.

Contact me

Email

My Blog

License

Copyright 2017 Qin Tong  Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License. You may obtain a copy of the License at
  http://www.apache.org/licenses/LICENSE-2.0  Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 

Resources

The recommended pattern for Android's equivalent to cron jobs and Windows scheduled tasks is to use AlarmManager. This works well when coupled with an IntentService, as the service will do its work on a background thread and shut down when there is no more work to do.

There's one small problem: IntentService does nothing to keep the device awake. If the alarm was a WAKEUP variant, the phone will only stay awake on its own while the BroadcastReceiver handling the alarm is in its onReceive() method. Otherwise, the phone may fall back asleep.

WakefulIntentService attempts to combat this by combining the ease of IntentService with a partial WakeLock.

ViewPager with custom aspect ratio.

Design template library for LG QCircle SDK.

Tooleap is an Android SDK which brings your app to the forefront of a user's device screen with a floating (always-on-top) UI, thus creating a unique multitasking experience and increasing your app's availability and usability.

Sample Of All Samples

With your help we can build a sample app that touches most components of the Android framework, helpful for beginners and experienced.

The CurtainView is much like a layer on the top level of your layout. It's also a container which can wrap other Views.

It will not block the actions of the child view unless you make a standard pull event.

Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes