android-dialogfragment

DialogFragment not appearing

若如初见. 提交于 2019-12-13 03:54:14
问题 For some reason, a DialogFragment that I've just created won't appear whenever I try to launch it from a click event. Why does the dialog not have a view, when my view has been clearly set builder.setView(rootView) ? Fragment does not have a view click event to launch DialogFragment holder.myButton.setOnClickListener { val dialog = MyDialog() val manager = (holder.itemView.context as FragmentActivity).supportFragmentManager dialog.show(manager, "example") } DialogFragment class MyDialog :

How to show the image outside the dialog in android?

我是研究僧i 提交于 2019-12-12 22:32:18
问题 I trying to show the profile image in topside of the dialog fragment with half outside the image.and i attach the sample dialog in below, like that.And tried all FrameLayout collaboration from old Stackoverflow solutions, But i cant able to archive this. Please give me correct solution. Thankyou. Updated I also tried to make transparent the ImageView parent layout but it's not working in after dialog show. i attach my xml and result screen shot below. <RelativeLayout xmlns:android="http:/

Android ShowDialog : IllegalStateException: Can not perform this action after onSaveInstanceState

[亡魂溺海] 提交于 2019-12-12 16:09:11
问题 In runOnUiThread() of an Activity, I'm trying to show a ProgressDialog. FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction(); ProgressDialogFragment mProgressDialogFragment = new ProgressDialogFragment(); mProgressDialogFragment.show(fragmentTransaction, TAG); Here ProgressDialogFragment extends DialogFragment . I have tested this in many devices and didn't get any crash. But whereas in Asus, I'm constantly getting the below crash whenever I show the dialog

DialogFragment with Roboelctric

时光毁灭记忆、已成空白 提交于 2019-12-12 11:27:36
问题 I wanted to test if a dialog Fragment is shown or not, with Roboelectric . public class SomeDialogActivity extends FragmentActivity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); DialogFragment someDialogFragment = new SomeDialogFragment(); someDialogFragment.show(getSupportFragmentManager(), "some_dialog"); } } Now I wanted to test if this dialog is shown, something like this: @Test public void

Android full screen dialog appears transparent and in the wrong position

拈花ヽ惹草 提交于 2019-12-12 10:53:17
问题 I'm trying to add a dialog to my android app which is full screen on small devices (e.g. mobile phone) but a standard dialog on large devices (e.g. tablets). This follows the logic laid out in the material design specification. Using the official android dialog guide, using a DialogFragment, I end up with a transparent dialog that overlays the action bar: Below is the source code. main.xml <?xml version="1.0" encoding="utf-8"?> <android.support.design.widget.CoordinatorLayout xmlns:android=

AlertDialog Default Button Divider Removal

こ雲淡風輕ζ 提交于 2019-12-12 05:24:43
问题 The problem is that whenever a single item array is passed into the DialogFragment, there is an extra line (a divider perhaps) that is drawn above the cancel button. Single Item AlertDialog When there are multiple items in the array, the dialog appears correctly. Multi-item AlertDialog How can I get rid of the extra line in the single item alert dialog? I'm using a DialogFragment to create an AlertDialog with an array resource @Override public Dialog onCreateDialog(Bundle savedInstanceState)

RecycleView not showing in Dialogue Fragment

丶灬走出姿态 提交于 2019-12-12 04:37:51
问题 I have a Dialogue Fragment which a RecycleView will shown inside it.This is driving me crazy,cause I almost see all the SO question about RecycleView not show up problem,but still not solving my problem.Please take a look in my code Here is my Fragment.xml <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent"> <LinearLayout android

How to remove “OK” button from Dialog fragment in Android

南笙酒味 提交于 2019-12-12 04:16:58
问题 I'm trying to remove the OK button completely so that an item is automatically clicked when selected. I noticed that this is Android's preferred way of doing it. I don't need a "cancel" button because I want to prevent null selected. Dialog Fragment public class SingleChoiceClass extends DialogFragment {` final CharSequence[] items = {"b1", "b2", "b3", "b4"}; String selection; @NonNull @Override public Dialog onCreateDialog(Bundle savedInstanceState) { AlertDialog.Builder builder = new

Android - how to set dialog's outer margin

大兔子大兔子 提交于 2019-12-12 01:43:28
问题 I know that this question have been asked a few times, but none of the solutions I came across worked for me, hence this topic. As the title states - I want to set dialog's outer margin: PurchaseDetailsDialogFragment public class PurchaseDetailsDialogFragment extends DialogFragment { private static final String MAX_AMOUNT = "maxAmount"; private static final String UNIT_PRICE = "unitPrice"; private static final String PICKUP_TIME_FROM = "pickupTimeFrom"; private static final String PICKUP_TIME

how to make a sington dialog

旧城冷巷雨未停 提交于 2019-12-12 01:35:49
问题 In android app, having a few activities with multiple fragments. Those activities or fragment could be running alive even if it's not on the top of the backStack, and receiving notifications from different services. When some event happens it is required to show a dialog to communicate with user. The activity or fragment on top of the stack may not have the handler for that event. Any other activity or fragment who is interested should react to open one dialog to the user. The problem is the