Merge branch '16-create-files' of mmarif/GitNex into master

This commit is contained in:
M M Arif 2019-09-18 09:51:27 +00:00 committed by Gitea
commit 0cd4e36a66
21 changed files with 862 additions and 30 deletions

View File

@ -11,8 +11,11 @@
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity
android:name=".activities.RepoWatchersActivity"
android:name=".activities.NewFileActivity"
android:theme="@style/AppTheme.NoActionBar"></activity>
<activity
android:name=".activities.RepoWatchersActivity"
android:theme="@style/AppTheme.NoActionBar" />
<activity
android:name=".activities.RepoStargazersActivity"
android:theme="@style/AppTheme.NoActionBar" />
@ -61,8 +64,8 @@
<activity android:name=".activities.NewOrganizationActivity" />
<activity android:name=".activities.OpenRepoInBrowserActivity" />
</application>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
</manifest>

View File

@ -0,0 +1,335 @@
package org.mian.gitnex.activities;
import android.content.Context;
import android.graphics.PorterDuff;
import android.graphics.drawable.GradientDrawable;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.Spinner;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import com.google.gson.JsonElement;
import org.mian.gitnex.R;
import org.mian.gitnex.clients.RetrofitClient;
import org.mian.gitnex.helpers.AlertDialogs;
import org.mian.gitnex.helpers.Authorization;
import org.mian.gitnex.helpers.Toasty;
import org.mian.gitnex.models.Branches;
import org.mian.gitnex.models.NewFile;
import org.mian.gitnex.util.AppUtil;
import org.mian.gitnex.util.TinyDB;
import java.util.ArrayList;
import java.util.List;
import retrofit2.Call;
import retrofit2.Callback;
/**
* Author M M Arif
*/
public class NewFileActivity extends AppCompatActivity {
public ImageView closeActivity;
private View.OnClickListener onClickListener;
private Button newFileCreate;
private EditText newFileName;
private EditText newFileContent;
private EditText newFileBranchName;
private EditText newFileCommitMessage;
private Spinner newFileBranchesSpinner;
final Context ctx = this;
List<Branches> branchesList = new ArrayList<>();
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_new_file);
boolean connToInternet = AppUtil.haveNetworkConnection(getApplicationContext());
TinyDB tinyDb = new TinyDB(getApplicationContext());
final String instanceUrl = tinyDb.getString("instanceUrl");
final String loginUid = tinyDb.getString("loginUid");
String repoFullName = tinyDb.getString("repoFullName");
String[] parts = repoFullName.split("/");
final String repoOwner = parts[0];
final String repoName = parts[1];
final String instanceToken = "token " + tinyDb.getString(loginUid + "-token");
closeActivity = findViewById(R.id.close);
newFileName = findViewById(R.id.newFileName);
newFileContent = findViewById(R.id.newFileContent);
newFileBranchName = findViewById(R.id.newFileBranchName);
newFileCommitMessage = findViewById(R.id.newFileCommitMessage);
initCloseListener();
closeActivity.setOnClickListener(onClickListener);
newFileCreate = findViewById(R.id.newFileCreate);
initCloseListener();
closeActivity.setOnClickListener(onClickListener);
newFileBranchesSpinner = findViewById(R.id.newFileBranchesSpinner);
newFileBranchesSpinner.getBackground().setColorFilter(getResources().getColor(R.color.white), PorterDuff.Mode.SRC_ATOP);
getBranches(instanceUrl, instanceToken, repoOwner, repoName, loginUid);
newFileBranchesSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener()
{
public void onItemSelected(AdapterView<?> arg0,
View arg1, int arg2, long arg3)
{
Branches bModelValue = (Branches) newFileBranchesSpinner.getSelectedItem();
Log.i("bModelSelected", bModelValue.toString());
if(bModelValue.toString().equals("No branch")) {
newFileBranchName.setEnabled(true);
}
else {
newFileBranchName.setEnabled(false);
newFileBranchName.setText("");
}
}
public void onNothingSelected(AdapterView<?> arg0) {}
});
disableProcessButton();
if(!connToInternet) {
newFileCreate.setEnabled(false);
GradientDrawable shape = new GradientDrawable();
shape.setCornerRadius( 8 );
shape.setColor(getResources().getColor(R.color.hintColor));
newFileCreate.setBackground(shape);
} else {
newFileCreate.setOnClickListener(createFileListener);
}
}
private View.OnClickListener createFileListener = new View.OnClickListener() {
public void onClick(View v) {
processNewFile();
}
};
private void processNewFile() {
boolean connToInternet = AppUtil.haveNetworkConnection(getApplicationContext());
AppUtil appUtil = new AppUtil();
TinyDB tinyDb = new TinyDB(getApplicationContext());
final String instanceUrl = tinyDb.getString("instanceUrl");
final String loginUid = tinyDb.getString("loginUid");
final String instanceToken = "token " + tinyDb.getString(loginUid + "-token");
String repoFullName = tinyDb.getString("repoFullName");
String[] parts = repoFullName.split("/");
final String repoOwner = parts[0];
final String repoName = parts[1];
String newFileName_ = newFileName.getText().toString();
String newFileContent_ = newFileContent.getText().toString();
String newFileBranchName_ = newFileBranchName.getText().toString();
String newFileCommitMessage_ = newFileCommitMessage.getText().toString();
Branches currentBranch = (Branches) newFileBranchesSpinner.getSelectedItem();
if(!connToInternet) {
Toasty.info(getApplicationContext(), getResources().getString(R.string.checkNetConnection));
return;
}
if(newFileName_.equals("") || newFileContent_.equals("") || newFileCommitMessage_.equals("")) {
Toasty.info(getApplicationContext(), getString(R.string.newFileRequiredFields));
return;
}
if(currentBranch.toString().equals("No branch")) {
if(newFileBranchName_.equals("")) {
Toasty.info(getApplicationContext(), getString(R.string.newFileRequiredFieldNewBranchName));
return;
}
else {
if(!appUtil.checkStringsWithDash(newFileBranchName_)) {
Toasty.info(getApplicationContext(), getString(R.string.newFileInvalidBranchName));
return;
}
}
}
if(appUtil.charactersLength(newFileCommitMessage_) > 255) {
Toasty.info(getApplicationContext(), getString(R.string.newFileCommitMessageError));
}
else {
disableProcessButton();
createNewFile(instanceUrl, Authorization.returnAuthentication(getApplicationContext(), loginUid, instanceToken), repoOwner, repoName, newFileName_, appUtil.encodeBase64(newFileContent_), newFileBranchName_, newFileCommitMessage_, currentBranch.toString());
}
}
private void createNewFile(final String instanceUrl, final String token, String repoOwner, String repoName, String fileName, String fileContent, String fileBranchName, String fileCommitMessage, String currentBranch) {
NewFile createNewFileJsonStr;
if(currentBranch.equals("No branch")) {
createNewFileJsonStr = new NewFile("", fileContent, fileCommitMessage, fileBranchName);
}
else {
createNewFileJsonStr = new NewFile(currentBranch, fileContent, fileCommitMessage, "");
}
Call<JsonElement> call = RetrofitClient
.getInstance(instanceUrl)
.getApiInterface()
.createNewFile(token, repoOwner, repoName, fileName, createNewFileJsonStr);
call.enqueue(new Callback<JsonElement>() {
@Override
public void onResponse(@NonNull Call<JsonElement> call, @NonNull retrofit2.Response<JsonElement> response) {
if(response.code() == 201) {
enableProcessButton();
Toasty.info(getApplicationContext(), getString(R.string.newFileSuccessMessage));
finish();
}
else if(response.code() == 401) {
enableProcessButton();
AlertDialogs.authorizationTokenRevokedDialog(ctx, getResources().getString(R.string.alertDialogTokenRevokedTitle),
getResources().getString(R.string.alertDialogTokenRevokedMessage),
getResources().getString(R.string.alertDialogTokenRevokedCopyNegativeButton),
getResources().getString(R.string.alertDialogTokenRevokedCopyPositiveButton));
}
else {
if(response.code() == 404) {
enableProcessButton();
Toasty.info(getApplicationContext(), getString(R.string.apiNotFound));
}
else {
enableProcessButton();
Toasty.info(getApplicationContext(), getString(R.string.orgCreatedError));
}
}
}
@Override
public void onFailure(@NonNull Call<JsonElement> call, @NonNull Throwable t) {
Log.e("onFailure", t.toString());
enableProcessButton();
}
});
}
private void getBranches(String instanceUrl, String instanceToken, String repoOwner, String repoName, String loginUid) {
Call<List<Branches>> call = RetrofitClient
.getInstance(instanceUrl)
.getApiInterface()
.getBranches(Authorization.returnAuthentication(getApplicationContext(), loginUid, instanceToken), repoOwner, repoName);
call.enqueue(new Callback<List<Branches>>() {
@Override
public void onResponse(@NonNull Call<List<Branches>> call, @NonNull retrofit2.Response<List<Branches>> response) {
if(response.isSuccessful()) {
if(response.code() == 200) {
List<Branches> branchesList_ = response.body();
branchesList.add(new Branches("No branch"));
assert branchesList_ != null;
if(branchesList_.size() > 0) {
for (int i = 0; i < branchesList_.size(); i++) {
Branches data = new Branches(
branchesList_.get(i).getName()
);
branchesList.add(data);
}
}
ArrayAdapter<Branches> adapter = new ArrayAdapter<>(getApplicationContext(),
R.layout.spinner_item, branchesList);
adapter.setDropDownViewResource(R.layout.spinner_dropdown_item);
newFileBranchesSpinner.setAdapter(adapter);
enableProcessButton();
}
}
}
@Override
public void onFailure(@NonNull Call<List<Branches>> call, @NonNull Throwable t) {
Log.e("onFailure", t.toString());
}
});
}
private void initCloseListener() {
onClickListener = new View.OnClickListener() {
@Override
public void onClick(View view) {
finish();
}
};
}
private void disableProcessButton() {
newFileCreate.setEnabled(false);
GradientDrawable shape = new GradientDrawable();
shape.setCornerRadius( 8 );
shape.setColor(getResources().getColor(R.color.hintColor));
newFileCreate.setBackground(shape);
}
private void enableProcessButton() {
newFileCreate.setEnabled(true);
GradientDrawable shape = new GradientDrawable();
shape.setCornerRadius( 8 );
shape.setColor(getResources().getColor(R.color.btnBackground));
newFileCreate.setBackground(shape);
}
}

View File

@ -108,7 +108,6 @@ public class RepoDetailActivity extends AppCompatActivity implements RepoBottomS
}
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
@ -165,6 +164,9 @@ public class RepoDetailActivity extends AppCompatActivity implements RepoBottomS
Intent i = new Intent(Intent.ACTION_VIEW, url);
startActivity(i);
break;
case "newFile":
startActivity(new Intent(RepoDetailActivity.this, NewFileActivity.class));
break;
}
}

View File

@ -2,8 +2,10 @@ package org.mian.gitnex.activities;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.text.method.LinkMovementMethod;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import org.mian.gitnex.R;
/**
@ -20,6 +22,9 @@ public class SponsorsActivity extends AppCompatActivity {
setContentView(R.layout.activity_sponsors);
ImageView closeActivity = findViewById(R.id.close);
TextView liberaPaySponsorsThomas = findViewById(R.id.liberaPaySponsorsThomas);
liberaPaySponsorsThomas.setMovementMethod(LinkMovementMethod.getInstance());
initCloseListener();
closeActivity.setOnClickListener(onClickListener);

View File

@ -1,12 +1,13 @@
package org.mian.gitnex.adapters;
import android.content.Context;
import android.text.Html;
import android.text.method.LinkMovementMethod;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import org.mian.gitnex.R;
import org.mian.gitnex.helpers.UrlHelper;
import org.mian.gitnex.models.Branches;
import org.mian.gitnex.util.TinyDB;
import java.util.List;
@ -66,7 +67,9 @@ public class BranchesAdapter extends RecyclerView.Adapter<BranchesAdapter.Branch
holder.branchCommitAuthor.setText(mCtx.getResources().getString(R.string.commitAuthor, currentItem.getCommit().getAuthor().getUsername()));
}
holder.branchCommitHash.setText(mCtx.getResources().getString(R.string.commitHash, "", currentItem.getCommit().getUrl()));
holder.branchCommitHash.setText(
Html.fromHtml("<a href='" + currentItem.getCommit().getUrl() + "'>" + mCtx.getResources().getString(R.string.commitLinkBranchesTab) + "</a> "));
holder.branchCommitHash.setMovementMethod(LinkMovementMethod.getInstance());
}

View File

@ -2,6 +2,8 @@ package org.mian.gitnex.adapters;
import android.content.Context;
import android.graphics.Color;
import android.text.Html;
import android.text.method.LinkMovementMethod;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
@ -139,8 +141,14 @@ public class ReleasesAdapter extends RecyclerView.Adapter<ReleasesAdapter.Releas
else {
holder.releaseDescription.setVisibility(View.GONE);
}
holder.releaseZipDownload.setText(currentItem.getZipball_url());
holder.releaseTarDownload.setText(currentItem.getTarball_url());
holder.releaseZipDownload.setText(
Html.fromHtml("<a href='" + currentItem.getZipball_url() + "'>" + mCtx.getResources().getString(R.string.zipArchiveDownloadReleasesTab) + "</a> "));
holder.releaseZipDownload.setMovementMethod(LinkMovementMethod.getInstance());
holder.releaseTarDownload.setText(
Html.fromHtml("<a href='" + currentItem.getTarball_url() + "'>" + mCtx.getResources().getString(R.string.tarArchiveDownloadReleasesTab) + "</a> "));
holder.releaseTarDownload.setMovementMethod(LinkMovementMethod.getInstance());
}

View File

@ -30,6 +30,7 @@ public class RepoBottomSheetFragment extends BottomSheetDialogFragment {
TextView addCollaborator = v.findViewById(R.id.addCollaborator);
TextView createRelease = v.findViewById(R.id.createRelease);
TextView openWebRepo = v.findViewById(R.id.openWebRepo);
TextView newFile = v.findViewById(R.id.newFile);
createLabel.setOnClickListener(new View.OnClickListener() {
@Override
@ -79,6 +80,14 @@ public class RepoBottomSheetFragment extends BottomSheetDialogFragment {
}
});
newFile.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
bmListener.onButtonClicked("newFile");
dismiss();
}
});
return v;
}

View File

@ -3,6 +3,7 @@ package org.mian.gitnex.interfaces;
import com.google.gson.JsonElement;
import org.mian.gitnex.models.AddEmail;
import org.mian.gitnex.models.Branches;
import org.mian.gitnex.models.NewFile;
import org.mian.gitnex.models.UpdateIssueAssignee;
import org.mian.gitnex.models.UpdateIssueState;
import org.mian.gitnex.models.Collaborators;
@ -210,4 +211,7 @@ public interface ApiInterface {
@GET("repos/{owner}/{repo}/subscribers") // get all repo watchers
Call<List<UserInfo>> getRepoWatchers(@Header("Authorization") String token, @Path("owner") String ownerName, @Path("repo") String repoName);
@POST("repos/{owner}/{repo}/contents/{file}") // create new file
Call<JsonElement> createNewFile(@Header("Authorization") String token, @Path("owner") String ownerName, @Path("repo") String repoName, @Path("file") String fileName, @Body NewFile jsonStr);
}

View File

@ -0,0 +1,99 @@
package org.mian.gitnex.models;
/**
* Author M M Arif
*/
public class NewFile {
private String branch;
private String content;
private String message;
private String new_branch;
private authorObject author;
private committerObject committer;
public String getBranch() {
return branch;
}
public void setBranch(String branch) {
this.branch = branch;
}
public String getContents() {
return content;
}
public void setContents(String contents) {
this.content = contents;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public String getNew_branch() {
return new_branch;
}
public void setNew_branch(String new_branch) {
this.new_branch = new_branch;
}
public class authorObject {
private String email;
private String name;
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
public class committerObject {
private String email;
private String name;
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
public NewFile(String branch, String content, String message, String new_branch) {
this.branch = branch;
this.content = content;
this.message = message;
this.new_branch = new_branch;
}
}

View File

@ -7,9 +7,11 @@ import android.content.res.Configuration;
import android.content.res.Resources;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.util.Base64;
import android.util.DisplayMetrics;
import java.net.HttpURLConnection;
import java.net.URL;
import java.nio.charset.StandardCharsets;
import java.text.DecimalFormat;
import java.util.Calendar;
import java.util.Locale;
@ -77,6 +79,10 @@ public class AppUtil {
return str.matches("^[\\w.-]+$");
}
public Boolean checkStringsWithDash(String str) { // [a-zA-Z0-9-_. ]
return str.matches("^[\\w-]+$");
}
public Boolean checkIntegers(String str) {
return str.matches("\\d+");
}
@ -180,4 +186,28 @@ public class AppUtil {
}
public String encodeBase64(String str) {
String base64Str = str;
if(!str.equals("")) {
byte[] data = str.getBytes(StandardCharsets.UTF_8);
base64Str = Base64.encodeToString(data, Base64.DEFAULT);
}
return base64Str;
}
public String decodeBase64(String str) {
String base64Str = str;
if(!str.equals("")) {
byte[] data = Base64.decode(base64Str, Base64.DEFAULT);
base64Str = new String(data, StandardCharsets.UTF_8);
}
return base64Str;
}
}

View File

@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#FFFFFF"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData="M6,2c-1.1,0 -1.99,0.9 -1.99,2L4,20c0,1.1 0.89,2 1.99,2L18,22c1.1,0 2,-0.9 2,-2L20,8l-6,-6L6,2zM13,9L13,3.5L18.5,9L13,9z"/>
</vector>

View File

@ -61,7 +61,6 @@
android:padding="10dp"
android:textSize="14sp"
tools:ignore="Autofill"
android:labelFor="@+id/instance_url"
android:background="@drawable/shape_inputs"
android:drawableStart="@drawable/ic_link_24dp"
android:drawablePadding="10dp"
@ -79,7 +78,6 @@
android:padding="10dp"
android:textSize="14sp"
tools:ignore="Autofill"
android:labelFor="@+id/login_uid"
android:background="@drawable/shape_inputs"
android:drawableStart="@drawable/ic_person_24dp"
android:drawablePadding="10dp"
@ -97,7 +95,6 @@
android:padding="10dp"
android:textSize="14sp"
tools:ignore="Autofill"
android:labelFor="@+id/login_passwd"
android:background="@drawable/shape_inputs"
android:drawableStart="@drawable/ic_lock_24dp"
android:drawablePadding="10dp"
@ -115,7 +112,6 @@
android:padding="10dp"
android:textSize="14sp"
tools:ignore="Autofill"
android:labelFor="@+id/otpCode"
android:background="@drawable/shape_inputs"
android:drawableStart="@drawable/ic_otp"
android:drawablePadding="10dp"

View File

@ -0,0 +1,229 @@
<?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="@color/colorPrimary">
<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<androidx.appcompat.widget.Toolbar
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/colorPrimary"
tools:ignore="UnusedAttribute">
<ImageView
android:id="@+id/close"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginRight="15dp"
android:layout_marginLeft="15dp"
android:gravity="center_vertical"
android:contentDescription="@string/close"
android:src="@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:text="@string/pageTitleNewFile"
android:textColor="@color/white"
android:maxLines="1"
android:textSize="20sp" />
</androidx.appcompat.widget.Toolbar>
</com.google.android.material.appbar.AppBarLayout>
<ScrollView
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/backgroundColor">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="20dp"
android:paddingBottom="30dp"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/newFileNameTintCopy"
android:textColor="@color/colorWhite"
android:textSize="16sp" />
<EditText
android:id="@+id/newFileName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:padding="10dp"
android:textSize="14sp"
tools:ignore="Autofill"
android:labelFor="@+id/newFileName"
android:background="@drawable/shape_inputs"
android:textColor="@color/colorWhite"
android:textColorHint="@color/colorWhite"
android:inputType="textCapSentences|text"
android:textColorHighlight="@color/colorWhite"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/newFileNameHintMessage"
android:textColor="@color/hintColor"
android:textSize="12sp"
android:paddingStart="10dp"
android:paddingEnd="5dp"
android:gravity="end" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/newFileContentTintCopy"
android:textColor="@color/colorWhite"
android:textSize="16sp"
android:layout_marginTop="10dp" />
<EditText
android:id="@+id/newFileContent"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:padding="10dp"
android:background="@drawable/shape_inputs"
android:maxLines="16"
android:minLines="14"
tools:ignore="Autofill"
android:labelFor="@+id/newFileContent"
android:scrollbars="vertical"
android:gravity="top|start"
android:textSize="14sp"
android:textColor="@color/colorWhite"
android:textColorHint="@color/colorWhite"
android:inputType="textCapSentences|textMultiLine"
android:textColorHighlight="@color/colorWhite"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/newFileOldBranches"
android:textColor="@color/colorWhite"
android:textSize="16sp"
android:layout_marginTop="10dp"/>
<Spinner
android:id="@+id/newFileBranchesSpinner"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:spinnerMode="dropdown"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:paddingLeft="5dp"
android:paddingRight="5dp"
android:paddingStart="5dp" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/newFileCurrentBranchMessage"
android:textColor="@color/hintColor"
android:textSize="12sp"
android:paddingStart="10dp"
android:paddingEnd="5dp"
android:gravity="end" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/newFileBranchTintCopy"
android:textColor="@color/colorWhite"
android:textSize="16sp"
android:layout_marginTop="10dp" />
<EditText
android:id="@+id/newFileBranchName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:padding="10dp"
android:textSize="14sp"
tools:ignore="Autofill"
android:labelFor="@+id/newFileBranchName"
android:background="@drawable/shape_inputs"
android:textColor="@color/colorWhite"
android:textColorHint="@color/colorWhite"
android:inputType="textCapSentences|text"
android:textColorHighlight="@color/colorWhite"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/newFileNewBranchMessage"
android:textColor="@color/hintColor"
android:textSize="12sp"
android:paddingStart="10dp"
android:paddingEnd="5dp"
android:gravity="end" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/newFileMessageTintCopy"
android:textColor="@color/colorWhite"
android:textSize="16sp"
android:layout_marginTop="10dp" />
<EditText
android:id="@+id/newFileCommitMessage"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:padding="10dp"
android:textSize="14sp"
tools:ignore="Autofill"
android:labelFor="@+id/newFileCommitMessage"
android:background="@drawable/shape_inputs"
android:textColor="@color/colorWhite"
android:textColorHint="@color/colorWhite"
android:inputType="textCapSentences|text"
android:textColorHighlight="@color/colorWhite"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/characters255Limit"
android:textColor="@color/hintColor"
android:textSize="12sp"
android:paddingStart="10dp"
android:paddingEnd="5dp"
android:gravity="end" />
<Button
android:id="@+id/newFileCreate"
android:gravity="center"
android:layout_gravity="end"
android:layout_marginTop="20dp"
android:layout_width="wrap_content"
android:layout_height="40dp"
android:width="140dp"
android:text="@string/newFileButtonCopy"
android:background="@drawable/shape_buttons"
android:textColor="@color/btnTextColor" />
</LinearLayout>
</ScrollView>
</LinearLayout>

View File

@ -73,6 +73,18 @@
android:text="@string/liberaPaySponsorsFabian"
android:textColor="@color/white"
android:textSize="16sp"
android:layout_marginBottom="10dp"
android:textColorLink="@color/lightBlue"
/>
<TextView
android:id="@+id/liberaPaySponsorsThomas"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/liberaPaySponsorsThomas"
android:textColor="@color/white"
android:textSize="16sp"
android:layout_marginBottom="10dp"
android:textColorLink="@color/lightBlue"
/>

View File

@ -36,10 +36,8 @@
android:layout_marginTop="10dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textIsSelectable="true"
android:textColor="@color/colorWhite"
android:textSize="16sp"
android:autoLink="web"
android:textColorLink="@color/lightBlue"/>
</LinearLayout>

View File

@ -83,10 +83,8 @@
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:text="@string/releaseZip"
android:textIsSelectable="true"
android:textColor="@color/colorWhite"
android:textSize="16sp"
android:autoLink="web"
android:textColorLink="@color/lightBlue"/>
<TextView
@ -94,11 +92,9 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/releaseTar"
android:textIsSelectable="true"
android:layout_marginTop="5dp"
android:textColor="@color/colorWhite"
android:textSize="16sp"
android:autoLink="web"
android:textColorLink="@color/lightBlue"/>
</LinearLayout>

View File

@ -7,6 +7,18 @@
android:background="@color/backgroundColor"
android:paddingTop="8dp">
<TextView
android:id="@+id/newFile"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="@string/pageTitleNewFile"
android:drawableStart="@drawable/ic_file"
android:drawablePadding="24dp"
android:textColor="@color/white"
android:textSize="16sp"
android:padding="16dp" />
<TextView
android:id="@+id/createNewIssue"
android:layout_width="match_parent"

View File

@ -404,6 +404,26 @@
<string name="starMember">Star</string>
<string name="watcherMember">Watcher</string>
<string name="commitLinkBranchesTab">Commit</string>
<string name="zipArchiveDownloadReleasesTab">Zip Archive</string>
<string name="tarArchiveDownloadReleasesTab">Tar Archive</string>
<!-- new file -->
<string name="newFileNameTintCopy">File Name</string>
<string name="newFileBranchTintCopy">Branch Name</string>
<string name="newFileContentTintCopy">File Content</string>
<string name="newFileButtonCopy">Create New File</string>
<string name="newFileNameHintMessage">with folder: app/test.md</string>
<string name="newFileMessageTintCopy">Commit Message</string>
<string name="newFileInvalidBranchName">Invalid branch name, may only contain &#8211;, a&#8211;z, 0&#8211;9</string>
<string name="newFileCommitMessageError">Commit message is too long</string>
<string name="newFileSuccessMessage">New file created</string>
<string name="newFileOldBranches">Current Branches</string>
<string name="newFileRequiredFields">Fields like filename, contents and commit message are required.</string>
<string name="newFileCurrentBranchMessage">Selecting current branch will disable new branch</string>
<string name="newFileNewBranchMessage">e.g: new-branch</string>
<string name="newFileRequiredFieldNewBranchName">New branch name cannot be empty if current branch is not selected</string>
<!-- generic copy -->
<string name="okButton">OK</string>
<string name="doneButton">Fertig</string>
@ -423,6 +443,7 @@
<string name="descriptionText">Beschreibung</string>
<string name="websiteText">Website</string>
<string name="locationText">Standort</string>
<string name="characters255Limit">Max 255 characters</string>
<!-- generic copy -->
</resources>

View File

@ -404,6 +404,26 @@
<string name="starMember">Star</string>
<string name="watcherMember">Watcher</string>
<string name="commitLinkBranchesTab">Commit</string>
<string name="zipArchiveDownloadReleasesTab">Zip Archive</string>
<string name="tarArchiveDownloadReleasesTab">Tar Archive</string>
<!-- new file -->
<string name="newFileNameTintCopy">File Name</string>
<string name="newFileBranchTintCopy">Branch Name</string>
<string name="newFileContentTintCopy">File Content</string>
<string name="newFileButtonCopy">Create New File</string>
<string name="newFileNameHintMessage">with folder: app/test.md</string>
<string name="newFileMessageTintCopy">Commit Message</string>
<string name="newFileInvalidBranchName">Invalid branch name, may only contain &#8211;, a&#8211;z, 0&#8211;9</string>
<string name="newFileCommitMessageError">Commit message is too long</string>
<string name="newFileSuccessMessage">New file created</string>
<string name="newFileOldBranches">Current Branches</string>
<string name="newFileRequiredFields">Fields like filename, contents and commit message are required.</string>
<string name="newFileCurrentBranchMessage">Selecting current branch will disable new branch</string>
<string name="newFileNewBranchMessage">e.g: new-branch</string>
<string name="newFileRequiredFieldNewBranchName">New branch name cannot be empty if current branch is not selected</string>
<!-- generic copy -->
<string name="okButton">OK</string>
<string name="doneButton">Done</string>
@ -424,6 +444,7 @@
<string name="websiteText">Website</string>
<string name="locationText">Location</string>
<string name="openWebRepo">Ouvrir avec le Browser</string>
<string name="characters255Limit">Max 255 characters</string>
<!-- generic copy -->
</resources>

View File

@ -404,6 +404,26 @@
<string name="starMember">Star</string>
<string name="watcherMember">Watcher</string>
<string name="commitLinkBranchesTab">Commit</string>
<string name="zipArchiveDownloadReleasesTab">Zip Archive</string>
<string name="tarArchiveDownloadReleasesTab">Tar Archive</string>
<!-- new file -->
<string name="newFileNameTintCopy">File Name</string>
<string name="newFileBranchTintCopy">Branch Name</string>
<string name="newFileContentTintCopy">File Content</string>
<string name="newFileButtonCopy">Create New File</string>
<string name="newFileNameHintMessage">with folder: app/test.md</string>
<string name="newFileMessageTintCopy">Commit Message</string>
<string name="newFileInvalidBranchName">Invalid branch name, may only contain &#8211;, a&#8211;z, 0&#8211;9</string>
<string name="newFileCommitMessageError">Commit message is too long</string>
<string name="newFileSuccessMessage">New file created</string>
<string name="newFileOldBranches">Current Branches</string>
<string name="newFileRequiredFields">Fields like filename, contents and commit message are required.</string>
<string name="newFileCurrentBranchMessage">Selecting current branch will disable new branch</string>
<string name="newFileNewBranchMessage">e.g: new-branch</string>
<string name="newFileRequiredFieldNewBranchName">New branch name cannot be empty if current branch is not selected</string>
<!-- generic copy -->
<string name="okButton">OK</string>
<string name="doneButton">Готово</string>
@ -424,6 +444,7 @@
<string name="websiteText">Веб-сайт</string>
<string name="locationText">Место расположения</string>
<string name="openWebRepo">Открыть с помощью браузера</string>
<string name="characters255Limit">Max 255 characters</string>
<!-- generic copy -->
</resources>

View File

@ -40,20 +40,21 @@
<string name="pageTitleMyRepos">My Repositories</string>
<string name="pageTitleRepositories">Repositories</string>
<string name="pageTitleProfile">Profile</string>
<string name="pageTitleNewRepo">Create Repository</string>
<string name="pageTitleNewRepo">New Repository</string>
<string name="pageTitleOrganizations">Organizations</string>
<string name="pageTitleIssues">Issues</string>
<string name="pageTitleSettings">Settings</string>
<string name="pageTitleCreateOrganization">Create Organization</string>
<string name="pageTitleCreateMilestone">Create Milestone</string>
<string name="pageTitleCreateNewIssue">Create Issue</string>
<string name="pageTitleCreateLabel">Create Label</string>
<string name="pageTitleCreateOrganization">New Organization</string>
<string name="pageTitleCreateMilestone">New Milestone</string>
<string name="pageTitleCreateNewIssue">New Issue</string>
<string name="pageTitleCreateLabel">New Label</string>
<string name="pageTitleCredits">Credits</string>
<string name="pageTitleLabelUpdate">Update Label</string>
<string name="pageTitleSponsors">Sponsors</string>
<string name="pageTitleStarredRepos">Starred Repositories</string>
<string name="pageTitleCreateTeam">Create Team</string>
<string name="pageTitleCreateTeam">New Team</string>
<string name="pageTitleAddEmail">Add Email Address</string>
<string name="pageTitleNewFile">New File</string>
<!-- page titles -->
<string name="appVersion">Version\u0020:\u0020</string>
@ -98,7 +99,6 @@
<string name="emptyFieldPassword">Password is required</string>
<string name="checkNetConnection">Cannot access network, please check your Internet connection</string>
<string name="emptyFields">All fields are required</string>
<string name="repoNameErrorEmpty">Repository name is empty</string>
<string name="repoNameErrorInvalid">Repository name is not valid. [a&#8211;z A&#8211;Z 0&#8211;9 &#8211; _]</string>
@ -260,7 +260,7 @@
<string name="noMoreData">No more data available.</string>
<string name="createLabel">Create Label</string>
<string name="createLabel">New Label</string>
<string name="menuTitleText">Repo Menu</string>
<string name="labelName">Label Name</string>
<string name="labelColor">Label Color</string>
@ -299,7 +299,7 @@
<string name="orgTabRepos">Repositories</string>
<string name="orgTabTeams">Teams</string>
<string name="orgTabMembers">Members</string>
<string name="orgCreateTeam">Create Team</string>
<string name="orgCreateTeam">New Team</string>
<string name="noDataTeams">No teams found</string>
<string name="teamTitle">Team name</string>
<string name="teamDescription">Team desc</string>
@ -387,7 +387,7 @@
<string name="repoMetaData">Repository Meta</string>
<!-- admin -->
<string name="adminCreateNewUser">Create New User</string>
<string name="adminCreateNewUser">Add New User</string>
<string name="adminUsers">Users</string>
<string name="userRoleAdmin">Admin</string>
<!-- admin -->
@ -400,13 +400,14 @@
<string name="userInvalidFullName">Invalid Full Name</string>
<string name="userInvalidUserName">Invalid Username</string>
<string name="userInvalidEmail">Invalid Email</string>
<string name="userCreatedText">New user created successfully</string>
<string name="userCreatedText">New user added successfully</string>
<string name="userExistsError">User already exists</string>
<!-- create user -->
<!-- sponsors -->
<string name="liberaPayText" translatable="false">Liberapay</string>
<string name="liberaPaySponsorsFabian" translatable="false">Fabian Stamm</string>
<string name="liberaPaySponsorsThomas" translatable="false">Thomas Schneider <a href="https://framapiaf.org/@fedilab">@Fedilab</a></string>
<!-- sponsors -->
<!-- edit issue -->
@ -415,7 +416,7 @@
<!-- edit issue -->
<!-- release -->
<string name="createRelease">Create Release</string>
<string name="createRelease">New Release</string>
<string name="releaseTagNameText">Tag Name</string>
<string name="releaseTitleText">Title</string>
<string name="releaseContentText">Content</string>
@ -441,6 +442,26 @@
<string name="starMember">Star</string>
<string name="watcherMember">Watcher</string>
<string name="commitLinkBranchesTab">Commit</string>
<string name="zipArchiveDownloadReleasesTab">Zip Archive</string>
<string name="tarArchiveDownloadReleasesTab">Tar Archive</string>
<!-- new file -->
<string name="newFileNameTintCopy">File Name</string>
<string name="newFileBranchTintCopy">New Branch Name</string>
<string name="newFileContentTintCopy">File Content</string>
<string name="newFileButtonCopy">Create New File</string>
<string name="newFileNameHintMessage">with folder: app/test.md</string>
<string name="newFileMessageTintCopy">Commit Message</string>
<string name="newFileInvalidBranchName">Invalid branch name, may only contain &#8211;, a&#8211;z, 0&#8211;9</string>
<string name="newFileCommitMessageError">Commit message is too long</string>
<string name="newFileSuccessMessage">New file created</string>
<string name="newFileOldBranches">Current Branches</string>
<string name="newFileRequiredFields">Fields like filename, content and commit message are required</string>
<string name="newFileCurrentBranchMessage">Selecting current branch will disable new branch</string>
<string name="newFileNewBranchMessage">e.g: new-branch</string>
<string name="newFileRequiredFieldNewBranchName">New branch name cannot be empty if current branch is not selected</string>
<!-- generic copy -->
<string name="okButton">OK</string>
<string name="doneButton">Done</string>
@ -463,6 +484,8 @@
<string name="descriptionText">Description</string>
<string name="websiteText">Website</string>
<string name="locationText">Location</string>
<string name="characters255Limit">Max 255 characters</string>
<string name="emptyFields">All fields are required</string>
<!-- generic copy -->
</resources>