Merge branch 'feature/invalidate_options_menu' into feature/general_improvements

# Conflicts:
#	src/main/java/ru/touchin/roboswag/components/adapters/ObservableCollectionAdapter.java
This commit is contained in:
Anton Domnikov 2017-05-03 17:27:10 +03:00
commit 30001c0f78
2 changed files with 18 additions and 2 deletions

View File

@ -459,6 +459,7 @@ public abstract class ObservableCollectionAdapter<TItem, TItemViewHolder extends
/**
* Method to bind item (from {@link #getObservableCollection()}) to item-specific ViewHolder.
* It is not calling for headers and footer which counts are returned by {@link #getHeadersCount()} and @link #getFootersCount()}.
* You don't need to override this method if you have delegates for every view type.
*
* @param holder ViewHolder to bind item to;
* @param positionInAdapter Position of ViewHolder (NOT item!);

View File

@ -44,6 +44,8 @@ public class SimpleActionBarDrawerToggle extends ActionBarDrawerToggle
@NonNull
private final View sidebar;
private boolean isInvalidateOptionsMenuSupported = true;
private boolean hamburgerShowed;
private boolean sidebarDisabled;
@ -203,7 +205,9 @@ public class SimpleActionBarDrawerToggle extends ActionBarDrawerToggle
@Override
public void onDrawerClosed(@NonNull final View view) {
activity.supportInvalidateOptionsMenu();
if (isInvalidateOptionsMenuSupported) {
activity.supportInvalidateOptionsMenu();
}
}
/**
@ -218,7 +222,18 @@ public class SimpleActionBarDrawerToggle extends ActionBarDrawerToggle
@Override
public void onDrawerOpened(@NonNull final View drawerView) {
activity.hideSoftInput();
activity.supportInvalidateOptionsMenu();
if (isInvalidateOptionsMenuSupported) {
activity.supportInvalidateOptionsMenu();
}
}
/**
* Set turn on/off invocation of supportInvalidateOptionsMenu
*
* @param isInvalidateOptionsMenuSupported flag for turning on/off invocation.
*/
public void setInvalidateOptionsMenuSupported(final boolean isInvalidateOptionsMenuSupported) {
this.isInvalidateOptionsMenuSupported = isInvalidateOptionsMenuSupported;
}
@Override