My progress bar uses a themed style:
<ProgressBar
android:id="@+id/pbRegister"
style="?android:attr/progressBarStyleHorizontal" <---------
android:indeterminate="true"
android:visibility="invisible"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="0dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/etRegisterPassword2" />
Note the question mark at the front:
?android:attr/progressBarStyleHorizontal
If I remove the question mark like this:
style="android:attr/progressBarStyleHorizontal
then my progress bar is quite different, so it is inheriting values from somewhere else based on my theme.
How can I find out all the details of what that style is inheriting from the theme and re-create it as 1 single style?
Essentially, I want to create a new style like this:
<style name="pbMyProgressBarStyle" parent="?android:attr/progressBarStyleHorizontal">
<item name="android:indeterminate">true</item>
<item name="android:visibility">invisible</item>
<item name="android:layout_width">0dp</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:layout_marginEnd">8dp</item>
<item name="android:layout_marginLeft">8dp</item>
<item name="android:layout_marginRight">8dp</item>
<item name="android:layout_marginStart">8dp</item>
<item name="android:layout_marginTop">0dp</item>
</style>
But I am not able to inherit from the parent style with a ? in it, and if I remove the ? I am missing some details of the style that I want.
question from:
https://stackoverflow.com/questions/65644632/how-can-i-extend-a-themed-style-attribute 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…