diff --git a/app/build.gradle b/app/build.gradle index bd602943..9c9e85c4 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -64,7 +64,6 @@ dependencies { //noinspection GradleDependency implementation 'com.squareup.picasso:picasso:2.8' implementation 'jp.wasabeef:picasso-transformations:2.4.0' - implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.25' implementation 'com.github.QuadFlask:colorpicker:0.0.15' implementation 'com.github.nuclearfog:ZoomView:1.0.4' implementation 'com.github.nuclearfog:Tagger:2.4' diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro index 64479a92..1132152b 100644 --- a/app/proguard-rules.pro +++ b/app/proguard-rules.pro @@ -37,8 +37,6 @@ -dontwarn org.openjsse.net.ssl.OpenJSSE -keep,allowobfuscation, allowoptimization class org.openjsse.net.ssl.OpenJSSE {*;} --keep class pl.droidsonroids.gif.** {*;} - -dontwarn javax.annotation.Nullable -keepclassmembers class * implements android.os.Parcelable {*;} \ No newline at end of file diff --git a/app/src/main/assets/licenses.html b/app/src/main/assets/licenses.html index 42738ca0..d12bd8fd 100644 --- a/app/src/main/assets/licenses.html +++ b/app/src/main/assets/licenses.html @@ -181,40 +181,6 @@ limitations under the License. -

Notices for libraries:

- -
-            MIT License
-            Copyright (c) 2016 Karol Wrótniak,
-            Droids on Roids
-
-            Permission is hereby granted, free of charge,
-            to any person obtaining a copy of this software
-            and associated documentation files (the "Software"),
-            to deal in the Software without restriction,
-            including without limitation the rights
-            to use, copy, modify, merge, publish, distribute,
-            sublicense, and/or sell copies of the Software,
-            and to permit persons to whom the Software is
-            furnished to do so, subject to the following conditions:
-
-            The above copyright notice and this permission
-            notice shall be included in all copies or
-            substantial portions of the Software.
-
-            THE SOFTWARE IS PROVIDED "AS IS",
-            WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
-            INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-            FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-            IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
-            BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-            WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-            ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
-            OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-        
- \ No newline at end of file diff --git a/app/src/main/java/org/nuclearfog/twidda/ui/activities/ImageViewer.java b/app/src/main/java/org/nuclearfog/twidda/ui/activities/ImageViewer.java index 4c8c4e46..e914bc5f 100644 --- a/app/src/main/java/org/nuclearfog/twidda/ui/activities/ImageViewer.java +++ b/app/src/main/java/org/nuclearfog/twidda/ui/activities/ImageViewer.java @@ -21,11 +21,11 @@ import org.nuclearfog.twidda.backend.async.ImageLoader.ImageResult; import org.nuclearfog.twidda.backend.utils.AppStyles; import org.nuclearfog.twidda.backend.utils.ErrorHandler; import org.nuclearfog.twidda.config.GlobalSettings; +import org.nuclearfog.twidda.ui.views.AnimatedImageView; import org.nuclearfog.zoomview.ZoomView; import java.io.File; -import pl.droidsonroids.gif.GifImageView; /** * Activity to show online and local images @@ -63,7 +63,7 @@ public class ImageViewer extends MediaActivity implements AsyncCallback 0 && movie.width() > 0) { + scale = Math.min((float) getMeasuredHeight() / (float) movie.height(), (float) getMeasuredWidth() / (float) movie.width()); + scale = Math.min(scale, MAX_SCALE); + if (scale > 0.0) { + xOffset = ((float) getWidth() / scale - (float) movie.width()) / 2.0f; + yOffset = ((float) getHeight() / scale - (float) movie.height()) / 2.0f; + } + } + long now = System.currentTimeMillis(); + if (moviestart == 0) + moviestart = now; + // set relative time + movie.setTime((int) ((now - moviestart) % movie.duration())); + // scale, translate and draw canvas + if (scale != 0.0f) + canvas.scale(scale, scale); + movie.draw(canvas, xOffset, yOffset); + // trigger next drawing + invalidate(); + } else { + super.onDraw(canvas); + } + } +} \ No newline at end of file diff --git a/app/src/main/res/layout/page_image.xml b/app/src/main/res/layout/page_image.xml index 859f1ef6..a0b11db4 100644 --- a/app/src/main/res/layout/page_image.xml +++ b/app/src/main/res/layout/page_image.xml @@ -29,7 +29,7 @@ app:max_zoom_in="10.0" app:max_zoom_out="0.5" /> -