本文整理汇总了Java中pl.droidsonroids.gif.GifDrawable.start方法的典型用法代码示例。如果您正苦于以下问题:Java GifDrawable.start方法的具体用法?Java GifDrawable.start怎么用?Java GifDrawable.start使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pl.droidsonroids.gif.GifDrawable
的用法示例。
在下文中一共展示了GifDrawable.start方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreate
import pl.droidsonroids.gif.GifDrawable; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_show_gif);
if (getSupportActionBar() != null) {
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setDisplayShowHomeEnabled(false);
}
setTitle(R.string.title_show_gif);
mGifImageView = (GifImageView) findViewById(R.id.gif_image_view);
try {
GifDrawable drawable = new GifDrawable(Config.GIF_SAVE_PATH);
drawable.start();
drawable.setLoopCount(10);
mGifImageView.setBackground(drawable);
} catch (IOException e) {
e.printStackTrace();
}
}
示例2: onPostExecute
import pl.droidsonroids.gif.GifDrawable; //导入方法依赖的package包/类
@Override
protected void onPostExecute(Drawable result) {
if (result != null) {
if (sUseCache) {
Logger.getLogger("a621").info("Storing " + iid + "...");
WebImageView.webImageCache.put(iid, result);
WebImageView.webImageUsage.put(iid, System.currentTimeMillis()/1000);
}
WebImageView.this.setImageDrawable(result);
if (gif && cacheDir != null) { //if cachedir is null we can't have a gif at hand, see code above
GifDrawable rr = (GifDrawable) result;
rr.setLoopCount(0);
rr.start();
}
//WebImageView.this.postInvalidate();
updateDisplay();
if (reqIids.contains(iid)) reqIids.remove(iid);
if (wil != null) wil.onImageLoaded();
} else {
Logger.getLogger("a621").info("Could not download " + iid);
}
}
示例3: loadImage
import pl.droidsonroids.gif.GifDrawable; //导入方法依赖的package包/类
private void loadImage(String path) {
if(path.endsWith(".gif")){
try {
GifDrawable drawable = new GifDrawable(path);
imageView.setImageDrawable(drawable);
drawable.start();
} catch (IOException e) {
e.printStackTrace();
}
}
if(imageView.getDrawable() == null){
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.GINGERBREAD_MR1){
usingTileBitmap(path);
}else{
imageView.setImageDrawable(Drawable.createFromPath(path));
}
}
imageView.setOnClickListener(clicked);
}
示例4: scaleBitmap
import pl.droidsonroids.gif.GifDrawable; //导入方法依赖的package包/类
@Override
public void scaleBitmap(final ImageDisplayedListener listener) {
if (gifImageView.getDrawable() instanceof GifDrawable) {
GifDrawable drawable = (GifDrawable) gifImageView.getDrawable();
drawable.pause();
if (listener != null) {
final WeakReference<Bitmap> weakBitmap = new WeakReference<>(drawable.seekToPositionAndGet(0));
listener.onImageDisplayed(null, weakBitmap.get());
}
drawable.start();
}
}
示例5: displayImgs
import pl.droidsonroids.gif.GifDrawable; //导入方法依赖的package包/类
private void displayImgs(String path){
try {
gifDrawable = new GifDrawable(path);
gifImageView.setImageDrawable(gifDrawable);
gifDrawable.addAnimationListener(new AnimationListener() {
@Override
public void onAnimationCompleted() {
gifDrawable.start();
}
});
gifDrawable.start();
}catch (Exception e){
e.printStackTrace();
}
}
示例6: onCreate
import pl.droidsonroids.gif.GifDrawable; //导入方法依赖的package包/类
@SuppressLint("InlinedApi")
@Override protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
FrameLayout layout = new FrameLayout(this);
layout.setLayoutParams(new FrameLayout.LayoutParams(MATCH_PARENT, MATCH_PARENT));
ImageView imageView = new ImageView(this);
FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(WRAP_CONTENT, WRAP_CONTENT);
params.gravity = Gravity.CENTER;
layout.addView(imageView, params);
setContentView(layout);
layout.setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
| SYSTEM_UI_FLAG_IMMERSIVE_STICKY);
try {
int drawableId = getIntent().getIntExtra(EXTRA_GIF, R.drawable.easteregg);
GifDrawable gifDrawable = new GifDrawable(getResources(), drawableId);
Bitmap bitmap = gifDrawable.seekToFrameAndGet(0);
int color = bitmap.getPixel(0, 0);
layout.setBackgroundColor(color);
imageView.setImageDrawable(gifDrawable);
gifDrawable.start();
} catch (Exception e) {
Toast.makeText(getApplicationContext(), "¯\\_| ✖ 〜 ✖ |_/¯", Toast.LENGTH_LONG).show();
finish();
}
}
示例7: onClick
import pl.droidsonroids.gif.GifDrawable; //导入方法依赖的package包/类
@Override
public void onClick(View v) {
GifDrawable drawable = (GifDrawable) ((GifImageView) v).getDrawable();
if (drawable.isPlaying())
drawable.stop();
else
drawable.start();
}
示例8: onGifClick
import pl.droidsonroids.gif.GifDrawable; //导入方法依赖的package包/类
@OnClick({R.id.gif1, R.id.gif2})
public void onGifClick(GifImageView view) {
GifDrawable drawable = (GifDrawable) view.getDrawable();
if (drawable.isPlaying())
drawable.stop();
else
drawable.start();
}
示例9: onGifClick
import pl.droidsonroids.gif.GifDrawable; //导入方法依赖的package包/类
@OnClick({R.id.gif1, R.id.gif2, R.id.gif3})
public void onGifClick(GifImageView view) {
GifDrawable drawable = (GifDrawable) view.getDrawable();
if (drawable.isPlaying())
drawable.stop();
else
drawable.start();
}
示例10: onGifClick
import pl.droidsonroids.gif.GifDrawable; //导入方法依赖的package包/类
@OnClick(R.id.gif1)
public void onGifClick(GifImageView view) {
GifDrawable drawable = (GifDrawable) view.getDrawable();
if (drawable.isPlaying())
drawable.stop();
else
drawable.start();
}
示例11: startGif
import pl.droidsonroids.gif.GifDrawable; //导入方法依赖的package包/类
public static void startGif(GifImageView view) {
GifDrawable drawable = (GifDrawable) view.getDrawable();
if (!drawable.isPlaying()) {
drawable.reset();
drawable.start();
}
}