check for scheme setting in intel-url generation

This commit is contained in:
Philipp Schaefer 2014-06-05 15:51:10 +02:00
parent 1b0dc2393b
commit 16f1ce1fc6

View File

@ -68,7 +68,8 @@ public class ShareActivity extends FragmentActivity implements ActionBar.TabList
}
private String getIntelUrl(final String ll, final int zoom, final boolean isPortal) {
String url = "http://www.ingress.com/intel?ll=" + ll + "&z=" + zoom;
final String scheme = mSharedPrefs.getBoolean("pref_force_https", true) ? "https" : "http";
String url = scheme + "://www.ingress.com/intel?ll=" + ll + "&z=" + zoom;
if (isPortal) {
url += "&pll=" + ll;
}
@ -107,6 +108,8 @@ public class ShareActivity extends FragmentActivity implements ActionBar.TabList
mFragmentAdapter = new FragmentAdapter(getSupportFragmentManager());
mSharedPrefs = PreferenceManager.getDefaultSharedPreferences(this);
final ActionBar actionBar = getActionBar();
actionBar.setDisplayHomeAsUpEnabled(true);
@ -175,7 +178,6 @@ public class ShareActivity extends FragmentActivity implements ActionBar.TabList
actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
}
mSharedPrefs = PreferenceManager.getDefaultSharedPreferences(this);
final int selected = mSharedPrefs.getInt("pref_share_selected_tab", 0);
if (selected < mFragmentAdapter.getCount()) {
mViewPager.setCurrentItem(selected);