Bug 1389269 - Clean up the UI layout for standalone webapps r=droeh
authorJames Willcox <snorp@snorp.net>
Thu, 10 Aug 2017 16:23:59 -0500
changeset 376112 270fefa0da6dc725db6abbc0000c647079d29bd2
parent 376111 5bb774244a1b337e44695c8a27148a04f6c20978
child 376113 26e3e0c5155245fe0acb0ff6c320e85563c6a4d6
push id94028
push userjwillcox@mozilla.com
push dateTue, 22 Aug 2017 14:10:00 +0000
treeherdermozilla-inbound@e938141097b5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdroeh
bugs1389269
milestone57.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1389269 - Clean up the UI layout for standalone webapps r=droeh MozReview-Commit-ID: 7NikFByIH7B
mobile/android/base/java/org/mozilla/gecko/webapps/WebAppActivity.java
--- a/mobile/android/base/java/org/mozilla/gecko/webapps/WebAppActivity.java
+++ b/mobile/android/base/java/org/mozilla/gecko/webapps/WebAppActivity.java
@@ -48,17 +48,16 @@ import org.mozilla.gecko.util.FileUtils;
 
 public class WebAppActivity extends AppCompatActivity
                             implements GeckoView.NavigationListener {
     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 DoorHangerPopup mDoorHangerPopup;
 
     private Uri mScope;
 
     @Override
     public void onCreate(Bundle savedInstanceState) {
@@ -72,45 +71,31 @@ 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 = new GeckoView(this);
         mGeckoView.setNavigationListener(this);
-
         mPromptService = new PromptService(this, mGeckoView.getEventDispatcher());
         mDoorHangerPopup = new DoorHangerPopup(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() {
         mDoorHangerPopup.destroy();
         mPromptService.destroy();
 
@@ -294,23 +279,16 @@ public class WebAppActivity extends AppC
         }
 
         return true;
     }
 
     /* 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) {