Search in sources :

Example 6 with ForumItemTree

use of forpdateam.ru.forpda.api.forum.models.ForumItemTree in project ForPDA by RadiationX.

the class ForumFragment method loadData.

@Override
public boolean loadData() {
    if (!super.loadData()) {
        return false;
    }
    updateDialog = new AlertDialog.Builder(getContext()).setTitle(R.string.refreshing).setMessage(R.string.loading_data).setCancelable(false).show();
    subscribe(RxApi.Forum().getForums(), this::onLoadThemes, new ForumItemTree(), null);
    return true;
}
Also used : AlertDialog(android.support.v7.app.AlertDialog) ForumItemTree(forpdateam.ru.forpda.api.forum.models.ForumItemTree)

Example 7 with ForumItemTree

use of forpdateam.ru.forpda.api.forum.models.ForumItemTree in project ForPDA by RadiationX.

the class ForumFragment method recourse.

private void recourse(ForumItemTree rootForum, TreeNode rootNode) {
    if (rootForum.getForums() == null)
        return;
    for (ForumItemTree item : rootForum.getForums()) {
        TreeNode child = new TreeNode(item);
        recourse(item, child);
        rootNode.addChild(child);
    }
}
Also used : ForumItemTree(forpdateam.ru.forpda.api.forum.models.ForumItemTree) TreeNode(com.unnamed.b.atv.model.TreeNode)

Aggregations

ForumItemTree (forpdateam.ru.forpda.api.forum.models.ForumItemTree)7 IForumItemFlat (forpdateam.ru.forpda.api.forum.interfaces.IForumItemFlat)2 ArrayList (java.util.ArrayList)2 AlertDialog (android.support.v7.app.AlertDialog)1 TreeNode (com.unnamed.b.atv.model.TreeNode)1 AndroidTreeView (com.unnamed.b.atv.view.AndroidTreeView)1 NetworkResponse (forpdateam.ru.forpda.api.NetworkResponse)1 ForumItemFlat (forpdateam.ru.forpda.api.forum.models.ForumItemFlat)1 ForumItemFlatBd (forpdateam.ru.forpda.data.realm.forum.ForumItemFlatBd)1 Matcher (java.util.regex.Matcher)1