Skip to content

Commit 270f8e1

Browse files
Merge pull request #1358 from khalid-nasralla/PAINTROID-803
PAINTROID-803 Use new media library for Import image tool
2 parents 05886b3 + 2d7eb39 commit 270f8e1

File tree

3 files changed

+2
-22
lines changed

3 files changed

+2
-22
lines changed

Paintroid/build.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,6 @@ android {
110110
signedRelease {
111111
initWith(release)
112112
signingConfig = signingConfigs.signedRelease
113-
114113
}
115114
debug { }
116115
}

Paintroid/src/main/java/org/catrobat/paintroid/common/Constants.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import java.io.File
2424
const val PAINTROID_PICTURE_PATH = "org.catrobat.extra.PAINTROID_PICTURE_PATH"
2525
const val PAINTROID_PICTURE_NAME = "org.catrobat.extra.PAINTROID_PICTURE_NAME"
2626
const val TEMP_PICTURE_NAME = "catroidTemp"
27-
const val MEDIA_GALLEY_URL = "https://share.catrob.at/pocketcode/media-library/looks"
27+
const val MEDIA_GALLEY_URL = "https://catrobat.org/figures-download/"
2828
const val ABOUT_DIALOG_FRAGMENT_TAG = "aboutdialogfragment"
2929
const val LIKE_US_DIALOG_FRAGMENT_TAG = "likeusdialogfragment"
3030
const val RATE_US_DIALOG_FRAGMENT_TAG = "rateusdialogfragment"

Paintroid/src/main/java/org/catrobat/paintroid/web/MediaGalleryWebViewClient.java

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
package org.catrobat.paintroid.web;
2424

2525
import android.graphics.Bitmap;
26-
import android.net.Uri;
2726
import android.view.View;
2827
import android.webkit.WebResourceError;
2928
import android.webkit.WebResourceRequest;
@@ -46,16 +45,9 @@ public MediaGalleryWebViewClient(WebClientCallback callback) {
4645
this.callback = callback;
4746
}
4847

49-
private static final String GALLERY_ROOT = "https://share.catrob.at/pocketcode/";
50-
5148
@Override
5249
public void onPageStarted(WebView view, String url, Bitmap favicon) {
53-
// avoid regex 'matches' – we only want a prefix check
54-
if (!startsWithGalleryRoot(url)) {
55-
showLoading(view);
56-
} else {
57-
callback.finish();
58-
}
50+
showLoading(view);
5951
}
6052

6153
@Override
@@ -92,17 +84,6 @@ public void onReceivedError(WebView view, int errorCode, String description, Str
9284
callback.finish();
9385
}
9486

95-
private boolean startsWithGalleryRoot(String url) {
96-
try {
97-
Uri u = Uri.parse(url);
98-
// normalize to compare robustly
99-
String normalized = u.getScheme() + "://" + u.getHost() + (u.getPort() != -1 ? ":" + u.getPort() : "") + u.getPath();
100-
return normalized.startsWith(GALLERY_ROOT);
101-
} catch (Exception ignored) {
102-
return false;
103-
}
104-
}
105-
10687
private void showLoading(View anchor) {
10788
if (loadingDialog != null) {
10889
return;

0 commit comments

Comments
 (0)