reformat code
This commit is contained in:
@@ -45,15 +45,17 @@ public class ShareActivity extends FragmentActivity implements ActionBar.TabList
|
||||
|
||||
private String getUrl() {
|
||||
String url = "http://www.ingress.com/intel?ll=" + mLl + "&z=" + mZoom;
|
||||
if (mIsPortal)
|
||||
if (mIsPortal) {
|
||||
url += "&pll=" + mLl;
|
||||
}
|
||||
return url;
|
||||
}
|
||||
|
||||
private void setSelected(int position) {
|
||||
// Activity not fully loaded yet (may occur during tab creation)
|
||||
if (mSharedPrefs == null)
|
||||
if (mSharedPrefs == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
mSharedPrefs
|
||||
.edit()
|
||||
@@ -125,8 +127,9 @@ public class ShareActivity extends FragmentActivity implements ActionBar.TabList
|
||||
mViewPager.setOnPageChangeListener(new ViewPager.SimpleOnPageChangeListener() {
|
||||
@Override
|
||||
public void onPageSelected(int position) {
|
||||
if (actionBar.getNavigationMode() != ActionBar.NAVIGATION_MODE_STANDARD)
|
||||
if (actionBar.getNavigationMode() != ActionBar.NAVIGATION_MODE_STANDARD) {
|
||||
actionBar.setSelectedNavigationItem(position);
|
||||
}
|
||||
setSelected(position);
|
||||
}
|
||||
});
|
||||
@@ -141,15 +144,17 @@ public class ShareActivity extends FragmentActivity implements ActionBar.TabList
|
||||
.setTabListener(this));
|
||||
}
|
||||
|
||||
if (mFragmentAdapter.getCount() > 1)
|
||||
if (mFragmentAdapter.getCount() > 1) {
|
||||
actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
|
||||
}
|
||||
|
||||
mSharedPrefs = PreferenceManager.getDefaultSharedPreferences(this);
|
||||
int selected = mSharedPrefs.getInt("pref_share_selected_tab", 0);
|
||||
if (selected < mFragmentAdapter.getCount()) {
|
||||
mViewPager.setCurrentItem(selected);
|
||||
if (actionBar.getNavigationMode() != ActionBar.NAVIGATION_MODE_STANDARD)
|
||||
if (actionBar.getNavigationMode() != ActionBar.NAVIGATION_MODE_STANDARD) {
|
||||
actionBar.setSelectedNavigationItem(selected);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user