Android × {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%©

Source: Internet
Author: User
Tags cve

Android × {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Õ â Ò» '{î Ç 正ç» áµ μ Ï öö» Ö öí Ê ''¿ â µä× Ô ¨ Ø please refer to £;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ¿Ø ¼ þ À '{µö£» {}» · ö~~~è ~~~ö£°× {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%£M.* Please refer to the following link for more information: {0} {0}. {0}. {0}. {0}. {0}. {0}. {0 }.° Í* Please refer to the following link for more information: Why? *************************************************£»

~ à ******************************************************************** µä¿ ª Ø ° '{¥î {{{}£;{}}â {****************************


Mahathé 'taobao' has been set to £;%%%%» ö %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%» please refer to Ø ×'please refer to £°



Î Á áë äü Ü» ² ½ â ç?maú£;;» Ç çà 'à» ±» ù ± ¾ µäé éü £ £.

~× ~~~~~~~~~~~~~~~~~~~~~~» ~~~~~~~~~~~************************************  ¸ öà £;{google Ú úview }â ¸ öà À ï à æ Ì *********************************************** Ç Ó ózantózant= ************************************************************* § ¹ ° Í ¹ äü££ Ú úõ â À ï è ?è Ó óó µ ¸ ö Ö ö? £» <symbol · blank "http://www.bkjia.com/kf/ware/vc/" target = "_ blank" class = "keylink"> vcD4KPHA + PGJyPgo8L3A + fingerprint + 19S2qNLlv9i8/fingerprint + signature/Signature + cve-vcd4kpha + signature + keystore + signature + CjxzdHJvbmc + signature + uPa7 + bShyc/Signature + c?vcd4kpha + y/Signature + signature/Signature + c=vcd4kpha + signature/Signature + bJz6OsxMfDtL/Signature + signature/7aOstdq2/rj2ss7K/crHdmlld7XEuN + signature/Signature/tuN/Signature + signature + cve-vcd4kpha + signature/Signature + MO709C + signature/sTHwO + signature/Signature/authorization/y75tbGs/authorization/YvP675tbGs/bAtDwvcD4KPHA + PGJyPgo8L3A + signature/Signature + signature + a/2Lz + signature + cve-vcd4kpha + Signature /samples + PGJyPgo8L3A + samples/YvP62qNLls/samples/2Lz + o6zL + samples + PGJyPgo8L3A + CjxwPtXiwO + samples + 00rvPwqO6PC9wPgo8cD48YnI + cda-vcd4kpha + PC9wPgo8cHJlIGNsYXNzPQ = "brush: java; ">/***» view maid,» Ö öæ μ ± ç° view maid */@ Overrideprotected void onDraw (Canvas canvas) {// super. onDraw (canvas); Paint paint Paint = new paint (); // 'Too many others before using the Paint. setAntiAlias (true); //» ± margin ° canvas. drawBitmap (backgroundBitmap, 0, 0, paint); //» ¬ ¿é canvas. drawBitmap (slideButton, slideBtn_left, 0, paint );}


OnDraw· Copyright? '?Canvas» 2. zookeeper ~ó £%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ~~~ú» ² ******************************************* please refer to the following link for more information'Paint paint = new Paint ()£ *********************************************Paint. setAntiAlias (true)£ *******************DrawBitmapMaid? £;ö± ~~~~â í~£°




Õ â À ï Ò ª × ¢ â µää» μ ã Í Ç ç£.DrawBitmap (Bitmap bitmap, float left, float top, painting)· Lower · öö~~äzäámá~~öfloat À ruíµä² ~~£;ö± ~'ú±í» möyangí zookeeper ********************************************************************** £ £;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%, 0 £ ************************************************************** çāzomáú ¿SlideBtn_leftÀ 'éáöã ää» ö~£;Äçã '~~óú~ø ± {× 'Then £;{slidebtn _ left µävalue ¿when too many bytes × 'when too many £;slidebtn _ left µävalue ********* backgroundBitmap (± ³ ¾ °) maid (» ~~~é) fig (» ~~~é)£»


Äçá 'hangzhou' ~~~~» À '£;;» úö ~~**************************** ~~~úramø ~~é ************************************************************* boolean ±äámācú±í¿ Ø %ø µä× '{{£;± µ;» ÷ µäê ± ° ò £;ç?ç» {â ¸ öboolean À Ð íµä± äáá Î true» please refer to false £******± ä» pleaseSlideButtonΜävalue limit0» Getting startedBackgroundBitmap. getWidth ()-slideButton. getWidth ()£ ******************Invalidate ()· Copyright?


 à À 'taobao' then has been transferred to µäúâ £ £;× ± â  ±? È £ £°


* Please refer to the following link for comparison. java :?

package com.example.togglebutton.ui;import com.example.togglebutton.R;import android.content.Context;import android.graphics.Bitmap;import android.graphics.BitmapFactory;import android.graphics.Canvas;import android.graphics.Paint;import android.util.AttributeSet;import android.view.View;/* * ×Ô¶¨ÒåviewµÄ¼¸¸ö²½Ö裺 * 1¡¢Ê×ÏÈÐèҪдһ¸öÀàÀ´¼Ì³Ð×ÔView * 2¡¢ÐèÒªµÃµ½viewµÄ¶ÔÏó£¬ÄÇôÐèÒªÖØд¹¹Ôì·½·¨£¬ÆäÖÐÒ»²ÎµÄ¹¹Ôì·½·¨ÓÃÓÚnew£¬¶þ²ÎµÄ¹¹Ôì·½·¨ÓÃÓÚxml²¼¾ÖÎļþʹÓã¬Èý²ÎµÄ¹¹Ôì·½·¨¿ÉÒÔ´«ÈëÒ»¸öÑùʽ * 3¡¢ÐèÒªÉèÖÃviewµÄ´óС£¬ÄÇôÐèÒªÖØдonMeasure·½·¨ * 4¡¢ÐèÒªÉèÖÃviewµÄλÖã¬ÄÇôÐèÒªÖØдonLayout·½·¨£¬µ«ÊÇÕâ¸ö·½·¨ÔÚ×Ô¶¨ÒåviewµÄʱºòÓõIJ»¶à£¬ÔÒòÖ÷ÒªÔÚÓÚviewµÄλÖÃÖ÷ÒªÊÇÓɸ¸¿Ø¼þÀ´¾ö¶¨ * 5¡¢ÐèÒª»æÖƳöËùÐèÒªÏÔʾµÄview£¬ÄÇôÐèÒªÖØдonDraw·½·¨ * 6¡¢µ±¿Ø¼þ״̬¸Ä±äµÄʱºò£¬ÐèÒªÖØ»æview£¬ÄÇôµ÷ÓÃinvalidate();·½·¨£¬Õâ¸ö·½·¨Êµ¼ÊÉÏ»áÖØе÷ÓÃonDraw·½·¨ * 7¡¢ÔÚÕâÆäÖУ¬Èç¹ûÐèÒª¶ÔviewÉèÖõã»÷ʼþ£¬¿ÉÒÔÖ±½Óµ÷ÓÃsetOnClickListener·½·¨ */public class MyToggleButton extends View {/** * ¿ª¹Ø°´Å¥µÄ±³¾° */private Bitmap backgroundBitmap;/** * ¿ª¹Ø°´Å¥µÄ»¬¶¯²¿·Ö */private Bitmap slideButton;/** * »¬¶¯°´Å¥µÄ×ó±ß½ç */private float slideBtn_left;/** * µ±Ç°¿ª¹ØµÄ״̬ */private boolean currentState = false;/** * ÔÚ´úÂëÀïÃæ´´½¨¶ÔÏóµÄʱºò£¬Ê¹Óô˹¹Ôì·½·¨ *  * @param context */public MyToggleButton(Context context) {super(context);}/** * ÔÚ²¼¾ÖÎļþÖÐÉùÃ÷µÄview£¬´´½¨Ê±ÓÉϵͳ×Ô¶¯µ÷Óà *  * @param context * @param attrs */public MyToggleButton(Context context, AttributeSet attrs) {super(context, attrs);initView();}/** * ²âÁ¿³ß´çʱµÄ»Øµ÷·½·¨ */@Overrideprotected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {// super.onMeasure(widthMeasureSpec, heightMeasureSpec);// ÉèÖõ±Ç°viewµÄ´óС width:viewµÄ¿í£¬µ¥Î»¶¼ÊÇÏñËØÖµ heigth:viewµÄ¸ß£¬µ¥Î»¶¼ÊÇÏñËØÖµsetMeasuredDimension(backgroundBitmap.getWidth(),backgroundBitmap.getHeight());}// Õâ¸ö·½·¨¶ÔÓÚ×Ô¶¨ÒåviewµÄʱºò°ïÖú²»´ó£¬ÒòΪviewµÄλÖÃÒ»°ãÓɸ¸×é¼þÀ´¾ö¶¨µÄ@Overrideprotected void onLayout(boolean changed, int left, int top, int right,int bottom) {super.onLayout(changed, left, top, right, bottom);}/** * »viewµÄ·½·¨,»æÖƵ±Ç°viewµÄÄÚÈÝ */@Overrideprotected void onDraw(Canvas canvas) {// super.onDraw(canvas);Paint paint = new Paint();// ´ò¿ª¿¹¾â³Ýpaint.setAntiAlias(true);// »±³¾°canvas.drawBitmap(backgroundBitmap, 0, 0, paint);// »»¬¿écanvas.drawBitmap(slideButton, slideBtn_left, 0, paint);}/** * ³õʼ»¯view */private void initView() {backgroundBitmap = BitmapFactory.decodeResource(getResources(),R.drawable.switch_background);slideButton = BitmapFactory.decodeResource(getResources(),R.drawable.slide_button);/* * µã»÷ʼþ */setOnClickListener(new OnClickListener() {@Overridepublic void onClick(View v) {currentState = !currentState;flushState();flushView();}});}/** * Ë¢ÐÂÊÓͼ */protected void flushView() {// ˢе±Ç°view»áµ¼ÖÂondraw·½·¨µÄÖ´ÐÐinvalidate();}/** * ˢе±Ç°µÄ״̬ */protected void flushState() {if (currentState) {slideBtn_left = backgroundBitmap.getWidth()- slideButton.getWidth();} else {slideBtn_left = 0;}}}


~Ú² ~~öî ä~~ö~~~~?????~~~~~öà '£°


     
  
 


Ú úranâ À ï óecorúgou» Ó Ð È '''? '¥?» Ç 正ç» ö öμ ¥'{µää Ø {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%^ maid


package com.example.togglebutton;import android.app.Activity;import android.os.Bundle;public class MainActivity extends Activity {@Overrideprotected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.activity_main);}}


Öá' Ë Ò» Ö ö× ö ¨ {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Æ ª ½ «» áééüräç° § ¹ ° íáç° Ê µ μ Ö öx Ô ¨ ô £» Ö ¡

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.