MaxI, MinI, цифры отсутствуют в android xml - PullRequest
0 голосов
/ 17 апреля 2020

Так что, пока я пытаюсь построить приложение AOSP Settings, я получаю эту ошибку

warn: removing resource com.android.settings:string/lineagelicense_title without required default value.
    warn: removing resource com.android.settings:string/lockscreen_visualizer_title without required default value.
    packages/apps/Settings/res/layout/preference_dialog_animation_scale.xml:38: error: attribute com.android.settings:digits not found.
    packages/apps/Settings/res/layout/preference_dialog_animation_scale.xml:38: error: attribute com.android.settings:maxI not found.
    packages/apps/Settings/res/layout/preference_dialog_animation_scale.xml:38: error: attribute com.android.settings:minI not found.

Если я прав, схема в файле xml должна решить эту проблему, но она не работает. Вот файл макета XML.

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:settings="http://schemas.android.com/apk/res/com.android.settings"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:padding="12dp">

        <!-- Static height enough to accommodate the text views in their biggest possible size,
        without having the dialog resize itself at any point. -->
        <LinearLayout android:id="@+id/container"
                 android:orientation="vertical"
                 android:layout_width="match_parent"
                 android:layout_height="64dp"
                 android:gravity="center_horizontal|center_vertical">

                <TextView android:id="@+id/scale"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:textAppearance="?android:textAppearanceLarge" />

        </LinearLayout>

        <com.android.settings.IntervalSeekBar android:id="@+id/scale_seekbar"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:padding="8dp"
                android:layout_below="@+id/container"
                settings:minI="0"
                settings:maxI="10"
                settings:defaultValue="1.0"
                settings:digits="1" />

</RelativeLayout>

1 Ответ

0 голосов
/ 18 апреля 2020

Итак, я сам нашел решение этой проблемы. MinI, maxI и цифры были определены в классе com. android .settings.IntervalSeekBar. Это на самом деле настраиваемые атрибуты, и их необходимо объявить в другом атрибуте. xml. Как только я это сделал, ошибка была решена.

Надеюсь, это будет полезно для тех, кто может столкнуться с такими проблемами в будущем.

Спасибо.

...