当前位置: 首页>>代码示例>>Java>>正文


Java Dialog类代码示例

本文整理汇总了Java中android.app.Dialog的典型用法代码示例。如果您正苦于以下问题:Java Dialog类的具体用法?Java Dialog怎么用?Java Dialog使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Dialog类属于android.app包,在下文中一共展示了Dialog类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: destroyDialog

import android.app.Dialog; //导入依赖的package包/类
@Test
public void destroyDialog() {
  screen.showDialog(new DialogCreator() {
    @Override
    public Dialog createDialog(Activity activity) {
      return dialog;
    }
  });
  screen.destroyDialog();

  verify(dialog).setOnDismissListener(null);
  verify(dialog).dismiss();
}
 
开发者ID:wealthfront,项目名称:magellan,代码行数:14,代码来源:ScreenTest.java

示例2: optionLegend

import android.app.Dialog; //导入依赖的package包/类
private void optionLegend() {
	// Show help
	Dialog dialog = new Dialog(ActivityApp.this);
	dialog.requestWindowFeature(Window.FEATURE_LEFT_ICON);
	dialog.setTitle(R.string.menu_legend);
	dialog.setContentView(R.layout.legend);
	dialog.setFeatureDrawableResource(Window.FEATURE_LEFT_ICON, getThemed(R.attr.icon_launcher));

	((ImageView) dialog.findViewById(R.id.imgHelpHalf)).setImageBitmap(getHalfCheckBox());
	((ImageView) dialog.findViewById(R.id.imgHelpOnDemand)).setImageBitmap(getOnDemandCheckBox());

	for (View child : Util.getViewsByTag((ViewGroup) dialog.findViewById(android.R.id.content), "main"))
		child.setVisibility(View.GONE);

	((LinearLayout) dialog.findViewById(R.id.llUnsafe)).setVisibility(PrivacyManager.cVersion3 ? View.VISIBLE
			: View.GONE);

	dialog.setCancelable(true);
	dialog.show();
}
 
开发者ID:ukanth,项目名称:XPrivacy,代码行数:21,代码来源:ActivityApp.java

示例3: onCreateDialog

import android.app.Dialog; //导入依赖的package包/类
@NonNull
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    ArrayList<DonateBean> dataList = (ArrayList<DonateBean>) getArguments().getSerializable("data");

    return new AlertDialog.Builder(getActivity())
            .setTitle(R.string.preference_support_title_sponsors)
            .setItems(parseData(dataList), null)
            .setPositiveButton(R.string.dlg_bt_donate_too, new DialogInterface.OnClickListener() {
                @Override
                public void onClick(DialogInterface dialog, int which) {
                    if (onDonateListener != null) {
                        onDonateListener.onDonate();
                    }
                }
            })
            .create();
}
 
开发者ID:by-syk,项目名称:NanoIconPack,代码行数:19,代码来源:SponsorsDialog.java

示例4: onCreateDialog

import android.app.Dialog; //导入依赖的package包/类
@NonNull
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    final Bundle args = getArguments();
    final AspectRatio[] ratios = (AspectRatio[]) args.getParcelableArray(ARG_ASPECT_RATIOS);
    if (ratios == null) {
        throw new RuntimeException("No ratios");
    }
    Arrays.sort(ratios);
    final AspectRatio current = args.getParcelable(ARG_CURRENT_ASPECT_RATIO);
    final AspectRatioAdapter adapter = new AspectRatioAdapter(ratios, current);
    return new AlertDialog.Builder(getActivity())
        .setAdapter(adapter, new DialogInterface.OnClickListener() {
            @Override
            public void onClick(DialogInterface dialog, int position) {
                mListener.onAspectRatioSelected(ratios[position]);
            }
        })
        .create();
}
 
开发者ID:lytcom,项目名称:CameraKitView,代码行数:21,代码来源:AspectRatioFragment.java

示例5: showRecoveryDialog

import android.app.Dialog; //导入依赖的package包/类
private void showRecoveryDialog(int statusCode) {
    Activity activity = getActivity("showRecoveryDialog()");
    if (activity == null) {
        return;
    }

    if (sCanShowAuthUi) {
        sCanShowAuthUi = false;
        LOGD(TAG, "Showing recovery dialog for status code " + statusCode);
        final Dialog d = GooglePlayServicesUtil.getErrorDialog(
                statusCode, activity, REQUEST_RECOVER_FROM_PLAY_SERVICES_ERROR);
        d.show();
    } else {
        LOGD(TAG, "Not showing Play Services recovery dialog because sCanShowSignInUi==false.");
        reportAuthFailure();
    }
}
 
开发者ID:dreaminglion,项目名称:iosched-reader,代码行数:18,代码来源:LoginAndAuthHelper.java

示例6: setupDialog

import android.app.Dialog; //导入依赖的package包/类
@Override
public void setupDialog(Dialog dialog, int style) {
    super.setupDialog(dialog, style);

    View view = View.inflate(getActivity(), R.layout.bottom_sheet_attachments, null);

    mRecyclerView = view.findViewById(R.id.recycler_view);
    mRecyclerView.setLayoutManager(new LinearLayoutManager(getActivity(), LinearLayoutManager.HORIZONTAL, false));

    mEmptyView = view.findViewById(R.id.empty_root);

    view.findViewById(R.id.button_send).setOnClickListener(v -> {
        getTargetFragment().onActivityResult(getTargetRequestCode(), Activity.RESULT_OK, null);
        getDialog().dismiss();
    });

    view.findViewById(R.id.button_hide).setOnClickListener(v -> getDialog().dismiss());
    view.findViewById(R.id.button_video).setOnClickListener(v -> getPresenter().fireButtonVideoClick());
    view.findViewById(R.id.button_doc).setOnClickListener(v -> getPresenter().fireButtonDocClick());
    view.findViewById(R.id.button_camera).setOnClickListener(v -> getPresenter().fireButtonCameraClick());

    dialog.setContentView(view);
    fireViewCreated();
}
 
开发者ID:PhoenixDevTeam,项目名称:Phoenix-for-VK,代码行数:25,代码来源:MessageAttachmentsFragment.java

示例7: setCodeDialogContentView

import android.app.Dialog; //导入依赖的package包/类
private static Dialog setCodeDialogContentView(Context context){
	switch (Adaptation.proportion){
		case Adaptation.SCREEN_9_16:
               String model = Build.MODEL;
               if (model.contains("M1") || model.contains("m1")) {
                   return getDialog(context, R.layout.dialog_code_9_16_m1);
               }else {
                   return getDialog(context, R.layout.dialog_code_9_16);
               }
		case Adaptation.SCREEN_3_4:
			return getDialog(context, R.layout.dialog_code_9_16);
		case Adaptation.SCREEN_4_3:
			return getDialog(context, R.layout.dialog_code_16_9);
		case Adaptation.SCREEN_16_9:
			return getDialog(context, R.layout.dialog_code_16_9);
		default:
			return getDialog(context, R.layout.dialog_code_9_16);
	}
}
 
开发者ID:teisun,项目名称:SunmiUI,代码行数:20,代码来源:DialogCreater.java

示例8: onCreateDialog

import android.app.Dialog; //导入依赖的package包/类
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    View v = getActivity().getLayoutInflater().inflate(R.layout.create_share_dialog, null);
    pathEdit = (EditText) v.findViewById(R.id.edit_sharepath);
    pathEdit.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS);

    Dialog dialog = new AlertDialog.Builder(getActivity()).setTitle(R.string.manually_create_share)
            .setView(v)
            .setNegativeButton(android.R.string.cancel, null)
            .setPositiveButton(android.R.string.yes, this).create();

    // Put the cursor at the end of "smb://"
    // This must be done after the dialog is created, else it does not work
    pathEdit.setSelection(pathEdit.getText().length());

    return dialog;
}
 
开发者ID:archos-sa,项目名称:aos-Video,代码行数:18,代码来源:CreateShareDialog.java

示例9: onCreateDialog

import android.app.Dialog; //导入依赖的package包/类
@NonNull
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    @SuppressLint("InflateParams") View view = LayoutInflater.from(getActivity()).inflate(R.layout.dialog_board_contributors, null, false);
    unbinder = ButterKnife.bind(this, view);
    if (null == getActivity()) {
        return new AlertDialog.Builder(getActivity())
                .setTitle(R.string.contributors)
                .setView(view)
                .setNegativeButton(R.string.closed, null)
                .create();
    } else {
        return new android.support.v7.app.AlertDialog.Builder(getActivity())
                .setTitle(R.string.contributors)
                .setView(view)
                .setNegativeButton(R.string.closed, null)
                .create();
    }
}
 
开发者ID:alphater,项目名称:garras,代码行数:20,代码来源:BoardContributorsDialog.java

示例10: onCreateDialog

import android.app.Dialog; //导入依赖的package包/类
@NonNull
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    final RelativeLayout root = new RelativeLayout(getActivity());
    root.setLayoutParams(new ViewGroup.LayoutParams(
            ViewGroup.LayoutParams.MATCH_PARENT,
            ViewGroup.LayoutParams.WRAP_CONTENT));
    // creating the fullscreen dialog
    final Dialog dialog = new Dialog(getContext());
    dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
    dialog.setContentView(root);
    if (dialog.getWindow() != null) {
        dialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
        dialog.getWindow().setLayout(
                ViewGroup.LayoutParams.MATCH_PARENT,
                ViewGroup.LayoutParams.WRAP_CONTENT);
    }
    dialog.setCanceledOnTouchOutside(false);
    return dialog;
}
 
开发者ID:graviton57,项目名称:DOUSalaries,代码行数:21,代码来源:BaseDialog.java

示例11: openHelpDialog

import android.app.Dialog; //导入依赖的package包/类
/**
 * @brief Show the dialog with the help message
 * @return The new dialog
 * @details Show the dialog with the help message
 */
private Dialog openHelpDialog()
 {
	
              
       final TextView text = new TextView(this);
       text.setText(R.string.help_message); 

  return new AlertDialog.Builder(this)
  .setTitle(R.string.help_title)
  .setView(text)
  .setPositiveButton(R.string.help_ok,
   new DialogInterface.OnClickListener() {
    
    @Override
    public void onClick(DialogInterface dialog, int which) {	     
    }
   }
    )
  .show();
 }
 
开发者ID:CodyyAndroid,项目名称:LibVNCAndroid,代码行数:26,代码来源:CanvasActivity.java

示例12: onCreateDialog

import android.app.Dialog; //导入依赖的package包/类
@NonNull
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {

    final List<Playlist> playlists = PlaylistLoader.getPlaylists(getActivity(), false);
    CharSequence[] chars = new CharSequence[playlists.size() + 1];
    chars[0] = "Create new playlist";

    for (int i = 0; i < playlists.size(); i++) {
        chars[i + 1] = playlists.get(i).name;
    }
    return new MaterialDialog.Builder(getActivity()).title("Add to playlist").items(chars).itemsCallback(new MaterialDialog.ListCallback() {
        @Override
        public void onSelection(MaterialDialog dialog, View itemView, int which, CharSequence text) {
            long[] songs = getArguments().getLongArray("songs");
            if (which == 0) {
                CreatePlaylistDialog.newInstance(songs).show(getActivity().getSupportFragmentManager(), "CREATE_PLAYLIST");
                return;
            }

            MusicPlayer.addToPlaylist(getActivity(), songs, playlists.get(which - 1).id);
            dialog.dismiss();

        }
    }).build();
}
 
开发者ID:Vinetos,项目名称:Hello-Music-droid,代码行数:27,代码来源:AddPlaylistDialog.java

示例13: onCreateDialog

import android.app.Dialog; //导入依赖的package包/类
@NonNull
@SuppressLint("InflateParams")
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
    LayoutInflater inflater = getActivity().getLayoutInflater();

    if (savedInstanceState != null) {
        mBio = savedInstanceState.getString("bio", mBio);
    }

    builder.setView(inflater.inflate(R.layout.dialog_update_profile_info, null))
            .setTitle(R.string.update_title)
            .setPositiveButton(R.string.update, null)
            .setNegativeButton(R.string.cancel, null);

    return builder.create();
}
 
开发者ID:Q115,项目名称:Goalie_Android,代码行数:19,代码来源:UpdateProfileDialog.java

示例14: onImageGoodsMenuClicked

import android.app.Dialog; //导入依赖的package包/类
private void onImageGoodsMenuClicked(Dialog d, int position) {
	switch (position) {

		case 0:
			shareImagePublic(currentClickImageUrl);
			break;
		case 1:
			shareImageCircle(currentClickImageUrl);
			break;


		case 2:
			shareImageGoods(currentClickImageUrl);
			break;

		case 3:
			saveImage(currentClickImageUrl);
			break;

		case 4:
			openImageMenuMore();
			break;
	}
}
 
开发者ID:Louis19910615,项目名称:youkes_browser,代码行数:25,代码来源:BrowserActivity.java

示例15: onCreateDialog

import android.app.Dialog; //导入依赖的package包/类
@NonNull
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    // the content
    final RelativeLayout root = new RelativeLayout(getActivity());
    root.setLayoutParams(new ViewGroup.LayoutParams(
            ViewGroup.LayoutParams.MATCH_PARENT,
            ViewGroup.LayoutParams.WRAP_CONTENT));

    // creating the fullscreen dialog
    final Dialog dialog = new Dialog(getContext());
    dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
    dialog.setContentView(root);
    if (dialog.getWindow() != null) {
        dialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
        dialog.getWindow().setLayout(
                ViewGroup.LayoutParams.MATCH_PARENT,
                ViewGroup.LayoutParams.WRAP_CONTENT);
    }
    dialog.setCanceledOnTouchOutside(false);

    return dialog;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:24,代码来源:BaseDialog.java


注:本文中的android.app.Dialog类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。