Im using the following Styles, ButtonBlue is used normally. Over the Menu the Style should be changed to ButtonBlue.Big the Styles look like this:
<style name="ButtonBlue" parent="android:Widget.Button">
<item name="android:layout_weight">1</item>
<item name="android:backgroundTint">@android:color/holo_blue_bright</item>
</style>
<style name="ButtonBlue.Big" parent="ButtonBlue">
<item name="android:textSize">20sp</item>
</style>
is there a way to change the Style to more than one Button? Because i have 31 Buttons and it would be really a lot of LoC if have to change it manually for every Button with
bt.setTextAppearance(this,R.style.ButtonBlue_Big);
Thanks in advance
Edit: I applied the ButtonBlue Style in the activity.xml
<Button
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/buttonInvert"
style="@style/ButtonBlue"
android:id="@+id/buttonInvert"
android:onClick="buttonOnClick"/>
But my problem is, that i don't know how i can apply the new Style via Button in the Java-Code
public boolean onOptionsItemSelected(MenuItem item) {
int id = item.getItemId();
if (id == R.id.number_small) {
//apply the Style here
return true;
}
return super.onOptionsItemSelected(item);
}