프로젝트
GitHub에서 보기
Mirkoddd/TabBarView
소개
Cyril Mottier의 앱 ‘Capitaine train’과 같은 액션 바 탭을 만들 수 있도록 도와주는 Android 라이브러리입니다.
웹 및 앱 개발측정된 스타 증가
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- 0
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
OriginalTabBarView
An Android Library to help you create actionbar tabs like "Capitaine train" app by Cyril Mottier
![]()
Implementation:
Declare TabBarView and set a ViewPager
LayoutInflater inflator =
(LayoutInflater) this.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View v = inflator.inflate(R.layout.custom_ab, null);
tabBarView = (TabBarView) v.findViewById(R.id.tab_bar);
getActionBar().setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM);
getActionBar().setCustomView(v);
// Create the adapter that will return a fragment for each of the three
// primary sections of the activity.
mSectionsPagerAdapter = new SectionsPagerAdapter(getFragmentManager());
// Set up the ViewPager with the sections adapter.
mViewPager = (ViewPager) findViewById(R.id.pager);
mViewPager.setAdapter(mSectionsPagerAdapter);
tabBarView.setViewPager(mViewPager);
Example using a simple pager adapter
public class SectionsPagerAdapter extends FragmentPagerAdapter implements IconTabProvider{
private int[] tab_icons={R.drawable.ic_tab1,
R.drawable.ic_tab2,
R.drawable.ic_tab3,
};
public SectionsPagerAdapter(FragmentManager fm) {
super(fm);
}
@Override
public Fragment getItem(int position) {
// getItem is called to instantiate the fragment for the given page.
// Return a PlaceholderFragment (defined as a static inner class
// below).
return PlaceholderFragment.newInstance(position + 1);
}
@Override
public int getCount() {
// Show 3 total pages.
return tab_icons.length;
}
@Override
public int getPageIconResId(int position) {
return tab_icons[position];
}
@Override
public CharSequence getPageTitle(int position) {
Locale l = Locale.getDefault();
switch (position) {
case 0:
return getString(R.string.title_section1).toUpperCase(l);
case 1:
return getString(R.string.title_section2).toUpperCase(l);
case 2:
return getString(R.string.title_section3).toUpperCase(l);
}
return null;
}
}
##Some ScreenShot

####License
Copyright 2014 Mirko Dimartino
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
####Developed by
관련 프로젝트 살펴보기
불러오는 중…