FeedbackMessageView.java
3.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
package net.hockeyapp.android.views;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.res.Resources;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.widget.LinearLayout;
import android.widget.TextView;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Iterator;
import java.util.List;
import net.hockeyapp.android.R.color;
import net.hockeyapp.android.R.id;
import net.hockeyapp.android.R.layout;
import net.hockeyapp.android.objects.FeedbackAttachment;
import net.hockeyapp.android.objects.FeedbackMessage;
import net.hockeyapp.android.tasks.AttachmentDownloader;
public class FeedbackMessageView
extends LinearLayout
{
@SuppressLint({"SimpleDateFormat"})
private static final SimpleDateFormat a = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
@SuppressLint({"SimpleDateFormat"})
private static final SimpleDateFormat b = new SimpleDateFormat("d MMM h:mm a");
private TextView c;
private TextView d;
private TextView e;
private AttachmentListView f;
private FeedbackMessage g;
private final Context h;
public FeedbackMessageView(Context paramContext, AttributeSet paramAttributeSet)
{
super(paramContext, paramAttributeSet);
this.h = paramContext;
LayoutInflater.from(paramContext).inflate(R.layout.hockeyapp_view_feedback_message, this);
this.c = ((TextView)findViewById(R.id.label_author));
this.d = ((TextView)findViewById(R.id.label_date));
this.e = ((TextView)findViewById(R.id.label_text));
this.f = ((AttachmentListView)findViewById(R.id.list_attachments));
}
public void setFeedbackMessage(FeedbackMessage paramFeedbackMessage)
{
this.g = paramFeedbackMessage;
try
{
paramFeedbackMessage = a.parse(this.g.getCreatedAt());
this.d.setText(b.format(paramFeedbackMessage));
this.c.setText(this.g.getName());
this.e.setText(this.g.getText());
this.f.removeAllViews();
paramFeedbackMessage = this.g.getFeedbackAttachments().iterator();
while (paramFeedbackMessage.hasNext())
{
FeedbackAttachment localFeedbackAttachment = (FeedbackAttachment)paramFeedbackMessage.next();
AttachmentView localAttachmentView = new AttachmentView(this.h, this.f, localFeedbackAttachment, false);
AttachmentDownloader.getInstance().download(localFeedbackAttachment, localAttachmentView);
this.f.addView(localAttachmentView);
}
}
catch (ParseException paramFeedbackMessage)
{
for (;;)
{
paramFeedbackMessage.printStackTrace();
}
}
}
public void setIndex(int paramInt)
{
if (paramInt % 2 == 0)
{
setBackgroundColor(getResources().getColor(R.color.hockeyapp_background_light));
this.c.setTextColor(getResources().getColor(R.color.hockeyapp_text_white));
this.d.setTextColor(getResources().getColor(R.color.hockeyapp_text_white));
}
for (;;)
{
this.e.setTextColor(getResources().getColor(R.color.hockeyapp_text_black));
return;
setBackgroundColor(getResources().getColor(R.color.hockeyapp_background_white));
this.c.setTextColor(getResources().getColor(R.color.hockeyapp_text_light));
this.d.setTextColor(getResources().getColor(R.color.hockeyapp_text_light));
}
}
}
/* Location: /home/merong/decompile/hackery-dex2jar.jar!/net/hockeyapp/android/views/FeedbackMessageView.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/