From d7dc65c7a644444f94581eceb9b364f61cf92f4e Mon Sep 17 00:00:00 2001 From: Mariotaku Lee Date: Mon, 29 Feb 2016 08:24:10 +0800 Subject: [PATCH] fixed #414 --- twidere/build.gradle | 2 +- twidere/src/main/AndroidManifest.xml | 4 ++ .../twidere/app/TwidereApplication.java | 2 +- .../twidere/util/ExternalThemeManager.java | 6 ++- .../droidsonroids/gif/GifSupportChecker.java | 37 ------------------- 5 files changed, 11 insertions(+), 40 deletions(-) delete mode 100644 twidere/src/main/java/pl/droidsonroids/gif/GifSupportChecker.java diff --git a/twidere/build.gradle b/twidere/build.gradle index 3a4c1cc24..d5eeb1a41 100644 --- a/twidere/build.gradle +++ b/twidere/build.gradle @@ -87,7 +87,7 @@ dependencies { compile 'com.commonsware.cwac:layouts:0.4.2' compile 'com.rengwuxian.materialedittext:library:2.1.4' compile 'com.pnikosis:materialish-progress:1.7' - compile 'pl.droidsonroids.gif:android-gif-drawable:1.1.7' +// compile 'pl.droidsonroids.gif:android-gif-drawable:1.1.7' compile 'com.github.johnpersano:supertoasts:1.3.4.1@aar' compile 'com.github.mariotaku:MessageBubbleView:1.2' compile 'com.github.mariotaku:DragSortListView:0.6.1' diff --git a/twidere/src/main/AndroidManifest.xml b/twidere/src/main/AndroidManifest.xml index 75f302b31..2f8f6d746 100644 --- a/twidere/src/main/AndroidManifest.xml +++ b/twidere/src/main/AndroidManifest.xml @@ -41,6 +41,10 @@ + + diff --git a/twidere/src/main/java/org/mariotaku/twidere/app/TwidereApplication.java b/twidere/src/main/java/org/mariotaku/twidere/app/TwidereApplication.java index d866d0ee4..ef4a94bfa 100644 --- a/twidere/src/main/java/org/mariotaku/twidere/app/TwidereApplication.java +++ b/twidere/src/main/java/org/mariotaku/twidere/app/TwidereApplication.java @@ -242,7 +242,7 @@ public class TwidereApplication extends MultiDexApplication implements Constants break; } case KEY_EMOJI_SUPPORT: { - DependencyHolder.get(this).getExternalThemeManager().initEmojiSupport(); + DependencyHolder.get(this).getExternalThemeManager().reloadEmojiPreferences(); break; } } diff --git a/twidere/src/main/java/org/mariotaku/twidere/util/ExternalThemeManager.java b/twidere/src/main/java/org/mariotaku/twidere/util/ExternalThemeManager.java index 43a1f6544..020ec99d7 100644 --- a/twidere/src/main/java/org/mariotaku/twidere/util/ExternalThemeManager.java +++ b/twidere/src/main/java/org/mariotaku/twidere/util/ExternalThemeManager.java @@ -62,14 +62,18 @@ public class ExternalThemeManager implements Constants { final ComponentName componentName = ComponentName.unflattenFromString(emojiComponentName); if (componentName != null) { emojiPackageName = componentName.getPackageName(); + } else { + emojiPackageName = null; } + } else { + emojiPackageName = null; } initEmojiSupport(); } public void initEmojiSupport() { if (emojiPackageName == null) { - emojiPackageName = null; + emoji = null; return; } emoji = new Emoji(application, emojiPackageName); diff --git a/twidere/src/main/java/pl/droidsonroids/gif/GifSupportChecker.java b/twidere/src/main/java/pl/droidsonroids/gif/GifSupportChecker.java deleted file mode 100644 index 09b4829bd..000000000 --- a/twidere/src/main/java/pl/droidsonroids/gif/GifSupportChecker.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Twidere - Twitter client for Android - * - * Copyright (C) 2012-2015 Mariotaku Lee - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -package pl.droidsonroids.gif; - -/** - * Created by mariotaku on 15/4/21. - */ -public class GifSupportChecker { - - public static boolean isSupported() { - try { - // Just make it trying to load native library - System.identityHashCode(GifInfoHandle.NULL_INFO); - } catch (Throwable t) { - return false; - } - return true; - } - -}