package net.thetranquilpsychonaut.hashtagger.sites.twitter.ui;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.squareup.picasso.Picasso;
import net.thetranquilpsychonaut.hashtagger.R;
import net.thetranquilpsychonaut.hashtagger.sites.twitter.retrofit.pojos.Status;

/**
 * Created by itwenty on 7/3/14.
 */
public class TwitterRetweetView extends RelativeLayout
{
    private ImageView retweetImage;
    private TextView  retweetName;
    private TextView  retweetScreenName;

    public TwitterRetweetView( Context context )
    {
        this( context, null, 0 );
    }

    public TwitterRetweetView( Context context, AttributeSet attrs )
    {
        this( context, attrs, 0 );
    }

    public TwitterRetweetView( Context context, AttributeSet attrs, int defStyle )
    {
        super( context, attrs, defStyle );
        inflate( context, R.layout.twitter_retweet_view, this );
        retweetImage = ( ImageView ) findViewById( R.id.retweet_image );
        retweetName = ( TextView ) findViewById( R.id.retweet_name );
        retweetScreenName = ( TextView ) findViewById( R.id.retweet_screen_name );
    }

    public void update( Status status )
    {
        Picasso.with( getContext() )
                .load( status.getUser().getProfileImageUrl() )
                .fit()
                .centerCrop()
                .into( retweetImage );
        retweetName.setText( status.getUser().getName() );
        retweetScreenName.setText( "@" + status.getUser().getScreenName() );
    }
}

@@ -134,186 +134,80 @@
 ort 
-android.widget.ImageView;%0Aimport android.widget.RelativeLayout;%0Aimport android.widget.TextView;%0Aimport com.squareup.picasso.Picasso;%0Aimport net.thetranquilpsychonaut.hashtagger.R
+net.thetranquilpsychonaut.hashtagger.sites.twitter.retrofit.pojos.Status
 ;%0Aim
@@ -258,37 +258,21 @@
 tes.
-twitter.retrofit.pojos.Status
+ui.PersonView
 ;%0A%0A/
@@ -355,137 +355,20 @@
 nds 
-RelativeLayout%0A%7B%0A    private ImageView retweetImage;%0A    private TextView  retweetName;%0A    private TextView  retweetScreenName;%0A
+PersonView%0A%7B
 %0A   
@@ -419,36 +419,37 @@
 )%0A    %7B%0A        
-this
+super
 ( context, null,
@@ -445,17 +445,8 @@
 text
-, null, 0
  );%0A
@@ -535,20 +535,21 @@
         
-this
+super
 ( contex
@@ -560,11 +560,8 @@
 ttrs
-, 0
  );%0A
@@ -707,646 +707,271 @@
     
+%7D%0A%0A
     
-inflate( context, R.layout.twitter_retweet_view, this );%0A        retweetImage = ( ImageView ) findViewById( R.id.retweet_image );%0A        retweetName = ( TextView ) findViewById( R.id.retweet_name
+@Override%0A    protected String getPersonImageUrl( Object result
  )
-;
 %0A    
+%7B%0A
     
-retweetScreenName = ( TextView ) findViewById( R.id.retweet_screen_name );%0A    %7D%0A%0A    public void update( Status status )%0A    %7B%0A        Picasso.with( getContext() )%0A                .load( status.getUser().getProfileImageUrl() )%0A                .fit()%0A                .centerCrop()%0A                .into( retweetImage );%0A        retweetName.setText( status.getUser().getName() );%0A        retweetScreenName.setText( %22@%22 + status
+    return ( ( Status ) result ).getUser().getProfileImageUrl();%0A    %7D%0A%0A    @Override%0A    protected String getPersonName( Object result )%0A    %7B%0A        return ( ( Status ) result )
 .get
@@ -984,22 +984,14 @@
 .get
-Screen
 Name()
- )
 ;%0A  

Make TwitterRetweetView inherit from PersonView