And another bugfix (Exception thrown when listview hidden) - thanks @leCradle
This commit is contained in:
parent
def3dd698c
commit
e8b730d078
@ -8,19 +8,17 @@ import android.widget.ArrayAdapter;
|
|||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
public class IITC_ActionBarHelper implements OnNavigationListener {
|
public class IITC_ActionBarHelper implements OnNavigationListener {
|
||||||
/*
|
// Show/hide the up arrow on the very left
|
||||||
* Show/hide the up arrow on the left end
|
// getActionBar().setDisplayHomeAsUpEnabled(enabled);
|
||||||
* getActionBar().setDisplayHomeAsUpEnabled(enabled);
|
|
||||||
*
|
// Show/hide the activity icon/logo
|
||||||
* Show/hide the activity icon/logo
|
// getActionBar().setDisplayShowHomeEnabled(enabled);
|
||||||
* getActionBar().setDisplayShowHomeEnabled(enabled);
|
|
||||||
*
|
// Show/hide the activity title
|
||||||
* Show/hide the activity title
|
// getActionBar().setDisplayShowTitleEnabled(enabled);
|
||||||
* getActionBar().setDisplayShowTitleEnabled(enabled);
|
|
||||||
*
|
// Makes the icon/title clickable
|
||||||
* Makes the icon/title clickable
|
// getActionBar().setHomeButtonEnabled(enabled);
|
||||||
* getActionBar().setHomeButtonEnabled(enabled);
|
|
||||||
*/
|
|
||||||
|
|
||||||
private class HighlighterAdapter extends ArrayAdapter<String> {
|
private class HighlighterAdapter extends ArrayAdapter<String> {
|
||||||
public HighlighterAdapter() {
|
public HighlighterAdapter() {
|
||||||
@ -90,9 +88,10 @@ public class IITC_ActionBarHelper implements OnNavigationListener {
|
|||||||
if (showHighlighter) {
|
if (showHighlighter) {
|
||||||
mActionBar.setDisplayShowTitleEnabled(false); // Hide title
|
mActionBar.setDisplayShowTitleEnabled(false); // Hide title
|
||||||
mActionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);
|
mActionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);
|
||||||
|
setActiveHighlighter(mActiveHighlighter);
|
||||||
} else {
|
} else {
|
||||||
mActionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
|
|
||||||
mActionBar.setDisplayShowTitleEnabled(true); // Show title
|
mActionBar.setDisplayShowTitleEnabled(true); // Show title
|
||||||
|
mActionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
|
||||||
}
|
}
|
||||||
if (mFullscreen && mHideInFullscreen)
|
if (mFullscreen && mHideInFullscreen)
|
||||||
mActionBar.hide();
|
mActionBar.hide();
|
||||||
@ -133,11 +132,13 @@ public class IITC_ActionBarHelper implements OnNavigationListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setActiveHighlighter(String name) {
|
public void setActiveHighlighter(String name) {
|
||||||
int position = mHighlighters.getPosition(name);
|
|
||||||
if (position >= 0)
|
|
||||||
mActionBar.setSelectedNavigationItem(position);
|
|
||||||
|
|
||||||
mActiveHighlighter = name;
|
mActiveHighlighter = name;
|
||||||
|
|
||||||
|
if (mActionBar.getNavigationMode() == ActionBar.NAVIGATION_MODE_LIST) {
|
||||||
|
int position = mHighlighters.getPosition(mActiveHighlighter);
|
||||||
|
if (position >= 0 && position < mActionBar.getNavigationItemCount())
|
||||||
|
mActionBar.setSelectedNavigationItem(position);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setFullscreen(boolean fullscreen) {
|
public void setFullscreen(boolean fullscreen) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user