Search in sources :

Example 26 with GojuonItem

use of pri.weiqiang.liyujapanese.mvp.bean.gojuon.GojuonItem in project LiYuJapanese by 54wall.

the class DBManager method getQingYinWithoutHeader.

public List<GojuonItem> getQingYinWithoutHeader() {
    if (qingYinWithoutHeader == null) {
        qingYinWithoutHeader = new ArrayList<>();
        List<GojuonItem> query = getQingYin();
        for (GojuonItem item : query) {
            if (item.getRow() != 0 && item.getColumn() != 0 && item.isExisted()) {
                qingYinWithoutHeader.add(item);
            }
        }
    }
    return qingYinWithoutHeader;
}
Also used : GojuonItem(pri.weiqiang.liyujapanese.mvp.bean.gojuon.GojuonItem)

Example 27 with GojuonItem

use of pri.weiqiang.liyujapanese.mvp.bean.gojuon.GojuonItem in project LiYuJapanese by 54wall.

the class DBManager method getZhuoYin.

public List<GojuonItem> getZhuoYin() {
    if (zhuoYin == null) {
        zhuoYin = new ArrayList<>();
        List<GojuonItem> query = query();
        for (GojuonItem item : query) {
            if (item.getCategory() == Constants.CATEGORY_ZHUOYIN) {
                zhuoYin.add(item);
            }
        }
        Collections.sort(zhuoYin, new GojuonItemComporator());
    }
    return zhuoYin;
}
Also used : GojuonItemComporator(pri.weiqiang.liyujapanese.comparator.GojuonItemComporator) GojuonItem(pri.weiqiang.liyujapanese.mvp.bean.gojuon.GojuonItem)

Example 28 with GojuonItem

use of pri.weiqiang.liyujapanese.mvp.bean.gojuon.GojuonItem in project LiYuJapanese by 54wall.

the class PuzzleActivityPresenterImpl method loadData.

@Override
public void loadData() {
    List<GojuonItem> items = model.getItems();
    List<GojuonItem> jams = new ArrayList<>();
    GojuonItem current = items.get(0);
    jams.add(items.get(1));
    jams.add(items.get(2));
    jams.add(items.get(3));
    view.setData(current, jams);
}
Also used : ArrayList(java.util.ArrayList) GojuonItem(pri.weiqiang.liyujapanese.mvp.bean.gojuon.GojuonItem)

Aggregations

GojuonItem (pri.weiqiang.liyujapanese.mvp.bean.gojuon.GojuonItem)28 GojuonItemComporator (pri.weiqiang.liyujapanese.comparator.GojuonItemComporator)6 View (android.view.View)4 TextView (android.widget.TextView)4 ImageDialog (pri.weiqaing.common.widget.dialog.ImageDialog)4 GojuonGif (pri.weiqiang.liyujapanese.mvp.bean.gojuon.GojuonGif)4 Cursor (android.database.Cursor)2 SQLiteDatabase (android.database.sqlite.SQLiteDatabase)2 RecyclerView (androidx.recyclerview.widget.RecyclerView)2 ObservableEmitter (io.reactivex.ObservableEmitter)2 ObservableOnSubscribe (io.reactivex.ObservableOnSubscribe)2 Disposable (io.reactivex.disposables.Disposable)2 ArrayList (java.util.ArrayList)2 GojuonRecyclerAdapter (pri.weiqiang.liyujapanese.ui.adapter.GojuonRecyclerAdapter)2 MemorySwipeAdapter (pri.weiqiang.liyujapanese.ui.adapter.MemorySwipeAdapter)2