Show current highlighter in as ActionBar subtitle
This commit is contained in:
parent
3172fc4e69
commit
2765200d0b
@ -177,7 +177,7 @@ public class IITC_MapSettings implements OnItemSelectedListener, OnItemClickList
|
|||||||
@Override
|
@Override
|
||||||
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
||||||
if (mLoading) return;
|
if (mLoading) return;
|
||||||
|
|
||||||
if (parent.equals(mSpinnerHighlighter)) {
|
if (parent.equals(mSpinnerHighlighter)) {
|
||||||
String name = mHighlighters.getItem(position);
|
String name = mHighlighters.getItem(position);
|
||||||
mIitc.getWebView().loadUrl("javascript: window.changePortalHighlights('" + name + "')");
|
mIitc.getWebView().loadUrl("javascript: window.changePortalHighlights('" + name + "')");
|
||||||
@ -201,6 +201,8 @@ public class IITC_MapSettings implements OnItemSelectedListener, OnItemClickList
|
|||||||
mBaseLayers.clear();
|
mBaseLayers.clear();
|
||||||
mOverlayLayers.clear();
|
mOverlayLayers.clear();
|
||||||
|
|
||||||
|
mIitc.getNavigationHelper().setHighlighter(null);
|
||||||
|
|
||||||
mLoading = true;
|
mLoading = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -210,6 +212,8 @@ public class IITC_MapSettings implements OnItemSelectedListener, OnItemClickList
|
|||||||
int position = mHighlighters.getPosition(mActiveHighlighter);
|
int position = mHighlighters.getPosition(mActiveHighlighter);
|
||||||
if (position >= 0 && position < mHighlighters.getCount())
|
if (position >= 0 && position < mHighlighters.getCount())
|
||||||
mSpinnerHighlighter.setSelection(position);
|
mSpinnerHighlighter.setSelection(position);
|
||||||
|
|
||||||
|
mIitc.getNavigationHelper().setHighlighter(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setLayers(String base_layer, String overlay_layer) {
|
public void setLayers(String base_layer, String overlay_layer) {
|
||||||
|
@ -111,6 +111,7 @@ public class IITC_NavigationHelper extends ActionBarDrawerToggle implements OnIt
|
|||||||
private boolean mIsLoading;
|
private boolean mIsLoading;
|
||||||
private boolean mHideInFullscreen = false;
|
private boolean mHideInFullscreen = false;
|
||||||
private Pane mPane = Pane.MAP;
|
private Pane mPane = Pane.MAP;
|
||||||
|
private String mHighlighter = null;
|
||||||
|
|
||||||
public IITC_NavigationHelper(IITC_Mobile activity, ActionBar bar) {
|
public IITC_NavigationHelper(IITC_Mobile activity, ActionBar bar) {
|
||||||
super(activity, (DrawerLayout) activity.findViewById(R.id.drawer_layout),
|
super(activity, (DrawerLayout) activity.findViewById(R.id.drawer_layout),
|
||||||
@ -217,6 +218,11 @@ public class IITC_NavigationHelper extends ActionBarDrawerToggle implements OnIt
|
|||||||
mActionBar.setTitle(getPaneTitle(mPane));
|
mActionBar.setTitle(getPaneTitle(mPane));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!isDrawerOpened() && (mDesktopMode || mPane == Pane.MAP))
|
||||||
|
mActionBar.setSubtitle(mHighlighter);
|
||||||
|
else
|
||||||
|
mActionBar.setSubtitle(null);
|
||||||
|
|
||||||
if (mFullscreen && mHideInFullscreen)
|
if (mFullscreen && mHideInFullscreen)
|
||||||
mActionBar.hide();
|
mActionBar.hide();
|
||||||
else
|
else
|
||||||
@ -317,6 +323,11 @@ public class IITC_NavigationHelper extends ActionBarDrawerToggle implements OnIt
|
|||||||
updateActionBar();
|
updateActionBar();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setHighlighter(String name) {
|
||||||
|
mHighlighter = name;
|
||||||
|
updateActionBar();
|
||||||
|
}
|
||||||
|
|
||||||
public void setLoadingState(boolean isLoading) {
|
public void setLoadingState(boolean isLoading) {
|
||||||
mIsLoading = isLoading;
|
mIsLoading = isLoading;
|
||||||
updateActionBar();
|
updateActionBar();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user