Search in sources :

Example 1 with Dialog

use of android.app.Dialog in project UltimateAndroid by cymcsg.

the class MatchDialog method onCreateDialog.

@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    if (mDialog == null) {
        mDialog = new Dialog(getActivity(), R.style.match_view_dialog);
        mDialog.setContentView(R.layout.match_view_dialog_match);
        mDialog.setCanceledOnTouchOutside(true);
        mDialog.getWindow().setGravity(Gravity.CENTER);
        View view = mDialog.getWindow().getDecorView();
        matchTextView = (MatchTextView) view.findViewById(R.id.mTextView);
        matchTextView.setMatchOutListener(new MatchView.MatchOutListener() {

            @Override
            public void onBegin() {
            }

            @Override
            public void onProgressUpdate(float progress) {
            }

            @Override
            public void onFinish() {
                MatchDialog.super.onStop();
            }
        });
        mMatchButton = (MatchButton) view.findViewById(R.id.mButton);
        mMatchButton.setOnClickListener(new View.OnClickListener() {

            @Override
            public void onClick(View v) {
                mMatchButton.hide();
                matchTextView.hide();
            }
        });
    }
    return mDialog;
}
Also used : Dialog(android.app.Dialog) MatchView(com.marshalchen.common.uimodule.matchview.util.MatchView) MatchTextView(com.marshalchen.common.uimodule.matchview.MatchTextView) MatchView(com.marshalchen.common.uimodule.matchview.util.MatchView) View(android.view.View)

Example 2 with Dialog

use of android.app.Dialog in project cw-omnibus by commonsguy.

the class ShortcutDialogFragment method onCreateDialog.

@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
    Dialog dlg = builder.setTitle(R.string.title_shortcuts).setMessage(R.string.msg_shortcuts).setPositiveButton(android.R.string.ok, null).create();
    return (dlg);
}
Also used : AlertDialog(android.app.AlertDialog) AlertDialog(android.app.AlertDialog) Dialog(android.app.Dialog)

Example 3 with Dialog

use of android.app.Dialog in project materialistic by hidroh.

the class PreferencesActivityTest method testLazyLoadHelp.

@Test
public void testLazyLoadHelp() {
    ((PreferencesActivity.SettingsFragment) activity.getSupportFragmentManager().findFragmentByTag(PreferencesActivity.SettingsFragment.class.getName())).getPreferenceScreen().findPreference(activity.getString(R.string.pref_lazy_load_help)).performClick();
    Dialog dialog = ShadowDialog.getLatestDialog();
    assertNotNull(dialog);
    assertThat((TextView) dialog.findViewById(R.id.alertTitle)).hasText(R.string.pref_lazy_load_title);
}
Also used : ShadowDialog(org.robolectric.shadows.ShadowDialog) Dialog(android.app.Dialog) TextView(android.widget.TextView) Test(org.junit.Test)

Example 4 with Dialog

use of android.app.Dialog in project qksms by moezbhatti.

the class QKDialog method onCreateDialog.

@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    Dialog dialog = new Dialog(mContext);
    Window window = dialog.getWindow();
    window.requestFeature(Window.FEATURE_NO_TITLE);
    window.setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
    window.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
    LayoutInflater inflater = getActivity().getLayoutInflater();
    View view = inflater.inflate(R.layout.dialog_material, null);
    if (mTitleEnabled || mMessageEnabled) {
        mContentPanel = (LinearLayout) view.findViewById(R.id.contentPanel);
        mContentPanel.setVisibility(View.VISIBLE);
    }
    if (mTitleEnabled) {
        mTitleView = (QKTextView) view.findViewById(R.id.alertTitle);
        mTitleView.setVisibility(View.VISIBLE);
        mTitleView.setText(mTitleText);
        Log.d(TAG, "title enabled");
    }
    if (mMessageEnabled) {
        mMessageView = (QKTextView) view.findViewById(R.id.message);
        mMessageView.setVisibility(View.VISIBLE);
        mMessageView.setText(mMessageText);
    }
    if (mCustomViewEnabled) {
        mCustomPanel = (LinearLayout) view.findViewById(R.id.customPanel);
        mCustomPanel.setVisibility(View.VISIBLE);
        if (mCustomView instanceof ListView || mCustomView instanceof RecyclerView) {
            mCustomPanel.addView(mCustomView);
        } else {
            ScrollView scrollView = new ScrollView(mContext);
            scrollView.addView(mCustomView);
            mCustomPanel.addView(scrollView);
        }
    }
    if (mPositiveButtonEnabled || mNegativeButtonEnabled) {
        mButtonBar = (LinearLayout) view.findViewById(R.id.buttonPanel);
        mButtonBar.setVisibility(View.VISIBLE);
        mButtonBar.setOrientation(mButtonBarOrientation);
    }
    if (mPositiveButtonEnabled) {
        mPositiveButtonView = (QKTextView) view.findViewById(R.id.buttonPositive);
        mPositiveButtonView.setVisibility(View.VISIBLE);
        mPositiveButtonView.setText(mPositiveButtonText);
        mPositiveButtonView.setOnClickListener(mPositiveButtonClickListener);
        LiveViewManager.registerView(QKPreference.THEME, mPositiveButtonView, key -> {
            mPositiveButtonView.setTextColor(ThemeManager.getColor());
        });
    }
    if (mNeutralButtonEnabled) {
        mNeutralButtonView = (QKTextView) view.findViewById(R.id.buttonNeutral);
        mNeutralButtonView.setVisibility(View.VISIBLE);
        mNeutralButtonView.setText(mNeutralButtonText);
        mNeutralButtonView.setOnClickListener(mNeutralButtonClickListener);
    }
    if (mNegativeButtonEnabled) {
        mNegativeButtonView = (QKTextView) view.findViewById(R.id.buttonNegative);
        mNegativeButtonView.setVisibility(View.VISIBLE);
        mNegativeButtonView.setText(mNegativeButtonText);
        mNegativeButtonView.setOnClickListener(mNegativeButtonClickListener);
    }
    dialog.setContentView(view);
    return dialog;
}
Also used : Window(android.view.Window) ListView(android.widget.ListView) ColorDrawable(android.graphics.drawable.ColorDrawable) ScrollView(android.widget.ScrollView) Dialog(android.app.Dialog) LayoutInflater(android.view.LayoutInflater) RecyclerView(android.support.v7.widget.RecyclerView) QKTextView(com.moez.QKSMS.ui.view.QKTextView) View(android.view.View) AdapterView(android.widget.AdapterView) RecyclerView(android.support.v7.widget.RecyclerView) ScrollView(android.widget.ScrollView) ListView(android.widget.ListView)

Example 5 with Dialog

use of android.app.Dialog in project Android-GoogleDirectionAndPlaceLibrary by akexorcist.

the class PlaceActivity3 method onCreate.

protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_place_1);
    textStatus = (TextView) findViewById(R.id.textStatus);
    listView = (ListView) findViewById(R.id.listView);
    gp = new GooglePlaceSearch(ApiKey);
    gp.setOnPlaceResponseListener(new OnPlaceResponseListener() {

        public void onResponse(String status, ArrayList<ContentValues> arr_data, Document doc) {
            textStatus.setText("Status : " + status);
            if (status.equals(GooglePlaceSearch.STATUS_OK)) {
                ArrayList<String> array = new ArrayList<String>();
                final ArrayList<String> array_photo = new ArrayList<String>();
                for (int i = 0; i < arr_data.size(); i++) {
                    array.add("Name : " + arr_data.get(i).getAsString(GooglePlaceSearch.PLACE_NAME) + "\n" + "Address : " + arr_data.get(i).getAsString(GooglePlaceSearch.PLACE_ADDRESS) + "\n" + "Latitude : " + arr_data.get(i).getAsString(GooglePlaceSearch.PLACE_LATITUDE) + "\n" + "Longitude : " + arr_data.get(i).getAsString(GooglePlaceSearch.PLACE_LONGITUDE) + "\n" + "Phone Number : " + arr_data.get(i).getAsString(GooglePlaceSearch.PLACE_PHONENUMBER));
                    array_photo.add(arr_data.get(i).getAsString(GooglePlaceSearch.PLACE_PHOTO));
                }
                ArrayAdapter<String> adapter = new ArrayAdapter<String>(PlaceActivity3.this, R.layout.listview_text, array);
                listView.setAdapter(adapter);
                listView.setOnItemClickListener(new OnItemClickListener() {

                    public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
                        Dialog dialog = new Dialog(PlaceActivity3.this);
                        dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
                        dialog.setContentView(R.layout.dialog_photo);
                        dialog.setCancelable(true);
                        final ImageView imgPhoto = (ImageView) dialog.findViewById(R.id.imgPhoto);
                        dialog.show();
                        gp.getPhotoBitmapByWidth(array_photo.get(arg2), 600, "", new OnBitmapResponseListener() {

                            public void onResponse(Bitmap bm, String tag) {
                                imgPhoto.setImageBitmap(bm);
                            }
                        });
                    }
                });
            }
        }
    });
    gp.getNearby(latitude, longitude, radius, type, language, keyword);
}
Also used : ContentValues(android.content.ContentValues) OnItemClickListener(android.widget.AdapterView.OnItemClickListener) ArrayList(java.util.ArrayList) OnPlaceResponseListener(app.akexorcist.gdaplibrary.GooglePlaceSearch.OnPlaceResponseListener) Document(org.w3c.dom.Document) ImageView(android.widget.ImageView) TextView(android.widget.TextView) View(android.view.View) AdapterView(android.widget.AdapterView) ListView(android.widget.ListView) Bitmap(android.graphics.Bitmap) GooglePlaceSearch(app.akexorcist.gdaplibrary.GooglePlaceSearch) Dialog(android.app.Dialog) AdapterView(android.widget.AdapterView) OnBitmapResponseListener(app.akexorcist.gdaplibrary.GooglePlaceSearch.OnBitmapResponseListener) ImageView(android.widget.ImageView) ArrayAdapter(android.widget.ArrayAdapter)

Aggregations

Dialog (android.app.Dialog)857 View (android.view.View)349 AlertDialog (android.app.AlertDialog)265 TextView (android.widget.TextView)234 DialogInterface (android.content.DialogInterface)216 Bundle (android.os.Bundle)116 Context (android.content.Context)110 Intent (android.content.Intent)104 LayoutInflater (android.view.LayoutInflater)95 ListView (android.widget.ListView)93 AlertDialog (android.support.v7.app.AlertDialog)86 AdapterView (android.widget.AdapterView)86 EditText (android.widget.EditText)85 Button (android.widget.Button)84 ImageView (android.widget.ImageView)79 NonNull (android.support.annotation.NonNull)70 ArrayList (java.util.ArrayList)70 Window (android.view.Window)59 Activity (android.app.Activity)58 LinearLayout (android.widget.LinearLayout)56