dialogfragment

Custom Date Time picker using NumberPicker and FragmentDialog in android

爱⌒轻易说出口 提交于 2019-12-22 01:39:24
问题 I want to a custom Date Time Picker Dialog exactly as shown in the image. In my project this is dialog is shown when clicked on a TextView which is in a Fragment . I know that I need to use NumberPickers which populates the dates From Current date till all the dates next week. The default android date and time pickers doesnt fit my required so I need to create my own custom `DateTimePicker fragmentDialog'. My required DateTimePicker <LinearLayout android:background="@color/background_default

DialogFragment is always resized when soft keyboard is opened

不打扰是莪最后的温柔 提交于 2019-12-21 05:13:09
问题 I'm having some issues with an custom DialogFragment that is displayed Fullscreen. This dialog has content that is scrollable and has an autocompletetextview. Initially the dialog is displayed with an margin at the top - set programmatically as an transparent view at the top of the layout content. As soon as the autocompletetextview is focused, this margin is reduced to 0 (thus giving the illusion that the dialog is getting in fullscreen mode). At this moment the keyboard is also showed.

Styling custom dialog fragment not working

萝らか妹 提交于 2019-12-20 14:42:17
问题 I'm trying to style all my dialog fragments to look the same in my app. The dialogs coming from my settings fragment are styled exactly the way I want it. For my custom dialog fragments, the style is similar but not exactly the same. For some reason the spinner, timepicker, datepicker, radiobuttons, and edittext widgets inside my custom dialog fragments don't pick up the same style. In fact, the widgets blend in with the white background and you can't see that they are there. What am I doing

Pass touch event from dialog fragment to View right below (inside the parent activity)

假装没事ソ 提交于 2019-12-19 11:21:11
问题 As you can see in the image , red border rectangle is the parent activity . Blue one is dialog fragment . The circle is indicating a view and rectangle below is the description. I want the click on circle to be passed down to the button. So far i have tried 1. overriding onTouchEvent in Circle View and return false 2. setOntouchListener on circle view and call activity.dispatchTouchListener and return false 3. mark dialog frgament and circle view clickable/focusable false. None of the above

DialogFragment has blue line on top in Android 4.4.2

我的梦境 提交于 2019-12-18 15:33:19
问题 There's a blue line appearing on top of my dialog fragment that I can't get rid off(I don't even know why does it appear in the first place. Does anybody know on how to get rid of this? I have tested it on several devices and it works just fine on later Android versions. My code: private void setupDialog() { final Dialog dialog = getDialog(); final Window window = dialog.getWindow(); window.setBackgroundDrawable(new ColorDrawable(0)); window.setSoftInputMode(WindowManager.LayoutParams.SOFT

How to recreate a ListView in DialogFragment

老子叫甜甜 提交于 2019-12-13 05:16:02
问题 I'm writing a DialogFragment for browsing the filesystem, which works really nice by now. I just got one Problem. The files are shown in an ListView, and when the user selects a file, this event is send to the Activity that has called the Fragment over an OnFileSelectedListener-Interface. This is fine for files, but it feels wrong to send out the directory names to the activity, then destroying and recreating the Fragment, when all that should happen is that the Fragment should show a new

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 :

Android DialogFragment getActivity() is null

帅比萌擦擦* 提交于 2019-12-13 02:26:21
问题 I am trying to create a dialog which displays the user a countdown before the user is logged out. The timeout is set from another activity. I wrote the following code: import android.app.AlertDialog; import android.app.Dialog; import android.app.DialogFragment; import android.content.DialogInterface; import android.content.res.Resources; import android.os.Bundle; public class SessionInactivityDialog extends DialogFragment { public void setInactivityTimeout(long timeout) { Resources res =

How to refresh the ListView after change the data with the DialogFragment?

末鹿安然 提交于 2019-12-11 19:38:38
问题 I create a custom dialog with DialogFragment, and in the dialog, I can add some data to the SQLite database. Also, there is a listview in the main activity, which show the data of the SQLite. I want to refresh the listview when I add the data to the database from the dialog. However, I have some problems. I call the notifyDataSetChanged() in the onResume(), but the listview doesn't refresh when I dismiss the dialog. And if I press the home button and open the activity from the recent list,

Pass data fragment to fragment in the same activity

半腔热情 提交于 2019-12-11 10:49:38
问题 I have some problem want to ask about passing data from fragment to fragment in an activity. I have no idea how to do this. Anybody can help? Here is my code. ShareFragment.java package com.example.user8.myapplication; import android.app.AlertDialog; import android.app.DatePickerDialog; import android.app.Dialog; import android.content.Intent; import android.os.Bundle; import android.support.annotation.NonNull; import android.support.v4.app.DialogFragment; import android.support.v4.app