This repository has been archived by the owner on Apr 19, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
57 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#Fri Feb 16 16:06:40 ALMT 2018 | ||
#Tue Apr 03 14:19:21 ALMT 2018 | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip |
21 changes: 21 additions & 0 deletions
21
sample/src/main/java/com/shuhart/stickyheader/BigSectionAdapter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package com.shuhart.stickyheader; | ||
|
||
import android.support.v7.widget.RecyclerView; | ||
import android.view.LayoutInflater; | ||
import android.view.ViewGroup; | ||
|
||
public class BigSectionAdapter extends SectionAdapter { | ||
@Override | ||
public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { | ||
LayoutInflater inflater = LayoutInflater.from(parent.getContext()); | ||
if (viewType == Section.HEADER) { | ||
RecyclerView.ViewHolder holder = | ||
new HeaderViewholder(inflater.inflate(R.layout.recycler_view_header_item, parent, false)); | ||
ViewGroup.LayoutParams lp = holder.itemView.getLayoutParams(); | ||
lp.height = lp.height * 2; | ||
holder.itemView.setLayoutParams(lp); | ||
return holder; | ||
} | ||
return super.onCreateViewHolder(parent, viewType); | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
sample/src/main/java/com/shuhart/stickyheader/SmallSectionAdapter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package com.shuhart.stickyheader; | ||
|
||
import android.support.v7.widget.RecyclerView; | ||
import android.view.LayoutInflater; | ||
import android.view.ViewGroup; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
public class SmallSectionAdapter extends SectionAdapter { | ||
@Override | ||
public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { | ||
LayoutInflater inflater = LayoutInflater.from(parent.getContext()); | ||
if (viewType == Section.HEADER) { | ||
RecyclerView.ViewHolder holder = | ||
new HeaderViewholder(inflater.inflate(R.layout.recycler_view_header_item, parent, false)); | ||
ViewGroup.LayoutParams lp = holder.itemView.getLayoutParams(); | ||
lp.height = lp.height / 2; | ||
holder.itemView.setLayoutParams(lp); | ||
return holder; | ||
} | ||
return super.onCreateViewHolder(parent, viewType); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters