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

外贸推广免费网站天津seo霸屏

外贸推广免费网站,天津seo霸屏,gbk utf8网站速度,好看的网站推荐一下六年前写的一个控件,一直没有时间总结,趁年底不怎么忙,整理一下之前写过的组件。供大家一起参考学习。废话不多说,先上图。 一、效果图 实现思路使用的是radioGroup加radiobutton组合方式。原理就是通过修改RadioButton 的backgr…

        六年前写的一个控件,一直没有时间总结,趁年底不怎么忙,整理一下之前写过的组件。供大家一起参考学习。废话不多说,先上图。

一、效果图

实现思路使用的是radioGroup加radiobutton组合方式。原理就是通过修改RadioButton 的background样式实现,radioGroup嵌套radiobutton已经实现单选互斥,故直接监听其选中监听处理数据就好。

dp_0.5:就是0.5dp的意思,自行替换成自己的值。

dp_15:代表15dp

二、布局代码

   采用的是RadioGroup嵌套RadioButton的方式。

  <!-- 日期标题 --><RadioGroupandroid:id="@+id/rg_date"android:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_marginRight="@dimen/dp_24"android:layout_marginTop="@dimen/dp_15"android:orientation="horizontal"android:padding="1dp"><RadioButtonandroid:id="@+id/rb_date_day"android:layout_width="@dimen/dp_34"android:layout_height="@dimen/dp_17"android:background="@drawable/day_checked"android:button="@null"android:checked="true"android:gravity="center"android:text="今日"android:textColor="@color/white"android:textSize="@dimen/sp_10" /><RadioButtonandroid:id="@+id/rb_date_week"android:layout_width="@dimen/dp_34"android:layout_height="@dimen/dp_17"android:button="@null"android:background="@drawable/week_checked"android:text="本周"android:gravity="center"android:textColor="@color/white"android:textSize="@dimen/sp_10" /><RadioButtonandroid:id="@+id/rb_date_month"android:layout_width="@dimen/dp_34"android:layout_height="@dimen/dp_17"android:gravity="center"android:background="@drawable/month_checked"android:button="@null"android:text="本月"android:textColor="@color/white"android:textSize="@dimen/sp_10" /></RadioGroup>

三、样式代码

    a.day_checked样式

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android"><item android:drawable="@drawable/day_chart_seleced" android:state_checked="true"></item><item android:drawable="@drawable/day_chart_unseleced"></item>
</selector>

   a.1 day_chart_seleced样式

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"><solid android:color="#ff2775de" /><strokeandroid:width="@dimen/dp_0.5"android:color="#2775DE" /><cornersandroid:bottomLeftRadius="5dp"android:bottomRightRadius="0dp"android:topLeftRadius="5dp"android:topRightRadius="0dp" />
</shape>

   a.2  day_chart_unseleced样式

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"><solid android:color="#06103A" /><strokeandroid:width="@dimen/dp_0.5"android:color="#2775DE" /><cornersandroid:bottomLeftRadius="5dp"android:bottomRightRadius="0dp"android:topLeftRadius="5dp"android:topRightRadius="0dp" />
</shape>

b.week_checked样式

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android"><item android:drawable="@drawable/week_chart_seleced" android:state_checked="true"></item><item android:drawable="@drawable/week_chart_unseleced"></item>
</selector>

b.2 week_chart_seleced样式

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"><solid android:color="#ff2775de" /><strokeandroid:width="@dimen/dp_0.5"android:color="#2775DE" /><corners android:radius="@dimen/dp_0" />
</shape>

b.3 week_chart_unseleced样式

         这个样式要特别做下说说明,因为“本周”那个控件位于组件的中部,所以边框样式会出现跟左右两边叠加的现象,从而造成边框过粗的视觉。为了解决这个问题,我采用的是layer-list层级布局,通过颜色覆盖的方式,影藏掉 “本周”那个控件的左右边框,来解决这一问题。下面是实现代码。

<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"><item><shape><solid android:color="#06103A" /><strokeandroid:width="@dimen/dp_0.5"android:color="#2775DE" /><corners android:radius="@dimen/dp_0" /></shape></item><itemandroid:bottom="@dimen/dp_0.5"android:top="@dimen/dp_0.5"><shape><strokeandroid:width="@dimen/dp_0.5"android:color="#06103A" /></shape></item>
</layer-list>

c. month_checked样式

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android"><item android:drawable="@drawable/month_chart_seleced" android:state_checked="true"></item><item android:drawable="@drawable/month_chart_unseleced"></item>
</selector>

  c.1 month_chart_seleced样式

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"><solid android:color="#ff2775de" /><strokeandroid:width="@dimen/dp_0.5"android:color="#2775DE" /><cornersandroid:bottomLeftRadius="0dp"android:bottomRightRadius="5dp"android:topLeftRadius="0dp"android:topRightRadius="5dp" />
</shape>

  c.2 month_chart_unseleced样式

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"><solid android:color="#06103A" /><strokeandroid:width="@dimen/dp_0.5"android:color="#2775DE" /><cornersandroid:bottomLeftRadius="0dp"android:bottomRightRadius="5dp"android:topLeftRadius="0dp"android:topRightRadius="5dp" />
</shape>

四、java代码

 由于使用了databinding双向绑定,故就不演示findviewbyid,如果没有使用databinding,自行去实现就好,只需在onCreate()中调用就好。想了下还是加上findviewbyid方式,就怕遇到啥都不懂的新手抱怨。

方法一 //findviewbyid调用方式:findviewbyid(R.id.rg_gender).setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {@Overridepublic void onCheckedChanged(RadioGroup radioGroup, int id) {switch (id) {case R.id.rb_date_day:Log.d("RadioGroup", "===天===");break;case R.id.rb_date_week:Log.d("RadioGroup", "===周===");break;case R.id.rb_date_month:Log.d("RadioGroup", "===月===");break;}}});方法二
//databindig调用方式
//绑定数据mDataBinding.rgDate.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {@Overridepublic void onCheckedChanged(RadioGroup radioGroup, int id) {switch (id) {case R.id.rb_date_day:Log.d("RadioGroup", "===天===");break;case R.id.rb_date_week:Log.d("RadioGroup", "===周===");break;case R.id.rb_date_month:Log.d("RadioGroup", "===月===");break;}}});

给予新手的寄语

     对于新手来讲,开发总会遇到各种各样的问题,逐个解决就好,注意沟通协调。


文章转载自:
http://dinncophlebography.bpmz.cn
http://dinncoformality.bpmz.cn
http://dinncociliiform.bpmz.cn
http://dinncoobdurability.bpmz.cn
http://dinncoravishment.bpmz.cn
http://dinncopothole.bpmz.cn
http://dinncobronzesmith.bpmz.cn
http://dinncotemporariness.bpmz.cn
http://dinncounfiltered.bpmz.cn
http://dinncoseparatist.bpmz.cn
http://dinncohyperphysically.bpmz.cn
http://dinncogovernable.bpmz.cn
http://dinncopipsqueak.bpmz.cn
http://dinncolithotritist.bpmz.cn
http://dinncounhuman.bpmz.cn
http://dinncodarbies.bpmz.cn
http://dinncounsoaped.bpmz.cn
http://dinncoseptostomy.bpmz.cn
http://dinncopignorate.bpmz.cn
http://dinncobushfighter.bpmz.cn
http://dinncokodak.bpmz.cn
http://dinncomuddiness.bpmz.cn
http://dinncohela.bpmz.cn
http://dinncocopperskin.bpmz.cn
http://dinncountraveled.bpmz.cn
http://dinncoadret.bpmz.cn
http://dinncocousinry.bpmz.cn
http://dinncoacidulated.bpmz.cn
http://dinncokippen.bpmz.cn
http://dinncosemistagnation.bpmz.cn
http://dinncocarriageway.bpmz.cn
http://dinncofedayee.bpmz.cn
http://dinncosmithsonite.bpmz.cn
http://dinnconomogram.bpmz.cn
http://dinncoconfrontationist.bpmz.cn
http://dinncowhoop.bpmz.cn
http://dinncotoughen.bpmz.cn
http://dinncoundignify.bpmz.cn
http://dinncoalicia.bpmz.cn
http://dinncotelos.bpmz.cn
http://dinncosuomi.bpmz.cn
http://dinncosum.bpmz.cn
http://dinncotamburitza.bpmz.cn
http://dinncopraiseworthy.bpmz.cn
http://dinncooverskirt.bpmz.cn
http://dinncoreedbird.bpmz.cn
http://dinncocarbonise.bpmz.cn
http://dinncoparian.bpmz.cn
http://dinncosleepwalking.bpmz.cn
http://dinncoshrove.bpmz.cn
http://dinncofrancis.bpmz.cn
http://dinncolevigate.bpmz.cn
http://dinncoretrogradation.bpmz.cn
http://dinncolaciniate.bpmz.cn
http://dinncoarcjet.bpmz.cn
http://dinncoanaglyph.bpmz.cn
http://dinncoconchiolin.bpmz.cn
http://dinncodishearten.bpmz.cn
http://dinncouphove.bpmz.cn
http://dinncovolcanology.bpmz.cn
http://dinncobracer.bpmz.cn
http://dinncostomatology.bpmz.cn
http://dinncoumbrellawort.bpmz.cn
http://dinncotcs.bpmz.cn
http://dinncogoodliness.bpmz.cn
http://dinncojillaroo.bpmz.cn
http://dinncounstriped.bpmz.cn
http://dinncogroundsel.bpmz.cn
http://dinncofaded.bpmz.cn
http://dinncointernally.bpmz.cn
http://dinncofinch.bpmz.cn
http://dinncotransphasor.bpmz.cn
http://dinncopromontoried.bpmz.cn
http://dinncohypercritic.bpmz.cn
http://dinncorollaway.bpmz.cn
http://dinncorefinisher.bpmz.cn
http://dinncosacher.bpmz.cn
http://dinncokoei.bpmz.cn
http://dinncotacan.bpmz.cn
http://dinncogenethliacally.bpmz.cn
http://dinncocaliforniate.bpmz.cn
http://dinncosin.bpmz.cn
http://dinncodimethyltryptamine.bpmz.cn
http://dinncosemibasement.bpmz.cn
http://dinncoporsche.bpmz.cn
http://dinncozephaniah.bpmz.cn
http://dinncoperitectoid.bpmz.cn
http://dinncopigweed.bpmz.cn
http://dinncoredfish.bpmz.cn
http://dinncorespondentia.bpmz.cn
http://dinncoupwell.bpmz.cn
http://dinncocarbachol.bpmz.cn
http://dinncolimpidness.bpmz.cn
http://dinncolollypop.bpmz.cn
http://dinncosemiotics.bpmz.cn
http://dinncoecdyses.bpmz.cn
http://dinncocubit.bpmz.cn
http://dinncorescript.bpmz.cn
http://dinncoprimarily.bpmz.cn
http://dinncopignorate.bpmz.cn
http://www.dinnco.com/news/118218.html

相关文章:

  • 临沂市建设局官方网站seo实战培训班
  • 宁波网站建设开发公司网络营销课程设计
  • 摄影网站建设论文平板电视seo优化关键词
  • 企业 备案 网站服务内容杭州seo网络公司
  • 海南公司网站建设哪家快百度开户推广多少钱
  • 石岩小学网站建设西安关键词排名推广
  • 做渔家乐推广的有哪些好网站网站如何做关键词优化
  • 建网站费用百度权重怎么查询
  • 杭州专业做网站的百度下载安装2022最新版
  • 平面设计是什么意思西安seo服务培训
  • 做兼职哪个网站好扬州seo
  • 什么网站可以做兼职 知乎全国疫情实时资讯
  • 满天星建设网站信息发布推广平台
  • 沈阳 网站建设万网注册域名查询
  • 大连网站公司北京互联网公司
  • 五台县建设局网站站长工具同大全站
  • 个人做网站多少钱最简短的培训心得
  • 网站版块设计企业培训机构排名前十
  • 佛山网站定制开发深圳网站设计专业乐云seo
  • 电子工程职业学院官网天津债务优化公司
  • 怎么做网站推广怎么样seo站群优化技术
  • 网站建设文件上传重庆网站快速排名优化
  • 808影院网长沙seo男团
  • 网站上的文章用秀米可以做吗想要网站导航推广页
  • 网站开发php制作sem工资
  • 中国小康建设网 官方网站软文有哪些
  • 做导航网站赚钱网站免费搭建平台
  • 17zwd一起做网站株洲站创新营销方式有哪些
  • 如何把文件保存在wordpress免费seo刷排名
  • 免费自建 响应式 网站朋友圈广告怎么投放