This commit is contained in:
tom79 2019-03-25 18:50:48 +01:00
parent 9d3c2583c3
commit cceace8e65
2 changed files with 26 additions and 23 deletions

View File

@ -560,7 +560,7 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
if( status.getPoll() != null && status.getPoll().getOptionsList() != null ){
Poll poll = status.getPoll();
int choiceCount = status.getPoll().getOptionsList().size();
if( poll.isVoted()){
if( poll.isVoted() || poll.isExpired()){
holder.rated.setVisibility(View.VISIBLE);
List<BarItem> items = new ArrayList<>();
int greaterValue = 0;

View File

@ -57,25 +57,9 @@ public class MastalabWebViewClient extends WebViewClient {
@Override
public WebResourceResponse shouldInterceptRequest (final WebView view, String url) {
URI uri;
try {
uri = new URI(url);
String domain = uri.getHost();
if( domain != null) {
domain = domain.startsWith("www.") ? domain.substring(4) : domain;
}
if (domain != null && WebviewActivity.trackingDomains.contains(domain)) {
if( activity instanceof WebviewActivity){
count++;
domains.add(url);
((WebviewActivity)activity).setCount(activity, String.valueOf(count));
}
ByteArrayInputStream nothing = new ByteArrayInputStream("".getBytes());
return new WebResourceResponse("text/plain", "utf-8", nothing);
}
} catch (URISyntaxException e) {
if( WebviewActivity.trackingDomains != null){
URI uri;
try {
url = url.substring(0,50);
uri = new URI(url);
String domain = uri.getHost();
if( domain != null) {
@ -89,11 +73,30 @@ public class MastalabWebViewClient extends WebViewClient {
}
ByteArrayInputStream nothing = new ByteArrayInputStream("".getBytes());
return new WebResourceResponse("text/plain", "utf-8", nothing);
}
} catch (URISyntaxException ignored) {
ignored.printStackTrace();
} }
} catch (URISyntaxException e) {
try {
url = url.substring(0, 50);
uri = new URI(url);
String domain = uri.getHost();
if (domain != null) {
domain = domain.startsWith("www.") ? domain.substring(4) : domain;
}
if (domain != null && WebviewActivity.trackingDomains.contains(domain)) {
if (activity instanceof WebviewActivity) {
count++;
domains.add(url);
((WebviewActivity) activity).setCount(activity, String.valueOf(count));
}
ByteArrayInputStream nothing = new ByteArrayInputStream("".getBytes());
return new WebResourceResponse("text/plain", "utf-8", nothing);
}
} catch (URISyntaxException ignored) {
ignored.printStackTrace();
}
}
}
return super.shouldInterceptRequest(view, url);
}