How some Android controls are used

Full screen prompt box:

Dialog dialog = new Dialog(this, android.R.style.Theme_Holo_NoActionBar_Fullscreen);//全屏的Dialog
		View view = LayoutInflater.from(this).inflate(R.layout.video_play_window, null);
		dialog.setContentView(view);

Confirmation prompt box:

		AlertDialog.Builder dialog = new AlertDialog.Builder(this);

		dialog.setTitle(mDialogTexts[0]);
		dialog.setMessage(stringRes);
		dialog.setPositiveButton(mDialogTexts[2], null).setNegativeButton(mDialogTexts[1],
				new DialogInterface.OnClickListener() {

					@Override
					public void onClick(DialogInterface dialog, int which) {
						deleteMsg(msgInfo);
						dialog.dismiss();
					}
				});
		dialog.create().show();

PopupWindow:

		
			View v = View.inflate(this, R.layout.photo_activity, null);
			mPhotoWindow = new PopupWindow (v, LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
			mPhotoWindow.setBackgroundDrawable(new ColorDrawable());//Remove the default selected background
			mPhotoWindow.setFocusable (true);
			mPhotoWindow.setOutsideTouchable(true);//Whether the outside click event responds
			mPhoto = (ImageView) v.findViewById (R.id.photo);

		        mPhoto.setImageBitmap (BitmapFactory.decodeFile (path));
		        mPhotoWindow.showAtLocation (mFriendsCircleView, Gravity.CENTER, 0, 0);

RecyclerView:

                mRvFriendsCircleView.setHasFixedSize(true);//Set the fixed size
		mLlManager = new LinearLayoutManager(this);//Create a manager that can jump to the specified position and other operations
		mLlManager.setOrientation(LinearLayout.VERTICAL);//Use as an enhanced version of ListView
		mRvFriendsCircleView.setLayoutManager (mLlManager);

to be continued..........


Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325940614&siteId=291194637