liaohuqiu / android-cube-app Goto Github PK
View Code? Open in Web Editor NEWHome Page: http://cube-sdk.liaohuqiu.net/
Home Page: http://cube-sdk.liaohuqiu.net/
首先,非常感谢你的开源项目,希望从你的开源项目中学到更多的东西。
不知道是版本问题还是什么原因,我导入工程无法通过编译。
我也是首次使用IDEA这个开发工具。
不知道哪里设置不正确而导致项目编译无法通过。
例如:import in.srain.cube.mints.base.MintsBaseActivity; MintsBaseActivity这个类导入失败。
希望给我一些提示。再次感谢你的开源项目。谢谢
1.demo中,一直loadmore直到全部加载完毕;
2.这个时候回到顶端,快速交替的下拉刷新+上拉刷新,crashed;
3.测试设备: 小米2;
4.出现几率:100%
When enter this page, CacheAbleRequestDemoFragment
, a NullPointException
will be trigged.
如题
LoadMoreListViewContainer setLoadMoreUIHandler() 没有处罚里面的回调接口
======= XML==============
<in.srain.cube.views.ptr.PtrClassicFrameLayout xmlns:cube_ptr="http://schemas.android.com/apk/res-auto"
android:id="@+id/rotate_header_list_view_frame"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#f1f1f1"
cube_ptr:ptr_duration_to_close="200"
cube_ptr:ptr_duration_to_close_header="1000"
cube_ptr:ptr_keep_header_when_refresh="true"
cube_ptr:ptr_pull_to_fresh="false"
cube_ptr:ptr_ratio_of_header_height_to_refresh="1.2"
cube_ptr:ptr_resistance="1.7">
<in.srain.cube.views.loadmore.LoadMoreListViewContainer
android:id="@+id/load_more_list_view_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/cube_mints_white">
<ListView
android:id="@+id/rotate_header_list_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:choiceMode="singleChoice"
android:divider="@null"
android:fadingEdge="none"
android:listSelector="@android:color/transparent"
android:paddingLeft="12dp"
android:paddingRight="12dp"
android:scrollbarStyle="outsideOverlay" />
</in.srain.cube.views.loadmore.LoadMoreListViewContainer>
</in.srain.cube.views.ptr.PtrClassicFrameLayout>
===============JAVA=====================
private void initUPTRefreshListView() {
//1.初始化listview
mListView = (ListView) findViewById(R.id.rotate_header_list_view);
// View view = LayoutInflater.from(this).inflate(R.layout.footer_loading_view, null); // 为listview的创建一个footerview,
// mListView.addFooterView(view, null, false);
// 为listview的创建一个headerview,注意,如果不加会影响到加载的footview的显示!
View headerMarginView = new View(this);
headerMarginView.setLayoutParams(new AbsListView.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, LocalDisplay.dp2px(20)));
mListView.addHeaderView(headerMarginView);
//2.绑定模拟的数据
mListView.setAdapter(mQuickAdapter = new QuickAdapter<Map<String, String>>(this, R.layout.activity_baseadapter_item, mapList) {
@Override
protected void convert(BaseAdapterHelper helper, Map<String, String> item) {
helper.setText(R.id.name, item.get("name"));
}
});
//3.设置下拉刷新组件和事件监听
mPtrFrame = (PtrClassicFrameLayout) findViewById(R.id.rotate_header_list_view_frame);
mPtrFrame.setLoadingMinTime(1000);
mPtrFrame.setPtrHandler(new PtrHandler() { // 顶部拉动监听
@Override
public boolean checkCanDoRefresh(PtrFrameLayout frame, View content, View header) {
return PtrDefaultHandler.checkContentCanBePulledDown(frame, mListView, header);
}
@Override
public void onRefreshBegin(PtrFrameLayout frame) {
// 请求网络
new GetDataTask().execute();
}
});
mPtrFrame.postDelayed(new Runnable() { //设置下拉延时自动刷新数据
@Override
public void run() {
loadingInfo();
}
}, 150);
//4.加载更多的组件
LoadMoreListViewContainer mLoadMoreListViewContainer = (LoadMoreListViewContainer) findViewById(R.id.load_more_list_view_container);
mLoadMoreListViewContainer.setAutoLoadMore(true);//设置是否自动加载更多
mLoadMoreListViewContainer.useDefaultHeader();
mLoadMoreListViewContainer.setLoadMoreHandler(new LoadMoreHandler() {
@Override
public void onLoadMore(LoadMoreContainer loadMoreContainer) {
// 请求下一页数据
// new GetDataTask().execute();
Toast.makeText(getApplication(), "底部加载更多数据--开始", Toast.LENGTH_SHORT).show();
}
});
}
问题:底部没有试图,而且 onLoadMore 方法没有调用成功 。。。(底部加载更多不生效)。请帮忙看看哪里问题
Error:Execution failed for task ':refresh:transformClassesWithDexForDebug'.
com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Library/Java/JavaVirtualMachines/jdk1.8.0_73.jdk/Contents/Home/bin/java'' finished with non-zero exit value 2
如何解决
如果布局里面不止listview、gridview,还有其他的view,能否添加一个这样的?
RequestCacheManager.init(this, dir, 1024 * 10, 1024 * 10);在有的手机上(联发科 MT6752)出现错误,为什么呢
后者监听覆盖前者。
listview 滑动的时候, item之间的间隔背景颜色变为黑色
依赖太多东西,一般人看了都不会移植到项目中! 有木有简单的来?
i m using this library and i m failed to remove top heading with "load data for gridview ..." and with "back arrow key "..... how will i remove these two things i m already using this inside my fragments and viewpager +tabs so i dnt need to show user regarding any heading etc ? @liaohuqiu @Jacky-xu any developer can pls tell me how to remove this ?
here is the image attach in my app as i have not set any text so thats why it showing null but still this blue header bar is present
E/AndroidRuntime(28784): java.lang.RuntimeException: Unable to start activity ComponentInfo{in.srain.cube.demo/in.srain.cube.demo.base.DemoHomeActivity}: android.view.InflateException: Binary XML file line #6: Error inflating class in.srain.cube.views.ptr.PtrFrameLayout
i m tryng to use the same class and gridview as u mentioned in this but i faied to download this class from dependencies i addeed in build.gradle @liaohuqiu @SkillCollege and not only this but also this Process: com.example.gridviewsectionheadersfooter, PID: 18360
java.lang.NoClassDefFoundError: in.srain.cube.util.CLog u have used public void doInBackground() {
if(ImageLoader.DEBUG) {
CLog.d(ImageLoader.LOG_TAG, "%s, %s LoadImageTask.doInBackground", new Object[]{this, this.mImageTask});
} in ImageLoader.java i m also getting error i m using this dependency in my project :
compile 'in.srain.cube:cube-sdk:1.0.44@aar'
这个好久没更新了,不维护了吗
当用PtrClassicFrameLayout包裹LoadMoreGridViewContainer,用LoadMoreGridViewContainer包裹GridViewWithHeaderAndFooter时,向下滑动GridViewWithHeaderAndFooter,然后向上滑动GridViewWithHeaderAndFooter,会导致PtrClassicFrameLayout加载数据
描述:调用 pushFragmentToBackStack方法第二次push相同的Fragment 到回退栈,CubeFragmentActivity类中执行show方法但不显示。
测试机:Lenovo s898t+
Caused by: android.content.res.Resources$NotFoundException: Unable to find resource ID #0x7f020007
900 29727-29993/in.srain.cube.demo D/cube-request: RequestData: [http://www.android-cube-app-server.liaohuqiu.net/api/image-list.php?token=&start=0&num=5, G: {token=, start=0, num=5}, P: null, F: null]
12-07 09:58:22.867 29727-29742/in.srain.cube.demo W/System.err: java.net.ConnectException: failed to connect to skykiwi-demo.liaohuqiu.net/106.186.29.127 (port 80): connect failed: ETIMEDOUT (Connection timed out)
12-07 09:58:22.867 29727-29742/in.srain.cube.demo W/System.err: at libcore.io.IoBridge.connect(IoBridge.java:114)
12-07 09:58:22.867 29727-29742/in.srain.cube.demo W/System.err: at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:192)
12-07 09:58:22.867 29727-29742/in.srain.cube.demo W/System.err: at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:459)
12-07 09:58:22.867 29727-29742/in.srain.cube.demo W/System.err: at java.net.Socket.connect(Socket.java:843)
12-07 09:58:22.867 29727-29742/in.srain.cube.demo W/System.err: at com.android.okhttp.internal.Platform.connectSocket(Platform.java:131)
12-07 09:58:22.867 29727-29742/in.srain.cube.demo W/System.err: at com.android.okhttp.Connection.connect(Connection.java:101)
12-07 09:58:22.867 29727-29742/in.srain.cube.demo W/System.err: at com.android.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:294)
12-07 09:58:22.867 29727-29742/in.srain.cube.demo W/System.err: at com.android.okhttp.internal.http.HttpEngine.sendSocketRequest(HttpEngine.java:255)
12-07 09:58:22.867 29727-29742/in.srain.cube.demo W/System.err: at com.android.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:206)
12-07 09:58:22.867 29727-29742/in.srain.cube.demo W/System.err: at com.android.okhttp.internal.http.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:345)
12-07 09:58:22.867 29727-29742/in.srain.cube.demo W/System.err: at com.android.okhttp.internal.http.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:296)
12-07 09:58:22.867 29727-29742/in.srain.cube.demo W/System.err: at com.android.okhttp.internal.http.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:503)
12-07 09:58:22.867 29727-29742/in.srain.cube.demo W/System.err: at in.srain.cube.request.sender.BaseRequestSender.getResponse(BaseRequestSender.java:53)
12-07 09:58:22.867 29727-29742/in.srain.cube.demo W/System.err: at in.srain.cube.request.DefaultRequestProxy.doSyncRequest(DefaultRequestProxy.java:43)
12-07 09:58:22.867 29727-29742/in.srain.cube.demo W/System.err: at in.srain.cube.request.DefaultRequestProxy.requestSync(DefaultRequestProxy.java:58)
12-07 09:58:22.867 29727-29742/in.srain.cube.demo W/System.err: at in.srain.cube.request.SimpleRequest.doRequestSync(SimpleRequest.java:30)
12-07 09:58:22.867 29727-29742/in.srain.cube.demo W/System.err: at in.srain.cube.request.RequestBase.requestSync(RequestBase.java:22)
12-07 09:58:22.867 29727-29742/in.srain.cube.demo W/System.err: at in.srain.cube.demo.datamodel.DemoUploadModel$2.run(DemoUploadModel.java:41)
12-07 09:58:22.867 29727-29742/in.srain.cube.demo W/System.err: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
12-07 09:58:22.867 29727-29742/in.srain.cube.demo W/System.err: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
12-07 09:58:22.867 29727-29742/in.srain.cube.demo W/System.err: at java.lang.Thread.run(Thread.java:841)
12-07 09:58:22.867 29727-29742/in.srain.cube.demo W/System.err: Caused by: libcore.io.ErrnoException: connect failed: ETIMEDOUT (Connection timed out)
12-07 09:58:22.867 29727-29742/in.srain.cube.demo W/System.err: at libcore.io.Posix.connect(Native Method)
12-07 09:58:22.867 29727-29742/in.srain.cube.demo W/System.err: at libcore.io.BlockGuardOs.connect(BlockGuardOs.java:85)
12-07 09:58:22.867 29727-29742/in.srain.cube.demo W/System.err: at libcore.io.IoBridge.connectErrno(IoBridge.java:127)
12-07 09:58:22.867 29727-29742/in.srain.cube.demo W/System.err: at libcore.io.IoBridge.connect(IoBridge.java:112)
12-07 09:58:22.867 29727-29742/in.srain.cube.demo W/System.err: ... 20 more
viewpager里放很多fragment,然后fragment里有上拉加载的功能,离屏的fragment销毁重新创建的时候好像会添加多个加载更多的footer
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.