use of com.zhan_dui.dictionary.pageradapter.QueryManageFragmentPager in project little-bear-dictionary by daimajia.
the class QueryWordFragment method onViewCreated.
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
mViewPager = (ViewPager) view.findViewById(R.id.viewpager);
mTitlePageIndicator = (TitlePageIndicator) view.findViewById(R.id.titles);
mQueryManageFragmentPager = new QueryManageFragmentPager();
mViewPager.setAdapter(mQueryManageFragmentPager);
mTitlePageIndicator.setViewPager(mViewPager);
mTitlePageIndicator.setOnPageChangeListener(new IndicatorOnPageChangeListener());
}
use of com.zhan_dui.dictionary.pageradapter.QueryManageFragmentPager 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;
}
}
Aggregations