aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/pixart/messenger/ui/XmppActivity.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/de/pixart/messenger/ui/XmppActivity.java')
-rw-r--r--src/main/java/de/pixart/messenger/ui/XmppActivity.java14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/XmppActivity.java b/src/main/java/de/pixart/messenger/ui/XmppActivity.java
index 19319df18..65383c2aa 100644
--- a/src/main/java/de/pixart/messenger/ui/XmppActivity.java
+++ b/src/main/java/de/pixart/messenger/ui/XmppActivity.java
@@ -55,6 +55,7 @@ import android.widget.Toast;
import net.java.otr4j.session.SessionID;
+import java.io.File;
import java.io.IOException;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
@@ -87,6 +88,7 @@ import de.pixart.messenger.utils.MenuDoubleTabUtil;
import de.pixart.messenger.utils.ThemeHelper;
import de.pixart.messenger.xmpp.OnKeyStatusUpdated;
import de.pixart.messenger.xmpp.OnUpdateBlocklist;
+import pl.droidsonroids.gif.GifDrawable;
import rocks.xmpp.addr.Jid;
public abstract class XmppActivity extends ActionBarActivity {
@@ -441,7 +443,7 @@ public abstract class XmppActivity extends ActionBarActivity {
return getBooleanPreference("display_enter_key", R.bool.display_enter_key);
}
- protected SharedPreferences getPreferences() {
+ public SharedPreferences getPreferences() {
return PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
}
@@ -1083,6 +1085,16 @@ public abstract class XmppActivity extends ActionBarActivity {
return xmppConnectionService.getAvatarService();
}
+ public void loadGif(File file, ImageView imageView) {
+ GifDrawable gifDrawable = null;
+ try {
+ gifDrawable = new GifDrawable(file);
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ imageView.setImageDrawable(gifDrawable);
+ }
+
public void loadBitmap(Message message, ImageView imageView) {
Bitmap bm;
try {