Android Open Source - Android-MultiPaneStream Tablet Multi Pane Stream Activity






From Project

Back to project page Android-MultiPaneStream.

License

The source code is released under:

Apache License

If you think the Android project Android-MultiPaneStream listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package net.ichigotake.multipanestream.app.tablet;
/*from   w w w.  ja v a  2  s  . com*/
import android.app.Activity;
import android.app.FragmentManager;
import android.os.Bundle;

import net.ichigotake.multipanestream.R;
import net.ichigotake.multipanestream.attribute.channel.ChannelTreeFragment;
import net.ichigotake.multipanestream.attribute.channel.OnChannelSelectedListener;
import net.ichigotake.multipanestream.attribute.joiner.JoinerFragment;
import net.ichigotake.multipanestream.sdk.Channel;
import net.ichigotake.multipanestream.sdk.Message;
import net.ichigotake.multipanestream.stream.LogStreamFragment;
import net.ichigotake.multipanestream.stream.MainStreamFragment;
import net.ichigotake.multipanestream.test.mock.ChannelCategoryFaker;
import net.ichigotake.multipanestream.test.mock.ChannelFaker;
import net.ichigotake.multipanestream.test.mock.MessageFaker;

public final class TabletMultiPaneStreamActivity extends Activity implements OnChannelSelectedListener {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_tablet_multi_pane_stream);

        ChannelCategoryFaker channelCategoryFaker = new ChannelCategoryFaker();
        MessageFaker messageFaker = new MessageFaker();
        Channel currentChannel = new ChannelFaker().create();
        FragmentManager fragmentManager = getFragmentManager();
        MainStreamFragment mainStreamFragment = (MainStreamFragment) fragmentManager
                .findFragmentById(R.id.activity_tablet_multi_pane_stream_main_stream);
        mainStreamFragment.setChannel(currentChannel);
        LogStreamFragment logStreamFragment = (LogStreamFragment) fragmentManager
                .findFragmentById(R.id.activity_tablet_multi_pane_stream_log_stream);
        ChannelTreeFragment channelTreeFragment = (ChannelTreeFragment) fragmentManager
                .findFragmentById(R.id.activity_tablet_multi_pane_stream_attribute_channel);
        JoinerFragment joinerFragment = (JoinerFragment) fragmentManager
                .findFragmentById(R.id.activity_tablet_multi_pane_stream_attribute_joiner);
        for (int i=0; i<10; i++) {
            Message message = messageFaker.create();
            logStreamFragment.addMessage(message);
            mainStreamFragment.addMessage(message);
            channelTreeFragment.addChannel(channelCategoryFaker.create(), message.getChannel());
            joinerFragment.addJoiner(message.getChannel(), message.getAuthor());
        }
        joinerFragment.setChannel(currentChannel);

    }

    @Override
    public void onChannelSelected(Channel channel) {
        FragmentManager fragmentManager = getFragmentManager();
        MainStreamFragment mainStreamFragment = (MainStreamFragment) fragmentManager
                .findFragmentById(R.id.activity_tablet_multi_pane_stream_main_stream);
        mainStreamFragment.setChannel(channel);
        JoinerFragment joinerFragment = (JoinerFragment) fragmentManager
                .findFragmentById(R.id.activity_tablet_multi_pane_stream_attribute_joiner);
        joinerFragment.setChannel(channel);
    }
}




Java Source Code List

net.ichigotake.multipanestream.ApplicationTest.java
net.ichigotake.multipanestream.app.tablet.TabletMultiPaneStreamActivity.java
net.ichigotake.multipanestream.attribute.channel.ChannelAdapter.java
net.ichigotake.multipanestream.attribute.channel.ChannelTreeExpandableListCollection.java
net.ichigotake.multipanestream.attribute.channel.ChannelTreeFragment.java
net.ichigotake.multipanestream.attribute.channel.OnChannelSelectedListener.java
net.ichigotake.multipanestream.attribute.joiner.JoinerAdapter.java
net.ichigotake.multipanestream.attribute.joiner.JoinerFragment.java
net.ichigotake.multipanestream.sdk.ChannelBuilder.java
net.ichigotake.multipanestream.sdk.ChannelCategoryBuilder.java
net.ichigotake.multipanestream.sdk.ChannelCategoryImpl.java
net.ichigotake.multipanestream.sdk.ChannelCategory.java
net.ichigotake.multipanestream.sdk.ChannelImpl.java
net.ichigotake.multipanestream.sdk.ChannelJoiners.java
net.ichigotake.multipanestream.sdk.ChannelTree.java
net.ichigotake.multipanestream.sdk.Channel.java
net.ichigotake.multipanestream.sdk.JoinerBuilder.java
net.ichigotake.multipanestream.sdk.JoinerImpl.java
net.ichigotake.multipanestream.sdk.Joiner.java
net.ichigotake.multipanestream.sdk.MessageBuilder.java
net.ichigotake.multipanestream.sdk.MessageImpl.java
net.ichigotake.multipanestream.sdk.Message.java
net.ichigotake.multipanestream.stream.LogStreamFragment.java
net.ichigotake.multipanestream.stream.MainStreamFragment.java
net.ichigotake.multipanestream.stream.MessageView.java
net.ichigotake.multipanestream.stream.StreamAdapter.java
net.ichigotake.multipanestream.stream.StreamContainer.java