Skip to content
This repository was archived by the owner on Jun 9, 2020. It is now read-only.

Commit

Permalink
Preparering first maven release 1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergej Shafarenka committed Aug 20, 2016
1 parent 2640017 commit 0d566ae
Show file tree
Hide file tree
Showing 36 changed files with 612 additions and 101 deletions.
14 changes: 11 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
bin
gen
# files
.project
.classpath
.settings
.DS_Store
**/.DS_Store
*.iml
local.properties

# folders
**/build/
.idea/
.gradle/
gen/
bin/
19 changes: 8 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
[![Flattr this git repo](http://api.flattr.com/button/flattr-badge-large.png)](https://flattr.com/submit/auto?user_id=beworker&url=https://github.com/beworker/pinned-section-listview&title=pinned-section-listview&language=java&tags=github&category=software)

Introduction
============

Easy to use ListView with pinned sections for Android 2.1 and higher. Pinned section is a header view which sticks to the top
of the list until at least one item of that section is visible.

![Alt text](screen1.png) 
![Alt text](screen2.png) 
![Alt text](screen3.png)
![Screenshot 1](web/screen1.png) 
![Screenshot 2](web/screen2.png) 
![Screenshot 3](web/screen3.png)

Features
========
Expand All @@ -23,10 +18,10 @@ Watch [this video][1] to see `PinnedSectionListView` in action.

Usage
=====
1. Replace standard `ListView` with `com.hb.views.PinnedSectionListView` in your `layout.xml` file.
1. Replace standard `ListView` with `de.halfbit.pinnedsection.PinnedSectionListView` in your `layout.xml` file.

```xml
<com.hb.views.PinnedSectionListView
<de.halfbit.pinnedsection.PinnedSectionListView
android:id="@android:id/list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
Expand Down Expand Up @@ -59,11 +54,12 @@ Used by
Let us know if you use this library in your application and we will mention it here.

[Grocery Sum][2]
[Slack][3]

License
=======

Copyright 2013-2014 Sergej Shafarenka, halfbit.de
Copyright 2013-2016 Sergej Shafarenka, halfbit.de

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -80,3 +76,4 @@ License

[1]: http://www.youtube.com/watch?v=mI3DpuoIIhQ
[2]: https://play.google.com/store/apps/details?id=org.codechimp.grocerysum
[3]: https://play.google.com/store/apps/details?id=com.Slack
14 changes: 14 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.3'
}
}

allprojects {
repositories {
jcenter()
}
}
1 change: 0 additions & 1 deletion example/assets/.gitignore

This file was deleted.

24 changes: 24 additions & 0 deletions example/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 24
buildToolsVersion "24.0.1"

defaultConfig {
applicationId "com.hb.examples.pinnedsection"
minSdkVersion 8
targetSdkVersion 24
versionCode 1
versionName "1.0.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}

dependencies {
compile project(':library')
}
Binary file removed example/libs/android-support-v4.jar
Binary file not shown.
20 changes: 0 additions & 20 deletions example/proguard-project.txt

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.hb.examples.pinnedsection"
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="19" />
package="de.halfbit.pinnedsection.examples.pinnedsection" >

<application
android:allowBackup="true"
Expand All @@ -15,7 +9,7 @@
android:theme="@style/AppTheme" >

<activity
android:name="com.hb.examples.PinnedSectionListActivity"
android:name="de.halfbit.pinnedsection.examples.PinnedSectionListActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@
* limitations under the License.
*/

package com.hb.examples;

import java.util.Locale;
package de.halfbit.pinnedsection.examples;

import android.annotation.SuppressLint;
import android.app.ListActivity;
Expand All @@ -36,9 +34,11 @@
import android.widget.TextView;
import android.widget.Toast;

import com.hb.examples.pinnedsection.R;
import com.hb.views.PinnedSectionListView;
import com.hb.views.PinnedSectionListView.PinnedSectionListAdapter;
import java.util.Locale;

import de.halfbit.pinnedsection.PinnedSectionListView;
import de.halfbit.pinnedsection.PinnedSectionListView.PinnedSectionListAdapter;
import de.halfbit.pinnedsection.examples.pinnedsection.R;

public class PinnedSectionListActivity extends ListActivity implements OnClickListener {

Expand All @@ -54,9 +54,9 @@ public SimpleAdapter(Context context, int resource, int textViewResourceId) {
}

public void generateDataset(char from, char to, boolean clear) {

if (clear) clear();

final int sectionsNumber = to - from + 1;
prepareSections(sectionsNumber);

Expand All @@ -79,7 +79,7 @@ public void generateDataset(char from, char to, boolean clear) {
sectionPosition++;
}
}

protected void prepareSections(int sectionsNumber) { }
protected void onSectionAdded(Item section, int sectionPosition) { }

Expand Down Expand Up @@ -258,7 +258,7 @@ private void updateDataset() {
}
adapter.notifyDataSetChanged();
}

private void initializePadding() {
float density = getResources().getDisplayMetrics().density;
int padding = addPadding ? (int) (16 * density) : 0;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<com.hb.views.PinnedSectionListView xmlns:android="http://schemas.android.com/apk/res/android"
<de.halfbit.pinnedsection.PinnedSectionListView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:headerDividersEnabled="false"
android:footerDividersEnabled="false"
android:layout_height="wrap_content"
android:divider="@null"
android:footerDividersEnabled="false"
android:headerDividersEnabled="false"
/>
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
17 changes: 17 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
GROUP=de.halfbit
VERSION_NAME=1.0.0
VERSION_CODE=1

POM_DESCRIPTION=Easy to use list view with pinned sections.

POM_URL=https://github.com/beworker/pinned-section-listview/
POM_SCM_URL=https://github.com/beworker/pinned-section-listview/
POM_SCM_CONNECTION=scm:[email protected]:beworker/pinned-section-listview.git
POM_SCM_DEV_CONNECTION=scm:[email protected]:beworker/pinned-section-listview.git

POM_LICENCE_NAME=The Apache Software License, Version 2.0
POM_LICENCE_URL=http://www.apache.org/licenses/LICENSE-2.0.txt
POM_LICENCE_DIST=repo

POM_DEVELOPER_ID=beworker
POM_DEVELOPER_NAME=Sergej Shafarenka
Loading

0 comments on commit 0d566ae

Please sign in to comment.