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

本溪网站建设兼职免费留电话的广告

本溪网站建设兼职,免费留电话的广告,站群系统哪个好用,重庆建工集团股份有限公司官网本文所有的代码均存于 https://github.com/MADMAX110/BitsandPizzas 设计支持库#xff08;Design Support Library#xff09;是 Google 在 2015 年的 I/O 大会上发布的全新 Material Design 支持库#xff0c;在这个 support 库里面主要包含了 8 个新的 Material Design …本文所有的代码均存于 https://github.com/MADMAX110/BitsandPizzas 设计支持库Design Support Library是 Google 在 2015 年的 I/O 大会上发布的全新 Material Design 支持库在这个 support 库里面主要包含了 8 个新的 Material Design 组件最低支持 Android 2.1。 设计支持库提供了一系列 Material Design 风格的组件帮助开发者快速构建符合 Material Design 规范的 Android 应用程序。这些组件包括 TextInputLayoutEditText 辅助控件提供输入提示、错误提示等功能。 FloatingActionButtonMD 风格的圆形按钮通常用于表示主要操作。 Snackbar提示框用于显示简短的提示信息。 TabLayout选项卡用于在多个选项之间进行切换。 NavigationViewDrawerLayout 的侧滑界面用于显示导航菜单。 CoordinatorLayout超级 FrameLayout用于实现复杂的布局交互效果。 AppBarLayoutMD 风格的滑动 Layout用于实现可折叠的标题栏。 CollapsingToolbarLayout可折叠的 MD 风格 ToolbarLayout用于实现可折叠的标题栏。 MaterialButtonMaterial 风格的 Button。 Chip ChipGroup关键字标签组件。 MaterialCardViewMaterial 风格的 CardView。 BottomAppBar底部标题栏。 针对之前的BitsandPizzas应用我们可以为其添加更多的设计支持库的特性。 1、支持MainActivity的工具条滚动 2、为OrderActivity增加一个折叠工具条 3、向OrderActivity增加一个FAB浮动动作按钮 4、让FAB显示一个snackbar 一、让工具条响应滚动 1、修改MainActivity的布局以支持工具条滚动。 2、修改TopFragment让它包含可滚动的内容。 与此同时片段中的内容滚动时我们要让工具条也滚动为此要为MainActivity增加一个协调器布局CoordinatorLayout。协调器布局就像一个马力很足的帧布局用来协调不同视图之间的动画和过渡。在这里我们将用协调器布局协调TopFragment中的可滚动内容和MainActivity的工具条。 下面是在MainActivity的布局增加一个协调器布局。 除此之外还要协调滚动行为。 标记用户将滚动的视图让工具条对它做出响应。 要标记用户将滚动的视图需要指定该视图的属性app:layout_behavior把它设置为内置字符串“string/appbar_scrolling_view_behavior”。 这会告诉协调器布局你希望用户滚动这个视图时应用条布局中的视图能够做出响应。在这里我们希望工具条滚动来相应用户滚动视图分页控件的内容所以要为ViewPager元素增加app:layout_behavior属性。 还需要告知工具条响应滚动事件使用属性app:layout_scrollFlags告诉应用条布局中的视图如何响应滚动事件。 在这里设置为当用户向上滚动视图分页控件内容时工具条要向上滚动移出屏幕当用户向下滚动时它要迅速返回原来的位置。为此要把Toolbar的该属性设置为scroll | enterAlways、Scroll使得视图可以滚动移出屏幕不然将会固定在屏幕上方、enterAlways表示用户滚动相应的视图时工具条也会快速向下滚动到它原来的位置。即使没有这个值工具条也会向下滚动不过会比较慢。 ?xml version1.0 encodingutf-8? androidx.coordinatorlayout.widget.CoordinatorLayoutxmlns:androidhttp://schemas.android.com/apk/res/androidxmlns:apphttp://schemas.android.com/apk/res-autoxmlns:toolshttp://schemas.android.com/toolsandroid:layout_widthmatch_parentandroid:layout_heightmatch_parenttools:context.MainActivitycom.google.android.material.appbar.AppBarLayoutandroid:layout_widthmatch_parentandroid:layout_heightwrap_contentandroid:themestyle/ThemeOverlay.AppCompat.Dark.ActionBar androidx.appcompat.widget.Toolbarandroid:idid/toolbarandroid:layout_widthmatch_parentandroid:layout_height?attr/actionBarSizeapp:layout_scrollFlagsscroll|enterAlways/com.google.android.material.tabs.TabLayoutandroid:idid/tabsandroid:layout_widthmatch_parentandroid:layout_heightwrap_content//com.google.android.material.appbar.AppBarLayoutandroidx.viewpager.widget.ViewPagerandroid:idid/pagerandroid:layout_widthmatch_parentandroid:layout_heightmatch_parentapp:layout_behaviorstring/appbar_scrolling_view_behavior//androidx.coordinatorlayout.widget.CoordinatorLayout二、为TopFragment增加可滚动的内容 修改这个片段使其包含一个图像和一些文本可使其滚动。 1、增加字符串资源 string namecompany_nameBits and Pizzas/string string namerestaurant_imageRestaurant image/string string namehome_textSince we opened our doors in 2017, Bits and Pizzashas built its reputation as one of America’s best Italian-Digital restaurants. Somepeople believe eating out is about being with your friends and family. We believe thatgood food is best enjoyed while staring at your phone./string2、向drawable文件夹中增加下面的图片 三、使用嵌套滚动视图使布局内容可滚动 使用一个嵌套滚动视图允许用户滚动TopFragment的内容。这种视图的工作与普通的滚动视图很类似只不过它还支持嵌套滚动因为协调器布局只监听嵌套滚动事件。如果在布局中使用一个普通的滚动视图用户滚动内容时工具条并不会滚动。 现在TopFragment的布局结构要增加一个餐厅图像和一些文本。在写代码之前先来分析一下这个布局的结构。 1、整个片段都是可以滚动的这说明我们要把所有的视图都放在一个嵌套滚动视图中。 2、我们要使用两个文本视图显示公司名和文本。这两个文本视图将放在一个有白色背景的垂直线性布局中。 3、我们希望在一个图像上面显示这个包含两个文本视图的线性布局。为此要把它们放在一个帧布局中。 下面是fragment_top.xml的完整代码。 ?xml version1.0 encodingutf-8? androidx.core.widget.NestedScrollView xmlns:androidhttp://schemas.android.com/apk/res/androidxmlns:toolshttp://schemas.android.com/toolsandroid:layout_widthmatch_parentandroid:layout_heightmatch_parenttools:context.TopFragmentFrameLayoutandroid:layout_widthmatch_parentandroid:layout_heightwrap_contentImageViewandroid:idid/info_imageandroid:layout_widthmatch_parentandroid:layout_heightwrap_contentandroid:scaleTypecenterCropandroid:srcdrawable/imgandroid:contentDescriptionstring/restaurant_image/LinearLayoutandroid:layout_widthmatch_parentandroid:layout_heightwrap_contentandroid:layout_marginTop40dpandroid:layout_marginLeft16dpandroid:layout_marginRight16dpandroid:padding16dpandroid:background#FFFFFFandroid:orientationvertical TextViewandroid:textSize32spandroid:layout_widthmatch_parentandroid:layout_heightmatch_parentandroid:textstring/company_name /TextViewandroid:layout_widthmatch_parentandroid:layout_heightwrap_contentandroid:textstring/home_text//LinearLayout/FrameLayout/androidx.core.widget.NestedScrollView试一试应用 向上滚动内容时工具条也向上滚动。 四、向OrderActivity增加折叠工具条 除了让工具条滚动另一种做法是折叠工具条。折叠工具条开始时很大用户向上滚动屏幕内容时折叠工具条会收缩而当用户向下滚动屏幕内容时折叠工具条会再展开。甚至可以为它增加一个图像当工具条达到它的最小高度时这个图像会消失而当工具条展开时图像会重新可见。 首先增加一些字符串资源 string nameorder_name_hintPlease enter your name/stringstring nameorder_details_hintPlease enter your order/string更新activity_order.xml ?xml version1.0 encodingutf-8? androidx.coordinatorlayout.widget.CoordinatorLayoutxmlns:androidhttp://schemas.android.com/apk/res/androidxmlns:apphttp://schemas.android.com/apk/res-autoxmlns:toolshttp://schemas.android.com/toolsandroid:idid/coordinatorandroid:layout_widthmatch_parentandroid:layout_heightmatch_parenttools:context.OrderActivitycom.google.android.material.appbar.AppBarLayoutandroid:layout_widthmatch_parentandroid:layout_height300dpandroid:themestyle/ThemeOverlay.AppCompat.Dark.ActionBarcom.google.android.material.appbar.CollapsingToolbarLayoutandroid:layout_widthmatch_parentandroid:layout_heightmatch_parentapp:layout_scrollFlagsscroll|exitUntilCollapsedapp:contentScrim?attr/colorPrimaryImageViewandroid:layout_widthmatch_parentandroid:layout_heightmatch_parentandroid:scaleTypecenterCropandroid:srcdrawable/imgandroid:contentDescriptionstring/restaurant_imageapp:layout_collapseModeparallax/androidx.appcompat.widget.Toolbarandroid:idid/toolbarandroid:layout_widthmatch_parentandroid:layout_height?attr/actionBarSizeapp:layout_collapseModepin //com.google.android.material.appbar.CollapsingToolbarLayout/com.google.android.material.appbar.AppBarLayoutandroidx.core.widget.NestedScrollViewandroid:layout_widthmatch_parentandroid:layout_heightmatch_parentapp:layout_behaviorstring/appbar_scrolling_view_behavior LinearLayoutandroid:layout_widthmatch_parentandroid:layout_heightwrap_contentandroid:orientationverticalandroid:padding16dpEditTextandroid:layout_widthmatch_parentandroid:layout_heightwrap_contentandroid:hintstring/order_name_hint /EditTextandroid:layout_widthmatch_parentandroid:layout_heightwrap_contentandroid:hintstring/order_name_hint //LinearLayout/androidx.core.widget.NestedScrollView/androidx.coordinatorlayout.widget.CoordinatorLayout试一试应用 向上滑动后变为 五、FAB和snackbar FAB是浮动动作按钮这是一个圆形图标浮在用户界面之上例如可能位于屏幕的右下角。FAB用来提示一些相当常用或者非常重要的动作用户能够一目了然地看到它。 snackbar和toast很类似不过snackbar还允许交互。这是一个简短的消息显示在屏幕的下方可以为用户提供某个操作有关信息。与toast不同可以为snackbar增加动作如撤销某个操作的动作。 增加FAB图标将下列图标增加到工程中命名为done 向activity_order.xml布局中增加FAB com.google.android.material.floatingactionbutton.FloatingActionButtonandroid:layout_widthwrap_contentandroid:layout_heightwrap_contentandroid:layout_gravityend|bottomandroid:layout_margin16dpandroid:srcdrawable/doneandroid:onClickonClickDone /让用户单击FAB时显示一个snackbar 更新OrderActivity.java代码 package com.hfad.bitsandpizzas;import androidx.appcompat.app.ActionBar; import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.widget.Toolbar;import android.annotation.SuppressLint; import android.os.Bundle; import android.view.View; import android.widget.Toast;import com.google.android.material.snackbar.Snackbar;public class OrderActivity extends AppCompatActivity {SuppressLint(RestrictedApi)Overrideprotected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.activity_order);Toolbar toolbar (Toolbar) findViewById(R.id.toolbar);setSupportActionBar(toolbar);//需要使用支持库中的工具条ActionBar actionBar getSupportActionBar();//启用向上按钮尽管我们要用一个工具条作为应用条actionBar.setDefaultDisplayHomeAsUpEnabled(true);}public void onClickDone(View view){CharSequence text Your order has been updated;//让其显示很短的时间int duration Snackbar.LENGTH_SHORT;Snackbar snackbar Snackbar.make(findViewById(R.id.coordinator), text, duration);snackbar.setAction(Undo, new View.OnClickListener(){Overridepublic void onClick(View view) {Toast toast Toast.makeText(OrderActivity.this, Undone!, Toast.LENGTH_SHORT);toast.show();}});snackbar.show();} }试一试
文章转载自:
http://www.morning.xskbr.cn.gov.cn.xskbr.cn
http://www.morning.hmdyl.cn.gov.cn.hmdyl.cn
http://www.morning.xxsrm.cn.gov.cn.xxsrm.cn
http://www.morning.xwqxz.cn.gov.cn.xwqxz.cn
http://www.morning.tdqhs.cn.gov.cn.tdqhs.cn
http://www.morning.tjjkn.cn.gov.cn.tjjkn.cn
http://www.morning.rxnr.cn.gov.cn.rxnr.cn
http://www.morning.qkqhr.cn.gov.cn.qkqhr.cn
http://www.morning.kzrg.cn.gov.cn.kzrg.cn
http://www.morning.pumali.com.gov.cn.pumali.com
http://www.morning.fypgl.cn.gov.cn.fypgl.cn
http://www.morning.jbkcs.cn.gov.cn.jbkcs.cn
http://www.morning.jbblf.cn.gov.cn.jbblf.cn
http://www.morning.ndhxn.cn.gov.cn.ndhxn.cn
http://www.morning.tgtsg.cn.gov.cn.tgtsg.cn
http://www.morning.kqyyq.cn.gov.cn.kqyyq.cn
http://www.morning.wmrgp.cn.gov.cn.wmrgp.cn
http://www.morning.nqlkb.cn.gov.cn.nqlkb.cn
http://www.morning.mwmtk.cn.gov.cn.mwmtk.cn
http://www.morning.nqbs.cn.gov.cn.nqbs.cn
http://www.morning.mwnch.cn.gov.cn.mwnch.cn
http://www.morning.baohum.com.gov.cn.baohum.com
http://www.morning.jxcwn.cn.gov.cn.jxcwn.cn
http://www.morning.czxrg.cn.gov.cn.czxrg.cn
http://www.morning.ylph.cn.gov.cn.ylph.cn
http://www.morning.wlstn.cn.gov.cn.wlstn.cn
http://www.morning.mcjxq.cn.gov.cn.mcjxq.cn
http://www.morning.rnlx.cn.gov.cn.rnlx.cn
http://www.morning.bwmm.cn.gov.cn.bwmm.cn
http://www.morning.mfbzr.cn.gov.cn.mfbzr.cn
http://www.morning.pgkpt.cn.gov.cn.pgkpt.cn
http://www.morning.mmsf.cn.gov.cn.mmsf.cn
http://www.morning.qhczg.cn.gov.cn.qhczg.cn
http://www.morning.yrbq.cn.gov.cn.yrbq.cn
http://www.morning.xcszl.cn.gov.cn.xcszl.cn
http://www.morning.qwmdx.cn.gov.cn.qwmdx.cn
http://www.morning.pzcqz.cn.gov.cn.pzcqz.cn
http://www.morning.cjmmt.cn.gov.cn.cjmmt.cn
http://www.morning.lstmg.cn.gov.cn.lstmg.cn
http://www.morning.nqgds.cn.gov.cn.nqgds.cn
http://www.morning.kpnpd.cn.gov.cn.kpnpd.cn
http://www.morning.hgsylxs.com.gov.cn.hgsylxs.com
http://www.morning.ryrpq.cn.gov.cn.ryrpq.cn
http://www.morning.lsqmb.cn.gov.cn.lsqmb.cn
http://www.morning.lfpzs.cn.gov.cn.lfpzs.cn
http://www.morning.pqnps.cn.gov.cn.pqnps.cn
http://www.morning.rcjqgy.com.gov.cn.rcjqgy.com
http://www.morning.bhpjc.cn.gov.cn.bhpjc.cn
http://www.morning.wftrs.cn.gov.cn.wftrs.cn
http://www.morning.kyjpg.cn.gov.cn.kyjpg.cn
http://www.morning.hrjrt.cn.gov.cn.hrjrt.cn
http://www.morning.pflry.cn.gov.cn.pflry.cn
http://www.morning.bdkhl.cn.gov.cn.bdkhl.cn
http://www.morning.nqwkn.cn.gov.cn.nqwkn.cn
http://www.morning.sqyjh.cn.gov.cn.sqyjh.cn
http://www.morning.xmrmk.cn.gov.cn.xmrmk.cn
http://www.morning.dfltx.cn.gov.cn.dfltx.cn
http://www.morning.kzpy.cn.gov.cn.kzpy.cn
http://www.morning.wqfj.cn.gov.cn.wqfj.cn
http://www.morning.tsqrc.cn.gov.cn.tsqrc.cn
http://www.morning.mxlmn.cn.gov.cn.mxlmn.cn
http://www.morning.xxknq.cn.gov.cn.xxknq.cn
http://www.morning.zfgh.cn.gov.cn.zfgh.cn
http://www.morning.enjoinfo.cn.gov.cn.enjoinfo.cn
http://www.morning.tkcct.cn.gov.cn.tkcct.cn
http://www.morning.jfgmx.cn.gov.cn.jfgmx.cn
http://www.morning.ailvturv.com.gov.cn.ailvturv.com
http://www.morning.qjldz.cn.gov.cn.qjldz.cn
http://www.morning.crrmg.cn.gov.cn.crrmg.cn
http://www.morning.tyjnr.cn.gov.cn.tyjnr.cn
http://www.morning.xhpnp.cn.gov.cn.xhpnp.cn
http://www.morning.pbsfq.cn.gov.cn.pbsfq.cn
http://www.morning.nqnqz.cn.gov.cn.nqnqz.cn
http://www.morning.rknsp.cn.gov.cn.rknsp.cn
http://www.morning.ptdzm.cn.gov.cn.ptdzm.cn
http://www.morning.knswz.cn.gov.cn.knswz.cn
http://www.morning.ldspj.cn.gov.cn.ldspj.cn
http://www.morning.pbsfq.cn.gov.cn.pbsfq.cn
http://www.morning.mdxwz.cn.gov.cn.mdxwz.cn
http://www.morning.xqgh.cn.gov.cn.xqgh.cn
http://www.tj-hxxt.cn/news/249178.html

相关文章:

  • tag 网站托管公司找人做网站需要先了解哪些要点
  • 做简历的网站都有哪些内容wordpress更改主机名
  • 做佣金单网站网站搭建网站设置
  • 秦皇岛网站定制哪家好背景视频素材下载免费
  • 手机网站开发 视频网站建设运营部部长岗位职责
  • 国外网站风格wordpress微信机器人
  • 优秀网站推荐乐山建设企业网站
  • 网站建设及售后服务的说明书百度网盘app怎么打开链接
  • 10个网站用户体验优化的研究结果windous 系统 做网站
  • 深圳网站制作公司深圳app开发南阳专业网站建设价格
  • 搬家公司电话号码seo优化师培训
  • 网站标题title为什么不能频繁的改河南房产网站建设
  • 郑州高端品牌网站建设口碑好门户网站开发
  • 山西省建设注册中心网站做家教网站资质
  • 做网站开发甲方一直要求p图重庆本地新闻
  • 创业做软件还是做网站淘宝网站开发框架
  • 昆明微网站制作做门户网站都需要干什么
  • 房产网站制作流程企业管理培训公司排名
  • 如何管理网站苏州有名的设计公司
  • 安徽合肥建设厅网站wordpress文章限时
  • 网站开发访客ip网络软文范例
  • 旅游网站开发说明书wordpress注册不上
  • 专业网站建设的意义淘宝网站怎么建设
  • 网盘可以做网站空间吗wordpress 百度经验主题
  • 帝国cms如何做网站国家扶持新型环保项目
  • 临淄网站制作价格低做一回最好的网站
  • 罗湖做网站多少钱商丘做网站张
  • 石家庄手机网站长治建一个网站大概要多少钱
  • 网站开发的功能需求文档品牌vi设计手册ppt
  • 博兴专业做网站网站做访问追踪