Android Theme에서 길을 잃으면 보는 자료.

7404 단어 Androidtheme
Android의 Theme는 새로운 프로젝트를 시작할 때마다 조사를 하기 때문에 보살핌을 받은 자료를 정리해야 합니다.

기본 매개 변수(예:colorPrimary)를 적용하는 곳



via Android 테마 Material의 색상 설정 1

재료 어셈블리 공식 문서

  • Color Theming - Material Components for Android
  • Dark Theme - Material Components for Android
  • Shape Theming - Material Components for Android
  • Typography Theming - Material Components for Android
  • 코드 샘플via DroidKaigi 2019


    DroidKaigi/conference-app은 설치 코드를 보고 싶으면 먼저 찾으세요. 참고할 수 있습니다.
    
    <?xml version="1.0" encoding="utf-8"?>
    <resources>
        <!-- Base application theme. -->
        <style name="Platform.AppTheme" parent="Theme.MaterialComponents.Light.NoActionBar">
        </style>
    
        <style name="AppTheme" parent="Platform.AppTheme">
            <!-- Customize your theme here. -->
            <item name="colorPrimary">@color/colorPrimary</item>
            <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
            <item name="colorSecondary">@color/colorSecondary</item>
            <item name="colorAccent">@color/colorPrimary</item>
            <item name="android:windowDrawsSystemBarBackgrounds">true</item>
            <item name="android:statusBarColor">@android:color/transparent</item>
            <item name="searchViewStyle">@style/SearchViewStyle</item>
            <item name="filterChipStyle">@style/Widget.App.FilterChip</item>
    
            <!-- see https://github.com/material-components/material-components-android/blob/2997b6995f32bbd7f7a4f24f4030278a50c15e6f/docs/theming/Typography.md -->
            <item name="textAppearanceHeadline5">@style/TextAppearance.App.Headline5</item>
            <item name="textAppearanceHeadline6">@style/TextAppearance.App.Headline6</item>
            <item name="textAppearanceSubtitle1">@style/TextAppearance.App.Subtitle1</item>
            <item name="textAppearanceSubtitle2">@style/TextAppearance.App.Subtitle2</item>
            <item name="textAppearanceBody1">@style/TextAppearance.App.Body1</item>
            <item name="textAppearanceBody2">@style/TextAppearance.App.Body2</item>
            <item name="textAppearanceCaption">@style/TextAppearance.App.Caption</item>
        </style>
    
        <style name="AppTheme.WithActionBar">
            <item name="windowActionBar">true</item>
            <item name="windowNoTitle">false</item>
            <item name="colorPrimary">@android:color/white</item>
        </style>
    
        <style name="SearchViewStyle" parent="Widget.AppCompat.SearchView">
            <item name="searchHintIcon">@null</item>
        </style>
    </resources>
    
    via conference-app-2019/themes.xml
    다른values의 xml은 다음과 같습니다.
    conference-app-2019/corecomponent/androidcomponent/src/main/res/values

    좋은 웹페이지 즐겨찾기