Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

URL bar polising #2140

Merged
merged 5 commits into from
Nov 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -326,8 +326,8 @@ public void setURL(String aURL) {
return;

} else if (aURL.startsWith("resource:") || mSession.isHomeUri(aURL)) {

aURL = "";

} else if (aURL.startsWith("data:") && mSession.isPrivateMode()) {
aURL = "";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -425,9 +425,15 @@ public void attachToWindow(@NonNull WindowWidget aWindow) {
mAttachedWindow.addWindowListener(this);
mAttachedWindow.setPopUpDelegate(mPopUpDelegate);

clearFocus();

if (getSession() != null) {
setUpSession(getSession());
}
handleWindowResize();

if (mAttachedWindow != null) {
mURLBar.setIsLibraryVisible(mAttachedWindow.isBookmarksVisible() || mAttachedWindow.isHistoryVisible());
mURLBar.setURL("");
if (mAttachedWindow.isBookmarksVisible()) {
mURLBar.setHint(R.string.url_bookmarks_title);
mURLBar.setIsLibraryVisible(true);
Expand All @@ -443,13 +449,6 @@ public void attachToWindow(@NonNull WindowWidget aWindow) {
}
mURLBar.setIsPopUpAvailable(mAttachedWindow.hasPendingPopUps());
}

clearFocus();

if (getSession() != null) {
setUpSession(getSession());
}
handleWindowResize();
}

private Session getSession() {
Expand Down
24 changes: 0 additions & 24 deletions app/src/main/res/drawable/url_bar_hint_fading_edge_end.xml

This file was deleted.

24 changes: 0 additions & 24 deletions app/src/main/res/drawable/url_bar_hint_fading_edge_end_private.xml

This file was deleted.

53 changes: 33 additions & 20 deletions app/src/main/res/drawable/url_bar_hint_fading_edge_private.xml
Original file line number Diff line number Diff line change
@@ -1,24 +1,37 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_enabled="true">
<shape>
<corners android:bottomRightRadius="20dp" android:topRightRadius="20dp" />
<gradient
android:type="linear"
android:angle="0"
android:startColor="#00000000"
android:endColor="@color/blackberry" />
</shape>
</item>
<item android:state_enabled="false">
<shape>
<corners android:bottomRightRadius="20dp" android:topRightRadius="20dp" />
<gradient
android:type="linear"
android:angle="0"
android:startColor="#00000000"
android:endColor="@color/eggplant" />
</shape>
</item>
<item android:state_focused="true">
<layer-list>
<item android:width="120dp">
<shape>
<gradient
android:startColor="#00000000"
android:endColor="@color/blackberry" />
<corners android:topRightRadius="20dp" android:bottomRightRadius="20dp"/>
</shape>
</item>
</layer-list>
</item>
<item android:state_focused="false">
<layer-list>
<item android:width="120dp">
<shape>
<gradient
android:startColor="@android:color/transparent"
android:endColor="@color/eggplant" />
<corners android:topRightRadius="20dp" android:bottomRightRadius="20dp"/>
</shape>
</item>
</layer-list>
</item>
<item>
<shape>
<gradient
android:type="linear"
android:angle="0"
android:startColor="#00000000"
android:endColor="@color/eggplant" />
</shape>
</item>
</selector>

9 changes: 5 additions & 4 deletions app/src/main/res/layout/navigation_url.xml
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
app:visibleGone="@{isPopUpAvailable}" />

<View
android:layout_width="10dp"
android:layout_width="15dp"
android:layout_height="match_parent"
app:visibleGone="@{!isPopUpAvailable}"/>
</LinearLayout>
Expand All @@ -154,6 +154,7 @@
android:id="@+id/loadingView"
android:layout_width="24dp"
android:layout_height="24dp"
android:paddingEnd="5dp"
android:contentDescription="Loading animation"
android:src="@drawable/loading_shape"
app:visibleGone="@{isLoading}" />
Expand All @@ -163,14 +164,14 @@
android:layout_height="24dp"
android:contentDescription="SSL icon"
android:src="@drawable/ic_icon_security_state_insecure"
app:visibleGone="@{isInsecure}" />
app:visibleGone="@{isInsecure &amp;&amp; (urlEditText.length() != 0)}" />
</LinearLayout>

</RelativeLayout>

<View
android:id="@+id/padding"
android:layout_width="10dp"
android:layout_width="15dp"
android:layout_height="match_parent"
android:layout_toEndOf="@id/iconsLayout"
app:visibleGone="@{isLibraryVisible}"/>
Expand All @@ -182,7 +183,7 @@
android:paddingEnd="10dp"
android:layout_toStartOf="@id/endButtonsLayout"
android:layout_toEndOf="@id/padding"
android:foreground="@{isUrlEmpty ? @drawable/url_bar_hint_fading_edge : null}"
android:foreground="@{isUrlEmpty ? (isPrivateMode ? @drawable/url_bar_hint_fading_edge_private : @drawable/url_bar_hint_fading_edge) : null}"
android:foregroundGravity="fill_vertical|right"
android:ems="10"
android:fadingEdgeLength="40dp"
Expand Down