Commit d6143ebf authored by M M Arif's avatar M M Arif

Merge branch '29-redesign-multiselect' into 'master'

[Improve] Refactor/design multiple assignees and labels dialog

See merge request mmarif4u/gitnex!45
parents a5213695 d22340bc
......@@ -33,43 +33,45 @@ public class MyReposListAdapter extends RecyclerView.Adapter<MyReposListAdapter.
static class MyReposViewHolder extends RecyclerView.ViewHolder {
private ImageView image;
private TextView mTextView1;
private TextView mTextView2;
private TextView fullName;
private ImageView repoPrivatePublic;
private TextView repoStars;
private TextView repoWatchers;
private TextView repoOpenIssuesCount;
private ImageView imageMy;
private TextView mTextView1My;
private TextView mTextView2My;
private TextView fullNameMy;
private ImageView repoPrivatePublicMy;
private TextView repoStarsMy;
private TextView repoWatchersMy;
private TextView repoOpenIssuesCountMy;
private MyReposViewHolder(View itemView) {
super(itemView);
mTextView1 = itemView.findViewById(R.id.repoName);
mTextView2 = itemView.findViewById(R.id.repoDescription);
image = itemView.findViewById(R.id.imageAvatar);
fullName = itemView.findViewById(R.id.repoFullName);
repoPrivatePublic = itemView.findViewById(R.id.imageRepoType);
repoStars = itemView.findViewById(R.id.repoStars);
repoWatchers = itemView.findViewById(R.id.repoWatchers);
repoOpenIssuesCount = itemView.findViewById(R.id.repoOpenIssuesCount);
mTextView1My = itemView.findViewById(R.id.repoNameMy);
mTextView2My = itemView.findViewById(R.id.repoDescriptionMy);
imageMy = itemView.findViewById(R.id.imageAvatarMy);
fullNameMy = itemView.findViewById(R.id.repoFullNameMy);
repoPrivatePublicMy = itemView.findViewById(R.id.imageRepoTypeMy);
repoStarsMy = itemView.findViewById(R.id.repoStarsMy);
repoWatchersMy = itemView.findViewById(R.id.repoWatchersMy);
repoOpenIssuesCountMy = itemView.findViewById(R.id.repoOpenIssuesCountMy);
itemView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Context context = v.getContext();
TextView repoFullName = (TextView) v.findViewById(R.id.repoFullName);
//TextView repoFullName = v.findViewById(R.id.repoFullNameMy);
//Log.i("clickListener", fullNameMy.getText().toString());
Intent intent = new Intent(context, RepoDetailActivity.class);
intent.putExtra("repoFullName", repoFullName.getText().toString());
intent.putExtra("repoFullName", fullNameMy.getText().toString());
TinyDB tinyDb = new TinyDB(context);
tinyDb.putString("repoFullName", repoFullName.getText().toString());
tinyDb.putString("repoFullName", fullNameMy.getText().toString());
tinyDb.putBoolean("resumeIssues", true);
context.startActivity(intent);
}
});
}
}
......@@ -90,7 +92,7 @@ public class MyReposListAdapter extends RecyclerView.Adapter<MyReposListAdapter.
public void onBindViewHolder(@NonNull MyReposListAdapter.MyReposViewHolder holder, int position) {
UserRepositories currentItem = reposList.get(position);
holder.mTextView2.setVisibility(View.GONE);
holder.mTextView2My.setVisibility(View.GONE);
ColorGenerator generator = ColorGenerator.MATERIAL;
int color = generator.getColor(currentItem.getName());
......@@ -106,22 +108,22 @@ public class MyReposListAdapter extends RecyclerView.Adapter<MyReposListAdapter.
.endConfig()
.buildRound(charac, color);
holder.image.setImageDrawable(drawable);
holder.mTextView1.setText(currentItem.getName());
holder.imageMy.setImageDrawable(drawable);
holder.mTextView1My.setText(currentItem.getName());
if (!currentItem.getDescription().equals("")) {
holder.mTextView2.setVisibility(View.VISIBLE);
holder.mTextView2.setText(currentItem.getDescription());
holder.mTextView2My.setVisibility(View.VISIBLE);
holder.mTextView2My.setText(currentItem.getDescription());
}
holder.fullName.setText(currentItem.getFullname());
holder.fullNameMy.setText(currentItem.getFullname());
if(currentItem.getPrivateFlag()) {
holder.repoPrivatePublic.setImageResource(R.drawable.ic_lock_bold);
holder.repoPrivatePublicMy.setImageResource(R.drawable.ic_lock_bold);
}
else {
holder.repoPrivatePublic.setImageResource(R.drawable.ic_public);
holder.repoPrivatePublicMy.setImageResource(R.drawable.ic_public);
}
holder.repoStars.setText(currentItem.getStars_count());
holder.repoWatchers.setText(currentItem.getWatchers_count());
holder.repoOpenIssuesCount.setText(currentItem.getOpen_issues_count());
holder.repoStarsMy.setText(currentItem.getStars_count());
holder.repoWatchersMy.setText(currentItem.getWatchers_count());
holder.repoOpenIssuesCountMy.setText(currentItem.getOpen_issues_count());
}
......
......@@ -25,7 +25,7 @@ import android.widget.ProgressBar;
import org.mian.gitnex.R;
import org.mian.gitnex.activities.MainActivity;
import org.mian.gitnex.activities.NewRepoActivity;
import org.mian.gitnex.adapters.ReposListAdapter;
import org.mian.gitnex.adapters.MyReposListAdapter;
import org.mian.gitnex.models.UserRepositories;
import org.mian.gitnex.util.AppUtil;
import org.mian.gitnex.util.TinyDB;
......@@ -43,7 +43,7 @@ public class MyRepositoriesFragment extends Fragment {
private static final String ARG_PARAM2 = "param2";
private ProgressBar mProgressBar;
private RecyclerView mRecyclerView;
private ReposListAdapter adapter;
private MyReposListAdapter adapter;
private ImageView createNewRepo;
private String mParam1;
......@@ -187,7 +187,7 @@ public class MyRepositoriesFragment extends Fragment {
myRepoModel.getCurrentUserRepositories(instanceUrl, instanceToken, username).observe(this, new Observer<List<UserRepositories>>() {
@Override
public void onChanged(@Nullable List<UserRepositories> myReposListMain) {
adapter = new ReposListAdapter(getContext(), myReposListMain);
adapter = new MyReposListAdapter(getContext(), myReposListMain);
mRecyclerView.setAdapter(adapter);
mProgressBar.setVisibility(View.GONE);
}
......
......@@ -94,7 +94,6 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="start"
android:textIsSelectable="true"
android:textColor="@color/white"
android:textSize="16sp" />
......@@ -109,7 +108,6 @@
<TextView
android:id="@+id/issueDueDate"
android:gravity="start"
android:textIsSelectable="true"
android:layout_alignParentStart="true"
android:layout_gravity="start"
android:layout_width="wrap_content"
......@@ -121,7 +119,6 @@
android:layout_toEndOf="@+id/issueDueDate"
android:id="@+id/issueMilestone"
android:gravity="end"
android:textIsSelectable="true"
android:layout_gravity="end"
android:layout_alignParentEnd="true"
android:layout_width="wrap_content"
......@@ -187,7 +184,6 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="start"
android:textIsSelectable="true"
android:textColor="@color/colorWhite"
android:textSize="14sp" />
......
......@@ -126,10 +126,11 @@
android:paddingStart="10dp"
android:paddingEnd="10dp"
android:textSize="14sp"
android:layout_gravity="center"
android:background="@drawable/shape_buttons"
android:textColor="@color/btnTextColor"
android:autoLink="web"
android:visibility="gone"/>
android:visibility="visible"/>
</LinearLayout>
......
......@@ -78,7 +78,6 @@
android:drawableStart="@drawable/ic_language"
android:drawablePadding="15dp"
android:id="@+id/userLang"
android:textIsSelectable="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
......
......@@ -213,7 +213,6 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/infoTabRepoDummyTime"
android:textIsSelectable="true"
android:textSize="16sp"
android:paddingTop="5dp"
android:textColor="@color/colorWhite"/>
......
......@@ -51,7 +51,6 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/createdText"
android:textIsSelectable="true"
android:textColor="@color/colorWhite"
android:textSize="14sp" />
......
......@@ -38,7 +38,6 @@
android:gravity="end"
android:layout_marginBottom="5dp"
android:text="@string/issueStatusClosed"
android:textIsSelectable="true"
android:textColor="@color/colorWhite"
android:textSize="16sp" />
......@@ -68,7 +67,6 @@
android:drawableStart="@drawable/ic_issue_open"
android:drawablePadding="6dp"
android:text="@string/repoStars"
android:textIsSelectable="true"
android:textColor="@color/colorWhite"
android:textSize="14sp" />
......@@ -80,7 +78,6 @@
android:drawableStart="@drawable/ic_issue_closed"
android:drawablePadding="6dp"
android:text="@string/repoWatchers"
android:textIsSelectable="true"
android:textColor="@color/colorWhite"
android:textSize="14sp" />
......@@ -92,7 +89,6 @@
android:drawableStart="@drawable/ic_calendar"
android:drawablePadding="06dp"
android:text="@string/repoWatchers"
android:textIsSelectable="true"
android:textColor="@color/colorWhite"
android:textSize="14sp" />
......
......@@ -18,7 +18,7 @@
tools:context=".activities.MainActivity">
<ImageView
android:id="@+id/imageAvatar"
android:id="@+id/imageAvatarMy"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginEnd="15dp"
......@@ -29,7 +29,7 @@
android:id="@+id/infoSection"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_toEndOf="@+id/imageAvatar"
android:layout_toEndOf="@+id/imageAvatarMy"
android:orientation="vertical">
<LinearLayout
......@@ -39,19 +39,18 @@
android:orientation="horizontal">
<TextView
android:id="@+id/repoName"
android:id="@+id/repoNameMy"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight=".95"
android:layout_marginBottom="5dp"
android:text="@string/repoName"
android:textIsSelectable="true"
android:textColor="@color/white"
android:textSize="16sp" />
<ImageView
android:layout_weight=".05"
android:id="@+id/imageRepoType"
android:id="@+id/imageRepoTypeMy"
android:layout_width="10dp"
android:layout_height="18dp"
android:layout_gravity="end"
......@@ -61,22 +60,20 @@
</LinearLayout>
<TextView
android:id="@+id/repoFullName"
android:id="@+id/repoFullNameMy"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:text="@string/repoFullname"
android:textIsSelectable="true"
android:textColor="@color/colorWhite"
android:textSize="14sp" />
<TextView
android:id="@+id/repoDescription"
android:id="@+id/repoDescriptionMy"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:text="@string/repoDescription"
android:textIsSelectable="true"
android:textColor="@color/colorWhite"
android:textSize="14sp"
android:visibility="gone" />
......@@ -89,7 +86,7 @@
android:orientation="horizontal">
<TextView
android:id="@+id/repoStars"
android:id="@+id/repoStarsMy"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight=".25"
......@@ -98,12 +95,11 @@
android:drawableStart="@drawable/ic_star"
android:drawablePadding="6dp"
android:text="@string/repoStars"
android:textIsSelectable="true"
android:textColor="@color/colorWhite"
android:textSize="14sp" />
<TextView
android:id="@+id/repoWatchers"
android:id="@+id/repoWatchersMy"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight=".25"
......@@ -112,12 +108,11 @@
android:drawableStart="@drawable/ic_watchers"
android:drawablePadding="6dp"
android:text="@string/repoWatchers"
android:textIsSelectable="true"
android:textColor="@color/colorWhite"
android:textSize="14sp" />
<TextView
android:id="@+id/repoOpenIssuesCount"
android:id="@+id/repoOpenIssuesCountMy"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight=".25"
......@@ -126,7 +121,6 @@
android:drawableStart="@drawable/ic_comment"
android:drawablePadding="06dp"
android:text="@string/repoWatchers"
android:textIsSelectable="true"
android:textColor="@color/colorWhite"
android:textSize="14sp" />
......
......@@ -38,7 +38,6 @@
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:text="@string/orgName"
android:textIsSelectable="true"
android:textColor="@color/white"
android:textSize="16sp" />
......@@ -48,7 +47,6 @@
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:text="@string/orgDescription"
android:textIsSelectable="true"
android:textColor="@color/colorWhite"
android:textSize="14sp"
android:visibility="gone" />
......
......@@ -17,7 +17,6 @@
<TextView
android:id="@+id/issueNumber"
android:textIsSelectable="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="invisible"/>
......@@ -51,7 +50,6 @@
<TextView
android:layout_marginTop="10dp"
android:id="@+id/issueCommentsCount"
android:textIsSelectable="true"
android:layout_width="48dp"
android:layout_height="50dp"
android:width="16dp"
......@@ -79,7 +77,6 @@
<TextView
android:id="@+id/issueTitle"
android:textIsSelectable="true"
android:layout_width="0dp"
android:layout_weight=".82"
android:layout_height="wrap_content"
......@@ -104,7 +101,6 @@
<TextView
android:id="@+id/issueDescription"
android:textIsSelectable="true"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
......@@ -129,7 +125,6 @@
<TextView
android:id="@+id/issueCreatedTime"
android:layout_width="wrap_content"
android:textIsSelectable="true"
android:layout_height="wrap_content"
android:textColor="@color/colorWhite"
android:textSize="14sp" />
......
......@@ -45,7 +45,6 @@
android:layout_weight=".95"
android:layout_marginBottom="5dp"
android:text="@string/repoName"
android:textIsSelectable="true"
android:textColor="@color/white"
android:textSize="16sp" />
......@@ -66,7 +65,6 @@
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:text="@string/repoFullname"
android:textIsSelectable="true"
android:textColor="@color/colorWhite"
android:textSize="14sp" />
......@@ -76,7 +74,6 @@
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:text="@string/repoDescription"
android:textIsSelectable="true"
android:textColor="@color/colorWhite"
android:textSize="14sp"
android:visibility="gone" />
......@@ -98,7 +95,6 @@
android:drawableStart="@drawable/ic_star"
android:drawablePadding="6dp"
android:text="@string/repoStars"
android:textIsSelectable="true"
android:textColor="@color/colorWhite"
android:textSize="14sp" />
......@@ -112,7 +108,6 @@
android:drawableStart="@drawable/ic_watchers"
android:drawablePadding="6dp"
android:text="@string/repoWatchers"
android:textIsSelectable="true"
android:textColor="@color/colorWhite"
android:textSize="14sp" />
......@@ -126,7 +121,6 @@
android:drawableStart="@drawable/ic_comment"
android:drawablePadding="06dp"
android:text="@string/repoWatchers"
android:textIsSelectable="true"
android:textColor="@color/colorWhite"
android:textSize="14sp" />
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment