├── .gitignore ├── CHANGELOG.md ├── HeaderListView ├── build.gradle ├── proguard-rules.txt └── src │ └── main │ ├── AndroidManifest.xml │ ├── java │ └── com │ │ └── applidium │ │ └── headerlistview │ │ ├── HeaderListView.java │ │ └── SectionAdapter.java │ └── res │ ├── drawable │ ├── ic_launcher.png │ ├── scrollbar_handle_holo_dark.9.png │ └── scrollbar_handle_holo_light.9.png │ └── values │ ├── strings.xml │ └── styles.xml ├── HeaderListViewDemo ├── build.gradle ├── proguard-rules.txt └── src │ └── main │ ├── AndroidManifest.xml │ ├── ic_launcher-web.png │ ├── java │ └── com │ │ └── applidium │ │ └── headerlistviewdemo │ │ └── DemoActivity.java │ └── res │ ├── drawable │ └── ic_launcher.png │ ├── values-v11 │ └── styles.xml │ ├── values-v14 │ └── styles.xml │ └── values │ ├── strings.xml │ └── styles.xml ├── LICENSE ├── README.md ├── build.gradle ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── settings.gradle /.gitignore: -------------------------------------------------------------------------------- 1 | .classpath 2 | .project 3 | bin/ 4 | gen/ 5 | *.iml 6 | build/ 7 | local.properties 8 | .gradle/ 9 | .idea 10 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ##1.0.0 (18 July 2013) 2 | 3 | First release -------------------------------------------------------------------------------- /HeaderListView/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | apply plugin: 'maven-publish' 3 | 4 | dependencies { 5 | compile 'com.android.support:appcompat-v7:19+' 6 | compile fileTree(dir: 'libs', include: ['*.jar', '*.aar']) 7 | } 8 | 9 | publishing { 10 | publications { 11 | HeaderListView(MavenPublication) { 12 | artifact './build/outputs/aar/' + project.name + '-' + project.version + '.aar' 13 | 14 | pom.withXml { 15 | Node deps = asNode().appendNode('dependencies') 16 | project.configurations.compile.dependencies.each() { obj -> 17 | if (obj.group?.trim()) { 18 | Node dep = new Node(deps, 'dependency') 19 | dep.appendNode('groupId', obj.group) 20 | dep.appendNode('artifactId', obj.name) 21 | dep.appendNode('version', obj.version) 22 | dep.appendNode('scope', 'compile') 23 | } 24 | } 25 | } 26 | } 27 | } 28 | } 29 | 30 | group 'com.applidium' 31 | version '1.0' 32 | ext.androidVersionCode = 1 33 | 34 | android { 35 | compileSdkVersion 19 36 | buildToolsVersion "19.1.0" 37 | 38 | defaultConfig { 39 | minSdkVersion 7 40 | targetSdkVersion 19 41 | versionCode androidVersionCode 42 | versionName version 43 | } 44 | 45 | buildTypes { 46 | release { 47 | 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /HeaderListView/proguard-rules.txt: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /Users/elodieferrais/.android/sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the ProGuard 5 | # include property in project.properties. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} -------------------------------------------------------------------------------- /HeaderListView/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /HeaderListView/src/main/java/com/applidium/headerlistview/HeaderListView.java: -------------------------------------------------------------------------------- 1 | package com.applidium.headerlistview; 2 | 3 | import android.content.Context; 4 | import android.graphics.drawable.Drawable; 5 | import android.util.AttributeSet; 6 | import android.util.TypedValue; 7 | import android.view.Gravity; 8 | import android.view.View; 9 | import android.view.animation.AlphaAnimation; 10 | import android.widget.AbsListView; 11 | import android.widget.AdapterView; 12 | import android.widget.FrameLayout; 13 | import android.widget.ImageView; 14 | import android.widget.ImageView.ScaleType; 15 | import android.widget.ListView; 16 | import android.widget.RelativeLayout; 17 | 18 | public class HeaderListView extends RelativeLayout { 19 | 20 | // TODO: Handle listViews with fast scroll 21 | // TODO: See if there are methods to dispatch to mListView 22 | 23 | private static final int FADE_DELAY = 1000; 24 | private static final int FADE_DURATION = 2000; 25 | 26 | private InternalListView mListView; 27 | private SectionAdapter mAdapter; 28 | private RelativeLayout mHeader; 29 | private View mHeaderConvertView; 30 | private FrameLayout mScrollView; 31 | private AbsListView.OnScrollListener mExternalOnScrollListener; 32 | 33 | public HeaderListView(Context context) { 34 | super(context); 35 | init(context, null); 36 | } 37 | 38 | public HeaderListView(Context context, AttributeSet attrs) { 39 | super(context, attrs); 40 | init(context, attrs); 41 | } 42 | 43 | private void init(Context context, AttributeSet attrs) { 44 | mListView = new InternalListView(getContext(), attrs); 45 | LayoutParams listParams = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT); 46 | listParams.addRule(ALIGN_PARENT_TOP); 47 | mListView.setLayoutParams(listParams); 48 | mListView.setOnScrollListener(new HeaderListViewOnScrollListener()); 49 | mListView.setVerticalScrollBarEnabled(false); 50 | mListView.setOnItemClickListener(new AdapterView.OnItemClickListener() { 51 | @Override 52 | public void onItemClick(AdapterView parent, View view, int position, long id) { 53 | if (mAdapter != null) { 54 | mAdapter.onItemClick(parent, view, position, id); 55 | } 56 | } 57 | }); 58 | addView(mListView); 59 | 60 | mHeader = new RelativeLayout(getContext()); 61 | LayoutParams headerParams = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT); 62 | headerParams.addRule(ALIGN_PARENT_TOP); 63 | mHeader.setLayoutParams(headerParams); 64 | mHeader.setGravity(Gravity.BOTTOM); 65 | addView(mHeader); 66 | 67 | // The list view's scroll bar can be hidden by the header, so we display our own scroll bar instead 68 | Drawable scrollBarDrawable = getResources().getDrawable(R.drawable.scrollbar_handle_holo_light); 69 | mScrollView = new FrameLayout(getContext()); 70 | LayoutParams scrollParams = new LayoutParams(scrollBarDrawable.getIntrinsicWidth(), LayoutParams.MATCH_PARENT); 71 | scrollParams.addRule(ALIGN_PARENT_RIGHT); 72 | scrollParams.rightMargin = (int) dpToPx(2); 73 | mScrollView.setLayoutParams(scrollParams); 74 | 75 | ImageView scrollIndicator = new ImageView(context); 76 | scrollIndicator.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT)); 77 | scrollIndicator.setImageDrawable(scrollBarDrawable); 78 | scrollIndicator.setScaleType(ScaleType.FIT_XY); 79 | mScrollView.addView(scrollIndicator); 80 | mScrollView.setVisibility(INVISIBLE); 81 | 82 | addView(mScrollView); 83 | } 84 | 85 | public void setAdapter(SectionAdapter adapter) { 86 | mAdapter = adapter; 87 | mListView.setAdapter(adapter); 88 | } 89 | 90 | public void setOnScrollListener(AbsListView.OnScrollListener l) { 91 | mExternalOnScrollListener = l; 92 | } 93 | 94 | private class HeaderListViewOnScrollListener implements AbsListView.OnScrollListener { 95 | 96 | private int previousFirstVisibleItem = -1; 97 | private int direction = 0; 98 | private int actualSection = 0; 99 | private boolean scrollingStart = false; 100 | private boolean doneMeasuring = false; 101 | private int lastResetSection = -1; 102 | private int nextH; 103 | private int prevH; 104 | private View previous; 105 | private View next; 106 | private AlphaAnimation fadeOut = new AlphaAnimation(1f, 0f); 107 | private boolean noHeaderUpToHeader = false; 108 | private boolean didScroll = false; 109 | 110 | @Override 111 | public void onScrollStateChanged(AbsListView view, int scrollState) { 112 | if (mExternalOnScrollListener != null) { 113 | mExternalOnScrollListener.onScrollStateChanged(view, scrollState); 114 | } 115 | didScroll = true; 116 | } 117 | 118 | @Override 119 | public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) { 120 | if (mExternalOnScrollListener != null) { 121 | mExternalOnScrollListener.onScroll(view, firstVisibleItem, visibleItemCount, totalItemCount); 122 | } 123 | 124 | if (!didScroll) { 125 | return; 126 | } 127 | 128 | firstVisibleItem -= mListView.getHeaderViewsCount(); 129 | if (firstVisibleItem < 0) { 130 | mHeader.removeAllViews(); 131 | return; 132 | } 133 | 134 | updateScrollBar(); 135 | if (visibleItemCount > 0 && firstVisibleItem == 0 && mHeader.getChildAt(0) == null) { 136 | addSectionHeader(0); 137 | lastResetSection = 0; 138 | } 139 | 140 | int realFirstVisibleItem = getRealFirstVisibleItem(firstVisibleItem, visibleItemCount); 141 | if (totalItemCount > 0 && previousFirstVisibleItem != realFirstVisibleItem) { 142 | direction = realFirstVisibleItem - previousFirstVisibleItem; 143 | 144 | actualSection = mAdapter.getSection(realFirstVisibleItem); 145 | 146 | boolean currIsHeader = mAdapter.isSectionHeader(realFirstVisibleItem); 147 | boolean prevHasHeader = mAdapter.hasSectionHeaderView(actualSection - 1); 148 | boolean nextHasHeader = mAdapter.hasSectionHeaderView(actualSection + 1); 149 | boolean currHasHeader = mAdapter.hasSectionHeaderView(actualSection); 150 | boolean currIsLast = mAdapter.getRowInSection(realFirstVisibleItem) == mAdapter.numberOfRows(actualSection) - 1; 151 | boolean prevHasRows = mAdapter.numberOfRows(actualSection - 1) > 0; 152 | boolean currIsFirst = mAdapter.getRowInSection(realFirstVisibleItem) == 0; 153 | 154 | boolean needScrolling = currIsFirst && !currHasHeader && prevHasHeader && realFirstVisibleItem != firstVisibleItem; 155 | boolean needNoHeaderUpToHeader = currIsLast && currHasHeader && !nextHasHeader && realFirstVisibleItem == firstVisibleItem && Math.abs(mListView.getChildAt(0).getTop()) >= mListView.getChildAt(0).getHeight() / 2; 156 | 157 | noHeaderUpToHeader = false; 158 | if (currIsHeader && !prevHasHeader && firstVisibleItem >= 0) { 159 | resetHeader(direction < 0 ? actualSection - 1 : actualSection); 160 | } else if ((currIsHeader && firstVisibleItem > 0) || needScrolling) { 161 | if (!prevHasRows) { 162 | resetHeader(actualSection-1); 163 | } 164 | startScrolling(); 165 | } else if (needNoHeaderUpToHeader) { 166 | noHeaderUpToHeader = true; 167 | } else if (lastResetSection != actualSection) { 168 | resetHeader(actualSection); 169 | } 170 | 171 | previousFirstVisibleItem = realFirstVisibleItem; 172 | } 173 | 174 | if (scrollingStart) { 175 | int scrolled = realFirstVisibleItem >= firstVisibleItem ? mListView.getChildAt(realFirstVisibleItem - firstVisibleItem).getTop() : 0; 176 | 177 | if (!doneMeasuring) { 178 | setMeasurements(realFirstVisibleItem, firstVisibleItem); 179 | } 180 | 181 | int headerH = doneMeasuring ? (prevH - nextH) * direction * Math.abs(scrolled) / (direction < 0 ? nextH : prevH) + (direction > 0 ? nextH : prevH) : 0; 182 | 183 | mHeader.scrollTo(0, -Math.min(0, scrolled - headerH)); 184 | if (doneMeasuring && headerH != mHeader.getLayoutParams().height) { 185 | LayoutParams p = (LayoutParams) (direction < 0 ? next.getLayoutParams() : previous.getLayoutParams()); 186 | p.topMargin = headerH - p.height; 187 | mHeader.getLayoutParams().height = headerH; 188 | mHeader.requestLayout(); 189 | } 190 | } 191 | 192 | if (noHeaderUpToHeader) { 193 | if (lastResetSection != actualSection) { 194 | addSectionHeader(actualSection); 195 | lastResetSection = actualSection + 1; 196 | } 197 | mHeader.scrollTo(0, mHeader.getLayoutParams().height - (mListView.getChildAt(0).getHeight() + mListView.getChildAt(0).getTop())); 198 | } 199 | } 200 | 201 | private void startScrolling() { 202 | scrollingStart = true; 203 | doneMeasuring = false; 204 | lastResetSection = -1; 205 | } 206 | 207 | private void resetHeader(int section) { 208 | scrollingStart = false; 209 | addSectionHeader(section); 210 | mHeader.requestLayout(); 211 | lastResetSection = section; 212 | } 213 | 214 | private void setMeasurements(int realFirstVisibleItem, int firstVisibleItem) { 215 | 216 | if (direction > 0) { 217 | nextH = realFirstVisibleItem >= firstVisibleItem ? mListView.getChildAt(realFirstVisibleItem - firstVisibleItem).getMeasuredHeight() : 0; 218 | } 219 | 220 | previous = mHeader.getChildAt(0); 221 | prevH = previous != null ? previous.getMeasuredHeight() : mHeader.getHeight(); 222 | 223 | if (direction < 0) { 224 | if (lastResetSection != actualSection - 1) { 225 | addSectionHeader(Math.max(0, actualSection - 1)); 226 | next = mHeader.getChildAt(0); 227 | } 228 | nextH = mHeader.getChildCount() > 0 ? mHeader.getChildAt(0).getMeasuredHeight() : 0; 229 | mHeader.scrollTo(0, prevH); 230 | } 231 | doneMeasuring = previous != null && prevH > 0 && nextH > 0; 232 | } 233 | 234 | private void updateScrollBar() { 235 | if (mHeader != null && mListView != null && mScrollView != null) { 236 | int offset = mListView.computeVerticalScrollOffset(); 237 | int range = mListView.computeVerticalScrollRange(); 238 | int extent = mListView.computeVerticalScrollExtent(); 239 | mScrollView.setVisibility(extent >= range ? View.INVISIBLE : View.VISIBLE); 240 | if (extent >= range) { 241 | return; 242 | } 243 | int top = range == 0 ? mListView.getHeight() : mListView.getHeight() * offset / range; 244 | int bottom = range == 0 ? 0 : mListView.getHeight() - mListView.getHeight() * (offset + extent) / range; 245 | mScrollView.setPadding(0, top, 0, bottom); 246 | fadeOut.reset(); 247 | fadeOut.setFillBefore(true); 248 | fadeOut.setFillAfter(true); 249 | fadeOut.setStartOffset(FADE_DELAY); 250 | fadeOut.setDuration(FADE_DURATION); 251 | mScrollView.clearAnimation(); 252 | mScrollView.startAnimation(fadeOut); 253 | } 254 | } 255 | 256 | private void addSectionHeader(int actualSection) { 257 | View previousHeader = mHeader.getChildAt(0); 258 | if (previousHeader != null) { 259 | mHeader.removeViewAt(0); 260 | } 261 | 262 | if (mAdapter.hasSectionHeaderView(actualSection)) { 263 | mHeaderConvertView = mAdapter.getSectionHeaderView(actualSection, mHeaderConvertView, mHeader); 264 | mHeaderConvertView.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT)); 265 | 266 | mHeaderConvertView.measure(MeasureSpec.makeMeasureSpec(mHeader.getWidth(), MeasureSpec.EXACTLY), MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED)); 267 | 268 | mHeader.getLayoutParams().height = mHeaderConvertView.getMeasuredHeight(); 269 | mHeaderConvertView.scrollTo(0, 0); 270 | mHeader.scrollTo(0, 0); 271 | mHeader.addView(mHeaderConvertView, 0); 272 | } else { 273 | mHeader.getLayoutParams().height = 0; 274 | mHeader.scrollTo(0, 0); 275 | } 276 | 277 | mScrollView.bringToFront(); 278 | } 279 | 280 | private int getRealFirstVisibleItem(int firstVisibleItem, int visibleItemCount) { 281 | if (visibleItemCount == 0) { 282 | return -1; 283 | } 284 | int relativeIndex = 0, totalHeight = mListView.getChildAt(0).getTop(); 285 | for (relativeIndex = 0; relativeIndex < visibleItemCount && totalHeight < mHeader.getHeight(); relativeIndex++) { 286 | totalHeight += mListView.getChildAt(relativeIndex).getHeight(); 287 | } 288 | int realFVI = Math.max(firstVisibleItem, firstVisibleItem + relativeIndex - 1); 289 | return realFVI; 290 | } 291 | } 292 | 293 | public ListView getListView() { 294 | return mListView; 295 | } 296 | 297 | public void addHeaderView(View v) { 298 | mListView.addHeaderView(v); 299 | } 300 | 301 | private float dpToPx(float dp) { 302 | return TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp, getContext().getResources().getDisplayMetrics()); 303 | } 304 | 305 | protected class InternalListView extends ListView { 306 | 307 | public InternalListView(Context context, AttributeSet attrs) { 308 | super(context, attrs); 309 | } 310 | 311 | @Override 312 | protected int computeVerticalScrollExtent() { 313 | return super.computeVerticalScrollExtent(); 314 | } 315 | 316 | @Override 317 | protected int computeVerticalScrollOffset() { 318 | return super.computeVerticalScrollOffset(); 319 | } 320 | 321 | @Override 322 | protected int computeVerticalScrollRange() { 323 | return super.computeVerticalScrollRange(); 324 | } 325 | } 326 | } 327 | -------------------------------------------------------------------------------- /HeaderListView/src/main/java/com/applidium/headerlistview/SectionAdapter.java: -------------------------------------------------------------------------------- 1 | package com.applidium.headerlistview; 2 | 3 | import android.view.View; 4 | import android.view.ViewGroup; 5 | import android.widget.AdapterView; 6 | import android.widget.AdapterView.OnItemClickListener; 7 | import android.widget.BaseAdapter; 8 | 9 | public abstract class SectionAdapter extends BaseAdapter implements OnItemClickListener { 10 | 11 | private int mCount = -1; 12 | 13 | public abstract int numberOfSections(); 14 | 15 | public abstract int numberOfRows(int section); 16 | 17 | public abstract View getRowView(int section, int row, View convertView, ViewGroup parent); 18 | 19 | public abstract Object getRowItem(int section, int row); 20 | 21 | public boolean hasSectionHeaderView(int section) { 22 | return false; 23 | } 24 | 25 | public View getSectionHeaderView(int section, View convertView, ViewGroup parent) { 26 | return null; 27 | } 28 | 29 | public Object getSectionHeaderItem(int section) { 30 | return null; 31 | } 32 | 33 | public int getRowViewTypeCount() { 34 | return 1; 35 | } 36 | 37 | public int getSectionHeaderViewTypeCount() { 38 | return 1; 39 | } 40 | 41 | /** 42 | * Must return a value between 0 and getRowViewTypeCount() (excluded) 43 | */ 44 | public int getRowItemViewType(int section, int row) { 45 | return 0; 46 | } 47 | 48 | /** 49 | * Must return a value between 0 and getSectionHeaderViewTypeCount() (excluded, if > 0) 50 | */ 51 | public int getSectionHeaderItemViewType(int section) { 52 | return 0; 53 | } 54 | 55 | @Override 56 | /** 57 | * Dispatched to call onRowItemClick 58 | */ 59 | public final void onItemClick(AdapterView parent, View view, int position, long id) { 60 | onRowItemClick(parent, view, getSection(position), getRowInSection(position), id); 61 | } 62 | 63 | public void onRowItemClick(AdapterView parent, View view, int section, int row, long id) { 64 | 65 | } 66 | 67 | @Override 68 | /** 69 | * Counts the amount of cells = headers + rows 70 | */ 71 | public final int getCount() { 72 | if (mCount < 0) { 73 | mCount = numberOfCellsBeforeSection(numberOfSections()); 74 | } 75 | return mCount; 76 | } 77 | 78 | @Override 79 | public boolean isEmpty() { 80 | return getCount() == 0; 81 | } 82 | 83 | @Override 84 | /** 85 | * Dispatched to call getRowItem or getSectionHeaderItem 86 | */ 87 | public final Object getItem(int position) { 88 | int section = getSection(position); 89 | if (isSectionHeader(position)) { 90 | if (hasSectionHeaderView(section)) { 91 | return getSectionHeaderItem(section); 92 | } 93 | return null; 94 | } 95 | return getRowItem(section, getRowInSection(position)); 96 | } 97 | 98 | @Override 99 | public long getItemId(int position) { 100 | return position; 101 | } 102 | 103 | @Override 104 | /** 105 | * Dispatched to call getRowView or getSectionHeaderView 106 | */ 107 | public final View getView(int position, View convertView, ViewGroup parent) { 108 | int section = getSection(position); 109 | if (isSectionHeader(position)) { 110 | if (hasSectionHeaderView(section)) { 111 | return getSectionHeaderView(section, convertView, parent); 112 | } 113 | return null; 114 | } 115 | return getRowView(section, getRowInSection(position), convertView, parent); 116 | } 117 | 118 | /** 119 | * Returns the section number of the indicated cell 120 | */ 121 | protected int getSection(int position) { 122 | int section = 0; 123 | int cellCounter = 0; 124 | while (cellCounter <= position && section <= numberOfSections()) { 125 | cellCounter += numberOfCellsInSection(section); 126 | section++; 127 | } 128 | return section - 1; 129 | } 130 | 131 | /** 132 | * Returns the row index of the indicated cell Should not be call with 133 | * positions directing to section headers 134 | */ 135 | protected int getRowInSection(int position) { 136 | int section = getSection(position); 137 | int row = position - numberOfCellsBeforeSection(section); 138 | if (hasSectionHeaderView(section)) { 139 | return row - 1; 140 | } else { 141 | return row; 142 | } 143 | } 144 | 145 | /** 146 | * Returns true if the cell at this index is a section header 147 | */ 148 | protected boolean isSectionHeader(int position) { 149 | int section = getSection(position); 150 | return hasSectionHeaderView(section) && numberOfCellsBeforeSection(section) == position; 151 | } 152 | 153 | /** 154 | * Returns the number of cells (= headers + rows) before the indicated 155 | * section 156 | */ 157 | protected int numberOfCellsBeforeSection(int section) { 158 | int count = 0; 159 | for (int i = 0; i < Math.min(numberOfSections(), section); i++) { 160 | count += numberOfCellsInSection(i); 161 | } 162 | return count; 163 | } 164 | 165 | private int numberOfCellsInSection(int section) { 166 | return numberOfRows(section) + (hasSectionHeaderView(section) ? 1 : 0); 167 | } 168 | 169 | @Override 170 | public void notifyDataSetChanged() { 171 | mCount = numberOfCellsBeforeSection(numberOfSections()); 172 | super.notifyDataSetChanged(); 173 | } 174 | 175 | @Override 176 | public void notifyDataSetInvalidated() { 177 | mCount = numberOfCellsBeforeSection(numberOfSections()); 178 | super.notifyDataSetInvalidated(); 179 | } 180 | 181 | @Override 182 | /** 183 | * Dispatched to call getRowItemViewType or getSectionHeaderItemViewType 184 | */ 185 | public final int getItemViewType(int position) { 186 | int section = getSection(position); 187 | if (isSectionHeader(position)) { 188 | return getRowViewTypeCount() + getSectionHeaderItemViewType(section); 189 | } else { 190 | return getRowItemViewType(section, getRowInSection(position)); 191 | } 192 | } 193 | 194 | @Override 195 | /** 196 | * Dispatched to call getRowViewTypeCount and getSectionHeaderViewTypeCount 197 | */ 198 | public final int getViewTypeCount() { 199 | return getRowViewTypeCount() + getSectionHeaderViewTypeCount(); 200 | } 201 | 202 | @Override 203 | /** 204 | * By default, disables section headers 205 | */ 206 | public boolean isEnabled(int position) { 207 | return (disableHeaders() || !isSectionHeader(position)) && isRowEnabled(getSection(position), getRowInSection(position)); 208 | } 209 | 210 | public boolean disableHeaders() { 211 | return false; 212 | } 213 | 214 | public boolean isRowEnabled(int section, int row) { 215 | return true; 216 | } 217 | } 218 | -------------------------------------------------------------------------------- /HeaderListView/src/main/res/drawable/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/applidium/HeaderListView/73d48935a2d861dfdf59f06744d6667edc4dfabc/HeaderListView/src/main/res/drawable/ic_launcher.png -------------------------------------------------------------------------------- /HeaderListView/src/main/res/drawable/scrollbar_handle_holo_dark.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/applidium/HeaderListView/73d48935a2d861dfdf59f06744d6667edc4dfabc/HeaderListView/src/main/res/drawable/scrollbar_handle_holo_dark.9.png -------------------------------------------------------------------------------- /HeaderListView/src/main/res/drawable/scrollbar_handle_holo_light.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/applidium/HeaderListView/73d48935a2d861dfdf59f06744d6667edc4dfabc/HeaderListView/src/main/res/drawable/scrollbar_handle_holo_light.9.png -------------------------------------------------------------------------------- /HeaderListView/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | HeaderListView 3 | 4 | -------------------------------------------------------------------------------- /HeaderListView/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /HeaderListViewDemo/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 19 5 | buildToolsVersion "19.1.0" 6 | 7 | defaultConfig { 8 | minSdkVersion 7 9 | targetSdkVersion 19 10 | versionCode 1 11 | versionName "1.0" 12 | } 13 | 14 | } 15 | 16 | dependencies { 17 | compile project(':HeaderListView') 18 | compile fileTree(dir: 'libs', include: ['*.jar', '*.aar']) 19 | compile 'com.android.support:appcompat-v7:19+' 20 | } 21 | -------------------------------------------------------------------------------- /HeaderListViewDemo/proguard-rules.txt: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /Users/elodieferrais/.android/sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the ProGuard 5 | # include property in project.properties. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} -------------------------------------------------------------------------------- /HeaderListViewDemo/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 12 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /HeaderListViewDemo/src/main/ic_launcher-web.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/applidium/HeaderListView/73d48935a2d861dfdf59f06744d6667edc4dfabc/HeaderListViewDemo/src/main/ic_launcher-web.png -------------------------------------------------------------------------------- /HeaderListViewDemo/src/main/java/com/applidium/headerlistviewdemo/DemoActivity.java: -------------------------------------------------------------------------------- 1 | package com.applidium.headerlistviewdemo; 2 | 3 | import android.app.Activity; 4 | import android.os.Bundle; 5 | import android.view.View; 6 | import android.view.ViewGroup; 7 | import android.widget.AdapterView; 8 | import android.widget.TextView; 9 | import android.widget.Toast; 10 | 11 | import com.applidium.headerlistview.HeaderListView; 12 | import com.applidium.headerlistview.SectionAdapter; 13 | 14 | public class DemoActivity extends Activity { 15 | 16 | @Override 17 | protected void onCreate(Bundle savedInstanceState) { 18 | super.onCreate(savedInstanceState); 19 | HeaderListView list = new HeaderListView(this); 20 | 21 | list.setAdapter(new SectionAdapter() { 22 | 23 | @Override 24 | public int numberOfSections() { 25 | return 4; 26 | } 27 | 28 | @Override 29 | public int numberOfRows(int section) { 30 | return 35; 31 | } 32 | 33 | @Override 34 | public Object getRowItem(int section, int row) { 35 | return null; 36 | } 37 | 38 | @Override 39 | public boolean hasSectionHeaderView(int section) { 40 | return true; 41 | } 42 | 43 | @Override 44 | public View getRowView(int section, int row, View convertView, ViewGroup parent) { 45 | if (convertView == null) { 46 | convertView = (TextView) getLayoutInflater().inflate(getResources().getLayout(android.R.layout.simple_list_item_1), null); 47 | } 48 | ((TextView) convertView).setText("Section " + section + " Row " + row); 49 | return convertView; 50 | } 51 | 52 | @Override 53 | public int getSectionHeaderViewTypeCount() { 54 | return 2; 55 | } 56 | 57 | @Override 58 | public int getSectionHeaderItemViewType(int section) { 59 | return section % 2; 60 | } 61 | 62 | @Override 63 | public View getSectionHeaderView(int section, View convertView, ViewGroup parent) { 64 | 65 | if (convertView == null) { 66 | if (getSectionHeaderItemViewType(section) == 0) { 67 | convertView = (TextView) getLayoutInflater().inflate(getResources().getLayout(android.R.layout.simple_list_item_1), null); 68 | } else { 69 | convertView = getLayoutInflater().inflate(getResources().getLayout(android.R.layout.simple_list_item_2), null); 70 | } 71 | } 72 | 73 | if (getSectionHeaderItemViewType(section) == 0) { 74 | ((TextView) convertView).setText("Header for section " + section); 75 | } else { 76 | ((TextView) convertView.findViewById(android.R.id.text1)).setText("Header for section " + section); 77 | ((TextView) convertView.findViewById(android.R.id.text2)).setText("Has a detail text field"); 78 | } 79 | 80 | switch (section) { 81 | case 0: 82 | convertView.setBackgroundColor(getResources().getColor(R.color.holo_red_light)); 83 | break; 84 | case 1: 85 | convertView.setBackgroundColor(getResources().getColor(R.color.holo_orange_light)); 86 | break; 87 | case 2: 88 | convertView.setBackgroundColor(getResources().getColor(R.color.holo_green_light)); 89 | break; 90 | case 3: 91 | convertView.setBackgroundColor(getResources().getColor(R.color.holo_blue_light)); 92 | break; 93 | } 94 | return convertView; 95 | } 96 | 97 | @Override 98 | public void onRowItemClick(AdapterView parent, View view, int section, int row, long id) { 99 | super.onRowItemClick(parent, view, section, row, id); 100 | Toast.makeText(DemoActivity.this, "Section " + section + " Row " + row, Toast.LENGTH_SHORT).show(); 101 | } 102 | }); 103 | setContentView(list); 104 | } 105 | } 106 | -------------------------------------------------------------------------------- /HeaderListViewDemo/src/main/res/drawable/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/applidium/HeaderListView/73d48935a2d861dfdf59f06744d6667edc4dfabc/HeaderListViewDemo/src/main/res/drawable/ic_launcher.png -------------------------------------------------------------------------------- /HeaderListViewDemo/src/main/res/values-v11/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013, Applidium All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 2 | 3 | * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 4 | 5 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 6 | 7 | * Neither the name of Applidium nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 8 | 9 | THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # DEPRECATED 2 | 3 | HeaderListView is deprecated. No new development will be taking place. 4 | 5 | # Quickstart 6 | 7 | 1. Import the HeaderListView module in your Android Studio project. 8 | 2. Replace your `ListView` with `HeaderListView` 9 | 3. Implement a subclass of `SectionAdapter` 10 | 4. Set it to your `HeaderListView` with `setAdapter(SectionAdapter adapter)` 11 | 12 | # HeaderListView 13 | 14 | `HeaderListView` is a list view with sections and with a cool iOS-like "sticky" section headers. Notice that `HeaderListView` is not a subclass of Android's `ListView` but uses composition. Hence, you will need to call `getListView()` to access the underlying `ListView`. 15 | -------------------------------------------------------------------------------- /build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | repositories { 5 | mavenCentral() 6 | } 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:0.12.+' 9 | } 10 | } 11 | 12 | allprojects { 13 | repositories { 14 | mavenCentral() 15 | } 16 | } 17 | 18 | task wrapper(type: Wrapper) { 19 | description = 'Generates gradlew[.bat] scripts' 20 | gradleVersion = '1.12' 21 | distributionUrl = "http://services.gradle.org/distributions/gradle-${gradleVersion}-all.zip" 22 | } 23 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Settings specified in this file will override any Gradle settings 5 | # configured through the IDE. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m 13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 14 | 15 | org.gradle.jvmargs=-Djava.awt.headless=true -Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 16 | 17 | # When configured, Gradle will run in incubating parallel mode. 18 | # This option should only be used with decoupled projects. More details, visit 19 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 20 | # org.gradle.parallel=true -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/applidium/HeaderListView/73d48935a2d861dfdf59f06744d6667edc4dfabc/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Wed Jul 02 08:53:14 MDT 2014 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=http\://services.gradle.org/distributions/gradle-1.12-all.zip 7 | -------------------------------------------------------------------------------- /gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 10 | DEFAULT_JVM_OPTS="" 11 | 12 | APP_NAME="Gradle" 13 | APP_BASE_NAME=`basename "$0"` 14 | 15 | # Use the maximum available, or set MAX_FD != -1 to use that value. 16 | MAX_FD="maximum" 17 | 18 | warn ( ) { 19 | echo "$*" 20 | } 21 | 22 | die ( ) { 23 | echo 24 | echo "$*" 25 | echo 26 | exit 1 27 | } 28 | 29 | # OS specific support (must be 'true' or 'false'). 30 | cygwin=false 31 | msys=false 32 | darwin=false 33 | case "`uname`" in 34 | CYGWIN* ) 35 | cygwin=true 36 | ;; 37 | Darwin* ) 38 | darwin=true 39 | ;; 40 | MINGW* ) 41 | msys=true 42 | ;; 43 | esac 44 | 45 | # For Cygwin, ensure paths are in UNIX format before anything is touched. 46 | if $cygwin ; then 47 | [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` 48 | fi 49 | 50 | # Attempt to set APP_HOME 51 | # Resolve links: $0 may be a link 52 | PRG="$0" 53 | # Need this for relative symlinks. 54 | while [ -h "$PRG" ] ; do 55 | ls=`ls -ld "$PRG"` 56 | link=`expr "$ls" : '.*-> \(.*\)$'` 57 | if expr "$link" : '/.*' > /dev/null; then 58 | PRG="$link" 59 | else 60 | PRG=`dirname "$PRG"`"/$link" 61 | fi 62 | done 63 | SAVED="`pwd`" 64 | cd "`dirname \"$PRG\"`/" >&- 65 | APP_HOME="`pwd -P`" 66 | cd "$SAVED" >&- 67 | 68 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 69 | 70 | # Determine the Java command to use to start the JVM. 71 | if [ -n "$JAVA_HOME" ] ; then 72 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 73 | # IBM's JDK on AIX uses strange locations for the executables 74 | JAVACMD="$JAVA_HOME/jre/sh/java" 75 | else 76 | JAVACMD="$JAVA_HOME/bin/java" 77 | fi 78 | if [ ! -x "$JAVACMD" ] ; then 79 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 80 | 81 | Please set the JAVA_HOME variable in your environment to match the 82 | location of your Java installation." 83 | fi 84 | else 85 | JAVACMD="java" 86 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 87 | 88 | Please set the JAVA_HOME variable in your environment to match the 89 | location of your Java installation." 90 | fi 91 | 92 | # Increase the maximum file descriptors if we can. 93 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then 94 | MAX_FD_LIMIT=`ulimit -H -n` 95 | if [ $? -eq 0 ] ; then 96 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 97 | MAX_FD="$MAX_FD_LIMIT" 98 | fi 99 | ulimit -n $MAX_FD 100 | if [ $? -ne 0 ] ; then 101 | warn "Could not set maximum file descriptor limit: $MAX_FD" 102 | fi 103 | else 104 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 105 | fi 106 | fi 107 | 108 | # For Darwin, add options to specify how the application appears in the dock 109 | if $darwin; then 110 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 111 | fi 112 | 113 | # For Cygwin, switch paths to Windows format before running java 114 | if $cygwin ; then 115 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 116 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 117 | 118 | # We build the pattern for arguments to be converted via cygpath 119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 120 | SEP="" 121 | for dir in $ROOTDIRSRAW ; do 122 | ROOTDIRS="$ROOTDIRS$SEP$dir" 123 | SEP="|" 124 | done 125 | OURCYGPATTERN="(^($ROOTDIRS))" 126 | # Add a user-defined pattern to the cygpath arguments 127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 129 | fi 130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 131 | i=0 132 | for arg in "$@" ; do 133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 135 | 136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 138 | else 139 | eval `echo args$i`="\"$arg\"" 140 | fi 141 | i=$((i+1)) 142 | done 143 | case $i in 144 | (0) set -- ;; 145 | (1) set -- "$args0" ;; 146 | (2) set -- "$args0" "$args1" ;; 147 | (3) set -- "$args0" "$args1" "$args2" ;; 148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 154 | esac 155 | fi 156 | 157 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 158 | function splitJvmOpts() { 159 | JVM_OPTS=("$@") 160 | } 161 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 162 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 163 | 164 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 165 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':HeaderListView', ':HeaderListViewDemo' 2 | --------------------------------------------------------------------------------