mirror of
https://codeberg.org/gitnex/GitNex.git
synced 2024-12-16 15:48:13 +08:00
Add stat indicator pr/issues (#686)
Merge branch 'master' into add-stat-indicator Merge branch 'master' of codeberg.org:gitnex/GitNex into master Show PR/Issue stat Merge branch 'master' of codeberg.org:gitnex/GitNex into master Merge branch 'master' of codeberg.org:gitnex/GitNex into master endline Co-authored-by: M M Arif <mmarif@swatian.com> Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/686
This commit is contained in:
parent
2bfe0b8d1a
commit
dbf5be25a5
@ -104,6 +104,7 @@ public class IssueDetailActivity extends BaseActivity {
|
||||
private LinearLayout assigneesLayout;
|
||||
private View divider;
|
||||
private ProgressBar progressBar;
|
||||
private ImageView issuePrState;
|
||||
|
||||
@Override
|
||||
protected int getLayoutResourceId() {
|
||||
@ -145,6 +146,7 @@ public class IssueDetailActivity extends BaseActivity {
|
||||
assigneesLayout = findViewById(R.id.frameAssignees);
|
||||
divider = findViewById(R.id.divider);
|
||||
progressBar = findViewById(R.id.progressBar);
|
||||
issuePrState = findViewById(R.id.issuePrState);
|
||||
|
||||
Toolbar toolbar = findViewById(R.id.toolbar);
|
||||
TextView toolbarTitle = toolbar.findViewById(R.id.toolbar_title);
|
||||
@ -351,6 +353,27 @@ public class IssueDetailActivity extends BaseActivity {
|
||||
Issues singleIssue = response.body();
|
||||
assert singleIssue != null;
|
||||
|
||||
issuePrState.setVisibility(View.VISIBLE);
|
||||
if(singleIssue.getPull_request() != null) {
|
||||
|
||||
if(singleIssue.getPull_request().isMerged()) { // merged
|
||||
|
||||
issuePrState.setImageResource(R.drawable.ic_pull_request_merged);
|
||||
}
|
||||
else if(!singleIssue.getPull_request().isMerged() && singleIssue.getState().equals("closed")) { // closed
|
||||
|
||||
issuePrState.setImageResource(R.drawable.ic_pull_request_closed);
|
||||
}
|
||||
else { // open
|
||||
|
||||
issuePrState.setImageResource(R.drawable.ic_pull_request);
|
||||
}
|
||||
}
|
||||
else if(singleIssue.getState().equals("closed")) { // issue closed
|
||||
|
||||
issuePrState.setImageResource(R.drawable.ic_issue_closed_red);
|
||||
}
|
||||
|
||||
final Markwon markwon = Markwon.builder(Objects.requireNonNull(ctx)).usePlugin(CorePlugin.create())
|
||||
.usePlugin(ImagesPlugin.create(plugin -> {
|
||||
plugin.addSchemeHandler(new SchemeHandler() {
|
||||
|
20
app/src/main/res/drawable/ic_issue_closed_red.xml
Normal file
20
app/src/main/res/drawable/ic_issue_closed_red.xml
Normal file
@ -0,0 +1,20 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:pathData="M22,11.08V12a10,10 0,1 1,-5.93 -9.14"
|
||||
android:strokeLineJoin="round"
|
||||
android:strokeWidth="2"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="@color/iconIssuePrClosedColor"
|
||||
android:strokeLineCap="round"/>
|
||||
<path
|
||||
android:pathData="M22,4l-10,10.01l-3,-3"
|
||||
android:strokeLineJoin="round"
|
||||
android:strokeWidth="2"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="@color/iconIssuePrClosedColor"
|
||||
android:strokeLineCap="round"/>
|
||||
</vector>
|
34
app/src/main/res/drawable/ic_pull_request_closed.xml
Normal file
34
app/src/main/res/drawable/ic_pull_request_closed.xml
Normal file
@ -0,0 +1,34 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:pathData="M18,18m-3,0a3,3 0,1 1,6 0a3,3 0,1 1,-6 0"
|
||||
android:strokeLineJoin="round"
|
||||
android:strokeWidth="2"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="@color/iconIssuePrClosedColor"
|
||||
android:strokeLineCap="round"/>
|
||||
<path
|
||||
android:pathData="M6,6m-3,0a3,3 0,1 1,6 0a3,3 0,1 1,-6 0"
|
||||
android:strokeLineJoin="round"
|
||||
android:strokeWidth="2"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="@color/iconIssuePrClosedColor"
|
||||
android:strokeLineCap="round"/>
|
||||
<path
|
||||
android:pathData="M13,6h3a2,2 0,0 1,2 2v7"
|
||||
android:strokeLineJoin="round"
|
||||
android:strokeWidth="2"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="@color/iconIssuePrClosedColor"
|
||||
android:strokeLineCap="round"/>
|
||||
<path
|
||||
android:pathData="M6,9L6,21"
|
||||
android:strokeLineJoin="round"
|
||||
android:strokeWidth="2"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="@color/iconIssuePrClosedColor"
|
||||
android:strokeLineCap="round"/>
|
||||
</vector>
|
34
app/src/main/res/drawable/ic_pull_request_merged.xml
Normal file
34
app/src/main/res/drawable/ic_pull_request_merged.xml
Normal file
@ -0,0 +1,34 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:pathData="M18,18m-3,0a3,3 0,1 1,6 0a3,3 0,1 1,-6 0"
|
||||
android:strokeLineJoin="round"
|
||||
android:strokeWidth="2"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="@color/iconPrMergedColor"
|
||||
android:strokeLineCap="round"/>
|
||||
<path
|
||||
android:pathData="M6,6m-3,0a3,3 0,1 1,6 0a3,3 0,1 1,-6 0"
|
||||
android:strokeLineJoin="round"
|
||||
android:strokeWidth="2"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="@color/iconPrMergedColor"
|
||||
android:strokeLineCap="round"/>
|
||||
<path
|
||||
android:pathData="M13,6h3a2,2 0,0 1,2 2v7"
|
||||
android:strokeLineJoin="round"
|
||||
android:strokeWidth="2"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="@color/iconPrMergedColor"
|
||||
android:strokeLineCap="round"/>
|
||||
<path
|
||||
android:pathData="M6,9L6,21"
|
||||
android:strokeLineJoin="round"
|
||||
android:strokeWidth="2"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="@color/iconPrMergedColor"
|
||||
android:strokeLineCap="round"/>
|
||||
</vector>
|
@ -19,6 +19,16 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/primaryBackgroundColor">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/issuePrState"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/ic_issue"
|
||||
android:paddingStart="0dp"
|
||||
android:paddingEnd="8dp"
|
||||
android:visibility="gone"
|
||||
android:contentDescription="@string/generalImgContentText" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
|
@ -50,4 +50,7 @@
|
||||
<color name="retroThemeColorPrimary">#6200EE</color>
|
||||
<color name="retroThemeColorSecondary">#03DAC6</color>
|
||||
|
||||
<color name="iconPrMergedColor">#a333c8</color>
|
||||
<color name="iconIssuePrClosedColor">#db2828</color>
|
||||
|
||||
</resources>
|
||||
|
Loading…
Reference in New Issue
Block a user