Change class name

This commit is contained in:
fkloft 2013-09-22 14:44:30 +02:00
parent 8c539078cb
commit 6477dd5656
3 changed files with 19 additions and 18 deletions

View File

@ -102,13 +102,13 @@ public class IITC_JSInterface {
iitcm.runOnUiThread(new Runnable() { iitcm.runOnUiThread(new Runnable() {
@Override @Override
public void run() { public void run() {
IITC_ActionBarHelper actionbar = iitcm.getActionBarHelper(); IITC_NavigationHelper navigation = iitcm.getNavigationHelper();
Integer button = IITC_Mobile.PANES.get(id); Integer button = IITC_Mobile.PANES.get(id);
if (button == null) if (button == null)
button = android.R.id.home; button = android.R.id.home;
actionbar.switchTo(button); navigation.switchTo(button);
iitcm.backStackUpdate(button); iitcm.backStackUpdate(button);
} }
}); });
@ -236,7 +236,7 @@ public class IITC_JSInterface {
iitc.runOnUiThread(new Runnable() { iitc.runOnUiThread(new Runnable() {
@Override @Override
public void run() { public void run() {
iitc.getActionBarHelper().addPortalHighlighter(name); iitc.getNavigationHelper().addPortalHighlighter(name);
} }
}); });
} }
@ -247,7 +247,7 @@ public class IITC_JSInterface {
iitc.runOnUiThread(new Runnable() { iitc.runOnUiThread(new Runnable() {
@Override @Override
public void run() { public void run() {
iitc.getActionBarHelper().setActiveHighlighter(name); iitc.getNavigationHelper().setActiveHighlighter(name);
} }
}); });
} }

View File

@ -54,7 +54,7 @@ public class IITC_Mobile extends Activity {
private boolean mReloadNeeded = false; private boolean mReloadNeeded = false;
private final ArrayList<String> mDialogStack = new ArrayList<String>(); private final ArrayList<String> mDialogStack = new ArrayList<String>();
private SharedPreferences mSharedPrefs; private SharedPreferences mSharedPrefs;
private IITC_ActionBarHelper mActionBarHelper; private IITC_NavigationHelper mNavigationHelper;
// Used for custom back stack handling // Used for custom back stack handling
private final ArrayList<Integer> mBackStack = new ArrayList<Integer>(); private final ArrayList<Integer> mBackStack = new ArrayList<Integer>();
@ -94,7 +94,7 @@ public class IITC_Mobile extends Activity {
mIitcWebView = (IITC_WebView) findViewById(R.id.iitc_webview); mIitcWebView = (IITC_WebView) findViewById(R.id.iitc_webview);
// pass ActionBar to helper because we deprecated getActionBar // pass ActionBar to helper because we deprecated getActionBar
mActionBarHelper = new IITC_ActionBarHelper(this, super.getActionBar()); mNavigationHelper = new IITC_NavigationHelper(this, super.getActionBar());
// do something if user changed something in the settings // do something if user changed something in the settings
mSharedPrefs = PreferenceManager.getDefaultSharedPreferences(this); mSharedPrefs = PreferenceManager.getDefaultSharedPreferences(this);
@ -104,14 +104,14 @@ public class IITC_Mobile extends Activity {
SharedPreferences sharedPreferences, String key) { SharedPreferences sharedPreferences, String key) {
if (key.equals("pref_force_desktop")) { if (key.equals("pref_force_desktop")) {
mDesktopMode = sharedPreferences.getBoolean("pref_force_desktop", false); mDesktopMode = sharedPreferences.getBoolean("pref_force_desktop", false);
mActionBarHelper.onPrefChanged(); mNavigationHelper.onPrefChanged();
invalidateOptionsMenu(); invalidateOptionsMenu();
} }
if (key.equals("pref_user_loc")) if (key.equals("pref_user_loc"))
mIsLocEnabled = sharedPreferences.getBoolean("pref_user_loc", mIsLocEnabled = sharedPreferences.getBoolean("pref_user_loc",
false); false);
if (key.equals("pref_fullscreen_actionbar")) { if (key.equals("pref_fullscreen_actionbar")) {
mActionBarHelper.onPrefChanged(); mNavigationHelper.onPrefChanged();
return; return;
} }
if (key.equals("pref_advanced_menu")) { if (key.equals("pref_advanced_menu")) {
@ -224,7 +224,7 @@ public class IITC_Mobile extends Activity {
(SearchView) mSearchMenuItem.getActionView(); (SearchView) mSearchMenuItem.getActionView();
searchView.setQuery(query, false); searchView.setQuery(query, false);
searchView.clearFocus(); searchView.clearFocus();
mActionBarHelper.switchTo(android.R.id.home); mNavigationHelper.switchTo(android.R.id.home);
backStackUpdate(android.R.id.home); backStackUpdate(android.R.id.home);
mIitcWebView.loadUrl("javascript:search('" + query + "');"); mIitcWebView.loadUrl("javascript:search('" + query + "');");
return; return;
@ -338,7 +338,7 @@ public class IITC_Mobile extends Activity {
} }
// exit fullscreen mode if it is enabled and action bar is disabled // exit fullscreen mode if it is enabled and action bar is disabled
// or the back stack is empty // or the back stack is empty
if (mFullscreenMode && (mBackStack.isEmpty() || mActionBarHelper.hideInFullscreen())) { if (mFullscreenMode && (mBackStack.isEmpty() || mNavigationHelper.hideInFullscreen())) {
this.toggleFullscreen(); this.toggleFullscreen();
} else if (!mBackStack.isEmpty()) { } else if (!mBackStack.isEmpty()) {
// Pop last item from backstack and pretend the relevant menu item was clicked // Pop last item from backstack and pretend the relevant menu item was clicked
@ -365,7 +365,7 @@ public class IITC_Mobile extends Activity {
// catch wrong usage // catch wrong usage
if (mBackStack.isEmpty()) { if (mBackStack.isEmpty()) {
// Empty back stack means we should be at home (ie map) screen // Empty back stack means we should be at home (ie map) screen
mActionBarHelper.switchTo(android.R.id.home); mNavigationHelper.switchTo(android.R.id.home);
mIitcWebView.loadUrl("javascript: window.show('map');"); mIitcWebView.loadUrl("javascript: window.show('map');");
return; return;
} }
@ -483,7 +483,7 @@ public class IITC_Mobile extends Activity {
} }
public void reloadIITC() { public void reloadIITC() {
mActionBarHelper.reset(); mNavigationHelper.reset();
mBackStack.clear(); mBackStack.clear();
// iitc starts on map after reload // iitc starts on map after reload
mCurrentPane = android.R.id.home; mCurrentPane = android.R.id.home;
@ -534,7 +534,7 @@ public class IITC_Mobile extends Activity {
public void toggleFullscreen() { public void toggleFullscreen() {
mFullscreenMode = !mFullscreenMode; mFullscreenMode = !mFullscreenMode;
mActionBarHelper.setFullscreen(mFullscreenMode); mNavigationHelper.setFullscreen(mFullscreenMode);
// toggle notification bar // toggle notification bar
WindowManager.LayoutParams attrs = getWindow().getAttributes(); WindowManager.LayoutParams attrs = getWindow().getAttributes();
@ -634,7 +634,8 @@ public class IITC_Mobile extends Activity {
} }
/** /**
* @deprecated ActionBar related stuff should be handled by ActionBarHelper * @deprecated ActionBar related stuff should be handled by IITC_NavigationHelper
* @see getNavigationHelper()
*/ */
@Deprecated @Deprecated
@Override @Override
@ -642,7 +643,7 @@ public class IITC_Mobile extends Activity {
return super.getActionBar(); return super.getActionBar();
} }
public IITC_ActionBarHelper getActionBarHelper() { public IITC_NavigationHelper getNavigationHelper() {
return mActionBarHelper; return mNavigationHelper;
} }
} }

View File

@ -7,7 +7,7 @@ import android.preference.PreferenceManager;
import android.widget.ArrayAdapter; import android.widget.ArrayAdapter;
import android.widget.Toast; import android.widget.Toast;
public class IITC_ActionBarHelper implements OnNavigationListener { public class IITC_NavigationHelper implements OnNavigationListener {
// Show/hide the up arrow on the very left // Show/hide the up arrow on the very left
// getActionBar().setDisplayHomeAsUpEnabled(enabled); // getActionBar().setDisplayHomeAsUpEnabled(enabled);
@ -50,7 +50,7 @@ public class IITC_ActionBarHelper implements OnNavigationListener {
private boolean mHideInFullscreen = false; private boolean mHideInFullscreen = false;
private int mPane = android.R.id.home; private int mPane = android.R.id.home;
public IITC_ActionBarHelper(IITC_Mobile activity, ActionBar bar) { public IITC_NavigationHelper(IITC_Mobile activity, ActionBar bar) {
mIitc = activity; mIitc = activity;
mActionBar = bar; mActionBar = bar;
mPrefs = PreferenceManager.getDefaultSharedPreferences(activity); mPrefs = PreferenceManager.getDefaultSharedPreferences(activity);