Bug 1389269 - Clean up the UI layout for standalone webapps r=droeh
MozReview-Commit-ID: 7NikFByIH7B
--- a/mobile/android/base/java/org/mozilla/gecko/webapps/WebAppActivity.java
+++ b/mobile/android/base/java/org/mozilla/gecko/webapps/WebAppActivity.java
@@ -39,24 +39,22 @@ import org.mozilla.gecko.GeckoViewSettin
import org.mozilla.gecko.icons.decoders.FaviconDecoder;
import org.mozilla.gecko.icons.decoders.LoadFaviconResult;
import org.mozilla.gecko.prompts.PromptService;
import org.mozilla.gecko.R;
import org.mozilla.gecko.util.ActivityUtils;
import org.mozilla.gecko.util.ColorUtil;
import org.mozilla.gecko.util.FileUtils;
-public class WebAppActivity extends AppCompatActivity
- implements GeckoView.NavigationListener {
+public class WebAppActivity extends AppCompatActivity {
private static final String LOGTAG = "WebAppActivity";
public static final String MANIFEST_PATH = "MANIFEST_PATH";
private static final String SAVED_INTENT = "savedIntent";
- private TextView mUrlView;
private GeckoView mGeckoView;
private PromptService mPromptService;
private boolean mFullScreen;
private Uri mScope;
@Override
public void onCreate(Bundle savedInstanceState) {
@@ -70,44 +68,29 @@ public class WebAppActivity extends AppC
savedInstanceState.setClassLoader(getClass().getClassLoader());
Intent lastLaunchIntent = savedInstanceState.getParcelable(SAVED_INTENT);
setIntent(lastLaunchIntent);
}
super.onCreate(savedInstanceState);
- setContentView(R.layout.customtabs_activity);
-
- final Toolbar toolbar = (Toolbar) findViewById(R.id.actionbar);
- setSupportActionBar(toolbar);
-
- final ActionBar actionBar = getSupportActionBar();
- actionBar.setCustomView(R.layout.webapps_action_bar_custom_view);
- actionBar.setDisplayShowCustomEnabled(true);
- actionBar.setDisplayShowTitleEnabled(false);
- actionBar.hide();
-
- final View customView = actionBar.getCustomView();
- mUrlView = (TextView) customView.findViewById(R.id.webapps_action_bar_url);
-
- mGeckoView = (GeckoView) findViewById(R.id.gecko_view);
-
- mGeckoView.setNavigationListener(this);
-
+ mGeckoView = new GeckoView(this);
mPromptService = new PromptService(this, mGeckoView.getEventDispatcher());
final GeckoViewSettings settings = mGeckoView.getSettings();
settings.setBoolean(GeckoViewSettings.USE_MULTIPROCESS, false);
final Uri u = getIntent().getData();
if (u != null) {
mGeckoView.loadUri(u.toString());
}
+ setContentView(mGeckoView);
+
loadManifest(getIntent().getStringExtra(MANIFEST_PATH));
}
@Override
public void onDestroy() {
mPromptService.destroy();
super.onDestroy();
}
@@ -294,29 +277,9 @@ public class WebAppActivity extends AppC
}
return true;
}
private void updateFullScreen() {
ActivityUtils.setFullScreen(this, mFullScreen);
}
-
- /* GeckoView.NavigationListener */
- @Override
- public void onLocationChange(GeckoView view, String url) {
- if (isInScope(url)) {
- getSupportActionBar().hide();
- } else {
- getSupportActionBar().show();
- }
-
- mUrlView.setText(url);
- }
-
- @Override
- public void onCanGoBack(GeckoView view, boolean canGoBack) {
- }
-
- @Override
- public void onCanGoForward(GeckoView view, boolean canGoForward) {
- }
}