80,490
社区成员
发帖
与我相关
我的任务
分享<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?rootViewBg"
>
<Button
android:id="@+id/bt"
android:text="修改主题"
android:layout_width="match_parent"
android:layout_height="60dp"
/>
<view.CircleProgress
android:id="@+id/circle_progress_welcome"
android:layout_centerInParent="true"
android:layout_width="150dp"
android:layout_height="150dp"
/>
<TextView
android:layout_marginBottom="40dp"
android:layout_centerHorizontal="true"
android:layout_alignParentBottom="true"
android:typeface="serif"
android:textStyle="bold"
android:text="@string/wasu_phone_tv"
android:textSize="30sp"
android:textColor="?textColor"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:layout_marginBottom="10dp"
android:layout_centerHorizontal="true"
android:layout_alignParentBottom="true"
android:textColor="@color/white"
android:text="@string/verion_info"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</RelativeLayout>
<resources>
<!-- Declare custom theme attributes that allow changing which styles are
used for button bars depending on the API level.
?android:attr/buttonBarStyle is new as of API 11 so this is
necessary to support previous API levels. -->
<attr name="rootViewBg" format="color"/>
<attr name="titleBg" format="color"/>
<attr name="buttonBg" format="color"/>
<attr name="textColor" format="color"/>
<attr name="buttonTextColor" format="color"/>
</resources>
<resources>
<!-- Base application theme. -->
<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="FullscreenTheme" parent="AppTheme">
<item name="android:actionBarStyle">@style/FullscreenActionBarStyle</item>
<item name="android:windowActionBarOverlay">true</item>
<item name="android:windowBackground">@null</item>
<item name="metaButtonBarStyle">?android:attr/buttonBarStyle</item>
<item name="metaButtonBarButtonStyle">?android:attr/buttonBarButtonStyle</item>
</style>
<style name="FullscreenActionBarStyle" parent="Widget.AppCompat.ActionBar">
<item name="android:background">@color/black_overlay</item>
</style>
<!--日间模式-->
<style name="Theme_Day" parent="AppTheme">
<item name="rootViewBg">#660099</item>
<item name="textColor">#FFFFFF</item>
<item name="buttonBg">#383838</item>
<item name="buttonTextColor">#008888</item>
</style>
<!--夜间模式-->
<style name="Theme_Night" parent="AppTheme">
<item name="rootViewBg">#006600</item>
<item name="textColor">#000000</item>
<item name="buttonBg">#000090</item>
<item name="buttonTextColor">#008811</item>
</style>
</resources>