本文整理匯總了Java中pl.droidsonroids.gif.GifDrawable.stop方法的典型用法代碼示例。如果您正苦於以下問題:Java GifDrawable.stop方法的具體用法?Java GifDrawable.stop怎麽用?Java GifDrawable.stop使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類pl.droidsonroids.gif.GifDrawable
的用法示例。
在下文中一共展示了GifDrawable.stop方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: prepareGif
import pl.droidsonroids.gif.GifDrawable; //導入方法依賴的package包/類
/**
* Prepares gif image view before it's started.
*
* @param isPortrait Checks if device is in portrait view.
*/
private void prepareGif(final boolean isPortrait) {
mGifDrawable = (GifDrawable) mGifImage.getDrawable();
mGifDrawable.stop();
mGifDrawable.addAnimationListener(mGifAnimListener);
RelativeLayout.LayoutParams params =
(RelativeLayout.LayoutParams) mGifImageLayout.getLayoutParams();
int halfOfScreen;
//Change size of the gif image.
if(isPortrait) {
final int screenHeight = getResources().getDisplayMetrics().heightPixels;
halfOfScreen = screenHeight / 2;
params.height = halfOfScreen;
mGifImageLayout.setTranslationY(screenHeight);
} else {
final int screenWidth = getResources().getDisplayMetrics().widthPixels;
halfOfScreen = screenWidth / 2;
params.width = halfOfScreen;
mGifImageLayout.setTranslationX(screenWidth);
mGifImageLayout.setPadding(0, 0, 0, 0);
}
mGifImageLayout.setLayoutParams(params);
}
示例2: setGifAnim
import pl.droidsonroids.gif.GifDrawable; //導入方法依賴的package包/類
/**
* 設置gif動畫資源
*
* @param gifDrawable
*/
public void setGifAnim(GifDrawable gifDrawable)
{
gifImageView.setImageDrawable(gifDrawable);
// 停止自動播放
gifDrawable.stop();
}
示例3: 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();
}
示例4: 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();
}
示例5: 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();
}
示例6: 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();
}
示例7: stopGif
import pl.droidsonroids.gif.GifDrawable; //導入方法依賴的package包/類
public static void stopGif(GifImageView view) {
GifDrawable drawable = (GifDrawable) view.getDrawable();
if (drawable.isPlaying())
drawable.stop();
}