I'm using the three parameter super constructor and pass the button style resource id. This works for all my custom themes. Thanks @pskink for pointing me into right direction.
public ClockButton(Context context, AttributeSet attrs) {
super(context, attrs, R.attr.buttonStyle);
...
}
My theme looks like this:
<style name="LilaTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="buttonStyle">@style/ButtonmyTimeLila</item>
</style>
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…