91超碰碰碰碰久久久久久综合_超碰av人澡人澡人澡人澡人掠_国产黄大片在线观看画质优化_txt小说免费全本

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

cc美團商家界面加上SlidePage開源項目

發布時間:2020-08-02 07:41:17 來源:網絡 閱讀:535 作者:愚人cc 欄目:移動開發

cc美團商家界面加上SlidePage開源項目

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 = { "全部商家", "優惠商家"};

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:

//周邊

startActivity(new Intent(getActivity(), MapOverLayActivity.class));

break;


default:

break;

}

}



}


2.修改庫PagerSlidingTabStrip里面indicator 和  underline的屬性



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;


向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

马边| 海晏县| 阿坝| 宁国市| 崇阳县| 南雄市| 新竹市| 西丰县| 温泉县| 阿拉尔市| 岳阳市| 长丰县| 海城市| 泗阳县| 斗六市| 双牌县| 叙永县| 海口市| 临西县| 墨竹工卡县| 弥渡县| 民权县| 胶南市| 邛崃市| 鄯善县| 顺昌县| 茂名市| 句容市| 平潭县| 体育| 顺平县| 连城县| 铁岭县| 吐鲁番市| 乐至县| 广西| 偏关县| 渑池县| 衡阳市| 博兴县| 灵武市|