Refactor org and team creation screens, make text selectable in issues,pr and comments
This commit is contained in:
parent
f07b2e40bd
commit
e2c4eb5b36
|
@ -51,7 +51,8 @@
|
|||
android:configChanges="orientation|screenSize|smallestScreenSize|density|screenLayout|keyboard|keyboardHidden|navigation"/>
|
||||
<activity
|
||||
android:name=".activities.CreateNewUserActivity"
|
||||
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.AccountSettingsEmailActivity"
|
||||
android:configChanges="orientation|screenSize|smallestScreenSize|density|screenLayout|keyboard|keyboardHidden|navigation"
|
||||
|
@ -110,7 +111,8 @@
|
|||
android:windowSoftInputMode="adjustResize"/>
|
||||
<activity
|
||||
android:name=".activities.CreateOrganizationActivity"
|
||||
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.DiffActivity"
|
||||
android:configChanges="orientation|screenSize|smallestScreenSize|density|screenLayout|keyboard|keyboardHidden|navigation"
|
||||
|
|
|
@ -468,7 +468,7 @@ public class CreateIssueActivity extends BaseActivity
|
|||
RepoDetailActivity.updateRepo = true;
|
||||
MainActivity.reloadRepos = true;
|
||||
|
||||
SnackBar.info(
|
||||
SnackBar.success(
|
||||
ctx,
|
||||
findViewById(android.R.id.content),
|
||||
getString(R.string.issueCreated));
|
||||
|
|
|
@ -1,15 +1,11 @@
|
|||
package org.mian.gitnex.activities;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.os.Handler;
|
||||
import android.util.Patterns;
|
||||
import android.view.View;
|
||||
import android.view.inputmethod.InputMethodManager;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageView;
|
||||
import android.view.MenuItem;
|
||||
import androidx.annotation.NonNull;
|
||||
import java.util.Objects;
|
||||
import org.gitnex.tea4j.v2.models.CreateUserOption;
|
||||
import org.gitnex.tea4j.v2.models.User;
|
||||
import org.mian.gitnex.R;
|
||||
|
@ -17,7 +13,7 @@ import org.mian.gitnex.clients.RetrofitClient;
|
|||
import org.mian.gitnex.databinding.ActivityCreateNewUserBinding;
|
||||
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;
|
||||
|
||||
|
@ -26,93 +22,91 @@ import retrofit2.Callback;
|
|||
*/
|
||||
public class CreateNewUserActivity extends BaseActivity {
|
||||
|
||||
private View.OnClickListener onClickListener;
|
||||
private EditText fullName;
|
||||
private EditText userUserName;
|
||||
private EditText userEmail;
|
||||
private EditText userPassword;
|
||||
private Button createUserButton;
|
||||
private final View.OnClickListener createNewUserListener = v -> processCreateNewUser();
|
||||
private ActivityCreateNewUserBinding activityCreateNewUserBinding;
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
ActivityCreateNewUserBinding activityCreateNewUserBinding =
|
||||
ActivityCreateNewUserBinding.inflate(getLayoutInflater());
|
||||
activityCreateNewUserBinding = ActivityCreateNewUserBinding.inflate(getLayoutInflater());
|
||||
setContentView(activityCreateNewUserBinding.getRoot());
|
||||
|
||||
boolean connToInternet = AppUtil.hasNetworkConnection(appCtx);
|
||||
activityCreateNewUserBinding.topAppBar.setNavigationOnClickListener(
|
||||
v -> {
|
||||
finish();
|
||||
});
|
||||
|
||||
InputMethodManager imm =
|
||||
(InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||
MenuItem attachment = activityCreateNewUserBinding.topAppBar.getMenu().getItem(0);
|
||||
MenuItem markdown = activityCreateNewUserBinding.topAppBar.getMenu().getItem(1);
|
||||
attachment.setVisible(false);
|
||||
markdown.setVisible(false);
|
||||
|
||||
ImageView closeActivity = activityCreateNewUserBinding.close;
|
||||
createUserButton = activityCreateNewUserBinding.createUserButton;
|
||||
fullName = activityCreateNewUserBinding.fullName;
|
||||
userUserName = activityCreateNewUserBinding.userUserName;
|
||||
userEmail = activityCreateNewUserBinding.userEmail;
|
||||
userPassword = activityCreateNewUserBinding.userPassword;
|
||||
activityCreateNewUserBinding.topAppBar.setOnMenuItemClickListener(
|
||||
menuItem -> {
|
||||
int id = menuItem.getItemId();
|
||||
|
||||
fullName.requestFocus();
|
||||
assert imm != null;
|
||||
imm.showSoftInput(fullName, InputMethodManager.SHOW_IMPLICIT);
|
||||
|
||||
initCloseListener();
|
||||
closeActivity.setOnClickListener(onClickListener);
|
||||
|
||||
if (!connToInternet) {
|
||||
|
||||
disableProcessButton();
|
||||
} else {
|
||||
|
||||
createUserButton.setOnClickListener(createNewUserListener);
|
||||
}
|
||||
if (id == R.id.create) {
|
||||
processCreateNewUser();
|
||||
return true;
|
||||
} else {
|
||||
return super.onOptionsItemSelected(menuItem);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void processCreateNewUser() {
|
||||
|
||||
boolean connToInternet = AppUtil.hasNetworkConnection(appCtx);
|
||||
|
||||
String newFullName = fullName.getText().toString().trim();
|
||||
String newUserName = userUserName.getText().toString().trim();
|
||||
String newUserEmail = userEmail.getText().toString().trim();
|
||||
String newUserPassword = userPassword.getText().toString();
|
||||
|
||||
if (!connToInternet) {
|
||||
|
||||
Toasty.error(ctx, getResources().getString(R.string.checkNetConnection));
|
||||
return;
|
||||
}
|
||||
String newFullName =
|
||||
Objects.requireNonNull(activityCreateNewUserBinding.fullName.getText())
|
||||
.toString()
|
||||
.trim();
|
||||
String newUserName =
|
||||
Objects.requireNonNull(activityCreateNewUserBinding.userUserName.getText())
|
||||
.toString()
|
||||
.trim();
|
||||
String newUserEmail =
|
||||
Objects.requireNonNull(activityCreateNewUserBinding.userEmail.getText())
|
||||
.toString()
|
||||
.trim();
|
||||
String newUserPassword =
|
||||
Objects.requireNonNull(activityCreateNewUserBinding.userPassword.getText())
|
||||
.toString();
|
||||
|
||||
if (newFullName.equals("")
|
||||
|| newUserName.equals("") | newUserEmail.equals("")
|
||||
|| newUserPassword.equals("")) {
|
||||
|
||||
Toasty.error(ctx, getString(R.string.emptyFields));
|
||||
SnackBar.error(
|
||||
ctx, findViewById(android.R.id.content), getString(R.string.emptyFields));
|
||||
return;
|
||||
}
|
||||
|
||||
if (!AppUtil.checkStrings(newFullName)) {
|
||||
|
||||
Toasty.error(ctx, getString(R.string.userInvalidFullName));
|
||||
SnackBar.error(
|
||||
ctx,
|
||||
findViewById(android.R.id.content),
|
||||
getString(R.string.userInvalidFullName));
|
||||
return;
|
||||
}
|
||||
|
||||
if (!AppUtil.checkStringsWithAlphaNumeric(newUserName)) {
|
||||
|
||||
Toasty.error(ctx, getString(R.string.userInvalidUserName));
|
||||
SnackBar.error(
|
||||
ctx,
|
||||
findViewById(android.R.id.content),
|
||||
getString(R.string.userInvalidUserName));
|
||||
return;
|
||||
}
|
||||
|
||||
if (!Patterns.EMAIL_ADDRESS.matcher(newUserEmail).matches()) {
|
||||
|
||||
Toasty.error(ctx, getString(R.string.userInvalidEmail));
|
||||
SnackBar.error(
|
||||
ctx, findViewById(android.R.id.content), getString(R.string.userInvalidEmail));
|
||||
return;
|
||||
}
|
||||
|
||||
disableProcessButton();
|
||||
createNewUser(newFullName, newUserName, newUserEmail, newUserPassword);
|
||||
}
|
||||
|
||||
|
@ -129,7 +123,7 @@ public class CreateNewUserActivity extends BaseActivity {
|
|||
Call<User> call = RetrofitClient.getApiInterface(ctx).adminCreateUser(createUser);
|
||||
|
||||
call.enqueue(
|
||||
new Callback<User>() {
|
||||
new Callback<>() {
|
||||
|
||||
@Override
|
||||
public void onResponse(
|
||||
|
@ -137,53 +131,43 @@ public class CreateNewUserActivity extends BaseActivity {
|
|||
|
||||
if (response.code() == 201) {
|
||||
|
||||
Toasty.success(ctx, getString(R.string.userCreatedText));
|
||||
enableProcessButton();
|
||||
finish();
|
||||
SnackBar.success(
|
||||
ctx,
|
||||
findViewById(android.R.id.content),
|
||||
getString(R.string.userCreatedText));
|
||||
new Handler().postDelayed(() -> finish(), 3000);
|
||||
} else if (response.code() == 401) {
|
||||
|
||||
enableProcessButton();
|
||||
AlertDialogs.authorizationTokenRevokedDialog(ctx);
|
||||
} else if (response.code() == 403) {
|
||||
|
||||
enableProcessButton();
|
||||
Toasty.error(ctx, ctx.getString(R.string.authorizeError));
|
||||
SnackBar.error(
|
||||
ctx,
|
||||
findViewById(android.R.id.content),
|
||||
getString(R.string.authorizeError));
|
||||
} else if (response.code() == 404) {
|
||||
|
||||
enableProcessButton();
|
||||
Toasty.warning(ctx, ctx.getString(R.string.apiNotFound));
|
||||
SnackBar.error(
|
||||
ctx,
|
||||
findViewById(android.R.id.content),
|
||||
getString(R.string.apiNotFound));
|
||||
} else if (response.code() == 422) {
|
||||
|
||||
enableProcessButton();
|
||||
Toasty.warning(ctx, ctx.getString(R.string.userExistsError));
|
||||
SnackBar.warning(
|
||||
ctx,
|
||||
findViewById(android.R.id.content),
|
||||
getString(R.string.userExistsError));
|
||||
} 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<User> call, @NonNull Throwable t) {
|
||||
|
||||
Log.e("onFailure", t.toString());
|
||||
enableProcessButton();
|
||||
}
|
||||
public void onFailure(@NonNull Call<User> call, @NonNull Throwable t) {}
|
||||
});
|
||||
}
|
||||
|
||||
private void initCloseListener() {
|
||||
|
||||
onClickListener = view -> finish();
|
||||
}
|
||||
|
||||
private void disableProcessButton() {
|
||||
|
||||
createUserButton.setEnabled(false);
|
||||
}
|
||||
|
||||
private void enableProcessButton() {
|
||||
|
||||
createUserButton.setEnabled(true);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,16 +1,12 @@
|
|||
package org.mian.gitnex.activities;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.os.Handler;
|
||||
import android.view.MenuItem;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.view.inputmethod.InputMethodManager;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageView;
|
||||
import androidx.annotation.NonNull;
|
||||
import java.util.Objects;
|
||||
import org.gitnex.tea4j.v2.models.CreateOrgOption;
|
||||
import org.gitnex.tea4j.v2.models.Organization;
|
||||
import org.mian.gitnex.R;
|
||||
|
@ -19,7 +15,7 @@ import org.mian.gitnex.databinding.ActivityCreateOrganizationBinding;
|
|||
import org.mian.gitnex.fragments.OrganizationsFragment;
|
||||
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;
|
||||
|
||||
|
@ -28,13 +24,7 @@ import retrofit2.Callback;
|
|||
*/
|
||||
public class CreateOrganizationActivity extends BaseActivity {
|
||||
|
||||
public ImageView closeActivity;
|
||||
private View.OnClickListener onClickListener;
|
||||
private Button createOrganizationButton;
|
||||
|
||||
private EditText orgName;
|
||||
private EditText orgDesc;
|
||||
private final View.OnClickListener createOrgListener = v -> processNewOrganization();
|
||||
private ActivityCreateOrganizationBinding activityCreateOrganizationBinding;
|
||||
|
||||
@SuppressLint("ClickableViewAccessibility")
|
||||
@Override
|
||||
|
@ -42,24 +32,18 @@ public class CreateOrganizationActivity extends BaseActivity {
|
|||
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
ActivityCreateOrganizationBinding activityCreateOrganizationBinding =
|
||||
activityCreateOrganizationBinding =
|
||||
ActivityCreateOrganizationBinding.inflate(getLayoutInflater());
|
||||
setContentView(activityCreateOrganizationBinding.getRoot());
|
||||
|
||||
boolean connToInternet = AppUtil.hasNetworkConnection(appCtx);
|
||||
MenuItem attachment = activityCreateOrganizationBinding.topAppBar.getMenu().getItem(0);
|
||||
MenuItem markdown = activityCreateOrganizationBinding.topAppBar.getMenu().getItem(1);
|
||||
attachment.setVisible(false);
|
||||
markdown.setVisible(false);
|
||||
|
||||
InputMethodManager imm =
|
||||
(InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||
activityCreateOrganizationBinding.topAppBar.setNavigationOnClickListener(v -> finish());
|
||||
|
||||
closeActivity = activityCreateOrganizationBinding.close;
|
||||
orgName = activityCreateOrganizationBinding.newOrganizationName;
|
||||
orgDesc = activityCreateOrganizationBinding.newOrganizationDescription;
|
||||
|
||||
orgName.requestFocus();
|
||||
assert imm != null;
|
||||
imm.showSoftInput(orgName, InputMethodManager.SHOW_IMPLICIT);
|
||||
|
||||
orgDesc.setOnTouchListener(
|
||||
activityCreateOrganizationBinding.newOrganizationDescription.setOnTouchListener(
|
||||
(touchView, motionEvent) -> {
|
||||
touchView.getParent().requestDisallowInterceptTouchEvent(true);
|
||||
|
||||
|
@ -71,56 +55,53 @@ public class CreateOrganizationActivity extends BaseActivity {
|
|||
return false;
|
||||
});
|
||||
|
||||
initCloseListener();
|
||||
closeActivity.setOnClickListener(onClickListener);
|
||||
activityCreateOrganizationBinding.topAppBar.setOnMenuItemClickListener(
|
||||
menuItem -> {
|
||||
int id = menuItem.getItemId();
|
||||
|
||||
createOrganizationButton = activityCreateOrganizationBinding.createNewOrganizationButton;
|
||||
|
||||
if (!connToInternet) {
|
||||
|
||||
createOrganizationButton.setEnabled(false);
|
||||
} else {
|
||||
|
||||
createOrganizationButton.setOnClickListener(createOrgListener);
|
||||
}
|
||||
}
|
||||
|
||||
private void initCloseListener() {
|
||||
|
||||
onClickListener = view -> finish();
|
||||
if (id == R.id.create) {
|
||||
processNewOrganization();
|
||||
return true;
|
||||
} else {
|
||||
return super.onOptionsItemSelected(menuItem);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void processNewOrganization() {
|
||||
|
||||
boolean connToInternet = AppUtil.hasNetworkConnection(appCtx);
|
||||
|
||||
String newOrgName = orgName.getText().toString();
|
||||
String newOrgDesc = orgDesc.getText().toString();
|
||||
|
||||
if (!connToInternet) {
|
||||
|
||||
Toasty.error(ctx, getResources().getString(R.string.checkNetConnection));
|
||||
return;
|
||||
}
|
||||
String newOrgName =
|
||||
Objects.requireNonNull(
|
||||
activityCreateOrganizationBinding.newOrganizationName.getText())
|
||||
.toString();
|
||||
String newOrgDesc =
|
||||
Objects.requireNonNull(
|
||||
activityCreateOrganizationBinding.newOrganizationDescription
|
||||
.getText())
|
||||
.toString();
|
||||
|
||||
if (!newOrgDesc.equals("")) {
|
||||
|
||||
if (newOrgDesc.length() > 255) {
|
||||
|
||||
Toasty.warning(ctx, getString(R.string.orgDescError));
|
||||
SnackBar.error(
|
||||
ctx, findViewById(android.R.id.content), getString(R.string.orgDescError));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (newOrgName.equals("")) {
|
||||
|
||||
Toasty.error(ctx, getString(R.string.orgNameErrorEmpty));
|
||||
SnackBar.error(
|
||||
ctx, findViewById(android.R.id.content), getString(R.string.orgNameErrorEmpty));
|
||||
} else if (!AppUtil.checkStrings(newOrgName)) {
|
||||
|
||||
Toasty.warning(ctx, getString(R.string.orgNameErrorInvalid));
|
||||
SnackBar.error(
|
||||
ctx,
|
||||
findViewById(android.R.id.content),
|
||||
getString(R.string.orgNameErrorInvalid));
|
||||
} else {
|
||||
|
||||
disableProcessButton();
|
||||
createNewOrganization(newOrgName, newOrgDesc);
|
||||
}
|
||||
}
|
||||
|
@ -134,7 +115,7 @@ public class CreateOrganizationActivity extends BaseActivity {
|
|||
Call<Organization> call = RetrofitClient.getApiInterface(ctx).orgCreate(createOrganization);
|
||||
|
||||
call.enqueue(
|
||||
new Callback<Organization>() {
|
||||
new Callback<>() {
|
||||
|
||||
@Override
|
||||
public void onResponse(
|
||||
|
@ -143,51 +124,46 @@ public class CreateOrganizationActivity extends BaseActivity {
|
|||
|
||||
if (response.code() == 201) {
|
||||
OrganizationsFragment.orgCreated = true;
|
||||
enableProcessButton();
|
||||
Toasty.success(ctx, getString(R.string.orgCreated));
|
||||
finish();
|
||||
SnackBar.success(
|
||||
ctx,
|
||||
findViewById(android.R.id.content),
|
||||
getString(R.string.orgCreated));
|
||||
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.orgExistsError));
|
||||
SnackBar.error(
|
||||
ctx,
|
||||
findViewById(android.R.id.content),
|
||||
getString(R.string.orgExistsError));
|
||||
} else if (response.code() == 422) {
|
||||
|
||||
enableProcessButton();
|
||||
Toasty.warning(ctx, getString(R.string.orgExistsError));
|
||||
SnackBar.error(
|
||||
ctx,
|
||||
findViewById(android.R.id.content),
|
||||
getString(R.string.orgExistsError));
|
||||
} else {
|
||||
|
||||
if (response.code() == 404) {
|
||||
|
||||
enableProcessButton();
|
||||
Toasty.warning(ctx, getString(R.string.apiNotFound));
|
||||
SnackBar.error(
|
||||
ctx,
|
||||
findViewById(android.R.id.content),
|
||||
getString(R.string.apiNotFound));
|
||||
} 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<Organization> call, @NonNull Throwable t) {
|
||||
|
||||
Log.e("onFailure", t.toString());
|
||||
enableProcessButton();
|
||||
}
|
||||
public void onFailure(@NonNull Call<Organization> call, @NonNull Throwable t) {}
|
||||
});
|
||||
}
|
||||
|
||||
private void disableProcessButton() {
|
||||
|
||||
createOrganizationButton.setEnabled(false);
|
||||
}
|
||||
|
||||
private void enableProcessButton() {
|
||||
|
||||
createOrganizationButton.setEnabled(true);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,20 +1,15 @@
|
|||
package org.mian.gitnex.activities;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.drawable.GradientDrawable;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.os.Handler;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.inputmethod.InputMethodManager;
|
||||
import android.widget.Button;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.core.content.res.ResourcesCompat;
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import org.gitnex.tea4j.v2.models.CreateTeamOption;
|
||||
import org.gitnex.tea4j.v2.models.Team;
|
||||
import org.mian.gitnex.R;
|
||||
|
@ -23,26 +18,17 @@ import org.mian.gitnex.databinding.ActivityCreateTeamByOrgBinding;
|
|||
import org.mian.gitnex.fragments.OrganizationTeamsFragment;
|
||||
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;
|
||||
|
||||
/**
|
||||
* @author M M Arif
|
||||
*/
|
||||
public class CreateTeamByOrgActivity extends BaseActivity implements View.OnClickListener {
|
||||
public class CreateTeamByOrgActivity extends BaseActivity {
|
||||
|
||||
private View.OnClickListener onClickListener;
|
||||
private TextView teamName;
|
||||
private TextView teamDesc;
|
||||
private TextView teamPermission;
|
||||
private TextView teamPermissionDetail;
|
||||
private TextView teamAccessControls;
|
||||
private TextView teamAccessControlsArray;
|
||||
private Button createTeamButton;
|
||||
private final String[] permissionList = {"Read", "Write", "Admin"};
|
||||
public int permissionSelectedChoice = -1;
|
||||
|
||||
private final String[] accessControlsList =
|
||||
new String[] {
|
||||
"Code",
|
||||
|
@ -53,8 +39,8 @@ public class CreateTeamByOrgActivity extends BaseActivity implements View.OnClic
|
|||
"External Wiki",
|
||||
"External Issues"
|
||||
};
|
||||
|
||||
private List<String> pushAccessList;
|
||||
private ActivityCreateTeamByOrgBinding activityCreateTeamByOrgBinding;
|
||||
|
||||
private final boolean[] selectedAccessControlsTrueFalse =
|
||||
new boolean[] {false, false, false, false, false, false, false};
|
||||
|
@ -64,32 +50,18 @@ public class CreateTeamByOrgActivity extends BaseActivity implements View.OnClic
|
|||
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
ActivityCreateTeamByOrgBinding activityCreateTeamByOrgBinding =
|
||||
activityCreateTeamByOrgBinding =
|
||||
ActivityCreateTeamByOrgBinding.inflate(getLayoutInflater());
|
||||
setContentView(activityCreateTeamByOrgBinding.getRoot());
|
||||
|
||||
boolean connToInternet = AppUtil.hasNetworkConnection(appCtx);
|
||||
MenuItem attachment = activityCreateTeamByOrgBinding.topAppBar.getMenu().getItem(0);
|
||||
MenuItem markdown = activityCreateTeamByOrgBinding.topAppBar.getMenu().getItem(1);
|
||||
attachment.setVisible(false);
|
||||
markdown.setVisible(false);
|
||||
|
||||
InputMethodManager imm =
|
||||
(InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||
activityCreateTeamByOrgBinding.topAppBar.setNavigationOnClickListener(v -> finish());
|
||||
|
||||
ImageView closeActivity = activityCreateTeamByOrgBinding.close;
|
||||
teamName = activityCreateTeamByOrgBinding.teamName;
|
||||
teamDesc = activityCreateTeamByOrgBinding.teamDesc;
|
||||
teamPermission = activityCreateTeamByOrgBinding.teamPermission;
|
||||
teamPermissionDetail = activityCreateTeamByOrgBinding.teamPermissionDetail;
|
||||
teamAccessControls = activityCreateTeamByOrgBinding.teamAccessControls;
|
||||
teamAccessControlsArray = activityCreateTeamByOrgBinding.teamAccessControlsArray;
|
||||
createTeamButton = activityCreateTeamByOrgBinding.createTeamButton;
|
||||
|
||||
teamName.requestFocus();
|
||||
assert imm != null;
|
||||
imm.showSoftInput(teamName, InputMethodManager.SHOW_IMPLICIT);
|
||||
|
||||
initCloseListener();
|
||||
closeActivity.setOnClickListener(onClickListener);
|
||||
|
||||
teamPermission.setOnClickListener(
|
||||
activityCreateTeamByOrgBinding.teamPermission.setOnClickListener(
|
||||
view -> {
|
||||
MaterialAlertDialogBuilder materialAlertDialogBuilderPerm =
|
||||
new MaterialAlertDialogBuilder(ctx)
|
||||
|
@ -100,29 +72,37 @@ public class CreateTeamByOrgActivity extends BaseActivity implements View.OnClic
|
|||
permissionSelectedChoice,
|
||||
(dialogInterface, i) -> {
|
||||
permissionSelectedChoice = i;
|
||||
teamPermission.setText(permissionList[i]);
|
||||
activityCreateTeamByOrgBinding.teamPermission
|
||||
.setText(permissionList[i]);
|
||||
|
||||
switch (permissionList[i]) {
|
||||
case "Read":
|
||||
teamPermissionDetail.setVisibility(
|
||||
activityCreateTeamByOrgBinding
|
||||
.teamPermissionDetail.setVisibility(
|
||||
View.VISIBLE);
|
||||
teamPermissionDetail.setText(
|
||||
activityCreateTeamByOrgBinding
|
||||
.teamPermissionDetail.setText(
|
||||
R.string.newTeamPermissionRead);
|
||||
break;
|
||||
case "Write":
|
||||
teamPermissionDetail.setVisibility(
|
||||
activityCreateTeamByOrgBinding
|
||||
.teamPermissionDetail.setVisibility(
|
||||
View.VISIBLE);
|
||||
teamPermissionDetail.setText(
|
||||
activityCreateTeamByOrgBinding
|
||||
.teamPermissionDetail.setText(
|
||||
R.string.newTeamPermissionWrite);
|
||||
break;
|
||||
case "Admin":
|
||||
teamPermissionDetail.setVisibility(
|
||||
activityCreateTeamByOrgBinding
|
||||
.teamPermissionDetail.setVisibility(
|
||||
View.VISIBLE);
|
||||
teamPermissionDetail.setText(
|
||||
activityCreateTeamByOrgBinding
|
||||
.teamPermissionDetail.setText(
|
||||
R.string.newTeamPermissionAdmin);
|
||||
break;
|
||||
default:
|
||||
teamPermissionDetail.setVisibility(
|
||||
activityCreateTeamByOrgBinding
|
||||
.teamPermissionDetail.setVisibility(
|
||||
View.GONE);
|
||||
break;
|
||||
}
|
||||
|
@ -133,10 +113,10 @@ public class CreateTeamByOrgActivity extends BaseActivity implements View.OnClic
|
|||
materialAlertDialogBuilderPerm.create().show();
|
||||
});
|
||||
|
||||
teamAccessControls.setOnClickListener(
|
||||
activityCreateTeamByOrgBinding.teamAccessControls.setOnClickListener(
|
||||
v -> {
|
||||
teamAccessControls.setText("");
|
||||
teamAccessControlsArray.setText("");
|
||||
activityCreateTeamByOrgBinding.teamAccessControls.setText("");
|
||||
activityCreateTeamByOrgBinding.teamAccessControlsArray.setText("");
|
||||
pushAccessList = Arrays.asList(accessControlsList);
|
||||
|
||||
MaterialAlertDialogBuilder materialAlertDialogBuilder =
|
||||
|
@ -181,19 +161,23 @@ public class CreateTeamByOrgActivity extends BaseActivity implements View.OnClic
|
|||
|
||||
if (value) {
|
||||
|
||||
teamAccessControls.setText(
|
||||
activityCreateTeamByOrgBinding
|
||||
.teamAccessControls.setText(
|
||||
getString(
|
||||
R.string
|
||||
.newTeamPermissionValues,
|
||||
teamAccessControls
|
||||
activityCreateTeamByOrgBinding
|
||||
.teamAccessControls
|
||||
.getText(),
|
||||
pushAccessList.get(
|
||||
selectedVal)));
|
||||
teamAccessControlsArray.setText(
|
||||
activityCreateTeamByOrgBinding
|
||||
.teamAccessControlsArray.setText(
|
||||
getString(
|
||||
R.string
|
||||
.newTeamPermissionValuesFinal,
|
||||
teamAccessControlsArray
|
||||
activityCreateTeamByOrgBinding
|
||||
.teamAccessControlsArray
|
||||
.getText(),
|
||||
repoCode));
|
||||
}
|
||||
|
@ -203,20 +187,26 @@ public class CreateTeamByOrgActivity extends BaseActivity implements View.OnClic
|
|||
|
||||
String data =
|
||||
String.valueOf(
|
||||
teamAccessControls.getText());
|
||||
activityCreateTeamByOrgBinding
|
||||
.teamAccessControls
|
||||
.getText());
|
||||
if (!data.equals("")) {
|
||||
|
||||
teamAccessControls.setText(
|
||||
activityCreateTeamByOrgBinding
|
||||
.teamAccessControls.setText(
|
||||
data.substring(0, data.length() - 2));
|
||||
}
|
||||
|
||||
String dataArray =
|
||||
String.valueOf(
|
||||
teamAccessControlsArray.getText());
|
||||
activityCreateTeamByOrgBinding
|
||||
.teamAccessControlsArray
|
||||
.getText());
|
||||
|
||||
if (!dataArray.equals("")) {
|
||||
|
||||
teamAccessControlsArray.setText(
|
||||
activityCreateTeamByOrgBinding
|
||||
.teamAccessControlsArray.setText(
|
||||
dataArray.substring(
|
||||
0, dataArray.length() - 2));
|
||||
}
|
||||
|
@ -225,47 +215,47 @@ public class CreateTeamByOrgActivity extends BaseActivity implements View.OnClic
|
|||
materialAlertDialogBuilder.create().show();
|
||||
});
|
||||
|
||||
createTeamButton.setEnabled(false);
|
||||
activityCreateTeamByOrgBinding.topAppBar.setOnMenuItemClickListener(
|
||||
menuItem -> {
|
||||
int id = menuItem.getItemId();
|
||||
|
||||
if (!connToInternet) {
|
||||
|
||||
createTeamButton.setEnabled(false);
|
||||
GradientDrawable shape = new GradientDrawable();
|
||||
shape.setCornerRadius(8);
|
||||
shape.setColor(ResourcesCompat.getColor(getResources(), R.color.hintColor, null));
|
||||
createTeamButton.setBackground(shape);
|
||||
} else {
|
||||
|
||||
createTeamButton.setEnabled(true);
|
||||
createTeamButton.setOnClickListener(this);
|
||||
}
|
||||
if (id == R.id.create) {
|
||||
processCreateTeam();
|
||||
return true;
|
||||
} else {
|
||||
return super.onOptionsItemSelected(menuItem);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void processCreateTeam() {
|
||||
|
||||
final String orgName = getIntent().getStringExtra("orgName");
|
||||
|
||||
boolean connToInternet = AppUtil.hasNetworkConnection(appCtx);
|
||||
String newTeamName = teamName.getText().toString();
|
||||
String newTeamDesc = teamDesc.getText().toString();
|
||||
String newTeamPermission = teamPermission.getText().toString().toLowerCase();
|
||||
String newTeamAccessControls = teamAccessControlsArray.getText().toString();
|
||||
|
||||
if (!connToInternet) {
|
||||
|
||||
Toasty.error(ctx, getResources().getString(R.string.checkNetConnection));
|
||||
return;
|
||||
}
|
||||
String newTeamName =
|
||||
Objects.requireNonNull(activityCreateTeamByOrgBinding.teamName.getText())
|
||||
.toString();
|
||||
String newTeamDesc =
|
||||
Objects.requireNonNull(activityCreateTeamByOrgBinding.teamDesc.getText())
|
||||
.toString();
|
||||
String newTeamPermission =
|
||||
Objects.requireNonNull(activityCreateTeamByOrgBinding.teamPermission.getText())
|
||||
.toString()
|
||||
.toLowerCase();
|
||||
String newTeamAccessControls =
|
||||
activityCreateTeamByOrgBinding.teamAccessControlsArray.getText().toString();
|
||||
|
||||
if (newTeamName.equals("")) {
|
||||
|
||||
Toasty.error(ctx, getString(R.string.teamNameEmpty));
|
||||
SnackBar.error(
|
||||
ctx, findViewById(android.R.id.content), getString(R.string.teamNameEmpty));
|
||||
return;
|
||||
}
|
||||
|
||||
if (!AppUtil.checkStringsWithAlphaNumericDashDotUnderscore(newTeamName)) {
|
||||
|
||||
Toasty.warning(ctx, getString(R.string.teamNameError));
|
||||
SnackBar.error(
|
||||
ctx, findViewById(android.R.id.content), getString(R.string.teamNameError));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -273,20 +263,25 @@ public class CreateTeamByOrgActivity extends BaseActivity implements View.OnClic
|
|||
|
||||
if (!AppUtil.checkStrings(newTeamDesc)) {
|
||||
|
||||
Toasty.warning(ctx, getString(R.string.teamDescError));
|
||||
SnackBar.error(
|
||||
ctx, findViewById(android.R.id.content), getString(R.string.teamDescError));
|
||||
return;
|
||||
}
|
||||
|
||||
if (newTeamDesc.length() > 100) {
|
||||
|
||||
Toasty.warning(ctx, getString(R.string.teamDescLimit));
|
||||
SnackBar.error(
|
||||
ctx, findViewById(android.R.id.content), getString(R.string.teamDescLimit));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (newTeamPermission.equals("")) {
|
||||
|
||||
Toasty.error(ctx, getString(R.string.teamPermissionEmpty));
|
||||
SnackBar.error(
|
||||
ctx,
|
||||
findViewById(android.R.id.content),
|
||||
getString(R.string.teamPermissionEmpty));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -329,7 +324,7 @@ public class CreateTeamByOrgActivity extends BaseActivity implements View.OnClic
|
|||
RetrofitClient.getApiInterface(ctx).orgCreateTeam(orgName, createNewTeamJson);
|
||||
|
||||
call3.enqueue(
|
||||
new Callback<Team>() {
|
||||
new Callback<>() {
|
||||
|
||||
@Override
|
||||
public void onResponse(
|
||||
|
@ -341,39 +336,32 @@ public class CreateTeamByOrgActivity extends BaseActivity implements View.OnClic
|
|||
|
||||
OrganizationTeamsFragment.resumeTeams = true;
|
||||
|
||||
Toasty.success(ctx, getString(R.string.teamCreated));
|
||||
finish();
|
||||
SnackBar.success(
|
||||
ctx,
|
||||
findViewById(android.R.id.content),
|
||||
getString(R.string.teamCreated));
|
||||
new Handler().postDelayed(() -> finish(), 3000);
|
||||
}
|
||||
} else if (response2.code() == 404) {
|
||||
|
||||
Toasty.warning(ctx, getString(R.string.apiNotFound));
|
||||
SnackBar.error(
|
||||
ctx,
|
||||
findViewById(android.R.id.content),
|
||||
getString(R.string.apiNotFound));
|
||||
} else if (response2.code() == 401) {
|
||||
|
||||
AlertDialogs.authorizationTokenRevokedDialog(ctx);
|
||||
} else {
|
||||
|
||||
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<Team> call, @NonNull Throwable t) {
|
||||
Log.e("onFailure", t.toString());
|
||||
}
|
||||
public void onFailure(@NonNull Call<Team> call, @NonNull Throwable t) {}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
||||
if (v == createTeamButton) {
|
||||
|
||||
processCreateTeam();
|
||||
}
|
||||
}
|
||||
|
||||
private void initCloseListener() {
|
||||
|
||||
onClickListener = view -> finish();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -216,6 +216,7 @@ public class Markdown {
|
|||
}
|
||||
}
|
||||
textView.setTypeface(tf);
|
||||
textView.setTextIsSelectable(true);
|
||||
super.beforeSetText(textView, markdown);
|
||||
}
|
||||
|
||||
|
@ -382,6 +383,7 @@ public class Markdown {
|
|||
}
|
||||
}
|
||||
textView.setTypeface(tf);
|
||||
textView.setTextIsSelectable(true);
|
||||
super.beforeSetText(textView, markdown);
|
||||
}
|
||||
|
||||
|
|
|
@ -53,7 +53,6 @@
|
|||
android:layout_marginBottom="@dimen/dimen8dp"
|
||||
android:hint="@string/accountEmailTitle"
|
||||
android:textColorHint="?attr/hintColor"
|
||||
app:boxBackgroundColor="?attr/inputBackgroundColor"
|
||||
app:boxStrokeErrorColor="@color/darkRed"
|
||||
app:endIconMode="clear_text"
|
||||
app:endIconTint="?attr/iconsColor"
|
||||
|
|
|
@ -1,61 +1,50 @@
|
|||
<?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="wrap_content"
|
||||
android:background="?attr/primaryBackgroundColor">
|
||||
app:layout_scrollFlags="scroll|exitUntilCollapsed|snap"
|
||||
android:background="?attr/primaryBackgroundColor"
|
||||
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/adminCreateNewUser"
|
||||
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/adminCreateNewUser"
|
||||
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"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:padding="@dimen/dimen16dp">
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:padding="@dimen/dimen16dp">
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/fullNameLayout"
|
||||
|
@ -65,7 +54,6 @@
|
|||
android:layout_marginBottom="@dimen/dimen8dp"
|
||||
android:hint="@string/userFullNameText"
|
||||
android:textColorHint="?attr/hintColor"
|
||||
app:boxBackgroundColor="?attr/inputBackgroundColor"
|
||||
app:boxStrokeErrorColor="@color/darkRed"
|
||||
app:endIconMode="clear_text"
|
||||
app:endIconTint="?attr/iconsColor"
|
||||
|
@ -93,7 +81,6 @@
|
|||
android:layout_marginBottom="@dimen/dimen8dp"
|
||||
android:hint="@string/userUserName"
|
||||
android:textColorHint="?attr/hintColor"
|
||||
app:boxBackgroundColor="?attr/inputBackgroundColor"
|
||||
app:boxStrokeErrorColor="@color/darkRed"
|
||||
app:endIconMode="clear_text"
|
||||
app:endIconTint="?attr/iconsColor"
|
||||
|
@ -120,7 +107,6 @@
|
|||
android:layout_marginBottom="@dimen/dimen8dp"
|
||||
android:hint="@string/userEmail"
|
||||
android:textColorHint="?attr/hintColor"
|
||||
app:boxBackgroundColor="?attr/inputBackgroundColor"
|
||||
app:boxStrokeErrorColor="@color/darkRed"
|
||||
app:endIconMode="clear_text"
|
||||
app:endIconTint="?attr/iconsColor"
|
||||
|
@ -147,7 +133,6 @@
|
|||
android:layout_marginBottom="@dimen/dimen8dp"
|
||||
android:hint="@string/userPassword"
|
||||
android:textColorHint="?attr/hintColor"
|
||||
app:boxBackgroundColor="?attr/inputBackgroundColor"
|
||||
app:boxStrokeErrorColor="@color/darkRed"
|
||||
app:endIconMode="clear_text"
|
||||
app:endIconTint="?attr/iconsColor"
|
||||
|
@ -165,17 +150,8 @@
|
|||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/createUserButton"
|
||||
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"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</ScrollView>
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
|
||||
</LinearLayout>
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
|
|
|
@ -1,61 +1,50 @@
|
|||
<?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="wrap_content"
|
||||
android:background="?attr/primaryBackgroundColor">
|
||||
app:layout_scrollFlags="scroll|exitUntilCollapsed|snap"
|
||||
android:background="?attr/primaryBackgroundColor"
|
||||
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/pageTitleCreateOrganization"
|
||||
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/pageTitleCreateOrganization"
|
||||
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"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:padding="@dimen/dimen16dp">
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:padding="@dimen/dimen16dp">
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/newOrganizationNameLayout"
|
||||
|
@ -65,7 +54,6 @@
|
|||
android:layout_marginBottom="@dimen/dimen8dp"
|
||||
android:hint="@string/newOrgTintCopy"
|
||||
android:textColorHint="?attr/hintColor"
|
||||
app:boxBackgroundColor="?attr/inputBackgroundColor"
|
||||
app:boxStrokeErrorColor="@color/darkRed"
|
||||
app:endIconMode="clear_text"
|
||||
app:endIconTint="?attr/iconsColor"
|
||||
|
@ -93,7 +81,6 @@
|
|||
android:layout_marginBottom="@dimen/dimen8dp"
|
||||
android:hint="@string/newOrgDescTintCopy"
|
||||
android:textColorHint="?attr/hintColor"
|
||||
app:boxBackgroundColor="?attr/inputBackgroundColor"
|
||||
app:boxStrokeErrorColor="@color/darkRed"
|
||||
app:counterEnabled="true"
|
||||
app:counterMaxLength="255"
|
||||
|
@ -116,18 +103,8 @@
|
|||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/createNewOrganizationButton"
|
||||
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"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</ScrollView>
|
||||
|
||||
</LinearLayout>
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
|
|
|
@ -1,61 +1,50 @@
|
|||
<?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="wrap_content"
|
||||
android:background="?attr/primaryBackgroundColor">
|
||||
app:layout_scrollFlags="scroll|exitUntilCollapsed|snap"
|
||||
android:background="?attr/primaryBackgroundColor"
|
||||
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/pageTitleCreateTeam"
|
||||
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/pageTitleCreateTeam"
|
||||
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"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:padding="@dimen/dimen16dp">
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:padding="@dimen/dimen16dp">
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/teamNameLayout"
|
||||
|
@ -65,7 +54,6 @@
|
|||
android:layout_marginBottom="@dimen/dimen8dp"
|
||||
android:hint="@string/newTeamTitle"
|
||||
android:textColorHint="?attr/hintColor"
|
||||
app:boxBackgroundColor="?attr/inputBackgroundColor"
|
||||
app:boxStrokeErrorColor="@color/darkRed"
|
||||
app:endIconMode="clear_text"
|
||||
app:endIconTint="?attr/iconsColor"
|
||||
|
@ -81,7 +69,7 @@
|
|||
android:textColor="?attr/inputTextColor"
|
||||
android:textColorHighlight="?attr/hintColor"
|
||||
android:textColorHint="?attr/hintColor"
|
||||
android:textSize="@dimen/dimen16sp"/>
|
||||
android:textSize="@dimen/dimen16sp" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
|
@ -93,7 +81,6 @@
|
|||
android:layout_marginBottom="@dimen/dimen8dp"
|
||||
android:hint="@string/newTeamDesc"
|
||||
android:textColorHint="?attr/hintColor"
|
||||
app:boxBackgroundColor="?attr/inputBackgroundColor"
|
||||
app:boxStrokeErrorColor="@color/darkRed"
|
||||
app:counterEnabled="true"
|
||||
app:counterMaxLength="255"
|
||||
|
@ -111,7 +98,7 @@
|
|||
android:textColor="?attr/inputTextColor"
|
||||
android:textColorHighlight="?attr/hintColor"
|
||||
android:textColorHint="?attr/hintColor"
|
||||
android:textSize="@dimen/dimen16sp"/>
|
||||
android:textSize="@dimen/dimen16sp" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
|
@ -123,7 +110,6 @@
|
|||
android:layout_marginBottom="@dimen/dimen8dp"
|
||||
android:hint="@string/newTeamPermission"
|
||||
android:textColorHint="?attr/hintColor"
|
||||
app:boxBackgroundColor="?attr/inputBackgroundColor"
|
||||
app:boxStrokeErrorColor="@color/darkRed"
|
||||
app:hintTextColor="?attr/hintColor">
|
||||
|
||||
|
@ -136,7 +122,7 @@
|
|||
android:textColor="?attr/inputTextColor"
|
||||
android:textColorHighlight="?attr/hintColor"
|
||||
android:textColorHint="?attr/hintColor"
|
||||
android:textSize="@dimen/dimen16sp"/>
|
||||
android:textSize="@dimen/dimen16sp" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
|
@ -147,7 +133,7 @@
|
|||
android:gravity="start"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="@dimen/dimen12sp"
|
||||
android:visibility="gone"/>
|
||||
android:visibility="gone" />
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/teamAccessControlsLayout"
|
||||
|
@ -157,7 +143,6 @@
|
|||
android:layout_marginBottom="@dimen/dimen8dp"
|
||||
android:hint="@string/newTeamAccessControls"
|
||||
android:textColorHint="?attr/hintColor"
|
||||
app:boxBackgroundColor="?attr/inputBackgroundColor"
|
||||
app:boxStrokeErrorColor="@color/darkRed"
|
||||
app:hintTextColor="?attr/hintColor">
|
||||
|
||||
|
@ -170,7 +155,7 @@
|
|||
android:textColor="?attr/inputTextColor"
|
||||
android:textColorHighlight="?attr/hintColor"
|
||||
android:textColorHint="?attr/hintColor"
|
||||
android:textSize="@dimen/dimen16sp"/>
|
||||
android:textSize="@dimen/dimen16sp" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
|
@ -178,19 +163,10 @@
|
|||
android:id="@+id/teamAccessControlsArray"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"/>
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/createTeamButton"
|
||||
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:visibility="gone" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</ScrollView>
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
|
||||
</LinearLayout>
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
|
|
|
@ -180,6 +180,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:ellipsize="middle"
|
||||
android:singleLine="true"
|
||||
android:textIsSelectable="true"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold" />
|
||||
|
@ -235,6 +236,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dimen8dp"
|
||||
android:singleLine="true"
|
||||
android:textIsSelectable="true"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="@dimen/dimen14sp" />
|
||||
|
||||
|
|
|
@ -73,12 +73,11 @@
|
|||
android:textColorLink="@color/lightBlue"
|
||||
android:textSize="@dimen/dimen16sp"/>
|
||||
|
||||
<View
|
||||
<com.google.android.material.divider.MaterialDivider
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dimen24dp"
|
||||
android:layout_marginBottom="@dimen/dimen24dp"
|
||||
android:background="?attr/dividerColor"/>
|
||||
android:layout_marginBottom="@dimen/dimen24dp" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
|
|
|
@ -61,6 +61,7 @@
|
|||
android:text="@string/newIssueTitle"
|
||||
android:textAlignment="gravity"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textIsSelectable="true"
|
||||
android:textSize="@dimen/dimen16sp"
|
||||
tools:text="Id illum odio repellat omnis fuga deserunt aut. Ut est aut similique qui incidunt quia et." />
|
||||
|
||||
|
|
|
@ -76,6 +76,7 @@
|
|||
android:textAlignment="gravity"
|
||||
android:text="@string/newIssueTitle"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textIsSelectable="true"
|
||||
android:textSize="@dimen/dimen16sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
|
|
@ -53,6 +53,7 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textIsSelectable="true"
|
||||
android:textSize="@dimen/dimen14sp"
|
||||
tools:text="@string/orgName"/>
|
||||
|
||||
|
@ -64,6 +65,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:text="@string/repoName"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textIsSelectable="true"
|
||||
android:textSize="@dimen/dimen18sp"
|
||||
android:textStyle="bold"/>
|
||||
|
||||
|
@ -73,6 +75,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/dimen8dp"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textIsSelectable="true"
|
||||
android:textSize="@dimen/dimen16sp"
|
||||
android:visibility="gone"
|
||||
android:text="@string/noDataDescription"/>
|
||||
|
|
Loading…
Reference in New Issue