CC US business interface plus slidepage Open source project

Source: Internet
Author: User

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/6F/CA/wKioL1WormGS3JnvAAJMUGtuBjA121.jpg "title=" merchant _ Slidepager.png "alt=" Wkiol1wormgs3jnvaajmugtubja121.jpg "/>

1.

Package com.chencheng.meituan.fragment;


Import Com.astuetz.PagerSlidingTabStrip;

Import com.chencheng.meituan.view.MapOverLayActivity;

Import COM.YUCHEN.MEITUAN.R;

Import Com.yuchen.meituan.r.layout;


Import android.content.Intent;

Import Android.os.Bundle;

Import android.support.v4.app.Fragment;

Import Android.support.v4.app.FragmentManager;

Import Android.support.v4.app.FragmentPagerAdapter;

Import Android.support.v4.view.ViewPager;

Import Android.view.LayoutInflater;

Import Android.view.View;

Import Android.view.View.OnClickListener;

Import Android.view.ViewGroup;


/**

* A Simple {@link Fragment} subclass.

*

*/

public class Shop0fragment extends Fragment implements Onclicklistener {


Private final string[] TITLES = {"All merchants", "Preferential merchants"};

Public Shop0fragment () {

Required empty Public constructor

}


@Override

Public View Oncreateview (layoutinflater inflater, ViewGroup container,

Bundle savedinstancestate) {

View layout = inflater.inflate (r.layout.fragment_shop0, NULL);

Layout.findviewbyid (R.ID.RL_MAP_BTN). Setonclicklistener (this);

Initviewpager (layout);

return layout;

}


private void Initviewpager (View layout) {

Viewpager Mpager = (viewpager) Layout.findviewbyid (R.id.pager);

Pagerslidingtabstrip TabStrip = (pagerslidingtabstrip) Layout.findviewbyid (r.id.tabs);

Fragmentmanager fm = Getchildfragmentmanager ();

Mpager.setadapter (new Bannerpageradapger (FM));

Tabstrip.setviewpager (Mpager);

}





Class Bannerpageradapger extends Fragmentpageradapter {


Public Bannerpageradapger (fragmentmanager FM) {

Super (FM);

}


@Override

Public charsequence getpagetitle (int position) {

return titles[position];

}


Public Fragment getItem (int position) {

int i =position%2;

Fragment Fragment;

if (i==0) {

fragment = new Shopfragment ();

}else{

Fragment=new shopfragment ();

}

Fragment.settitle (Titles[position]);

return fragment;

}

public int GetCount () {

return titles.length;

}


}





@Override

public void OnClick (View v) {

Switch (V.getid ()) {

Case R.ID.RL_MAP_BTN:

Surrounding

StartActivity (New Intent (Getactivity (), mapoverlayactivity.class));

Break


Default

Break

}

}



}


2. Modify the properties of indicator and underline inside the library Pagerslidingtabstrip



private int indicatorcolor = 0xff22b14c;

private int underlinecolor = 0x1a22b14c;

private int dividercolor = 0x00e61a5f;


Private Boolean shouldexpand = false;

Private Boolean textallcaps = true;


private int scrolloffset = 52;

private int indicatorheight = 2;

private int underlineheight = 4;

private int dividerpadding = 2;

private int tabpadding = 24;

private int dividerwidth = 2;


private int tabtextsize = 12;

private int tabtextcolor = 0xff22b14c;


CC US business interface plus slidepage Open source project

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.