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;
}
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);
}
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);
}
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;
}
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);
}
Aggregations