Skip to content

Commit

Permalink
Merge branch 'release/v1.1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
mikepenz committed Feb 22, 2016
2 parents 2223bcc + 63d42c1 commit 4d1e9dd
Show file tree
Hide file tree
Showing 34 changed files with 932 additions and 70 deletions.
36 changes: 30 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,36 @@ Beside being blazing fast, minimizing the code you need to write, it is also rea

##A quick overview:
- Click / Long-Click listeners
- Selection / Multi-Selection
- Selection / Multi-Selection [MultiselectSample](https://github.com/mikepenz/FastAdapter/blob/develop/app/src/main/java/com/mikepenz/fastadapter/app/MultiselectSampleActivity.java)
- [CheckBoxSample](https://github.com/mikepenz/FastAdapter/blob/develop/app/src/main/java/com/mikepenz/fastadapter/app/CheckBoxSampleActivity.java)
- [RadioButtonSample](https://github.com/mikepenz/FastAdapter/blob/develop/app/src/main/java/com/mikepenz/fastadapter/app/RadioButtonSampleActivity.java)
- Expandable items
- [ExpandableSample](https://github.com/mikepenz/FastAdapter/blob/develop/app/src/main/java/com/mikepenz/fastadapter/app/ExpandableSampleActivity.java)
- [IconGridSample](https://github.com/mikepenz/FastAdapter/blob/develop/app/src/main/java/com/mikepenz/fastadapter/app/IconGridActivity.java)
- [AdvancedSample](https://github.com/mikepenz/FastAdapter/blob/develop/app/src/main/java/com/mikepenz/fastadapter/app/AdvancedSampleActivity.java)
- Write less code, get better results
- Simple Drag & Drop
- Headers
- [SimpleItemListSample](https://github.com/mikepenz/FastAdapter/blob/develop/app/src/main/java/com/mikepenz/fastadapter/app/SimpleItemListActivity.java)
- Headers
- [StickyHeaderSample](https://github.com/mikepenz/FastAdapter/blob/develop/app/src/main/java/com/mikepenz/fastadapter/app/StickyHeaderSampleActivity.java)
- [AdvancedSample](https://github.com/mikepenz/FastAdapter/blob/develop/app/src/main/java/com/mikepenz/fastadapter/app/AdvancedSampleActivity.java)
- Footers
- FastScroller (external lib)
- [SimpleItemListSample](https://github.com/mikepenz/FastAdapter/blob/develop/app/src/main/java/com/mikepenz/fastadapter/app/SimpleItemListActivity.java)
- Filter
- [SimpleItemListSample](https://github.com/mikepenz/FastAdapter/blob/develop/app/src/main/java/com/mikepenz/fastadapter/app/SimpleItemListActivity.java)
- Highly optimized code
- Includes suggestions from the Android Team
- Easily extensible
- Split item view and model
- [GenericItem](https://github.com/mikepenz/FastAdapter/blob/develop/app/src/main/java/com/mikepenz/fastadapter/app/GenericItemActivity.java)
- [MultiTypeGenericItem](https://github.com/mikepenz/FastAdapter/blob/develop/app/src/main/java/com/mikepenz/fastadapter/app/MultiTypeGenericItemActivity.java)
- Chain other Adapters
- [SimpleItemListSample](https://github.com/mikepenz/FastAdapter/blob/develop/app/src/main/java/com/mikepenz/fastadapter/app/SimpleItemListActivity.java)
- [StickyHeaderSample](https://github.com/mikepenz/FastAdapter/blob/develop/app/src/main/java/com/mikepenz/fastadapter/app/StickyHeaderSampleActivity.java)
- Comes with useful Helpers
- ActionModeHelper
- UndoHelper
- ActionModeHelper [MultiselectSample](https://github.com/mikepenz/FastAdapter/blob/develop/app/src/main/java/com/mikepenz/fastadapter/app/MultiselectSampleActivity.java)
- UndoHelper [MultiselectSample](https://github.com/mikepenz/FastAdapter/blob/develop/app/src/main/java/com/mikepenz/fastadapter/app/MultiselectSampleActivity.java)
- More to come...

#Preview
Expand All @@ -33,12 +49,20 @@ You can try it out here [Google Play](https://play.google.com/store/apps/details

#Include in your project
##Using Maven
```javascript
compile('com.mikepenz:fastadapter:1.0.6@aar') {

The library is split up into core, and extensions. The core functions are included in the following dependency.
```gradle
compile('com.mikepenz:fastadapter:1.1.0@aar') {
transitive = true
}
```

All additions are included in the following dependency.
```gradle
compile 'com.mikepenz:fastadapter-extensions:1.1.0@aar'
```


##How to use
###1. Implement your item (the easy way)
Just create a class which extends the `AbstractItem` as shown below. Implement the methods, and your item is ready.
Expand Down
15 changes: 9 additions & 6 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ android {
defaultConfig {
minSdkVersion 11
targetSdkVersion 23
versionCode 106
versionName '1.0.6'
versionCode 110
versionName '1.1.0'

applicationVariants.all { variant ->
variant.outputs.each { output ->
Expand Down Expand Up @@ -48,10 +48,13 @@ android {

dependencies {
compile project(':library')
compile project(':library-extensions')

compile "com.android.support:cardview-v7:${rootProject.ext.supportLibVersion}"

//used to generate the drawer on the left
//https://github.com/mikepenz/MaterialDrawer
compile('com.mikepenz:materialdrawer:5.0.0.b24-SNAPSHOT@aar') {
compile('com.mikepenz:materialdrawer:5.0.0@aar') {
transitive = true
exclude module: "fastadapter"
}
Expand All @@ -60,15 +63,15 @@ dependencies {
compile 'com.mikepenz:itemanimators:0.2.1@aar'
//used to generate the Open Source section
//https://github.com/mikepenz/AboutLibraries
compile('com.mikepenz:aboutlibraries:5.5.0@aar') {
compile('com.mikepenz:aboutlibraries:5.5.2@aar') {
transitive = true
exclude module: "fastadapter"
}
//used to display the icons in the drawer
//https://github.com/mikepenz/Android-Iconics
compile 'com.mikepenz:material-design-iconic-typeface:2.2.0.1@aar'
compile 'com.mikepenz:community-material-typeface:1.3.41.1@aar'
compile 'com.mikepenz:google-material-typeface:2.1.0.1.original@aar'
compile 'com.mikepenz:google-material-typeface:2.2.0.1.original@aar'
compile 'com.mikepenz:fontawesome-typeface:4.5.0.1@aar'

//Used for the StickyHeaderSample
Expand All @@ -79,7 +82,7 @@ dependencies {

//Used to provide the FastScrollBar
//https://github.com/krimin-killr21/MaterialScrollBar
compile 'com.turingtechnologies.materialscrollbar:lib:7.1.1'
compile 'com.turingtechnologies.materialscrollbar:lib:8.0.0'

//https://github.com/JakeWharton/butterknife
compile 'com.jakewharton:butterknife:7.0.1'
Expand Down
3 changes: 3 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
<activity
android:name=".SimpleItemListActivity"
android:label="@string/sample_simple_item_list" />
<activity
android:name=".SwipeListActivity"
android:label="@string/sample_swipe_list" />
<activity
android:name=".ImageListActivity"
android:label="@string/sample_image_list" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import com.mikepenz.fastadapter.app.adapter.StickyHeaderAdapter;
import com.mikepenz.fastadapter.app.items.ExpandableItem;
import com.mikepenz.fastadapter.app.items.SampleItem;
import com.mikepenz.fastadapter.helpers.ActionModeHelper;
import com.mikepenz.fastadapter_extensions.ActionModeHelper;
import com.mikepenz.iconics.context.IconicsLayoutInflater;
import com.mikepenz.materialize.MaterializeBuilder;
import com.mikepenz.materialize.util.UIUtils;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
import com.mikepenz.fastadapter.adapters.HeaderAdapter;
import com.mikepenz.fastadapter.adapters.ItemAdapter;
import com.mikepenz.fastadapter.app.items.SampleItem;
import com.mikepenz.fastadapter.helpers.ActionModeHelper;
import com.mikepenz.fastadapter.helpers.UndoHelper;
import com.mikepenz.fastadapter_extensions.ActionModeHelper;
import com.mikepenz.fastadapter_extensions.UndoHelper;
import com.mikepenz.itemanimators.SlideDownAlphaAnimator;
import com.mikepenz.materialize.MaterializeBuilder;
import com.mikepenz.materialize.util.UIUtils;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ protected void onCreate(Bundle savedInstanceState) {
new PrimaryDrawerItem().withName(R.string.sample_multi_generic_item).withDescription(R.string.sample_multi_generic_item_descr).withSelectable(false).withIdentifier(9).withIcon(MaterialDesignIconic.Icon.gmi_format_list_numbered),
new PrimaryDrawerItem().withName(R.string.sample_checkbox_item).withDescription(R.string.sample_checkbox_item_descr).withSelectable(false).withIdentifier(10).withIcon(CommunityMaterial.Icon.cmd_checkbox_marked),
new PrimaryDrawerItem().withName(R.string.sample_radiobutton_item).withDescription(R.string.sample_radiobutton_item_descr).withSelectable(false).withIdentifier(11).withIcon(CommunityMaterial.Icon.cmd_radiobox_marked),
new PrimaryDrawerItem().withName(R.string.sample_swipe_list).withDescription(R.string.sample_swipe_list_descr).withSelectable(false).withIdentifier(12).withIcon(MaterialDesignIconic.Icon.gmi_format_align_left),
new DividerDrawerItem(),
new PrimaryDrawerItem().withName(R.string.open_source).withSelectable(false).withIdentifier(100).withIcon(MaterialDesignIconic.Icon.gmi_github)
)
Expand Down Expand Up @@ -105,6 +106,8 @@ public boolean onItemClick(View view, int position, IDrawerItem drawerItem) {
intent = new Intent(SampleActivity.this, CheckBoxSampleActivity.class);
} else if (drawerItem.getIdentifier() == 11) {
intent = new Intent(SampleActivity.this, RadioButtonSampleActivity.class);
} else if (drawerItem.getIdentifier() == 12) {
intent = new Intent(SampleActivity.this, SwipeListActivity.class);
} else if (drawerItem.getIdentifier() == 100) {
intent = new LibsBuilder()
.withFields(R.string.class.getFields())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@
import com.mikepenz.fastadapter.IAdapter;
import com.mikepenz.fastadapter.IItemAdapter;
import com.mikepenz.fastadapter.adapters.FastItemAdapter;
import com.mikepenz.fastadapter.adapters.ItemAdapter.ItemFilterListener;
import com.mikepenz.fastadapter.app.adapter.FastScrollIndicatorAdapter;
import com.mikepenz.fastadapter.app.items.SampleItem;
import com.mikepenz.fastadapter.drag.ItemTouchCallback;
import com.mikepenz.fastadapter.drag.SimpleDragCallback;
import com.mikepenz.fastadapter_extensions.drag.ItemTouchCallback;
import com.mikepenz.fastadapter_extensions.drag.SimpleDragCallback;
import com.mikepenz.materialize.MaterializeBuilder;
import com.turingtechnologies.materialscrollbar.AlphabetIndicator;
import com.turingtechnologies.materialscrollbar.DragScrollBar;
Expand All @@ -34,7 +35,7 @@
import java.util.List;
import java.util.Random;

public class SimpleItemListActivity extends AppCompatActivity implements ItemTouchCallback {
public class SimpleItemListActivity extends AppCompatActivity implements ItemTouchCallback, ItemFilterListener {
private static final String[] ALPHABET = new String[]{"A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"};

//save our FastAdapter
Expand Down Expand Up @@ -82,6 +83,8 @@ public boolean filter(SampleItem item, CharSequence constraint) {
}
});

fastItemAdapter.getItemAdapter().setItemFilterListener(this);

//get our recyclerView and do basic setup
RecyclerView recyclerView = (RecyclerView) findViewById(R.id.rv);
recyclerView.setLayoutManager(new LinearLayoutManager(this));
Expand Down Expand Up @@ -175,4 +178,9 @@ public boolean itemTouchOnMove(int oldPosition, int newPosition) {
fastItemAdapter.notifyAdapterItemMoved(oldPosition, newPosition);
return true;
}

@Override
public void itemsFiltered() {
Toast.makeText(SimpleItemListActivity.this, "filtered items count: " + fastItemAdapter.getItemCount(), Toast.LENGTH_SHORT).show();
}
}
Loading

0 comments on commit 4d1e9dd

Please sign in to comment.