當前位置: 首頁>>代碼示例>>Java>>正文


Java GifDrawable.stop方法代碼示例

本文整理匯總了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);
}
 
開發者ID:Samsung,項目名稱:microbit,代碼行數:32,代碼來源:SplashScreenActivity.java

示例2: setGifAnim

import pl.droidsonroids.gif.GifDrawable; //導入方法依賴的package包/類
/**
 * 設置gif動畫資源
 * 
 * @param gifDrawable
 */
public void setGifAnim(GifDrawable gifDrawable)
{
	gifImageView.setImageDrawable(gifDrawable);
	// 停止自動播放
	gifDrawable.stop();
}
 
開發者ID:Revival-liangjialiang,項目名稱:ShoppingApp,代碼行數:12,代碼來源:GifHeadView.java

示例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();
}
 
開發者ID:luciofm,項目名稱:qconrio,代碼行數:9,代碼來源:FeedbackFragment.java

示例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();
}
 
開發者ID:luciofm,項目名稱:qconrio,代碼行數:9,代碼來源:TransitionsExampleFragment.java

示例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();
}
 
開發者ID:luciofm,項目名稱:qconrio,代碼行數:9,代碼來源:AtentionFragment.java

示例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();
}
 
開發者ID:luciofm,項目名稱:qconrio,代碼行數:9,代碼來源:ContextFragment.java

示例7: stopGif

import pl.droidsonroids.gif.GifDrawable; //導入方法依賴的package包/類
public static void stopGif(GifImageView view) {
    GifDrawable drawable = (GifDrawable) view.getDrawable();
    if (drawable.isPlaying())
        drawable.stop();
}
 
開發者ID:luciofm,項目名稱:qconrio,代碼行數:6,代碼來源:Utils.java


注:本文中的pl.droidsonroids.gif.GifDrawable.stop方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。