當前位置: 首頁>>代碼示例>>Java>>正文


Java DialogFragment.show方法代碼示例

本文整理匯總了Java中android.support.v4.app.DialogFragment.show方法的典型用法代碼示例。如果您正苦於以下問題:Java DialogFragment.show方法的具體用法?Java DialogFragment.show怎麽用?Java DialogFragment.show使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.support.v4.app.DialogFragment的用法示例。


在下文中一共展示了DialogFragment.show方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onOptionsItemSelected

import android.support.v4.app.DialogFragment; //導入方法依賴的package包/類
@Override
public boolean onOptionsItemSelected(MenuItem item) {
    switch (item.getItemId()) {
        case R.id.action_locate:
            if (hasLocationPermission()) {
                findCoords();
            } else if (ActivityCompat.shouldShowRequestPermissionRationale(
                    getActivity(), LOCATION_PERMISSIONS[0])) {
                DialogFragment dialog = new PermissionRationaleFragment();
                dialog.setTargetFragment(PlaceListFragment.this, 0);
                dialog.show(getFragmentManager(), PERMISSION_RATIONALE_DIALOG);

            } else {
                requestPermissions(LOCATION_PERMISSIONS, REQUEST_LOCATION_PERMISSIONS);
            }
            return true;
        default:
            return super.onOptionsItemSelected(item);
    }
}
 
開發者ID:plweegie,項目名稱:piast-trail,代碼行數:21,代碼來源:PlaceListFragment.java

示例2: onDisplayPreferenceDialog

import android.support.v4.app.DialogFragment; //導入方法依賴的package包/類
@Override
public void onDisplayPreferenceDialog(Preference preference) {
    if (callback != null) {
        callback.onSettingChanged();
    }

    DialogFragment dialogFragment = null;
    if (preference instanceof StylePreference) {
        dialogFragment
                = StylePreferenceDialogFragment
                .newInstance(preference);
    } else if (preference instanceof ColumnCountPreference) {
        dialogFragment
                = ColumnCountPreferenceDialogFragment
                .newInstance(preference);
    }

    if (dialogFragment != null) {
        dialogFragment.setTargetFragment(this, 0);
        dialogFragment.show(this.getFragmentManager(), DIALOG_FRAGMENT_TAG);
        return;
    }

    super.onDisplayPreferenceDialog(preference);
}
 
開發者ID:kollerlukas,項目名稱:Camera-Roll-Android-App,代碼行數:26,代碼來源:SettingsActivity.java

示例3: dontClearForDialog

import android.support.v4.app.DialogFragment; //導入方法依賴的package包/類
@Test
public void dontClearForDialog() throws Throwable {
    testFragment.testValue = new AutoClearedValue<>(testFragment, "foo");
    DialogFragment dialogFragment = new DialogFragment();
    dialogFragment.show(testFragment.getFragmentManager(), "dialog");
    dialogFragment.dismiss();
    InstrumentationRegistry.getInstrumentation().waitForIdleSync();
    assertThat(testFragment.testValue.get(), is("foo"));
}
 
開發者ID:googlesamples,項目名稱:android-architecture-components,代碼行數:10,代碼來源:AutoClearedValueTest.java

示例4: onSuccess

import android.support.v4.app.DialogFragment; //導入方法依賴的package包/類
@Override
public void onSuccess(List<String> connectionInfo) {
    if (getActivity() == null) {
        // our activity went away while we worked...
        return;
    }
    if (snackbar != null) {
        snackbar.dismiss();
    }
    DialogFragment newFragment = HtmlDialogFragment.newInstance(connectionInfo.get(0));
    newFragment.show(getActivity().getSupportFragmentManager(), "conninfo");
}
 
開發者ID:gbl08ma,項目名稱:underlx,代碼行數:13,代碼來源:StationGeneralFragment.java

示例5: onFileUploaded

import android.support.v4.app.DialogFragment; //導入方法依賴的package包/類
@Override
public void onFileUploaded(final String fileCode) {
    if (isUIVisible) {
        showUploadDialog = false;
        hideBottomNotice();
        DialogFragment dialog = UploadFileDialog.newInstance(fileCode);
        dialog.show(getActivity().getSupportFragmentManager(), UploadFileDialogTag);
    } else {
        showUploadDialog = true;
        showUploadDialogCode = fileCode;
    }
    mUploadFile.setEnabled(true);
    mUploadFile.setImageDrawable(ResourcesCompat.getDrawable(getResources(), R.drawable
            .ic_file_upload_24dp, null));
}
 
開發者ID:metarhia,項目名稱:metacom-android,代碼行數:16,代碼來源:FilesFragment.java

示例6: onDisplayPreferenceDialog

import android.support.v4.app.DialogFragment; //導入方法依賴的package包/類
/**
 * Called when a preference in the tree requests to display a dialog. Subclasses should
 * override this method to display custom dialogs or to handle dialogs for custom preference
 * classes.
 *
 * @param preference The Preference object requesting the dialog.
 */
@Override
public void onDisplayPreferenceDialog(Preference preference) {
	if (preference instanceof VolumePreference) {
		DialogFragment fragment = VolumePreferenceFragment.newInstance(preference);
		fragment.setTargetFragment(this, 0);
		fragment.show(getFragmentManager(),
				"android.support.v7.preference.PreferenceFragment.DIALOG");
	} else {
		super.onDisplayPreferenceDialog(preference);
	}
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:19,代碼來源:SettingsFragment.java

示例7: pickDate

import android.support.v4.app.DialogFragment; //導入方法依賴的package包/類
public void pickDate(View view) {
    /* This function is called when the user presses the "pick the date" button. */
    //Create the arguments for the fragment:
    Bundle defaultDate = new Bundle();
    defaultDate.putInt("year", startingTime.get(Calendar.YEAR));
    defaultDate.putInt("month", startingTime.get(Calendar.MONTH));
    defaultDate.putInt("day", startingTime.get(Calendar.DAY_OF_MONTH));
    //This fragment will allow the user to pick the date, with the default being the date that was picked before:
    DialogFragment dateFragment = new DriveDateFragment();
    dateFragment.setArguments(defaultDate);
    //Start the date fragment:
    dateFragment.show(getSupportFragmentManager(), "DriveDateFragment");
}
 
開發者ID:brianjaustin,項目名稱:permitlog-android,代碼行數:14,代碼來源:CustomDriveDialog.java

示例8: pickTime

import android.support.v4.app.DialogFragment; //導入方法依賴的package包/類
public void pickTime(Calendar driveTime) {
    //Create the arguments for the fragment:
    Bundle defaultTime = new Bundle();
    defaultTime.putInt("hour", driveTime.get(Calendar.HOUR_OF_DAY));
    defaultTime.putInt("minute", driveTime.get(Calendar.MINUTE));
    //This fragment will allow the user to pick the date:
    DialogFragment timeFragment = new DriveTimeFragment();
    timeFragment.setArguments(defaultTime);
    //Start the date fragment:
    timeFragment.show(getSupportFragmentManager(), "DriveTimeFragment");
}
 
開發者ID:brianjaustin,項目名稱:permitlog-android,代碼行數:12,代碼來源:CustomDriveDialog.java

示例9: showMemoDialog

import android.support.v4.app.DialogFragment; //導入方法依賴的package包/類
private void showMemoDialog(){
    DialogFragment dialog = new MemoDialogFragment();
    Bundle args = new Bundle();
    args.putSerializable("type", requestMessage.getChallengeType());
    args.putString("opponent", requestMessage.getFrom());
    args.putString("sender", requestMessage.getSender());
    args.putSerializable("date", requestMessage.getTime());
    args.putString("opponentEmail", requestMessage.getFrom());
    dialog.setArguments(args);
    dialog.show(getSupportFragmentManager(), "MemoDialogFragment");
}
 
開發者ID:IrrilevantHappyLlamas,項目名稱:Runnest,代碼行數:12,代碼來源:SideBarActivity.java

示例10: showDiaryEntryDeletionMessage

import android.support.v4.app.DialogFragment; //導入方法依賴的package包/類
@Override
public void showDiaryEntryDeletionMessage(final int position) {
    mDeletionPosition = position;
    DialogFragment newFragment = new DeleteDiaryEntryDialogFragment();
    newFragment.setTargetFragment(this, ENTRY_DELETION_REQ_CODE);
    newFragment.show(getFragmentManager(), "delete entry");
}
 
開發者ID:jgevans,項目名稱:TherapyGuide,代碼行數:8,代碼來源:DiaryFragment.java

示例11: onCreate

import android.support.v4.app.DialogFragment; //導入方法依賴的package包/類
@Override
protected void onCreate(final Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	setContentView(R.layout.activity_feature_dfu);
	isBLESupported();
	if (!isBLEEnabled()) {
		showBLEDialog();
	}
	setGUI();

	// Try to create sample files
	if (FileHelper.newSamplesAvailable(this)) {
		if (ActivityCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED) {
			FileHelper.createSamples(this);
		} else {
			final DialogFragment dialog = PermissionRationaleFragment.getInstance(R.string.permission_sd_text, Manifest.permission.WRITE_EXTERNAL_STORAGE);
			dialog.show(getSupportFragmentManager(), null);
		}
	}

	// restore saved state
	mFileType = DfuService.TYPE_AUTO; // Default
	if (savedInstanceState != null) {
		mFileType = savedInstanceState.getInt(DATA_FILE_TYPE);
		mFileTypeTmp = savedInstanceState.getInt(DATA_FILE_TYPE_TMP);
		mFilePath = savedInstanceState.getString(DATA_FILE_PATH);
		mFileStreamUri = savedInstanceState.getParcelable(DATA_FILE_STREAM);
		mInitFilePath = savedInstanceState.getString(DATA_INIT_FILE_PATH);
		mInitFileStreamUri = savedInstanceState.getParcelable(DATA_INIT_FILE_STREAM);
		mSelectedDevice = savedInstanceState.getParcelable(DATA_DEVICE);
		mStatusOk = mStatusOk || savedInstanceState.getBoolean(DATA_STATUS);
		mUploadButton.setEnabled(mSelectedDevice != null && mStatusOk);
	}
}
 
開發者ID:runtimeco,項目名稱:Android-DFU-App,代碼行數:35,代碼來源:DfuActivity.java

示例12: showConfirmGoBackDialog

import android.support.v4.app.DialogFragment; //導入方法依賴的package包/類
public void showConfirmGoBackDialog() {

        if (!mTimeControl.isEqual(mTimeControlSnapshot)) {
            DialogFragment newFragment = ExitConfirmationDialogFragment.newInstance();
            newFragment.setTargetFragment(this, REQUEST_EXIT_DIALOG);
            newFragment.show(getFragmentManager(), TAG_EXIT_DIALOG_FRAGMENT);
        } else {
            getActivity().getSupportFragmentManager().popBackStack();
        }
    }
 
開發者ID:ChessCom,項目名稱:android-chessclock,代碼行數:11,代碼來源:TimeControlFragment.java

示例13: createImportDialog

import android.support.v4.app.DialogFragment; //導入方法依賴的package包/類
public void createImportDialog() {
    DialogFragment dialogFragment = new ImportSongDialog();
    dialogFragment.show(getSupportFragmentManager(), "Import");
}
 
開發者ID:Davarco,項目名稱:Divertio,代碼行數:5,代碼來源:MainActivity.java

示例14: createDownloadFailureDialog

import android.support.v4.app.DialogFragment; //導入方法依賴的package包/類
public void createDownloadFailureDialog(DialogFragment d) {
    d.dismiss();
    DialogFragment uploadFailureDialog = new DownloadConnectionFailureDialog();
    uploadFailureDialog.show(getSupportFragmentManager(), "UploadFailure");
}
 
開發者ID:Davarco,項目名稱:Divertio,代碼行數:6,代碼來源:MainActivity.java

示例15: featureSelectorDialog

import android.support.v4.app.DialogFragment; //導入方法依賴的package包/類
public void featureSelectorDialog() {
    DialogFragment dialogFragment = PoiFeatureDialogFragment.newInstance();
    dialogFragment.setTargetFragment(this, 1);
    dialogFragment.show(getActivity().getSupportFragmentManager(), "PoiFeatureDialogFragment");
}
 
開發者ID:CityZenApp,項目名稱:Android-Development,代碼行數:6,代碼來源:CreatePoiFragment.java


注:本文中的android.support.v4.app.DialogFragment.show方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。