In my application i am using alert dialog with rounded rectangle theme.But it have alertdialog rectangle and my theme.My problem is how to replace alert dialog border like dialog.I want to show this set item with own theme only.
I want output this manner instead of the above theme:
Main Activity:
AlertDialog.Builder alertSeverity = new AlertDialog.Builder(
getActivity(), R.style.Theme_CustomDialog);
alertSeverity.setTitle("Severity Status");
CharSequence[] severityStatus = { "Low-Severity",
"Middle-Severity", "High-Severity" };
alertSeverity.setItems(severityStatus,
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
}
});
My Theme:
<style name="Theme.CustomDialog" parent="android:style/Theme.Dialog">
<item name="android:windowBackground">@drawable/shapedialogtheme</item>
<item name="android:windowFrame">@null</item>
</style>
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
<solid android:color="#565656" />
<stroke
android:width="5dp"
android:color="#ffff8080" />
<corners android:radius="30dp" />
<padding
android:bottom="10dp"
android:left="10dp"
android:right="10dp"
android:top="10dp" />
<size
android:width="150dp"
android:height="150dp"/>
</shape>
You can not remove border from alert dialog.
use this
and try this below function for show, hide and clear dialog
You need to design a custom dialog for this purpose :
You can then make different class for the particular dialog like this:
Then you can call the custom dialog in your main class by using the following code :
Use Dialog instead of AlertDialog
Style.xml
call.xml
call_bg.xml
Main thing is that you have to make layout backgrpund transparent otherwise you will not able to get output as you want.
you can use popwindow for more style by yourself
Use Dialog instead of AlertDialog.
Create your custom layout which you want to show in dialog and setContent in dialog. Apply this theme
android.R.style.Theme_Translucent_NoTitleBar
in dialog it will hide border.Here is sample code.
Updated:
just tried this in AlertDialog.
try the next solution:
extend from dialog, and set the exact view to use by using setContentView .
the alertDialog is used for some functionalities. it's not that it can do anything you want.
maybe instead of extending you could take the dialog and then use the setContentView.