Search in sources :

Example 6 with Replyable

use of com.winsonchiu.reader.data.reddit.Replyable in project Reader by TheKeeperOfPie.

the class ControllerInbox method setReplyText.

public boolean setReplyText(String name, String text, boolean collapsed) {
    for (int index = 0; index < data.getChildren().size(); index++) {
        Thing thing = data.getChildren().get(index);
        if (thing.getName().equals(name)) {
            ((Replyable) thing).setReplyText(text);
            ((Replyable) thing).setReplyExpanded(!collapsed);
            for (Listener listener : listeners) {
                listener.getAdapter().notifyItemChanged(index);
            }
            return true;
        }
    }
    return false;
}
Also used : ControllerListener(com.winsonchiu.reader.utils.ControllerListener) Replyable(com.winsonchiu.reader.data.reddit.Replyable) Thing(com.winsonchiu.reader.data.reddit.Thing)

Example 7 with Replyable

use of com.winsonchiu.reader.data.reddit.Replyable in project Reader by TheKeeperOfPie.

the class ControllerSearch method setReplyTextLinks.

public boolean setReplyTextLinks(String name, String text, boolean collapsed) {
    for (int index = 0; index < links.getChildren().size(); index++) {
        Thing thing = links.getChildren().get(index);
        if (thing.getName().equals(name)) {
            ((Replyable) thing).setReplyText(text);
            ((Replyable) thing).setReplyExpanded(!collapsed);
            eventHolder.callLinks(new RxAdapterEvent<>(getLinksModel(), RxAdapterEvent.Type.CHANGE, index + 1));
            return true;
        }
    }
    return false;
}
Also used : Replyable(com.winsonchiu.reader.data.reddit.Replyable) Thing(com.winsonchiu.reader.data.reddit.Thing)

Aggregations

Replyable (com.winsonchiu.reader.data.reddit.Replyable)7 Thing (com.winsonchiu.reader.data.reddit.Thing)6 ControllerListener (com.winsonchiu.reader.utils.ControllerListener)2 ActivityManager (android.app.ActivityManager)1 ComponentName (android.content.ComponentName)1 Intent (android.content.Intent)1 Bundle (android.os.Bundle)1 Handler (android.os.Handler)1 CustomTabsCallback (android.support.customtabs.CustomTabsCallback)1 CustomTabsClient (android.support.customtabs.CustomTabsClient)1 CustomTabsIntent (android.support.customtabs.CustomTabsIntent)1 CustomTabsServiceConnection (android.support.customtabs.CustomTabsServiceConnection)1 NavigationView (android.support.design.widget.NavigationView)1 DrawerLayout (android.support.v4.widget.DrawerLayout)1 RecyclerView (android.support.v7.widget.RecyclerView)1 View (android.view.View)1 HorizontalScrollView (android.widget.HorizontalScrollView)1 ImageView (android.widget.ImageView)1 TextView (android.widget.TextView)1 BindView (butterknife.BindView)1