Android Custom Imitation micro-letter Popupwindow effect _android

Source: Internet
Author: User

To share a high imitation micro-letter Popupwindow, it's the micro-mail sweep. That function window, below has the application Operation effect chart, more intuitive shows the demo effect, the source code is realizes through two kinds of methods, everybody can download the source Code research research, the integration to own project is also very convenient, Hope to be useful to you, first look at

Demo Running effect

This demo is a high imitation of the micro-letter previous version, not the latest version, if you want to change to the latest version can be a little change on the OK

The first way
Initializing components

private void Initview () {
 //instantiate the title bar button and set the listener
 titlebtn = (ImageButton) Findviewbyid (R.ID.TITLE_BTN);
 Titlebtn.setonclicklistener (New Onclicklistener () {
 @Override public
 void OnClick (View v) {
  Titlepopup.show (v);
 }
 });
  
 Instantiate title bar Bullet window
 titlepopup = new Titlepopup (this, 
 layoutparams.wrap_content, layoutparams.wrap_content);
}

Initializing data

private void InitData () {
 ///Add subclass Titlepopup.addaction to the title bar window (this
 , "Initiate chat", 
 r.drawable.mm_ Title_btn_compose_normal));
 Titlepopup.addaction (This, "earpiece mode", R.drawable.mm_title_btn_receiver_normal) (new Actionitem) 
 ;
 Titlepopup.addaction (This, "Login Web page", R.drawable.mm_title_btn_keyboard_normal) (new Actionitem) 
 ;
 Titlepopup.addaction (This, "sweep", R.drawable.mm_title_btn_qrcode_normal)) (new Actionitem) 
 ;

The second way

Initializing components

private void Initview () {
 //instantiate the title bar button and set the listener
 titlebtn = (ImageButton) Findviewbyid (R.ID.TITLE_BTN);
 Titlebtn.setonclicklistener (New Onclicklistener () {
 @Override public
 void OnClick (View v) {
  StartActivity (New Intent (Customtitleactivity02.this,
  dialogactivity.class));
 }   

The above is the entire content of this article, I hope to help you learn, but also hope that we support the cloud habitat community.

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.