// Path: app/src/main/java/party/minge/reddit/client/Manager.java
// @EBean(scope = EBean.Scope.Singleton)
// public class Manager {
//     @Bean(ResFactory.class)
//     protected UserAgentFactory userAgentFactory;
// 
//     @Bean(ResFactory.class)
//     protected CredentialFactory credentialFactory;
// 
//     @Bean(UserlessCredentialFactory.class)
//     protected CredentialFactory anonymousCredentialFactory;
// 
//     protected RedditClient redditClient;
// 
//     protected AuthenticationManager authenticationManager;
// 
//     protected AccountManager accountManager;
// 
//     @Bean(PreferenceTokenStore.class)
//     protected TokenStore tokenStore;
// 
//     @AfterInject
//     public void afterInject() {
//         this.redditClient = new RedditClient(this.userAgentFactory.getUserAgent());
//         this.authenticationManager = AuthenticationManager.get();
//         this.authenticationManager.init(this.redditClient, new RefreshTokenHandler(this.tokenStore, this.redditClient));
//         this.accountManager = new AccountManager(this.redditClient);
//     }
// 
//     /**
//      * Anonymously authenticates if required.
//      * If already authenticated, does not re-authenticate.
//      *
//      * @param authenticationCallback Methods to call on success or failure.
//      */
//     public void authenticateIfRequired(AuthenticationCallback authenticationCallback) {
//         AuthenticationState state = AuthenticationManager.get().checkAuthState();
// 
//         if (state == AuthenticationState.READY) {
//             authenticationCallback.onSuccessfulAuthentication();
//             return;
//         }
// 
//         if (state == AuthenticationState.NEED_REFRESH) {
//             try {
//                 this.authenticationManager.refreshAccessToken(this.getCredentials());
//                 authenticationCallback.onSuccessfulAuthentication();
//             } catch (Exception ex) {
//                 authenticationCallback.onFailedAuthentication(ex);
//             }
// 
//             return;
//         }
// 
//         try {
//             OAuthData authData = this.getClient().getOAuthHelper().easyAuth(this.getAnonymousCredentials());
//             this.getClient().authenticate(authData);
// 
//             authenticationCallback.onSuccessfulAuthentication();
//         } catch (Exception ex) {
//             authenticationCallback.onFailedAuthentication(ex);
//         }
//     }
// 
//     public RedditClient getClient() {
//         return this.redditClient;
//     }
// 
//     public AccountManager getAccountManager() {
//         return this.accountManager;
//     }
// 
//     public AuthenticationManager getAuthenticationManager() {
//         return this.authenticationManager;
//     }
// 
//     public Credentials getCredentials() {
//         return this.credentialFactory.getCredentials();
//     }
// 
//     public Credentials getAnonymousCredentials() {
//         return this.anonymousCredentialFactory.getCredentials();
//     }
// }
// 
// Path: app/src/main/java/party/minge/reddit/client/Upvoter.java
// @EBean
// public class Upvoter<T extends Thing & Votable> {
//     @Bean
//     protected Manager manager;
// 
//     private T upvotable;
// 
//     private VoteChangeListener voteChangeListener;
// 
//     private VoteDirection currentVoteDirection = VoteDirection.NO_VOTE;
// 
//     private boolean currentlyVoting = false;
// 
//     public void setUpvotable(T thing) {
//         this.upvotable = thing;
// 
//         this.setVoteDirection(thing.getVote());
//     }
// 
//     protected void setVoteDirection(VoteDirection voteDirection) {
//         this.currentVoteDirection = voteDirection;
// 
//         if (this.voteChangeListener != null) {
//             this.voteChangeListener.onVoteChanged(voteDirection);
//         }
//     }
// 
//     public void setVoteChangeListener(VoteChangeListener voteChangeListener) {
//         this.voteChangeListener = voteChangeListener;
//     }
// 
//     @Background
//     public void performVote(VoteDirection voteDirection) {
//         if (this.currentlyVoting) {
//             return;
//         }
// 
//         this.currentlyVoting = true;
// 
//         VoteDirection oldDirection = this.currentVoteDirection;
// 
//         if (voteDirection == oldDirection) {
//             voteDirection = VoteDirection.NO_VOTE;
//         }
// 
//         // update vote on ui instantly, reverting if it fails
//         this.setVoteDirection(voteDirection);
// 
//         try {
//             this.manager.getAccountManager().vote(this.upvotable, voteDirection);
//         } catch (ApiException ex) {
//             Log.e("vote", ex.toString());
//             this.setVoteDirection(oldDirection);
//         }
// 
//         this.currentlyVoting = false;
//     }
// }
// 
// Path: app/src/main/java/party/minge/reddit/client/VoteChangeListener.java
// public interface VoteChangeListener {
//     void onVoteChanged(VoteDirection voteDirection);
// }


import android.annotation.SuppressLint;
import android.content.Context;
import android.graphics.Color;
import android.text.format.DateUtils;
import android.util.Log;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.bumptech.glide.Glide;
import com.bumptech.glide.request.target.Target;
import com.joanzapata.iconify.widget.IconTextView;
import net.dean.jraw.ApiException;
import net.dean.jraw.models.OEmbed;
import net.dean.jraw.models.Submission;
import net.dean.jraw.models.Thumbnails;
import net.dean.jraw.models.VoteDirection;
import org.androidannotations.annotations.AfterViews;
import org.androidannotations.annotations.Background;
import org.androidannotations.annotations.Bean;
import org.androidannotations.annotations.EViewGroup;
import org.androidannotations.annotations.UiThread;
import org.androidannotations.annotations.ViewById;
import org.androidannotations.annotations.res.ColorRes;
import java.util.Locale;
import party.minge.reddit.client.Manager;
import party.minge.reddit.client.Upvoter;
import party.minge.reddit.client.VoteChangeListener;
package party.minge.reddit;








@EViewGroup(R.layout.post_item)
public class PostItemView extends LinearLayout {
    @Bean
// Path: app/src/main/java/party/minge/reddit/client/Manager.java
// @EBean(scope = EBean.Scope.Singleton)
// public class Manager {
//     @Bean(ResFactory.class)
//     protected UserAgentFactory userAgentFactory;
// 
//     @Bean(ResFactory.class)
//     protected CredentialFactory credentialFactory;
// 
//     @Bean(UserlessCredentialFactory.class)
//     protected CredentialFactory anonymousCredentialFactory;
// 
//     protected RedditClient redditClient;
// 
//     protected AuthenticationManager authenticationManager;
// 
//     protected AccountManager accountManager;
// 
//     @Bean(PreferenceTokenStore.class)
//     protected TokenStore tokenStore;
// 
//     @AfterInject
//     public void afterInject() {
//         this.redditClient = new RedditClient(this.userAgentFactory.getUserAgent());
//         this.authenticationManager = AuthenticationManager.get();
//         this.authenticationManager.init(this.redditClient, new RefreshTokenHandler(this.tokenStore, this.redditClient));
//         this.accountManager = new AccountManager(this.redditClient);
//     }
// 
//     /**
//      * Anonymously authenticates if required.
//      * If already authenticated, does not re-authenticate.
//      *
//      * @param authenticationCallback Methods to call on success or failure.
//      */
//     public void authenticateIfRequired(AuthenticationCallback authenticationCallback) {
//         AuthenticationState state = AuthenticationManager.get().checkAuthState();
// 
//         if (state == AuthenticationState.READY) {
//             authenticationCallback.onSuccessfulAuthentication();
//             return;
//         }
// 
//         if (state == AuthenticationState.NEED_REFRESH) {
//             try {
//                 this.authenticationManager.refreshAccessToken(this.getCredentials());
//                 authenticationCallback.onSuccessfulAuthentication();
//             } catch (Exception ex) {
//                 authenticationCallback.onFailedAuthentication(ex);
//             }
// 
//             return;
//         }
// 
//         try {
//             OAuthData authData = this.getClient().getOAuthHelper().easyAuth(this.getAnonymousCredentials());
//             this.getClient().authenticate(authData);
// 
//             authenticationCallback.onSuccessfulAuthentication();
//         } catch (Exception ex) {
//             authenticationCallback.onFailedAuthentication(ex);
//         }
//     }
// 
//     public RedditClient getClient() {
//         return this.redditClient;
//     }
// 
//     public AccountManager getAccountManager() {
//         return this.accountManager;
//     }
// 
//     public AuthenticationManager getAuthenticationManager() {
//         return this.authenticationManager;
//     }
// 
//     public Credentials getCredentials() {
//         return this.credentialFactory.getCredentials();
//     }
// 
//     public Credentials getAnonymousCredentials() {
//         return this.anonymousCredentialFactory.getCredentials();
//     }
// }
// 
// Path: app/src/main/java/party/minge/reddit/client/Upvoter.java
// @EBean
// public class Upvoter<T extends Thing & Votable> {
//     @Bean
//     protected Manager manager;
// 
//     private T upvotable;
// 
//     private VoteChangeListener voteChangeListener;
// 
//     private VoteDirection currentVoteDirection = VoteDirection.NO_VOTE;
// 
//     private boolean currentlyVoting = false;
// 
//     public void setUpvotable(T thing) {
//         this.upvotable = thing;
// 
//         this.setVoteDirection(thing.getVote());
//     }
// 
//     protected void setVoteDirection(VoteDirection voteDirection) {
//         this.currentVoteDirection = voteDirection;
// 
//         if (this.voteChangeListener != null) {
//             this.voteChangeListener.onVoteChanged(voteDirection);
//         }
//     }
// 
//     public void setVoteChangeListener(VoteChangeListener voteChangeListener) {
//         this.voteChangeListener = voteChangeListener;
//     }
// 
//     @Background
//     public void performVote(VoteDirection voteDirection) {
//         if (this.currentlyVoting) {
//             return;
//         }
// 
//         this.currentlyVoting = true;
// 
//         VoteDirection oldDirection = this.currentVoteDirection;
// 
//         if (voteDirection == oldDirection) {
//             voteDirection = VoteDirection.NO_VOTE;
//         }
// 
//         // update vote on ui instantly, reverting if it fails
//         this.setVoteDirection(voteDirection);
// 
//         try {
//             this.manager.getAccountManager().vote(this.upvotable, voteDirection);
//         } catch (ApiException ex) {
//             Log.e("vote", ex.toString());
//             this.setVoteDirection(oldDirection);
//         }
// 
//         this.currentlyVoting = false;
//     }
// }
// 
// Path: app/src/main/java/party/minge/reddit/client/VoteChangeListener.java
// public interface VoteChangeListener {
//     void onVoteChanged(VoteDirection voteDirection);
// }


// Path: app/src/main/java/party/minge/reddit/PostItemView.java
import android.annotation.SuppressLint;
import android.content.Context;
import android.graphics.Color;
import android.text.format.DateUtils;
import android.util.Log;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.bumptech.glide.Glide;
import com.bumptech.glide.request.target.Target;
import com.joanzapata.iconify.widget.IconTextView;
import net.dean.jraw.ApiException;
import net.dean.jraw.models.OEmbed;
import net.dean.jraw.models.Submission;
import net.dean.jraw.models.Thumbnails;
import net.dean.jraw.models.VoteDirection;
import org.androidannotations.annotations.AfterViews;
import org.androidannotations.annotations.Background;
import org.androidannotations.annotations.Bean;
import org.androidannotations.annotations.EViewGroup;
import org.androidannotations.annotations.UiThread;
import org.androidannotations.annotations.ViewById;
import org.androidannotations.annotations.res.ColorRes;
import java.util.Locale;
import party.minge.reddit.client.Manager;
import party.minge.reddit.client.Upvoter;
import party.minge.reddit.client.VoteChangeListener;

package party.minge.reddit;








@EViewGroup(R.layout.post_item)
public class PostItemView extends LinearLayout {
    @Bean
    protected Manager manager;