All Projects → git-xuhao → XHLoadingView

git-xuhao / XHLoadingView

Licence: Apache-2.0 license
🚀A load Loading page state view,load,no network,empty data,load failure state switch.

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to XHLoadingView

ZXLoadingView
🍕ZXLoadingView is an iOS progress-activity
Stars: ✭ 14 (-75.86%)
Mutual labels:  loading, loadingview
koleton
The easiest library to show skeleton screens in an Android app.
Stars: ✭ 84 (+44.83%)
Mutual labels:  loading, loadingview
vue-loading-button
👇 Vue button with slideout loading indicator
Stars: ✭ 39 (-32.76%)
Mutual labels:  loading
blazor-lazy-loading
Automatic Lazy Loading support for Blazor (Server and WebAssembly)
Stars: ✭ 89 (+53.45%)
Mutual labels:  loading
jh-weapp-demo
微信小程序项目- 实现一些常用效果、封装通用组件和工具类
Stars: ✭ 60 (+3.45%)
Mutual labels:  loading
ember-contextual-services
Services in Ember are scoped to the app as a whole and are singletons. Sometimes you don't want that. :) This addon provides ephemeral route-based services.
Stars: ✭ 20 (-65.52%)
Mutual labels:  loading
dlib
Dynamic loading library for C/C++
Stars: ✭ 19 (-67.24%)
Mutual labels:  loading
blur-up
A tool that creates preview images.
Stars: ✭ 28 (-51.72%)
Mutual labels:  loading
ngx-loading-mask
Angular 5+ simple loading-mask ui component.
Stars: ✭ 22 (-62.07%)
Mutual labels:  loading
CustomProgress
一款常见的进度条加载框架
Stars: ✭ 32 (-44.83%)
Mutual labels:  loading
RxPagingLoading
Easy handling of the Paging or Loading screens states
Stars: ✭ 45 (-22.41%)
Mutual labels:  loading
react-loading-placeholder
Loading placeholer, inspired by Facebook
Stars: ✭ 17 (-70.69%)
Mutual labels:  loading
flutter page tracker
flutter埋点、弹窗埋点、页面埋点事件捕获框架,支持普通页面的页面曝光事件(PageView),页面离开事件(PageExit)。支持在TabView和PageView组件中发送页面曝光和页面离开
Stars: ✭ 103 (+77.59%)
Mutual labels:  pageview
XLDotLoading
iOS 新浪微博红包加载动画
Stars: ✭ 30 (-48.28%)
Mutual labels:  loading
spinners-angular
Lightweight SVG/CSS spinners for Angular
Stars: ✭ 21 (-63.79%)
Mutual labels:  loading
react-data-fetching-components
♻️ Asynchronously load data for your React components with SSR
Stars: ✭ 13 (-77.59%)
Mutual labels:  loading
LottieDemo
This Demo contains a reference to use Lottie Library by Airbnb in an Android Project. An animation JSON file can be played using LottieAnimationView.
Stars: ✭ 33 (-43.1%)
Mutual labels:  loading
shitload
The appropriate bullgit loading animation
Stars: ✭ 15 (-74.14%)
Mutual labels:  loading
TipDialog
flutter tip dialog
Stars: ✭ 78 (+34.48%)
Mutual labels:  loading
loading-indicator
🚦 Simple and customizable command line loading indicator
Stars: ✭ 18 (-68.97%)
Mutual labels:  loading

概述

在设计应用的时候,我们应该热爱极简主义,简单就是好的,对于很多用户来说,复杂的东西并不受欢迎。 我要实现的是根据不同的情况去显示不同的加载效果,随用随调,效果是借鉴于某一项目的效果,我认为有必要提取出来改善封装一下,供以后使用。情况大致分为:加载中、无网络、无数据、加载失败等,这些仅仅就需要一个View 就可以搞定啦!

效果图

这里写图片描述

Usage


        mLoadingView.withLoadEmptyText("≥﹏≤ , 啥也木有 !")
                    .withEmptyIcon(R.drawable.disk_file_no_data)
                    .withBtnEmptyEnnable(false)
                    .withErrorIco(R.drawable.ic_chat_empty)
                    .withLoadErrorText("(῀( ˙᷄ỏ˙᷅ )῀)ᵒᵐᵍᵎᵎᵎ,我家程序猿跑路了 !")
                    .withBtnErrorText("臭狗屎!!!")
                    .withLoadNoNetworkText("你挡着信号啦o( ̄ヘ ̄o)☞ᗒᗒ 你走")
                    .withNoNetIcon(R.drawable.ic_chat_empty)
                    .withBtnNoNetText("网弄好了,重试")
                    .withLoadingIcon(R.drawable.loading_animation)
                    .withLoadingText("加载中...")
                    .withOnRetryListener(new XHLoadingView.OnRetryListener() {
                @Override
                public void onRetry() {
                    SnackbarUtil.show(mLoadingView,"已经在努力重试了",0);
                }
            }).build();
        
       .....

       if(mLoadState.contains(LOADING)){
            mLoadingView.setVisibility(View.VISIBLE);
            mLoadingView.setState(LoadingState.STATE_LOADING);

        }else if(mLoadState.contains(LOADING_EMPTY)){
            mLoadingView.setVisibility(View.VISIBLE);
            mLoadingView.setState(LoadingState.STATE_EMPTY);

        }else if(mLoadState.contains(LOADING_NONETWORK)){
            mLoadingView.setVisibility(View.VISIBLE);
            mLoadingView.setState(LoadingState.STATE_NO_NET);
        }else if(mLoadState.contains(LOADING_ERROR)){
           mLoadingView.setVisibility(View.VISIBLE);
           mLoadingView.setState(LoadingState.STATE_ERROR);
       }

apk:DownLoad

Blog:http://xuhaoblog.com/Android-custom-loadingview.html

License

Copyright 2016 Xuhao

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.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].