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:
commit
30001c0f78
|
|
@ -459,6 +459,7 @@ public abstract class ObservableCollectionAdapter<TItem, TItemViewHolder extends
|
||||||
/**
|
/**
|
||||||
* Method to bind item (from {@link #getObservableCollection()}) to item-specific ViewHolder.
|
* 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()}.
|
* 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 holder ViewHolder to bind item to;
|
||||||
* @param positionInAdapter Position of ViewHolder (NOT item!);
|
* @param positionInAdapter Position of ViewHolder (NOT item!);
|
||||||
|
|
|
||||||
|
|
@ -44,6 +44,8 @@ public class SimpleActionBarDrawerToggle extends ActionBarDrawerToggle
|
||||||
@NonNull
|
@NonNull
|
||||||
private final View sidebar;
|
private final View sidebar;
|
||||||
|
|
||||||
|
private boolean isInvalidateOptionsMenuSupported = true;
|
||||||
|
|
||||||
private boolean hamburgerShowed;
|
private boolean hamburgerShowed;
|
||||||
private boolean sidebarDisabled;
|
private boolean sidebarDisabled;
|
||||||
|
|
||||||
|
|
@ -203,7 +205,9 @@ public class SimpleActionBarDrawerToggle extends ActionBarDrawerToggle
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDrawerClosed(@NonNull final View view) {
|
public void onDrawerClosed(@NonNull final View view) {
|
||||||
activity.supportInvalidateOptionsMenu();
|
if (isInvalidateOptionsMenuSupported) {
|
||||||
|
activity.supportInvalidateOptionsMenu();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -218,7 +222,18 @@ public class SimpleActionBarDrawerToggle extends ActionBarDrawerToggle
|
||||||
@Override
|
@Override
|
||||||
public void onDrawerOpened(@NonNull final View drawerView) {
|
public void onDrawerOpened(@NonNull final View drawerView) {
|
||||||
activity.hideSoftInput();
|
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
|
@Override
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue