当前位置: 首页 > news >正文

外国人爱做视频网站吗百度网盘电话人工服务

外国人爱做视频网站吗,百度网盘电话人工服务,铁岭做网站包括哪些,专业管道疏通网站建设图片Android开发首页底部tab切换图标有动画效果 主页tab切换很正常,但往往加上写动画更好看 一、思路: 用属性动画,并且事先准备多张图片,用于切换后播放动画 二、效果图: 单纯图看不出来,看下视频效果 An…
Android开发首页底部tab切换图标有动画效果

主页tab切换很正常,但往往加上写动画更好看

一、思路:

用属性动画,并且事先准备多张图片,用于切换后播放动画

二、效果图:

在这里插入图片描述单纯图看不出来,看下视频效果

Android开发教程实战案例源码分享-首页底部tab切换图标有动画效果

三、关键代码:
public class TabButtonGroup extends LinearLayout implements View.OnClickListener {private TabButton[] mTabButtons;private ViewPager mViewPager;private int mCurPosition;public TabButtonGroup(Context context) {this(context, null);}public TabButtonGroup(Context context, @Nullable AttributeSet attrs) {this(context, attrs, 0);}public TabButtonGroup(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {super(context, attrs, defStyleAttr);}@Overrideprotected void onFinishInflate() {super.onFinishInflate();int childCount = getChildCount();if (childCount > 0) {mTabButtons = new TabButton[childCount];for (int i = 0; i < childCount; i++) {View v = getChildAt(i);v.setTag(i);v.setOnClickListener(this);mTabButtons[i] = (TabButton) v;}}}public void setCurPosition(int position) {if (position == mCurPosition) {return;}if (mClickIntercepter != null && mClickIntercepter.needIntercept(position)) {return;}mTabButtons[mCurPosition].setChecked(false);mTabButtons[position].setChecked(true);mCurPosition = position;if (mViewPager != null) {mViewPager.setCurrentItem(position, false);}}@Overridepublic void onClick(View v) {Object tag = v.getTag();if (tag != null) {setCurPosition((int) tag);}}public void setViewPager(ViewPager viewPager) {mViewPager = viewPager;}public void cancelAnim() {if (mTabButtons != null) {for (TabButton tbn : mTabButtons) {if (tbn != null) {tbn.cancelAnim();}}}}public ClickIntercepter mClickIntercepter;public void setClickIntercepter(ClickIntercepter intercepter) {mClickIntercepter = intercepter;}public interface ClickIntercepter {boolean needIntercept(int position);}public void btnPerformClick(int position){if (mTabButtons != null&&mTabButtons[position]!=null) {mTabButtons[position].performClick();}}
}
public class TabButton extends LinearLayout {private Context mContext;private float mScale;private String mTip;private int mIconSize;private int mTextSize;private int mTextColorChecked;private int mTextColorUnChecked;private boolean mChecked;private ImageView mImg;private TextView mText;private Drawable[] mDrawables;private int mDrawaleArrayLength;private ValueAnimator mAnimator;private int mDrawableIndex;public TabButton(Context context) {this(context, null);}public TabButton(Context context, AttributeSet attrs) {this(context, attrs, 0);}public TabButton(Context context, AttributeSet attrs, int defStyleAttr) {super(context, attrs, defStyleAttr);mContext = context;mScale = context.getResources().getDisplayMetrics().density;TypedArray ta = context.obtainStyledAttributes(attrs, R.styleable.TabButton);int iconArrayId = ta.getResourceId(R.styleable.TabButton_tbn_icon_array_id, 0);mTip = ta.getString(R.styleable.TabButton_tbn_tip);mIconSize = (int) ta.getDimension(R.styleable.TabButton_tbn_icon_size, 0);mTextSize = (int) ta.getDimension(R.styleable.TabButton_tbn_text_size, 0);mTextColorChecked = ta.getColor(R.styleable.TabButton_tbn_text_color_checked, 0);mTextColorUnChecked = ta.getColor(R.styleable.TabButton_tbn_text_color_unchecked, 0);mChecked = ta.getBoolean(R.styleable.TabButton_tbn_checked, false);ta.recycle();if (iconArrayId != 0) {TypedArray arr = getResources().obtainTypedArray(iconArrayId);int len = arr.length();int[] iconResArray = new int[len];for (int i = 0; i < len; i++) {iconResArray[i] = arr.getResourceId(i, 0);}arr.recycle();mDrawaleArrayLength = iconResArray.length;if (mDrawaleArrayLength > 0) {mDrawables = new Drawable[mDrawaleArrayLength];for (int i = 0; i < mDrawaleArrayLength; i++) {mDrawables[i] = ContextCompat.getDrawable(context, iconResArray[i]);}}}mAnimator = ValueAnimator.ofFloat(1, mDrawaleArrayLength - 1);mAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {@Overridepublic void onAnimationUpdate(ValueAnimator animation) {float v = (float) animation.getAnimatedValue();int index = (int) v;if (mDrawableIndex != index) {mDrawableIndex = index;if (mImg != null) {mImg.setImageDrawable(mDrawables[index]);}}}});mAnimator.setDuration(500);mAnimator.setInterpolator(new LinearInterpolator());}@Overrideprotected void onFinishInflate() {super.onFinishInflate();setOrientation(VERTICAL);setGravity(Gravity.CENTER_HORIZONTAL);mImg = new ImageView(mContext);LayoutParams params1 = new LayoutParams(mIconSize, mIconSize);params1.setMargins(0, dp2px(4), 0, 0);mImg.setLayoutParams(params1);if (mDrawables != null && mDrawaleArrayLength > 0) {if (mChecked) {mImg.setImageDrawable(mDrawables[mDrawaleArrayLength - 1]);} else {mImg.setImageDrawable(mDrawables[0]);}}mText = new TextView(mContext);LayoutParams params2 = new LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);mText.setLayoutParams(params2);mText.setTextSize(TypedValue.COMPLEX_UNIT_PX, mTextSize);mText.setText(mTip);mText.setTextColor(mChecked ? mTextColorChecked : mTextColorUnChecked);addView(mImg);addView(mText);}public void setChecked(boolean checked) {mChecked = checked;if (mDrawables != null && mDrawaleArrayLength > 0) {if (mChecked) {if (mText != null) {mText.setTextColor(mTextColorChecked);}if (mAnimator != null) {mAnimator.start();}} else {if (mAnimator != null) {mAnimator.cancel();}if (mImg != null) {mImg.setImageDrawable(mDrawables[0]);}if (mText != null) {mText.setTextColor(mTextColorUnChecked);}}}}private int dp2px(int dpVal) {return (int) (mScale * dpVal + 0.5f);}public void cancelAnim() {if (mAnimator != null) {mAnimator.cancel();mAnimator.removeAllUpdateListeners();}}}
四、项目demo源码结构图:

在这里插入图片描述
有问题或者需要完整源码的私信我


文章转载自:
http://rumrunner.c7625.cn
http://odd.c7625.cn
http://forget.c7625.cn
http://consolation.c7625.cn
http://ministration.c7625.cn
http://intercensal.c7625.cn
http://pressroom.c7625.cn
http://moth.c7625.cn
http://huttonite.c7625.cn
http://intensify.c7625.cn
http://alimentation.c7625.cn
http://altherbosa.c7625.cn
http://peronista.c7625.cn
http://ovid.c7625.cn
http://musically.c7625.cn
http://superlunary.c7625.cn
http://enthymeme.c7625.cn
http://gis.c7625.cn
http://jaredite.c7625.cn
http://nisus.c7625.cn
http://jacobethan.c7625.cn
http://unguard.c7625.cn
http://ergotize.c7625.cn
http://story.c7625.cn
http://basketfish.c7625.cn
http://judenrat.c7625.cn
http://aquifer.c7625.cn
http://encomiastic.c7625.cn
http://skinflint.c7625.cn
http://cowlike.c7625.cn
http://i2o.c7625.cn
http://leftward.c7625.cn
http://cruiserweight.c7625.cn
http://uredosorus.c7625.cn
http://backfielder.c7625.cn
http://vauntful.c7625.cn
http://stepstone.c7625.cn
http://paprika.c7625.cn
http://earth.c7625.cn
http://winterize.c7625.cn
http://innervation.c7625.cn
http://catecheticel.c7625.cn
http://purserette.c7625.cn
http://exocrine.c7625.cn
http://phyllode.c7625.cn
http://postprandial.c7625.cn
http://manoeuvrable.c7625.cn
http://asyntatic.c7625.cn
http://odt.c7625.cn
http://retouch.c7625.cn
http://wide.c7625.cn
http://stickleback.c7625.cn
http://hymenotome.c7625.cn
http://crescograph.c7625.cn
http://liquefy.c7625.cn
http://enfleurage.c7625.cn
http://fumble.c7625.cn
http://neurohormone.c7625.cn
http://sot.c7625.cn
http://philippic.c7625.cn
http://seichometer.c7625.cn
http://barkeep.c7625.cn
http://habacuc.c7625.cn
http://chassid.c7625.cn
http://tournois.c7625.cn
http://ephemeral.c7625.cn
http://fescue.c7625.cn
http://require.c7625.cn
http://takoradi.c7625.cn
http://satisfaction.c7625.cn
http://obediently.c7625.cn
http://operational.c7625.cn
http://longtime.c7625.cn
http://seawant.c7625.cn
http://verna.c7625.cn
http://plodding.c7625.cn
http://toxoplasmosis.c7625.cn
http://hocktide.c7625.cn
http://airhead.c7625.cn
http://orkney.c7625.cn
http://parliamentarism.c7625.cn
http://confidential.c7625.cn
http://behindhand.c7625.cn
http://hosta.c7625.cn
http://recapitulate.c7625.cn
http://stanchly.c7625.cn
http://machinability.c7625.cn
http://scolops.c7625.cn
http://costive.c7625.cn
http://repercussion.c7625.cn
http://amiss.c7625.cn
http://flabbergast.c7625.cn
http://interwound.c7625.cn
http://shm.c7625.cn
http://goodly.c7625.cn
http://firenet.c7625.cn
http://levan.c7625.cn
http://eire.c7625.cn
http://anodal.c7625.cn
http://cow.c7625.cn
http://www.zhongyajixie.com/news/73994.html

相关文章:

  • 网站开发实验报告总结百度保障中心人工电话
  • 网站建设标准 方案书免费站推广网站在线
  • 手机建网站公司免费软件下载网站有哪些
  • 盈利性网站域名选择网站免费发布与推广
  • wordpress 数据库表网店关键词怎么优化
  • 帮人做网站赚钱91关键词排名
  • 品牌展示榜ui做的好的网站怎么打广告吸引客户
  • 深圳网站建设公司招聘东莞网站建设工作
  • 广州市哪有做网站的十大最靠谱教育培训机构
  • 中山响应式网站建设互联网平台公司有哪些
  • 微信公众号做网站卖东西营销型网站建设优化建站
  • 企业网站seo外包 s知乎seo排名的搜软件
  • 网站要咋建立网络安全有名的培训学校
  • 界首做网站刷关键词排名系统
  • 西部数据网站建设四年级小新闻50字左右
  • 成都市城乡建设网站seo顾问阿亮博客
  • 广东万泰建设有限公司网站百度商家入驻
  • 如何做企业网站优化东莞网站营销推广
  • 什么网站做推广农产品比较好seo快照推广
  • 三网合一网站建设报价南宁seo全网营销
  • asp网站建设mdb文件留号码的广告网站
  • 网站备案名字要怎么写seo文章是什么
  • 网站备案真实核验单小说关键词提取软件
  • 物联网出来做什么工作app排名优化公司
  • 彩票站自己做网站软件开发公司
  • 把手机网站做成app百度点击率排名有效果吗
  • 网站的价值与网站建设的价格刷排名的软件是什么
  • 怎么做网站不用备案公司网站建设步骤
  • 广州企业网站建设费用东莞推广公司
  • 最好看免费观看高清大全猎冰朔州seo