• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java AnimatedVectorDrawableCompat类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中android.support.graphics.drawable.AnimatedVectorDrawableCompat的典型用法代码示例。如果您正苦于以下问题:Java AnimatedVectorDrawableCompat类的具体用法?Java AnimatedVectorDrawableCompat怎么用?Java AnimatedVectorDrawableCompat使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



AnimatedVectorDrawableCompat类属于android.support.graphics.drawable包,在下文中一共展示了AnimatedVectorDrawableCompat类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: invalidateAllKeys

import android.support.graphics.drawable.AnimatedVectorDrawableCompat; //导入依赖的package包/类
@Override
public void invalidateAllKeys() {
    if (getKeyboard() != null) {
        boolean isDark = ColorUtils.isColorDark(color);
        for (Keyboard.Key key : getKeyboard().getKeys()) {
            if (key.label != null) {
                key.icon = new TextDrawable(getContext(), getShiftedLabel(key.label.toString()), isDark ? Color.WHITE : Color.BLACK);
                key.label = null;
            } else if (key.icon != null) {
                if (key.icon instanceof TextDrawable) {
                    key.icon = new TextDrawable(getContext(), getShiftedLabel(((TextDrawable) key.icon).getText()), isDark ? Color.WHITE : Color.BLACK);
                } else {
                    DrawableCompat.setTint(key.icon, isDark ? Color.WHITE : Color.BLACK);
                    if (key.icon instanceof AnimatedVectorDrawableCompat)
                        ((AnimatedVectorDrawableCompat) key.icon).start();
                }
            }
        }
    }

    super.invalidateAllKeys();
}
 
开发者ID:DoubleDotLabs,项目名称:Butterboard,代码行数:23,代码来源:ButteryKeyboardView.java


示例2: onOptionsItemSelected

import android.support.graphics.drawable.AnimatedVectorDrawableCompat; //导入依赖的package包/类
@Override
public boolean onOptionsItemSelected(MenuItem item) {
    int id = item.getItemId();

    if (id == R.id.action_list_to_grid) {
        if (!((Animatable) item.getIcon()).isRunning()) {
            if (gridLayoutManager.getSpanCount() == 1) {
                item.setIcon(AnimatedVectorDrawableCompat.create(MainActivity.this, R.drawable.avd_list_to_grid));
                gridLayoutManager.setSpanCount(3);
            } else {
                item.setIcon(AnimatedVectorDrawableCompat.create(MainActivity.this, R.drawable.avd_grid_to_list));
                gridLayoutManager.setSpanCount(1);
            }
            ((Animatable) item.getIcon()).start();
            simpleAdapter.notifyItemRangeChanged(0, simpleAdapter.getItemCount());
        }
        return true;
    }

    return super.onOptionsItemSelected(item);
}
 
开发者ID:adonixis,项目名称:android-list-to-grid,代码行数:22,代码来源:MainActivity.java


示例3: onCreateView

import android.support.graphics.drawable.AnimatedVectorDrawableCompat; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    // Inflate the layout for this fragment
    View view =  inflater.inflate(R.layout.fragment_life_grid, container, false);
    worldGridLayout = (LifeGridLayout)view.findViewById(R.id.life_grid_layout);
    worldGridLayout.setCallback(this);
    listener = new ViewTreeObserver.OnGlobalLayoutListener() {
        @Override
        public void onGlobalLayout() {
            setUpGrid();
        }
    };
    //wait until layout is drawn before running setup calculations on its measurements
    worldGridLayout.getViewTreeObserver().addOnGlobalLayoutListener(listener);
    ImageView touchIcon = (ImageView)view.findViewById(R.id.touch_icon);
    AnimatedVectorDrawableCompat touchAnimation = AnimatedVectorDrawableCompat.create(getContext(), R.drawable.hand_animated_vector);
    touchIcon.setImageDrawable(touchAnimation);
    touchAnimation.start();
    return view;
}
 
开发者ID:lewismcgeary,项目名称:AndroidGameofLife,代码行数:22,代码来源:LifeGridFragment.java


示例4: initialiseButton

import android.support.graphics.drawable.AnimatedVectorDrawableCompat; //导入依赖的package包/类
private void initialiseButton(){
    startResetFab = (FloatingActionButton)findViewById(R.id.start_reset_fab);
    startButtonText = getString(R.string.start_button_text);
    resetButtonText = getString(R.string.reset_button_text);
    playIcon = AnimatedVectorDrawableCompat.create(this, R.drawable.fab_animated_vector_reset_to_play);
    resetIcon = AnimatedVectorDrawableCompat.create(this, R.drawable.fab_animated_vector_play_to_reset);
    startResetFab.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            if (startResetFab.getTag().equals(startButtonText)) {
                lifeGridFragment.worldGridPresenter.passLiveCellsToModelAndStartGame();
            } else {
                showButtonInStartMode();
                lifeGridFragment.worldGridPresenter.resetGrid();
            }
        }
    });
    showButtonInStartMode();
}
 
开发者ID:lewismcgeary,项目名称:AndroidGameofLife,代码行数:20,代码来源:MainActivity.java


示例5: setState

import android.support.graphics.drawable.AnimatedVectorDrawableCompat; //导入依赖的package包/类
public void setState(State state, boolean animate) {
  if (state == this.state) return;

  @DrawableRes int resId = getDrawable(this.state, state, animate);
  if (resId == 0) {
    setImageDrawable(null);
  } else {
    Drawable icon = null;
    if (animate) {
      icon = AnimatedVectorDrawableCompat.create(getContext(), resId);
    }
    if (icon == null) {
      icon = VectorDrawableCompat.create(getResources(), resId, getContext().getTheme());
    }
    setImageDrawable(icon);

    if (icon instanceof Animatable) {
      ((Animatable) icon).start();
    }
  }

  this.state = state;
}
 
开发者ID:mattprecious,项目名称:swirl,代码行数:24,代码来源:SwirlView.java


示例6: onClick

import android.support.graphics.drawable.AnimatedVectorDrawableCompat; //导入依赖的package包/类
@OnClick(android.R.id.content)
public void onClick() {
    AnimatedVectorDrawableCompat animatable = setDrawable();
    if(!animatable.isRunning()) {
        animatable.start();
    }
    animateForward = !animateForward;
}
 
开发者ID:zawadz88,项目名称:AnimationShowcase,代码行数:9,代码来源:AnimatedVectorDrawableActivity.java


示例7: setDrawable

import android.support.graphics.drawable.AnimatedVectorDrawableCompat; //导入依赖的package包/类
private AnimatedVectorDrawableCompat setDrawable() {
    int resId = animateForward
            ? R.drawable.avd_checkable_expandcollapse_expanded_to_collapsed
            : R.drawable.avd_checkable_expandcollapse_collapsed_to_expanded;
    AnimatedVectorDrawableCompat animatable = AnimatedVectorDrawableCompat.create(this, resId);
    icon.setImageDrawable(animatable);
    return animatable;
}
 
开发者ID:zawadz88,项目名称:AnimationShowcase,代码行数:9,代码来源:AnimatedVectorDrawableActivity.java


示例8: createFromXmlInner

import android.support.graphics.drawable.AnimatedVectorDrawableCompat; //导入依赖的package包/类
public Drawable createFromXmlInner(@NonNull Context context, @NonNull XmlPullParser parser, @NonNull AttributeSet attrs, @Nullable Theme theme) {
    try {
        return AnimatedVectorDrawableCompat.createFromXmlInner(context, context.getResources(), parser, attrs, theme);
    } catch (Exception e) {
        Log.e("AvdcInflateDelegate", "Exception while inflating <animated-vector>", e);
        return null;
    }
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:9,代码来源:AppCompatDrawableManager.java


示例9: onCreate

import android.support.graphics.drawable.AnimatedVectorDrawableCompat; //导入依赖的package包/类
@SuppressLint("RestrictedApi")
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.fingerprint_isloated);
    final AppCompatImageView fingerprintIsolated = findViewById(R.id.fingerprint_animator);
    mFingerprintAnimator = new LoopAnimatedVectorDrawableCompat(AnimatedVectorDrawableCompat.create(this,
            R.drawable.enrollment_fingerprint_isolated_animation));

    fingerprintIsolated.setBackgroundDrawable(AppCompatResources.getDrawable(FingerprintIsloatedActivity.this
            , top.trumeet.snippet.aospanimation.library.R.drawable.fp_illustration_enrollment));
    fingerprintIsolated.setSupportBackgroundTintList(ColorStateList.valueOf(getResources().getColor(top.trumeet.snippet.aospanimation.library.R.color.fingerprint_indicator_background_resting)));

    CheckBox showBackground = findViewById(R.id.check_show_background);
    showBackground.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
        @Override
        public void onCheckedChanged(CompoundButton compoundButton, boolean b) {
            if (b) {
                fingerprintIsolated.setBackgroundDrawable(AppCompatResources.getDrawable(FingerprintIsloatedActivity.this
                        , top.trumeet.snippet.aospanimation.library.R.drawable.fp_illustration_enrollment));
                fingerprintIsolated.setSupportBackgroundTintList(ColorStateList.valueOf(getResources().getColor(top.trumeet.snippet.aospanimation.library.R.color.fingerprint_indicator_background_resting)));
            } else {
                fingerprintIsolated.setBackgroundDrawable(null);
            }
        }
    });

    fingerprintIsolated.setImageDrawable(mFingerprintAnimator.getDrawable());
}
 
开发者ID:Trumeet,项目名称:Animations,代码行数:30,代码来源:FingerprintIsloatedActivity.java


示例10: handleMessage

import android.support.graphics.drawable.AnimatedVectorDrawableCompat; //导入依赖的package包/类
@Override
public void handleMessage(Message msg) {
    super.handleMessage(msg);
    switch (msg.what) {
        case MESSAGE_ANIMATION_START:
            final Drawable drawable = iconMenu.getDrawable();
            if (drawable instanceof AnimatedVectorDrawableCompat) {
                ((AnimatedVectorDrawableCompat) iconMenu.getDrawable()).start();
                sendEmptyMessageDelayed(MESSAGE_ANIMATION_START, 5000);
            }
            break;
    }
}
 
开发者ID:florent37,项目名称:AwesomeBar,代码行数:14,代码来源:AwesomeBar.java


示例11: createFromXmlInner

import android.support.graphics.drawable.AnimatedVectorDrawableCompat; //导入依赖的package包/类
@SuppressLint("NewApi")
@Override
public Drawable createFromXmlInner(@NonNull Context context, @NonNull XmlPullParser parser,
                                   @NonNull AttributeSet attrs, @Nullable Resources.Theme theme) {
    try {
        return AnimatedVectorDrawableCompat
                .createFromXmlInner(context, context.getResources(), parser, attrs, theme);
    } catch (Exception e) {
        Log.e("AvdcInflateDelegate", "Exception while inflating <animated-vector>", e);
        return null;
    }
}
 
开发者ID:ximsfei,项目名称:Android-skin-support,代码行数:13,代码来源:SkinCompatDrawableManager.java


示例12: RecordsAdapter

import android.support.graphics.drawable.AnimatedVectorDrawableCompat; //导入依赖的package包/类
RecordsAdapter(RecordsActivity activity, Podcast podcast, List<Record> records) {
    this.activity = activity;
    this.podcast = podcast;
    this.records = records;
    footerMode = FooterMode.HIDDEN;
    setHasStableIds(true);

    months = activity.getString(R.string.months).split(",");

    equalizerDrawable = AnimatedVectorDrawableCompat.create(activity, R.drawable.record_equalizer_animated);
}
 
开发者ID:kalikov,项目名称:lighthouse,代码行数:12,代码来源:RecordsAdapter.java


示例13: PodcastsAdapter

import android.support.graphics.drawable.AnimatedVectorDrawableCompat; //导入依赖的package包/类
PodcastsAdapter(LighthouseActivity activity, List<Podcast> podcasts) {
    this.activity = activity;
    this.podcasts = podcasts;

    int size = activity.getResources().getDimensionPixelSize(R.dimen.podcast_icon_size);
    Drawable micResourceDrawable = ResourcesCompat.getDrawable(activity.getResources(), R.drawable.mic, activity.getTheme());
    Bitmap micBitmap = createBitmap(micResourceDrawable, size);
    micDrawable = RoundedBitmapDrawableFactory.create(activity.getResources(), micBitmap);
    micDrawable.setCircular(true);

    equalizerDrawable = AnimatedVectorDrawableCompat.create(activity, R.drawable.equalizer_animated);
}
 
开发者ID:kalikov,项目名称:lighthouse,代码行数:13,代码来源:PodcastsAdapter.java


示例14: instantiateAnimatedVectorDrawables

import android.support.graphics.drawable.AnimatedVectorDrawableCompat; //导入依赖的package包/类
private void instantiateAnimatedVectorDrawables() {
    mAvdAlphaScale = AnimatedVectorDrawableCompat.create(this, R.drawable.avd_alpha_scale);
    mAvdAlphaScaleReverse = AnimatedVectorDrawableCompat.create(this, R.drawable.avd_alpha_scale_reverse);
    mAvdRotate = AnimatedVectorDrawableCompat.create(this, R.drawable.avd_rotate);
    mAvdTranslate = AnimatedVectorDrawableCompat.create(this, R.drawable.avd_translate);
    mAvdColor = AnimatedVectorDrawableCompat.create(this, R.drawable.avd_color);
    mAvdColorReverse = AnimatedVectorDrawableCompat.create(this, R.drawable.avd_color_reverse);
    mAvdTrimPath = AnimatedVectorDrawableCompat.create(this, R.drawable.avd_trim_path);
    mAvdTrimPathReverse = AnimatedVectorDrawableCompat.create(this, R.drawable.avd_trim_path_reverse);
    mAvdMorph = AnimatedVectorDrawableCompat.create(this, R.drawable.avd_morph);
    mAvdMorphReverse = AnimatedVectorDrawableCompat.create(this, R.drawable.avd_morph_reverse);
}
 
开发者ID:nicholasrout,项目名称:android-animated-vectors,代码行数:13,代码来源:MainActivity.java


示例15: ViewHolder

import android.support.graphics.drawable.AnimatedVectorDrawableCompat; //导入依赖的package包/类
public ViewHolder(View itemView, final ClickListener listener, final List<TorrentStateParcel> states)
{
    super(itemView);

    this.context = itemView.getContext();
    this.listener = listener;
    this.states = states;
    itemView.setOnClickListener(this);
    itemView.setOnLongClickListener(this);

    playToPauseAnim = AnimatedVectorDrawableCompat.create(context, R.drawable.play_to_pause);
    pauseToPlayAnim = AnimatedVectorDrawableCompat.create(context, R.drawable.pause_to_play);
    itemTorrentList = itemView.findViewById(R.id.item_torrent_list);
    name = itemView.findViewById(R.id.torrent_name);
    pauseButton = itemView.findViewById(R.id.pause_torrent);
    pauseButton.setOnClickListener(new View.OnClickListener()
    {
        @Override
        public void onClick(View v)
        {
            int position = getAdapterPosition();
            if (listener != null && position >= 0) {
                TorrentStateParcel state = states.get(position);
                listener.onPauseButtonClicked(position, state);
            }
        }
    });
    progress = itemView.findViewById(R.id.torrent_progress);
    Utils.colorizeProgressBar(context, progress);
    state = itemView.findViewById(R.id.torrent_status);
    downloadCounter = itemView.findViewById(R.id.torrent_download_counter);
    downloadUploadSpeed = itemView.findViewById(R.id.torrent_download_upload_speed);
    ETA = itemView.findViewById(R.id.torrent_ETA);
    indicatorCurOpenTorrent = itemView.findViewById(R.id.indicator_cur_open_torrent);
}
 
开发者ID:proninyaroslav,项目名称:libretorrent,代码行数:36,代码来源:TorrentListAdapter.java


示例16: setPauseButtonState

import android.support.graphics.drawable.AnimatedVectorDrawableCompat; //导入依赖的package包/类
void setPauseButtonState(boolean isPause)
{
    AnimatedVectorDrawableCompat prevAnim = currAnim;
    currAnim = (isPause ? pauseToPlayAnim : playToPauseAnim);
    pauseButton.setImageDrawable(currAnim);
    if (currAnim != prevAnim)
        currAnim.start();
}
 
开发者ID:proninyaroslav,项目名称:libretorrent,代码行数:9,代码来源:TorrentListAdapter.java


示例17: addArcAnimation

import android.support.graphics.drawable.AnimatedVectorDrawableCompat; //导入依赖的package包/类
/**
 * Add arc above/below the circular target overlay.
 */
private void addArcAnimation(final Activity activity) {
    AppCompatImageView mImageView = new AppCompatImageView(activity);
    mImageView.setImageResource(R.drawable.ic_spotlight_arc);
    LayoutParams params = new LayoutParams(2 * (circleShape.getRadius() + extraPaddingForArc),
            2 * (circleShape.getRadius() + extraPaddingForArc));


    if (targetView.getPoint().y > getHeight() / 2) {//bottom
        if (targetView.getPoint().x > getWidth() / 2) {//Right
            params.rightMargin = getWidth() - targetView.getPoint().x - circleShape.getRadius() - extraPaddingForArc;
            params.bottomMargin = getHeight() - targetView.getPoint().y - circleShape.getRadius() - extraPaddingForArc;
            params.gravity = Gravity.RIGHT | Gravity.BOTTOM;
        } else {
            params.leftMargin = targetView.getPoint().x - circleShape.getRadius() - extraPaddingForArc;
            params.bottomMargin = getHeight() - targetView.getPoint().y - circleShape.getRadius() - extraPaddingForArc;
            params.gravity = Gravity.LEFT | Gravity.BOTTOM;
        }
    } else {//up
        mImageView.setRotation(180); //Reverse the view
        if (targetView.getPoint().x > getWidth() / 2) {//Right
            params.rightMargin = getWidth() - targetView.getPoint().x - circleShape.getRadius() - extraPaddingForArc;
            params.bottomMargin = getHeight() - targetView.getPoint().y - circleShape.getRadius() - extraPaddingForArc;
            params.gravity = Gravity.RIGHT | Gravity.BOTTOM;
        } else {
            params.leftMargin = targetView.getPoint().x - circleShape.getRadius() - extraPaddingForArc;
            params.bottomMargin = getHeight() - targetView.getPoint().y - circleShape.getRadius() - extraPaddingForArc;
            params.gravity = Gravity.LEFT | Gravity.BOTTOM;
        }

    }
    mImageView.postInvalidate();
    mImageView.setLayoutParams(params);
    addView(mImageView);

    PorterDuffColorFilter porterDuffColorFilter = new PorterDuffColorFilter(lineAndArcColor,
            PorterDuff.Mode.SRC_ATOP);
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        AnimatedVectorDrawable avd = (AnimatedVectorDrawable)
                ContextCompat.getDrawable(activity, R.drawable.avd_spotlight_arc);
        avd.setColorFilter(porterDuffColorFilter);
        mImageView.setImageDrawable(avd);
        avd.start();
    } else {
        AnimatedVectorDrawableCompat avdc =
                AnimatedVectorDrawableCompat.create(activity, R.drawable.avd_spotlight_arc);
        avdc.setColorFilter(porterDuffColorFilter);
        mImageView.setImageDrawable(avdc);
        avdc.start();

    }

    new Handler(Looper.getMainLooper()).postDelayed(new Runnable() {
        @Override
        public void run() {
            addPathAnimation(activity);
        }
    }, 400);
}
 
开发者ID:HueToYou,项目名称:ChatExchange-old,代码行数:62,代码来源:SpotlightView.java


示例18: LoopAnimatedVectorDrawableCompat

import android.support.graphics.drawable.AnimatedVectorDrawableCompat; //导入依赖的package包/类
public LoopAnimatedVectorDrawableCompat (AnimatedVectorDrawableCompat animatedVectorDrawableCompat) {
    this.mAnimator = animatedVectorDrawableCompat;
    setLoopEnable(true);
}
 
开发者ID:Trumeet,项目名称:Animations,代码行数:5,代码来源:LoopAnimatedVectorDrawableCompat.java


示例19: getDrawable

import android.support.graphics.drawable.AnimatedVectorDrawableCompat; //导入依赖的package包/类
public AnimatedVectorDrawableCompat getDrawable () {
    return mAnimator;
}
 
开发者ID:Trumeet,项目名称:Animations,代码行数:4,代码来源:LoopAnimatedVectorDrawableCompat.java


示例20: animateMenuImage

import android.support.graphics.drawable.AnimatedVectorDrawableCompat; //导入依赖的package包/类
private void animateMenuImage() {
    final Drawable drawable = iconMenu.getDrawable();
    if (drawable instanceof AnimatedVectorDrawableCompat) {
        ((AnimatedVectorDrawableCompat) iconMenu.getDrawable()).start();
    }
}
 
开发者ID:florent37,项目名称:AwesomeBar,代码行数:7,代码来源:AwesomeBar.java



注:本文中的android.support.graphics.drawable.AnimatedVectorDrawableCompat类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java MethodClosure类代码示例发布时间:2022-05-21
下一篇:
Java ApplicationUser类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap