bingoogolapple / bingoogolapple.github.io

个人主页。同时也通过 Issues 记录学习笔记
http://www.bingoogolapple.cn
86 stars 22 forks source link

Android5.0学习笔记 #97

Open bingoogolapple opened 8 years ago

bingoogolapple commented 8 years ago

主题样式

themecolors

android:colorPrimaryDark 应用的主要暗色调,statusBarColor默认使用该颜色
android:statusBarColor 状态栏颜色,默认使用colorPrimaryDark
android:colorPrimary 应用的主要色调,actionBar默认使用该颜色
android:windowBackground 窗口背景颜色
android:navigationBarColor 底部栏颜色
android:colorForeground 应用的前景色,ListView的分割线,switch滑动区默认使用该颜色
android:colorBackground 应用的背景色,popMenu的背景默认使用该颜色
android:colorAccent 一般控件的选种效果默认采用该颜色
android:colorControlNormal 控件的默认色调 
android:colorControlHighlight 控件按压时的色调
android:colorControlActivated 控件选中时的颜色,默认使用colorAccent
android:colorButtonNormal 默认按钮的背景颜色
android:textColor Button,textView的文字颜色
android:textColorPrimaryDisableOnly RadioButton checkbox等控件的文字
android:textColorPrimary 应用的主要文字颜色,actionBar的标题文字默认使用该颜色
bingoogolapple commented 8 years ago

触摸反馈

// 沿着中心的缩小的动画
view.setOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View v) {
        Animator animator = ViewAnimationUtils.createCircularReveal(view, view.getWidth() / 2, view.getHeight() / 2, view.getWidth() / 2, 0);
        animator.setInterpolator(new LinearInterpolator());
        animator.setDuration(1000);
        animator.start();
    }
});

// 从左上角扩展的圆形动画
view.setOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View v) {
        Animator animator = ViewAnimationUtils.createCircularReveal(view,0,0,0,(float) Math.hypot(view.getWidth(), view.getHeight()));
        animator.setDuration(1000);
        animator.start();
    }
});