Android: App Compat Theme - Dialog When Large

2020-06-13 20:17发布

I want to use AppCompat library, however there is no Dialog theme, and there is no DialogWhenLarge theme which I can either extend or use.

Is there a way I can extend the base theme and make it DialogWhenLarge, probably using folders and custom styling items.

Thanks

1条回答
Emotional °昔
2楼-- · 2020-06-13 20:33

Closing this ticket down. For anyone who would like the answer see this.

ActionBar in a DialogFragment

and this custom style in folder values-large

<style name="AppBaseTheme" parent="@style/Theme.AppCompat.Light">
    <!-- API 14 theme customizations can go here. -->
</style>

 <style name="MyAppCompatDialogTheme" parent="AppBaseTheme">
    <item name="android:windowIsFloating">false</item>
    <item name="android:windowContentOverlay">@null</item>
    <item name="android:windowSoftInputMode">stateAlwaysHidden</item>
    <item name="android:windowActionModeOverlay">true</item>
    <item name="android:windowIsTranslucent">true</item>
</style>

However I think I have decided to go down the route of using a DialogFragment which i can then load into an activity on the phone, or show as a dialog on tablet, rather than this semi-mashed way of turning an activity into a dialog.

查看更多
登录 后发表回答