当前位置: 首页>>代码示例>>Java>>正文


Java GifDrawable.start方法代码示例

本文整理汇总了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();
    }
}
 
开发者ID:pili-engineering,项目名称:PLDroidShortVideo,代码行数:23,代码来源:ShowGIFActivity.java

示例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);
    }
}
 
开发者ID:rebane621,项目名称:e621-android,代码行数:25,代码来源:WebImageView.java

示例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);
}
 
开发者ID:yrom,项目名称:AcFun-Area63,代码行数:20,代码来源:ImagePagerActivity.java

示例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();
    }

}
 
开发者ID:MimiReader,项目名称:mimi-reader,代码行数:16,代码来源:GalleryGifFragment.java

示例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();
    }
}
 
开发者ID:peerless2012,项目名称:QingNianTuZhai,代码行数:16,代码来源:GifFragment.java

示例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();
  }
}
 
开发者ID:jaredrummler,项目名称:EasterEggs,代码行数:32,代码来源:GifEasterEgg.java

示例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();
}
 
开发者ID:luciofm,项目名称:qconrio,代码行数:9,代码来源:FeedbackFragment.java

示例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();
}
 
开发者ID:luciofm,项目名称:qconrio,代码行数:9,代码来源:TransitionsExampleFragment.java

示例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();
}
 
开发者ID:luciofm,项目名称:qconrio,代码行数:9,代码来源:AtentionFragment.java

示例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();
}
 
开发者ID:luciofm,项目名称:qconrio,代码行数:9,代码来源:ContextFragment.java

示例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();
    }
}
 
开发者ID:luciofm,项目名称:qconrio,代码行数:8,代码来源:Utils.java


注:本文中的pl.droidsonroids.gif.GifDrawable.start方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。