added repos avatars
This commit is contained in:
@@ -13,11 +13,13 @@ import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
import com.amulyakhare.textdrawable.TextDrawable;
|
||||
import com.amulyakhare.textdrawable.util.ColorGenerator;
|
||||
import com.squareup.picasso.Picasso;
|
||||
import org.mian.gitnex.R;
|
||||
import org.mian.gitnex.activities.OpenRepoInBrowserActivity;
|
||||
import org.mian.gitnex.activities.RepoDetailActivity;
|
||||
import org.mian.gitnex.activities.RepoStargazersActivity;
|
||||
import org.mian.gitnex.activities.RepoWatchersActivity;
|
||||
import org.mian.gitnex.helpers.RoundedTransformation;
|
||||
import org.mian.gitnex.models.UserRepositories;
|
||||
import org.mian.gitnex.util.TinyDB;
|
||||
import java.lang.reflect.Field;
|
||||
@@ -46,7 +48,7 @@ public class MyReposListAdapter extends RecyclerView.Adapter<MyReposListAdapter.
|
||||
private TextView fullNameMy;
|
||||
private ImageView repoPrivatePublicMy;
|
||||
private TextView repoStarsMy;
|
||||
private TextView repoWatchersMy;
|
||||
private TextView repoForksMy;
|
||||
private TextView repoOpenIssuesCountMy;
|
||||
|
||||
private MyReposViewHolder(View itemView) {
|
||||
@@ -57,7 +59,7 @@ public class MyReposListAdapter extends RecyclerView.Adapter<MyReposListAdapter.
|
||||
fullNameMy = itemView.findViewById(R.id.repoFullNameMy);
|
||||
repoPrivatePublicMy = itemView.findViewById(R.id.imageRepoTypeMy);
|
||||
repoStarsMy = itemView.findViewById(R.id.repoStarsMy);
|
||||
repoWatchersMy = itemView.findViewById(R.id.repoWatchersMy);
|
||||
repoForksMy = itemView.findViewById(R.id.repoForksMy);
|
||||
repoOpenIssuesCountMy = itemView.findViewById(R.id.repoOpenIssuesCountMy);
|
||||
ImageView reposDropdownMenu = itemView.findViewById(R.id.reposDropdownMenu);
|
||||
|
||||
@@ -175,9 +177,14 @@ public class MyReposListAdapter extends RecyclerView.Adapter<MyReposListAdapter.
|
||||
.width(28)
|
||||
.height(28)
|
||||
.endConfig()
|
||||
.buildRoundRect(firstCharacter, color, 4);
|
||||
.buildRoundRect(firstCharacter, color, 3);
|
||||
|
||||
if (!currentItem.getAvatar_url().equals("")) {
|
||||
Picasso.get().load(currentItem.getAvatar_url()).transform(new RoundedTransformation(8, 0)).resize(120, 120).centerCrop().into(holder.imageMy);
|
||||
} else {
|
||||
holder.imageMy.setImageDrawable(drawable);
|
||||
}
|
||||
|
||||
holder.imageMy.setImageDrawable(drawable);
|
||||
holder.mTextView1My.setText(currentItem.getName());
|
||||
if (!currentItem.getDescription().equals("")) {
|
||||
holder.mTextView2My.setVisibility(View.VISIBLE);
|
||||
@@ -191,7 +198,7 @@ public class MyReposListAdapter extends RecyclerView.Adapter<MyReposListAdapter.
|
||||
holder.repoPrivatePublicMy.setImageResource(R.drawable.ic_public);
|
||||
}
|
||||
holder.repoStarsMy.setText(currentItem.getStars_count());
|
||||
holder.repoWatchersMy.setText(currentItem.getWatchers_count());
|
||||
holder.repoForksMy.setText(currentItem.getForks_count());
|
||||
holder.repoOpenIssuesCountMy.setText(currentItem.getOpen_issues_count());
|
||||
|
||||
}
|
||||
|
||||
@@ -17,11 +17,13 @@ import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
import com.amulyakhare.textdrawable.TextDrawable;
|
||||
import com.amulyakhare.textdrawable.util.ColorGenerator;
|
||||
import com.squareup.picasso.Picasso;
|
||||
import org.mian.gitnex.R;
|
||||
import org.mian.gitnex.activities.OpenRepoInBrowserActivity;
|
||||
import org.mian.gitnex.activities.RepoDetailActivity;
|
||||
import org.mian.gitnex.activities.RepoStargazersActivity;
|
||||
import org.mian.gitnex.activities.RepoWatchersActivity;
|
||||
import org.mian.gitnex.helpers.RoundedTransformation;
|
||||
import org.mian.gitnex.models.UserRepositories;
|
||||
import org.mian.gitnex.util.TinyDB;
|
||||
import java.lang.reflect.Field;
|
||||
@@ -46,7 +48,7 @@ public class ReposListAdapter extends RecyclerView.Adapter<ReposListAdapter.Repo
|
||||
private TextView fullName;
|
||||
private ImageView repoPrivatePublic;
|
||||
private TextView repoStars;
|
||||
private TextView repoWatchers;
|
||||
private TextView repoForks;
|
||||
private TextView repoOpenIssuesCount;
|
||||
|
||||
private ReposViewHolder(View itemView) {
|
||||
@@ -58,7 +60,7 @@ public class ReposListAdapter extends RecyclerView.Adapter<ReposListAdapter.Repo
|
||||
fullName = itemView.findViewById(R.id.repoFullName);
|
||||
repoPrivatePublic = itemView.findViewById(R.id.imageRepoType);
|
||||
repoStars = itemView.findViewById(R.id.repoStars);
|
||||
repoWatchers = itemView.findViewById(R.id.repoWatchers);
|
||||
repoForks = itemView.findViewById(R.id.repoForks);
|
||||
repoOpenIssuesCount = itemView.findViewById(R.id.repoOpenIssuesCount);
|
||||
ImageView reposDropdownMenu = itemView.findViewById(R.id.reposDropdownMenu);
|
||||
|
||||
@@ -177,9 +179,14 @@ public class ReposListAdapter extends RecyclerView.Adapter<ReposListAdapter.Repo
|
||||
.width(28)
|
||||
.height(28)
|
||||
.endConfig()
|
||||
.buildRoundRect(firstCharacter, color, 4);
|
||||
.buildRoundRect(firstCharacter, color, 3);
|
||||
|
||||
if (!currentItem.getAvatar_url().equals("")) {
|
||||
Picasso.get().load(currentItem.getAvatar_url()).transform(new RoundedTransformation(8, 0)).resize(120, 120).centerCrop().into(holder.image);
|
||||
} else {
|
||||
holder.image.setImageDrawable(drawable);
|
||||
}
|
||||
|
||||
holder.image.setImageDrawable(drawable);
|
||||
holder.mTextView1.setText(currentItem.getName());
|
||||
if (!currentItem.getDescription().equals("")) {
|
||||
holder.mTextView2.setVisibility(View.VISIBLE);
|
||||
@@ -193,7 +200,7 @@ public class ReposListAdapter extends RecyclerView.Adapter<ReposListAdapter.Repo
|
||||
holder.repoPrivatePublic.setImageResource(R.drawable.ic_public);
|
||||
}
|
||||
holder.repoStars.setText(currentItem.getStars_count());
|
||||
holder.repoWatchers.setText(currentItem.getWatchers_count());
|
||||
holder.repoForks.setText(currentItem.getForks_count());
|
||||
holder.repoOpenIssuesCount.setText(currentItem.getOpen_issues_count());
|
||||
|
||||
}
|
||||
|
||||
@@ -13,11 +13,13 @@ import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
import com.amulyakhare.textdrawable.TextDrawable;
|
||||
import com.amulyakhare.textdrawable.util.ColorGenerator;
|
||||
import com.squareup.picasso.Picasso;
|
||||
import org.mian.gitnex.R;
|
||||
import org.mian.gitnex.activities.OpenRepoInBrowserActivity;
|
||||
import org.mian.gitnex.activities.RepoDetailActivity;
|
||||
import org.mian.gitnex.activities.RepoStargazersActivity;
|
||||
import org.mian.gitnex.activities.RepoWatchersActivity;
|
||||
import org.mian.gitnex.helpers.RoundedTransformation;
|
||||
import org.mian.gitnex.models.UserRepositories;
|
||||
import org.mian.gitnex.util.TinyDB;
|
||||
import java.lang.reflect.Field;
|
||||
@@ -46,7 +48,7 @@ public class RepositoriesByOrgAdapter extends RecyclerView.Adapter<RepositoriesB
|
||||
private TextView fullName;
|
||||
private ImageView repoPrivatePublic;
|
||||
private TextView repoStars;
|
||||
private TextView repoWatchers;
|
||||
private TextView repoForks;
|
||||
private TextView repoOpenIssuesCount;
|
||||
|
||||
private OrgReposViewHolder(View itemView) {
|
||||
@@ -57,7 +59,7 @@ public class RepositoriesByOrgAdapter extends RecyclerView.Adapter<RepositoriesB
|
||||
fullName = itemView.findViewById(R.id.repoFullName);
|
||||
repoPrivatePublic = itemView.findViewById(R.id.imageRepoType);
|
||||
repoStars = itemView.findViewById(R.id.repoStars);
|
||||
repoWatchers = itemView.findViewById(R.id.repoWatchers);
|
||||
repoForks = itemView.findViewById(R.id.repoForks);
|
||||
repoOpenIssuesCount = itemView.findViewById(R.id.repoOpenIssuesCount);
|
||||
ImageView reposDropdownMenu = itemView.findViewById(R.id.reposDropdownMenu);
|
||||
|
||||
@@ -176,9 +178,14 @@ public class RepositoriesByOrgAdapter extends RecyclerView.Adapter<RepositoriesB
|
||||
.width(28)
|
||||
.height(28)
|
||||
.endConfig()
|
||||
.buildRoundRect(firstCharacter, color, 4);
|
||||
.buildRoundRect(firstCharacter, color, 3);
|
||||
|
||||
if (!currentItem.getAvatar_url().equals("")) {
|
||||
Picasso.get().load(currentItem.getAvatar_url()).transform(new RoundedTransformation(8, 0)).resize(120, 120).centerCrop().into(holder.image);
|
||||
} else {
|
||||
holder.image.setImageDrawable(drawable);
|
||||
}
|
||||
|
||||
holder.image.setImageDrawable(drawable);
|
||||
holder.mTextView1.setText(currentItem.getName());
|
||||
if (!currentItem.getDescription().equals("")) {
|
||||
holder.mTextView2.setVisibility(View.VISIBLE);
|
||||
@@ -192,7 +199,7 @@ public class RepositoriesByOrgAdapter extends RecyclerView.Adapter<RepositoriesB
|
||||
holder.repoPrivatePublic.setImageResource(R.drawable.ic_public);
|
||||
}
|
||||
holder.repoStars.setText(currentItem.getStars_count());
|
||||
holder.repoWatchers.setText(currentItem.getWatchers_count());
|
||||
holder.repoForks.setText(currentItem.getForks_count());
|
||||
holder.repoOpenIssuesCount.setText(currentItem.getOpen_issues_count());
|
||||
|
||||
}
|
||||
|
||||
@@ -13,11 +13,13 @@ import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
import com.amulyakhare.textdrawable.TextDrawable;
|
||||
import com.amulyakhare.textdrawable.util.ColorGenerator;
|
||||
import com.squareup.picasso.Picasso;
|
||||
import org.mian.gitnex.R;
|
||||
import org.mian.gitnex.activities.OpenRepoInBrowserActivity;
|
||||
import org.mian.gitnex.activities.RepoDetailActivity;
|
||||
import org.mian.gitnex.activities.RepoStargazersActivity;
|
||||
import org.mian.gitnex.activities.RepoWatchersActivity;
|
||||
import org.mian.gitnex.helpers.RoundedTransformation;
|
||||
import org.mian.gitnex.models.UserRepositories;
|
||||
import org.mian.gitnex.util.TinyDB;
|
||||
import java.lang.reflect.Field;
|
||||
@@ -46,7 +48,7 @@ public class StarredReposListAdapter extends RecyclerView.Adapter<StarredReposLi
|
||||
private TextView fullName;
|
||||
private ImageView repoPrivatePublic;
|
||||
private TextView repoStars;
|
||||
private TextView repoWatchers;
|
||||
private TextView repoForks;
|
||||
private TextView repoOpenIssuesCount;
|
||||
|
||||
private StarredReposViewHolder(View itemView) {
|
||||
@@ -57,7 +59,7 @@ public class StarredReposListAdapter extends RecyclerView.Adapter<StarredReposLi
|
||||
fullName = itemView.findViewById(R.id.repoFullName);
|
||||
repoPrivatePublic = itemView.findViewById(R.id.imageRepoType);
|
||||
repoStars = itemView.findViewById(R.id.repoStars);
|
||||
repoWatchers = itemView.findViewById(R.id.repoWatchers);
|
||||
repoForks = itemView.findViewById(R.id.repoForks);
|
||||
repoOpenIssuesCount = itemView.findViewById(R.id.repoOpenIssuesCount);
|
||||
ImageView reposDropdownMenu = itemView.findViewById(R.id.reposDropdownMenu);
|
||||
|
||||
@@ -176,9 +178,14 @@ public class StarredReposListAdapter extends RecyclerView.Adapter<StarredReposLi
|
||||
.width(28)
|
||||
.height(28)
|
||||
.endConfig()
|
||||
.buildRoundRect(firstCharacter, color, 4);
|
||||
.buildRoundRect(firstCharacter, color, 3);
|
||||
|
||||
if (!currentItem.getAvatar_url().equals("")) {
|
||||
Picasso.get().load(currentItem.getAvatar_url()).transform(new RoundedTransformation(8, 0)).resize(120, 120).centerCrop().into(holder.image);
|
||||
} else {
|
||||
holder.image.setImageDrawable(drawable);
|
||||
}
|
||||
|
||||
holder.image.setImageDrawable(drawable);
|
||||
holder.mTextView1.setText(currentItem.getName());
|
||||
if (!currentItem.getDescription().equals("")) {
|
||||
holder.mTextView2.setVisibility(View.VISIBLE);
|
||||
@@ -192,7 +199,7 @@ public class StarredReposListAdapter extends RecyclerView.Adapter<StarredReposLi
|
||||
holder.repoPrivatePublic.setImageResource(R.drawable.ic_public);
|
||||
}
|
||||
holder.repoStars.setText(currentItem.getStars_count());
|
||||
holder.repoWatchers.setText(currentItem.getWatchers_count());
|
||||
holder.repoForks.setText(currentItem.getForks_count());
|
||||
holder.repoOpenIssuesCount.setText(currentItem.getOpen_issues_count());
|
||||
|
||||
}
|
||||
|
||||
@@ -28,6 +28,7 @@ public class UserRepositories {
|
||||
private String website;
|
||||
private String forks_count;
|
||||
private Boolean has_issues;
|
||||
private String avatar_url;
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
@@ -100,4 +101,8 @@ public class UserRepositories {
|
||||
public Boolean getHas_issues() {
|
||||
return has_issues;
|
||||
}
|
||||
|
||||
public String getAvatar_url() {
|
||||
return avatar_url;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user