android-dialogfragment

Keep AlertDialog default layout params using custom window background

荒凉一梦 提交于 2019-12-24 19:46:34
问题 I need a dialog with custom background color and rounded corners. How can I keep default layout params using custom window background for AlertDialog? Currently, my dialog has smaller left-right margin than in regular dialog. Also, dialog buttons such as positive and neutral have more shift from the edge of dialog. <style name="DialogStuffTheme" parent="Theme.AppCompat.Light.Dialog.Alert"> <item name="android:windowBackground">@drawable/bg_custom</item> <item name="android

Spinner options (an IcsSpinner from ABS) inside DialogFragment are displayed truncated

扶醉桌前 提交于 2019-12-24 14:43:05
问题 I have the following problem displaying a Spinner inside a DialogFragment . The Spinner is displayed cut and it's only displayed OK when the keyboard appears. The Spinner is actually a custom class with the following code: import android.content.Context; import android.util.AttributeSet; import com.actionbarsherlock.internal.widget.IcsSpinner; public class CustomIcsSpinner extends IcsSpinner { public CustomIcsSpinner(Context context, AttributeSet attrs) { super(context, attrs, com

Text selection tools in ActionBar are white on white background after selecting text in Dialog

半世苍凉 提交于 2019-12-24 11:37:14
问题 Anyone had this issue, that after selecting text in dialog's EditText, toolbar appears with invisible action buttons (white on white background)? How do I set theme to a DialogFragment? 回答1: You can custom dialog theme in styles.xml: <style name="MyDialogTheme" parent="android:Theme.Holo.Dialog" /> then use MyDialogTheme in your DialogFragment UPDATE In your dialog use following codes to set custom theme: ContextThemeWrapper context = new ContextThemeWrapper(getActivity(), R.style

Show FragmentDialog in RecyclerView adapter

青春壹個敷衍的年華 提交于 2019-12-24 06:49:45
问题 Here is my scenario I refer this link I have a Navigation Drawer it contain FeedFragment. And FeeedFragment have recyclerview. And my onClick is in RecyclerView adapter so i wanna to open FragmentDialog in this onclick method so please help me.. FeedFragment.java import android.support.v4.app.FragmentManager; import android.app.Activity; import android.os.Bundle; import android.support.v4.app.Fragment; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget

How to retrieve editText1 in DialogFragment using view from xml-resourcefile

你。 提交于 2019-12-23 19:25:59
问题 How to retrieve editText1 in this DialogFragment? It exists in vraag_banen.xml but getView() is null. The dialog shows fine, also no compilation errors, however I cannot figure out how to write the eventhandler for the PositiveButton, using a custom view from an xml resourcefile. package mypackage; import android.app.Activity; import android.app.AlertDialog; import android.app.AlertDialog.Builder; import android.app.Dialog; import android.content.Context; import android.content

How to create custom progressDialog

帅比萌擦擦* 提交于 2019-12-23 02:57:27
问题 At any devices we have different position of progressBar inside of the progressDialog. So I need to customize it. When I try like this: public class CustomProgressDialog extends ProgressDialog { public CustomProgressDialog(Context context) { super(context); } @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.progress_fragment_dialog); } } <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas

File Chooser inside DialogFragment (re-using code)

北慕城南 提交于 2019-12-23 02:34:20
问题 In this tutorial : http://www.dreamincode.net/forums/topic/190013-creating-simple-file-chooser/ they are using a class that extends ListActivity, they show the results thanks to the next sentence: this.setListAdapter(adapter); ( whith a custom FileArrayAdapter) but I cant use it because I want to show the file chooser inside a DialogFragment (extends DialogFragment). I appreciate any help or explanation of how I should proceed, thanks in advance. Here is my code: DialogFragment: public class

Use of getActivity

最后都变了- 提交于 2019-12-23 02:32:29
问题 First of all sorry if this post may seem a duplicate but I am very new to Android programming and posting this question only when I am still not able to get a satisfactory answer for use of getActivity. Theoretically I understand the use of getActivity() from the several posts here but I am confused how it is working in my code. I have a class MainActivity from which I am creating a dialog onclick of a checkbox. I have another class TaxDialog where the dialog is implemented. On click of Yes

DialogFragment with a custom title

≯℡__Kan透↙ 提交于 2019-12-22 12:15:49
问题 I need to place a custom title to my DialogFragment . getDialog().setTitle("My Title"); is not enough for me because I want to change the title text and background colors. As you can see from the image below, with getDialog().setTitle("My Title"); I've no customization (as far as I know), ie, the text color is black and the background is white. My objective is to have My Title customized as seen by Custom Title . I've been looking around the API and I couldn't find any method to load a view

DialogFragment with a custom title

百般思念 提交于 2019-12-22 12:15:13
问题 I need to place a custom title to my DialogFragment . getDialog().setTitle("My Title"); is not enough for me because I want to change the title text and background colors. As you can see from the image below, with getDialog().setTitle("My Title"); I've no customization (as far as I know), ie, the text color is black and the background is white. My objective is to have My Title customized as seen by Custom Title . I've been looking around the API and I couldn't find any method to load a view