안드로이드) 폰트 일괄적용이 텍스트뷰 이외에는 되지않습니다..

조회수 40회

themes.xml (style.xml)

<resources xmlns:tools="http://schemas.android.com/tools" xmlns:android="http://schemas.android.com/apk/res/android">
    <!-- Base application theme. -->
    <style name="Theme.WriteWeight" parent="Theme.MaterialComponents.DayNight.NoActionBar">
        <!-- Primary brand color. -->
        <item name="colorPrimary">@color/purple_500</item>
        <item name="colorPrimaryVariant">@color/light_green_dark</item>
        <item name="colorOnPrimary">@color/white</item>
        <!-- Secondary brand color. -->
        <item name="colorSecondary">@color/teal_200</item>
        <item name="colorSecondaryVariant">@color/teal_700</item>
        <item name="colorOnSecondary">@color/black</item>
        <!-- Status bar color. -->
        <item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>
        <!-- Customize your theme here. -->


        <!-- 폰트 일괄 적용 -->
        <item name="android:textViewStyle">@style/TextViewFont</item>
        <item name="android:buttonStyle">@style/ButtonStyle</item>
        <item name="chipStyle">@style/ChipStyle</item>
    </style>

    <style name="TextViewFont" parent="@android:style/Widget.DeviceDefault.TextView">
        <item name="android:fontFamily">@font/noto_sans_kr_font_family</item>
        <item name="android:includeFontPadding">false</item>
    </style>

    <style name="ButtonStyle" parent="@android:style/Widget.DeviceDefault.Button">
        <item name="android:fontFamily">@font/noto_sans_kr_regular</item>
        <item name="android:includeFontPadding">false</item>
        <item name="backgroundTint">@color/light_green</item>
    </style>

    <style name="ChipStyle" parent="Widget.MaterialComponents.Chip.Choice">
        <item name="android:fontFamily">@font/noto_sans_kr_regular</item>
        <item name="android:includeFontPadding">false</item>
    </style>
</resources>

noto_sans_kr_font_family.xml

<?xml version="1.0" encoding="utf-8"?>
<font-family xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:fontSize="http://schemas.android.com/tools">

    <!-- app: 네임스페이스를 사용하는 이유는 api 레벨 26미만에서도 이 파일을 사용하기 위함 -->
    <!-- Font Resource File.xml은 api 레벨 26이상에서 사용가능 함   -->

    <!-- thin -->
    <font
        android:font="@font/noto_sans_kr_thin"
        android:fontStyle="normal"
        android:fontWeight="100"
        app:font="@font/noto_sans_kr_thin"
        app:fontStyle="normal"
        app:fontWeight="100"/>

    <!-- light -->
    <font
        android:font="@font/noto_sans_kr_light"
        android:fontStyle="normal"
        android:fontWeight="300"
        app:font="@font/noto_sans_kr_light"
        app:fontStyle="normal"
        app:fontWeight="300"/>

    <!-- regular -->
    <font
        android:font="@font/noto_sans_kr_regular"
        android:fontStyle="normal"
        android:fontWeight="400"
        app:font="@font/noto_sans_kr_black"
        app:fontStyle="italic"
        app:fontWeight="400" />
</font-family>

layout1.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="300dp"
    android:layout_height="wrap_content"
    xmlns:tools="http://schemas.android.com/tools"
    android:orientation="vertical"
    android:backgroundTint="@color/light_green">

    <FrameLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@drawable/border_dialog">
        <androidx.recyclerview.widget.RecyclerView
            android:id="@+id/rcy_part"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="@color/white"
            tools:listitem="@layout/body_part_item"/>
    </FrameLayout>

    <Button
        android:id="@+id/check"
        android:layout_width="300dp"
        android:layout_height="wrap_content"
        android:text="시      작"
        android:textSize="27dp"
        android:backgroundTint="@color/light_green"/>
</LinearLayout>

layout2

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    xmlns:app="http://schemas.android.com/apk/res-auto">
    <HorizontalScrollView
        android:id="@+id/horizontal_scroll"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        app:layout_constraintBottom_toTopOf="@id/routine_list_recycler"
        android:scrollbars="none"
        android:overScrollMode="never">
        <com.google.android.material.chip.ChipGroup
            android:id="@+id/routine_chipgroup"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:padding="10dp"
            app:chipSpacingHorizontal="10dp"
            app:singleLine="true"
            app:singleSelection="true"
            style="@style/ChipStyle">
            <com.google.android.material.chip.Chip
                android:id="@+id/chip_back"
                android:layout_width="55dp"
                android:layout_height="wrap_content"
                android:textAlignment="center"
                android:gravity="center_horizontal"
                android:text="  등  "
                app:rippleColor="@color/light_green"
                style="@style/CustomChipChoice"/>
            <com.google.android.material.chip.Chip
                android:id="@+id/chip_chest"
                android:layout_width="55dp"
                android:layout_height="wrap_content"
                android:textAlignment="center"
                android:gravity="center_horizontal"
                android:text="가슴"
                app:rippleColor="@color/light_green"
                style="@style/CustomChipChoice"/>
            <com.google.android.material.chip.Chip
                android:id="@+id/chip_leg"
                android:layout_width="55dp"
                android:layout_height="wrap_content"
                android:textAlignment="center"
                android:gravity="center_horizontal"
                android:text="하체"
                app:rippleColor="@color/light_green"
                style="@style/CustomChipChoice"/>
            <com.google.android.material.chip.Chip
                android:id="@+id/chip_sholuder"
                android:layout_width="55dp"
                android:layout_height="wrap_content"
                android:textAlignment="center"
                android:gravity="center_horizontal"
                android:text="어깨"
                app:rippleColor="@color/light_green"
                style="@style/CustomChipChoice"/>
            <com.google.android.material.chip.Chip
                android:id="@+id/chip_biceps"
                android:layout_width="55dp"
                android:layout_height="wrap_content"
                android:textAlignment="center"
                android:gravity="center_horizontal"
                android:text="이두"
                app:rippleColor="@color/light_green"
                style="@style/CustomChipChoice"/>
            <com.google.android.material.chip.Chip
                android:id="@+id/chip_triceps"
                android:layout_width="55dp"
                android:layout_height="wrap_content"
                android:textAlignment="center"
                android:gravity="center_horizontal"
                android:text="삼두"
                app:rippleColor="@color/light_green"
                style="@style/CustomChipChoice"/>
            <com.google.android.material.chip.Chip
                android:id="@+id/chip_abs"
                android:layout_width="55dp"
                android:layout_height="wrap_content"
                android:textAlignment="center"
                android:gravity="center_horizontal"
                android:text="복근"
                app:rippleColor="@color/light_green"
                style="@style/CustomChipChoice"/>
        </com.google.android.material.chip.ChipGroup>
    </HorizontalScrollView>

    <View
        android:id="@+id/horizontal_bar"
        android:layout_width="match_parent"
        android:layout_height="0.5dp"
        android:background="@color/light_green"
        app:layout_constraintTop_toBottomOf="@id/horizontal_scroll"
        app:layout_constraintBottom_toTopOf="@id/routine_list_recycler"/>

    <androidx.recyclerview.widget.RecyclerView
        android:id="@+id/routine_list_recycler"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/horizontal_bar" />
</androidx.constraintlayout.widget.ConstraintLayout>

앱 모든 폰트를 바꾸고 싶어서 이것저것 해보는데.. 구글 검색해봐도 다 위 방법대로 나오길래

따라했더니 TextView만 적용되고 버튼, Chip등은 적용되질 않습니다.

그나마 버튼은 직접 style=""으로 지정하면 적용은되던데 Chip은 그마저도 안되네요..

무엇때문에 안되는건가요?

답변을 하려면 로그인이 필요합니다.

Hashcode는 개발자들을 위한 무료 QnA 사이트입니다. 계정을 생성하셔야만 답변을 작성하실 수 있습니다.

(ಠ_ಠ)
(ಠ‿ಠ)

ᕕ( ᐛ )ᕗ
로그인이 필요합니다

Hashcode는 개발자들을 위한 무료 QnA사이트 입니다. 계정을 생성하셔야만 글을 작성하실 수 있습니다.