Search in sources :

Example 1 with LearningSelectionMethodDialog

use of com.alphago.alphago.fragment.LearningSelectionMethodDialog in project Alphago by Onedelay.

the class CardBookActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_card_book);
    final Intent intent = new Intent(this, WordLearningActivity.class);
    dbHelper = new DbHelper(getBaseContext());
    btnLearning = (Button) findViewById(R.id.btn_learning);
    btnLearning.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            if (!isSelectMode) {
                new LearningSelectionMethodDialog().show(getSupportFragmentManager(), "dialog");
            } else {
                intent.putExtra("category_select_list", selectList);
                intent.putExtra("learning_type", LearningSelectionMethodDialog.TYPE_ALBUM);
                startActivity(intent);
                cancelLearning(dbHelper);
            }
        }
    });
    adapter = new CategoryAdapter(this);
    recyclerView = (RecyclerView) findViewById(R.id.cardbook_grid);
    recyclerView.setAdapter(adapter);
    recyclerView.setHasFixedSize(true);
    // recyclerView.setLayoutManager(new GridLayoutManager(this, 3));
    adapter.setList(dbHelper.categorySelect());
}
Also used : CategoryAdapter(com.alphago.alphago.adapter.CategoryAdapter) LearningSelectionMethodDialog(com.alphago.alphago.fragment.LearningSelectionMethodDialog) Intent(android.content.Intent) DbHelper(com.alphago.alphago.database.DbHelper) RecyclerView(android.support.v7.widget.RecyclerView) View(android.view.View)

Aggregations

Intent (android.content.Intent)1 RecyclerView (android.support.v7.widget.RecyclerView)1 View (android.view.View)1 CategoryAdapter (com.alphago.alphago.adapter.CategoryAdapter)1 DbHelper (com.alphago.alphago.database.DbHelper)1 LearningSelectionMethodDialog (com.alphago.alphago.fragment.LearningSelectionMethodDialog)1