Git Product home page Git Product logo

ultimaterecyclerview's Issues

height: wrap_content not working

I am trying to get the UltimateRecyclerView to wrap its content, this is the result:

But when I use the normal RecyclerView it does work:

How can I fix this?

Library Compatibility

It seems that the library is compatible with API 11 or higher only (because of many animations)
On Android Arsenal is written "API 7".

EmptyView problem

I'm fetching files from a folder to recyclerview if the folder doesn't contain any files then i'd like to show empty view. Emptyview is shown if the adapter is set to null right? but when i try to ultimateRecyclerView.setAdapter(null); it crashes.

Is there a solution to show empty view when adapter is set null or it can be empty by default?

change color Swipe Refresh

Ho to change color in default swiperefresh (google refresh)? I can't find a method that can to change it.

Thanks cymcsg

Different layout is not supported in UltimateViewAdapter?

I try to create an adapter which extends UltimateViewAdapter,and I want to load different layout file.So I overwrite the function:getItemViewType(),but I find out that the function:onCreateViewHolder() only have one paramater,not contain viewType.
Please give me some suggesttions,thanks a lot.

Refreshing and scrolling will cause an exception.

Pulling to refresh and immediatly scrolling will cause the given exception:

 java.lang.IndexOutOfBoundsException: Inconsistency detected. Invalid item position 6(offset:6).state:13
            at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:4041)
            at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:3999)
            at android.support.v7.widget.LinearLayoutManager$LayoutState.next(LinearLayoutManager.java:1892)
            at android.support.v7.widget.GridLayoutManager.layoutChunk(GridLayoutManager.java:419)
            at android.support.v7.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1301)
            at android.support.v7.widget.LinearLayoutManager.scrollBy(LinearLayoutManager.java:1128)
            at android.support.v7.widget.LinearLayoutManager.scrollVerticallyBy(LinearLayoutManager.java:985)
            at android.support.v7.widget.RecyclerView.scrollByInternal(RecyclerView.java:1204)
            at android.support.v7.widget.RecyclerView.onTouchEvent(RecyclerView.java:1951)
            at android.view.View.dispatchTouchEvent(View.java:7713)
            at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2210)
            at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1945)
            at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2216)
            at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1959)
            at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2216)
            at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1959)
            at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2216)
            at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1959)
            at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2216)
            at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1959)
            at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2216)
            at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1959)
            at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2216)
            at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1959)
            at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2216)
            at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1959)
            at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2216)
            at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1959)
            at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2216)
            at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1959)
            at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2216)
            at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1959)
            at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2216)
            at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1959)
            at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2216)
            at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1959)
            at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:2329)
            at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1568)
            at android.app.Activity.dispatchTouchEvent(Activity.java:2458)
            at android.support.v7.internal.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:59)
            at android.support.v7.internal.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:59)
            at android.support.v7.internal.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:59)
            at android.support.v7.internal.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:59)
            at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:2277)
            at android.view.View.dispatchPointerEvent(View.java:7893)
            at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:3947)
            at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:3826)
            at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3392)
            at android.v

Error in load more...

My code just work fine before adding these lines but I get this error when adding load more:

mRecyclerView.enableLoadmore();
    adapter.setCustomLoadMoreView(LayoutInflater.from(getActivity())
            .inflate(R.layout.progressbar_bottom_load_more_recycler_view, null));
    mRecyclerView.setOnLoadMoreListener(new UltimateRecyclerView.OnLoadMoreListener() {
        @Override
        public void loadMore(int itemsCount, final int maxLastVisiblePosition) {
            new Handler().postDelayed(new Runnable() {
                public void run() {
                    // todo: insert new items at the end of list....
                    // adapter.insert("More " + moreNum++, simpleRecyclerViewAdapter.getAdapterItemCount());
                    CallLogAdapter.HistoryItem historyItem = new CallLogAdapter.HistoryItem();
                    adapter.insert(historyItem, adapter.getAdapterItemCount());
                    adapter.insert(historyItem, adapter.getAdapterItemCount());
                    adapter.insert(historyItem, adapter.getAdapterItemCount());
                }
            }, 3000);
        }

The error:

06-02 10:50:49.217    9898-9898/co.a.m E/AndroidRuntime﹕ FATAL EXCEPTION: main
Process: co.a.m , PID: 9898
java.lang.IndexOutOfBoundsException: Invalid index 30, size is 30
        at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:255)
        at java.util.ArrayList.get(ArrayList.java:308)
        at co.a.m.view.adapter.CallLogAdapter.getItem(CallLogAdapter.java:105)
        at co.a.m.view.adapter.CallLogAdapter.onBindViewHolder(CallLogAdapter.java:90)
        at android.support.v7.widget.RecyclerView$Adapter.bindViewHolder(RecyclerView.java:4805)
        at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:4106)
        at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:3999)
        at android.support.v7.widget.LinearLayoutManager$LayoutState.next(LinearLayoutManager.java:1892)
        at android.support.v7.widget.LinearLayoutManager.layoutChunk(LinearLayoutManager.java:1338)
        at android.support.v7.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1301)
        at android.support.v7.widget.LinearLayoutManager.scrollBy(LinearLayoutManager.java:1128)
        at android.support.v7.widget.LinearLayoutManager.scrollVerticallyBy(LinearLayoutManager.java:985)
        at android.support.v7.widget.RecyclerView$ViewFlinger.run(RecyclerView.java:3458)
        at android.view.Choreographer$CallbackRecord.run(Choreographer.java:799)
        at android.view.Choreographer.doCallbacks(Choreographer.java:599)
        at android.view.Choreographer.doFrame(Choreographer.java:558)
        at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:784)
        at android.os.Handler.handleCallback(Handler.java:733)
        at android.os.Handler.dispatchMessage(Handler.java:95)
        at android.os.Looper.loop(Looper.java:157)
        at android.app.ActivityThread.main(ActivityThread.java:5872)
        at java.lang.reflect.Method.invokeNative(Native Method)
        at java.lang.reflect.Method.invoke(Method.java:515)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:674)
        at dalvik.system.NativeStart.main(Native Method)

Invalid index 30, size is 30??????!!!!!!!!

Although call disableLoadmore method, load more view will still show if item count is more than 3

Because when calling disableLoadmore method, customLoadMoreView will still be set an empty view(empty_progressbar.xml). But if recycle view need show load more view you use the following clauses:

if (mAdapter.getAdapterItemCount() >= showLoadMoreItemNum && mAdapter.getCustomLoadMoreView() != null
&& mAdapter.getCustomLoadMoreView().getVisibility() == View.GONE) {
mAdapter.getCustomLoadMoreView().setVisibility(View.VISIBLE);
}
if (mAdapter.getAdapterItemCount() < showLoadMoreItemNum && mAdapter.getCustomLoadMoreView() != null) {
mAdapter.getCustomLoadMoreView().setVisibility(View.GONE);
}

You can see the if clause can still be true, is that right?

admob support for DFP google

I have a very important question. If i want to integrate admob or DFP into the list view.
As from the image. How does it make the adapter to support typed view binding to support this kind of inserting ad into the listview? I have also seen from the previous discussion about this support as mentioned on #35.

I have also came across another android library from the typed listview.

Will anyone to take a good look of how to integrate that?

Please change so that RecylerView is not permanently white.

    <android.support.v7.widget.RecyclerView
        android:id="@+id/ultimate_list"
        android:background="#ffffff"
        android:layout_width="match_parent"
        android:layout_height="match_parent"></android.support.v7.widget.RecyclerView>

This part of the code. I am not able to override it in gradle. Please remove the #ffffff I do not want my recyclerview to be white at all times.

New method swapAdapter should be more intelligent

The swapAdapter method is just a proxy to RecyclerView's method. But I think this method should do more stuff just like the addAdapter method. For example show/hide loading progress, attach observers and update an empty view, etc.
For now if I update data with the swapAdapter a loader indicator is not hiding.

Request : Ability pullToRefresh in empty Recyclerview

hi cymcsg, its a great library and very helpfull.
I just try pulltorefresh when adapter is empty, and it seems does'nt work anyway.
maybe you can change pulltorefresh with MultiSwipeRefreshLayout
here is the link : MultiSwipeRefreshLayout.java
and you can add layout_empty.xml with scrollview as parent view to make it enable to pulltorefresh.

thanks cymcsg 👍

Report bug of StringIndexOutOfBoundsException


Process: com.marshalchen.ultimaterecyclerview.demo, PID: 19937
    java.lang.StringIndexOutOfBoundsException: length=0; index=0
            at com.marshalchen.ultimaterecyclerview.demo.SimpleAdapter.getHeaderId(SimpleAdapter.java:87)
            at com.timehop.stickyheadersrecyclerview.HeaderPositionCalculator.hasNewHeader(HeaderPositionCalculator.java:43)
            at com.timehop.stickyheadersrecyclerview.StickyRecyclerHeadersDecoration.getItemOffsets(StickyRecyclerHeadersDecoration.java:60)
            at android.support.v7.widget.RecyclerView.getItemDecorInsetsForChild(RecyclerView.java:2744)
            at android.support.v7.widget.RecyclerView$LayoutManager.measureChildWithMargins(RecyclerView.java:5543)
            at android.support.v7.widget.LinearLayoutManager.layoutChunk(LinearLayoutManager.java:1332)
            at android.support.v7.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1269)
            at android.support.v7.widget.LinearLayoutManager.scrollBy(LinearLayoutManager.java:1097)
            at android.support.v7.widget.LinearLayoutManager.scrollVerticallyBy(LinearLayoutManager.java:957)
            at android.support.v7.widget.RecyclerView$ViewFlinger.run(RecyclerView.java:2797)
            at android.view.Choreographer$CallbackRecord.run(Choreographer.java:761)
            at android.view.Choreographer.doCallbacks(Choreographer.java:574)
            at android.view.Choreographer.doFrame(Choreographer.java:543)
            at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:747)
            at android.os.Handler.handleCallback(Handler.java:733)
            at android.os.Handler.dispatchMessage(Handler.java:95)
            at android.os.Looper.loop(Looper.java:136)
            at android.app.ActivityThread.main(ActivityThread.java:5050)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:515)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:806)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:622)
            at dalvik.system.NativeStart.main(Native Method)

Empty view won't show when adapter item count is zero because using loading more view

I find your code about showing or hiding empty view as follows:
if (mRecyclerView.getAdapter().getItemCount() == 0 && mEmptyId != 0) {
mEmpty.setVisibility(View.VISIBLE);
} else if (mEmptyId != 0) {
mEmpty.setVisibility(View.GONE);
}

There is a bug if you add load more view. You can see mRecyclerView.getAdapter().getItemCount() will never be ==0 because the return result of getItemCount method will be ==1.

Now I have to use the following method to fix this problem:
@OverRide
public int getAdapterItemCount() {
int fixHeaderFooterBug = 0;
if(mItems.size() == 0 && getCustomLoadMoreView() != null)fixHeaderFooterBug--;
if(mItems.size() == 0 && getCustomHeaderView() != null)fixHeaderFooterBug--;
return mItems.size() + fixHeaderFooterBug;
}

Can you fix this bug ASAP. Thank you very much

A few proposals to improve this library

  1. add swapAdapter() functionality;
  2. setSwipeToDismissCallback() throws a null pointer exception if there is no adapter set;
  3. add getAdapter() method (useful thing);
  4. when no data in the adapter it would be great to show an empty view =)

Hide toolbar and tabs.

The current implementation only works for toolbar, would be awesome to also support any kind of view instead of only Toolbar. In my case i have a LinearLayout that contains the toolbar and tabs and i would like to hide only a portion of that LinearLayout

setCustomLoadMoreView

setCustomLoadMoreView 接口为什么一定要在adapter设置, 这应该是RecyclerView职责啊, 而不该在adapter中.

Can't use on 4.3 Phones

Hi, I was using UltimateRecyclerView on my application, but it works well on my Nexys 5 (5.1) but now in my Galaxy Nexus (4.3), Am I doing something wrong?

Thanks

Cannot extend UltimateRecyclerviewViewHolder as it is protected

Hi, I am trying to integrate UltimateRecyclerView into my project, and I am not able to extend my custom ViewHolder from UltimateRecyclerviewViewHolder as it is protected class in UltimateViewHolder.

It would be good also if adapter could be based on generics, to that I could use it in same way as RecyclerView.Adapter and specify my custom ViewHolder class there.

setOnLoadMoreListener

i use it like this,but it doen't work

 rv_mycre.setOnLoadMoreListener(new UltimateRecyclerView.OnLoadMoreListener() {
        @Override
        public void loadMore(int i, int i2) {
           // fg_recommend_presenter.getRcdPost(lasId);
        }
    });

I want know how to use it

UltimateRecyclerView's background

Could you remove the background color or recyclerview (ultimate_recycler_view_layout.xml, android:background="#ffffff" ) and make it optional with styles or something?

Because it doesn't seem good with white background.

Also another suggestion is could you add some attributes to VerticalSwipeRefreshLayout for changing refreshing colors? like; app:recyclerviewRefreshingColors="@color\refreshing_colors" which uses array of 4 colors.

Thank you so much again @cymcsg

OnScrollListener - RecyclerView Y Translation

I am using the OnScrollListener to hide the Toolbar when scrolling.. This functions correctly with the stock RecyclerView, however when using UltimateRecyclerView component, the RecyclerView doesn't translate upwards with the Toolbar, instead it just crops the content.

Any ideas as to how to resolve this? TIA.

Here's how it looks..
Actual Result

Here's how it should look..
Desired Effect

gradle please?

Thank you for amazing lib!

I'd like to use it in one of my project, could you host it in maven please?

Strange issue in row visibility

I am facing a strange behaviour. I have an adapter extending UltimateViewAdapter. It is showing one row less that it must show in actual. If I setView count to 1, it shows no rows.

Loading view.

Would you consider adding "Loading" state into the RecyclerView?, empty view will trigger when there isn't any item and loading will trigger the first time the recycler view is retrieving the items.

[ProgressBar] Load more not showing

HI, Im trying to use enabledMore feature, but when I scroll down, progress bar not showing, can you explain me how this works, and if there is some callback like onRefresh (pull from top) to loadmore... I was thinking in populate recycler from a paginated get service...

Thanks,

when i use it,it cause some questions

apply plugin: 'com.android.application'

android {
compileSdkVersion 18
buildToolsVersion '22.0.1'
defaultConfig {
applicationId "test"
minSdkVersion 15
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
}
}
repositories {
mavenCentral()
//UltimateRecyclerView 用到的
jcenter()
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:support-v4:22.1.1'
//网络请求
compile 'com.loopj.android:android-async-http:1.4.7'
//加载图片类库
compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.3'
//阿里fastjson
compile files('libs/fastjson-1.1.43.android.jar')
//recyclerview
compile 'com.android.support:recyclerview-v7:22.1.1'
//viewpager tablayout
compile 'com.ogaclejapan.smarttablayout:library:1.1.3@aar'
//圆形图片
compile 'de.hdodenhof:circleimageview:1.3.0'
//卡片背景
compile 'com.android.support:cardview-v7:22.1.1'
//扇形菜单
compile 'com.oguzdev:CircularFloatingActionMenu:1.0.2'
//photoview支持图片放大缩小
compile 'com.github.chrisbanes.photoview:library:1.2.3'
//动画库
compile files('libs/nineoldandroids-2.4.0.jar')
//gif显示类库
compile 'pl.droidsonroids.gif:android-gif-drawable:1.1.+'
compile 'com.marshalchen.ultimaterecyclerview:library:0.3.4'
}

superslim's proguard problem

I've updated the lib for the latest version and it gives error from proguard;

Warning:com.tonicartos.superslim.LayoutModifierHelper: can't find referenced class com.tonicartos.superslim.Recycler
Warning:there were 4 unresolved references to classes or interfaces.
You may need to add missing library jars or update their versions.
If your code works fine without the missing classes, you can suppress
the warnings with '-dontwarn' options.
(http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedclass)

is it a problem or should i add the superslim library with -dontwarn ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.