當前位置: 首頁>>代碼示例>>Java>>正文


Java PagerSlidingTabStrip.setOnPageChangeListener方法代碼示例

本文整理匯總了Java中com.astuetz.PagerSlidingTabStrip.setOnPageChangeListener方法的典型用法代碼示例。如果您正苦於以下問題:Java PagerSlidingTabStrip.setOnPageChangeListener方法的具體用法?Java PagerSlidingTabStrip.setOnPageChangeListener怎麽用?Java PagerSlidingTabStrip.setOnPageChangeListener使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.astuetz.PagerSlidingTabStrip的用法示例。


在下文中一共展示了PagerSlidingTabStrip.setOnPageChangeListener方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onCreate

import com.astuetz.PagerSlidingTabStrip; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    mToolbar = (Toolbar) findViewById(R.id.activity_main_toolbar);
    mToolbar.setTitle(R.string.app_name);
    setSupportActionBar(mToolbar);

    mCurrentPageId = PAGE_ID_COLOR_ITEM_LIST;
    mColorItemListPage = new ColorItemListPage(this);
    mColorItemListPage.setListener(this);
    mPaletteListPage = new PaletteListPage(this);
    mPaletteListPage.setListener(this);

    mFab = (FloatingActionButton) findViewById(R.id.activity_main_fab);
    mFab.setOnClickListener(this);

    final MyPagerAdapter adapter = new MyPagerAdapter();
    mTabs = (PagerSlidingTabStrip) findViewById(R.id.activity_main_tabs);
    mViewPager = (ViewPager) findViewById(R.id.activity_main_view_pager);
    mViewPager.setAdapter(adapter);
    mTabs.setViewPager(mViewPager);
    mTabs.setOnPageChangeListener(this);

    mMainActivityFlavor = new MainActivityFlavor(this);
}
 
開發者ID:tvbarthel,項目名稱:CameraColorPicker,代碼行數:27,代碼來源:MainActivity.java

示例2: onCreate

import com.astuetz.PagerSlidingTabStrip; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    mBeyondApplication = (BeyondApplication) getApplication();

    mTabs = (PagerSlidingTabStrip) findViewById(R.id.tabs);
    mTabs.setShouldExpand(true);

    mPager = (ViewPager) findViewById(R.id.pager);
    mPagerAdapter = new PagerAdapter(getFragmentManager());

    mPager.setAdapter(mPagerAdapter);
    mPager.setOffscreenPageLimit(2);

    mTabs.setViewPager(mPager);
    mTabs.setOnPageChangeListener(this);
    // Bind UPnP service
    Intent upnpServiceIntent = new Intent(MainActivity.this, BeyondUpnpService.class);
    bindService(upnpServiceIntent, mUpnpServiceConnection, Context.BIND_AUTO_CREATE);
    // Bind System service
    Intent systemServiceIntent = new Intent(MainActivity.this, SystemService.class);
    bindService(systemServiceIntent, mSystemServiceConnection, Context.BIND_AUTO_CREATE);
}
 
開發者ID:kevinshine,項目名稱:BeyondUPnP,代碼行數:26,代碼來源:MainActivity.java

示例3: onCreate

import com.astuetz.PagerSlidingTabStrip; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_example);

    // Pager
    mPager = (ViewPager) findViewById(R.id.pager);
    mPagerAdapter = new MutableTitlePagerAdapter(getSupportFragmentManager());
    mPager.setAdapter(mPagerAdapter);
    mPager.setOnPageChangeListener(mPagerListener);

    // First page
    ExamplePageFragment.resetSerialNumber();
    mPagerAdapter.addPageFragment(ExamplePageFragment.newInstance(null));

    // Sliding tabs example
    mTabs = (PagerSlidingTabStrip) findViewById(R.id.tabs);
    mTabs.setViewPager(mPager);
    mTabs.setOnPageChangeListener(mPagerListener);
    mPagerAdapter.setTabStrip(mTabs);
    resetTabIndicatorColor();
}
 
開發者ID:kakajika,項目名稱:MutablePagerAdapter,代碼行數:23,代碼來源:ExampleActivity.java

示例4: onCreate

import com.astuetz.PagerSlidingTabStrip; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    viewpager = (ViewPager) findViewById(R.id.viewpager);
    tabStrip = (PagerSlidingTabStrip) findViewById(R.id.tabs);
    toolBar = (Toolbar) findViewById(R.id.toolbar);

    setSupportActionBar(toolBar);
    tintManager = new SystemBarTintManager(this);
    tintManager.setStatusBarTintEnabled(true);

    adapter = new TabAdapter(getSupportFragmentManager());

    viewpager.setAdapter(adapter);
    tabStrip.setViewPager(viewpager);
    tabStrip.setOnPageChangeListener(onPageChangeListener);

    changeColor(getResources().getColor(R.color.color_card_info));
}
 
開發者ID:Chrisplus,項目名稱:UniversalCardReader,代碼行數:22,代碼來源:MainActivity.java

示例5: onCreate

import com.astuetz.PagerSlidingTabStrip; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	setContentView(R.layout.activity_my_main);

	mScrollView = (ScrollViewSuperExtend) this.findViewById(R.id.scroll);
	mPagerSlidingTabStrip = (PagerSlidingTabStrip) findViewById(R.id.tabs);
	mViewPager = (ViewPager) findViewById(R.id.pager);
	mViewPager.setOffscreenPageLimit(4);

	mPagerAdapter = new PagerAdapter(getSupportFragmentManager());

	mViewPager.setAdapter(mPagerAdapter);

	mPagerSlidingTabStrip.setViewPager(mViewPager);
	mPagerSlidingTabStrip.setOnPageChangeListener(changeListener);
	mViewPager.getViewTreeObserver().addOnGlobalLayoutListener(new OnGlobalLayoutListener() {

		@Override
		public void onGlobalLayout() {
			mViewPager.getViewTreeObserver().removeGlobalOnLayoutListener(this);
			mViewPager.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, mScrollView
					.getMeasuredHeight() - mPagerSlidingTabStrip.getMeasuredHeight() - getActionBarHeight()));
		}
	});
}
 
開發者ID:haikuowuya,項目名稱:StickViewPagerList,代碼行數:27,代碼來源:MyMainActivity.java

示例6: onCreate

import com.astuetz.PagerSlidingTabStrip; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	
	mMinHeaderHeight = getResources().getDimensionPixelSize(R.dimen.min_header_height);
	mHeaderHeight = getResources().getDimensionPixelSize(R.dimen.header_height);
	mMinHeaderTranslation = -mMinHeaderHeight;

	setContentView(R.layout.activity_main);

	mHeader = findViewById(R.id.header);
	info = (TextView) findViewById(R.id.info);

	mPagerSlidingTabStrip = (PagerSlidingTabStrip) findViewById(R.id.tabs);
	mViewPager = (ViewPager) findViewById(R.id.pager);
	mViewPager.setOffscreenPageLimit(4);

	mPagerAdapter = new PagerAdapter(getSupportFragmentManager());
	mPagerAdapter.setTabHolderScrollingContent(this);

	mViewPager.setAdapter(mPagerAdapter);

	mPagerSlidingTabStrip.setViewPager(mViewPager);
	mPagerSlidingTabStrip.setOnPageChangeListener(this);
	mLastY=0;
}
 
開發者ID:kmshack,項目名稱:Android-ParallaxHeaderViewPager,代碼行數:27,代碼來源:MainActivity.java

示例7: onCreateView

import com.astuetz.PagerSlidingTabStrip; //導入方法依賴的package包/類
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
        Bundle savedInstanceState) {
    View rootView = inflater.inflate(R.layout.fragment_home_card_list, container, false);

    mViewPager = (ViewPager)rootView.findViewById(R.id.card_list_pager);
    mPagerAdapter = new BrowsePagerAdapter(getActivity().getSupportFragmentManager());
    mViewPager.setAdapter(mPagerAdapter);

    mTabs =
            (PagerSlidingTabStrip)rootView.findViewById(R.id.card_list_pager_title_strip);
    mTabs.setViewPager(mViewPager);
    mTabs.setOnPageChangeListener(pageChangeListener);
    mTabs.setTextColor(Color.WHITE);
    mTabs.setIndicatorColor(Color.WHITE);

    return rootView;
}
 
開發者ID:efarraro,項目名稱:deckerino,代碼行數:19,代碼來源:BrowseFragment.java

示例8: initViewPager

import com.astuetz.PagerSlidingTabStrip; //導入方法依賴的package包/類
private void initViewPager() {
    List<Fragment> fragments = getFragments();

    showPage = 0;

    vp_apps = (ViewPager) findViewById(R.id.vp_apps);
    vp_apps.setAdapter(new PagerAdapter(getSupportFragmentManager(), fragments));

    psts_apps_tabs = (PagerSlidingTabStrip) findViewById(R.id.psts_apps_tabs);
    psts_apps_tabs.setShouldExpand(true);
    psts_apps_tabs.setViewPager(vp_apps);
    vp_apps.setCurrentItem(showPage);

    psts_apps_tabs.setBackgroundColor(getResources().getColor(R.color.main500));
    psts_apps_tabs.setUnderlineColor(getResources().getColor(R.color.transparent));
    psts_apps_tabs.setIndicatorColor(getResources().getColor(R.color.titlewhite));
    psts_apps_tabs.setDividerColor(getResources().getColor(R.color.main500));

    ViewPager.OnPageChangeListener pageListener = new PageListener();
    psts_apps_tabs.setOnPageChangeListener(pageListener);

    float dp = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 2, getResources().getDisplayMetrics());
    psts_apps_tabs.setIndicatorHeight((int) dp);

    LinearLayout ll = (LinearLayout) psts_apps_tabs.getChildAt(0);
    for(int p=0; p < ll.getChildCount(); p++) {
        TextView tv = (TextView) ll.getChildAt(p);
        if (p == showPage) {
            tv.setTextColor(getResources().getColor(R.color.titlewhite));
        } else {
            tv.setTextColor(getResources().getColor(R.color.titlewhite_alpha));
        }
    }
}
 
開發者ID:ordsen,項目名稱:Snach-Android,代碼行數:35,代碼來源:AppsActivity.java

示例9: onCreate

import com.astuetz.PagerSlidingTabStrip; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	
	mMinHeaderHeight = getResources().getDimensionPixelSize(R.dimen.min_header_height);
	mHeaderHeight = getResources().getDimensionPixelSize(R.dimen.header_height);
	mMinHeaderTranslation = -mMinHeaderHeight + getActionBarHeight();

	setContentView(R.layout.activity_main);

	mHeaderPicture = (KenBurnsSupportView) findViewById(R.id.header_picture);
	mHeaderPicture.setResourceIds(R.drawable.pic0, R.drawable.pic1);
	mHeaderLogo = (ImageView) findViewById(R.id.header_logo);
	mHeader = findViewById(R.id.header);

	mPagerSlidingTabStrip = (PagerSlidingTabStrip) findViewById(R.id.tabs);
	mViewPager = (ViewPager) findViewById(R.id.pager);
	mViewPager.setOffscreenPageLimit(4);

	mPagerAdapter = new PagerAdapter(getSupportFragmentManager());
	mPagerAdapter.setTabHolderScrollingContent(this);

	mViewPager.setAdapter(mPagerAdapter);

	mPagerSlidingTabStrip.setViewPager(mViewPager);
	mPagerSlidingTabStrip.setOnPageChangeListener(this);
	mSpannableString = new SpannableString(getString(R.string.actionbar_title));
	mAlphaForegroundColorSpan = new AlphaForegroundColorSpan(0xffffffff);
	
	ViewHelper.setAlpha(getActionBarIconView(), 0f);
	
	getSupportActionBar().setBackgroundDrawable(null);
}
 
開發者ID:zpwan110,項目名稱:Android-ParallaxHeaderViewPager-master,代碼行數:34,代碼來源:MainActivity.java

示例10: onCreate

import com.astuetz.PagerSlidingTabStrip; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    mMinHeaderHeight = getResources().getDimensionPixelSize(R.dimen.min_header_height);
    mHeaderHeight = getResources().getDimensionPixelSize(R.dimen.header_height);
    mMinHeaderTranslation = -mMinHeaderHeight + Utils.getActionBarHeight(this);

    setContentView(R.layout.activity_main);

    mHeaderPicture = (ImageView) findViewById(R.id.header_picture);
    mHeaderPicture.setImageResource(R.drawable.pic3);
    mHeader = findViewById(R.id.header);

    mPagerSlidingTabStrip = (PagerSlidingTabStrip) findViewById(R.id.tabs);
    mViewPager = (ViewPager) findViewById(R.id.pager);
    mViewPager.setOffscreenPageLimit(2);
    mViewPager.requestDisallowInterceptTouchEvent(true);

    mPagerAdapter = new PagerAdapter(getSupportFragmentManager());
    mPagerAdapter.setTabHolderScrollingContent(this);
    mViewPager.setAdapter(mPagerAdapter);

    mPagerSlidingTabStrip.setShouldExpand(true);
    mPagerSlidingTabStrip.setTextColorResource(android.R.color.white);
    mPagerSlidingTabStrip.setDividerColorResource(android.R.color.white);
    mPagerSlidingTabStrip.setViewPager(mViewPager);
    mPagerSlidingTabStrip.setOnPageChangeListener(new ActivityOnPageChangeListener());
    mPagerSlidingTabStrip.setTabPaddingLeftRight(getResources().getDimensionPixelOffset(R.dimen.tab_padding));
}
 
開發者ID:mrhether,項目名稱:HeaderViewPager,代碼行數:31,代碼來源:MainActivity.java

示例11: onCreateView

import com.astuetz.PagerSlidingTabStrip; //導入方法依賴的package包/類
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    final View rootView = inflater.inflate(R.layout.fragment_game, container, false);

    viewPager = (ViewPager) rootView.findViewById(R.id.fragment_game_pager);
    viewPager.setAdapter(new GamePagerAdapter(getActivity().getSupportFragmentManager()));

    final PagerSlidingTabStrip tabStrip = (PagerSlidingTabStrip) rootView.findViewById(R.id.fragment_game_tab_strip);
    tabStrip.setViewPager(viewPager);
    tabStrip.setOnPageChangeListener(new ViewPager.SimpleOnPageChangeListener() {
        @Override
        public void onPageSelected(int position) {
            UiUtils.callOnscreenStateChange(getPageFragment(currentPageIndex), false);
            UiUtils.callOnscreenStateChange(getPageFragment(position), true);
            currentPageIndex = position;

            updateMenu();
        }
    });

    final GamePage gamePage = PreferencesManager.getDesiredGamePage();
    if(gamePage != null) {
        setCurrentPage(gamePage);
        PreferencesManager.setDesiredGamePage(null);
    } else if(savedInstanceState != null) {
        viewPager.setCurrentItem(savedInstanceState.getInt(KEY_PAGE_INDEX, 0));
    }

    findPlayerContainer = rootView.findViewById(R.id.fragment_game_find_player);
    UiUtils.setupFindPlayerContainer(findPlayerContainer, this, this, (MainActivity) getActivity());

    return rootView;
}
 
開發者ID:hamsterxc,項目名稱:TheTaleClient,代碼行數:34,代碼來源:GameFragment.java

示例12: onCreateView

import com.astuetz.PagerSlidingTabStrip; //導入方法依賴的package包/類
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View v = inflater.inflate(R.layout.fragment_filepager, container, false);
    mDirPager = (ViewPager)v.findViewById(R.id.pager);
    mDirPager.setAdapter(mDirPagerAdapter);

    mIndicator = (PagerSlidingTabStrip)v.findViewById(R.id.indicator);
    mIndicator.setViewPager(mDirPager);
    mIndicator.setOnPageChangeListener(this);

    return v;
}
 
開發者ID:TonicArtos,項目名稱:FilePicker,代碼行數:13,代碼來源:FilePickerFragment.java

示例13: initViewPager

import com.astuetz.PagerSlidingTabStrip; //導入方法依賴的package包/類
/**
 * 初始化ViewPager
 */
private void initViewPager() {
	tabs = (PagerSlidingTabStrip)_getView(R.id.tabs);
	viewpager = (ViewPager) _getView(R.id.acty_alldynamic_vp_content);
	
	View allDynamic, friendDynamic;
	allDynamic = getLayoutInflater().inflate(
			R.layout.item_lv_acty_alldynamic_content, null);
	friendDynamic = getLayoutInflater().inflate(
			R.layout.item_lv_acty_frienddynamic_content, null);
	lv_AllDynamic = (XListView) allDynamic
			.findViewById(R.id.item_lv_alldynamic_content);
	lv_friendDynamic = (XListView) friendDynamic
			.findViewById(R.id.item_lv_frienddynamic_content);

	List<View> views = new ArrayList<View>();
	views.add(allDynamic);
	views.add(friendDynamic);

	List<XListView> listviews = new ArrayList<XListView>();
	listviews.add(lv_AllDynamic);
	listviews.add(lv_friendDynamic);

	viewpager.setAdapter(new BaseViewPagerAdapter(views,titles));
	tabs.setViewPager(viewpager);
	tabs.setOnPageChangeListener(new MyOnPageChangeListener(listviews));
}
 
開發者ID:Jayin,項目名稱:SiyuanGroup,代碼行數:30,代碼來源:Alldynamic.java

示例14: initViewPager

import com.astuetz.PagerSlidingTabStrip; //導入方法依賴的package包/類
private void initViewPager() {
	tabs = (PagerSlidingTabStrip)_getView(R.id.tabs);
	viewpager = (ViewPager) _getView(R.id.acty_comunication_content);
	View all = getLayoutInflater().inflate(
			R.layout.frame_acty_communication_all, null);
	View myjoin = getLayoutInflater().inflate(
			R.layout.frame_acty_communication_join, null);
	View favourit = getLayoutInflater().inflate(
			R.layout.frame_acty_communication_favourite, null);
	lv_all = (XListView) all
			.findViewById(R.id.frame_acty_communication_all_listview);
	lv_my = (XListView) myjoin
			.findViewById(R.id.frame_acty_communication_join_listview);
	lv_favourit = (XListView) favourit
			.findViewById(R.id.frame_acty_communication_favourite_listview);

	adapter_all = new IssueAdapter(getContext(), data_all);
	adapter_my = new IssueAdapter(getContext(), data_my);
	adapter_favourite = new IssueAdapter(getContext(), data_favourite);

	lv_all.setAdapter(adapter_all);
	lv_my.setAdapter(adapter_my);
	lv_favourit.setAdapter(adapter_favourite);

	List<View> views = new ArrayList<View>();
	views.add(all);
	views.add(myjoin);
	views.add(favourit);

	List<XListView> listviews = new ArrayList<XListView>();
	listviews.add(lv_all);
	listviews.add(lv_my);
	listviews.add(lv_favourit);

	viewpager.setAdapter(new BaseViewPagerAdapter(views,titles));
	tabs.setViewPager(viewpager);
	tabs.setOnPageChangeListener(new MyOnPageChangeListener(listviews));
}
 
開發者ID:Jayin,項目名稱:SiyuanGroup,代碼行數:39,代碼來源:Communication.java

示例15: initViewPager

import com.astuetz.PagerSlidingTabStrip; //導入方法依賴的package包/類
private void initViewPager() {
	tabs = (PagerSlidingTabStrip)_getView(R.id.tabs);
	viewpager = (ViewPager) _getView(R.id.acty_group_content);
	View all = getLayoutInflater().inflate(R.layout.frame_acty_group, null);
	View myjoin = getLayoutInflater().inflate(R.layout.frame_acty_group,
			null);

	lv_all = (XListView) all.findViewById(R.id.frame_acty_group_listview);
	lv_myjoin = (XListView) myjoin
			.findViewById(R.id.frame_acty_group_listview);

	adapter_all = new GroupAdapter(data_all);
	adapter_myjoin = new GroupAdapter(data_myjoin);

	lv_all.setAdapter(adapter_all);
	lv_myjoin.setAdapter(adapter_myjoin);

	List<View> views = new ArrayList<View>();
	views.add(all);
	views.add(myjoin);

	List<XListView> listviews = new ArrayList<XListView>();
	listviews.add(lv_all);
	listviews.add(lv_myjoin);

	viewpager.setAdapter(new BaseViewPagerAdapter(views,titles));
	tabs.setViewPager(viewpager);
	tabs.setOnPageChangeListener(new MyOnPageChangeListener(listviews));
}
 
開發者ID:Jayin,項目名稱:SiyuanGroup,代碼行數:30,代碼來源:Group.java


注:本文中的com.astuetz.PagerSlidingTabStrip.setOnPageChangeListener方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。