Search in sources :

Example 1 with TitlePageIndicator

use of com.viewpagerindicator.TitlePageIndicator in project glimmr by brk3.

the class BottomOverlayActivity method initViewPager.

protected void initViewPager() {
    if (mViewPager == null || mAdapter == null) {
        Log.e(TAG, "mViewPager and mAdapter must be initialised before " + "calling BottomOverlayActivity.initViewPager");
        return;
    }
    mViewPager.setAdapter(mAdapter);
    TitlePageIndicator indicator = (TitlePageIndicator) findViewById(R.id.indicator);
    if (indicator != null) {
        indicator.setViewPager(mViewPager);
    } else {
        mActionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
        mViewPager.setOnPageChangeListener(mAdapter);
        for (String title : CONTENT) {
            ActionBar.Tab newTab = mActionBar.newTab().setText(title);
            newTab.setTabListener(mAdapter);
            mActionBar.addTab(newTab);
        }
    }
}
Also used : TitlePageIndicator(com.viewpagerindicator.TitlePageIndicator) ActionBar(android.app.ActionBar)

Example 2 with TitlePageIndicator

use of com.viewpagerindicator.TitlePageIndicator in project ViewPagerIndicator by JakeWharton.

the class SampleTitlesCenterClickListener method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.simple_titles);
    mAdapter = new TestFragmentAdapter(getSupportFragmentManager());
    mPager = (ViewPager) findViewById(R.id.pager);
    mPager.setAdapter(mAdapter);
    TitlePageIndicator indicator = (TitlePageIndicator) findViewById(R.id.indicator);
    indicator.setViewPager(mPager);
    indicator.setFooterIndicatorStyle(IndicatorStyle.Underline);
    indicator.setOnCenterItemClickListener(this);
    mIndicator = indicator;
}
Also used : TitlePageIndicator(com.viewpagerindicator.TitlePageIndicator)

Example 3 with TitlePageIndicator

use of com.viewpagerindicator.TitlePageIndicator in project ViewPagerIndicator by JakeWharton.

the class SampleTitlesStyledMethods method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.simple_titles);
    mAdapter = new TestFragmentAdapter(getSupportFragmentManager());
    mPager = (ViewPager) findViewById(R.id.pager);
    mPager.setAdapter(mAdapter);
    TitlePageIndicator indicator = (TitlePageIndicator) findViewById(R.id.indicator);
    mIndicator = indicator;
    indicator.setViewPager(mPager);
    final float density = getResources().getDisplayMetrics().density;
    indicator.setBackgroundColor(0x18FF0000);
    indicator.setFooterColor(0xFFAA2222);
    //1dp
    indicator.setFooterLineHeight(1 * density);
    //3dp
    indicator.setFooterIndicatorHeight(3 * density);
    indicator.setFooterIndicatorStyle(IndicatorStyle.Underline);
    indicator.setTextColor(0xAA000000);
    indicator.setSelectedColor(0xFF000000);
    indicator.setSelectedBold(true);
}
Also used : TitlePageIndicator(com.viewpagerindicator.TitlePageIndicator)

Example 4 with TitlePageIndicator

use of com.viewpagerindicator.TitlePageIndicator in project ViewPagerIndicator by JakeWharton.

the class SampleTitlesTriangle method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.simple_titles);
    mAdapter = new TestFragmentAdapter(getSupportFragmentManager());
    mPager = (ViewPager) findViewById(R.id.pager);
    mPager.setAdapter(mAdapter);
    TitlePageIndicator indicator = (TitlePageIndicator) findViewById(R.id.indicator);
    indicator.setViewPager(mPager);
    indicator.setFooterIndicatorStyle(IndicatorStyle.Triangle);
    mIndicator = indicator;
}
Also used : TitlePageIndicator(com.viewpagerindicator.TitlePageIndicator)

Example 5 with TitlePageIndicator

use of com.viewpagerindicator.TitlePageIndicator in project Klyph by jonathangerbaud.

the class ProfileActivity method onCreate.

@Override
public void onCreate(final Bundle savedInstanceState) {
    requestWindowFeature(Window.FEATURE_ACTION_BAR_OVERLAY);
    final float ratio = getRatio();
    final int coverImageHeaderHeight = (int) (KlyphDevice.getDeviceWidth() * ratio);
    super.onCreate(savedInstanceState);
    getActionBar().setBackgroundDrawable(getResources().getDrawable(R.drawable.ab_background_transparent_gradient));
    // Let the Application class know that the first launch is complete
    // If we come from a notification, then do not show the ads
    // When going back to main activity
    KlyphApplication.getInstance().launchComplete();
    id = getIntent().getStringExtra(getBundleIdParameter());
    String name = getIntent().getStringExtra(getBundleNameParameter());
    TitlePageIndicator titleIndicator = (TitlePageIndicator) findViewById(R.id.title_indicator);
    TabPageIndicator tabIndicator = (TabPageIndicator) findViewById(R.id.tab_indicator);
    if (KlyphPreferences.showTabPageIndicator())
        titleIndicator.setVisibility(View.GONE);
    else
        tabIndicator.setVisibility(View.GONE);
    mHeader = findViewById(R.id.header);
    mHeaderPicture = (ImageView) findViewById(R.id.header_picture);
    mHeaderLogo = (ImageView) findViewById(R.id.header_logo);
    headerNameButton = findViewById(R.id.header_name_button);
    pageIndicator = getPageIndicator();
    errorView = findViewById(R.id.error_layout);
    errorTextView = (TextView) findViewById(R.id.error_text);
    errorButton = (Button) findViewById(R.id.retry_button);
    ImageLoader.display((ImageView) mHeaderPicture, ImageLoader.FAKE_URI, true, R.drawable.cover_place_holder);
    if (mHeaderLogo != null)
        ImageLoader.display((ImageView) mHeaderLogo, ImageLoader.FAKE_URI, true, KlyphUtil.getProfilePlaceHolder(this));
    initComponents();
    mSmoothInterpolator = new DecelerateInterpolator();
    mMinHeaderTranslation = -coverImageHeaderHeight + getActionBarHeight();
    mActionBarTitleColor = 0xFFFFFF;
    mSpannableString = new SpannableString(name);
    mAlphaForegroundColorSpan = new AlphaForegroundColorSpan(mActionBarTitleColor);
    setupActionBar();
    final View content = findViewById(android.R.id.content);
    if (hasCachedData(savedInstanceState)) {
        content.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {

            @SuppressWarnings("deprecation")
            @Override
            public void onGlobalLayout() {
                content.getViewTreeObserver().removeGlobalOnLayoutListener(this);
                loadCachedData(savedInstanceState);
            }
        });
    } else {
        loadData();
    }
}
Also used : DecelerateInterpolator(android.view.animation.DecelerateInterpolator) TabPageIndicator(com.viewpagerindicator.TabPageIndicator) SpannableString(android.text.SpannableString) ImageView(android.widget.ImageView) View(android.view.View) AbsListView(android.widget.AbsListView) TextView(android.widget.TextView) TextPaint(android.text.TextPaint) SpannableString(android.text.SpannableString) ImageView(android.widget.ImageView) TitlePageIndicator(com.viewpagerindicator.TitlePageIndicator) ViewTreeObserver(android.view.ViewTreeObserver)

Aggregations

TitlePageIndicator (com.viewpagerindicator.TitlePageIndicator)7 View (android.view.View)2 TextView (android.widget.TextView)2 TabPageIndicator (com.viewpagerindicator.TabPageIndicator)2 ActionBar (android.app.ActionBar)1 Cursor (android.database.Cursor)1 SQLiteDatabase (android.database.sqlite.SQLiteDatabase)1 ViewPager (android.support.v4.view.ViewPager)1 SpannableString (android.text.SpannableString)1 TextPaint (android.text.TextPaint)1 ViewTreeObserver (android.view.ViewTreeObserver)1 DecelerateInterpolator (android.view.animation.DecelerateInterpolator)1 AbsListView (android.widget.AbsListView)1 ImageView (android.widget.ImageView)1 QueryAsyncTask (com.zhan_dui.dictionary.asynctasks.QueryAsyncTask)1 IndicatorOnPageChangeListener (com.zhan_dui.dictionary.listeners.IndicatorOnPageChangeListener)1 QueryManageFragmentPager (com.zhan_dui.dictionary.pageradapter.QueryManageFragmentPager)1 Dialog (org.holoeverywhere.app.Dialog)1