Custom PobUpwindow dialog box, custom pobupwindow
When sharing this part, the pop-up box function is used. You must also click the back key to undo the displayed pop-up box, so you can write a code for everything:
Public class implements boardpicker implements OnClickListener {private Context mContext; private extends pobupwindow mPopupWindow; // sharing box private LinearLayout layout; private RelativeLayout mWeixinLayout; // share private RelativeLayout timeout; // share private RelativeLayout mSinaLayout in the circle of friends; // share private RelativeLayout mQQZoneLayout on Sina Weibo; // share private UMengShare share in QQ space; public incluboardpicker (Context context, St Ring infoStr) {mContext = context; share = new UMengShare (context, infoStr); init ();} public parameter boardpicker (Context context, String title, String url, String imgUrl) {mContext = context; share = new UMengShare (context, title, url, imgUrl); init ();} public void init () {LayoutInflater inflater = LayoutInflater. from (mContext); layout = (LinearLayout) inflater. inflate (R. layout. shareboard_picker, null); mWeixinLay Out = (RelativeLayout) layout. findViewById (R. id. weixin); mWeixinCircleLayout = (RelativeLayout) layout. findViewById (R. id. weixin_circle); mSinaLayout = (RelativeLayout) layout. findViewById (R. id. sina); mQQZoneLayout = (RelativeLayout) layout. findViewById (R. id. email_share); mWeixinLayout. setOnClickListener (this); mWeixinCircleLayout. setOnClickListener (this); mSinaLayout. setOnClickListener (this); mQQZoneLayo Ut. setOnClickListener (this); mPopupWindow = new extends pobupwindow (mContext, layout, LayoutParams. MATCH_PARENT, LayoutParams. WRAP_CONTENT, true); // set the window to disappear when the window outside the window is clicked. setOutsideTouchable (true); // set this parameter to get the focus. Otherwise, you cannot click mPopupWindow. setFocusable (true); mPopupWindow. setBackgroundDrawable (new ColorDrawable (Color. TRANSPARENT); mPopupWindow. setAnimationStyle (R. style. picker_anim_style);} public void show () {Win DowManager. layoutParams lp = (Activity) mContext ). getWindow (). getAttributes (); lp. alpha = 0.5f; // 0.0-1.0 (Activity) mContext ). getWindow (). setAttributes (lp); layout. setFocusable (true); // set the view to listen to the event layout. setFocusableInTouchMode (true); // set the view to listen to the event layout. setOnKeyListener (new OnKeyListener () {public boolean onKey (View v, int keyCode, KeyEvent event) {if (keyCode = KeyEvent. KEYCODE_BACK & mPopu PWindow! = Null) {dismiss () ;}return true ;}}); mPopupWindow. update (); mPopupWindow. showAtLocation (layout, Gravity. BOTTOM, 0, 0);} public void dismiss () {WindowManager. layoutParams lp = (Activity) mContext ). getWindow (). getAttributes (); lp. alpha = 1.0f; // 0.0-1.0 (Activity) mContext ). getWindow (). setAttributes (lp); mPopupWindow. dismiss (); mPopupWindow = null; (Activity) mContext ). getWindow (). setAttributes (lp);}/*** is used to use ** @ return */public void activityResult (int requestCode, int resultCode, Intent data) {share in the Activity. activityResult (requestCode, resultCode, data) ;}@ Overridepublic void onClick (View v) {// TODO Auto-generated method stubswitch (v. getId () {case R. id. weixin: share. startWeixinShare (); dismiss (); break; case R. id. weixin_circle: share. startWeixinCircleShare (); dismiss (); break; case R. id. sina: share. startSinaShare (); dismiss (); break; case R. id. email_share: share. startEmailShare (); dismiss (); break; default: dismiss (); break;} class extends pobupwindow extends PopupWindow {private Context myContext; @ Overridepublic void dismiss () {// TODO Auto-generated method stubWindowManager. layoutParams lp = (Activity) myContext ). getWindow (). getAttributes (); lp. alpha = 1.0f; // 0.0-1.0 (Activity) myContext ). getWindow (). setAttributes (lp); super. dismiss ();} public writable pobupwindow () {} public writable pobupwindow (Context context, View contentView, int width, int height, boolean focusable) {super (contentView, width, height, focusable); myContext = context ;}}}
Windows open is used to customize the pop-up window, but the pop-up window does not change.
Window. open ('page.html') is used to control the new Window page.html. If page.html defines a function openwin (), the function content is to open a Window. Not before calling it
Pop-up custom prompt box
The current login user still has some text displayed on startup
Enter "secpol. msc" in the run box of the Start menu to enable the Local Security Policy Manager;
Windows Vista will pop up the corresponding UAC prompt window, enter the administrator password or confirm;
Click "Local Policy" => "Security Options" in turn"
In the right pane, find "Interactive login: Message Text of the user attempting to log on". Here, I would like to pay tribute to the Chinese translation team of Windows Vista. In comparison, this item is in the Chinese version of Windows XP, "Interactive login: Message text when a user tries to log on", which is too child-friendly and has no cultural depth.
Right-click the option and select Properties or double-click it;
Enter the text of the message to be displayed to other users. The text entered during the test is as follows:
Unplug the power plug before starting the instance.
Click OK.
(Optional) If necessary, you can also set the message title, that is, to modify the content of "Interactive login: Message Title of the user attempting to log on". The method is the same as above, the content we entered in the test is "HighDiy prompt ";
After setting, exit the Local Security Policy Editor.
In this way, before other users log on, they will first see the corresponding prompt content and click OK to allow the user to log on.