mirror of https://codeberg.org/gitnex/GitNex.git
Redesign create repo screen, add default branch, issue labels and license options
This commit is contained in:
parent
87d325fd79
commit
758ee59a44
|
@ -104,7 +104,8 @@
|
|||
android:theme="@android:style/Theme.NoTitleBar"/>
|
||||
<activity
|
||||
android:name=".activities.CreateRepoActivity"
|
||||
android:configChanges="orientation|screenSize|smallestScreenSize|density|screenLayout|keyboard|keyboardHidden|navigation"/>
|
||||
android:configChanges="orientation|screenSize|smallestScreenSize|density|screenLayout|keyboard|keyboardHidden|navigation"
|
||||
android:windowSoftInputMode="adjustResize"/>
|
||||
<activity
|
||||
android:name=".activities.CreateOrganizationActivity"
|
||||
android:configChanges="orientation|screenSize|smallestScreenSize|density|screenLayout|keyboard|keyboardHidden|navigation"/>
|
||||
|
@ -148,7 +149,8 @@
|
|||
android:configChanges="orientation|screenSize|smallestScreenSize|density|screenLayout|keyboard|keyboardHidden|navigation"/>
|
||||
<activity
|
||||
android:name=".activities.CreatePullRequestActivity"
|
||||
android:configChanges="orientation|screenSize|smallestScreenSize|density|screenLayout|keyboard|keyboardHidden|navigation"/>
|
||||
android:configChanges="orientation|screenSize|smallestScreenSize|density|screenLayout|keyboard|keyboardHidden|navigation"
|
||||
android:windowSoftInputMode="adjustResize"/>
|
||||
<activity
|
||||
android:name=".activities.SettingsGeneralActivity"
|
||||
android:configChanges="orientation|screenSize|smallestScreenSize|density|screenLayout|keyboard|keyboardHidden|navigation"/>
|
||||
|
@ -168,7 +170,7 @@
|
|||
<activity
|
||||
android:name=".activities.CreateNoteActivity"
|
||||
android:configChanges="orientation|screenSize|smallestScreenSize|density|screenLayout|keyboard|keyboardHidden|navigation"
|
||||
android:windowSoftInputMode="adjustResize" />
|
||||
android:windowSoftInputMode="adjustResize"/>
|
||||
|
||||
<meta-data
|
||||
android:name="com.samsung.android.keepalive.density"
|
||||
|
|
|
@ -1,22 +1,16 @@
|
|||
package org.mian.gitnex.activities;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.view.inputmethod.InputMethodManager;
|
||||
import android.view.MenuItem;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.AutoCompleteTextView;
|
||||
import android.widget.Button;
|
||||
import android.widget.CheckBox;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageView;
|
||||
import androidx.annotation.NonNull;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.regex.Pattern;
|
||||
import org.gitnex.tea4j.v2.models.CreateRepoOption;
|
||||
import org.gitnex.tea4j.v2.models.Organization;
|
||||
|
@ -26,7 +20,7 @@ import org.mian.gitnex.clients.RetrofitClient;
|
|||
import org.mian.gitnex.databinding.ActivityCreateRepoBinding;
|
||||
import org.mian.gitnex.helpers.AlertDialogs;
|
||||
import org.mian.gitnex.helpers.AppUtil;
|
||||
import org.mian.gitnex.helpers.Toasty;
|
||||
import org.mian.gitnex.helpers.SnackBar;
|
||||
import retrofit2.Call;
|
||||
import retrofit2.Callback;
|
||||
|
||||
|
@ -38,103 +32,121 @@ public class CreateRepoActivity extends BaseActivity {
|
|||
// https://github.com/go-gitea/gitea/blob/52cfd2743c0e85b36081cf80a850e6a5901f1865/models/repo.go#L964-L967
|
||||
final List<String> reservedRepoNames = Arrays.asList(".", "..");
|
||||
final Pattern reservedRepoPatterns = Pattern.compile("\\.(git|wiki)$");
|
||||
public ImageView closeActivity;
|
||||
List<String> organizationsList = new ArrayList<>();
|
||||
private View.OnClickListener onClickListener;
|
||||
private AutoCompleteTextView spinner;
|
||||
private Button createRepo;
|
||||
private EditText repoName;
|
||||
private EditText repoDesc;
|
||||
private CheckBox repoAccess;
|
||||
List<String> issueLabelsList = new ArrayList<>();
|
||||
List<String> licenseList = new ArrayList<>();
|
||||
private ActivityCreateRepoBinding activityCreateRepoBinding;
|
||||
private String loginUid;
|
||||
private String selectedOwner;
|
||||
private final View.OnClickListener createRepoListener = v -> processNewRepo();
|
||||
private String selectedIssueLabels;
|
||||
private String selectedLicense;
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
ActivityCreateRepoBinding activityCreateRepoBinding =
|
||||
ActivityCreateRepoBinding.inflate(getLayoutInflater());
|
||||
activityCreateRepoBinding = ActivityCreateRepoBinding.inflate(getLayoutInflater());
|
||||
setContentView(activityCreateRepoBinding.getRoot());
|
||||
|
||||
boolean connToInternet = AppUtil.hasNetworkConnection(ctx);
|
||||
|
||||
loginUid = getAccount().getAccount().getUserName();
|
||||
|
||||
InputMethodManager imm =
|
||||
(InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||
|
||||
closeActivity = activityCreateRepoBinding.close;
|
||||
repoName = activityCreateRepoBinding.newRepoName;
|
||||
repoDesc = activityCreateRepoBinding.newRepoDescription;
|
||||
repoAccess = activityCreateRepoBinding.newRepoPrivate;
|
||||
|
||||
repoName.requestFocus();
|
||||
assert imm != null;
|
||||
imm.showSoftInput(repoName, InputMethodManager.SHOW_IMPLICIT);
|
||||
|
||||
initCloseListener();
|
||||
closeActivity.setOnClickListener(onClickListener);
|
||||
|
||||
spinner = activityCreateRepoBinding.ownerSpinner;
|
||||
getOrganizations(loginUid);
|
||||
|
||||
createRepo = activityCreateRepoBinding.createNewRepoButton;
|
||||
disableProcessButton();
|
||||
activityCreateRepoBinding.topAppBar.setNavigationOnClickListener(v -> finish());
|
||||
|
||||
if (!connToInternet) {
|
||||
MenuItem attachment = activityCreateRepoBinding.topAppBar.getMenu().getItem(0);
|
||||
attachment.setVisible(false);
|
||||
MenuItem markdown = activityCreateRepoBinding.topAppBar.getMenu().getItem(1);
|
||||
markdown.setVisible(false);
|
||||
|
||||
disableProcessButton();
|
||||
} else {
|
||||
String[] licenses = getResources().getStringArray(R.array.licenses);
|
||||
Collections.addAll(licenseList, licenses);
|
||||
getLicenses();
|
||||
|
||||
createRepo.setOnClickListener(createRepoListener);
|
||||
}
|
||||
issueLabelsList.add(getString(R.string.advanced));
|
||||
issueLabelsList.add(getString(R.string.defaultText));
|
||||
getIssueLabels();
|
||||
|
||||
activityCreateRepoBinding.topAppBar.setOnMenuItemClickListener(
|
||||
menuItem -> {
|
||||
int id = menuItem.getItemId();
|
||||
|
||||
if (id == R.id.create) {
|
||||
processNewRepo();
|
||||
return true;
|
||||
} else {
|
||||
return super.onOptionsItemSelected(menuItem);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void processNewRepo() {
|
||||
|
||||
boolean connToInternet = AppUtil.hasNetworkConnection(appCtx);
|
||||
|
||||
String newRepoName = repoName.getText().toString();
|
||||
String newRepoDesc = repoDesc.getText().toString();
|
||||
boolean newRepoAccess = repoAccess.isChecked();
|
||||
|
||||
if (!connToInternet) {
|
||||
|
||||
Toasty.error(ctx, getResources().getString(R.string.checkNetConnection));
|
||||
return;
|
||||
}
|
||||
String newRepoName =
|
||||
Objects.requireNonNull(activityCreateRepoBinding.newRepoName.getText()).toString();
|
||||
String newRepoDesc =
|
||||
Objects.requireNonNull(activityCreateRepoBinding.newRepoDescription.getText())
|
||||
.toString();
|
||||
boolean newRepoAccess = activityCreateRepoBinding.newRepoPrivate.isChecked();
|
||||
boolean repoAsTemplate = activityCreateRepoBinding.setAsTemplate.isChecked();
|
||||
String defaultBranch =
|
||||
Objects.requireNonNull(activityCreateRepoBinding.defaultBranch.getText())
|
||||
.toString();
|
||||
|
||||
if (!newRepoDesc.equals("")) {
|
||||
|
||||
if (newRepoDesc.length() > 255) {
|
||||
|
||||
Toasty.warning(ctx, getString(R.string.repoDescError));
|
||||
SnackBar.error(
|
||||
ctx, findViewById(android.R.id.content), getString(R.string.repoDescError));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (newRepoName.equals("")) {
|
||||
|
||||
Toasty.error(ctx, getString(R.string.repoNameErrorEmpty));
|
||||
SnackBar.error(
|
||||
ctx,
|
||||
findViewById(android.R.id.content),
|
||||
getString(R.string.repoNameErrorEmpty));
|
||||
} else if (!AppUtil.checkStrings(newRepoName)) {
|
||||
|
||||
Toasty.warning(ctx, getString(R.string.repoNameErrorInvalid));
|
||||
SnackBar.error(
|
||||
ctx,
|
||||
findViewById(android.R.id.content),
|
||||
getString(R.string.repoNameErrorInvalid));
|
||||
} else if (reservedRepoNames.contains(newRepoName)) {
|
||||
|
||||
Toasty.warning(ctx, getString(R.string.repoNameErrorReservedName));
|
||||
SnackBar.error(
|
||||
ctx,
|
||||
findViewById(android.R.id.content),
|
||||
getString(R.string.repoNameErrorReservedName));
|
||||
} else if (reservedRepoPatterns.matcher(newRepoName).find()) {
|
||||
|
||||
Toasty.warning(ctx, getString(R.string.repoNameErrorReservedPatterns));
|
||||
SnackBar.error(
|
||||
ctx,
|
||||
findViewById(android.R.id.content),
|
||||
getString(R.string.repoNameErrorReservedPatterns));
|
||||
} else if (defaultBranch.equalsIgnoreCase("")) {
|
||||
|
||||
SnackBar.error(
|
||||
ctx,
|
||||
findViewById(android.R.id.content),
|
||||
getString(R.string.repoDefaultBranchError));
|
||||
} else if (selectedOwner == null) {
|
||||
|
||||
Toasty.error(ctx, getString(R.string.repoOwnerError));
|
||||
SnackBar.error(
|
||||
ctx, findViewById(android.R.id.content), getString(R.string.repoOwnerError));
|
||||
} else {
|
||||
|
||||
disableProcessButton();
|
||||
createNewRepository(loginUid, newRepoName, newRepoDesc, selectedOwner, newRepoAccess);
|
||||
createNewRepository(
|
||||
loginUid,
|
||||
newRepoName,
|
||||
newRepoDesc,
|
||||
selectedOwner,
|
||||
newRepoAccess,
|
||||
defaultBranch,
|
||||
repoAsTemplate);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -143,7 +155,9 @@ public class CreateRepoActivity extends BaseActivity {
|
|||
String repoName,
|
||||
String repoDesc,
|
||||
String selectedOwner,
|
||||
boolean isPrivate) {
|
||||
boolean isPrivate,
|
||||
String defaultBranch,
|
||||
boolean repoAsTemplate) {
|
||||
|
||||
CreateRepoOption createRepository = new CreateRepoOption();
|
||||
createRepository.setAutoInit(true);
|
||||
|
@ -151,6 +165,10 @@ public class CreateRepoActivity extends BaseActivity {
|
|||
createRepository.setPrivate(isPrivate);
|
||||
createRepository.setReadme("Default");
|
||||
createRepository.setName(repoName);
|
||||
createRepository.setDefaultBranch(defaultBranch);
|
||||
createRepository.setIssueLabels(selectedIssueLabels);
|
||||
createRepository.setTemplate(repoAsTemplate);
|
||||
createRepository.setLicense(selectedLicense);
|
||||
|
||||
Call<Repository> call;
|
||||
if (selectedOwner.equals(loginUid)) {
|
||||
|
@ -164,7 +182,7 @@ public class CreateRepoActivity extends BaseActivity {
|
|||
}
|
||||
|
||||
call.enqueue(
|
||||
new Callback<Repository>() {
|
||||
new Callback<>() {
|
||||
|
||||
@Override
|
||||
public void onResponse(
|
||||
|
@ -175,40 +193,68 @@ public class CreateRepoActivity extends BaseActivity {
|
|||
|
||||
MainActivity.reloadRepos = true;
|
||||
OrganizationDetailActivity.updateOrgFABActions = true;
|
||||
Toasty.success(ctx, getString(R.string.repoCreated));
|
||||
enableProcessButton();
|
||||
finish();
|
||||
|
||||
SnackBar.success(
|
||||
ctx,
|
||||
findViewById(android.R.id.content),
|
||||
getString(R.string.repoCreated));
|
||||
|
||||
new Handler().postDelayed(() -> finish(), 3000);
|
||||
} else if (response.code() == 401) {
|
||||
|
||||
enableProcessButton();
|
||||
AlertDialogs.authorizationTokenRevokedDialog(ctx);
|
||||
} else if (response.code() == 409) {
|
||||
|
||||
enableProcessButton();
|
||||
Toasty.warning(ctx, getString(R.string.repoExistsError));
|
||||
SnackBar.error(
|
||||
ctx,
|
||||
findViewById(android.R.id.content),
|
||||
getString(R.string.repoExistsError));
|
||||
} else {
|
||||
|
||||
enableProcessButton();
|
||||
Toasty.error(ctx, getString(R.string.genericError));
|
||||
SnackBar.error(
|
||||
ctx,
|
||||
findViewById(android.R.id.content),
|
||||
getString(R.string.genericError));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(@NonNull Call<Repository> call, @NonNull Throwable t) {
|
||||
|
||||
Log.e("onFailure", t.toString());
|
||||
enableProcessButton();
|
||||
}
|
||||
public void onFailure(@NonNull Call<Repository> call, @NonNull Throwable t) {}
|
||||
});
|
||||
}
|
||||
|
||||
private void getIssueLabels() {
|
||||
|
||||
ArrayAdapter<String> adapter =
|
||||
new ArrayAdapter<>(
|
||||
CreateRepoActivity.this, R.layout.list_spinner_items, issueLabelsList);
|
||||
|
||||
activityCreateRepoBinding.issueLabels.setAdapter(adapter);
|
||||
|
||||
activityCreateRepoBinding.issueLabels.setOnItemClickListener(
|
||||
(parent, view, position, id) ->
|
||||
selectedIssueLabels = issueLabelsList.get(position));
|
||||
}
|
||||
|
||||
private void getLicenses() {
|
||||
|
||||
ArrayAdapter<String> adapter =
|
||||
new ArrayAdapter<>(
|
||||
CreateRepoActivity.this, R.layout.list_spinner_items, licenseList);
|
||||
|
||||
activityCreateRepoBinding.licenses.setAdapter(adapter);
|
||||
|
||||
activityCreateRepoBinding.licenses.setOnItemClickListener(
|
||||
(parent, view, position, id) -> selectedLicense = licenseList.get(position));
|
||||
}
|
||||
|
||||
private void getOrganizations(final String userLogin) {
|
||||
|
||||
Call<List<Organization>> call =
|
||||
RetrofitClient.getApiInterface(ctx).orgListCurrentUserOrgs(1, 50);
|
||||
|
||||
call.enqueue(
|
||||
new Callback<List<Organization>>() {
|
||||
new Callback<>() {
|
||||
|
||||
@Override
|
||||
public void onResponse(
|
||||
|
@ -247,9 +293,9 @@ public class CreateRepoActivity extends BaseActivity {
|
|||
R.layout.list_spinner_items,
|
||||
organizationsList);
|
||||
|
||||
spinner.setAdapter(adapter);
|
||||
activityCreateRepoBinding.ownerSpinner.setAdapter(adapter);
|
||||
|
||||
spinner.setOnItemClickListener(
|
||||
activityCreateRepoBinding.ownerSpinner.setOnItemClickListener(
|
||||
(parent, view, position, id) ->
|
||||
selectedOwner = organizationsList.get(position));
|
||||
|
||||
|
@ -260,7 +306,7 @@ public class CreateRepoActivity extends BaseActivity {
|
|||
new Handler(Looper.getMainLooper())
|
||||
.postDelayed(
|
||||
() -> {
|
||||
spinner.setText(
|
||||
activityCreateRepoBinding.ownerSpinner.setText(
|
||||
organizationsList.get(selectOwnerById),
|
||||
false);
|
||||
selectedOwner =
|
||||
|
@ -270,36 +316,15 @@ public class CreateRepoActivity extends BaseActivity {
|
|||
getIntent().removeExtra("organizationAction");
|
||||
}
|
||||
|
||||
enableProcessButton();
|
||||
} else if (response.code() == 401) {
|
||||
|
||||
enableProcessButton();
|
||||
AlertDialogs.authorizationTokenRevokedDialog(ctx);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(
|
||||
@NonNull Call<List<Organization>> call, @NonNull Throwable t) {
|
||||
|
||||
Log.e("onFailure", t.toString());
|
||||
enableProcessButton();
|
||||
}
|
||||
@NonNull Call<List<Organization>> call, @NonNull Throwable t) {}
|
||||
});
|
||||
}
|
||||
|
||||
private void initCloseListener() {
|
||||
|
||||
onClickListener = view -> finish();
|
||||
}
|
||||
|
||||
private void disableProcessButton() {
|
||||
|
||||
createRepo.setEnabled(false);
|
||||
}
|
||||
|
||||
private void enableProcessButton() {
|
||||
|
||||
createRepo.setEnabled(true);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,55 +1,43 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
<androidx.coordinatorlayout.widget.CoordinatorLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/primaryBackgroundColor"
|
||||
android:orientation="vertical">
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:id="@+id/appbar"
|
||||
android:id="@+id/appBarLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:theme="@style/Widget.AppCompat.SearchView"
|
||||
app:elevation="@dimen/dimen0dp">
|
||||
android:background="?attr/primaryBackgroundColor"
|
||||
android:fitsSystemWindows="true">
|
||||
|
||||
<com.google.android.material.appbar.MaterialToolbar
|
||||
android:id="@+id/toolbar"
|
||||
<com.google.android.material.appbar.CollapsingToolbarLayout
|
||||
style="?attr/collapsingToolbarLayoutLargeStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:background="?attr/primaryBackgroundColor">
|
||||
app:layout_scrollFlags="scroll|exitUntilCollapsed|snap"
|
||||
app:contentScrim="?attr/primaryBackgroundColor"
|
||||
android:layout_height="?attr/collapsingToolbarLayoutLargeSize">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/close"
|
||||
android:layout_width="@dimen/dimen26dp"
|
||||
android:layout_height="@dimen/dimen26dp"
|
||||
android:layout_marginStart="@dimen/dimen16dp"
|
||||
android:layout_marginEnd="@dimen/dimen16dp"
|
||||
android:background="?android:attr/selectableItemBackgroundBorderless"
|
||||
android:clickable="true"
|
||||
android:contentDescription="@string/close"
|
||||
android:focusable="true"
|
||||
android:gravity="center_vertical"
|
||||
android:src="@drawable/ic_close"/>
|
||||
<com.google.android.material.appbar.MaterialToolbar
|
||||
android:id="@+id/topAppBar"
|
||||
android:layout_width="match_parent"
|
||||
android:elevation="0dp"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
app:title="@string/pageTitleNewRepo"
|
||||
app:layout_collapseMode="pin"
|
||||
app:menu="@menu/create_issue_menu"
|
||||
app:navigationIcon="@drawable/ic_close" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/toolbar_title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:maxLines="1"
|
||||
android:text="@string/pageTitleNewRepo"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="@dimen/dimen20sp"/>
|
||||
|
||||
</com.google.android.material.appbar.MaterialToolbar>
|
||||
</com.google.android.material.appbar.CollapsingToolbarLayout>
|
||||
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
<ScrollView
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/primaryBackgroundColor">
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
|
@ -66,7 +54,6 @@
|
|||
android:layout_marginBottom="@dimen/dimen8dp"
|
||||
android:hint="@string/newRepoOwner"
|
||||
android:textColorHint="?attr/hintColor"
|
||||
app:boxBackgroundColor="?attr/inputBackgroundColor"
|
||||
app:endIconTint="?attr/iconsColor"
|
||||
app:hintTextColor="?attr/hintColor">
|
||||
|
||||
|
@ -77,7 +64,7 @@
|
|||
android:inputType="none"
|
||||
android:labelFor="@+id/ownerSpinner"
|
||||
android:textColor="?attr/inputTextColor"
|
||||
android:textSize="@dimen/dimen16sp"/>
|
||||
android:textSize="@dimen/dimen16sp" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
|
@ -89,7 +76,6 @@
|
|||
android:layout_marginBottom="@dimen/dimen8dp"
|
||||
android:hint="@string/newRepoTintCopy"
|
||||
android:textColorHint="?attr/hintColor"
|
||||
app:boxBackgroundColor="?attr/inputBackgroundColor"
|
||||
app:boxStrokeErrorColor="@color/darkRed"
|
||||
app:endIconMode="clear_text"
|
||||
app:endIconTint="?attr/iconsColor"
|
||||
|
@ -107,6 +93,55 @@
|
|||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/defaultBranchFrame"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dimen8dp"
|
||||
android:layout_marginBottom="@dimen/dimen8dp"
|
||||
android:hint="@string/infoTabRepoDefaultBranch"
|
||||
android:textColorHint="?attr/hintColor"
|
||||
app:boxStrokeErrorColor="@color/darkRed"
|
||||
app:endIconMode="clear_text"
|
||||
app:endIconTint="?attr/iconsColor"
|
||||
app:hintTextColor="?attr/hintColor">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/defaultBranch"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:inputType="textCapSentences"
|
||||
android:textColor="?attr/inputTextColor"
|
||||
android:textColorHighlight="?attr/hintColor"
|
||||
android:textColorHint="?attr/hintColor"
|
||||
android:text="@string/main"
|
||||
android:textSize="@dimen/dimen16sp" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/issueLabelsFrame"
|
||||
style="@style/Widget.Material3.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dimen8dp"
|
||||
android:layout_marginBottom="@dimen/dimen8dp"
|
||||
android:hint="@string/newRepoIssueLabels"
|
||||
android:textColorHint="?attr/hintColor"
|
||||
app:endIconTint="?attr/iconsColor"
|
||||
app:hintTextColor="?attr/hintColor">
|
||||
|
||||
<AutoCompleteTextView
|
||||
android:id="@+id/issueLabels"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:inputType="none"
|
||||
android:labelFor="@+id/issueLabels"
|
||||
android:textColor="?attr/inputTextColor"
|
||||
android:textSize="@dimen/dimen16sp" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/newRepoDescriptionLayout"
|
||||
android:layout_width="match_parent"
|
||||
|
@ -115,7 +150,6 @@
|
|||
android:layout_marginBottom="@dimen/dimen8dp"
|
||||
android:hint="@string/newRepoDescTintCopy"
|
||||
android:textColorHint="?attr/hintColor"
|
||||
app:boxBackgroundColor="?attr/inputBackgroundColor"
|
||||
app:boxStrokeErrorColor="@color/darkRed"
|
||||
app:counterEnabled="true"
|
||||
app:counterMaxLength="255"
|
||||
|
@ -137,6 +171,29 @@
|
|||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/licenseFrame"
|
||||
style="@style/Widget.Material3.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dimen8dp"
|
||||
android:layout_marginBottom="@dimen/dimen8dp"
|
||||
android:hint="@string/license"
|
||||
android:textColorHint="?attr/hintColor"
|
||||
app:endIconTint="?attr/iconsColor"
|
||||
app:hintTextColor="?attr/hintColor">
|
||||
|
||||
<AutoCompleteTextView
|
||||
android:id="@+id/licenses"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:inputType="none"
|
||||
android:labelFor="@+id/licenses"
|
||||
android:textColor="?attr/inputTextColor"
|
||||
android:textSize="@dimen/dimen16sp" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/newRepoPrivate"
|
||||
android:layout_width="match_parent"
|
||||
|
@ -147,17 +204,18 @@
|
|||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="@dimen/dimen16sp" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/createNewRepoButton"
|
||||
<CheckBox
|
||||
android:id="@+id/setAsTemplate"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dimen54dp"
|
||||
android:layout_marginTop="@dimen/dimen8dp"
|
||||
android:text="@string/newCreateButtonCopy"
|
||||
android:textColor="?attr/materialCardBackgroundColor"
|
||||
android:textStyle="bold"/>
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dimen10dp"
|
||||
android:checked="false"
|
||||
android:text="@string/setAsTemplate"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="@dimen/dimen16sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</ScrollView>
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
|
||||
</LinearLayout>
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
|
|
|
@ -204,6 +204,15 @@
|
|||
app:icon="@drawable/ic_watchers"
|
||||
android:text="@string/repoStars" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/repoAdditionalButton"
|
||||
style="?attr/materialButtonToggleGroupStyle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="@dimen/dimen12sp"
|
||||
app:icon="@drawable/ic_info"
|
||||
android:text="@string/infoMoreInformation" />
|
||||
|
||||
</com.google.android.material.button.MaterialButtonToggleGroup>
|
||||
|
||||
</LinearLayout>
|
||||
|
@ -366,16 +375,6 @@
|
|||
|
||||
</LinearLayout>
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/repoAdditionalButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dimen54dp"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="@dimen/dimen6dp"
|
||||
android:layout_marginBottom="@dimen/dimen20dp"
|
||||
android:text="@string/infoShowMoreInformation"
|
||||
android:textColor="?attr/materialCardBackgroundColor"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
|
|
@ -118,4 +118,184 @@
|
|||
<item>@string/zoomOut</item>
|
||||
<item>@string/none</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="licenses">
|
||||
<item>0BSD</item>
|
||||
<item>AAL</item>
|
||||
<item>ADSL</item>
|
||||
<item>AFL-1.1</item>
|
||||
<item>AFL-1.1</item>
|
||||
<item>AFL-2.0</item>
|
||||
<item>AFL-3.0</item>
|
||||
<item>AGPL-1.0-only</item>
|
||||
<item>AGPL-1.0-or-later</item>
|
||||
<item>AGPL-3.0-only</item>
|
||||
<item>AGPL-3.0-or-later</item>
|
||||
<item>AML</item>
|
||||
<item>APL-1.0</item>
|
||||
<item>APSL-1.0</item>
|
||||
<item>APSL-2.0</item>
|
||||
<item>Adobe-2006</item>
|
||||
<item>Aladdin</item>
|
||||
<item>Apache-1.0</item>
|
||||
<item>Apache-1.1</item>
|
||||
<item>Apache-2.0</item>
|
||||
<item>Artistic-1.0</item>
|
||||
<item>Artistic-2.0</item>
|
||||
<item>BSD-1-Clause</item>
|
||||
<item>BSD-2-Clause</item>
|
||||
<item>BSD-2-Clause-Patent</item>
|
||||
<item>BSD-2-Clause-Views</item>
|
||||
<item>BSD-3-Clause</item>
|
||||
<item>BSD-3-Clause-Attribution</item>
|
||||
<item>BSD-3-Clause-Clear</item>
|
||||
<item>BSD-3-Clause-LBNL</item>
|
||||
<item>BSD-3-Clause-Modification</item>
|
||||
<item>BSD-3-Clause-No-Military-License</item>
|
||||
<item>BSD-3-Clause-No-Nuclear-License</item>
|
||||
<item>BSD-3-Clause-No-Nuclear-License-2014</item>
|
||||
<item>BSD-3-Clause-No-Nuclear-Warranty</item>
|
||||
<item>BSD-3-Clause-Open-MPI</item>
|
||||
<item>BSD-3-Clause-Sun</item>
|
||||
<item>BSD-4-Clause-Shortened</item>
|
||||
<item>BSD-4-Clause-UC</item>
|
||||
<item>BSD-4.3RENO</item>
|
||||
<item>BSD-4.3TAHOE</item>
|
||||
<item>BSD-Advertising-Acknowledgement</item>
|
||||
<item>BSD-Attribution-HPND-disclaimer</item>
|
||||
<item>BSD-Protection</item>
|
||||
<item>BSD-Source-Code</item>
|
||||
<item>BSD-Systemics</item>
|
||||
<item>BitTorrent-1.0</item>
|
||||
<item>BitTorrent-1.1</item>
|
||||
<item>CC-BY-1.0</item>
|
||||
<item>CC-BY-2.0</item>
|
||||
<item>CC-BY-2.5</item>
|
||||
<item>CC-BY-2.5-AU</item>
|
||||
<item>CC-BY-3.0</item>
|
||||
<item>CC-BY-3.0-AT</item>
|
||||
<item>CC-BY-3.0-DE</item>
|
||||
<item>CC-BY-4.0</item>
|
||||
<item>CC-BY-NC-1.0</item>
|
||||
<item>CC-BY-NC-2.0</item>
|
||||
<item>CC-BY-NC-2.5</item>
|
||||
<item>CC-BY-NC-3.0</item>
|
||||
<item>CC-BY-NC-4.0</item>
|
||||
<item>Community-Spec-1.0</item>
|
||||
<item>Cube</item>
|
||||
<item>D-FSL-1.0</item>
|
||||
<item>DL-DE-BY-2.0</item>
|
||||
<item>ECL-1.0</item>
|
||||
<item>ECL-2.0</item>
|
||||
<item>EFL-1.0</item>
|
||||
<item>EFL-2.0</item>
|
||||
<item>Elastic-2.0</item>
|
||||
<item>FreeBSD-DOC</item>
|
||||
<item>GD</item>
|
||||
<item>GFDL-1.1-only</item>
|
||||
<item>GFDL-1.1-or-later</item>
|
||||
<item>GFDL-1.2-only</item>
|
||||
<item>GFDL-1.2-or-later</item>
|
||||
<item>GFDL-1.3-only</item>
|
||||
<item>GFDL-1.3-or-later</item>
|
||||
<item>GPL-1.0-only</item>
|
||||
<item>GPL-1.0-or-later</item>
|
||||
<item>GPL-2.0-only</item>
|
||||
<item>GPL-2.0-or-later</item>
|
||||
<item>GPL-3.0-interface-exception</item>
|
||||
<item>GPL-3.0-only</item>
|
||||
<item>GPL-3.0-or-later</item>
|
||||
<item>GPL-CC-1.0</item>
|
||||
<item>GStreamer-exception-2008</item>
|
||||
<item>Glide</item>
|
||||
<item>HP-1989</item>
|
||||
<item>IBM-pibs</item>
|
||||
<item>ICU</item>
|
||||
<item>IPL-1.0</item>
|
||||
<item>ImageMagick</item>
|
||||
<item>Intel</item>
|
||||
<item>Intel-ACPI</item>
|
||||
<item>Interbase-1.0</item>
|
||||
<item>JSON</item>
|
||||
<item>LAL-1.3</item>
|
||||
<item>LGPL-2.0-only</item>
|
||||
<item>LGPL-2.0-or-later</item>
|
||||
<item>LGPL-2.1-only</item>
|
||||
<item>LGPL-2.1-or-later</item>
|
||||
<item>LGPL-3.0-only</item>
|
||||
<item>LGPL-3.0-or-later</item>
|
||||
<item>LGPLLR</item>
|
||||
<item>LLGPL</item>
|
||||
<item>LPL-1.0</item>
|
||||
<item>LPL-1.02</item>
|
||||
<item>LPPL-1.0</item>
|
||||
<item>LPPL-1.3a</item>
|
||||
<item>LPPL-1.3c</item>
|
||||
<item>Libpng</item>
|
||||
<item>Linux-OpenIB</item>
|
||||
<item>MIT</item>
|
||||
<item>MIT-0</item>
|
||||
<item>MIT-CMU</item>
|
||||
<item>MIT-Festival</item>
|
||||
<item>MIT-Modern-Variant</item>
|
||||
<item>MIT-Wu</item>
|
||||
<item>MIT-advertising</item>
|
||||
<item>MIT-open-group</item>
|
||||
<item>MPL-1.0</item>
|
||||
<item>MPL-2.0</item>
|
||||
<item>MirOS</item>
|
||||
<item>NASA-1.3</item>
|
||||
<item>NTP</item>
|
||||
<item>Nokia</item>
|
||||
<item>OCLC-2.0</item>
|
||||
<item>OFL-1.0</item>
|
||||
<item>OFL-1.1</item>
|
||||
<item>OLDAP-1.1</item>
|
||||
<item>OLDAP-2.0</item>
|
||||
<item>OLDAP-2.8</item>
|
||||
<item>OML</item>
|
||||
<item>OSL-1.0</item>
|
||||
<item>OSL-2.0</item>
|
||||
<item>OSL-3.0</item>
|
||||
<item>OpenSSL</item>
|
||||
<item>PHP-3.0</item>
|
||||
<item>PSF-2.0</item>
|
||||
<item>PostgreSQL</item>
|
||||
<item>Python-2.0</item>
|
||||
<item>QPL-1.0</item>
|
||||
<item>Qt-GPL-exception-1.0</item>
|
||||
<item>Qt-GPL-exception-1.1</item>
|
||||
<item>RPL-1.1</item>
|
||||
<item>RPL-1.5</item>
|
||||
<item>Ruby</item>
|
||||
<item>SGI-B-1.0</item>
|
||||
<item>SGI-B-2.0</item>
|
||||
<item>SSH-OpenSSH</item>
|
||||
<item>Sendmail</item>
|
||||
<item>TCL</item>
|
||||
<item>UnixCrypt</item>
|
||||
<item>Unlicense</item>
|
||||
<item>Vim</item>
|
||||
<item>W3C</item>
|
||||
<item>WTFPL</item>
|
||||
<item>X11</item>
|
||||
<item>XFree86-1.1</item>
|
||||
<item>Xdebug-1.03</item>
|
||||
<item>Xerox</item>
|
||||
<item>YPL-1.0</item>
|
||||
<item>ZPL-1.1</item>
|
||||
<item>ZPL-2.0</item>
|
||||
<item>Zed</item>
|
||||
<item>Zimbra-1.4</item>
|
||||
<item>Zlib</item>
|
||||
<item>bzip2-1.0.6</item>
|
||||
<item>copyleft-next-0.3.1</item>
|
||||
<item>curl</item>
|
||||
<item>gnuplot</item>
|
||||
<item>libpng-2.0</item>
|
||||
<item>libselinux-1.0</item>
|
||||
<item>w3m</item>
|
||||
<item>xpp</item>
|
||||
<item>zlib-acknowledgement</item>
|
||||
</string-array>
|
||||
</resources>
|
||||
|
|
|
@ -72,6 +72,10 @@
|
|||
<string name="newRepoDescTintCopy">Repository Description</string>
|
||||
<string name="newRepoPrivateCopy">Private</string>
|
||||
<string name="newRepoOwner">Owner</string>
|
||||
<string name="newRepoIssueLabels">Issue Labels</string>
|
||||
<string name="advanced" translatable="false">Advanced</string>
|
||||
<string name="defaultText" translatable="false">Default</string>
|
||||
<string name="setAsTemplate">Make repository a template</string>
|
||||
|
||||
<string name="newOrgTintCopy">Organization Name</string>
|
||||
<string name="newOrgDescTintCopy">Organization Description</string>
|
||||
|
@ -103,6 +107,7 @@
|
|||
<string name="repoCreated">Repository created successfully</string>
|
||||
<string name="repoExistsError">Repository of this name already exists under selected Owner</string>
|
||||
<string name="repoOwnerError">Select owner for the repository</string>
|
||||
<string name="repoDefaultBranchError">The default branch must not be empty</string>
|
||||
|
||||
<string name="orgNameErrorEmpty">Organization name is empty</string>
|
||||
<string name="orgNameErrorInvalid">Organization name is not valid, [a–z A–Z 0–9 – _]</string>
|
||||
|
@ -144,7 +149,6 @@
|
|||
<string name="infoTabRepoUpdatedAt">Last Updated</string>
|
||||
<string name="infoTabRepoZero" translatable="false">0</string>
|
||||
|
||||
<string name="infoShowMoreInformation">Show More Information</string>
|
||||
<string name="infoMoreInformation">More Information</string>
|
||||
|
||||
<string name="timeAtText">at</string>
|
||||
|
@ -524,6 +528,8 @@
|
|||
<string name="reset">Reset</string>
|
||||
<string name="beta">BETA</string>
|
||||
<string name="none">None</string>
|
||||
<string name="main">main</string>
|
||||
<string name="license">License</string>
|
||||
<!-- generic copy -->
|
||||
|
||||
<string name="exploreUsers">Explore users</string>
|
||||
|
|
Loading…
Reference in New Issue