Bug 1358089 - [RTL] Separate xml drawable into v17 folder, r=sebastian,ahunt draft
authormaliu <max@mxli.us>
Mon, 24 Apr 2017 01:16:11 +0800
changeset 567534 1ae493637c5c81e1e908d42f5fc8eb7a5b5f1c82
parent 566789 8e969cc9aff49f845678cba5b35d9dd8aa340f16
child 625689 74872ec29b0a466a33dbe776d58381fc86edf77c
push id55615
push userbmo:max@mxli.us
push dateTue, 25 Apr 2017 07:39:07 +0000
reviewerssebastian, ahunt
bugs1358089
milestone55.0a1
Bug 1358089 - [RTL] Separate xml drawable into v17 folder, r=sebastian,ahunt MozReview-Commit-ID: LaOwxXwhsHA
mobile/android/base/java/org/mozilla/gecko/toolbar/BrowserToolbar.java
mobile/android/base/java/org/mozilla/gecko/toolbar/ToolbarEditLayout.java
mobile/android/base/resources/drawable-ldrtl-v17/url_bar_translating_edge.xml
mobile/android/base/resources/drawable-v17/url_bar_translating_edge.xml
mobile/android/base/resources/drawable/url_bar_translating_edge.xml
--- a/mobile/android/base/java/org/mozilla/gecko/toolbar/BrowserToolbar.java
+++ b/mobile/android/base/java/org/mozilla/gecko/toolbar/BrowserToolbar.java
@@ -362,16 +362,17 @@ public abstract class BrowserToolbar ext
 
     public void setTabHistoryController(TabHistoryController tabHistoryController) {
         this.tabHistoryController = tabHistoryController;
     }
 
     public void refresh() {
         progressBar.setImageDrawable(getResources().getDrawable(R.drawable.progress));
         urlDisplayLayout.dismissSiteIdentityPopup();
+        urlEditLayout.refresh();
     }
 
     public boolean onBackPressed() {
         // If we exit editing mode during the animation,
         // we're put into an inconsistent state (bug 1017276).
         if (isEditing() && !isAnimating()) {
             Telemetry.sendUIEvent(TelemetryContract.Event.CANCEL,
                                   TelemetryContract.Method.BACK);
--- a/mobile/android/base/java/org/mozilla/gecko/toolbar/ToolbarEditLayout.java
+++ b/mobile/android/base/java/org/mozilla/gecko/toolbar/ToolbarEditLayout.java
@@ -198,16 +198,20 @@ public class ToolbarEditLayout extends T
         // Checking if qr code is supported after resuming the app
         if (qrCodeIsEnabled(getContext())) {
             mQrCode.setVisibility(View.VISIBLE);
         } else {
             mQrCode.setVisibility(View.GONE);
         }
     }
 
+    public void refresh() {
+        mEditText.setHint(getResources().getString(R.string.url_bar_default_text));
+    }
+
     void setToolbarPrefs(final ToolbarPrefs prefs) {
         mEditText.setToolbarPrefs(prefs);
     }
 
     private void showSoftInput() {
         InputMethodManager imm =
                (InputMethodManager) getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
         imm.showSoftInput(mEditText, InputMethodManager.SHOW_IMPLICIT);
deleted file mode 100644
--- a/mobile/android/base/resources/drawable-ldrtl-v17/url_bar_translating_edge.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- This Source Code Form is subject to the terms of the Mozilla Public
-   - License, v. 2.0. If a copy of the MPL was not distributed with this
-   - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
-
-<clip xmlns:android="http://schemas.android.com/apk/res/android"
-      android:drawable="@drawable/url_bar_entry"
-      android:clipOrientation="horizontal"
-      android:gravity="left"/>
\ No newline at end of file
new file mode 100644
--- /dev/null
+++ b/mobile/android/base/resources/drawable-v17/url_bar_translating_edge.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+   - License, v. 2.0. If a copy of the MPL was not distributed with this
+   - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
+
+<clip xmlns:android="http://schemas.android.com/apk/res/android"
+      android:drawable="@drawable/url_bar_entry"
+      android:clipOrientation="horizontal"
+      android:gravity="end"/>
\ No newline at end of file
--- a/mobile/android/base/resources/drawable/url_bar_translating_edge.xml
+++ b/mobile/android/base/resources/drawable/url_bar_translating_edge.xml
@@ -1,9 +1,9 @@
 <?xml version="1.0" encoding="utf-8"?>
 <!-- This Source Code Form is subject to the terms of the Mozilla Public
    - License, v. 2.0. If a copy of the MPL was not distributed with this
    - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
 
 <clip xmlns:android="http://schemas.android.com/apk/res/android"
       android:drawable="@drawable/url_bar_entry"
       android:clipOrientation="horizontal"
-      android:gravity="right|end"/>
\ No newline at end of file
+      android:gravity="right"/>
\ No newline at end of file