android-dialogfragment

How to set Maxmum and minimum time in Time picker?

半腔热情 提交于 2019-12-22 08:34:44
问题 i have time interval 12:00 PM to 12:00 AM.I want set this time interval in time picker dialog.Disable the time before 12:00 PM and after 12:00 AM in time picker.I don't know how to set time in time picker dialog.Can any one know help me to solve this issue. Time Picker private void showTimePicker(){ Time_picker time = new Time_picker(); Bundle args = new Bundle(); args.putInt("hours", c.get(Calendar.HOUR_OF_DAY)+2); args.putInt("minute", c.get(Calendar.MINUTE)+30); time.setArguments(args);

Android full screen dialog fragment like calendar app

删除回忆录丶 提交于 2019-12-22 07:56:10
问题 I am trying to achieve a full-screen dialog like the below image. I am able to show a full screen dialog but when the dialog is shown the status bar color changes to black and does not keep the primary-dark color. Heres my dialog fragment public class IconsDialogFragment extends DialogFragment { @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Inflate the layout to use as dialog or embedded fragment return inflater.inflate(R

Custom Support Dialog Fragment text is the wrong color

萝らか妹 提交于 2019-12-22 07:09:37
问题 If I put a TextView in a custom dialog box, the text will be black by default. Unfortunately, the support fragment dialogs backgrounds are dark gray. Black on gray is very hard to read. I could change the TextView to white or something like android:textColor="?android:attr/textColorPrimaryInverseDisableOnly" . But the dialog boxes on the new android (Holo Light) are white. So it will be white on white. I could use a hack like forcing it to be white on old versions of Android and forcing it to

DialogFragment with a custom layout causes a crash in my application

回眸只為那壹抹淺笑 提交于 2019-12-22 04:08:27
问题 I have problem with Dialog fragment. Simple dialog with my custom layout is working ok. But I want to initiate controls when dialog is showing. I'm trying to do this in method onActivityCreated . But getView() return null, so I thought that I must set my custom view in onCreateView instead of onCreateDialog . And here the error occurs. When I use onCreateView then my application crashes. Here is my code: class StatisticDialog extends DialogFragment { @Override public Dialog onCreateDialog

Shared Element Transition not working

人走茶凉 提交于 2019-12-22 02:54:10
问题 I have made a github project with just the issue. You can see it / clone it / build it from here: https://git.io/vMPqb I am trying to get shared elements working for a Fragment transition. There are two FABs in the project - Feather and Plane. Feather and Plane are shared elements. When Feather is clicked, the SheetDialog is opened, and Feather should animate over to Plane dialog. It does not do that at the moment, and I am trying to determine why. It may be worthwhile noting that I am

ListView does not update until keyboard is hidden

落爺英雄遲暮 提交于 2019-12-21 09:21:52
问题 I have a DialogFragment and in it's layout I have a EditText and a ListView . The Listview basically shows the list of contacts (Initially this list has 0 items). When the edittext 's value is updated I populate the list with contacts that have the text typed in the EditText . On the EditText I have used a addTextChangedListener to update the list with desired contacts as the user types in a name or email address of the contact. The weird problem I am facing is that the list (or maybe the

Can't Scroll in Dialog Fragment

喜你入骨 提交于 2019-12-21 05:15:08
问题 I am trying to get a DialogFragment to popup and to show a scrollable TextView legend but it just cuts off the rest of the legend. I can't scroll through it or anything. I tried adding a ScrollView but it doesn't do anything. This is the screen that I get: This is my XML layout file: <?xml version="1.0" encoding="utf-8"?> <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:fillViewport="true">

DialogFragment set height of Dialog

北慕城南 提交于 2019-12-20 18:34:22
问题 I just used created by first Dialog using DialogFragment. Everything works great except I can't get the Dialog to wrap it's layout. My layout has the height of all elements to wrap_content . In MyFragmentDialog I can't even find a method that would imply that it can be used to set the height of the FragmentDialog . What am I missing? How do I make a DialogFragment fit it's content? The DialogFrament 's onCreateView method: @Override public View onCreateView(LayoutInflater inflater, ViewGroup

Display DialogFragment content below status bar

▼魔方 西西 提交于 2019-12-20 14:48:53
问题 Im trying to display an DialogFragment with match_parent both for height and width but it happens that on top the DialogFragment is being displayed below StatusBar. The DialogFragment is applying some default value for padding on bottom, right, left, and top. But the top padding should start counting from statusBar and not from the total screen size. How can I set DialogFragment to be match_parent, but have the normal/default padding on top,bottom,right,left? 回答1: By default Dialog would be

passing context as argument of DialogFragment

主宰稳场 提交于 2019-12-20 09:11:29
问题 it's possible to pass a context variable to a DialogFragment? i've use this code inside dialog for passing a string: public static ConfirmDialog newInstance( String f) { ConfirmDialog d = new ConfirmDialog(); Bundle args = new Bundle(); args.putString("FILE_NAME", f); d.setArguments(args); return d; } but i don't find any function like putString for passing context. It's possible to do that? 回答1: Your DialogFragment has a very handy method for getting a Context instance: getActivity()