Skip to content
This repository has been archived by the owner on May 13, 2022. It is now read-only.

Commit

Permalink
Merge pull request #27 from digipost/bugfix-og-kvitteringer
Browse files Browse the repository at this point in the history
Bugfix og kvitteringer
  • Loading branch information
ftlno authored Apr 16, 2018
2 parents 3545d0e + a544f38 commit 662aba3
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 12 deletions.
6 changes: 3 additions & 3 deletions Digipost/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ apply plugin: 'com.android.application'

android {
defaultConfig {
versionCode 70
versionName '3.4.0'
versionCode 71
versionName '3.4.1'
applicationId = "no.digipost.android"
minSdkVersion 16
targetSdkVersion 25
Expand Down Expand Up @@ -63,7 +63,7 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:2.3.0'
classpath 'com.android.tools.build:gradle:2.3.2'
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,8 @@ private int getFolderIcon(CharSequence type) {
return R.drawable.trophy_32;
} else if (type.equals(context.getString(R.string.icon_box))) {
return R.drawable.archive_32;
} else if (type.equals(context.getString(R.string.icon_receipt))) {
return R.drawable.receipt_32;
} else if (type.equals(context.getString(R.string.icon_home))) {
return R.drawable.home_32;
} else if (type.equals(context.getString(R.string.icon_star))) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import android.content.Intent;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
Expand Down Expand Up @@ -88,20 +89,28 @@ private void setupWebView() {
webView.getSettings().setLoadWithOverviewMode(true);
webView.setWebViewClient(new WebViewClient() {
@Override
public void onLoadResource(WebView view, String url) {
if (content_type != ApplicationConstants.RECEIPTS && !url.equals(webView.getUrl())){
openExternalLink(url);
view.stopLoading();
}
public boolean shouldOverrideUrlLoading(WebView view, String url) {
overrideUrlLoading(url);
return content_type != ApplicationConstants.RECEIPTS || super.shouldOverrideUrlLoading(view, url);
}

@Override
public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) {
return content_type == ApplicationConstants.RECEIPTS || super.shouldOverrideUrlLoading(view, request);
if(android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
overrideUrlLoading(request.getUrl().toString());
}
return content_type != ApplicationConstants.RECEIPTS || super.shouldOverrideUrlLoading(view, request);
}
});
}

private void overrideUrlLoading(String url) {
if(url != null) {
openExternalLink(url);
this.webView.stopLoading();
}
}

private void openExternalLink(final String url) {
try {
String scheme = new URL(url).toURI().getScheme();
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions Digipost/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
<string name="icon_camera">CAMERA</string>
<string name="icon_money">MONEY</string>
<string name="icon_beer">BONUS</string>
<string name="icon_receipt">RECEIPT</string>
<!-- Misc -->
<string name="ok">Ok</string>
<string name="close">Lukk</string>
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.0'
classpath 'com.android.tools.build:gradle:2.3.2'
classpath 'com.google.gms:google-services:3.0.0'
}
}
Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Fri Jan 27 15:42:44 CET 2017
#Mon Apr 16 09:11:48 CEST 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip

0 comments on commit 662aba3

Please sign in to comment.