Search in sources :

Example 6 with TitlePageIndicator

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

the class TitledViewPagerActivity method getPageIndicator.

@Override
protected PageIndicator getPageIndicator() {
    TitlePageIndicator titleIndicator = (TitlePageIndicator) findViewById(R.id.title_indicator);
    TabPageIndicator tabIndicator = (TabPageIndicator) findViewById(R.id.tab_indicator);
    if (KlyphPreferences.showTabPageIndicator())
        return tabIndicator;
    else
        return titleIndicator;
}
Also used : TabPageIndicator(com.viewpagerindicator.TabPageIndicator) TitlePageIndicator(com.viewpagerindicator.TitlePageIndicator)

Example 7 with TitlePageIndicator

use of com.viewpagerindicator.TitlePageIndicator in project little-bear-dictionary by daimajia.

the class SimpleWordAdapter method onClick.

@Override
public void onClick(View v) {
    switch(v.getId()) {
        case R.id.delete:
            String id = (String) v.getContentDescription();
            SQLiteDatabase sqLiteDatabase = mDictionaryDB.getWritableDatabase();
            sqLiteDatabase.execSQL("delete from `word` where `_id`='" + id + "'");
            Cursor cursor = sqLiteDatabase.rawQuery("select * from `word` order by `_id` desc", null);
            changeCursor(cursor);
            notifyDataSetChanged();
            sqLiteDatabase.close();
            break;
        case R.id.word_item:
            String word = (String) v.getContentDescription();
            Dialog dialog = new Dialog(mContext);
            View query_View = mInflater.inflate(R.layout.query, null);
            ViewPager mViewPager = (ViewPager) query_View.findViewById(R.id.viewpager);
            TitlePageIndicator mTitlePageIndicator = (TitlePageIndicator) query_View.findViewById(R.id.titles);
            QueryManageFragmentPager mQueryManageFragmentPager = new QueryManageFragmentPager();
            mViewPager.setAdapter(mQueryManageFragmentPager);
            mTitlePageIndicator.setViewPager(mViewPager);
            mTitlePageIndicator.setOnPageChangeListener(new IndicatorOnPageChangeListener());
            DictionaryDataCenter.instance(mContext).clear();
            mQueryManageFragmentPager.notifyDataSetChanged();
            mTitlePageIndicator.notifyDataSetChanged();
            new QueryAsyncTask(mContext, mTitlePageIndicator, mQueryManageFragmentPager, word).execute();
            dialog.setTitle(word);
            dialog.setContentView(query_View);
            dialog.show();
        default:
            break;
    }
}
Also used : SQLiteDatabase(android.database.sqlite.SQLiteDatabase) QueryAsyncTask(com.zhan_dui.dictionary.asynctasks.QueryAsyncTask) Dialog(org.holoeverywhere.app.Dialog) IndicatorOnPageChangeListener(com.zhan_dui.dictionary.listeners.IndicatorOnPageChangeListener) Cursor(android.database.Cursor) QueryManageFragmentPager(com.zhan_dui.dictionary.pageradapter.QueryManageFragmentPager) TextView(android.widget.TextView) View(android.view.View) ViewPager(android.support.v4.view.ViewPager) TitlePageIndicator(com.viewpagerindicator.TitlePageIndicator)

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