A couple of sticky header decorations for android's recycler view.

Overview

CircleCI

DEPRECATION NOTICE

This library has not been touched in a very long time and many things have changed in the android ecosystem since then. Updating and maintaining this library is not a priority at the moment.

Header-decor

A couple of sticky header decorations for android's recycler view.

A Sample app is available on Google Play:

Header decor sample app image

Google Play

License

Copyright 2015 Eduardo Barrenechea.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Comments
  • Failed to resolve: com.github.edubarr

    Failed to resolve: com.github.edubarr

    When I add this to gradle, it fails: Failed to resolve: com.github.edubarr

    My project build.gradle:

    buildscript {
        repositories {
            jcenter()
            google()
            maven {
                url 'https://maven.fabric.io/public'
            }
        }
        dependencies {
    
            classpath 'com.android.tools.build:gradle:3.1.3'
            classpath 'io.realm:realm-gradle-plugin:5.2.0'
        }
    }
    
    allprojects {
        repositories {
            jcenter()
            maven { url 'https://maven.google.com/' }
            maven { url "https://jitpack.io" }
            google()
            flatDir {
                dirs 'libs'
            }
        }
    }
    
    task clean(type: Delete) {
        delete rootProject.buildDir
    }
    
    

    My app build gradle:

    implementation 'com.github.edubarr.header-decor/header-decor:0.2.8'
    
    opened by gelbertgel 12
  • Add ability to make headers optional for some items

    Add ability to make headers optional for some items

    This is basically the same as pull request #32 with a few modifications that made it a little easier to understand as well as a bug fix from @chendrak.

    opened by starkej2 7
  • On click not working

    On click not working

    viewHolder.buttonDelete.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Log.v("test", "clicked delete"); } });

    isn't working. I'm setting this in the onBindViewHolder(). How do I implement on click?

    opened by dphart 7
  • Can minSdk 9 work?

    Can minSdk 9 work?

    Hello, I know this library has set minSdk to 15 but I tried this library on android 2.3. And It looks like the headers cover the entire screen. Check out the pic. I was wondering how hard can it be to support apis starting from 9 and above? device-2015-06-16-021708

    opened by ThanosFisherman 7
  • Not working with recyclerView having more than 2 view types

    Not working with recyclerView having more than 2 view types

    I implemented my adapter using the library, but still I am not able to make headers stick. Here is my adapter implementation:

    public class StickyFeedAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> implements StickyHeaderAdapter<StickyFeedAdapter.HeaderViewHolder> {
    
        protected final String TAG = getClass().getSimpleName();
        private Context context;
        private List<FeedItems> feedItems;
        private Fragment fragment;
        String API;
        private String token;
        TinyDB tinyDB;
        RestAdapter restAdapter;
        private static int radius = Utils.dpToPx(28);
        private LayoutInflater mInflater;
        Galleri5Application application;
        MixpanelAPI mixpanel;
    
        private static final int ITEM_TYPE_HEADER = 0, ITEM_TYPE_CARD = 1, ITEM_TYPE_RIBBON = 2, ITEM_TYPE_LOADING = 3;
    
        public StickyFeedAdapter(Context context, List<FeedItems> list, Fragment fragment) {
            this.context = context;
            this.feedItems = list;
            this.fragment = fragment;
    
            mInflater = LayoutInflater.from(context);
            application = (Galleri5Application) ((AppCompatActivity) context).getApplication();
            API = application.getAPI();
            mixpanel = MixpanelAPI.getInstance(context, application.getMixpanelId());
            OkHttpClient okHttpClient = new OkHttpClient();
            tinyDB = new TinyDB(context);
            token = tinyDB.getString(AppConstants.GALLERI5_ACCESS_TOKEN);
            RequestInterceptor requestInterceptor = new RequestInterceptor() {
                @Override
                public void intercept(RequestFacade request) {
                    request.addHeader("Accept", "application/json");
                    request.addHeader("Authorization", "Token " + token);
                }
            };
            restAdapter = new RestAdapter.Builder()
                    .setClient(new OkClient(okHttpClient))
                    .setLogLevel(RestAdapter.LogLevel.FULL)
                    .setEndpoint(API)
                    .setRequestInterceptor(requestInterceptor)
                    .build();
        }
    
        @Override
        public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
            LogUtil.i(TAG, "onCreateViewHolder called");
            if (viewType == ITEM_TYPE_HEADER) {
                View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.feed_row, parent, false);
                return new HeaderViewHolder(view);
            } else if (viewType == ITEM_TYPE_CARD) {
                View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.feed_new_card, parent, false);
                return new CardViewHolder(view);
            } else if (viewType == ITEM_TYPE_RIBBON) {
                View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.feed_row_ribbon, parent, false);
                return new RibbonViewHolder(view, context);
            } else if (viewType == ITEM_TYPE_LOADING) {
                View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.row_loading, parent, false);
                return new LoadingViewHolder(view);
            } else {
                return null;
            }
        }
    
        @Override
        public void onBindViewHolder(final RecyclerView.ViewHolder holder, int position) {
            LogUtil.i(TAG, "onBindViewHolder called");
            int viewType = getItemViewType(position);
            FeedItems currentItem = getItem(position);
            StaggeredGridLayoutManager.LayoutParams layoutParams = (StaggeredGridLayoutManager.LayoutParams) holder.itemView.getLayoutParams();
    
            if (viewType == ITEM_TYPE_HEADER) {
                final HeaderItem headerItem = currentItem.getHeaderItem();
                layoutParams.setFullSpan(true);
    
                if (headerItem.isFollowing()) {
                    ((HeaderViewHolder) holder).mightLike.setVisibility(View.GONE);
                    ((HeaderViewHolder) holder).followButton.setBackgroundResource(R.drawable.button_background_filled);
                    ((HeaderViewHolder) holder).followText.setTextColor(Color.parseColor("#424447"));
                    ((HeaderViewHolder) holder).followText.setText("FOLLOWING");
                } else {
                    ((HeaderViewHolder) holder).mightLike.setVisibility(View.VISIBLE);
                    ((HeaderViewHolder) holder).followButton.setBackgroundResource(R.drawable.button_background);
                    ((HeaderViewHolder) holder).followText.setTextColor(Color.parseColor("#F0F0E9"));
                    ((HeaderViewHolder) holder).followText.setText("FOLLOW");
                }
    
                ((HeaderViewHolder) holder).followButton.setOnClickListener(new View.OnClickListener() {
                    @Override
                    public void onClick(View view) {
                        if (!headerItem.isFollowing()) {
                            //follow gallery
                            headerItem.setFollowing(true);
                            ((HeaderViewHolder) holder).mightLike.setVisibility(View.GONE);
                            ((HeaderViewHolder) holder).followButton.setBackgroundResource(R.drawable.button_background_filled);
                            ((HeaderViewHolder) holder).followText.setTextColor(Color.parseColor("#424447"));
                            ((HeaderViewHolder) holder).followText.setText("FOLLOWING");
    
                            follow(headerItem.getGalleryPk());
    
                        } else {
                            //unfollow gallery
                            headerItem.setFollowing(false);
                            ((HeaderViewHolder) holder).mightLike.setVisibility(View.VISIBLE);
                            ((HeaderViewHolder) holder).followButton.setBackgroundResource(R.drawable.button_background);
                            ((HeaderViewHolder) holder).followText.setTextColor(Color.parseColor("#F0F0E9"));
                            ((HeaderViewHolder) holder).followText.setText("FOLLOW");
    
                            unfollow(headerItem.getGalleryPk());
                        }
                    }
                });
    
                ((HeaderViewHolder) holder).shareButton.setOnClickListener(new View.OnClickListener() {
                    @Override
                    public void onClick(View v) {
    
                    }
                });
    
                ((HeaderViewHolder) holder).galleryName.setText(headerItem.getGalleryName());
    
                ((HeaderViewHolder) holder).numPhotos.setText(String.format("%s PHOTOS", String.valueOf(headerItem.getNumPhotos())));
    
                ((HeaderViewHolder) holder).numFollowers.setText(String.format("%s FOLLOWERS", String.valueOf(headerItem.getNumFollowers())));
    
            } else if (viewType == ITEM_TYPE_CARD) {
                final FeedPhoto cardItem = currentItem.getCardItem();
                layoutParams.setFullSpan(false);
    
                double aspectRatio = (double) cardItem.getWidth() / cardItem.getHeight();
                ((CardViewHolder) holder).image.setAspectRatio((float) aspectRatio);
    
                Uri uri = Uri.parse(cardItem.getPhotoUrl());
                ImageRequest request = ImageRequestBuilder.newBuilderWithSource(uri)
                        .setProgressiveRenderingEnabled(true)
                        .build();
                DraweeController controller = Fresco.newDraweeControllerBuilder()
                        .setImageRequest(request)
                        .setOldController(((CardViewHolder) holder).image.getController())
                        .build();
                ((CardViewHolder) holder).image.setController(controller);
    
                Picasso.with(context)
                        .load(cardItem.getProfilePic())
                        .resize(radius, radius)
                        .centerCrop()
                        .transform(new CircleTransform())
                        .into(((CardViewHolder) holder).profilePic);
    
                ((CardViewHolder) holder).username.setText(cardItem.getUserName());
    
                ((CardViewHolder) holder).timestamp.setText(cardItem.getTime());
    
                if (TextUtils.isEmpty(cardItem.getLocation())) {
                    ((CardViewHolder) holder).locationBox.setVisibility(View.GONE);
                } else {
                    ((CardViewHolder) holder).locationBox.setVisibility(View.VISIBLE);
                    ((CardViewHolder) holder).locationText.setText(cardItem.getLocation());
                }
    
                if (TextUtils.isEmpty(cardItem.getCaption())) {
                    ((CardViewHolder) holder).captionText.setVisibility(View.GONE);
                } else {
                    ((CardViewHolder) holder).captionText.setVisibility(View.VISIBLE);
                    ((CardViewHolder) holder).captionText.setText(cardItem.getCaption());
                }
    
                ((CardViewHolder) holder).collectButton.setOnClickListener(new View.OnClickListener() {
                    @Override
                    public void onClick(View v) {
                        Intent intent = new Intent(context, AddToCollectionActivity.class);
                        intent.putExtra("photoPk", cardItem.getPk());
                        intent.putExtra("imageUrl", cardItem.getPhotoUrl());
                        intent.putExtra("location", cardItem.getLocation());
                        intent.putExtra("caption", cardItem.getCaption());
                        context.startActivity(intent);
                        ((Activity) context).overridePendingTransition(R.anim.slide_up, R.anim.no_change);
                    }
                });
    
            } else if (viewType == ITEM_TYPE_RIBBON) {
                RibbonItem ribbonItem = currentItem.getRibbonItem();
                layoutParams.setFullSpan(true);
    
                FeedRibbonAdapter feedRibbonAdapter = new FeedRibbonAdapter(context, fragment, ribbonItem);
                ((RibbonViewHolder) holder).feedRibbonAdapter = feedRibbonAdapter;
    
                ((RibbonViewHolder) holder).ribbonText.setText(ribbonItem.getTitle());
                ((RibbonViewHolder) holder).recyclerView.setAdapter(feedRibbonAdapter);
    
            } else if (viewType == ITEM_TYPE_LOADING) {
                layoutParams.setFullSpan(true);
                ((LoadingViewHolder) holder).indicator.setVisibility(View.VISIBLE);
            }
        }
    
        public FeedItems getItem(int position) {
            return feedItems.get(position);
        }
    
        @Override
        public int getItemViewType(int position) {
            LogUtil.i(TAG, "getItemViewType called");
            FeedItems currentItem = getItem(position);
            if (currentItem.getType() == 0) {
                return ITEM_TYPE_HEADER;
            } else if (currentItem.getType() == 1) {
                return ITEM_TYPE_CARD;
            } else if (currentItem.getType() == 2) {
                return ITEM_TYPE_RIBBON;
            } else {
                return ITEM_TYPE_LOADING;
            }
        }
    
        @Override
        public int getItemCount() {
            return feedItems == null ? 0 : feedItems.size();
        }
    
        @Override
        public long getHeaderId(int position) {
            LogUtil.i(TAG, "getHeaderId called");
            if (position == 0) { // don't show header for first item
                return StickyHeaderDecoration.NO_HEADER_ID;
            } else {
                return getHeaderForPosition(position);
            }
        }
    
        private long getHeaderForPosition(int position) {
            for (int i = position; i > 0; i--) {
                if (getItem(position) != null) {
                    if (getItem(position).getType() == 0) {
                        return (long) i;
                    }
                }
            }
    
            return StickyHeaderDecoration.NO_HEADER_ID;
        }
    
        @Override
        public HeaderViewHolder onCreateHeaderViewHolder(ViewGroup parent) {
            LogUtil.i(TAG, "onCreateHeaderViewHolder called");
            View view = mInflater.inflate(R.layout.feed_row, parent, false);
            return new HeaderViewHolder(view);
        }
    
        @Override
        public void onBindHeaderViewHolder(final HeaderViewHolder viewholder, int position) {
            LogUtil.i(TAG, "onBindHeaderViewHolder called");
            FeedItems currentItem = getItem(position);
            StaggeredGridLayoutManager.LayoutParams layoutParams = (StaggeredGridLayoutManager.LayoutParams) viewholder.itemView.getLayoutParams();
            final HeaderItem headerItem = currentItem.getHeaderItem();
            layoutParams.setFullSpan(true);
    
            if (headerItem.isFollowing()) {
                viewholder.mightLike.setVisibility(View.GONE);
                viewholder.followButton.setBackgroundResource(R.drawable.button_background_filled);
                viewholder.followText.setTextColor(Color.parseColor("#424447"));
                viewholder.followText.setText("FOLLOWING");
            } else {
                viewholder.mightLike.setVisibility(View.VISIBLE);
                viewholder.followButton.setBackgroundResource(R.drawable.button_background);
                viewholder.followText.setTextColor(Color.parseColor("#F0F0E9"));
                viewholder.followText.setText("FOLLOW");
            }
    
            viewholder.followButton.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    if (!headerItem.isFollowing()) {
                        //follow gallery
                        headerItem.setFollowing(true);
                        viewholder.mightLike.setVisibility(View.GONE);
                        viewholder.followButton.setBackgroundResource(R.drawable.button_background_filled);
                        viewholder.followText.setTextColor(Color.parseColor("#424447"));
                        viewholder.followText.setText("FOLLOWING");
    
                        follow(headerItem.getGalleryPk());
    
                    } else {
                        //unfollow gallery
                        headerItem.setFollowing(false);
                        viewholder.mightLike.setVisibility(View.VISIBLE);
                        viewholder.followButton.setBackgroundResource(R.drawable.button_background);
                        viewholder.followText.setTextColor(Color.parseColor("#F0F0E9"));
                        viewholder.followText.setText("FOLLOW");
    
                        unfollow(headerItem.getGalleryPk());
                    }
                }
            });
    
            viewholder.shareButton.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
    
                }
            });
    
            viewholder.galleryName.setText(headerItem.getGalleryName());
    
            viewholder.numPhotos.setText(String.format("%s PHOTOS", String.valueOf(headerItem.getNumPhotos())));
    
            viewholder.numFollowers.setText(String.format("%s FOLLOWERS", String.valueOf(headerItem.getNumFollowers())));
        }
    
        private void follow(int galleryPk) {
            LogUtil.i(TAG, "follow called");
    
            PostAPI api = restAdapter.create(PostAPI.class);
            api.follow(galleryPk, new Callback<ActionResponse>() {
                @Override
                public void success(ActionResponse actionResponse, Response response) {
                    LogUtil.i(TAG, "follow successful");
                }
    
                @Override
                public void failure(RetrofitError error) {
                    LogUtil.i(TAG, "follow failed");
                }
            });
        }
    
        private void unfollow(int galleryPk) {
            LogUtil.i(TAG, "unfollow called");
    
            PostAPI api = restAdapter.create(PostAPI.class);
            api.unfollow(galleryPk, new Callback<ActionResponse>() {
                @Override
                public void success(ActionResponse actionResponse, Response response) {
                    LogUtil.i(TAG, "unfollow successful");
                }
    
                @Override
                public void failure(RetrofitError error) {
                    LogUtil.i(TAG, "unfollow failed");
                }
            });
        }
    
        public static class HeaderViewHolder extends RecyclerView.ViewHolder {
            @Bind(R.id.mightLike)
            TextView mightLike;
    
            @Bind(R.id.galleryName)
            TextView galleryName;
    
            @Bind(R.id.shareButton)
            RelativeLayout shareButton;
    
            @Bind(R.id.shareText)
            TextView shareText;
    
            @Bind(R.id.followButton)
            RelativeLayout followButton;
    
            @Bind(R.id.followText)
            TextView followText;
    
            @Bind(R.id.numPhotos)
            TextView numPhotos;
    
            @Bind(R.id.numFollowers)
            TextView numFollowers;
    
            public HeaderViewHolder(View view) {
                super(view);
                ButterKnife.bind(this, view);
            }
        }
    
        public static class CardViewHolder extends RecyclerView.ViewHolder {
            @Bind(R.id.profilePic)
            ImageView profilePic;
    
            @Bind(R.id.username)
            TextView username;
    
            @Bind(R.id.timestamp)
            TextView timestamp;
    
            @Bind(R.id.image)
            SimpleDraweeView image;
    
            @Bind(R.id.tagButton)
            ImageView tagButton;
    
            @Bind(R.id.reminderButton)
            ImageView reminderButton;
    
            @Bind(R.id.collectButton)
            RelativeLayout collectButton;
    
            @Bind(R.id.shareButton)
            RelativeLayout shareButton;
    
            @Bind(R.id.locationBox)
            LinearLayout locationBox;
    
            @Bind(R.id.locationText)
            TextView locationText;
    
            @Bind(R.id.captionText)
            TextView captionText;
    
            public CardViewHolder(View itemView) {
                super(itemView);
                ButterKnife.bind(this, itemView);
            }
        }
    
        public static class RibbonViewHolder extends RecyclerView.ViewHolder {
            @Bind(R.id.recyclerView)
            FlingRecyclerView recyclerView;
    
            @Bind(R.id.ribbonText)
            TextView ribbonText;
    
            FeedRibbonAdapter feedRibbonAdapter;
    
            public RibbonViewHolder(View view, Context context) {
                super(view);
                ButterKnife.bind(this, view);
                LinearLayoutManager layoutManager = new LinearLayoutManager(context, LinearLayoutManager.HORIZONTAL, false);
                recyclerView.setLayoutManager(layoutManager);
                SpacesItemDecoration spacesItemDecoration = new SpacesItemDecoration(Utils.dpToPx(8));
                recyclerView.addItemDecoration(spacesItemDecoration);
            }
        }
    
        public static class LoadingViewHolder extends RecyclerView.ViewHolder {
            @Bind(R.id.avloadingIndicatorView)
            AVLoadingIndicatorView indicator;
    
            public LoadingViewHolder(View view) {
                super(view);
                ButterKnife.bind(this, view);
            }
        }
    
        private static class SpacesItemDecoration extends RecyclerView.ItemDecoration {
            private int space;
    
            public SpacesItemDecoration(int space) {
                this.space = space;
            }
    
            @Override
            public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) {
                int position = parent.getChildAdapterPosition(view);
                int count = state.getItemCount();
                if (position == 0) {
                    outRect.left = space;
                    outRect.right = space / 2;
                } else if (position == count - 1) {
                    outRect.right = space;
                    outRect.left = space / 2;
                } else {
                    outRect.left = space / 2;
                    outRect.right = space / 2;
                }
            }
        }
    }
    

    I see that the getHeaderId() is never called. I have one type of view which will be header and 3 other view types that would not be header and won't stick. What's wrong with my implementation?

    opened by pipipzz 5
  • Add continuous integration

    Add continuous integration

    Continuous integration would be helpful to make sure proposed pull requests build successfully. CircleCi would be pretty easy to set up, but I'm not an admin in the repo so maybe @edubarr can help.

    opened by starkej2 4
  • NullPointerException: Attempt to invoke virtual method 'int android.support.v7.widget.RecyclerView$ViewHolder.getLayoutPosition()' on a null object reference

    NullPointerException: Attempt to invoke virtual method 'int android.support.v7.widget.RecyclerView$ViewHolder.getLayoutPosition()' on a null object reference

    Android 5.1.1 Device Sony M2

    FilterAdapter filterAdapter = new FilterAdapter();
            StickyHeaderDecoration decoration = new StickyHeaderDecoration(filterAdapter);
    
            LinearLayoutManager layoutManager = new LinearLayoutManager(getContext());
            layoutManager.setOrientation(LinearLayoutManager.VERTICAL);
    
            filterRecyclerView.setHasFixedSize(true);
            filterRecyclerView.setLayoutManager(layoutManager);
            filterRecyclerView.addItemDecoration(decoration);
            filterRecyclerView.setAdapter(filterAdapter);
    
            ArrayList<String> headers = new ArrayList<>(Arrays.asList(getResources().getStringArray(R.array.filter_list_headers)));
            List<Object> filterModels = new ArrayList<>();
            filterModels.add(new Object());
            filterModels.add(new Object());
            filterModels.add(new Object());
    
            filterAdapter.addHeaders(headers);
            filterAdapter.addAll(filterModels);
            filterAdapter.notifyDataSetChanged();
    
    Process: co.route1.client.staging, PID: 7038
    java.lang.NullPointerException: Attempt to invoke virtual method 'int android.support.v7.widget.RecyclerView$ViewHolder.getLayoutPosition()' on a null object reference
    at android.support.v7.widget.RecyclerView$LayoutParams.getViewLayoutPosition(RecyclerView.java:9472)
    at android.support.v7.widget.RecyclerView$LayoutManager.getPosition(RecyclerView.java:6800)
    at android.support.v7.widget.LinearLayoutManager.findReferenceChild(LinearLayoutManager.java:1615)
    at android.support.v7.widget.LinearLayoutManager.findFirstReferenceChild(LinearLayoutManager.java:1597)
    at android.support.v7.widget.LinearLayoutManager.findReferenceChildClosestToStart(LinearLayoutManager.java:1592)
    at android.support.v7.widget.LinearLayoutManager.updateAnchorFromChildren(LinearLayoutManager.java:745)
    at android.support.v7.widget.LinearLayoutManager.updateAnchorInfoForLayout(LinearLayoutManager.java:713)
    at android.support.v7.widget.LinearLayoutManager.onLayoutChildren(LinearLayoutManager.java:484)
    at android.support.v7.widget.RecyclerView.dispatchLayoutStep2(RecyclerView.java:3028)
    at android.support.v7.widget.RecyclerView.onMeasure(RecyclerView.java:2625)
    at android.view.View.measure(View.java:17637)
    at ca.barrenechea.widget.recyclerview.decoration.StickyHeaderDecoration.getHeader(StickyHeaderDecoration.java:128)
    at ca.barrenechea.widget.recyclerview.decoration.StickyHeaderDecoration.getItemOffsets(StickyHeaderDecoration.java:67)
    
    invalid 
    opened by rusmichal 4
  • Added ability to have optional headers

    Added ability to have optional headers

    Greetings!

    I added the ability to have optional headers for each item. I had the need to have the first few items be without headers.

    I've tested this with 1 item with no header and all other items being in one section with a header.

    Cheers! Justin

    opened by ghost 4
  • Build error

    Build error

    I'm getting error trying to build my project with header-decor dependency:

    • Information:Gradle tasks [:app:assembleDebug]
    • Error:Error converting bytecode to dex: Cause: com.android.dex.DexException: Multiple dex files define Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat$AccessibilityServiceInfoVersionImpl; Error:Execution failed for task ':app:transformClassesWithDexForDebug'.
    • com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java'' finished with non-zero exit value 2

    Here's my dependencies from app-level build.gradle:

    dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) testCompile 'junit:junit:4.12' compile 'com.android.support:appcompat-v7:23.4.0' compile 'com.android.support:design:23.4.0' compile 'ca.barrenechea.header-decor:header-decor:0.2.8' }

    opened by akrupych-remit 3
  • protected  hasHeader(int position)

    protected hasHeader(int position)

    private boolean StickyHeaderDecoration::hasHeader(int position) should be protected,

    so subclasses can define specific items (such as empty-views, special items or footers) to have no header.

    opened by MarcusWolschon 3
  • Header-decor with Expandable RecyclerView

    Header-decor with Expandable RecyclerView

    Hi Eduardo! I tried use Header-decor view with Expandable RecyclerView library (by Ryan Brooks https://github.com/rbro112/expandable-recycler-view ) to create Expandable items with sticky headers but, I have a problem, can you write any commentary to me. When I StickerheaderDecoration send request to adapter by method getHeaderId I can retrun right header position but when expandable items expended then header will be draw header on incorrect position. Can you any suggestion to solve this?

    help wanted 
    opened by sm-tester 3
  • using android x but not able to sync

    using android x but not able to sync "Failed to resolve: com.github.edubarr"

    i am using android x able to sync with implementation 'ca.barrenechea.header-decor:header-decor:0.2.8' but its not work wiyh android x while using implementation 'com.github.edubarr.header-decor/header-decor:0.2.8' it gives me error "Failed to resolve: com.github.edubarr"

    opened by fahed-android 2
  • Problem with scrolling

    Problem with scrolling

    Hi, I used your library and I encountered a problem that is also in your demo The problem is that when scrolling, the scroll is sometimes cut off When scrolling on headers, scrolling is not done. Also, out of headers, sometimes this problem occurs. Do you know the solution to this problem?

    opened by emami7495 0
  • Maintainers wanted!

    Maintainers wanted!

    TL;DR

    Let me know if you'd like to take over as one of the maintainers of this library. If no one wants the responsibility then the repo and library will be marked as Deprecated.

    Help Wanted

    I haven't had the time or inclination to maintain, update or improve this library in quite a long time. @starkej2 has been an invaluable help to me, as he has taken over most of the work looking at issues and cleaning things up. I consider it to be feature complete for what was my own use, but there are quite a few requests for fixes, features and improvements which I'll probably never implement.

    This is something I've been thinking about (and postponing) for quite a while. I would like for users of the library to either know that it's being maintained or be warned that they are on their own when using this code. These two options translate into either finding people who are interested in taking over this repo or deprecating this library.

    If you'd like to take over then please let me know. I can create an organization and move the repo over. We could also switch to using jitpack instead of the existing maven repo, which would give quite a bit of flexibility. I would still check how things are going every once in a blue moon and, who knows, might even contribute to it again!

    If no one wants to take over then I'll mark the library as deprecated. The code and existing artifacts will remain in their respective places and everything should work until it doesn't (incompatible support libraries, API changes, etc).

    Thanks, Eduardo

    help wanted 
    opened by ebarrenechea 6
Releases(0.2.8)
Owner
Eduardo Barrenechea
Eduardo Barrenechea
Handy library to integrate pagination, which allow no data layout, refresh layout, recycler view in one view and easy way to bind pagination in app.

Pagination View Handy library to integrate pagination, which allow no data layout, refresh layout, recycler view in one view and easy way to bind pagi

DhiWise 4 Dec 18, 2021
Custom Layout Manager for Recycler View

Circular Layout Manager Overview A library for Android which essentially contains a Custom Layout Manager for Recycler View which lays out its child v

Kapilesh Iyer 181 Dec 2, 2022
A custom recycler view with shimmer views to indicate that views are loading.

ShimmerRecyclerView Intro A custom recycler view with shimmer views to indicate that views are loading. The recycler view has a built-in adapter to co

Harish Sridharan 3.8k Dec 31, 2022
Medium sample for frogo-recycler-view

mediumstory-frogo-recycler-view Tutorial how to use frogo-recycler-view lib Medium sample for frogo-recycler-view Medium Story Here frogo-recycler-vie

Muhammad Faisal Amir 5 Sep 12, 2021
Examples of custom recycler view items. Automatically detecting a dominant color of an image using Picasso and Palette libraries

custom-image-list-item Examples of custom RecyclerView items using Data Binding Features: Loading images urls with the help of a Picasso library Autom

Alina Stepanova 2 Sep 12, 2022
Simple lib to create a endless recycler view scroll

Endless RecyclerView A simple lib to create an infinite list in a RecyclerView. When you reach the end of the list, a callback is triggered, where you

Jaison Klemer 4 Sep 2, 2022
[UNMAINTAINED] Sticky Headers decorator for Android's RecyclerView

This project is no longer being maintained sticky-headers-recyclerview This decorator allows you to easily create section headers for RecyclerViews us

timehop 3.7k Jan 8, 2023
A layout manager for the RecyclerView with interchangeable linear, grid, and staggered displays of views, all with configurable section headers including the sticky variety as specified in the material design docs.

SuperSLiM This is the version 5 development branch. Project Plan Support me on Patreon Blog What is Version 5 Version 5 is the current development bra

Tonic Artos 2.1k Jan 2, 2023
[] Super fast and easy way to create header for Android RecyclerView

DEPRECATED I created this library back in the day when I thought RecyclerView was all new and difficult. Writing an adapter that could inflate multipl

Bartek Lipinski 1.3k Dec 28, 2022
Android Development by using Kotlin, this App uses the concept of API, Recycler Methods and Databases.

Bookstore App by using Kotlin This Project is made using Kotlin, and it uses main concepts of API, Databases, Fragments and many more. This Applicatio

Abeye Tewodros 4 Nov 23, 2022
Android library defining adapter classes of RecyclerView to manage multiple view types

RecyclerView-MultipleViewTypeAdapter RecyclerView adapter classes for managing multiple view types Release Note [Release Note] (https://github.com/yqr

Yoshihito Ikeda 414 Nov 21, 2022
Android library for RecyclerView to manage order of items and multiple view types.

recyclerview-binder Android Library for RecyclerView to manage order of items and multiple view types. Features Insert any items to wherever you want

Satoru Fujiwara 185 Nov 15, 2022
Dogglers app uses a RecyclerView in horizontal, vertical and grid view to show a group of CardViews

Welcome to DogglersApp! This app is the final project from Unit 2 of Android Basics in Kotlin given by Google codelabs: https://developer.android.com/

David Ortega Farrerons 1 Feb 25, 2022
A customizable and easy-to-use Timeline View library for Android

TimelineView A customizable and easy-to-use Timeline View library for Android Can be used as a standalone view or as a RecyclerView decorator Setup 1.

Riccardo Lattarulo 189 Dec 10, 2022
RetroDialer - Custom view like a retro telephone dialer

RetroDialer Custom view like a retro telephone dialer Demo

Kshitij Kumar 7 Feb 5, 2022
A couple of sticky header decorations for android's recycler view.

DEPRECATION NOTICE This library has not been touched in a very long time and many things have changed in the android ecosystem since then. Updating an

Eduardo Barrenechea 879 Nov 26, 2022
Bottom Sheet fragment with a sticky header and a content recycler view

Sticky Header Bottom Sheet A simple library to create a Bottom Sheet with a sticky header and a content recycler view. The bottom sheet expands on scr

Kshitij Kumar 12 Sep 21, 2022
A small android library for tagging views inside a ScrollView as "sticky" making them stick to the top of the scroll container until a new sticky view comes and takes it's place

StickyScrollViewItems StickyScrollViewItems is a ScrollView subclass that allowed you to mark items inside the ScrollView as sticky. The items marked

Emil Sj├Âlander 1k Jan 7, 2023
A layout that hide the header when the body is scrolled down and reveal it when the header is scrolled up

AndroidAutoHideHeader A layout that hide the header when the body is scrolled down and reveal it when the header is scrolled up Demo Import it ! In yo

Vadim Caen 48 Apr 22, 2022