1993hzw / androids Goto Github PK
View Code? Open in Web Editor NEW提供了一些工具类以及自定义View,用于日常的Android快速开发。something about android
提供了一些工具类以及自定义View,用于日常的Android快速开发。something about android
想问下每个item用(小图片+文字+小图片)这种怎么写呀
想问下每个item用(小图片+文字+小图片)这种怎么写呀
作者辛苦了,非常感谢。效果非常好!Star支持!
1、希望为未选中的item也预留背景设置方法
2、希望左右边界item可以只显示一半,为选中item留出更多空间
i'm sorry
如题,网上找了解决方案,就是配置build.gradle,然后将重复的class剔除出去了,但是还是报错,resource link failed,并且我还找不到到底是哪里link failed了,我猜估计就是作者这个库里面的某个资源丢失了。
就Demo中的水平滚动的StringScrollPicker在惯性滑动多个后有时不会回调selectlisten。这个bug严重影响使用啊。测试了下,fling超过13、4个item就不会被回调。着急,层主看看。
KeyboardLayout类
WindowManager windowManager = (WindowManager) getContext().getSystemService(Context.WINDOW_SERVICE);
mScreenHeight = windowManager.getDefaultDisplay().getHeight();
获取屏幕高度在一般手机是正确的,但是在全面屏手机获取高度不准确
DisplayMetrics dm = new DisplayMetrics();
windowManager.getDefaultDisplay().getRealMetrics(dm);
mScreenHeight = dm.heightPixels;
使用这个方法即可
StringScrollPicker怎么设置选中非选中文字颜色
修改 ScrollPickerView.java
代码210行 解决了此问题.
mAutoScrollAnimator.addListener(new AnimatorListenerAdapter()
{
@Override
public void onAnimationEnd(Animator animation)
{
super.onAnimationEnd(animation);
mIsAutoScrolling = false;
mDisallowTouch = temp;
//!!!:调用以下代码后,可以保证 直接点击单个项时, 也能正常触发 OnSelectedListener 回调
notifySelected();
}
});
效果很好!
《 android图片滚动选择器的实现》这个里面,比如我滑到第0个,这个时候我想把这个图片换成一个动画,比如倒计时的一个效果.像我这种只能换成一张静止的图片:
mPicker02.setOnSelectedListener(new OnSelectedListener() {
@OverRide
public void onSelected(ScrollPickerView scrollPickerView, int position) {
Log.e("收到位置", "位置:" + position);
mCustomProgressBar5.setVisibility(View.INVISIBLE);
if (position == 0) {//开始向上滑动-第二站
mPicker02.setSelectedPosition(0);
mPicker02.setCenterPosition(1);
bitmaps.set(0, BitmapFactory.decodeResource(getResources(), R.drawable.long_video_b));//0
bitmaps.set(1, BitmapFactory.decodeResource(getResources(), R.drawable.shooting_t));//1-中
bitmaps.set(2, BitmapFactory.decodeResource(getResources(), R.drawable.twotis));//2
bitmaps.set(3, BitmapFactory.decodeResource(getResources(), R.drawable.living));//3
} else if (position == 1) {//开始向上滑动-第三站
mPicker02.setSelectedPosition(1);
mPicker02.setCenterPosition(1);
bitmaps.set(0, BitmapFactory.decodeResource(getResources(), R.drawable.long_video));//0
bitmaps.set(1, BitmapFactory.decodeResource(getResources(), R.drawable.shooting));//1-中
bitmaps.set(2, BitmapFactory.decodeResource(getResources(), R.drawable.twotis));//2
bitmaps.set(3, BitmapFactory.decodeResource(getResources(), R.drawable.living));//3
} else if (position == 2) {//开始向上滑动-第四站
mPicker02.setSelectedPosition(2);
mPicker02.setCenterPosition(1);
bitmaps.set(0, BitmapFactory.decodeResource(getResources(), R.drawable.long_video));//0
bitmaps.set(1, BitmapFactory.decodeResource(getResources(), R.drawable.shooting_t));//1-中
bitmaps.set(2, BitmapFactory.decodeResource(getResources(), R.drawable.twotis));//2
bitmaps.set(3, BitmapFactory.decodeResource(getResources(), R.drawable.living));//3
} else if (position == 3) {//20s--开始向上滑动-第一站-位置要加1
mPicker02.setSelectedPosition(3);
mPicker02.setCenterPosition(1);
bitmaps.set(0, BitmapFactory.decodeResource(getResources(), R.drawable.long_video));//0
bitmaps.set(1, BitmapFactory.decodeResource(getResources(), R.drawable.shooting_t));//1-中
bitmaps.set(2, BitmapFactory.decodeResource(getResources(), R.drawable.twotis));//2
bitmaps.set(3, BitmapFactory.decodeResource(getResources(), R.drawable.living_b));//3
} else {
Log.e("收到", "mPicker02选择出错");
}
}
});
应该怎么做呢?我有自定义的圆形进度条,也是正常ok的.
我用/**
@1993hzw 如果是特别大的图片会造成OOM吗,之前用RoundImageView 造成了OOM异常?
使用这个圆角图片空间,查看内存消耗明显增大了,能优化吗
我感觉这个库很好,手势区分的单指双指操作,缩放也可以控制,就是边缘限定的不知道该用那个值,如果大佬可以把这个写道demo里,或写个博客就很好了
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.