android-dialogfragment

How to change background color of the snackbar?

一世执手 提交于 2019-11-30 06:18:57
问题 I am showing snackbar in DialogFragment Within the Positive click of alertDialog. Here is my code snippet. Snackbar snackbar = Snackbar.make(view, "Please enter customer name", Snackbar.LENGTH_LONG) .setAction("Action", null); View sbView = snackbar.getView(); sbView.setBackgroundColor(Color.BLACK); snackbar.show(); I am passing view of the dialogfragment to the snackbar. I want the background color black? How can I do this? I am returning alertDialog in the DialogFragment. And the theme I am

Can't get transparent DialogFragment

岁酱吖の 提交于 2019-11-30 05:27:31
I have a dialog Fragment which look like that. AlertDialog ad = builder.create(); Drawable d = new ColorDrawable(Color.BLACK); d.setAlpha(130); ad.getWindow().setBackgroundDrawable(d); This code get background semi transparent. But I still got a white part on the bottom. I want to get rid of the white to just have semi transparent background I already tried a lot of stuff that I saw in other posts. I don't know what is the object that I must change between the DialogFragment, the AlertDialog and the LinearLayout. It may not be the LinearLayout, because when I increase margin, nothing is moving

Android: How to have dialogFragment to fullscreen

耗尽温柔 提交于 2019-11-30 05:10:49
Hello I have tried to override the theme to the dialogFragment for fullscreen but the full screen I wanted was an overlay on top of the previous activity so when the dialogFragment is opened, we still can see back activity from the padding between the screen and the dialogFragment. This is the style I have used for full screen <style name="fullscreen_dialog" parent="android:Theme" > <item name="android:windowNoTitle">true</item> <item name="android:windowFullscreen">true</item> <item name="android:windowIsFloating">false</item> </style> Doug Ray You could just manually set the layout params in

getSupportFragmentManager() is undefined

。_饼干妹妹 提交于 2019-11-30 04:10:23
I'm getting the following error: "The method getSupportFragmentManager() is undefined for the type new View.OnClickListener(){}" in my fragment file shown below. I have the compatibility library referenced through ABS and the proper imports in place. I reinstalled ABS library w/ the compatibility library, cleaned the project, restarted Eclipse, but nothing has worked. Essentially, I'm trying to get the fragment to show a date picker through a dialog fragment. Once the date is picked, it must be returned to the fragment so it can be used to calculate information based on that date. Here's the

DialogFragment setCancelable property not working

雨燕双飞 提交于 2019-11-30 04:08:31
I am working in an android application and am using a DialogFragment to show a dialog and I want to make that DialogFragment not cancelable. I have made the dialog cancelable property to false, but still its not affecting. Please look into my code and suggest me a solution. public class DialogTest extends DialogFragment { @Override public Dialog onCreateDialog(Bundle savedInstanceState) { return super.onCreateDialog(savedInstanceState); } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.dialog

Android full-screen dialog callback issue

萝らか妹 提交于 2019-11-30 03:59:00
I am having trouble wrapping my head around something but let me first describe my setup: I have an activity that references 3 fragments, each one of them get shown at the correct time. This is how the ChildrenSpecificationFragment looks: If the user clicks the floating action button the following DialogFragment opens: I found the following information in the new material design guidelines: https://www.google.com/design/spec/components/dialogs.html#dialogs-full-screen-dialogs Avoid dialogs that: Open additional dialogs from within a dialog. Contain scrolling content, particularly alerts.

BottomSheetDialogFragment - listen to dismissed by user event

大城市里の小女人 提交于 2019-11-30 00:39:43
问题 How can I listen to a FINAL dismissal of a BottomSheetDialogFragment ? I want to save user changes on the final dismissal only... I tried following: Method 1 This only fires, if the dialog is dismissed by swiping it down (not on back press or on touch outside) @Override public Dialog onCreateDialog(Bundle savedInstanceState) { Dialog d = super.onCreateDialog(savedInstanceState); d.setOnShowListener(new DialogInterface.OnShowListener() { @Override public void onShow(DialogInterface dialog) {

android: how do I check if dialogfragment is showing

◇◆丶佛笑我妖孽 提交于 2019-11-29 22:47:35
I launch my dialog fragment using FragmentTransaction ft = getFragmentManager().beginTransaction(); MyDialogFragment dialog = new MyDialogFragment() dialog.show(ft, "dialog"); then to get a handle on it I do Fragment prev = getFragmentManager().findFragmentByTag("dialog"); but once I get prev , how do I check if it is showing? Back Story My problem is that my looping code keeps launching the dialog again and again. But if the dialog is already showing, I don't want it to launch again. This back story is just for context. The answer I seek is not: "move it out of the loop." simply check if it's

DialogFragment and force to show keyboard

ぃ、小莉子 提交于 2019-11-29 21:22:31
I have a problem with my DialogFragment. So to create my view, I use the method described on the android blog. Here is my DialogFragment @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { final View myLayout = inflater.inflate(R.layout.dialog_connect, null); edit = (EditText) myLayout.findViewById(R.id.password_edit); edit.requestFocus(); getDialog().getWindow().setSoftInputMode(LayoutParams.SOFT_INPUT_STATE_VISIBLE); return myLayout; } If I use onCreateView(), it works but I would like create an AlterDialog and to do this, I have the

Receiving data from a DialogFragment if you're calling from an Activity vs a Fragment?

江枫思渺然 提交于 2019-11-29 16:23:11
I call my DialogFragment like so: If I am in an Activity: MyDialogFragment dialogfragment = new MyDialogFragment(); dialogfragment.show(getFragmentManager(), ""); If I am already in a Fragment: MyDialogFragment dialogfragment = new MyDialogFragment(); dialogfragment.show(getActivity().getFragmentManager(), ""); In MyDialogFragment, which inflates an XML and allows the user to input some values to EditTexts and so forth, I want to be able to return those values back to wherever I called the dialog from. For the sake of the question let's say my dialog class wants to return some private