次のような android attrs.xml (data/res/values/attrs.xml) で宣言されたディメンション定数が表示されます。
<attr name="padding" format="dimension" />
<!-- Sets the padding, in pixels, of the left edge; see {@link android.R.attr#padding}. -->
<attr name="paddingLeft" format="dimension" />
<!-- Sets the padding, in pixels, of the top edge; see {@link android.R.attr#padding}. -->
<attr name="paddingTop" format="dimension" />
<!-- Sets the padding, in pixels, of the right edge; see {@link android.R.attr#padding}. -->
<attr name="paddingRight" format="dimension" />
私が正しければ、値は
./data/res/values/styles.xml
as <item name="android:paddingLeft">20dp</item>
などで定義されています。
これらはある種の「優先」ディメンション値ですか。これらの値はリリース間で比較的安定しているので、これらの定数を直接使用しても外観に影響はありません。
ありがとう。
編集:
少し明確にするために、ビューレイアウトでこれらの「Android」定義の値を使用することの意味を疑問に思っていました。
<TextView android:text="@string/text"
android:layout_width="wrap_content"
android:layout_height="?android:attr/listPreferredItemHeightSmall"
android:paddingStart="?android:attr/expandableListPreferredItemPaddingLeft"/>
これらの値を定義する代わりに、android 名前空間で参照しています。そうしても安全ですか?