Skip to content

Commit

Permalink
Merge branch 'release/v1.1.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
mikepenz committed Feb 24, 2016
2 parents 1d8cc28 + 88230d2 commit 04c3456
Show file tree
Hide file tree
Showing 13 changed files with 34 additions and 23 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,14 @@ You can try it out here [Google Play](https://play.google.com/store/apps/details

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.1@aar') {
compile('com.mikepenz:fastadapter:1.1.2@aar') {
transitive = true
}
```

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


Expand Down
4 changes: 2 additions & 2 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 111
versionName '1.1.1'
versionCode 112
versionName '1.1.2'

applicationVariants.all { variant ->
variant.outputs.each { output ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,10 @@ public boolean onClick(View v, IAdapter adapter, IItem item, int position) {
Boolean res = mActionModeHelper.onClick(item, position);

if (res != null && res) {
if (((IExpandable) item).isExpanded()) {
if (!((IExpandable) item).isExpanded()) {
ViewCompat.animate(v.findViewById(R.id.material_drawer_icon)).rotation(0).start();
} else {
ViewCompat.animate(v.findViewById(R.id.material_drawer_icon)).rotation(90).start();
ViewCompat.animate(v.findViewById(R.id.material_drawer_icon)).rotation(180).start();
}
}

Expand All @@ -101,6 +101,13 @@ public boolean onClick(View v, IAdapter adapter, IItem item, int position) {
mFastAdapter.withOnPreLongClickListener(new FastAdapter.OnLongClickListener<IItem>() {
@Override
public boolean onLongClick(View v, IAdapter adapter, IItem item, int position) {
//we do not want expandable items to be selected
if (item instanceof IExpandable) {
if (((IExpandable) item).getSubItems() != null) {
return true;
}
}

ActionMode actionMode = mActionModeHelper.onLongClick(AdvancedSampleActivity.this, position);

if (actionMode != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,11 @@ protected void onCreate(Bundle savedInstanceState) {
public boolean onClick(View v, IAdapter adapter, IItem item, int position) {
if (item instanceof ExpandableItem) {
if (((ExpandableItem) item).getSubItems() != null) {
if (((IExpandable) item).isExpanded()) {
ViewCompat.animate(v.findViewById(R.id.material_drawer_icon)).rotation(90).start();
if (!((IExpandable) item).isExpanded()) {
ViewCompat.animate(v.findViewById(R.id.material_drawer_icon)).rotation(180).start();
} else {
ViewCompat.animate(v.findViewById(R.id.material_drawer_icon)).rotation(0).start();
}

fastItemAdapter.toggleExpandable(position);
return true;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public void bindView(ViewHolder viewHolder) {
if (isExpanded()) {
ViewCompat.setRotation(viewHolder.icon, 0);
} else {
ViewCompat.setRotation(viewHolder.icon, 90);
ViewCompat.setRotation(viewHolder.icon, 180);
}
}

Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/expandable_item.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,6 @@
android:layout_height="16dp"
android:layout_marginTop="@dimen/material_drawer_vertical_padding"
app:ico_color="@color/md_black_1000"
app:ico_icon="gmd-keyboard-arrow-down"
app:ico_icon="gmd-keyboard-arrow-up"
app:ico_size="16dp" />
</LinearLayout>
4 changes: 2 additions & 2 deletions library-extensions/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ android {
defaultConfig {
minSdkVersion 10
targetSdkVersion 23
versionCode 110
versionName '1.1.0'
versionCode 112
versionName '1.1.2'
}
buildTypes {
release {
Expand Down
4 changes: 2 additions & 2 deletions library-extensions/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ POM_NAME=FastAdapter Library-Extensions
POM_ARTIFACT_ID=fastadapter-extensions
POM_PACKAGING=aar

VERSION_NAME=1.1.0
VERSION_CODE=110
VERSION_NAME=1.1.2
VERSION_CODE=112
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ public ActionMode getActionMode() {
public Boolean onClick(IItem item, int position) {
if (item instanceof IExpandable) {
if (((IExpandable) item).getSubItems() != null) {
mFastAdapter.toggleExpandable(position);

//if we are in CAB mode and there are no selections afterwards we end the CAB mode
if (mActionMode != null && mFastAdapter.getSelections().size() == 0) {
mActionMode.finish();
Expand Down
4 changes: 2 additions & 2 deletions library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ android {
defaultConfig {
minSdkVersion 10
targetSdkVersion 23
versionCode 111
versionName '1.1.1'
versionCode 112
versionName '1.1.2'
}
buildTypes {
release {
Expand Down
4 changes: 2 additions & 2 deletions library/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ POM_NAME=FastAdapter Library
POM_ARTIFACT_ID=fastadapter
POM_PACKAGING=aar

VERSION_NAME=1.1.1
VERSION_CODE=111
VERSION_NAME=1.1.2
VERSION_CODE=112
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,14 @@ public void onClick(View v) {
if (mOnPreClickListener != null) {
consumed = mOnPreClickListener.onClick(v, relativeInfo.adapter, relativeInfo.item, pos);
}

//if this is a expandable item :D
if (relativeInfo.item instanceof IExpandable) {
if (((IExpandable) relativeInfo.item).getSubItems() != null) {
toggleExpandable(pos);
}
}

//handle the selection if the event was not yet consumed, and we are allowed to select an item (only occurs when we select with long click only)
if (!consumed && !mSelectOnLongClick && mSelectable) {
handleSelection(v, relativeInfo.item, pos);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<b>FastAdapter</b>, the bullet proof, fast and easy to use adapter library, which minimizes developing time to a fraction...
]]>
</string>
<string name="library_fastadapter_libraryVersion">1.1.1</string>
<string name="library_fastadapter_libraryVersion">1.1.2</string>
<string name="library_fastadapter_libraryWebsite">https://github.com/mikepenz/FastAdapter</string>
<string name="library_fastadapter_licenseId">apache_2_0</string>
<string name="library_fastadapter_isOpenSource">true</string>
Expand Down

0 comments on commit 04c3456

Please sign in to comment.