mirror of https://codeberg.org/gitnex/GitNex.git
Compare commits
2 Commits
87b595b262
...
67042d81f4
Author | SHA1 | Date |
---|---|---|
M M Arif | 67042d81f4 | |
M M Arif | 1eedae7e3d |
|
@ -391,7 +391,7 @@ public class DashboardAdapter extends RecyclerView.Adapter<RecyclerView.ViewHold
|
|||
+ "'>"
|
||||
+ activity.getRepo().getFullName()
|
||||
+ "</font>";
|
||||
typeString = "created repository";
|
||||
typeString = context.getString(R.string.createdRepository);
|
||||
typeIcon.setImageResource(R.drawable.ic_repo);
|
||||
} else if (activity.getOpType().equalsIgnoreCase("rename_repo")) {
|
||||
|
||||
|
@ -402,7 +402,10 @@ public class DashboardAdapter extends RecyclerView.Adapter<RecyclerView.ViewHold
|
|||
+ "'>"
|
||||
+ activity.getRepo().getFullName()
|
||||
+ "</font>";
|
||||
typeString = "renamed repository from " + activity.getContent() + " to";
|
||||
typeString =
|
||||
String.format(
|
||||
context.getString(R.string.renamedRepository),
|
||||
activity.getContent());
|
||||
typeIcon.setImageResource(R.drawable.ic_repo);
|
||||
} else if (activity.getOpType().equalsIgnoreCase("star_repo")) {
|
||||
|
||||
|
@ -413,7 +416,7 @@ public class DashboardAdapter extends RecyclerView.Adapter<RecyclerView.ViewHold
|
|||
+ "'>"
|
||||
+ activity.getRepo().getFullName()
|
||||
+ "</font>";
|
||||
typeString = "starred";
|
||||
typeString = context.getString(R.string.starredRepository);
|
||||
typeIcon.setImageResource(R.drawable.ic_star);
|
||||
} else if (activity.getOpType().equalsIgnoreCase("transfer_repo")) {
|
||||
|
||||
|
@ -424,7 +427,10 @@ public class DashboardAdapter extends RecyclerView.Adapter<RecyclerView.ViewHold
|
|||
+ "'>"
|
||||
+ activity.getRepo().getFullName()
|
||||
+ "</font>";
|
||||
typeString = "transferred repository " + activity.getContent() + " to";
|
||||
typeString =
|
||||
String.format(
|
||||
context.getString(R.string.transferredRepository),
|
||||
activity.getContent());
|
||||
typeIcon.setImageResource(R.drawable.ic_arrow_up);
|
||||
} else if (activity.getOpType().equalsIgnoreCase("commit_repo")) {
|
||||
|
||||
|
@ -447,7 +453,8 @@ public class DashboardAdapter extends RecyclerView.Adapter<RecyclerView.ViewHold
|
|||
activity.getRefName().lastIndexOf("/") + 1)
|
||||
.trim()
|
||||
+ "</font>";
|
||||
typeString = "created branch " + branch + " in";
|
||||
typeString =
|
||||
String.format(context.getString(R.string.createdBranch), branch);
|
||||
} else {
|
||||
String branch =
|
||||
"<font color='"
|
||||
|
@ -459,7 +466,7 @@ public class DashboardAdapter extends RecyclerView.Adapter<RecyclerView.ViewHold
|
|||
activity.getRefName().lastIndexOf("/") + 1)
|
||||
.trim()
|
||||
+ "</font>";
|
||||
typeString = "pushed to " + branch + " at";
|
||||
typeString = String.format(context.getString(R.string.pushedTo), branch);
|
||||
|
||||
JSONObject commitsObj = null;
|
||||
try {
|
||||
|
@ -567,7 +574,7 @@ public class DashboardAdapter extends RecyclerView.Adapter<RecyclerView.ViewHold
|
|||
+ context.getResources().getString(R.string.hash)
|
||||
+ id
|
||||
+ "</font>";
|
||||
typeString = "opened issue";
|
||||
typeString = context.getString(R.string.openedIssue);
|
||||
typeIcon.setImageResource(R.drawable.ic_issue);
|
||||
} else if (activity.getOpType().equalsIgnoreCase("comment_issue")) {
|
||||
|
||||
|
@ -580,7 +587,7 @@ public class DashboardAdapter extends RecyclerView.Adapter<RecyclerView.ViewHold
|
|||
+ context.getResources().getString(R.string.hash)
|
||||
+ id
|
||||
+ "</font>";
|
||||
typeString = "commented on issue";
|
||||
typeString = context.getString(R.string.commentedOnIssue);
|
||||
typeIcon.setImageResource(R.drawable.ic_comment);
|
||||
} else if (activity.getOpType().equalsIgnoreCase("close_issue")) {
|
||||
|
||||
|
@ -593,7 +600,7 @@ public class DashboardAdapter extends RecyclerView.Adapter<RecyclerView.ViewHold
|
|||
+ context.getResources().getString(R.string.hash)
|
||||
+ id
|
||||
+ "</font>";
|
||||
typeString = "closed issue";
|
||||
typeString = context.getString(R.string.closedIssue);
|
||||
typeIcon.setImageResource(R.drawable.ic_issue_closed);
|
||||
} else if (activity.getOpType().equalsIgnoreCase("reopen_issue")) {
|
||||
|
||||
|
@ -606,7 +613,7 @@ public class DashboardAdapter extends RecyclerView.Adapter<RecyclerView.ViewHold
|
|||
+ context.getResources().getString(R.string.hash)
|
||||
+ id
|
||||
+ "</font>";
|
||||
typeString = "reopened issue";
|
||||
typeString = context.getString(R.string.reopenedIssue);
|
||||
typeIcon.setImageResource(R.drawable.ic_reopen);
|
||||
}
|
||||
} else if (activity.getOpType().contains("pull")) {
|
||||
|
@ -634,7 +641,7 @@ public class DashboardAdapter extends RecyclerView.Adapter<RecyclerView.ViewHold
|
|||
+ context.getResources().getString(R.string.hash)
|
||||
+ id
|
||||
+ "</font>";
|
||||
typeString = "created pull request";
|
||||
typeString = context.getString(R.string.createdPR);
|
||||
typeIcon.setImageResource(R.drawable.ic_pull_request);
|
||||
} else if (activity.getOpType().equalsIgnoreCase("close_pull_request")) {
|
||||
|
||||
|
@ -647,7 +654,7 @@ public class DashboardAdapter extends RecyclerView.Adapter<RecyclerView.ViewHold
|
|||
+ context.getResources().getString(R.string.hash)
|
||||
+ id
|
||||
+ "</font>";
|
||||
typeString = "closed pull request";
|
||||
typeString = context.getString(R.string.closedPR);
|
||||
typeIcon.setImageResource(R.drawable.ic_issue_closed);
|
||||
} else if (activity.getOpType().equalsIgnoreCase("reopen_pull_request")) {
|
||||
|
||||
|
@ -660,7 +667,7 @@ public class DashboardAdapter extends RecyclerView.Adapter<RecyclerView.ViewHold
|
|||
+ context.getResources().getString(R.string.hash)
|
||||
+ id
|
||||
+ "</font>";
|
||||
typeString = "reopened pull request";
|
||||
typeString = context.getString(R.string.reopenedPR);
|
||||
typeIcon.setImageResource(R.drawable.ic_reopen);
|
||||
} else if (activity.getOpType().equalsIgnoreCase("merge_pull_request")) {
|
||||
|
||||
|
@ -673,7 +680,7 @@ public class DashboardAdapter extends RecyclerView.Adapter<RecyclerView.ViewHold
|
|||
+ context.getResources().getString(R.string.hash)
|
||||
+ id
|
||||
+ "</font>";
|
||||
typeString = "merged pull request";
|
||||
typeString = context.getString(R.string.mergedPR);
|
||||
typeIcon.setImageResource(R.drawable.ic_pull_request);
|
||||
} else if (activity.getOpType().equalsIgnoreCase("approve_pull_request")) {
|
||||
|
||||
|
@ -686,7 +693,7 @@ public class DashboardAdapter extends RecyclerView.Adapter<RecyclerView.ViewHold
|
|||
+ context.getResources().getString(R.string.hash)
|
||||
+ id
|
||||
+ "</font>";
|
||||
typeString = "approved";
|
||||
typeString = context.getString(R.string.approved);
|
||||
typeIcon.setImageResource(R.drawable.ic_done);
|
||||
} else if (activity.getOpType().equalsIgnoreCase("reject_pull_request")) {
|
||||
|
||||
|
@ -699,7 +706,7 @@ public class DashboardAdapter extends RecyclerView.Adapter<RecyclerView.ViewHold
|
|||
+ context.getResources().getString(R.string.hash)
|
||||
+ id
|
||||
+ "</font>";
|
||||
typeString = "suggested changes for";
|
||||
typeString = context.getString(R.string.suggestedChanges);
|
||||
typeIcon.setImageResource(R.drawable.ic_diff);
|
||||
} else if (activity.getOpType().equalsIgnoreCase("comment_pull")) {
|
||||
|
||||
|
@ -712,7 +719,7 @@ public class DashboardAdapter extends RecyclerView.Adapter<RecyclerView.ViewHold
|
|||
+ context.getResources().getString(R.string.hash)
|
||||
+ id
|
||||
+ "</font>";
|
||||
typeString = "commented on pull request";
|
||||
typeString = context.getString(R.string.commentedOnPR);
|
||||
typeIcon.setImageResource(R.drawable.ic_comment);
|
||||
} else if (activity.getOpType().equalsIgnoreCase("auto_merge_pull_request")) {
|
||||
|
||||
|
@ -725,7 +732,7 @@ public class DashboardAdapter extends RecyclerView.Adapter<RecyclerView.ViewHold
|
|||
+ context.getResources().getString(R.string.hash)
|
||||
+ id
|
||||
+ "</font>";
|
||||
typeString = "automatically merged pull request";
|
||||
typeString = context.getString(R.string.autoMergePR);
|
||||
typeIcon.setImageResource(R.drawable.ic_issue_closed);
|
||||
}
|
||||
} else if (activity.getOpType().contains("branch")) {
|
||||
|
@ -758,7 +765,7 @@ public class DashboardAdapter extends RecyclerView.Adapter<RecyclerView.ViewHold
|
|||
.trim()
|
||||
+ "</font>";
|
||||
|
||||
typeString = "deleted branch " + branch + " at";
|
||||
typeString = String.format(context.getString(R.string.deletedBranch), branch);
|
||||
typeIcon.setImageResource(R.drawable.ic_commit);
|
||||
}
|
||||
} else if (activity.getOpType().contains("tag")) {
|
||||
|
@ -783,7 +790,7 @@ public class DashboardAdapter extends RecyclerView.Adapter<RecyclerView.ViewHold
|
|||
.trim()
|
||||
+ "</font>";
|
||||
|
||||
typeString = "pushed tag " + branch + " to";
|
||||
typeString = String.format(context.getString(R.string.pushedTag), branch);
|
||||
typeIcon.setImageResource(R.drawable.ic_commit);
|
||||
} else if (activity.getOpType().equalsIgnoreCase("delete_tag")) {
|
||||
|
||||
|
@ -805,7 +812,7 @@ public class DashboardAdapter extends RecyclerView.Adapter<RecyclerView.ViewHold
|
|||
.trim()
|
||||
+ "</font>";
|
||||
|
||||
typeString = "deleted tag " + branch + " from";
|
||||
typeString = String.format(context.getString(R.string.deletedTag), branch);
|
||||
typeIcon.setImageResource(R.drawable.ic_commit);
|
||||
}
|
||||
} else if (activity.getOpType().contains("release")) {
|
||||
|
@ -830,7 +837,7 @@ public class DashboardAdapter extends RecyclerView.Adapter<RecyclerView.ViewHold
|
|||
.trim()
|
||||
+ "</font>";
|
||||
|
||||
typeString = "released " + branch + " at";
|
||||
typeString = String.format(context.getString(R.string.releasedBranch), branch);
|
||||
typeIcon.setImageResource(R.drawable.ic_tag);
|
||||
}
|
||||
} else if (activity.getOpType().contains("mirror")) {
|
||||
|
@ -845,7 +852,8 @@ public class DashboardAdapter extends RecyclerView.Adapter<RecyclerView.ViewHold
|
|||
+ activity.getRepo().getFullName()
|
||||
+ "</font>";
|
||||
|
||||
typeString = "synced commits to " + headerString + " at";
|
||||
typeString =
|
||||
String.format(context.getString(R.string.syncedCommits), headerString);
|
||||
typeIcon.setImageResource(R.drawable.ic_tag);
|
||||
} else if (activity.getOpType().equalsIgnoreCase("mirror_sync_create")) {
|
||||
|
||||
|
@ -857,7 +865,8 @@ public class DashboardAdapter extends RecyclerView.Adapter<RecyclerView.ViewHold
|
|||
+ activity.getRepo().getFullName()
|
||||
+ "</font>";
|
||||
|
||||
typeString = "synced new reference " + headerString + " to";
|
||||
typeString =
|
||||
String.format(context.getString(R.string.syncedRefs), headerString);
|
||||
typeIcon.setImageResource(R.drawable.ic_tag);
|
||||
} else if (activity.getOpType().equalsIgnoreCase("mirror_sync_delete")) {
|
||||
|
||||
|
@ -869,7 +878,9 @@ public class DashboardAdapter extends RecyclerView.Adapter<RecyclerView.ViewHold
|
|||
+ activity.getRepo().getFullName()
|
||||
+ "</font>";
|
||||
|
||||
typeString = "synced and deleted reference " + headerString + " at";
|
||||
typeString =
|
||||
String.format(
|
||||
context.getString(R.string.syncedDeletedRefs), headerString);
|
||||
typeIcon.setImageResource(R.drawable.ic_tag);
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -8,6 +8,7 @@ import android.view.LayoutInflater;
|
|||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
@ -41,7 +42,6 @@ public class MostVisitedReposAdapter
|
|||
private final TextView repoName;
|
||||
private final TextView orgName;
|
||||
private final TextView mostVisited;
|
||||
private final ImageView resetCounter;
|
||||
|
||||
private MostVisitedViewHolder(View itemView) {
|
||||
|
||||
|
@ -51,7 +51,7 @@ public class MostVisitedReposAdapter
|
|||
repoName = itemView.findViewById(R.id.repo_name);
|
||||
orgName = itemView.findViewById(R.id.org_name);
|
||||
mostVisited = itemView.findViewById(R.id.most_visited);
|
||||
resetCounter = itemView.findViewById(R.id.reset_counter);
|
||||
LinearLayout repoInfoEndFrame = itemView.findViewById(R.id.repo_info_end_frame);
|
||||
|
||||
itemView.setOnClickListener(
|
||||
v -> {
|
||||
|
@ -66,7 +66,7 @@ public class MostVisitedReposAdapter
|
|||
context.startActivity(intent);
|
||||
});
|
||||
|
||||
resetCounter.setOnClickListener(
|
||||
repoInfoEndFrame.setOnClickListener(
|
||||
itemDelete -> {
|
||||
MaterialAlertDialogBuilder materialAlertDialogBuilder =
|
||||
new MaterialAlertDialogBuilder(
|
||||
|
|
|
@ -62,7 +62,7 @@
|
|||
<View
|
||||
android:id="@+id/spacer_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/dimen8dp" />
|
||||
|
||||
<LinearLayout
|
||||
|
@ -71,40 +71,45 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/dimen18dp"
|
||||
android:layout_height="@dimen/dimen18dp"
|
||||
android:layout_marginStart="@dimen/dimen0dp"
|
||||
android:layout_marginEnd="@dimen/dimen6dp"
|
||||
android:contentDescription="@string/generalImgContentText"
|
||||
app:srcCompat="@drawable/ic_trending"
|
||||
app:tint="?attr/iconsColor" />
|
||||
<LinearLayout
|
||||
android:id="@+id/repo_info_counter_frame"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight=".90"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/most_visited"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="@dimen/dimen14sp"
|
||||
tools:text="@string/repoStars" />
|
||||
<ImageView
|
||||
android:layout_width="@dimen/dimen18dp"
|
||||
android:layout_height="@dimen/dimen18dp"
|
||||
android:layout_marginStart="@dimen/dimen0dp"
|
||||
android:layout_marginEnd="@dimen/dimen6dp"
|
||||
android:contentDescription="@string/generalImgContentText"
|
||||
app:srcCompat="@drawable/ic_trending"
|
||||
app:tint="?attr/iconsColor" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/most_visited"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="@dimen/dimen14sp"
|
||||
tools:text="@string/repoStars" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/repo_info_end_frame"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dimen10dp"
|
||||
android:gravity="center_vertical|end"
|
||||
android:orientation="horizontal"
|
||||
android:paddingStart="@dimen/dimen6dp"
|
||||
android:paddingEnd="@dimen/dimen0dp">
|
||||
android:layout_weight=".10"
|
||||
android:gravity="end"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/reset_counter"
|
||||
android:layout_width="@dimen/dimen18dp"
|
||||
android:layout_height="@dimen/dimen18dp"
|
||||
android:layout_marginStart="@dimen/dimen16dp"
|
||||
android:layout_marginEnd="@dimen/dimen2dp"
|
||||
android:contentDescription="@string/generalImgContentText"
|
||||
app:srcCompat="@drawable/ic_delete"
|
||||
app:tint="?attr/iconsColor" />
|
||||
|
|
|
@ -885,6 +885,31 @@
|
|||
<string name="lang_percentage" translatable="false">%s%%</string>
|
||||
|
||||
<string name="dashboard">Dashboard</string>
|
||||
<string name="createdRepository">created repository</string>
|
||||
<string name="renamedRepository">renamed repository from %1$s to</string>
|
||||
<string name="starredRepository">starred</string>
|
||||
<string name="transferredRepository">transferred repository %1$s to</string>
|
||||
<string name="createdBranch">created branch %1$s in</string>
|
||||
<string name="pushedTo">pushed to %1$s at</string>
|
||||
<string name="openedIssue">opened issue</string>
|
||||
<string name="commentedOnIssue">commented on issue</string>
|
||||
<string name="closedIssue">closed issue</string>
|
||||
<string name="reopenedIssue">reopened issue</string>
|
||||
<string name="createdPR">created pull request</string>
|
||||
<string name="closedPR">closed pull request</string>
|
||||
<string name="reopenedPR">reopened pull request</string>
|
||||
<string name="mergedPR">merged pull request</string>
|
||||
<string name="approved">approved</string>
|
||||
<string name="suggestedChanges">suggested changes for</string>
|
||||
<string name="commentedOnPR">commented on pull request</string>
|
||||
<string name="autoMergePR">automatically merged pull request</string>
|
||||
<string name="deletedBranch">deleted branch %1$s at</string>
|
||||
<string name="pushedTag">pushed tag %1$s to</string>
|
||||
<string name="deletedTag">deleted tag %1$s from</string>
|
||||
<string name="releasedBranch">released %1$s at</string>
|
||||
<string name="syncedCommits">synced commits to %1$s at</string>
|
||||
<string name="syncedRefs">synced new reference %1$s to</string>
|
||||
<string name="syncedDeletedRefs">synced and deleted reference %1$s at</string>
|
||||
|
||||
<string name="attachment">Attachment</string>
|
||||
<string name="attachments">Attachments</string>
|
||||
|
|
Loading…
Reference in New Issue