Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android override default dialog theme

I want to create a custom style for an activity that will look like a dialog. But i want to put this dialog at the top right of the screen, and also set is background to transparent.

I have setted the activity theme to @android:style/Theme.Dialog but now i want to override the existing theme but i have not found this theme in my sdk folder.

Can someone tell me how can i change the default dialog theme?

like image 860
Allrast Avatar asked Jul 10 '26 13:07

Allrast


1 Answers

You can define Styles for customizing any View.

For example:

<style name="Theme.Dialog">
    <item name="android:windowFrame">@null</item>
    <item name="android:windowTitleStyle">@android:style/DialogWindowTitle</item>
    <item name="android:windowBackground">@android:drawable/transparent</item>
    <item name="android:windowIsFloating">true</item>
    <item name="android:windowContentOverlay">@null</item>
    <item name="android:windowAnimationStyle">@android:style/Animation.Dialog</item>
    <item name="android:windowSoftInputMode">stateUnspecified|adjustPan</item>
</style>
like image 188
Paresh Mayani Avatar answered Jul 14 '26 21:07

Paresh Mayani



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!