Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

recode the core. #276

Closed
2 tasks done
jjhesk opened this issue Jan 25, 2016 · 15 comments
Closed
2 tasks done

recode the core. #276

jjhesk opened this issue Jan 25, 2016 · 15 comments

Comments

@jjhesk
Copy link
Collaborator

jjhesk commented Jan 25, 2016

First of all, thanks to @cymcsg for your amazing bundle from other library and we have been fixing bugs so far and its been your sole effort for the majority. Here I want to give you a special thanks for our hard works. However, looking at the contribution rate. We dont see the popular of contributions from the crowds. For my view of points, it is still such an headache to look at the code in one single large file.
I think the recyclerview has been a maze for people to add their external efforts on combining their module.

Basically, there are

  1. too many hardcoded things
  2. not many generic type
  3. not able to add module easily.
    I have read from other libraries and found some interesting implementation yet will able to keep this library as lightweight. Maybe we can try some effort to make this library more adaptable for developer crowd. Please read up this libray and give me some suggestions. Here I will response to all the previous query for the adaptable module features Is there a way to add headers to UltimateRecyclerView as listview.addHeader(...)?  #222
  • better control for the empty view to show or not
  • fix load more on grid layout issue

For this version of 0.4.0 we need to clear out all the most the popular issues from the previous posts.

  1. The first thing is the loadmore issue raised by all other developers.
  2. The second thing is the grid layout issues.
@jjhesk jjhesk changed the title rewriting the code?! recode the core. Jan 25, 2016
@cymcsg
Copy link
Owner

cymcsg commented Jan 25, 2016

I agree with you.I really think the library should be more adaptable.
Would you like to be a collaborator of the project?

@jjhesk
Copy link
Collaborator Author

jjhesk commented Jan 26, 2016

can u add me in the project? +1 you can branch out a portion for me to start making updates..

@cymcsg
Copy link
Owner

cymcsg commented Jan 26, 2016

@jjhesk I have added you to the project.Hoping for your magical contribution~

@jjhesk
Copy link
Collaborator Author

jjhesk commented Jan 26, 2016

started from this branch i will start digging into grid layout manager on the core code at this file

@jjhesk
Copy link
Collaborator Author

jjhesk commented Feb 2, 2016

now i have done some works for the upgrades. =)
sample demonstration code
adapter for gridlayout manager
enhanced adapter for URV

#280 First is the load more issue which is now resolved
#284 Zero data to start at the beginning

Now this is the proper coding for enable load more on grid layout manager

     super.onCreate(savedInstanceState);
        setContentView(getMainLayout());
        mToolbar = (Toolbar) findViewById(R.id.tool_bar);
        setSupportActionBar(mToolbar);
        getSupportActionBar().setDisplayShowTitleEnabled(true);
        listuv = (UltimateRecyclerView) findViewById(R.id.ultimate_recycler_view);
        mGridAdapter = new GridLayoutRVAdapter(getItems());
        mGridAdapter.setSpanColumns(columns);
        mGridLayoutManager = new BasicGridLayoutManager(this, columns, mGridAdapter);
        listuv.setLayoutManager(mGridLayoutManager);
        listuv.setHasFixedSize(true);
        listuv.setSaveEnabled(true);
        listuv.setClipToPadding(false);
        listuv.setAdapter(mGridAdapter);
        listuv.setItemAnimator(new DefaultItemAnimator());

        // mGridAdapter.setCustomLoadMoreView(LayoutInflater.from(this).inflate(R.layout.custom_bottom_progressbar, null));
        listuv.setNormalHeader(setupHeaderView());
        final Handler f = new Handler();
        listuv.setOnLoadMoreListener(new UltimateRecyclerView.OnLoadMoreListener() {
            @Override
            public void loadMore(int itemsCount, int maxLastVisiblePosition) {
                //   Log.d(TAG, itemsCount + " :: " + itemsCount);
                f.postDelayed(new Runnable() {
                    @Override
                    public void run() {
                        mGridAdapter.insert(SampleDataboxset.newListFromGen(2));
                        // listuv.disableLoadmore();
                        // listuv.disableLoadmore();
                    }
                }, 1000);
            }
        });

        listuv.enableLoadmore();

when you need to disable load more after done loading the items you can do this:

    public void loadMore(int itemsCount, int maxLastVisiblePosition) {
                //   Log.d(TAG, itemsCount + " :: " + itemsCount);
                f.postDelayed(new Runnable() {
                    @Override
                    public void run() {
                        mGridAdapter.insert( .... );
                        listuv.disableLoadmore();
                    }
                }, 1000);
            }

@jjhesk
Copy link
Collaborator Author

jjhesk commented Feb 2, 2016

  • new feature to add for empty view control. it will enable the user to take control of when the empty view should be shown via api.
  • @cymcsg can you please do some testing on the scrolling? lets test it and see if it is stable on my branch then we can publish a release for the incremental version. Cheers!

@cymcsg
Copy link
Owner

cymcsg commented Feb 3, 2016

Great work! Let's try to do some test and then release them.

@jjhesk
Copy link
Collaborator Author

jjhesk commented Feb 3, 2016

just tested on linearlayout and i also fixed the defects from the load more. please do more load more testing...
sample apps are also updated.

Test code list

  • empty adapter at the beginning and using load more to add items into the RV for LINEAR layout manager - expect a loading spinner to show before
  • empty adapter at the beginning and using load more to add items into the RV for GRID layout manager - expect a loading spinner to show before (https://youtu.be/iTnIf-N8m1Y)
  • empty adapter at the beginning and using load more to add items into the RV for GRID layout manager - expect empty view to show
  • empty adapter at the beginning and using load more to add items into the RV for LINEAR layout manager - expect empty view to show

@jjhesk
Copy link
Collaborator Author

jjhesk commented Feb 3, 2016

quick fix from zero data at the beginning. #284

@cymcsg
Copy link
Owner

cymcsg commented Feb 4, 2016

Awesome work!

@jjhesk
Copy link
Collaborator Author

jjhesk commented Feb 11, 2016

@cymcsg try to deploy from branch core-recode-redesign i think its ready for 0.4.0. the only thing is the swiplist demo and there are some errors behind. you might take a look of the code

@jjhesk jjhesk added ready and removed in progress labels Feb 11, 2016
@cymcsg
Copy link
Owner

cymcsg commented Feb 11, 2016

Great work!
I have noticed that problem in SwipeListViewExampleActivity and some problem in the Mainactivity when I swipe the first item.

@cymcsg
Copy link
Owner

cymcsg commented Feb 12, 2016

I do not have enough time to fix the bug in SwipeListViewExampleActivity in these days so I think it's a good idea to release 0.4.0 with this problem which will be fixed in next version.
Thank you for your great work.If you like we can also talk about something via Email.

@jjhesk jjhesk modified the milestones: 0.4.1, 0.4.0 Feb 12, 2016
@jjhesk jjhesk self-assigned this Feb 12, 2016
@jjhesk jjhesk closed this as completed Feb 12, 2016
@jjhesk jjhesk reopened this Feb 17, 2016
@jjhesk
Copy link
Collaborator Author

jjhesk commented Mar 21, 2016

@cymcsg yes i can take up your work and fix the possible bugs

@jjhesk jjhesk modified the milestones: 0.5.0, 0.4.0 Apr 5, 2016
@jjhesk
Copy link
Collaborator Author

jjhesk commented Apr 5, 2016

should be fixed again.. on v0.5.0

@jjhesk jjhesk closed this as completed Apr 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants