Java Code Examples for android.content.DialogInterface.OnDismissListener

The following are top voted examples for showing how to use android.content.DialogInterface.OnDismissListener. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: open-rmbt   File: RMBTTestFragment.java   Source Code and License 6 votes vote down vote up
protected void showErrorDialog(int errorMessageId)
{
    stopLoop = true;
    
    final AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
    builder.setTitle(R.string.test_dialog_error_title);
    builder.setMessage(errorMessageId);
    builder.setNeutralButton(android.R.string.ok, null);
    dismissDialogs();
    errorDialog = builder.create();
    errorDialog.setOnDismissListener(new OnDismissListener()
    {
        @Override
        public void onDismiss(DialogInterface dialog)
        {
            final RMBTMainActivity activity = (RMBTMainActivity) getActivity();
            if (activity != null)
                activity.getSupportFragmentManager().popBackStack();
        }
    });
    errorDialog.show();
}
 
Example 2
Project: ThunderMusic   File: MixRadioActivity.java   Source Code and License 6 votes vote down vote up
@Override
protected void onPreExecute() {
    // 

    mProgressDialog = new ProgressDialog(context,
            ProgressDialog.THEME_DEVICE_DEFAULT_LIGHT);
    mProgressDialog.setTitle("");
    mProgressDialog.setMessage(activity
            .getString(R.string.mixradio_dialog));

    mProgressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
    mProgressDialog.setOnDismissListener(new OnDismissListener() {

        @Override
        public void onDismiss(DialogInterface dialog) {
            // 
            mTask.cancel(true);
        }
    });
    mProgressDialog.show();
    super.onPreExecute();
}
 
Example 3
Project: LibreTasks   File: ActivityDlgActionInput.java   Source Code and License 6 votes vote down vote up
/**
 * Show the attributes dialog for the specified {@code viewItem} if applicable
 * 
 * @param viewItem
 *          the item chosen to show the attributes
 */
private void showDialogAttributes(final ViewItem viewItem) {

  ArrayList<ModelAttribute> attributesValid = (ArrayList<ModelAttribute>) getAttributes(viewItem);
  // Show the dialog finally if they have any choice.
  if (!attributesValid.isEmpty()) {
    DlgAttributes dlg = new DlgAttributes(this, attributesValid);
    dlg.setOnDismissListener(new OnDismissListener() {
      public void onDismiss(DialogInterface dialog) {
        // Fetch the attribute they chose, if any.
        ModelAttribute modelAttribute = ((DlgAttributes) dialog).getSelectedAttribute();

        if (modelAttribute != null) {
          viewItem.insertAttribute(modelAttribute);
        }
      }
    });
    dlg.show();
  } else {
    // Shouldn't happen but leaving in for safety
    UtilUI.showAlert(this, "Sorry!",
        "There are no matching parameters for the selected attribute type!");
  }
}
 
Example 4
Project: foursquared   File: BadgesActivity.java   Source Code and License 6 votes vote down vote up
@Override
protected Dialog onCreateDialog(int id) {
    switch (id) {
        case DIALOG_ID_INFO:
            AlertDialog dlgInfo = new AlertDialog.Builder(this)
                .setTitle(mStateHolder.getDlgInfoTitle())
                .setIcon(0)
                .setMessage(mStateHolder.getDlgInfoMessage()).create();
            dlgInfo.setOnDismissListener(new OnDismissListener() {
                public void onDismiss(DialogInterface dialog) {
                    removeDialog(DIALOG_ID_INFO);
                }
            });
            try {
                Uri icon = Uri.parse(mStateHolder.getDlgInfoBadgeIconUrl());
                dlgInfo.setIcon(new BitmapDrawable(((Foursquared) getApplication())
                        .getRemoteResourceManager().getInputStream(icon)));
            } catch (Exception e) {
                Log.e(TAG, "Error loading badge dialog!", e);
                dlgInfo.setIcon(R.drawable.default_on);
            }
            return dlgInfo;
    }
    return null;
}
 
Example 5
Project: Wei.Lib2A   File: Prompt.java   Source Code and License 6 votes vote down vote up
/**弹出窗口消失会发送该事件**/
public synchronized static void setOnDismissListener(OnDismissListener l) {
	if(mOnDismissListener == l) return;
	final OnDismissListener oldListnener = mOnDismissListener;
	mOnDismissListener = l;
	if(oldListnener != null) {
		final MyDialog dialog = MyDialog.get();
		if(dialog != null) {
			if(mUiThread != Thread.currentThread()) {
				if(mHandler != null) mHandler.post(new Runnable() {
					@Override
					public void run() {
						oldListnener.onDismiss(dialog);
					}
				});
			}else {
				oldListnener.onDismiss(dialog);
			}
		}
	}
}
 
Example 6
Project: S4-challenge   File: VoiceActivity.java   Source Code and License 6 votes vote down vote up
private void createListeningDialog() {
    _listeningDialog = new ListeningDialog(this);


    _listeningDialog.setOnDismissListener(new OnDismissListener() {
        @Override
        public void onDismiss(DialogInterface dialog) {
            if (_currentRecognizer != null) // Cancel the current recognizer
            {
                _currentRecognizer.cancel();
                _currentRecognizer = null;
            }

            if (!_destroyed) {
                VoiceActivity.this.removeDialog(LISTENING_DIALOG);
                createListeningDialog();
            }
        }
    });
}
 
Example 7
Project: PdDroidPublisher   File: PopupTaplist.java   Source Code and License 6 votes vote down vote up
@Override
public boolean touchdown(int pid, float x, float y) {

	if (dRect.contains(x, y)) {
		final Selector selector = new Selector(parent.getContext(), getValues());

		selector.setOnDismissListener(new OnDismissListener() {				
			@Override
			public void onDismiss(DialogInterface dialog) {
				Integer v = selector.getSelectedValue();
				if (v != null){
					val = v;
					doSend();
					parent.threadSafeInvalidate();
				}
				dialog.dismiss();
			}
		});	
		selector.show();
		return true;
	}
	return false;
}
 
Example 8
Project: PdDroidPublisher   File: Numberbox.java   Source Code and License 6 votes vote down vote up
private void openEditDialog()
{
	final NumberboxDialog editDialog = new NumberboxDialog(parent.getContext(), val);
	editDialog.setTitle(label == null ? "Edit number" : label);
	editDialog.setOnDismissListener(new OnDismissListener() {
		@Override
		public void onDismiss(DialogInterface dialog) {
			Float selectedValue = editDialog.getSelectedValue();
			if(selectedValue != null)
			{
				setval(selectedValue.floatValue());
				sendFloat(val);
				parent.invalidate();
			}
		}
	});
	editDialog.show();
}
 
Example 9
Project: PdDroidPublisher   File: Symbol.java   Source Code and License 6 votes vote down vote up
private void openEditDialog()
{
	final SymbolDialog editDialog = new SymbolDialog(parent.getContext(), value);
	editDialog.setTitle(label == null ? "Edit symbol" : label);
	editDialog.setOnDismissListener(new OnDismissListener() {
		@Override
		public void onDismiss(DialogInterface dialog) {
			String selectedValue = editDialog.getSelectedValue();
			if(selectedValue != null)
			{
				setValue(selectedValue);
				parent.invalidate();
			}
		}
	});
	editDialog.show();
}
 
Example 10
Project: yelo-android   File: RatingDialogFragment.java   Source Code and License 6 votes vote down vote up
@Override
public void onAttach(final Activity activity) {

    super.onAttach(activity);

    if (activity instanceof OnClickListener) {
        mClickListener = (OnClickListener) activity;
    }

    else {
        throw new IllegalStateException("Activity must implement DialogInterface.OnClickListener");
    }

    if (activity instanceof OnDismissListener) {
        mOnDismissListener = (OnDismissListener) activity;
    }
}
 
Example 11
Project: yelo-android   File: SingleChoiceDialogFragment.java   Source Code and License 6 votes vote down vote up
@Override
public void onAttach(final Activity activity) {

    super.onAttach(activity);

    if (activity instanceof OnClickListener) {
        mClickListener = (OnClickListener) activity;
    }

    else {
        throw new IllegalStateException("Activity must implement DialogInterface.OnClickListener");
    }

    if (activity instanceof OnDismissListener) {
        mOnDismissListener = (OnDismissListener) activity;
    }
}
 
Example 12
Project: OpeningHoursFragment   File: OpeningHoursFragment.java   Source Code and License 6 votes vote down vote up
/**
 * Show a list of the templates in the database, selection will either load a template or start the edit dialog on
 * it
 * 
 * @param context Android context
 * @param manage if true the template editor will be started otherwise the template will replace the current OH
 *            value
 */
void loadOrManageTemplate(Context context, boolean manage) {
    AlertDialog.Builder alertDialog = new AlertDialog.Builder(context);
    View templateView = (View) inflater.inflate(R.layout.template_list, null);
    alertDialog.setTitle(manage ? R.string.manage_templates_title : R.string.load_templates_title);
    alertDialog.setView(templateView);
    ListView lv = (ListView) templateView.findViewById(R.id.listView1);
    final SQLiteDatabase writableDb = new TemplateDatabaseHelper(context).getWritableDatabase();
    templateCursor = TemplateDatabase.queryByKey(writableDb, manage ? null : key);
    templateAdapter = new TemplateAdapter(writableDb, context, templateCursor, manage);
    lv.setAdapter(templateAdapter);
    alertDialog.setNegativeButton(R.string.Done, null);
    alertDialog.setOnDismissListener(new OnDismissListener() {
        @Override
        public void onDismiss(DialogInterface dialog) {
            templateCursor.close();
            writableDb.close();
        }
    });
    templateDialog = alertDialog.show();
}
 
Example 13
Project: Lulu   File: MyFragment.java   Source Code and License 6 votes vote down vote up
private void showDialog() {
    final MaterialDialog materialDialog = new MaterialDialog(mContext);
    materialDialog.setCanceledOnTouchOutside(true);
    materialDialog.setMessage("这里是用来展示的文字信息的东西").setTitle("标题").setPositiveButton("确定", new OnClickListener() {
        @Override
        public void onClick(View v) {
            materialDialog.dismiss();
        }
    }).setNegativeButton("取消", null);
    materialDialog.setOnDismissListener(new OnDismissListener() {
        @Override
        public void onDismiss(DialogInterface dialog) {
            Toast.makeText(mContext, "运行到关闭了", Toast.LENGTH_SHORT).show();
        }
    });
    materialDialog.show();
}
 
Example 14
Project: freeiot-android   File: CommonUtils.java   Source Code and License 6 votes vote down vote up
public static final void showProgressDialog(Context context, String title,
		String message, OnDismissListener onDismissListener) {
	if (context == null) {
		return;
	}
	dismissDialog();
	if (TextUtils.isEmpty(title)) {
		title = "";
	}
	if (TextUtils.isEmpty(message)) {
		message = context.getString(R.string.loading);
	}
	mProgressDialog = ProgressDialog.show(context, title, message);
	mProgressDialog.setCancelable(true);
	mProgressDialog.setCanceledOnTouchOutside(false);
	mProgressDialog.setOnDismissListener(onDismissListener);
}
 
Example 15
Project: M3UPlayer   File: Player.java   Source Code and License 6 votes vote down vote up
private void browse() {
	if (mBrowser == null) {
		mBrowser = FileBrowser.createFileBrowser(this, "/", ".m3u", new OnFileSelectedListener() {
			
			@Override
			public void onFileSelected(String path) {
				prepareData(path);
				if (mBrowser != null && mBrowser.isShowing()) {
					mBrowser.dismiss();
				}
			}
		});
		mBrowser.setOnDismissListener(new OnDismissListener() {
			
			@Override
			public void onDismiss(DialogInterface dialog) {
				mBrowse.requestFocus();
			}
		});
	}
	mBrowser.show();
}
 
Example 16
Project: JVC-Forums-Reader   File: PmTopicActivity.java   Source Code and License 6 votes vote down vote up
public void pmTopicSeeAllPreviousMessagesClick(View view)
{
	seeAllMessagesDialog = new ProgressDialog(this);
	seeAllMessagesDialog.setCancelable(true);
	seeAllMessagesDialog.setOnDismissListener(new OnDismissListener()
	{
		@Override
		public void onDismiss(DialogInterface dialog)
		{
			stopLoadingAllMessages = true;
		}
	});
	seeAllMessagesDialog.setTitle(R.string.genericLoading);
	seeAllMessagesDialog.setIndeterminate(true);
	seeAllMessagesDialog.setMessage(String.format(getString(R.string.pmTopicLoadedMessages), 0));
	seeAllMessagesDialog.show();

	allMessagesCounter = 25;
	currentPage++;
	loadPreviousMessages(true);
}
 
Example 17
Project: sturesy-android-client   File: VotingActivity.java   Source Code and License 6 votes vote down vote up
/**
 * Displays a dialog to select question sets for voting. Loads selected
 * question set and sets UI to display values.
 */
private void loadQuestion() {
	if (!_isVotingRunning)
	{
		String title = getString(R.string.load_question_set);
		final FileImportDialog dialog = new FileImportDialog(this,
				new NameXMLFileFilter(), title);
		dialog.setOnDismissListener(new OnDismissListener() {

			@Override
			public void onDismiss(DialogInterface dialog2) {
				setCurrentFile(dialog.getSelectedFile());
				if (_currentFile != null)
				{
					readFile(_currentFile);
				}
			}
		});
		dialog.show();
	}
}
 
Example 18
Project: sturesy-android-client   File: VotingAnalysisActivity.java   Source Code and License 6 votes vote down vote up
/**
 * Opens a dialog to choose the voting results from. Triggers file
 * processing, if a valid file has been selected.
 */
private void openResults() {
	String title = getString(R.string.title_load_votes);
	final FileImportDialog dialog = new FileImportDialog(this,
			new LectureFileFilter(), title);
	dialog.setOnDismissListener(new OnDismissListener() {
		@Override
		public void onDismiss(DialogInterface dialog2) {
			File f = dialog.getSelectedFile();
			if (f != null)
			{
				readFile(f);
			}
		}
	});
	dialog.show();
}
 
Example 19
Project: sturesy-android-client   File: SingleQuestionFragment.java   Source Code and License 6 votes vote down vote up
@Override
public void onItemClick(AdapterView<?> parent, View view, int position,
		long id) {
	final int selectedPosition = position;
	final TextInputDialog input = new TextInputDialog(getActivity(),
			getString(R.string.enter_answer));
	input.setOnDismissListener(new OnDismissListener() {

		@Override
		public void onDismiss(DialogInterface dialog) {
			String updatedText = input.getText();
			if (!updatedText.equals(""))
			{
				_questionModel.getAnswers().set(selectedPosition,
						updatedText);
				_answerAdapter.notifyDataSetChanged();
			}
		}
	});
	input.setInputText(_questionModel.getAnswers().get(selectedPosition));
	input.show();
}
 
Example 20
Project: sturesy-android-client   File: MultipleQuestionFragment.java   Source Code and License 6 votes vote down vote up
@Override
public void onItemClick(AdapterView<?> parent, View view, int position,
		long id) {
	final int selectedPosition = position;
	final TextInputDialog input = new TextInputDialog(getActivity(),
			getString(R.string.enter_answer));
	input.setOnDismissListener(new OnDismissListener() {

		@Override
		public void onDismiss(DialogInterface dialog) {
			String updatedText = input.getText();
			if (!updatedText.equals(""))
			{
				_questionModel.getAnswers().set(selectedPosition,
						updatedText);
				_answerAdapter.notifyDataSetChanged();
			}
		}
	});
	input.setInputText(_questionModel.getAnswers().get(selectedPosition));
	input.show();
}
 
Example 21
Project: sturesy-android-client   File: QuestionGeneratorActivity.java   Source Code and License 6 votes vote down vote up
/**
 * Method to import qti questions and add them to the current questionset.
 */
private void importQTI() {
	String title = getString(R.string.qti_import);
	final FileImportDialog dialog = new FileImportDialog(this,
			new ZipFileFilter(), title);
	dialog.setOnDismissListener(new OnDismissListener() {
		@Override
		public void onDismiss(DialogInterface dialog2) {
			setQtiFile(dialog.getSelectedFile());
			if (_qtiFile != null)
			{
				QTIImportService qtiService = new QTIImportService();
				QuestionSet questions = qtiService.getQuestions(_qtiFile);
				for (QuestionModel questionModel : questions)
				{
					_currentQuestionset.addQuestionModel(questionModel);
				}
				_questionAdapter.notifyDataSetChanged();
				// Check if qti import was 100% successful
				checkQTIAfterImport(qtiService, questions);
			}
		}
	});
	dialog.show();
}
 
Example 22
Project: sturesy-android-client   File: QuestionGeneratorActivity.java   Source Code and License 6 votes vote down vote up
/**
 * Opens a dialog to select previously saved questions. Loads them after
 * selection.
 */
private void loadQuestion() {
	String title = getString(R.string.load_question_set);
	final FileImportDialog dialog = new FileImportDialog(this,
			new NameXMLFileFilter(), title);
	dialog.setOnDismissListener(new OnDismissListener() {
		@Override
		public void onDismiss(DialogInterface dialog2) {
			File f = dialog.getSelectedFile();
			if (f != null)
			{
				setCurrentFile(f);
				readFile(_currentFile);
			}
		}
	});
	dialog.show();
}
 
Example 23
Project: androsgi   File: OSGiHelper.java   Source Code and License 6 votes vote down vote up
private static void showErrorDialog(Exception e, android.content.Context androidContext){
	// show a dialog
	AlertDialog alertDialog = new AlertDialog.Builder(
               androidContext).create();
	alertDialog.setTitle("Error starting application");
	alertDialog.setMessage("Failed to start the OSGi runtime \n"
			+e.getMessage());

	alertDialog.setOnDismissListener(new OnDismissListener() {
		@Override
		public void onDismiss(DialogInterface dialog) {
			System.exit(-1);
		}
	});
	alertDialog.show();
}
 
Example 24
Project: barterli_android   File: AddUserInfoDialogFragment.java   Source Code and License 6 votes vote down vote up
@Override
public void onAttach(final Activity activity) {

    super.onAttach(activity);

    if (activity instanceof OnClickListener) {
        mClickListener = (OnClickListener) activity;
    }

    else {
        throw new IllegalStateException("Activity must implement DialogInterface.OnClickListener");
    }

    if (activity instanceof OnDismissListener) {
        mOnDismissListener = (OnDismissListener) activity;
    }
}
 
Example 25
Project: barterli_android   File: AlertDialogFragment.java   Source Code and License 6 votes vote down vote up
@Override
public void onAttach(final Activity activity) {

    super.onAttach(activity);

    if (activity instanceof OnClickListener) {
        mClickListener = (OnClickListener) activity;
    }

    else {
        throw new IllegalStateException("Activity must implement DialogInterface.OnClickListener");
    }

    if (activity instanceof OnDismissListener) {
        mOnDismissListener = (OnDismissListener) activity;
    }
}
 
Example 26
Project: barterli_android   File: AddSingleEditTextDialogFragment.java   Source Code and License 6 votes vote down vote up
@Override
public void onAttach(final Activity activity) {

    super.onAttach(activity);

    if (activity instanceof OnClickListener) {
        mClickListener = (OnClickListener) activity;
    }

    else {
        throw new IllegalStateException("Activity must implement DialogInterface.OnClickListener");
    }

    if (activity instanceof OnDismissListener) {
        mOnDismissListener = (OnDismissListener) activity;
    }
}
 
Example 27
Project: barterli_android   File: EnableLocationDialogFragment.java   Source Code and License 6 votes vote down vote up
@Override
public void onAttach(final Activity activity) {

    super.onAttach(activity);

    if (activity instanceof OnClickListener) {
        mClickListener = (OnClickListener) activity;
    }

    else {
        throw new IllegalStateException("Activity must implement DialogInterface.OnClickListener");
    }

    if (activity instanceof OnDismissListener) {
        mOnDismissListener = (OnDismissListener) activity;
    }
}
 
Example 28
Project: barterli_android   File: SingleChoiceDialogFragment.java   Source Code and License 6 votes vote down vote up
@Override
public void onAttach(final Activity activity) {

    super.onAttach(activity);

    if (activity instanceof OnClickListener) {
        mClickListener = (OnClickListener) activity;
    }

    else {
        throw new IllegalStateException("Activity must implement DialogInterface.OnClickListener");
    }

    if (activity instanceof OnDismissListener) {
        mOnDismissListener = (OnDismissListener) activity;
    }
}
 
Example 29
Project: AccelerationAlert   File: AccelerationAlertActivity.java   Source Code and License 6 votes vote down vote up
/**
 * Show a dialog with the acceleration event settings.
 */
private void showSettingsDialog()
{
	SettingsDialog dialog = new SettingsDialog(this);

	dialog.setOnDismissListener(new OnDismissListener()
	{
		@Override
		public void onDismiss(DialogInterface arg0)
		{
			// Read the new preferences.
			readPrefs();
		}
	});

	dialog.show();
}
 
Example 30
Project: chessonline   File: CPUWarning.java   Source Code and License 6 votes vote down vote up
@Override
protected Dialog onCreateDialog(int id) {
    switch (id) {
    case CPU_WARNING_DIALOG:
        AlertDialog.Builder builder = new AlertDialog.Builder(this);
        builder.setTitle(R.string.app_name).setMessage(R.string.cpu_warning);
        AlertDialog alert = builder.create();
        alert.setOnDismissListener(new OnDismissListener() {
            public void onDismiss(DialogInterface dialog) {
                finish();
            }
        });
        return alert;
    }
    return null;
}
 
Example 31
Project: TurkcellUpdater_android_sdk   File: UpdaterDialogManager.java   Source Code and License 6 votes vote down vote up
/**
 * Creates a dialog for given message.
 *
 * @param activity        Parent activity.
 * @param message         Message contents
 * @param dismissListener Listener that will be called when dialog is closed or
 *                        cancelled.
 * @return Created dialog.
 */
public static Dialog createMessageDialog(Activity activity, Message message, OnDismissListener dismissListener) {
    final AlertDialog.Builder builder = new AlertDialog.Builder(activity);
    final String title = message.description == null ? null : message.description.get(MessageDescription.KEY_TITLE);
    if (!Utilities.isNullOrEmpty(title)) {
        builder.setTitle(title);
    }
    final View dialogContentsView = createMessageDialogContentsView(activity, message.description);
    builder.setView(dialogContentsView);
    initializeMessageDialogButtons(activity, builder, message);
    builder.setCancelable(true);
    final AlertDialog dialog = builder.create();
    if (Utilities.isNullOrEmpty(title)) {
        dialog.getWindow().requestFeature(Window.FEATURE_NO_TITLE);
    }
    dialog.setOnDismissListener(dismissListener);
    return dialog;
}
 
Example 32
Project: Divide_And_Conquer_Card_Shuffler   File: ShufflerFragment.java   Source Code and License 6 votes vote down vote up
private Dialog createDialogInstructions(String title, String msg, String buttonText, OnDismissListener onDismiss) {
	// Use the custom instruction layout for the dialog.
	LayoutInflater inflater = (LayoutInflater) mActivity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
	LinearLayout layoutInstructions =
			(LinearLayout) inflater.inflate(R.layout.linearlayout_instructions, null, false);
	
	TextView textViewMessage = (TextView) layoutInstructions.findViewById(R.id.TextViewDialogInstructions);
	Button buttonOK = (Button) layoutInstructions.findViewById(R.id.ButtonDialogInstructionsOK);
	
	Dialog dialog = new Dialog(mActivity);
	dialog.getWindow().setBackgroundDrawableResource(R.color.background_dialog);
	dialog.setContentView(layoutInstructions);
	dialog.setTitle(title);
	dialog.setOnDismissListener(onDismiss);
	textViewMessage.setText(msg);
	buttonOK.setText(buttonText);
	buttonOK.setOnClickListener(mOnClickButtonDialogInstructionsOK);
	
	mDialogInstructions = dialog;
	
	return mDialogInstructions;
}
 
Example 33
Project: HoebApp   File: PreferencesActivity.java   Source Code and License 6 votes vote down vote up
@Click(R.id.addAccount)
public void addAccount() {
	dialog = new AccountDialog(this, null);

	dialog.setOnDismissListener(new OnDismissListener() {

		@Override
		public void onDismiss(final DialogInterface paramDialogInterface) {
			final Account account = dialog.getAccount();
			if (account != null) {
				accounts.add(account);
			}
			updateAccounts();
		}
	});
	dialog.show();
}
 
Example 34
Project: UIWidget   File: UIActionSheetView.java   Source Code and License 5 votes vote down vote up
/**
 * 设置关闭dialog 监听
 *
 * @param listener
 * @return
 */
public UIActionSheetView setOnDismissListener(OnDismissListener listener) {
    dialog.setOnDismissListener(listener);
    if (lLayoutItem != null) {
        lLayoutItem.removeAllViews();
    }
    if (lLayoutItem != null)
        lLayoutItem.removeAllViews();
    return this;
}
 
Example 35
Project: PresenterLite   File: StandaloneDisplayActivity.java   Source Code and License 5 votes vote down vote up
private void updatePresentation() {
    MediaRouter.RouteInfo route = mediaRouter
            .getSelectedRoute(MediaRouter.ROUTE_TYPE_LIVE_VIDEO);
    Display presentationDisplay = route != null ? route
            .getPresentationDisplay() : null;
    if (displayPresentation != null
            && displayPresentation.getDisplay() != presentationDisplay) {
        displayPresentation.dismiss();
        displayPresentation = null;
    }
    if (displayPresentation == null && presentationDisplay != null) {
        displayPresentation = new DisplayPresentation(this, presentationDisplay);
        displayPresentation.setOnDismissListener(
                new OnDismissListener() {

                    @Override
                    public void onDismiss(DialogInterface dialog) {
                        if (dialog == displayPresentation) {
                            displayPresentation = null;
                        }
                    }
                }
        );
        displayPresentation.show();
        displayPresentation.go(displayLayout.getCurrentSlidePos(), displayLayout.getCurrentSlidePhase());
    }
}
 
Example 36
Project: GuideHelper   File: GuideHelper.java   Source Code and License 5 votes vote down vote up
/**
 * @param autoPlay 是否自动播放提示
 * @return
 */
@TargetApi(Build.VERSION_CODES.KITKAT)
public GuideHelper show(boolean autoPlay) {
    this.autoPlay = autoPlay;
    //关闭dialog,移除handler消息
    dismiss();
    handler.removeCallbacksAndMessages(null);

    //创建dialog
    layout = new InnerChildRelativeLayout(activity);
    baseDialog = new Dialog(activity, android.R.style.Theme_DeviceDefault_Light_DialogWhenLarge_NoActionBar);
    baseDialog.getWindow().setBackgroundDrawable(new ColorDrawable(0x66000000));

    //设置沉浸式状态栏
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
        WindowManager.LayoutParams localLayoutParams = baseDialog.getWindow().getAttributes();
        localLayoutParams.flags |= WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS;
        localLayoutParams.flags |= WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN;
    }

    baseDialog.setContentView(layout);
    //设置dialog的窗口大小全屏
    baseDialog.getWindow().setLayout(WindowManager.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.MATCH_PARENT);
    //dialog关闭的时候移除所有消息
    baseDialog.setOnDismissListener(new OnDismissListener() {

        @Override
        public void onDismiss(DialogInterface dialog) {
            handler.removeCallbacksAndMessages(null);
            if (onDismissListener != null) {
                baseDialog.setOnDismissListener(onDismissListener);
            }
        }
    });
    //显示
    baseDialog.show();
    startSend();
    return this;
}
 
Example 37
Project: faims-android   File: ShowModuleActivity.java   Source Code and License 5 votes vote down vote up
private void showMemoryLowDialog() {
	memoryLowDialog = new ErrorDialog(this, getString(R.string.memory_low_title), getString(R.string.memory_low_message));
	memoryLowDialog.setOnDismissListener(new OnDismissListener() {
		
		@Override
		public void onDismiss(DialogInterface dialog) {
			ShowModuleActivity.this.finish();
		}
	});
	memoryLowDialog.show();
}
 
Example 38
Project: umeng_community_android   File: FindActivity.java   Source Code and License 5 votes vote down vote up
/**
 * 显示推荐话题的Dialog</br>
 */
private void showRecommendTopic() {
    if (mRecommendTopicFragment == null) {
        mRecommendTopicFragment = RecommendTopicFragment.newRecommendTopicFragment();
        mRecommendTopicFragment.setSaveButtonInVisiable();
        mRecommendTopicFragment.setOnDismissListener(new OnDismissListener() {

            @Override
            public void onDismiss(DialogInterface dialog) {
                showFindPage();
            }
        });
    }
    showCommFragment(mRecommendTopicFragment);
}
 
Example 39
Project: umeng_community_android   File: GuideActivity.java   Source Code and License 5 votes vote down vote up
/**
 * 显示话题引导页面</br>
 */
private void showTopicFragment() {
    RecommendTopicFragment topicRecommendDialog =RecommendTopicFragment.newRecommendTopicFragment();
    topicRecommendDialog.setOnDismissListener(new OnDismissListener() {

        @Override
        public void onDismiss(DialogInterface dialog) {
            showRecommendUserFragment();
        }
    });
    addFragment(mContainer, topicRecommendDialog);
}
 
Example 40
Project: AndroidGeek   File: FindActivity.java   Source Code and License 5 votes vote down vote up
/**
 * 显示推荐话题的Dialog</br>
 */
private void showRecommendTopic() {
    if (mRecommendTopicFragment == null) {
        mRecommendTopicFragment = RecommendTopicFragment.newRecommendTopicFragment();
        mRecommendTopicFragment.setSaveButtonInVisiable();
        mRecommendTopicFragment.setOnDismissListener(new OnDismissListener() {

            @Override
            public void onDismiss(DialogInterface dialog) {
                showFindPage();
            }
        });
    }
    showCommFragment(mRecommendTopicFragment);
}
 
Example 41
Project: AndroidGeek   File: GuideActivity.java   Source Code and License 5 votes vote down vote up
/**
 * 显示话题引导页面</br>
 */
private void showTopicFragment() {
    RecommendTopicFragment topicRecommendDialog =RecommendTopicFragment.newRecommendTopicFragment();
    topicRecommendDialog.setOnDismissListener(new OnDismissListener() {

        @Override
        public void onDismiss(DialogInterface dialog) {
            showRecommendUserFragment();
        }
    });
    addFragment(mContainer, topicRecommendDialog);
}
 
Example 42
Project: VSigner   File: LocationActivity.java   Source Code and License 5 votes vote down vote up
@Override
public void initData() {
	initLocationClientOption();
	mLocationClient.start();
	refreshLocation();
	
	Intent intent = getIntent();
	Serializable serializable = intent.getSerializableExtra(Constants.CHANNEL_KEY);
	if(serializable != null && serializable instanceof Channel) {
		mChannel = (Channel) serializable;
	} else {
		ShowToast(getString(R.string.param_error));
		finish();
	}
	if(!mChannel.isActive()) {
		TipsDialog tipsDialog = new TipsDialog(mContext, getString(R.string.channel_is_not_active), getString(R.string.ok));
		tipsDialog.SetOnDismissListener(new OnDismissListener() {
				@Override
				public void onDismiss(DialogInterface arg0) {
					finish();
				}
			});
		tipsDialog.show();
	}
	
	mChannelNameTextView.setText(mChannel.getName());
}
 
Example 43
Project: VSigner   File: BaseActivity.java   Source Code and License 5 votes vote down vote up
public void showProgressDialog(String message, boolean canceledOnTouchOutide){
	if(mProgressDialog == null) {
		mProgressDialog = new ProgressDialog(mContext);
		mProgressDialog.setOnDismissListener(new OnDismissListener() {
			@Override
			public void onDismiss(DialogInterface arg0) {
				mProgressDialog = null;
			}
		});
	}
	mProgressDialog.setMessage(message);
	mProgressDialog.setCanceledOnTouchOutside(canceledOnTouchOutide);
	mProgressDialog.show();
}
 
Example 44
Project: freeiot-android   File: LoginActivity.java   Source Code and License 5 votes vote down vote up
public void onPrepare() {
	CommonUtils.showProgressDialog(LoginActivity.this, null, getString(R.string.logining), new OnDismissListener() {

              @Override
              public void onDismiss(DialogInterface dialog) {
                  LogUtils.d("progress dialog onDissmiss Listener, cancel login...");
                  UserApi.cancel(LoginActivity.this, true);
              }
          });
}
 
Example 45
Project: JVC-Forums-Reader   File: PmNewActivity.java   Source Code and License 5 votes vote down vote up
public void pmNewPreviewButtonClick(View view)
{
	if(contentEditText.length() > 0)
	{
		MainApplication appContext = (MainApplication) getApplicationContext();
		PostItem item = new PostItem(this, true, showNoelshackThumbnails, animateSmileys);
		String date = new SimpleDateFormat("d MMMM y \u00E0 HH:mm:ss", Locale.FRANCE).format(new Date());
		JvcPost post = new JvcPost(null, 0, getPostTextWithSignature() + "\n", appContext.getJvcPseudo(), false, false, 1, date, null, null);

		item.updateDataFromPost(post, true);
		Dialog previewDialog = new Dialog(this, R.style.FullScreenNoTitleDialogTheme);
		previewDialog.setContentView(item.getView());
		startAnimatingDrawables(item.getView());
		previewDialog.setCancelable(true);
		previewDialog.setOnDismissListener(new OnDismissListener()
		{
			@Override
			public void onDismiss(DialogInterface dialogInterface)
			{
				stopAnimatingDrawables();
			}
		});
		previewDialog.show();
	}
	else
	{
		Toast.makeText(this, R.string.postEmpty, Toast.LENGTH_LONG).show();
	}
}
 
Example 46
Project: JVC-Forums-Reader   File: TopicReplyLayoutHandler.java   Source Code and License 5 votes vote down vote up
public void onClick(View view)
{
	if(replyEditText.length() > 0)
	{
		MainApplication appContext = (MainApplication) activity.getApplicationContext();
		PostItem item = new PostItem(activity, true, JvcUserData.getBoolean(JvcUserData.PREF_SHOW_NOELSHACK_THUMBNAILS, JvcUserData.DEFAULT_SHOW_NOELSHACK_THUMBNAILS), JvcUserData.getBoolean(JvcUserData.PREF_ANIMATE_SMILEYS, JvcUserData.DEFAULT_ANIMATE_SMILEYS));
		String date = new SimpleDateFormat("d MMMM y \u00E0 HH:mm:ss", Locale.FRANCE).format(new Date());
		JvcPost post = new JvcPost(null, 0, getPostTextWithSignature() + "\n", appContext.getJvcPseudo(), false, postAsMobileCheckBox.isChecked(), 1, date, null, null);

		item.updateDataFromPost(post, true);
		Dialog previewDialog = new Dialog(activity, R.style.FullScreenNoTitleDialogTheme);
		previewDialog.setContentView(item.getView());
		previewDialog.setCancelable(true);
		previewDialog.setOnDismissListener(new OnDismissListener()
		{
			@Override
			public void onDismiss(DialogInterface dialog)
			{
				handler.sendEmptyMessage(PREVIEW_POST_CLOSE);
			}
		});
		previewDialog.show();
		handler.sendMessage(Message.obtain(handler, PREVIEW_POST_ANIMATE, item.getView()));
	}
	else
	{
		Toast.makeText(activity, R.string.postEmpty, Toast.LENGTH_LONG).show();
	}
}
 
Example 47
Project: ntsync-android   File: ShowLicensesActivity.java   Source Code and License 5 votes vote down vote up
private void showPageOfText(String text) {
	// Create an AlertDialog to display the WebView in.
	AlertDialog.Builder builder = new AlertDialog.Builder(
			ShowLicensesActivity.this);
	builder.setCancelable(true).setView(mWebView)
			.setTitle(R.string.license_activity_title);

	mTextDlg = builder.create();
	mTextDlg.setOnDismissListener(new OnDismissListener() {
		public void onDismiss(DialogInterface dlgi) {
			ShowLicensesActivity.this.finish();
		}
	});

	// Begin the loading. This will be done in a separate thread in WebView.
	mWebView.loadDataWithBaseURL(null, text, "text/html", "utf-8", null);
	mWebView.setWebViewClient(new WebViewClient() {
		@Override
		public void onPageFinished(WebView view, String url) {
			if (mSpinnerDlg != null) {
				mSpinnerDlg.dismiss();
			}
			if (!ShowLicensesActivity.this.isFinishing()) {
				mTextDlg.show();
			}
		}
	});

	mWebView = null;
}
 
Example 48
Project: SpunkyCharts   File: ApplicationPreferences.java   Source Code and License 5 votes vote down vote up
private void
_setupStyleListeners(final View cv, final CheckBox bv, final int ii){                
    cv.setBackgroundColor(getDockingPanelColor(ii));
    cv.setOnClickListener( 
        new OnClickListener(){
            @Override
            public void onClick(View v){
                ColorPaletteDialog cpd = new ColorPaletteDialog(myActivity, getDockingPanelColor(ii));
                cpd.setOnDismissListener( 
                    new OnDismissListener(){
                        @Override
                        public void onDismiss(DialogInterface dialog){
                            setDockingPanelColor(ii, ((ColorPaletteDialog)dialog).getColorId());
                            cv.setBackgroundColor(getDockingPanelColor(ii));
                            cv.invalidate();
                        }                                
                    });
                cpd.show();
            }
        });
    bv.setOnCheckedChangeListener(
        new OnCheckedChangeListener(){
            @Override                        
            public void /* TODO: implement this */  
            onCheckedChanged(CompoundButton cButton, boolean isChecked){                               
                Toast.makeText(myActivity, "N/A", Toast.LENGTH_LONG).show();                                        
            }                                    
        }
    );                
}
 
Example 49
Project: XamarinAdmobTutorial   File: XyzWalletFragment.java   Source Code and License 5 votes vote down vote up
protected void initializeProgressDialog() {
    mProgressDialog = new ProgressDialog(getActivity());
    mProgressDialog.setMessage(getString(R.string.loading));
    mProgressDialog.setIndeterminate(true);
    mProgressDialog.setOnDismissListener(new OnDismissListener() {

        @Override
        public void onDismiss(DialogInterface dialog) {
            mHandleMaskedWalletWhenReady = false;
            mHandleFullWalletWhenReady = false;
        }
    });
}
 
Example 50
Project: sinovoice-pathfinder   File: CandidateView.java   Source Code and License 5 votes vote down vote up
/**
     * ��ʼ��¼��dialog
     */
    private void initAsrDialog() {
        mRecorderDialog = new JTAsrRecorderDialog(mService, asrListener);
        Window window = mRecorderDialog.getWindow();
        window.setType(WindowManager.LayoutParams.TYPE_SYSTEM_ALERT);
        window.addFlags(WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM);
//        window.setGravity(Gravity.BOTTOM | Gravity.CENTER_HORIZONTAL);
        mRecorderDialog.setOnDismissListener(new OnDismissListener() {
            @Override
            public void onDismiss(DialogInterface dialog) {
                if(TextUtils.isEmpty(mAsrResult)){
                    return;
                }
                
                Message msg = mHandler.obtainMessage(Pathfinder.MSG_WHAT_ASR_RESULT, mAsrResult);
                mHandler.sendMessage(msg);
                mAsrResult = "";
            }
        });

        JTAsrRecogParams asrRecogParams = new JTAsrRecogParams();
        asrRecogParams.setCapKey(SysConfig.CAPKEY_ASR);
        asrRecogParams
                .setAudioFormat(HciCloudAsr.HCI_ASR_AUDIO_FORMAT_PCM_16K16BIT);
        asrRecogParams.setMaxSeconds("60");
        asrRecogParams.setAddPunc("yes");

        // ��ȡ�ֻ�������,�����ֻ�����������ѹ����ʽ
        int cpuCoreNum = getNumCores();
        if (cpuCoreNum > 1) {
            asrRecogParams.setEncode(HciCloudAsr.HCI_ASR_ENCODE_SPEEX);
        } else {
            asrRecogParams.setEncode(HciCloudAsr.HCI_ASR_ENCODE_ALAW);
        }
        
        mRecorderDialog.setParams(asrRecogParams);
    }
 
Example 51
Project: 12306-android-Decompile   File: DViewManager.java   Source Code and License 5 votes vote down vote up
private void a(boolean paramBoolean)
{
  ((Activity)this.e).runOnUiThread(new Runnable(paramBoolean)
  {
    public void run()
    {
      DViewManager.b(DViewManager.this, DViewManager.i(DViewManager.this).a(this.a, DViewManager.f(DViewManager.this), DViewManager.j(DViewManager.this), DViewManager.k(DViewManager.this), DViewManager.d(DViewManager.this), DViewManager.e(DViewManager.this)));
      DViewManager.m(DViewManager.this).findViewById(d.a(DViewManager.f(DViewManager.this), "bar_button")).setOnClickListener(new View.OnClickListener()
      {
        public void onClick(View paramView)
        {
          DViewManager.a().b("关闭应用墙首页");
          DViewManager.l(DViewManager.this).dismiss();
        }
      });
      ((Activity)DViewManager.f(DViewManager.this)).setRequestedOrientation(1);
      DViewManager.l(DViewManager.this).setContentView(DViewManager.m(DViewManager.this));
      DViewManager.l(DViewManager.this).show();
      DViewManager.l(DViewManager.this).setOnDismissListener(new DialogInterface.OnDismissListener()
      {
        public void onDismiss(DialogInterface paramDialogInterface)
        {
          DViewManager.a().b("应用墙关闭");
          DViewManager.e(DViewManager.this).wallTurnHide();
          DViewManager.e(DViewManager.this).doUserActionReport(DService.ReportUserActionType.EXIT);
          ((Activity)DViewManager.f(DViewManager.this)).setRequestedOrientation(2);
        }
      });
    }
  });
}
 
Example 52
Project: HereAStory-Android   File: FullWalletConfirmationButtonFragment.java   Source Code and License 5 votes vote down vote up
protected void initializeProgressDialog() {
    mProgressDialog = new ProgressDialog(getActivity());
    mProgressDialog.setMessage(getString(R.string.loading));
    mProgressDialog.setIndeterminate(true);
    mProgressDialog.setOnDismissListener(new OnDismissListener() {

        @Override
        public void onDismiss(DialogInterface dialog) {
            mHandleFullWalletWhenReady = false;
        }
    });
}
 
Example 53
Project: AI-project   File: SamplesUtils.java   Source Code and License 5 votes vote down vote up
public static void indeterminate(Context context, Handler handler, String message, final Runnable runnable, OnDismissListener dismissListener)
{
	try
	{

		indeterminateInternal(context, handler, message, runnable, dismissListener, true);
	}
	catch (Exception e)
	{

		; // nop.
	}
}
 
Example 54
Project: AI-project   File: SamplesUtils.java   Source Code and License 5 votes vote down vote up
public static void indeterminate(Context context, Handler handler, String message, final Runnable runnable, OnDismissListener dismissListener,
	boolean cancelable)
{

	try
	{

		indeterminateInternal(context, handler, message, runnable, dismissListener, cancelable);
	}
	catch (Exception e)
	{

		; // nop.
	}
}
 
Example 55
Project: AI-project   File: DiscoveryActivity.java   Source Code and License 5 votes vote down vote up
protected void onCreate(Bundle savedInstanceState)
{
	super.onCreate(savedInstanceState);
	getWindow().setFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND, WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
	setContentView(R.layout.discovery);
	
	/* BT isEnable */
	if (!_bluetooth.isEnabled())
	{
		Log.w("EF-BTBee", ">>BTBee is disable!");
		finish();
		return;
	}
	/* Register Receiver*/
	IntentFilter discoveryFilter = new IntentFilter(BluetoothAdapter.ACTION_DISCOVERY_FINISHED);
	registerReceiver(_discoveryReceiver, discoveryFilter);
	IntentFilter foundFilter = new IntentFilter(BluetoothDevice.ACTION_FOUND);
	registerReceiver(_foundReceiver, foundFilter);
	
	/* show a dialog "Scanning..." */
	SamplesUtils.indeterminate(DiscoveryActivity.this, _handler, "Scanning...", _discoveryWorkder, new OnDismissListener() {
		public void onDismiss(DialogInterface dialog)
		{

			for (; _bluetooth.isDiscovering();)
			{

				_bluetooth.cancelDiscovery();
			}

			_discoveryFinished = true;
		}
	}, true);
}
 
Example 56
Project: opensudoku   File: HintsQueue.java   Source Code and License 5 votes vote down vote up
public HintsQueue(Context context) {
	mContext = context;
	mPrefs = mContext.getSharedPreferences(PREF_FILE_NAME, Context.MODE_PRIVATE);

	SharedPreferences gameSettings = PreferenceManager.getDefaultSharedPreferences(context);
	gameSettings.registerOnSharedPreferenceChangeListener(new OnSharedPreferenceChangeListener() {

		@Override
		public void onSharedPreferenceChanged(
				SharedPreferences sharedPreferences, String key) {
			if (key.equals("show_hints")) {
				mOneTimeHintsEnabled = sharedPreferences.getBoolean("show_hints", true);
			}
		}

	});
	mOneTimeHintsEnabled = gameSettings.getBoolean("show_hints", true);

	mHintDialog = new AlertDialog.Builder(context)
			.setIcon(R.drawable.ic_info)
			.setTitle(R.string.hint)
			.setMessage("")
			.setPositiveButton(R.string.close, mHintClosed).create();

	mHintDialog.setOnDismissListener(new OnDismissListener() {

		@Override
		public void onDismiss(DialogInterface dialog) {
			processQueue();
		}

	});

	mMessages = new LinkedList<Message>();
}
 
Example 57
Project: silent-contacts-android   File: DialogManager.java   Source Code and License 5 votes vote down vote up
/**
 * Callback function called by the Activity to handle View-managed Dialogs.
 * This function returns null if the id is not one of the two reserved Ids.
 */
public Dialog onCreateDialog(final int id, final Bundle bundle) {
    if (id == R.id.dialog_manager_id_1) {
        mUseDialogId2 = true;
    } else if (id == R.id.dialog_manager_id_2) {
        mUseDialogId2 = false;
    } else {
        return null;
    }
    if (!bundle.containsKey(VIEW_ID_KEY)) {
        throw new IllegalArgumentException("Bundle does not contain a ViewId");
    }
    final int viewId = bundle.getInt(VIEW_ID_KEY);
    final View view = mActivity.findViewById(viewId);
    if (view == null || !(view instanceof DialogShowingView)) {
        return null;
    }
    final Dialog dialog = ((DialogShowingView)view).createDialog(bundle);
    if (dialog == null) {
        return dialog;
    }

    // As we will never re-use this dialog, we can completely kill it here
    dialog.setOnDismissListener(new OnDismissListener() {
        public void onDismiss(DialogInterface dialogInterface) {
            mActivity.removeDialog(id);
        }
    });
    return dialog;
}
 
Example 58
Project: OpenSudoku   File: HintsQueue.java   Source Code and License 5 votes vote down vote up
public HintsQueue(Context context) {
	mContext = context;
	mPrefs = mContext.getSharedPreferences(PREF_FILE_NAME, Context.MODE_PRIVATE);

	SharedPreferences gameSettings = PreferenceManager.getDefaultSharedPreferences(context);
	gameSettings.registerOnSharedPreferenceChangeListener(new OnSharedPreferenceChangeListener() {

		@Override
		public void onSharedPreferenceChanged(
				SharedPreferences sharedPreferences, String key) {
			if (key.equals("show_hints")) {
				mOneTimeHintsEnabled = sharedPreferences.getBoolean("show_hints", true);
			}
		}

	});
	mOneTimeHintsEnabled = gameSettings.getBoolean("show_hints", true);

	mHintDialog = new AlertDialog.Builder(context)
			.setIcon(android.R.drawable.ic_menu_info_details)
			.setTitle(R.string.hint)
			.setMessage("")
			.setPositiveButton(R.string.close, mHintClosed).create();

	mHintDialog.setOnDismissListener(new OnDismissListener() {

		@Override
		public void onDismiss(DialogInterface dialog) {
			processQueue();
		}

	});

	mMessages = new LinkedList<Message>();
}
 
Example 59
Project: NexusDialog   File: DatePickerController.java   Source Code and License 5 votes vote down vote up
private void showDatePickerDialog(final Context context, final EditText editText) {
    // don't show dialog again if it's already being shown
    if (datePickerDialog == null) {
        Date date = (Date)getModel().getValue(getName());
        if (date == null) {
            date = new Date();
        }
        Calendar calendar = Calendar.getInstance(Locale.getDefault());
        calendar.setTimeZone(timeZone);
        calendar.setTime(date);

        datePickerDialog = new DatePickerDialog(context, new OnDateSetListener() {
            @Override
            public void onDateSet(DatePicker view, int year, int monthOfYear, int dayOfMonth) {
                Calendar calendar = Calendar.getInstance(Locale.getDefault());
                calendar.setTimeZone(timeZone);
                calendar.set(year, monthOfYear, dayOfMonth);
                getModel().setValue(getName(), calendar.getTime());
                editText.setText(displayFormat.format(calendar.getTime()));

            }
        }, calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH), calendar.get(Calendar.DAY_OF_MONTH));

        datePickerDialog.setOnDismissListener(new OnDismissListener() {
            @Override
            public void onDismiss(DialogInterface dialog) {
                datePickerDialog = null;
            }
        });

        datePickerDialog.show();
    }
}
 
Example 60
Project: 12306-android-Decompile   File: DViewManager.java   Source Code and License 5 votes vote down vote up
private void a(boolean paramBoolean)
{
  ((Activity)this.e).runOnUiThread(new Runnable(paramBoolean)
  {
    public void run()
    {
      DViewManager.b(DViewManager.this, DViewManager.i(DViewManager.this).a(this.a, DViewManager.f(DViewManager.this), DViewManager.j(DViewManager.this), DViewManager.k(DViewManager.this), DViewManager.d(DViewManager.this), DViewManager.e(DViewManager.this)));
      DViewManager.m(DViewManager.this).findViewById(d.a(DViewManager.f(DViewManager.this), "bar_button")).setOnClickListener(new View.OnClickListener()
      {
        public void onClick(View paramView)
        {
          DViewManager.a().b("关闭应用墙首页");
          DViewManager.l(DViewManager.this).dismiss();
        }
      });
      ((Activity)DViewManager.f(DViewManager.this)).setRequestedOrientation(1);
      DViewManager.l(DViewManager.this).setContentView(DViewManager.m(DViewManager.this));
      DViewManager.l(DViewManager.this).show();
      DViewManager.l(DViewManager.this).setOnDismissListener(new DialogInterface.OnDismissListener()
      {
        public void onDismiss(DialogInterface paramDialogInterface)
        {
          DViewManager.a().b("应用墙关闭");
          DViewManager.e(DViewManager.this).wallTurnHide();
          DViewManager.e(DViewManager.this).doUserActionReport(DService.ReportUserActionType.EXIT);
          ((Activity)DViewManager.f(DViewManager.this)).setRequestedOrientation(2);
        }
      });
    }
  });
}