Comments (5)
@sieml 你好,不太理解你的意思,你是指要自定义一个进度动画页面吗?能否描述更具体些。
from loadsir.
@KingJA 假如我想把ProgressBar换成ImageView的, 使用帧动画. 这时要通过findViewById来找到这个View, 然后开启动画, 还有关闭动画 , 需要另外处理, 能封装在库中吗? 还是已经有了
from loadsir.
1.可以尝试在Callback类添加
protected void initView(Context context, View view){
//do nothing
}
2.在rootView = View.inflate(context, onCreateView(), null);之后调用;
public View getRootView() {
int resId = onCreateView();
if (resId == 0 && rootView != null) {
return rootView;
}
rootView = View.inflate(context, onCreateView(), null);
rootView.setOnClickListener(new View.OnClickListener() {
@OverRide
public void onClick(View v) {
if (onRetry(context, rootView)) {
return;
}
if (onReloadListener != null) {
onReloadListener.onReload(v);
}
}
});
initView(context, rootView);
return rootView;
}
3.然后在自定义的LoadingCallback重写父类的initView;
public class LoadingCallback extends Callback {
@Override
protected int onCreateView() {
return R.layout.layout_loading;
}
@Override
protected void initView(Context context, View view) {
super.initView(context, view);
ImageView ivLoading = (ImageView) view.findViewById(R.id.iv_loading);
Animation animation = new RotateAnimation(0, 359,Animation.RELATIVE_TO_SELF,
0.5f,Animation.RELATIVE_TO_SELF,0.5f);
animation.setDuration(500);
animation.setRepeatCount(Integer.MAX_VALUE);
animation.setFillAfter(true);
ivLoading.startAnimation(animation);//开始动画
}
}
from loadsir.
@sieml 非常好的使用场景,目前LoadSir没有针对该场景的相关API。下个版本会增加。@toothwind 感谢你建议,我想我会在下个版本增加相关API。
from loadsir.
@sieml @toothwind 感谢两位的支持,https://github.com/KingJA/LoadSir/blob/v1.2.2-pre/app/src/main/java/sample/kingja/loadsir/callback/AnimateCallback.java LoadSir v1.2.2-pre 更新API,近期将出release版本,欢迎提出意见和建议。
from loadsir.
Related Issues (20)
- 项目还维护吗? HOT 2
- 注册view布局时会出现问题
- 能够加在切换界面状态的时候加入动画 能够淡入淡出 HOT 1
- 在使用转换器回调的时候如何动态修改错误页面的提示文字 HOT 2
- 有没有人遇到当数据很快获取到时,不能显示成功布局,还是加载布局的情况? HOT 6
- 承载各个fragment的容器如果是FragmentContainerView或者Fragment,在调用register注册时会crash HOT 1
- DefaultCallback 调用时机有问题 HOT 3
- 什么时候增加viewbinding 支持?
- 某个页面自定义loadsir不会继承默认全局里面的callback? HOT 2
- loadIsr无法取消
- jcent仓库要过期了 不更新一下吗
- 用loadSir绑定SmartRefreshLayout中的RecyclerView 直接就空白视图 什么都不展示 HOT 3
- onReloadEvent 事件重写 点击特定view的事件 第一次无响应 ,第二次才触发 点击事件 HOT 3
- 为什么不提供一个unregister的方法呢 HOT 1
- 请问什么时候迁移到maven-central呢? HOT 4
- 希望添加获取当前显示的 View
- 建议添加View显示时的动画
- 承载各个fragment的容器如果是FragmentContainerView或者Fragment,在调用register注册时会crash HOT 2
- 一个界面能使用多个load吗?两个RV,会造成滑动,好像也没显示loading
- 是不是已经不更新了 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from loadsir.