New popup for labels/assignees (#723)

Preventing lists to store duplicate collaborators (#726)

Using login instead of id.

Merge branch 'new-popup-labels-assigness' of https://codeberg.org/gitnex/GitNex into new-popup-labels-assigness

To prevent lists storing duplicate Collaborators

Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/726

Add current logged user to list

Change to collection

Fix depricated handler calls

Change to List and better naming

Move to actions

Merge branch 'master' into new-popup-labels-assigness

Add assignees popup and remove multi select

update to view binding

add/remove labels in edit issue

remove org call

Add org members to assignees list

Add assignees adapter

Add color to labels

Refactor and add new labels popup

Clean up build libs

Co-authored-by: opyale <opyale@noreply.codeberg.org>
Co-authored-by: M M Arif <mmarif@swatian.com>
Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/723
Reviewed-by: opyale <opyale@noreply.codeberg.org>
This commit is contained in:
M M Arif
2020-10-09 17:47:52 +02:00
parent 1e30c37d7c
commit 57f0d23ef0
32 changed files with 1304 additions and 2013 deletions

View File

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?attr/primaryBackgroundColor"
tools:context=".activities.AddRemoveAssigneesActivity" />

View File

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?attr/primaryBackgroundColor"
tools:context=".activities.AddRemoveLabelsActivity" />

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
android:layout_width="match_parent"
<LinearLayout android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
xmlns:android="http://schemas.android.com/apk/res/android"
android:background="?attr/primaryBackgroundColor">
@ -55,155 +55,155 @@
android:padding="16dp"
android:orientation="vertical">
<TextView
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/newIssueTitleLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/newIssueTitle"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp" />
<EditText
android:id="@+id/newIssueTitle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:padding="10dp"
android:textSize="14sp"
tools:ignore="Autofill"
android:inputType="textCapSentences|text"
android:labelFor="@+id/newIssueTitle"
android:background="@drawable/shape_inputs"
android:textColor="?attr/inputTextColor"
app:boxBackgroundColor="?attr/inputBackgroundColor"
android:textColorHint="?attr/hintColor"
android:textColorHighlight="?attr/primaryTextColor" />
app:hintTextColor="?attr/hintColor"
app:boxStrokeErrorColor="@color/darkRed"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp"
app:endIconMode="clear_text"
app:endIconTint="?attr/iconsColor"
app:counterEnabled="true"
app:counterMaxLength="255"
app:counterTextColor="?attr/inputTextColor"
android:hint="@string/newIssueTitle">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/newIssueDescriptionTitle"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp"
android:layout_marginTop="10dp"/>
<com.hendraanggrian.appcompat.widget.SocialAutoCompleteTextView
android:id="@+id/newIssueDescription"
android:layout_width="match_parent"
android:layout_height="240dp"
android:layout_marginTop="10dp"
android:padding="10dp"
android:completionThreshold="1"
android:background="@drawable/shape_inputs"
android:maxLines="10"
android:minLines="8"
tools:ignore="Autofill"
android:labelFor="@+id/newReplyToIssue"
android:scrollbars="vertical"
android:gravity="top|start"
android:textSize="14sp"
android:inputType="textCapSentences|textMultiLine"
android:textColor="?attr/inputTextColor"
android:textColorHint="?attr/hintColor"
android:textColorHighlight="?attr/primaryTextColor" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/newIssueAssigneesListTitle"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp"
android:layout_marginTop="10dp"/>
<TextView
android:id="@+id/newIssueAssigneesList"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:padding="10dp"
android:textSize="14sp"
tools:ignore="Autofill"
android:background="@drawable/shape_inputs"
android:textColor="?attr/inputTextColor"
android:textColorHint="?attr/hintColor"
android:inputType="none"
android:textColorHighlight="?attr/primaryTextColor"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/labelsIdHolder"
android:visibility="gone" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/newIssueMilestoneTitle"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp"
android:layout_marginTop="10dp"/>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/shape_dropdown"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp" >
<Spinner
android:id="@+id/newIssueMilestoneSpinner"
android:layout_width="wrap_content"
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/newIssueTitle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:spinnerMode="dropdown"
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp"
android:paddingLeft="5dp"
android:paddingRight="5dp"
android:paddingStart="5dp" />
android:textColor="?attr/inputTextColor"
android:textColorHighlight="?attr/hintColor"
android:textColorHint="?attr/hintColor"
android:textSize="16sp" />
</RelativeLayout>
</com.google.android.material.textfield.TextInputLayout>
<TextView
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/newIssueDescriptionLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/newIssueLabelsTitle"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp"
android:layout_marginTop="10dp"/>
<TextView
android:id="@+id/newIssueLabels"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:padding="10dp"
android:textSize="14sp"
tools:ignore="Autofill"
android:background="@drawable/shape_inputs"
android:textColor="?attr/inputTextColor"
app:boxBackgroundColor="?attr/inputBackgroundColor"
android:textColorHint="?attr/hintColor"
android:inputType="none"
android:textColorHighlight="?attr/primaryTextColor"/>
app:hintTextColor="?attr/hintColor"
app:boxStrokeErrorColor="@color/darkRed"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp"
app:endIconMode="clear_text"
app:endIconTint="?attr/iconsColor"
android:hint="@string/newIssueDescriptionTitle">
<TextView
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/newIssueDescription"
android:layout_width="match_parent"
android:layout_height="140dp"
android:textColor="?attr/inputTextColor"
android:textColorHighlight="?attr/hintColor"
android:textColorHint="?attr/hintColor"
android:textSize="16sp" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/newIssueAssigneesListLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/newIssueDueDateTitle"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp"
android:layout_marginTop="10dp" />
<TextView
android:id="@+id/newIssueDueDate"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:focusable="false"
android:layout_marginTop="10dp"
android:padding="10dp"
android:textSize="14sp"
tools:ignore="Autofill"
android:background="@drawable/shape_inputs"
android:textColor="?attr/inputTextColor"
app:boxBackgroundColor="?attr/inputBackgroundColor"
android:textColorHint="?attr/hintColor"
android:textColorHighlight="?attr/primaryTextColor"/>
app:hintTextColor="?attr/hintColor"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp"
android:hint="@string/newIssueAssigneesListTitle">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/newIssueAssigneesList"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="?attr/inputTextColor"
android:textColorHighlight="?attr/hintColor"
android:textColorHint="?attr/hintColor"
android:focusable="false"
android:textSize="16sp" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/newIssueMilestoneSpinnerLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:boxBackgroundColor="?attr/inputBackgroundColor"
android:textColorHint="?attr/hintColor"
app:hintTextColor="?attr/hintColor"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp"
android:hint="@string/newIssueMilestoneTitle"
app:endIconTint="?attr/iconsColor"
style="@style/Widget.MaterialComponents.TextInputLayout.FilledBox.ExposedDropdownMenu">
<AutoCompleteTextView
android:id="@+id/newIssueMilestoneSpinner"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="none"
android:textColor="?attr/inputTextColor"
android:labelFor="@+id/newIssueMilestoneSpinner"
android:textSize="16sp" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/newIssueLabelsLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:boxBackgroundColor="?attr/inputBackgroundColor"
android:textColorHint="?attr/hintColor"
app:hintTextColor="?attr/hintColor"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp"
android:hint="@string/newIssueLabelsTitle">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/newIssueLabels"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="?attr/inputTextColor"
android:textColorHighlight="?attr/hintColor"
android:textColorHint="?attr/hintColor"
android:focusable="false"
android:textSize="16sp" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/newIssueDueDateLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:boxBackgroundColor="?attr/inputBackgroundColor"
android:textColorHint="?attr/hintColor"
app:hintTextColor="?attr/hintColor"
app:boxStrokeErrorColor="@color/darkRed"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp"
app:endIconMode="clear_text"
app:endIconTint="?attr/iconsColor"
android:hint="@string/newIssueDueDateTitle">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/newIssueDueDate"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="?attr/inputTextColor"
android:textColorHighlight="?attr/hintColor"
android:textColorHint="?attr/hintColor"
android:maxLines="1"
android:focusable="false"
android:textSize="16sp" />
</com.google.android.material.textfield.TextInputLayout>
<Button
android:id="@+id/createNewIssueButton"

View File

@ -81,22 +81,6 @@
</RelativeLayout>
<LinearLayout
android:visibility="gone"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/info"
android:layout_width="28dp"
android:layout_height="28dp"
android:src="@drawable/ic_info"
android:layout_marginStart="120dp"
android:layout_marginTop="10dp"
android:contentDescription="@string/urlInfoTooltip" />
</LinearLayout>
<EditText
android:id="@+id/instance_url"
android:layout_width="match_parent"

View File

@ -0,0 +1,46 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/layoutFrame"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="vertical">
<CheckBox
android:id="@+id/assigneesSelection"
android:layout_width="match_parent"
android:layout_height="36dp"
android:checked="false"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp" />
<androidx.cardview.widget.CardView
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_marginTop="8dp"
android:layout_marginStart="36dp"
android:layout_marginEnd="4dp"
app:cardElevation="0dp"
app:cardCornerRadius="4dp">
<ImageView
android:id="@+id/assigneesAvatar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:contentDescription="@string/generalImgContentText" />
</androidx.cardview.widget.CardView>
<TextView
android:id="@+id/assigneesName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="8dp"
android:paddingStart="64dp"
android:paddingEnd="4dp"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp" />
</RelativeLayout>

View File

@ -0,0 +1,101 @@
<?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="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="@drawable/shape_custom_dialog"
android:orientation="vertical">
<com.google.android.material.progressindicator.ProgressIndicator
android:id="@+id/progressBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/Widget.MaterialComponents.ProgressIndicator.Linear.Indeterminate"
app:indicatorColor="?attr/progressIndicatorColor" />
<LinearLayout
android:id="@+id/dialogFrame"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="16dp"
android:id="@+id/TitleFrame"
android:orientation="vertical">
<TextView
android:id="@+id/title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="?attr/primaryTextColor"
android:textSize="20sp"
android:textStyle="bold"
android:drawableStart="@drawable/ic_person_add"
android:drawablePadding="16dp"
android:text="@string/newIssueSelectAssigneesListTitle" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:id="@+id/dividerTitle"
android:background="?attr/dividerColor" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="100"
android:layout_margin="12dp"
android:orientation="vertical">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/assigneesRecyclerView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:id="@+id/divider"
android:background="?attr/dividerColor" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingStart="16dp"
android:paddingEnd="16dp"
android:paddingTop="8dp"
android:paddingBottom="8dp"
android:orientation="vertical" >
<Button
android:id="@+id/cancel"
android:layout_width="wrap_content"
android:layout_height="60dp"
style="?android:attr/button"
android:layout_alignParentStart="true"
android:text="@string/close"
android:textColor="@color/colorWhite"
android:textSize="16sp" />
</RelativeLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/layoutFrame"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@ -10,10 +10,37 @@
<CheckBox
android:id="@+id/labelSelection"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="36dp"
android:checked="false"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp" />
<androidx.cardview.widget.CardView
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_marginTop="8dp"
android:layout_marginStart="36dp"
android:layout_marginEnd="4dp"
app:cardElevation="0dp"
app:cardCornerRadius="4dp">
<ImageView
android:id="@+id/labelColor"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:contentDescription="@string/generalImgContentText" />
</androidx.cardview.widget.CardView>
<TextView
android:id="@+id/labelText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="8dp"
android:paddingStart="64dp"
android:paddingEnd="4dp"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp" />
</RelativeLayout>

View File

@ -1,116 +0,0 @@
<?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:padding="10dp"
android:background="?attr/primaryBackgroundColor"
android:orientation="vertical">
<TextView
android:id="@+id/title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/select_entry"
android:textColor="?attr/primaryTextColor"
android:textSize="24sp" />
<androidx.appcompat.widget.SearchView
android:id="@+id/search_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:layout_marginTop="5dp"
android:iconifiedByDefault="true"
android:queryHint="Search" />
<LinearLayout
android:id="@+id/select_all_container"
android:visibility="gone"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:background="@color/colorPrimary"
android:orientation="horizontal">
<androidx.appcompat.widget.AppCompatCheckBox
android:id="@+id/select_all_checkbox"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:textColor="?attr/primaryTextColor"
android:clickable="false" />
<TextView
android:textAllCaps="true"
android:id="@+id/select_all_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginEnd="10dp"
android:layout_marginStart="10dp"
android:textSize="18sp"
android:textColor="?attr/primaryTextColor"
android:text="@string/select_all"/>
</LinearLayout>
<View
android:layout_marginTop="10dp"
android:layout_marginBottom="5dp"
android:layout_marginStart="40dp"
android:layout_marginEnd="40dp"
android:layout_width="match_parent"
android:layout_height="0.1dp"
android:visibility="gone"
android:background="?attr/primaryBackgroundColor"/>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
<view
android:id="@+id/recycler_view"
class="org.mian.gitnex.helpers.RecyclerViewEmptySupport"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<TextView
android:id="@+id/list_empty1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:text="@string/noDataFound"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp" />
</FrameLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<Button
android:id="@+id/cancel"
style="@style/Widget.MaterialComponents.Button.OutlinedButton"
android:textColor="@color/darkGreen"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/cancelButton" />
<Space
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
<Button
android:id="@+id/done"
style="@style/Widget.MaterialComponents.Button.OutlinedButton"
android:textColor="@color/darkRed"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/doneButton" />
</LinearLayout>
</LinearLayout>

View File

@ -1,28 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/main_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:background="?attr/primaryBackgroundColor"
android:orientation="horizontal">
<androidx.appcompat.widget.AppCompatCheckBox
android:id="@+id/dialog_item_checkbox"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:textColor="?attr/primaryTextColor"
android:clickable="false" />
<TextView
android:id="@+id/dialog_item_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginEnd="10dp"
android:layout_marginStart="10dp"
android:textColor="?attr/primaryTextColor"
android:textSize="18sp" />
</LinearLayout>