A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

Code Examples of Dialog


			MenuEntry me = new MenuEntry(setting.getRealName(), setting.getDescription());
			//if (setting.mDataType.equals("boolean"))
			menuEntries.add(me);

			if (setting.mDataType.equals("integer") || setting.mDataType.equals("double") || setting.mDataType.equals("string")) {
				final Dialog dialog = new Dialog(context);
				dialog.setContentView(R.layout.input_dialog);

				TextView text = (TextView) dialog.findViewById(R.id.text);
				text.setInputType(InputType.TYPE_CLASS_NUMBER);
				//text

				String boundDesc = "";
				final Button button = (Button) dialog.findViewById(R.id.button1);

				if (setting.mDataType.equals("integer") || setting.mDataType.equals("double")) {
					final EditText editText = (EditText) dialog.findViewById(R.id.editText);
					final Setting finalSetting = setting;
					editText.setInputType(InputType.TYPE_CLASS_NUMBER);
					editText.addTextChangedListener(new TextWatcher() {

						@Override
						public void onTextChanged(CharSequence s, int start, int before, int count) {
							if (editText.getText().toString().equals(""))
								return;
							double textValue = Double.parseDouble(editText.getText().toString());
							
							if (textValue < finalSetting.mMin  || textValue > finalSetting.mMax)
								button.setText("Ugyldig v?rdi");
							else
								button.setText("OK");
						}
						@Override
						public void beforeTextChanged(CharSequence s, int start, int count, int after) {
						}
						@Override
						public void afterTextChanged(Editable s) {
						}
					});
				}
				
				if (setting.mDataType.equals("string")) {
					final EditText editText = (EditText) dialog.findViewById(R.id.editText);
					final Setting finalSetting = setting;
					editText.addTextChangedListener(new TextWatcher() {
						
						@Override
						public void onTextChanged(CharSequence s, int start, int before, int count) {
							int textLength = editText.getText().toString().length();
							if (textLength == 0)
								return;
							if (textLength < finalSetting.mMin  || textLength > finalSetting.mMax)
								button.setText("Ugyldig v?rdi");
							else
								button.setText("OK");
						}
						@Override
						public void beforeTextChanged(CharSequence s, int start, int count, int after) {
						}
						@Override
						public void afterTextChanged(Editable s) {
						}
					});
				}

				button.setOnClickListener(new OnClickListener() {
					@Override
					public void onClick(View v) {
						Button b = (Button)v;
						String text = b.getText().toString();
						if (text.equals("Ugyldig v?rdi") == false)
							dialog.dismiss();
					} 
				});

				if (setting.mDataType.equals("integer"))
				{
					if (setting.getMin() != -Double.MAX_VALUE && setting.getMax() == Double.MAX_VALUE) {
						boundDesc += "V?rdien skal v?re over " + (int)setting.getMin();
					}
					else if (setting.getMin() == -Double.MAX_VALUE && setting.getMax() != Double.MAX_VALUE) {
						boundDesc += "V?rdien m? maksimalt v?re " + (int)setting.getMax();
					}
					else if (setting.getMin() != -Double.MAX_VALUE && setting.getMax() != Double.MAX_VALUE) {
						boundDesc += "V?rdien skal v?re mellem " + (int)setting.getMin() + " og " + (int)setting.getMax();
					}
				}
				else if (setting.mDataType.equals("double")) {
					if (setting.getMin() != -Double.MAX_VALUE && setting.getMax() == Double.MAX_VALUE) {
						boundDesc += "V?rdien skal v?re over " + setting.getMin();
					}
					else if (setting.getMin() == -Double.MAX_VALUE && setting.getMax() != Double.MAX_VALUE) {
						boundDesc += "V?rdien m? maksimalt v?re " + setting.getMax();
					}
					if (setting.getMin() == -Double.MAX_VALUE && setting.getMax() == Double.MAX_VALUE) {
						boundDesc += "V?rdien skal v?re mellem " + setting.getMin() + " og " + setting.getMax();
					}
				}

				if (boundDesc == "")
					text.setText(setting.getDescription());
				else
					text.setText(setting.getDescription() + " - " + boundDesc);

				dialog.setTitle(setting.getRealName());
				setting.setDialog(dialog);
			}
			else if (setting.mDataType.equals("enum")) {

				CharSequence[] items = new CharSequence[setting.getEnumElements().size()];

				for (int i = 0; i < setting.getEnumElements().size(); i++) {
					items[i] = setting.getEnumElements().get(i).getmRealName();
				}

				AlertDialog.Builder builder = new AlertDialog.Builder(context);
				builder.setTitle(setting.getRealName());
				builder.setSingleChoiceItems(items, -1, new DialogInterface.OnClickListener() {
					public void onClick(DialogInterface dialog, int item) {
						dialog.dismiss();
					}
				});
				AlertDialog alert = builder.create();
				
				setting.setDialog(alert);

View Full Code Here


//            });
//            builder.setMessage(readEula(activity));
//            builder.create().show();
        	Typeface font = Typeface.createFromAsset(activity.getAssets(), BoskoiService.fontPath);
             
      		Dialog dialog = new Dialog(activity);
            dialog.setContentView(R.layout.eula);
            dialog.setTitle(R.string.eula_title);
            dialog.setCancelable(true);
            //there are a lot of settings, for dialog, check them all out!

            TextView versionName = (TextView) dialog.findViewById(R.id.version_name);
            PackageManager manager = activity.getPackageManager(); 
            PackageInfo info;
    		try {
    			info = manager.getPackageInfo(activity.getPackageName(), 0);
    			versionName.setText(versionName.getText()+" "+info.versionName);
    		} catch (NameNotFoundException e) {
    			// TODO Auto-generated catch block
    			e.printStackTrace();
    		}
            
            TextView titleTV = (TextView) dialog.findViewById(R.id.eula_title);
    		titleTV.setTypeface(font);  
            titleTV = (TextView) dialog.findViewById(R.id.privacy_title);
    		titleTV.setTypeface(font);  
    		titleTV = (TextView) dialog.findViewById(R.id.license_title);
    		titleTV.setTypeface(font);
    		
            Linkify.addLinks((TextView) dialog.findViewById(R.id.privacy), Linkify.ALL);
            Linkify.addLinks((TextView) dialog.findViewById(R.id.license), Linkify.ALL);
            
            //set up button
            Button refuse = (Button) dialog.findViewById(R.id.Disagree);
            refuse.setOnClickListener(new OnClickListener() {
            public void onClick(View v) {
            		// false
            		refuse(activity);
                }
            });
            
            Button accept = (Button) dialog.findViewById(R.id.Agree);
            accept.setOnClickListener(new OnClickListener() {
            public void onClick(View v) {
            		//true
            		accept(preferences);
	              if (activity instanceof OnEulaAgreedTo) {
	                  ((OnEulaAgreedTo) activity).onEulaAgreedTo();
	              }
                }
            });
            //now that the dialog is set up, it's time to show it    
            dialog.show();
        	
            return false;
        }
        return true;
    }

View Full Code Here


        mDbFrontend = dbFrontend;
    }

    @Override
    public void act() {
        final Dialog dialog = new Dialog(mActivity);
//        final DialogFilterGui gui = new DialogFilterGui(dialog);
//
//        final OnClickListener mOnApply = new OnClickListener() {
//            @Override
//            public void onClick(View v) {
//                mFilter.loadFromGui(gui);
//                mFilter.saveToPreferences();
//                dialog.dismiss();
//                mGuiState.setActiveFilter(mFilter);
//                if (mThread != null)
//                    mThread.clearListUntilCalculated(mRefresher);
//            }
//        };

        dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
        dialog.setContentView(R.layout.usernote);

//        SetOpposingCheckBoxes(dialog, R.id.CheckBoxRequireFavorites, 
//                R.id.CheckBoxForbidFavorites);
//        SetOpposingCheckBoxes(dialog, R.id.CheckBoxRequireFound, 
//                R.id.CheckBoxForbidFound);
//        SetOpposingCheckBoxes(dialog, R.id.CheckBoxRequireDNF, 
//                R.id.CheckBoxForbidDNF);
//        SetOpposingCheckBoxes(dialog, R.id.CheckBoxRequireNew, 
//                R.id.CheckBoxForbidNew);
//        
//        mFilter = mGuiState.getActiveFilter();
//        TextView title = (TextView)dialog.findViewById(R.id.TextFilterTitle);
//        title.setText("Editing filter \"" + mFilter.getName() + "\"");
//        mFilter.pushToGui(gui);
//        Button apply = (Button) dialog.findViewById(R.id.ButtonApplyFilter);
//        apply.setOnClickListener(mOnApply);
        dialog.show();
    }

    @Override
    public boolean isEnabled() {
        return mGuiState.getActiveGeocache() != null;

View Full Code Here


    
    /**
     * Dialog interface for entering the name.
     */
    protected Dialog onCreateDialog(int id) {
        Dialog mdialog = new Dialog(this);
        switch(id) {
        case NAME_DIALOG_ID:
        	mdialog.setContentView(R.layout.name_dialog_2);
    		mdialog.setTitle("Player Names");
    		mdialog.setCancelable(true);
    		
    		final EditText namep1 = (EditText) mdialog.findViewById(R.id.namep1);
    		final EditText namep2 = (EditText) mdialog.findViewById(R.id.namep2);
        
    		Button ok_b = (Button) mdialog.findViewById(R.id.ok);
    		ok_b.setOnClickListener(new OnClickListener() {
    			public void onClick(View v) {
    				change_skin();
    				player_name_2 = namep1.getText();
    				player_name_1 = namep2.getText();
    				score_player_1 = 0;
    				score_player_2 = 0;
    				new_game(namep2.getText());
    				dismissDialog(1);
    			}
    		});
            break;
            
        case HELP_DIALOG_ID :
        	mdialog.setContentView(R.layout.help);
            mdialog.setTitle("Help");
            mdialog.setCancelable(true);
        	break;
        default:
            mdialog = null;
        }
        return mdialog;

View Full Code Here


	
	// Ask the date the check was done
	void askCheckDoneDate(final boolean checked) {
		Button done;
		TextView text;
		final Dialog dialog = new Dialog(this);
	
		dialog.setContentView(R.layout.check_ask_date);
		dialog.setTitle(getString(R.string.check_askDateTitle));
		
		done = (Button) dialog.findViewById(R.id.checkButtonDone);
		text = (TextView) dialog.findViewById(R.id.checkAskDateText);
		
		done.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				DatePicker date = (DatePicker) dialog.findViewById(R.id.check_dateDone);
				setCheckDate(checked, C.getDate(date));
				dialog.dismiss();
				finish();
			}
		});
		
		String checkName = getCheckNameWithMonth(mCheck); 
		text.setText(String.format(getString(R.string.check_askDate), checkName.toLowerCase()));

		dialog.show();
	}
	
	void setCheckDate(boolean checked, Date date) {
		// Update the DB
		mPregnancy.setCheckDone(mCheck.mCheckId, checked, ACheck.this, date);

View Full Code Here


	public boolean onOptionsItemSelected(MenuItem item) {
		switch (item.getItemId()) {
		case R.id.menu_thismonth_validate_all:

			Button done;
			final Dialog dialog = new Dialog(this);
		
			dialog.setContentView(R.layout.check_ask_date);
			dialog.setTitle(getString(R.string.check_askDateTitle));
			
			done = (Button) dialog.findViewById(R.id.checkButtonDone);
			done.setOnClickListener(new OnClickListener() {
				@Override
				public void onClick(View v) {
					DatePicker date = (DatePicker) dialog.findViewById(R.id.check_dateDone);
					Date d = new Date();
					d.setDate(date.getDayOfMonth());
					d.setMonth(date.getMonth());
					d.setYear(date.getYear()-1900);
					
					setChecksDate(d);
					
					dialog.dismiss();
				}
			});

			dialog.show();
			
			refreshUI();
			return true;
			
		default:

View Full Code Here


		);
	}

	private void displayErrorDialog(String error) {

		Dialog errorDialog = new Dialog(IntervalGui.this);
		errorDialog.setTitle("Fejl");
		errorDialog.setContentView(R.layout.error_dialog);

		TextView textView = (TextView) errorDialog.findViewById(R.id.textView1);
		Button okButton = (Button) errorDialog.findViewById(R.id.button1);

		textView.setText(error);

		final IntervalGui intervalGui = this;
		okButton.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				intervalGui.finish();
			}});

		errorDialog.show();
	}
}

View Full Code Here


		);
	}

	private void displayErrorDialog(String error) {

		Dialog errorDialog = new Dialog(IntervalGui.this);
		errorDialog.setTitle("Fejl");
		errorDialog.setContentView(R.layout.error_dialog);

		TextView textView = (TextView) errorDialog.findViewById(R.id.textView1);
		Button okButton = (Button) errorDialog.findViewById(R.id.button1);

		textView.setText(error);

		final IntervalGui intervalGui = this;
		okButton.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				intervalGui.finish();
			}});

		errorDialog.show();
	}
}

View Full Code Here


	}


	private void dialogoInformacion(){
		
		Dialog d = new Dialog(MenuPrincipal.this);
		Window window = d.getWindow();
		window.setFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND,WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
		
		d.setTitle("Informaci??n");
		d.setContentView(R.layout.information_dialog);
		TextView text = (TextView) d.findViewById(R.id.information_dialog);
		
		text.setText(" MADSA presents a new application that will change the world!\n\n");
		text.append(" Developers:\n");
		text.append(" Jorge Pintado de Santiago\n");
		text.append(" Victor Mayoral Vilches\n");
		text.append(" Adri??n Garc??a L??pez\n");
		text.append(" Javier Rodr??guez Robles\n");
		text.append(" Luis Alonso Blazquez\n");
		text.append(" Fernando Jos?? Iglesias\n");
		d.show();
	}
		
	public boolean onCreateOptionsMenu(Menu menu) {
        super.onCreateOptionsMenu(menu);
        menu.add(Menu.NONE, TUPELI, 0, R.string.tupeli_textmenu);

View Full Code Here


	public boolean onOptionsItemSelected(MenuItem item) {
		switch (item.getItemId()) {
		case Global.MENU_QUIT:
			this.finish();
		case Global.MENU_LOG:
			Dialog logDialog = new Dialog(this);
			logDialog.setContentView(R.layout.logwindow);
			logDialog.setTitle(Global.TAG + " Log");
			TextView logText = (TextView) logDialog.findViewById(R.id.logText);
			logText.setText(appLog.getLogDataAllFormatted());
			Button closeDialogButton = (Button) logDialog
					.findViewById(R.id.CloseDialogButton);
			Button sendLogDialogButton = (Button) logDialog
					.findViewById(R.id.SendLogDialogButton);
			closeDialogButton.setOnClickListener(new closeListener(logDialog));
			sendLogDialogButton.setOnClickListener(new sendLogListener(
					logDialog));
			logDialog.show();
			return true;
		case Global.MENU_CREDITS:
			createDialog("Credits", getString(R.string.credits));
			return true;
		case Global.MENU_CONTACT:

View Full Code Here


		ft.commit();
	}

	private void showQRCode()
	{
		final Dialog dialog = new Dialog(getActivity());
		dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
		dialog.setContentView(R.layout.bitcoin_address_qr_dialog);
		final ImageView imageView = (ImageView) dialog.findViewById(R.id.bitcoin_address_qr);
		imageView.setImageBitmap(qrCodeBitmap);
		dialog.setCanceledOnTouchOutside(true);
		dialog.show();
		imageView.setOnClickListener(new OnClickListener()
		{
			public void onClick(final View v)
			{
				dialog.dismiss();
			}
		});
	}
}

View Full Code Here


	@Override
	protected Dialog onCreateDialog(int dialogId)
	{
		if( dialogId == DIALOG_CONFIRM_DELETE )
		{
			Dialog dialog = new Dialog( this );
			dialog.setContentView( R.layout.delete_confirmation_dialog );
			dialog.setTitle( R.string.confirmation_message );
			Button okButton = (Button)dialog.findViewById( R.id.deleteConfirmationOkButton );
			okButton.setOnClickListener( okDeleteOnClickListener );
			Button cancelButton = (Button)dialog.findViewById( R.id.deleteConfirmationCancelButton );
			cancelButton.setOnClickListener( cancelDeleteDialogListener );
			return dialog;
		}
		else
		{

View Full Code Here


			  return true;
		  case R.id.context_nowplaying:
			  context.startActivity(new Intent(context, org.musikcube.app1.NowPlayingList.class));
			  return true;
		  case R.id.context_help:
			  Dialog dialog = new Dialog(context);
			  dialog.setContentView(R.layout.help);
			  dialog.setTitle("Help");
			  
			  dialog.show();
			  return true;
    	  default:
    		  return false;
    	  }
   	}

View Full Code Here


	protected Dialog onCreateDialog(final int id)
	{
		final WebView webView = new WebView(this);
		webView.loadUrl("file:///android_asset/help_send_coins" + languagePrefix() + ".html");

		final Dialog dialog = new Dialog(this);
		dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
		dialog.setContentView(webView);
		dialog.setCanceledOnTouchOutside(true);

		return dialog;
	}

	@Override

View Full Code Here


        } else {
            layout = View.inflate(EditTextActivityDialog.this, 
                    R.layout.dialog_edit_text_no_scroll, null);
        }
        
        Dialog d = new Dialog(EditTextActivityDialog.this);
        d.setTitle(getString(R.string.test_dialog));
        d.setCancelable(true);
        d.setContentView(layout);
        return d;
    }

}

View Full Code Here


            EditText editText;
            editText = new EditText(this);
            layout.addView(editText);
        }
        
        Dialog d = new Dialog(this);
        d.setTitle("The DIALOG!!!");
        d.setCancelable(true);
        d.setContentView(layout);
        return d;
    }

 }

View Full Code Here


        }
        return dialog;
    }   	
	
    private Dialog helpDialog() {
    	final Dialog dialog = new Dialog(this);
    	dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
    	dialog.setContentView(R.layout.dialog_help);
    	dialog.setCancelable(true);
    	return dialog;
    }
    
    private Dialog infoDialog() {
    	final Dialog dialog = new Dialog(this);

View Full Code Here


	

	public static String showInputDialog(Component parentComponent, String message)
	{
		final StringBuffer result = new StringBuffer();
		final Dialog dialog = new Dialog(getFrame(parentComponent), "Input");
		final TextField tfInput = new TextField(40);

		dialog.setModal(true);
		dialog.setLayout(new BorderLayout());
		dialog.add(new Label(message), BorderLayout.WEST);
		dialog.add(tfInput, BorderLayout.CENTER);
		Panel panel = new Panel();
		Button btOk = new Button("OK");
		panel.add(btOk);
		Button btCancel = new Button("Cancel");
		panel.add(btCancel);
		dialog.add(panel, BorderLayout.SOUTH); 
		dialog.pack();
		dialog.addWindowListener(windowListener);
		
		btOk.addActionListener(new ActionListener() 
		{
			public void actionPerformed(ActionEvent ev) 
			{
				result.append(tfInput.getText());
				dialog.hide();
			}
		});
		
		btCancel.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent ev) 
			{
				dialog.hide();
			}
		}); 

		dialog.show();
				
		if (result.length() > 0) {		
			return result.toString();
		}
		

View Full Code Here

TOP

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

TOP