44
44
45
45
public class DirectMessageItemView extends LinearLayout {
46
46
47
+ private final Path mPath = new Path ();
48
+ private final Paint mPaint = new Paint ();
49
+ /*
50
+ *
51
+ */
52
+ private final OnTouchListener mOnTouchListener = new OnTouchListener () {
53
+
54
+ @ Override
55
+ public boolean onTouch (View v , MotionEvent event ) {
56
+ return mGestureDetector .onTouchEvent (event );
57
+ }
58
+ };
59
+ /*
60
+ *
61
+ */
62
+ private final GestureDetector mGestureDetector = new GestureDetector (
63
+ new GestureDetector .SimpleOnGestureListener () {
64
+
65
+ @ Override
66
+ public boolean onSingleTapConfirmed (MotionEvent e ) {
67
+ return mCallbacks != null && mCallbacks .onSingleTapConfirmed (DirectMessageItemView .this , mPosition );
68
+ }
69
+
70
+ @ Override
71
+ public void onLongPress (MotionEvent e ) {
72
+ if (mCallbacks != null ) {
73
+ mCallbacks .onLongPress (DirectMessageItemView .this ,
74
+ mPosition );
75
+ }
76
+ // return true;
77
+ }
78
+
79
+ @ Override
80
+ public boolean onDown (MotionEvent e ) {
81
+ return true ;
82
+ }
83
+ });
47
84
private Context mContext ;
48
85
private int mPosition ;
49
86
private TwitterDirectMessage mDirectMessage ;
@@ -52,25 +89,9 @@ public class DirectMessageItemView extends LinearLayout {
52
89
private QuickContactDivot mAvatar ;
53
90
private boolean mFullConversation ;
54
91
private ViewHolder mHolder ;
55
- private final Path mPath = new Path ();
56
- private final Paint mPaint = new Paint ();
57
-
58
- /*
59
- *
60
- */
61
- public interface DirectMessageItemViewCallbacks {
62
-
63
- public boolean onSingleTapConfirmed (View view , int position );
64
-
65
- public void onLongPress (View view , int position );
66
-
67
- public Activity getActivity ();
68
-
69
- public LazyImageLoader getProfileImageLoader ();
70
- }
71
92
72
93
/*
73
- *
94
+ *
74
95
*/
75
96
public DirectMessageItemView (Context context ) {
76
97
super (context );
@@ -259,6 +280,8 @@ public void onClick(View v) {
259
280
if (imageLoader != null ) {
260
281
imageLoader .displayImage (imageUrl , mAvatar );
261
282
}
283
+ } else {
284
+ mAvatar .setImageResource (R .drawable .ic_contact_picture );
262
285
}
263
286
264
287
mMessageBlock = mHolder .messageBlock ;
@@ -273,43 +296,6 @@ public void onClick(View v) {
273
296
}
274
297
}
275
298
276
- /*
277
- *
278
- */
279
- private final OnTouchListener mOnTouchListener = new OnTouchListener () {
280
-
281
- @ Override
282
- public boolean onTouch (View v , MotionEvent event ) {
283
- return mGestureDetector .onTouchEvent (event );
284
- }
285
- };
286
-
287
- /*
288
- *
289
- */
290
- private final GestureDetector mGestureDetector = new GestureDetector (
291
- new GestureDetector .SimpleOnGestureListener () {
292
-
293
- @ Override
294
- public boolean onSingleTapConfirmed (MotionEvent e ) {
295
- return mCallbacks != null && mCallbacks .onSingleTapConfirmed (DirectMessageItemView .this , mPosition );
296
- }
297
-
298
- @ Override
299
- public void onLongPress (MotionEvent e ) {
300
- if (mCallbacks != null ) {
301
- mCallbacks .onLongPress (DirectMessageItemView .this ,
302
- mPosition );
303
- }
304
- // return true;
305
- }
306
-
307
- @ Override
308
- public boolean onDown (MotionEvent e ) {
309
- return true ;
310
- }
311
- });
312
-
313
299
public TwitterDirectMessage getDirectMessage () {
314
300
return mDirectMessage ;
315
301
}
@@ -384,6 +370,20 @@ public void dispatchDraw(Canvas c) {
384
370
}
385
371
}
386
372
373
+ /*
374
+ *
375
+ */
376
+ public interface DirectMessageItemViewCallbacks {
377
+
378
+ public boolean onSingleTapConfirmed (View view , int position );
379
+
380
+ public void onLongPress (View view , int position );
381
+
382
+ public Activity getActivity ();
383
+
384
+ public LazyImageLoader getProfileImageLoader ();
385
+ }
386
+
387
387
private static class ViewHolder {
388
388
public ImageView replyIcon ;
389
389
public TextView authorScreenNameTextView ;
0 commit comments