视图层

UI逻辑

色调

颜色 说明
colorPrimary #3F51B5 toolbar颜色
colorPrimaryDark #2735b3 状态栏颜色
colorAccent #FF4081 组件的颜色
black #5a3bf5 背景色(暂时没有)

工具栏

  • 不做左边返回Home功能

内容部分

  • 使用Activity,不适用Fragment

导航栏

  • 不需要改变

兼容性

  • v21需要状态栏颜色
  • v21需要点击水波纹效果

列表

  • 采用RecycleView组件
  • 不需要下拉刷新

列表项

  • 采用CardView组件为RootView

资源

res/values/colors.xml


<?xml version="1.0" encoding="utf-8"?>
<resources>
    <color name="colorPrimary">#3F51B5</color>
    <color name="colorPrimaryDark">#2735b3</color>
    <color name="colorAccent">#FF4081</color>
    <color name="black">#5a3bf5</color>
</resources>

res/values/style.xml




<resources>

    <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
        <!-- Customize your theme here. -->
        <item name="colorPrimary">@color/colorPrimary</item>
        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
        <item name="colorAccent">@color/colorAccent</item>
    </style>


    <style name="AppTheme.NoActionBar">
        <item name="windowActionBar">false</item>
        <item name="windowNoTitle">true</item>
    </style>


    <style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar"/>
    <style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light"/>

</resources>

res/values-v21/style.xml


<!--AppTheme.NoActionBar主要给活动使用-->
<resources>
    <style name="AppTheme.NoActionBar">
        <item name="windowActionBar">false</item>
        <item name="windowNoTitle">true</item>
        <item name="android:windowDrawsSystemBarBackgrounds">true</item>
        <item name="android:statusBarColor">@android:color/transparent</item>
        <item name="android:windowTranslucentStatus">true</item>
    </style>

    <!--AppTheme主要给整个app使用-->
    <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
        <!-- Customize your theme here. -->
        <item name="colorPrimary">@color/colorPrimary</item>
        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
        <item name="colorAccent">@color/colorAccent</item>
    </style>
</resources>

res/drawable-系列

res/drawable-v21/custom_ripple.xml

  自定义水波纹颜色,本项目没有使用


<?xml version="1.0" encoding="utf-8"?>
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
        android:color="#FFbec5c9"
    >
</ripple>

总配置AndroidManifest.xml


<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.hzj163.mysqlitedb" >

    <!--android:theme="@style/AppTheme"-->
    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >

        <!-- android:theme="@style/AppTheme.NoActionBar"-->
        <activity
            android:name=".MainActivity"
            android:label="@string/app_name"
            android:theme="@style/AppTheme.NoActionBar" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

        <!-- android:theme="@style/AppTheme.NoActionBar"-->
        <activity android:name=".AddActivity" android:theme="@style/AppTheme.NoActionBar"></activity>

        <!-- android:theme="@style/AppTheme.NoActionBar"-->
        <activity android:name=".EditActicity" android:theme="@style/AppTheme.NoActionBar"></activity>
    </application>

</manifest>