Skip to content

Commit

Permalink
Fixes #3281 Fixes #3282 Only show URL buttons for http/https uris (#3287
Browse files Browse the repository at this point in the history
)

* Only show URL buttons for http/https uris

* Also hide URL bar icons if in library
  • Loading branch information
keianhzo committed Apr 29, 2020
1 parent 76a4b30 commit 18270f0
Showing 1 changed file with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import android.text.SpannableString;
import android.text.style.ForegroundColorSpan;
import android.util.TypedValue;
import android.webkit.URLUtil;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
Expand Down Expand Up @@ -316,8 +317,8 @@ public void onChanged(Spannable aUrl) {
!isFocused.getValue().get() &&
!isLibraryVisible.getValue().get() &&
!UrlUtils.isContentFeed(getApplication(), aUrl.toString()) &&
!UrlUtils.isFileUri(aUrl.toString()) &&
!UrlUtils.isPrivateAboutPage(getApplication(), aUrl.toString()) &&
(URLUtil.isHttpUrl(aUrl.toString()) || URLUtil.isHttpsUrl(aUrl.toString())) &&
(
(SettingsStore.getInstance(getApplication()).getTrackingProtectionLevel() != ContentBlocking.EtpLevel.NONE) ||
isPopUpAvailable.getValue().get() ||
Expand All @@ -332,8 +333,9 @@ public void onChanged(Spannable aUrl) {
@Override
public void onChanged(ObservableBoolean o) {
isUrlBarIconsVisible.postValue(new ObservableBoolean(
isLoading.getValue().get() ||
isInsecureVisible.getValue().get()
!isLibraryVisible.getValue().get() &&
(isLoading.getValue().get() ||
isInsecureVisible.getValue().get())
));
}
};
Expand Down Expand Up @@ -389,10 +391,6 @@ public void setUrl(@Nullable Spannable url) {

String aURL = url.toString();

if (isLibraryVisible.getValue().get()) {
return;
}

int index = -1;
try {
aURL = URLDecoder.decode(aURL, "UTF-8");
Expand Down

0 comments on commit 18270f0

Please sign in to comment.