Slidingmenu.jar drawer used to avoid the embarrassment of using libaray incompatible

Source: Internet
Author: User

Although this thing has come out for some time, but the good things still have to share.

We used to be libaray, all kinds of mistakes, team development is not good operation. I don't know

What kind of person simply encapsulates this tool into a jar and really likes you. Afraid to forget later

This stuff, just write it out. Convenient to reach the party conveniently himself later

Click to download Slidingmenu.jar


Now put out some of the main code to use it


<textarea readonly="" name="code" class="java">private Slidingmenu menu;//define a menu = new Slidingmenu (this);//load drawer Menu.setmode in the activity (slidingmen U.left); Set the drawer on the left menu.settouchmodeabove (slidingmenu.touchmode_fullscreen);//set menu sliding style menu.setshadowwidthres ( R.dimen.shadow_width); menu.setshadowdrawable (R.drawable.shadow);//The Shadow part Menu.setbehindoffsetres when the menu is sliding ( R.dimen.slidingmenu_offset); Menu.setbehindwidth (Resolution.getwidth (this) * 3/4);//Set width Menu.setfadedegree (0.35f) ; Set the transparency menu.attachtoactivity (this, slidingmenu.sliding_content);//Specify the area menu.setmenu (r.layout.activity_menu);// Load menu's panel//load control inside Menu Lin_meu_qiantai = (linearlayout) Menu.findviewbyid (r.id.lin_meu_qiantai); Lin_meu_paidui = ( LinearLayout) Menu.findviewbyid (r.id.lin_meu_paidui); lin_meu_yuding = (linearlayout) Menu.findviewbyid (R.id.lin_ meu_yuding); Zhuxiao = (Button) Menu.findviewbyid (R.id.zhuxiao); </textarea>


It's got a variety of styles and layouts.

<dimen name= "Shadow_width" >1dp</dimen>

Shadow.xml

<textarea readonly="" name="code" class="java"><?xml version= "1.0" encoding= "Utf-8"? ><shape xmlns:android= "http://schemas.android.com/apk/res/ Android "> <gradient android:endcolor=" #33000000 "android:centercolor=" #11000000 "android:startcolor=" # 00000000 "></gradient></shape></textarea>


<dimen name= "Slidingmenu_offset" >60dp</dimen>

Left layout What, everyone can write their own, put a simple layout can be

It's playing.


Other simple listening events I also give it, I guess it's good to see. No eggs.

<textarea readonly="" name="code" class="java">//Menu click event Add private void Setmenulistener () {//TODO auto-generated method Stublin_meu_qiantai.setonclicklistener ( New Onclicklistener () {@Overridepublic void OnClick (View arg0) {menu.toggle ();}}); Lin_meu_paidui.setonclicklistener (New Onclicklistener () {@Overridepublic void OnClick (View arg0) {menu.toggle (); Ntent Intent = new Intent (Mainactivity.this,waitupactivity.class); startactivity (intent); Overridependingtransition ( 0, 0);}); Lin_meu_yuding.setonclicklistener (New Onclicklistener () {@Overridepublic void OnClick (View arg0) {menu.toggle (); Ntent Intent = new Intent (Mainactivity.this,dianneiyudingactivity.class); startactivity (intent); O Verridependingtransition (0, 0);}); Zhuxiao.setonclicklistener (New Onclicklistener () {@Overridepublic void OnClick (View arg0) {//TODO auto-generated Method Stubdialog_cancel.show_dialog (Mainactivity.this);}});}</textarea>










Slidingmenu.jar drawer used to avoid the embarrassment of using libaray incompatible

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.