Repo settings (delete-edit) (#683)

better var names

remove migration

Merge branch 'repo-settings-delete-migrate-edit' of codeberg.org:gitnex/GitNex into repo-settings-delete-migrate-edit

delete repository

Merge branch 'master' into repo-settings-delete-migrate-edit

Can edit repo properties now

Add progress indicator, call for save

Pull repo info into dialog

Repo properties in custom dialog

settings activity with labels

Merge branch 'master' into repo-settings-delete-migrate-edit

Merge branch 'master' of codeberg.org:gitnex/GitNex into master

add bottom sheet entry

endline

Co-authored-by: M M Arif <mmarif@swatian.com>
Co-authored-by: 6543 <6543@noreply.codeberg.org>
Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/683
This commit is contained in:
M M Arif
2020-09-13 06:54:05 +02:00
parent dbf5be25a5
commit 5e6c600e71
23 changed files with 1078 additions and 67 deletions

View File

@ -0,0 +1,109 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
xmlns:android="http://schemas.android.com/apk/res/android"
android:background="?attr/primaryBackgroundColor">
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/Widget.AppCompat.SearchView">
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/primaryBackgroundColor">
<ImageView
android:id="@+id/close"
android:layout_width="@dimen/close_button_size"
android:layout_height="@dimen/close_button_size"
android:layout_marginRight="15dp"
android:layout_marginLeft="15dp"
android:gravity="center_vertical"
android:contentDescription="@string/close"
android:src="@drawable/ic_arrow_back" />
<TextView
android:id="@+id/toolbarTitle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="@string/repoSettingsTitle"
android:textColor="?attr/primaryTextColor"
android:maxLines="1"
android:textSize="20sp" />
</com.google.android.material.appbar.MaterialToolbar>
</com.google.android.material.appbar.AppBarLayout>
<ScrollView android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?attr/primaryBackgroundColor">
<LinearLayout
android:layout_width="match_parent"
android:orientation="vertical"
android:layout_height="wrap_content">
<TextView
android:id="@+id/editProperties"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="@string/repoSettingsEditProperties"
android:drawableStart="@drawable/ic_edit"
android:drawablePadding="32dp"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp"
android:padding="16dp" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="?attr/dividerColor" />
<LinearLayout
android:layout_width="match_parent"
android:orientation="vertical"
android:layout_height="wrap_content"
android:paddingBottom="16dp">
<TextView
android:id="@+id/deleteRepository"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="@string/repoSettingsDelete"
android:drawableStart="@drawable/ic_delete"
android:drawablePadding="32dp"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp"
android:paddingTop="16dp"
android:paddingStart="16dp"
android:paddingEnd="16dp" />
<TextView
android:id="@+id/deleteRepositoryHint"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="@string/repoSettingsDeleteHint"
android:textColor="?attr/hintColor"
android:textSize="12sp"
android:paddingStart="72dp"
android:paddingEnd="16dp" />
</LinearLayout>
</LinearLayout>
</ScrollView>
</LinearLayout>

View File

@ -189,6 +189,27 @@
android:textSize="16sp"
android:padding="12dp" />
<View
android:id="@+id/repoSettingsDivider"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginTop="12dp"
android:layout_marginBottom="12dp"
android:layout_marginStart="64dp"
android:background="?attr/dividerColor" />
<TextView
android:id="@+id/repoSettings"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:drawableStart="@drawable/ic_settings"
android:drawablePadding="24dp"
android:text="@string/navSettings"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp"
android:padding="12dp" />
</LinearLayout>
</androidx.core.widget.NestedScrollView>

View File

@ -0,0 +1,109 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
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">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="16dp"
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_delete"
android:drawablePadding="16dp"
android:text="@string/repoSettingsDelete"
android:layout_marginBottom="16dp" />
<TextView
android:id="@+id/description"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp"
android:text="@string/repoSettingsDeleteDescription"
android:layout_marginBottom="16dp" />
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/repoNameForDeletionLayout"
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_marginBottom="8dp"
android:hint="@string/newRepoTintCopy">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/repoNameForDeletion"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="?attr/inputTextColor"
android:textColorHighlight="?attr/hintColor"
android:textColorHint="?attr/hintColor"
android:textSize="16sp" />
</com.google.android.material.textfield.TextInputLayout>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:id="@+id/divider"
android:background="?attr/dividerColor" />
<com.google.android.material.progressindicator.ProgressIndicator
android:id="@+id/processingRequest"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone"
style="@style/Widget.MaterialComponents.ProgressIndicator.Linear.Indeterminate"
app:indicatorColor="?attr/progressIndicatorColor" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingStart="16dp"
android:paddingEnd="16dp"
android:paddingTop="4dp"
android:paddingBottom="4dp"
android:orientation="horizontal" >
<Button
android:id="@+id/cancel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="?android:attr/button"
android:layout_alignParentStart="true"
android:text="@string/cancelButton"
android:textColor="@color/colorWhite"
android:textSize="16sp" />
<Button
android:id="@+id/delete"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="?android:attr/button"
android:layout_alignParentEnd="true"
android:text="@string/menuDeleteText"
android:backgroundTint="@color/darkRed"
android:textColor="@color/colorWhite"
android:textSize="16sp"
tools:ignore="RelativeOverlap" />
</RelativeLayout>
</LinearLayout>

View File

@ -0,0 +1,231 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
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" />
<androidx.core.widget.NestedScrollView
android:id="@+id/mainView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="16dp"
android:orientation="vertical">
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/repoNameLayout"
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_marginBottom="8dp"
android:hint="@string/newRepoTintCopy">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/repoName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
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/repoWebsiteLayout"
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_marginBottom="8dp"
android:hint="@string/websiteText">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/repoWebsite"
android:layout_width="match_parent"
android:layout_height="wrap_content"
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/repoDescriptionLayout"
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:hint="@string/newRepoDescTintCopy">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/repoDescription"
android:layout_width="match_parent"
android:layout_height="wrap_content"
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.switchmaterial.SwitchMaterial
android:id="@+id/repoPrivate"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:checked="true"
android:textColor="?attr/primaryTextColor"
android:text="@string/newRepoPrivateCopy" />
<com.google.android.material.switchmaterial.SwitchMaterial
android:id="@+id/repoAsTemplate"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:checked="true"
android:textColor="?attr/primaryTextColor"
android:text="@string/repoPropertiesTemplate" />
<com.google.android.material.switchmaterial.SwitchMaterial
android:id="@+id/repoEnableIssues"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:checked="true"
android:textColor="?attr/primaryTextColor"
android:text="@string/repoPropertiesEnableIssues" />
<com.google.android.material.switchmaterial.SwitchMaterial
android:id="@+id/repoEnableWiki"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:checked="true"
android:textColor="?attr/primaryTextColor"
android:text="@string/repoPropertiesEnableWiki" />
<com.google.android.material.switchmaterial.SwitchMaterial
android:id="@+id/repoEnablePr"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:checked="true"
android:textColor="?attr/primaryTextColor"
android:text="@string/repoPropertiesEnablePr" />
<com.google.android.material.switchmaterial.SwitchMaterial
android:id="@+id/repoEnableTimer"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:checked="true"
android:textColor="?attr/primaryTextColor"
android:text="@string/repoPropertiesEnableTimeTracker" />
<com.google.android.material.switchmaterial.SwitchMaterial
android:id="@+id/repoEnableMerge"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:checked="true"
android:textColor="?attr/primaryTextColor"
android:text="@string/repoPropertiesEnableMergeCommits" />
<com.google.android.material.switchmaterial.SwitchMaterial
android:id="@+id/repoEnableRebase"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:checked="true"
android:textColor="?attr/primaryTextColor"
android:text="@string/repoPropertiesEnableRebase" />
<com.google.android.material.switchmaterial.SwitchMaterial
android:id="@+id/repoEnableSquash"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:checked="true"
android:textColor="?attr/primaryTextColor"
android:text="@string/repoPropertiesEnableSquash" />
<com.google.android.material.switchmaterial.SwitchMaterial
android:id="@+id/repoEnableForceMerge"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:checked="true"
android:textColor="?attr/primaryTextColor"
android:text="@string/repoPropertiesEnableForceMerge" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:id="@+id/divider"
android:background="?attr/dividerColor" />
<com.google.android.material.progressindicator.ProgressIndicator
android:id="@+id/processingRequest"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone"
style="@style/Widget.MaterialComponents.ProgressIndicator.Linear.Indeterminate"
app:indicatorColor="?attr/progressIndicatorColor" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingStart="16dp"
android:paddingEnd="16dp"
android:paddingTop="4dp"
android:paddingBottom="4dp"
android:orientation="horizontal" >
<Button
android:id="@+id/cancel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="?android:attr/button"
android:layout_alignParentStart="true"
android:text="@string/cancelButton"
android:textColor="@color/colorWhite"
android:textSize="16sp" />
<Button
android:id="@+id/save"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="?android:attr/button"
android:layout_alignParentEnd="true"
android:text="@string/saveButton"
android:textColor="@color/colorWhite"
android:textSize="16sp"
tools:ignore="RelativeOverlap" />
</RelativeLayout>
</LinearLayout>
</androidx.core.widget.NestedScrollView>
</LinearLayout>