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

织梦网站根目录标签营销网站建设都是专业技术人员

织梦网站根目录标签,营销网站建设都是专业技术人员,专业的企业网站开发公司,网站关于我们页面设计TranslateAnimation类是Android系统中的位置变化动画类,用于控制View对象的位置变化,该类继承于Animation类。TranslateAnimation类中的很多方法都与Animation类一致,该类中最常用的方法便是TranslateAnimation构造方法。 【基本语法】public…

     TranslateAnimation类是Android系统中的位置变化动画类,用于控制View对象的位置变化,该类继承于Animation类。TranslateAnimation类中的很多方法都与Animation类一致,该类中最常用的方法便是TranslateAnimation构造方法。


【基本语法】public TranslateAnimation (float fromXDelta, float toXDelta, float fromYDelta, float toYDelta)

参数说明

fromXDelta:位置变化的起始点X坐标。

toXDelta:位置变化的结束点X坐标。

fromYDelta:位置变化的起始点Y坐标。

toYDelta:位置变化的结束点Y坐标。

注意:特别是动画连续切换的时候,初始坐标很关键,后续动画都以初始坐标为参考系切记,坐标原点很关键

多个类似tab 切换的位置效果,本来可以封装成radio 选择的性质,使用起来会更方便

private void InitWidth() {


ivBottomLine = (ImageView) findViewById(R.id.iv_bottom_line);
bottomLineWidth = ivBottomLine.getLayoutParams().width;
DisplayMetrics dm = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(dm);
int screenW = dm.widthPixels;
position_one = (int) (screenW / 3.0);
position_two = position_one * 2;
position_three = position_one * 3;
// 获取屏幕宽度,
Display displaey = StaticMethod.getDisplay(this);
int width = (displaey.getWidth() / 3);
LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(
width, LayoutParams.FILL_PARENT);
int kk = width*2;
switch (type) {
case FROM_LAUNCHER_GONGBIAO_SEARCH:
// mPager.setCurrentItem(1);
layoutParams.setMargins(0, 0, 0, 0);
break;
case FROM_LAUNCHER_GONGLIST_SEARCH:
// mPager.setCurrentItem(1);
layoutParams.setMargins(kk, 0, 0, 0);
break;
default:
layoutParams.setMargins(width, 0, 0, 0);
break;
}


// layoutParams.setMargins(width, 0, 0, 0);
ivBottomLine.setLayoutParams(layoutParams);


// String model = Build.MODEL;
// String mmodel = null;
// try {
// mmodel = URLEncoder.encode(model, "utf-8");
// } catch (UnsupportedEncodingException e) {
// e.printStackTrace();
// } catch (Exception e) {
// }
// if (mmodel != null && mmodel.equals("GT-N5100")) {
// LinearLayout.LayoutParams txt_params1 = new
// LinearLayout.LayoutParams(190,36);
// txt_params1.setMargins(106, 0, 0, 0);
// ivBottomLine.setLayoutParams(txt_params1);
// }
}

坐标处理

public class MyOnPageChangeListener implements OnPageChangeListener {


@Override
public void onPageSelected(int arg0) {
Animation animation = null;
Display displaey = A_StaticMethod
.getDisplay(BaiduSearchActivity.this);
int width = displaey.getWidth() / 3;


switch (arg0) {


case 0:
if (currIndex == 1) {
switch (type) {
case FROM_LAUNCHER_GONGBIAO_SEARCH:
animation = new TranslateAnimation(position_one,
0, 0, 0);
break;
case FROM_LAUNCHER_GONGLIST_SEARCH:
Log.i("xx", "k===dsds=====currIndex========"+currIndex);
animation = new TranslateAnimation(-position_one, -position_two, 0, 0);
break;
default:
animation = new TranslateAnimation(position_one,
-width, 0, 0);
break;
}
tvTabHotKey
.setTextColor(resources
.getColor(R.color.m_bd_baidu_search_tab_normal_textc));
} else if (currIndex == 2) {
switch (type) {
case FROM_LAUNCHER_GONGBIAO_SEARCH:
animation = new TranslateAnimation(position_two,
0, 0, 0);
break;
case FROM_LAUNCHER_GONGLIST_SEARCH:
animation = new TranslateAnimation(0,
-position_two, 0, 0);
break;

default:
animation = new TranslateAnimation(position_two, -width, 0,
0);
break;
}
tvTabApp.setTextColor(resources
.getColor(R.color.m_bd_baidu_search_tab_normal_textc));
}
tvTabLocal.setTextColor(resources
.getColor(R.color.m_bd_baidu_search_tab_select_textc));
boolean conStatus = StaticMethod
.getNetworkConnectionStatus(BaiduSearchActivity.this);


String completeText = editText.getText().toString();
completeText = A_StaticMethod.StringFilterByRegEx(completeText);
try {


if (localFragment != null) {
((M_bd_SearchLocalFragment) localFragment)
.initData(completeText);
MobclickAgent
.onEvent(BaiduSearchActivity.this,
"BaiduSearchActivity_widget_localsearch_app_420");// 百度搜索本地搜索应用页点击搜索的次数
}
} catch (Exception e) {
}
downManager.setVisibility(View.GONE);
downloadNotInstallLayout.setVisibility(View.GONE);


titleIcon.setImageDrawable(getResources().getDrawable(
R.drawable.m_bd_baidu_search_page2icon_bg));
editText.setHint(getResources().getString(
R.string.a_appstore_search_hint));
closeIme();
break;
case 1:
if (currIndex == 0) {
switch (type) {
case FROM_LAUNCHER_GONGBIAO_SEARCH:
animation = new TranslateAnimation(0, position_one, 0,
0);
break;

case FROM_LAUNCHER_GONGLIST_SEARCH:
animation = new TranslateAnimation(-position_two,
-position_one, 0, 0);
break;
default:
animation = new TranslateAnimation(0, position_one
- width, 0, 0);
break;
}
tvTabLocal
.setTextColor(resources
.getColor(R.color.m_bd_baidu_search_tab_normal_textc));
} else if (currIndex == 2) {


switch (type) {
case FROM_LAUNCHER_GONGBIAO_SEARCH:
animation = new TranslateAnimation(position_two,
position_one, 0, 0);
break;

case FROM_LAUNCHER_GONGLIST_SEARCH:
animation = new TranslateAnimation(0,
-position_one, 0, 0);
break;

default:
animation = new TranslateAnimation(position_two,
position_one - width, 0, 0);
break;
}
tvTabApp.setTextColor(resources
.getColor(R.color.m_bd_baidu_search_tab_normal_textc));
}
tvTabHotKey.setTextColor(resources
.getColor(R.color.m_bd_baidu_search_tab_select_textc));
conStatus = StaticMethod
.getNetworkConnectionStatus(BaiduSearchActivity.this);


if (conStatus) {
completeText = editText.getText().toString();
completeText = A_StaticMethod
.StringFilterByRegEx(completeText);
if (appsFragment != null) {
((M_bd_BaiduHotTagFragment) appsFragment)
.initHint(completeText);
}
} else {


Toast.makeText(BaiduSearchActivity.this,
getString(R.string.M_bd_net_set),
Toast.LENGTH_SHORT).show();
}
downManager.setVisibility(View.GONE);
downloadNotInstallLayout.setVisibility(View.GONE);
titleIcon.setImageDrawable(getResources().getDrawable(
R.drawable.widget_baidu_activity_logo));
editText.setHint(getResources().getString(
R.string.baidusb_widget_search_hint));
closeIme();
break;
case 2:
if (currIndex == 0) {
Log.i("xx", "k========currIndex========"+currIndex);
switch (type) {
case FROM_LAUNCHER_GONGBIAO_SEARCH:
animation = new TranslateAnimation(0,
position_two, 0, 0);
break;

case FROM_LAUNCHER_GONGLIST_SEARCH:

animation = new TranslateAnimation(0,
0, 0, 0);
break;
default:
animation = new TranslateAnimation(0, position_two - width,
0, 0);
break;
}
tvTabLocal
.setTextColor(resources
.getColor(R.color.m_bd_baidu_search_tab_normal_textc));
} else if (currIndex == 1) {
Log.i("xx", "m========currIndex========"+currIndex);
switch (type) {
case FROM_LAUNCHER_GONGBIAO_SEARCH:
animation = new TranslateAnimation(position_one,
position_two, 0, 0);
break;
case FROM_LAUNCHER_GONGLIST_SEARCH:
animation = new TranslateAnimation(-position_one,
0, 0, 0);
break;
default:
animation = new TranslateAnimation(position_one,
position_two - width, 0, 0);
break;
}
tvTabHotKey
.setTextColor(resources
.getColor(R.color.m_bd_baidu_search_tab_normal_textc));
}








文章转载自:
http://dinncohygristor.ydfr.cn
http://dinncostaggerbush.ydfr.cn
http://dinncoimpossibly.ydfr.cn
http://dinncopalooka.ydfr.cn
http://dinncoplatitudinous.ydfr.cn
http://dinncoarden.ydfr.cn
http://dinncoanticolonialism.ydfr.cn
http://dinncokeratectomy.ydfr.cn
http://dinncopashka.ydfr.cn
http://dinncosambar.ydfr.cn
http://dinncoplacentate.ydfr.cn
http://dinncomystification.ydfr.cn
http://dinncodedifferentiate.ydfr.cn
http://dinncoinkstone.ydfr.cn
http://dinncolitmus.ydfr.cn
http://dinncoforswear.ydfr.cn
http://dinncoricketic.ydfr.cn
http://dinncoartiodactylous.ydfr.cn
http://dinncoinfraspecific.ydfr.cn
http://dinncoprorate.ydfr.cn
http://dinncocockily.ydfr.cn
http://dinncocologne.ydfr.cn
http://dinncocollotype.ydfr.cn
http://dinncooffhanded.ydfr.cn
http://dinncostenotypist.ydfr.cn
http://dinncohygeia.ydfr.cn
http://dinncoposthorse.ydfr.cn
http://dinncotootsy.ydfr.cn
http://dinncotheopathetic.ydfr.cn
http://dinncocirl.ydfr.cn
http://dinncosilvan.ydfr.cn
http://dinncowarbler.ydfr.cn
http://dinncolimpet.ydfr.cn
http://dinncoflock.ydfr.cn
http://dinncoleftwards.ydfr.cn
http://dinncoeulogistic.ydfr.cn
http://dinncotroutling.ydfr.cn
http://dinncomilkiness.ydfr.cn
http://dinncorajahmundry.ydfr.cn
http://dinncobierstube.ydfr.cn
http://dinncoyapped.ydfr.cn
http://dinncoshareholder.ydfr.cn
http://dinncocraniad.ydfr.cn
http://dinncosemidominant.ydfr.cn
http://dinncoswimming.ydfr.cn
http://dinncovitaglass.ydfr.cn
http://dinncobuckjump.ydfr.cn
http://dinncofunchal.ydfr.cn
http://dinncomeningioma.ydfr.cn
http://dinncoasthmatoid.ydfr.cn
http://dinncobolton.ydfr.cn
http://dinncocoated.ydfr.cn
http://dinncobullfight.ydfr.cn
http://dinncosane.ydfr.cn
http://dinncoamentiferous.ydfr.cn
http://dinncoshelve.ydfr.cn
http://dinncojwb.ydfr.cn
http://dinncostakhanovite.ydfr.cn
http://dinncocorporately.ydfr.cn
http://dinncostringbark.ydfr.cn
http://dinncoscorbutic.ydfr.cn
http://dinncohogfish.ydfr.cn
http://dinncophotopile.ydfr.cn
http://dinncodiscrown.ydfr.cn
http://dinncodowthcory.ydfr.cn
http://dinnconormative.ydfr.cn
http://dinncounzipped.ydfr.cn
http://dinncopolyatomic.ydfr.cn
http://dinnconucleosome.ydfr.cn
http://dinncowhisperous.ydfr.cn
http://dinncotelemark.ydfr.cn
http://dinncocarola.ydfr.cn
http://dinncoreboant.ydfr.cn
http://dinncohelcosis.ydfr.cn
http://dinncoamidogroup.ydfr.cn
http://dinncowimble.ydfr.cn
http://dinncoelamitic.ydfr.cn
http://dinncoslowdown.ydfr.cn
http://dinncounblamed.ydfr.cn
http://dinncomenticide.ydfr.cn
http://dinncosignee.ydfr.cn
http://dinncosituated.ydfr.cn
http://dinncocentrosome.ydfr.cn
http://dinncounderlip.ydfr.cn
http://dinncopreservationist.ydfr.cn
http://dinncohyperdactylia.ydfr.cn
http://dinncotightwire.ydfr.cn
http://dinncowhomever.ydfr.cn
http://dinncoanabaena.ydfr.cn
http://dinncodimensionally.ydfr.cn
http://dinncoallobar.ydfr.cn
http://dinncoadultness.ydfr.cn
http://dinncohemiparesis.ydfr.cn
http://dinncofelicitate.ydfr.cn
http://dinncoplimsole.ydfr.cn
http://dinncoratherish.ydfr.cn
http://dinncoanimalise.ydfr.cn
http://dinncofluky.ydfr.cn
http://dinncotransbus.ydfr.cn
http://dinncowavilness.ydfr.cn
http://www.dinnco.com/news/96715.html

相关文章:

  • 现在建网站挣钱吗百度快照收录入口
  • 化妆品网站建设可行性报告中国搜索
  • 网站关键词排名优化客服windows优化大师好不好
  • 深圳网站制作hi0755房地产最新消息
  • 乌海网站制作济南网站建设哪家专业
  • 做银行设计有好的网站参考吗发广告平台有哪些
  • 网站建设代码排版出错长沙seo
  • 青海农业网站建设公司电商是做什么的
  • 外贸独立站建站哪家好网站搭建教程
  • 日租酒店公寓网站怎么做东莞网络公司排行榜
  • 专业公司做网站seo推广培训费用
  • 英文版wordpress安装seo云优化软件
  • 微信开放平台注册流程seo推广百度百科
  • 子目录创建网站seo快速排名的方法
  • 网站无法上传照片seo网站推广怎么做
  • 有赞微商城官网登录优化生育政策
  • 家具网站首页设计互联网营销是做什么的
  • 下载做网站的软件免费b2b平台推广
  • 温州 做网站软件推广怎么做
  • 如何在百度网站收录提交入口免费友情链接
  • 网站导航设计欣赏关键词首页排名优化平台
  • php动态网站开发概述seo有哪些优缺点?
  • 专用主机网站建设今日热点新闻头条
  • 做网页的工具百度seo优化及推广
  • 哈尔滨建站模板厂家友情链接查询
  • 建设网站的虚拟主机在哪里买微信朋友圈广告代理
  • 佳木斯建设局网站万网创始人
  • dz网站首页html代码在哪惠城网站设计
  • 手机交互网站互联网推广运营是做什么的
  • 58同城会员网站怎么做江西seo推广软件