This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class LazyInstagramAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> { | |
private Context context; | |
private List<Layout> layouts; | |
private UserProfile userProfile; | |
private Boolean isGrid = true; | |
public ImageButton gridBtn, listBtn; | |
public LazyInstagramAdapter(Context context, List<Layout> layouts) { | |
this.context = context; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class LazyInstagramAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> { | |
private Context context; | |
private List<Layout> layouts; | |
private UserProfile userProfile; | |
@Override | |
public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { | |
LayoutInflater inflater = LayoutInflater.from(context); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MainActivity extends AppCompatActivity { | |
public OkHttpClient client; | |
public Retrofit retrofit; | |
public LazyInstagramApi lazyInstagramApi; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.lazyinstagram_main); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class PostAdapter extends RecyclerView.Adapter<PostItemHolder> { | |
private List<Post> posts; | |
private Context context; | |
public PostAdapter(Context context, List<Post> posts) { | |
this.context = context; | |
this.posts = posts; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class PostItemHolder extends RecyclerView.ViewHolder { | |
public ImageView imageView; | |
public TextView like; | |
public TextView comment; | |
public PostItemHolder(View itemView) { | |
super(itemView); | |
imageView = (ImageView) itemView.findViewById(R.id.imageView); | |
like = (TextView) itemView.findViewById(R.id.tvLike); | |
comment = (TextView) itemView.findViewById(R.id.tvComment); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public int getItemCount() { | |
return 0; | |
} | |
@Override | |
public ViewHolder onCreateViewHolder(ViewGroup viewGroup, int viewType) { | |
return null; | |
} | |
@Override | |
public void onBindViewHolder(ViewHolder holder, int position) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class UserDetailAdapter extends RecyclerView.Adapter<UserDetailHolder> { | |
private Context context; | |
private UserProfile userProfile; | |
public UserDetailAdapter(Context context, UserProfile userProfile) { | |
this.context = context; | |
this.userProfile = userProfile; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class UserDetailHolder extends RecyclerView.ViewHolder { | |
private TextView tvId, tvPost, tvFollowing, tvFollower, tvBio; | |
private ImageView avatar; | |
public UserDetailHolder(View itemView) { | |
super(itemView); | |
tvId = (TextView) itemView.findViewById(R.id.user_id); | |
tvPost = (TextView) itemView.findViewById(R.id.post); | |
tvFollowing = (TextView) itemView.findViewById(R.id.following); | |
tvFollower = (TextView) itemView.findViewById(R.id.follower); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class LazyInstagramAdapter { | |
public class PostsViewHolder extends RecyclerView.ViewHolder { | |
RecyclerView recyclerView; | |
public PostsViewHolder(View itemView) { | |
super(itemView); | |
recyclerView = (RecyclerView) itemView.findViewById(R.id.rc_post); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:orientation="vertical"> | |
<android.support.v7.widget.RecyclerView | |
android:id="@+id/main_recycler" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
/> |