Backed out changeset 094e6802c2f4 (bug 1389269)
authorSebastian Hengst <archaeopteryx@coole-files.de>
Tue, 15 Aug 2017 18:30:08 +0200
changeset 374805 78e49684354331b02d3e425d2afcd757559bd7db
parent 374804 bec2a9eac2d9c7ec52543e5b77a6ee38c3f6879f
child 374806 2bbb1bd8335d0c49ac477e60e85a03029c8c6a17
push id93770
push userarchaeopteryx@coole-files.de
push dateTue, 15 Aug 2017 16:31:29 +0000
treeherdermozilla-inbound@4af3a98934c4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1389269
milestone57.0a1
backs out094e6802c2f440f74076374030268de13a806b22
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
Backed out changeset 094e6802c2f4 (bug 1389269)
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
@@ -45,16 +45,17 @@ 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 Uri mScope;
 
     @Override
     public void onCreate(Bundle savedInstanceState) {
         if ((getIntent().getFlags() & Intent.FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY) != 0 &&
@@ -67,30 +68,44 @@ public class WebAppActivity extends AppC
             savedInstanceState.setClassLoader(getClass().getClassLoader());
 
             Intent lastLaunchIntent = savedInstanceState.getParcelable(SAVED_INTENT);
             setIntent(lastLaunchIntent);
         }
 
         super.onCreate(savedInstanceState);
 
-        mGeckoView = new GeckoView(this);
+        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);
+
         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();
     }
@@ -266,16 +281,23 @@ 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) {