Android Design Note

关于android app设计的一些笔记。


-Tabs are most appropriate for small sets (4 or fewer) of section-related screens. 

tab最适合4组或4组以下的分区内容

-Tab switches should not be treated as history. For example, if a user switches from a tab Ato another tab B, pressing the Back button (more on that in the next lesson) should not re-select tab A

tab切换不应该记录历史操作(点击back不应该回到上个tab)

-tabs should always run along the top of the screen, and should not be aligned to the bottom of the screen.tab应该在屏幕顶部。而不是底部。

Use primarily one type of button per container. Only mix button types when you have a good reason to, such as emphasizing an important function.每个container中使用一种主要的button类型(Float, Raised, Flat Button ),除非你有足够好的理由去混用button(比如需要强调某个button的功能)。

-you can declare the logical parent of each activity by specifying theandroid:parentActivityName attribute in the <activity> element.

通过在manifest文件中,指定activity的"android: parentActivityName"属性来指定其逻辑上的父Activity。(以实现向上)


-新版本的 Design Support Library(23.1.0)现在AppBarLayout里面包含了一个新的layout_scrollFlag :SCROLL_FLAG_SNAP。在滚动结束后,如果view只是部分可见,它将滑动到最近的边界。比如,如果view的底部只有25%可见,它将滚动离开屏幕,而如果底部有75%可见,它将滚动到完全显示。这意味着如果你实现自己的behaviour或者与AppbarLayout有关的东西,滚动不会在处于中间状态的时候停止。方法很简单:在AppbarLayout的子控件里加上app:layout_scrollFlags="scroll|exitUntilCollapsed|snap

-添加MD转场动画的特效,ActivityOptionsCompat.makeSceneTrasitionAnimation的第二个参数是shareView也就是自然过渡的那个公用的view。第三个参数是这个view的String类型的name。

Intent intent = new Intent(MainActivity.this, ViewerActivity.class);
intent.putExtra("index", position);

ActivityOptionsCompat options = ActivityOptionsCompat
        .makeSceneTransitionAnimation(this, itemView, adapter.get(position).url);
startActivity(intent, options.toBundle());

-toolbar的两个theme,终于搞清楚区别了:

android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
<!--设置Dark表示actionBar的文字颜色为黑色-->
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"/>
<!--设置Light主题使得toolbar的overflow menu变成白色风格-->
使用
<item name="windowActionModeOverlay">true</item>
来使文本复制时,ActionMode覆盖toolbar。【注意,加android: 前缀会使windowActionModeOverlay属性无效(用的是toolbar)】

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值