Android Open Source - Android-MultiPaneStream Message View






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.stream;
// w w  w. ja v  a  2s.com
import android.content.Context;
import android.text.format.DateFormat;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;

import net.ichigotake.multipanestream.R;
import net.ichigotake.multipanestream.sdk.Message;

import butterknife.ButterKnife;
import butterknife.InjectView;

public class MessageView extends LinearLayout {

    @InjectView(R.id.message_item_timestamp)
    TextView messageItemTimestamp;
    @InjectView(R.id.message_item_channel)
    TextView messageItemChannel;
    @InjectView(R.id.message_item_title)
    TextView messageItemTitle;
    @InjectView(R.id.message_item_body)
    TextView messageItemBody;

    public MessageView(Context context) {
        super(context);
        init();
    }

    public MessageView(Context context, AttributeSet attrs) {
        super(context, attrs);
        init();
    }

    public MessageView(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
        init();
    }

    private void init() {
        View view = LayoutInflater.from(getContext()).inflate(R.layout.message_item, this, true);
        ButterKnife.inject(view);
    }

    public void setMessage(Message message) {
        messageItemTitle.setText(message.getTitle());
        messageItemBody.setText(message.getBody());
        messageItemChannel.setText("[" + message.getChannel().getName() + "]");
        messageItemTimestamp.setText(DateFormat.format("yyyy-MM-dd HH:mm", message.getTimestamp()));
    }
}




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