Пример #1
0
  // Activity Callbacks __________________________________________________________________________
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main_activity);
    this.getSupportActionBar().setElevation(0);

    getWindow().setSharedElementExitTransition(new Slide());
    getWindow().setSharedElementEnterTransition(new Slide());

    tabs = (PagerSlidingTabStrip) findViewById(R.id.tabs);
    viewPager = (ViewPager) findViewById(R.id.pager);
    viewPagerAdapter = new ContactsAdapter(this.getSupportFragmentManager(), this);

    viewPager.setAdapter(viewPagerAdapter);

    tabs.setShouldExpand(true);
    tabs.setTextColor(getResources().getColor(R.color.text_primary));
    tabs.setDividerColor(getResources().getColor(R.color.primary));
    tabs.setIndicatorColorResource(R.color.text_primary);
    tabs.setIndicatorHeight(7);

    // Bind the tabs to the ViewPager
    tabs.setViewPager(viewPager);

    // Start in Contacts Fragment
    viewPager.setCurrentItem(1);

    // Listener for slide animation on searchable selected
    setOnSearchableListener();

    // Configure custom-searchable UI
    // CustomSearchableInfo.setTransparencyColor(Color.parseColor("#0288D1"));
  }
  private void setupSlidingTabs(ViewPager vpPager) {
    tabs = (PagerSlidingTabStrip) findViewById(R.id.slidingTabStrip);
    tabs.setViewPager(vpPager);
    tabs.setTextColor(getResources().getColor(R.color.TwitterBlue));

    tabs.setIndicatorColor(getResources().getColor(R.color.TwitterBlue));
    tabs.setDividerColor(getResources().getColor(android.R.color.white));
    tabs.setShouldExpand(true);
    tabs.setAllCaps(true);
  }
Пример #3
0
 @Override
 public View onCreateView(
     LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
   View rootView = inflater.inflate(R.layout.blog_fragment_main, container, false);
   ButterKnife.inject(this, rootView);
   vpDate.setAdapter(new BlogFragmentListAdapter(getChildFragmentManager()));
   tabs.setViewPager(vpDate);
   tabs.setTextColor(Color.WHITE);
   tabs.setBackgroundColor(getResources().getColor(R.color.blue));
   write.setOnClickListener(v -> startActivity(new Intent(getActivity(), WriteActivity.class)));
   return rootView;
 }
Пример #4
0
 /** mPagerSlidingTabStrip默认值配置 */
 private void initTabsValue() {
   // 底部游标颜色
   mPagerSlidingTabStrip.setIndicatorColor(Color.WHITE);
   // tab的分割线颜色
   mPagerSlidingTabStrip.setDividerColor(Color.TRANSPARENT);
   // tab背景
   mPagerSlidingTabStrip.setBackgroundColor(Color.parseColor("#ff259b2c"));
   // tab底线高度
   mPagerSlidingTabStrip.setUnderlineHeight(
       (int)
           TypedValue.applyDimension(
               TypedValue.COMPLEX_UNIT_DIP, 1, getResources().getDisplayMetrics()));
   // 游标高度
   mPagerSlidingTabStrip.setIndicatorHeight(
       (int)
           TypedValue.applyDimension(
               TypedValue.COMPLEX_UNIT_DIP, 5, getResources().getDisplayMetrics()));
   // 选中的文字颜色
   // mPagerSlidingTabStrip.setSelectedTextColor(Color.WHITE);
   // 正常文字颜色
   mPagerSlidingTabStrip.setTextColor(Color.WHITE);
 }
Пример #5
0
  @Override
  public void onViewCreated(View view, Bundle savedInstanceState) {
    // TODO Auto-generated method stub
    super.onViewCreated(view, savedInstanceState);

    aq.id(R.id.header_logo_inivit)
        .clicked(
            new OnClickListener() {

              @Override
              public void onClick(View arg0) {
                // TODO Auto-generated method stub

                getFragmentManager().popBackStack();
              }
            });
    aq.id(R.id.organizer)
        .text(
            Html.fromHtml(
                "<i><small><font color=\"#c5c5c5\">"
                    + "Competitor ID: "
                    + "</font></small></i>"
                    + "<font color=\"#47a842\">"
                    + "compID"
                    + "</font>"));

    pager = (ViewPager) getActivity().findViewById(R.id.pager_invit);

    tabPagerAdapter = new TabPagerAdapter1(getChildFragmentManager());
    tabPagerAdapter.setTabHolderScrollingContent(
        new InvitationScrollHolder() {

          @Override
          public void onScroll(
              AbsListView view,
              int firstVisibleItem,
              int visibleItemCount,
              int totalItemCount,
              int pagePosition) {
            // TODO Auto-generated method stub

          }

          @Override
          public void adjustScroll(int scrollHeight) {
            // TODO Auto-generated method stub

          }
        });

    pager.setAdapter(tabPagerAdapter);

    // Bind the tabs to the ViewPager
    final PagerSlidingTabStrip tabs = (PagerSlidingTabStrip) aq.id(R.id.tabs_invit).getView();

    tabs.setShouldExpand(false);
    tabs.setDividerColorResource(android.R.color.transparent);
    tabs.setUnderlineColorResource(android.R.color.transparent);
    tabs.setTextSize(Utils.getPxFromDp(getActivity(), 14));
    tabs.setIndicatorHeight(Utils.getPxFromDp(getActivity(), 3));

    tabs.setMinimumWidth(Utils.getPxFromDp(getActivity(), 200));

    tabs.setIndicatorColor(Color.parseColor("#ffffff"));
    tabs.setTextColor(Color.parseColor("#ffffff"));
    tabs.setSmoothScrollingEnabled(true);
    tabs.setShouldExpand(false);
    tabs.setAllCaps(false);
    tabs.setTypeface(null, Typeface.NORMAL);

    tabs.setViewPager(pager);
    tabPagerAdapter.notifyDataSetChanged();
  }