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


Java PagerSlidingTabStrip.setIndicatorColor方法代碼示例

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


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

示例1: onCreateView

import com.astuetz.PagerSlidingTabStrip; //導入方法依賴的package包/類
@Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.pager_fragment, container, false);
        ViewPager pager = (ViewPager) view.findViewById(R.id.pagerForList);
        PagerAdapter pagerAdapter = new PagerAdapter(getChildFragmentManager());
        pager.setAdapter(pagerAdapter);
        pager.setOffscreenPageLimit(2);
        tabs = (PagerSlidingTabStrip) view.findViewById(R.id.tabs_main);
        tabs.setShouldExpand(true);
        tabs.setBackgroundColor(getResources().getColor(R.color.brown));
        tabs.setIndicatorColor(getResources().getColor(R.color.white));
        tabs.setTextColor(getResources().getColor(R.color.black));
        tabs.setIndicatorHeight(height);
        tabs.setDividerColor(getResources().getColor(R.color.black));
        tabs.setViewPager(pager);

//        tabs.setTextSize(45);

        return view;
    }
 
開發者ID:vector-solutions,項目名稱:TimeToPrayer,代碼行數:22,代碼來源:PagerFragment.java

示例2: onCreate

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


    // Create the adapter that will return a fragment for each of the three
    // primary sections of the activity.
    mSectionsPagerAdapter = new SectionsPagerAdapter(getSupportFragmentManager());

    // Set up the ViewPager with the sections adapter.
    mViewPager = (ViewPager) findViewById(R.id.pager);
    mViewPager.setAdapter(mSectionsPagerAdapter);
    PagerSlidingTabStrip tabs = (PagerSlidingTabStrip) findViewById(R.id.tabs);
    tabs.setIndicatorColor(Color.parseColor("#33b5e5"));
    tabs.setTextColor(Color.parseColor("#33b5e5"));
    tabs.setViewPager(mViewPager);


    mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
    // Start the server thread in the ServerThread.class and pass on the UUID for communication
    // as well as the instance for this activity to access the ImageView
    myServer = new ServerThread(mBluetoothAdapter, MY_UUID, HomeActivity.this);
    myServer.start();
}
 
開發者ID:CarlXue,項目名稱:COMP90018,代碼行數:26,代碼來源:HomeActivity.java

示例3: onCreate

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

    // Initialize the ViewPager and set an adapter
    pager = (ViewPager) findViewById(R.id.pager);
    pager.setAdapter(new PageAdapter(getSupportFragmentManager()));

    final int pageMargin = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 4, getResources()
            .getDisplayMetrics());
    pager.setPageMargin(pageMargin);

    // Bind the tabs to the ViewPager
    tabs = (PagerSlidingTabStrip) findViewById(R.id.tabs);
    tabs.setIndicatorColor(0xFFFFBB00);
    tabs.setViewPager(pager);

    mBluetooth = new Bluetooth(getApplicationContext());
}
 
開發者ID:galaxyAbstractor,項目名稱:Suwako-Moriya-Hat,代碼行數:21,代碼來源:MainActivity.java

示例4: onCreate

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

    actionBar = getSupportActionBar();
    pager = (ViewPager) findViewById(R.id.pager);
    pager.setAdapter(new MyPagerAdapter(getSupportFragmentManager()));
    pager.addOnPageChangeListener(this);

    // Bind the tabs to the ViewPager
    PagerSlidingTabStrip tabs = (PagerSlidingTabStrip) findViewById(R.id.tabs);
    tabs.setIndicatorColor(Color.WHITE);
    tabs.setViewPager(pager);

    setUpAccountLayout(sessionM.getUser().isRegistered());
}
 
開發者ID:sessionm,項目名稱:android-sdk-example,代碼行數:18,代碼來源:MainActivity.java

示例5: onCreateView

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

    View rootView = inflater.inflate(R.layout.fragment_deck_builder, container, false);

    ViewPager pager = (ViewPager)rootView.findViewById(R.id.deck_list_pager);
    pager.setAdapter(new DeckBuilderPagerAdapter(
            getActivity().getSupportFragmentManager(),
            mDeck.getPlayerClass(),
            mDeck.getId(),
            getActivity()));

    PagerSlidingTabStrip tabs =
            (PagerSlidingTabStrip)rootView.findViewById(R.id.deck_builder_tab_strip);
    tabs.setBackground(new ColorDrawable(Utility.getPrimaryColorForClass(
            mDeck.getPlayerClass(), getResources())));
    tabs.setTextColor(Color.WHITE);
    tabs.setIndicatorColor(Color.WHITE);
    tabs.setViewPager(pager);

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

示例6: 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

示例7: 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

示例8: onCreate

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

    SamplesNotification.startJob(this);

    // Set up the action bar.
    final ActionBar actionBar = getSupportActionBar();
    actionBar.setDisplayShowHomeEnabled(true);
    actionBar.setLogo(R.mipmap.logo_action_bar);
    actionBar.setDisplayUseLogoEnabled(true);
    actionBar.setElevation(0);

    // Create the adapter that will return a fragment for each of the three
    // primary sections of the activity.
    SectionsPagerAdapter mSectionsPagerAdapter = new SectionsPagerAdapter(getSupportFragmentManager());

    // Set up the ViewPager with the sections adapter.
    mViewPager = (ViewPager) findViewById(R.id.pager);
    mViewPager.setAdapter(mSectionsPagerAdapter);

    // Bind the tabs to the ViewPager
    PagerSlidingTabStrip tabs = (PagerSlidingTabStrip) findViewById(R.id.tabs);
    tabs.setViewPager(mViewPager);
    tabs.setTextColor(getResources().getColor(R.color.white));
    tabs.setBackgroundColor(getResources().getColor(R.color.colorPrimary));
    tabs.setIndicatorColor(getResources().getColor(R.color.white));
}
 
開發者ID:alexprut,項目名稱:HappinessTracker,代碼行數:30,代碼來源:MainActivity.java

示例9: setupSlidingTabs

import com.astuetz.PagerSlidingTabStrip; //導入方法依賴的package包/類
private void setupSlidingTabs(ViewPager vpPager2) {
	tabs = (PagerSlidingTabStrip) findViewById(R.id.slidingTabStrip);
	tabs.setShouldExpand(true);

	tabs.setAllCaps(false);
	float dimension = getResources().getDimensionPixelSize(
			R.dimen.fontsize_small);
	tabs.setTextSize((int) dimension);
	Util.applyPrimaryFont(getApplicationContext(), tabs);
	tabs.setViewPager(vpPager);

	tabs.setIndicatorColor(getResources().getColor(R.color.watsi_blue));

}
 
開發者ID:rutvijkumarshah,項目名稱:WatsiAndroidApp,代碼行數:15,代碼來源:WatsiMainActivity.java

示例10: onCreate

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

    pColor = DB.patients().getActive(this).getColor();
    setupToolbar(null, pColor);
    setupStatusBar(pColor);
    subscribeToEvents();
    processIntent();


    mSectionsPagerAdapter = new SectionsPagerAdapter(getSupportFragmentManager());

    TextView title = ((TextView) findViewById(R.id.textView2));
    title.setBackgroundColor(pColor);
    title.setText(getString(mScheduleId != -1 ? R.string.title_edit_schedule_activity : R.string.title_create_schedule_activity));

    // Set up the ViewPager with the sections adapter.
    mViewPager = (ViewPager) findViewById(R.id.pager);
    mViewPager.setAdapter(mSectionsPagerAdapter);
    mViewPager.setOnPageChangeListener(this);
    mViewPager.setOffscreenPageLimit(3);
    tabs = (PagerSlidingTabStrip) findViewById(R.id.tabs);

    tabs.setOnPageChangeListener(this);
    tabs.setAllCaps(true);
    tabs.setShouldExpand(true);
    tabs.setDividerPadding(3);
    tabs.setDividerColor(getResources().getColor(R.color.white_50));
    tabs.setDividerColor(getResources().getColor(R.color.transparent));
    tabs.setIndicatorHeight(ScreenUtils.dpToPx(getResources(), 4));
    tabs.setIndicatorColor(ScreenUtils.equivalentNoAlpha(pColor, 0.8f));
    tabs.setTextColor(Color.parseColor("#222222"));
    tabs.setUnderlineColor(ScreenUtils.equivalentNoAlpha(pColor, 0.5f));
    tabs.setViewPager(mViewPager);

    if (mSchedule != null) {
        mViewPager.setCurrentItem(1);
    }


    findViewById(R.id.add_button).setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            saveSchedule();
        }
    });


}
 
開發者ID:citiususc,項目名稱:calendula,代碼行數:52,代碼來源:ScheduleCreationActivity.java


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