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 Sep 22, 2018
2 parents 9d447da + 97f3e87 commit e8de628
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 28 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ These `Animators` correctly work with all view states and `RecyclerView` states
# Include in your project
## Using Maven
```javascript
implementation "com.mikepenz:itemanimators:1.1.0-rc01@aar"
implementation "com.mikepenz:itemanimators:1.1.0"
implementation "androidx.recyclerview:recyclerview:${androidXVersion}"
```

Expand Down
12 changes: 6 additions & 6 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ dependencies {

//used to generate the drawer on the left
//https://github.com/mikepenz/MaterialDrawer
implementation('com.mikepenz:materialdrawer:5.9.3@aar') {
implementation('com.mikepenz:materialdrawer:6.1.0-rc01') {
transitive = true
exclude module: "itemanimators"
exclude module: "fastadapter"
Expand All @@ -59,20 +59,20 @@ dependencies {
// used to fill the RecyclerView with the DrawerItems
// and provides single and multi selection, collapsable items
// https://github.com/mikepenz/FastAdapter
implementation('com.mikepenz:fastadapter:2.6.3@aar')
implementation('com.mikepenz:fastadapter-commons:2.6.3@aar')
implementation('com.mikepenz:fastadapter:3.3.0')
implementation('com.mikepenz:fastadapter-commons:3.3.0')

//used to generate the Open Source section
//https://github.com/mikepenz/AboutLibraries
implementation('com.mikepenz:aboutlibraries:5.9.8@aar')
implementation('com.mikepenz:aboutlibraries:6.2.0-rc01')

//used to display the icons in the drawer
//https://github.com/mikepenz/Android-Iconics
implementation 'com.mikepenz:material-design-iconic-typeface:2.2.0.1@aar'

//https://github.com/JakeWharton/butterknife
implementation 'com.jakewharton:butterknife:8.8.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
implementation 'com.jakewharton:butterknife:9.0.0-SNAPSHOT'
annotationProcessor 'com.jakewharton:butterknife-compiler:9.0.0-SNAPSHOT'

//used to load the images in the ImageListSample
//https://github.com/bumptech/glide
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@
import android.graphics.Color;
import android.os.Bundle;
import android.os.Handler;
import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.appcompat.widget.Toolbar;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
Expand Down Expand Up @@ -44,6 +39,12 @@

import java.util.List;

import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

public class SampleActivity extends AppCompatActivity {
enum Type {
CrossFade(new AlphaCrossFadeAnimator()),
Expand Down Expand Up @@ -74,7 +75,7 @@ public BaseItemAnimator getAnimator() {
//save our FastAdapter
private FastAdapter mFastAdapter;
//save our FastAdapter
private ItemAdapter mItemAdapter;
private ItemAdapter<IItem> mItemAdapter;

@Override
protected void onCreate(Bundle savedInstanceState) {
Expand Down Expand Up @@ -121,20 +122,21 @@ public boolean onItemClick(View view, int position, IDrawerItem drawerItem) {
})
.build();

//create our ItemAdapter which will host our items
mItemAdapter = new ItemAdapter<>();

//create our FastAdapter which will manage everything
mFastAdapter = new FastAdapter();
mFastAdapter = FastAdapter.with(mItemAdapter);
mFastAdapter.withSelectable(true);
mFastAdapter.withMultiSelect(true);
mFastAdapter.withSelectOnLongClick(false);
//create our ItemAdapter which will host our items
mItemAdapter = new ItemAdapter();

//configure our fastAdapter
//get our recyclerView and do basic setup
mRecyclerView = (RecyclerView) findViewById(R.id.rv);
mRecyclerView.setLayoutManager(new GridLayoutManager(this, 3));
//mRecyclerView.setLayoutManager(new LinearLayoutManager(this));
mRecyclerView.setAdapter(mItemAdapter.wrap(mFastAdapter));
mRecyclerView.setAdapter(mFastAdapter);
mRecyclerView.setItemAnimator(new AlphaCrossFadeAnimator());
mRecyclerView.getItemAnimator().setAddDuration(500);
mRecyclerView.getItemAnimator().setRemoveDuration(500);
Expand Down Expand Up @@ -207,7 +209,7 @@ public boolean onOptionsItemSelected(MenuItem item) {
return true;
case R.id.item_change:
for (Integer pos : (Iterable<Integer>) mFastAdapter.getSelections()) {
ImageItem i = (ImageItem) mItemAdapter.getItem(pos);
ImageItem i = (ImageItem) mItemAdapter.getAdapterItem(pos);
i.withName("CHANGED");
i.withDescription("This item was modified");
mItemAdapter.set(pos, i);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package com.mikepenz.itemanimators.app.dummy;


import com.mikepenz.fastadapter.IItem;
import com.mikepenz.itemanimators.app.items.ImageItem;

import java.util.Arrays;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;

Expand All @@ -23,7 +24,7 @@ public static ImageItem getDummyItem() {
}
}

public static List<ImageItem> getImages() {
public static List<IItem> getImages() {
return toList(
new ImageItem().withName("Yang Zhuo Yong Cuo, Tibet China").withDescription("#100063").withImage("https://raw.githubusercontent.com/mikepenz/earthview-wallpapers/develop/thumb/yang_zhuo_yong_cuo,_tibet-china-63.jpg"),
new ImageItem().withName("Yellowstone United States").withDescription("#100017").withImage("https://raw.githubusercontent.com/mikepenz/earthview-wallpapers/develop/thumb/yellowstone-united_states-17.jpg"),
Expand Down Expand Up @@ -59,7 +60,11 @@ public static List<ImageItem> getImages() {
);
}

private static List<ImageItem> toList(ImageItem... imageItems) {
return Arrays.asList(imageItems);
private static List<IItem> toList(ImageItem... imageItems) {
ArrayList<IItem> items = new ArrayList<>();
for (ImageItem imageItem : imageItems) {
items.add(imageItem);
}
return items;
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.mikepenz.itemanimators.app.items;

import android.content.Context;
import androidx.recyclerview.widget.RecyclerView;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.ImageView;
Expand All @@ -15,6 +14,7 @@

import java.util.List;

import androidx.recyclerview.widget.RecyclerView;
import butterknife.BindView;
import butterknife.ButterKnife;

Expand Down
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
buildscript {
ext {
release = [
versionName: "1.1.0-rc01",
versionName: "1.1.0",
versionCode: 1100
]

Expand All @@ -13,7 +13,7 @@ buildscript {
]

versions = [
androidXVersion: '1.0.0-rc01'
androidXVersion: '1.0.0'
]
}

Expand All @@ -22,7 +22,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.0-alpha05'
classpath 'com.android.tools.build:gradle:3.3.0-alpha11'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4'
}
Expand Down
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ POM_DEVELOPER_ID=mikepenz
POM_DEVELOPER_NAME=Mike Penz

android.useAndroidX=true
android.enableJetifier=true
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Sat Aug 11 19:17:43 CEST 2018
#Sat Sep 22 15:53:59 CEST 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.9-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10-all.zip

0 comments on commit e8de628

Please sign in to comment.