Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Dialog newServerDialog = new Dialog(getContext(), R.style.CustomDialogStyleServerDetails);
- newServerDialog.setContentView(newServerDialogLayout);
- newServerDialog.setTitle(R.string.server_details_new_title_text);
- newServerDialog.getWindow().setLayout(
- android.view.ViewGroup.LayoutParams.FILL_PARENT,
- android.view.ViewGroup.LayoutParams.WRAP_CONTENT);
- newServerDialog.setCancelable(true);
- <style name="CustomDialogStyleServerDetails" parent="@android:style/Theme.Dialog">
- <item name="android:background">@drawable/server_details_background_repeat</item>
- <item name="android:windowTitleStyle">@style/DialogWindowTitle</item>
- </style>
- <style name="DialogWindowTitle">
- <item name="android:maxLines">1</item>
- <item name="android:scrollHorizontally">true</item>
- <item name="android:textAppearance">@style/customDialogTextAppearance</item>
- <item name="android:gravity">center_horizontal|center_vertical</item>
- <item name="android:background">@drawable/server_details_title_background_repeat</item>
- </style>
- ContextThemeWrapper mTheme = new ContextThemeWrapper(this,
- R.style.CustomDialogStyleServerDetails);
- mInflater = (LayoutInflater) getBaseContext().getSystemService(
- LAYOUT_INFLATER_SERVICE);
- ContextThemeWrapper mTheme = new ContextThemeWrapper(this,
- R.style.CustomDialogStyleServerDetails);
- mView = mInflater.inflate(R.layout.YOUR_XML_LAYOUT_FILE, null);
- mDialog = new Dialog(mTheme);
- mDialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
- mDialog.setContentView(this.mView);
- mDialog.show();
Add Comment
Please, Sign In to add comment