PR targeting multiple issues: #1101, #1092, #1080, #1079, #1057 (#1109)

- [x] Closes #1101
- [x] Closes #1092
- [x] Closes #1080
- [x] Closes #1079
- [x] Closes #1057
- [x] Closes #1107
- [x] Closes #913

Co-authored-by: M M Arif <mmarif@swatian.com>
Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/1109
Reviewed-by: 6543 <6543@noreply.codeberg.org>
Reviewed-by: qwerty287 <qwerty287@noreply.codeberg.org>
This commit is contained in:
M M Arif 2022-04-22 17:18:38 +02:00
parent a05216e18a
commit c67b3c178f
97 changed files with 1843 additions and 1142 deletions

View File

@ -8,6 +8,7 @@ import android.view.View;
import android.widget.ArrayAdapter; import android.widget.ArrayAdapter;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.appcompat.app.AlertDialog; import androidx.appcompat.app.AlertDialog;
import org.gitnex.tea4j.v2.models.GeneralAPISettings;
import org.gitnex.tea4j.v2.models.ServerVersion; import org.gitnex.tea4j.v2.models.ServerVersion;
import org.gitnex.tea4j.v2.models.User; import org.gitnex.tea4j.v2.models.User;
import org.mian.gitnex.R; import org.mian.gitnex.R;
@ -39,6 +40,8 @@ public class AddNewAccountActivity extends BaseActivity {
private String spinnerSelectedValue; private String spinnerSelectedValue;
private Version giteaVersion; private Version giteaVersion;
private int maxResponseItems = 50;
private int defaultPagingNumber = 30;
@Override @Override
public void onCreate(Bundle savedInstanceState) { public void onCreate(Bundle savedInstanceState) {
@ -115,6 +118,7 @@ public class AddNewAccountActivity extends BaseActivity {
.toUri(); .toUri();
versionCheck(instanceUrl.toString(), loginToken); versionCheck(instanceUrl.toString(), loginToken);
serverPageLimitSettings();
} }
catch(Exception e) { catch(Exception e) {
@ -196,6 +200,31 @@ public class AddNewAccountActivity extends BaseActivity {
}); });
} }
private void serverPageLimitSettings() {
Call<GeneralAPISettings> generalAPISettings = RetrofitClient.getApiInterface(ctx).getGeneralAPISettings();
generalAPISettings.enqueue(new Callback<>() {
@Override
public void onResponse(@NonNull final Call<GeneralAPISettings> generalAPISettings, @NonNull retrofit2.Response<GeneralAPISettings> response) {
if(response.code() == 200 && response.body() != null) {
if(response.body().getMaxResponseItems() != null) {
maxResponseItems = Math.toIntExact(response.body().getMaxResponseItems());
}
if(response.body().getDefaultPagingNum() != null) {
defaultPagingNumber = Math.toIntExact(response.body().getDefaultPagingNum());
}
}
}
@Override
public void onFailure(@NonNull Call<GeneralAPISettings> generalAPISettings, @NonNull Throwable t) {
}
});
}
private void setupNewAccountWithToken(String instanceUrl, final String loginToken) { private void setupNewAccountWithToken(String instanceUrl, final String loginToken) {
Call<User> call = RetrofitClient.getApiInterface(ctx, instanceUrl, "token " + loginToken).userGetCurrent(); Call<User> call = RetrofitClient.getApiInterface(ctx, instanceUrl, "token " + loginToken).userGetCurrent();
@ -219,7 +248,7 @@ public class AddNewAccountActivity extends BaseActivity {
if(!userAccountExists) { if(!userAccountExists) {
long id = userAccountsApi.createNewAccount(accountName, instanceUrl, userDetails.getLogin(), loginToken, giteaVersion.toString()); long id = userAccountsApi.createNewAccount(accountName, instanceUrl, userDetails.getLogin(), loginToken, giteaVersion.toString(), maxResponseItems, defaultPagingNumber);
UserAccount account = userAccountsApi.getAccountById((int) id); UserAccount account = userAccountsApi.getAccountById((int) id);
AppUtil.switchToAccount(AddNewAccountActivity.this, account); AppUtil.switchToAccount(AddNewAccountActivity.this, account);
Toasty.success(ctx, getResources().getString(R.string.accountAddedMessage)); Toasty.success(ctx, getResources().getString(R.string.accountAddedMessage));

View File

@ -10,6 +10,7 @@ import org.mian.gitnex.R;
import org.mian.gitnex.adapters.TeamRepositoriesAdapter; import org.mian.gitnex.adapters.TeamRepositoriesAdapter;
import org.mian.gitnex.clients.RetrofitClient; import org.mian.gitnex.clients.RetrofitClient;
import org.mian.gitnex.databinding.AddNewTeamRepositoryBinding; import org.mian.gitnex.databinding.AddNewTeamRepositoryBinding;
import org.mian.gitnex.helpers.Constants;
import org.mian.gitnex.helpers.Toasty; import org.mian.gitnex.helpers.Toasty;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@ -27,6 +28,7 @@ public class AddNewTeamRepoActivity extends BaseActivity {
private View.OnClickListener onClickListener; private View.OnClickListener onClickListener;
private List<Repository> dataList; private List<Repository> dataList;
private TeamRepositoriesAdapter adapter; private TeamRepositoriesAdapter adapter;
private int resultLimit;
private long teamId; private long teamId;
private String teamName; private String teamName;
@ -39,6 +41,7 @@ public class AddNewTeamRepoActivity extends BaseActivity {
addNewTeamRepositoryBinding = AddNewTeamRepositoryBinding.inflate(getLayoutInflater()); addNewTeamRepositoryBinding = AddNewTeamRepositoryBinding.inflate(getLayoutInflater());
setContentView(addNewTeamRepositoryBinding.getRoot()); setContentView(addNewTeamRepositoryBinding.getRoot());
resultLimit = Constants.getCurrentResultLimit(ctx);
initCloseListener(); initCloseListener();
addNewTeamRepositoryBinding.close.setOnClickListener(onClickListener); addNewTeamRepositoryBinding.close.setOnClickListener(onClickListener);
@ -58,7 +61,7 @@ public class AddNewTeamRepoActivity extends BaseActivity {
public void loadRepos() { public void loadRepos() {
Call<List<Repository>> call = RetrofitClient.getApiInterface(ctx).orgListRepos(getIntent().getStringExtra("orgName"), 1, 50); Call<List<Repository>> call = RetrofitClient.getApiInterface(ctx).orgListRepos(getIntent().getStringExtra("orgName"), 1, resultLimit);
addNewTeamRepositoryBinding.progressBar.setVisibility(View.VISIBLE); addNewTeamRepositoryBinding.progressBar.setVisibility(View.VISIBLE);

View File

@ -14,11 +14,12 @@ import org.mian.gitnex.databinding.ActivityAdminCronTasksBinding;
import org.mian.gitnex.viewmodels.AdminCronTasksViewModel; import org.mian.gitnex.viewmodels.AdminCronTasksViewModel;
/** /**
* Author M M Arif * @author M M Arif
*/ */
public class AdminCronTasksActivity extends BaseActivity { public class AdminCronTasksActivity extends BaseActivity {
private AdminCronTasksViewModel adminCronTasksViewModel;
private View.OnClickListener onClickListener; private View.OnClickListener onClickListener;
private AdminCronTasksAdapter adapter; private AdminCronTasksAdapter adapter;
@ -34,6 +35,7 @@ public class AdminCronTasksActivity extends BaseActivity {
activityAdminCronTasksBinding = ActivityAdminCronTasksBinding.inflate(getLayoutInflater()); activityAdminCronTasksBinding = ActivityAdminCronTasksBinding.inflate(getLayoutInflater());
setContentView(activityAdminCronTasksBinding.getRoot()); setContentView(activityAdminCronTasksBinding.getRoot());
adminCronTasksViewModel = new ViewModelProvider(this).get(AdminCronTasksViewModel.class);
initCloseListener(); initCloseListener();
activityAdminCronTasksBinding.close.setOnClickListener(onClickListener); activityAdminCronTasksBinding.close.setOnClickListener(onClickListener);
@ -51,7 +53,7 @@ public class AdminCronTasksActivity extends BaseActivity {
activityAdminCronTasksBinding.pullToRefresh.setOnRefreshListener(() -> new Handler(Looper.getMainLooper()).postDelayed(() -> { activityAdminCronTasksBinding.pullToRefresh.setOnRefreshListener(() -> new Handler(Looper.getMainLooper()).postDelayed(() -> {
activityAdminCronTasksBinding.pullToRefresh.setRefreshing(false); activityAdminCronTasksBinding.pullToRefresh.setRefreshing(false);
AdminCronTasksViewModel.loadCronTasksList(ctx, PAGE, LIMIT); adminCronTasksViewModel.loadCronTasksList(ctx, PAGE, LIMIT);
}, 500)); }, 500));

View File

@ -29,11 +29,12 @@ import org.mian.gitnex.viewmodels.AdminGetUsersViewModel;
public class AdminGetUsersActivity extends BaseActivity implements BottomSheetListener { public class AdminGetUsersActivity extends BaseActivity implements BottomSheetListener {
private AdminGetUsersViewModel adminGetUsersViewModel;
private View.OnClickListener onClickListener; private View.OnClickListener onClickListener;
private ActivityAdminGetUsersBinding activityAdminGetUsersBinding; private ActivityAdminGetUsersBinding activityAdminGetUsersBinding;
private AdminGetUsersAdapter adapter; private AdminGetUsersAdapter adapter;
private int page = 1; private int page = 1;
private int resultLimit = Constants.resultLimitNewGiteaInstances; private int resultLimit;
private Boolean searchFilter = false; private Boolean searchFilter = false;
public void onCreate(Bundle savedInstanceState) { public void onCreate(Bundle savedInstanceState) {
@ -42,6 +43,7 @@ public class AdminGetUsersActivity extends BaseActivity implements BottomSheetLi
activityAdminGetUsersBinding = ActivityAdminGetUsersBinding.inflate(getLayoutInflater()); activityAdminGetUsersBinding = ActivityAdminGetUsersBinding.inflate(getLayoutInflater());
setContentView(activityAdminGetUsersBinding.getRoot()); setContentView(activityAdminGetUsersBinding.getRoot());
adminGetUsersViewModel = new ViewModelProvider(this).get(AdminGetUsersViewModel.class);
Toolbar toolbar = activityAdminGetUsersBinding.toolbar; Toolbar toolbar = activityAdminGetUsersBinding.toolbar;
setSupportActionBar(toolbar); setSupportActionBar(toolbar);
@ -49,6 +51,8 @@ public class AdminGetUsersActivity extends BaseActivity implements BottomSheetLi
initCloseListener(); initCloseListener();
activityAdminGetUsersBinding.close.setOnClickListener(onClickListener); activityAdminGetUsersBinding.close.setOnClickListener(onClickListener);
resultLimit = Constants.getCurrentResultLimit(ctx);
activityAdminGetUsersBinding.recyclerView.setHasFixedSize(true); activityAdminGetUsersBinding.recyclerView.setHasFixedSize(true);
activityAdminGetUsersBinding.recyclerView.setLayoutManager(new LinearLayoutManager(ctx)); activityAdminGetUsersBinding.recyclerView.setLayoutManager(new LinearLayoutManager(ctx));
DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(activityAdminGetUsersBinding.recyclerView.getContext(), DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(activityAdminGetUsersBinding.recyclerView.getContext(),
@ -79,7 +83,7 @@ public class AdminGetUsersActivity extends BaseActivity implements BottomSheetLi
public void onLoadMore() { public void onLoadMore() {
page += 1; page += 1;
AdminGetUsersViewModel.loadMoreUsersList(page, resultLimit, ctx, adapter); adminGetUsersViewModel.loadMoreUsersList(page, resultLimit, ctx, adapter);
activityAdminGetUsersBinding.progressBar.setVisibility(View.VISIBLE); activityAdminGetUsersBinding.progressBar.setVisibility(View.VISIBLE);
} }

View File

@ -42,7 +42,7 @@ public class CommitsActivity extends BaseActivity {
private TextView noData; private TextView noData;
private ProgressBar progressBar; private ProgressBar progressBar;
private final String TAG = "CommitsActivity"; private final String TAG = "CommitsActivity";
private int resultLimit = Constants.resultLimitOldGiteaInstances; private int resultLimit;
private int pageSize = 1; private int pageSize = 1;
private RecyclerView recyclerView; private RecyclerView recyclerView;
@ -80,11 +80,7 @@ public class CommitsActivity extends BaseActivity {
initCloseListener(); initCloseListener();
closeActivity.setOnClickListener(onClickListener); closeActivity.setOnClickListener(onClickListener);
// if gitea is 1.12 or higher use the new limit (resultLimitNewGiteaInstances) resultLimit = Constants.getCurrentResultLimit(ctx);
if(getAccount().requiresVersion("1.12")) {
resultLimit = Constants.resultLimitNewGiteaInstances;
}
recyclerView = activityCommitsBinding.recyclerView; recyclerView = activityCommitsBinding.recyclerView;
commitsList = new ArrayList<>(); commitsList = new ArrayList<>();

View File

@ -53,7 +53,7 @@ public class CreateIssueActivity extends BaseActivity implements View.OnClickLis
private CustomLabelsSelectionDialogBinding labelsBinding; private CustomLabelsSelectionDialogBinding labelsBinding;
private CustomAssigneesSelectionDialogBinding assigneesBinding; private CustomAssigneesSelectionDialogBinding assigneesBinding;
private View.OnClickListener onClickListener; private View.OnClickListener onClickListener;
private int resultLimit = Constants.resultLimitOldGiteaInstances; private int resultLimit;
private Dialog dialogLabels; private Dialog dialogLabels;
private Dialog dialogAssignees; private Dialog dialogAssignees;
private String labelsSetter; private String labelsSetter;
@ -87,11 +87,7 @@ public class CreateIssueActivity extends BaseActivity implements View.OnClickLis
repository = RepositoryContext.fromIntent(getIntent()); repository = RepositoryContext.fromIntent(getIntent());
// require gitea 1.12 or higher resultLimit = Constants.getCurrentResultLimit(ctx);
if(getAccount().requiresVersion("1.12.0")) {
resultLimit = Constants.resultLimitNewGiteaInstances;
}
viewBinding.newIssueTitle.requestFocus(); viewBinding.newIssueTitle.requestFocus();
assert imm != null; assert imm != null;

View File

@ -12,6 +12,7 @@ import android.widget.ImageView;
import android.widget.TextView; import android.widget.TextView;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.core.content.ContextCompat; import androidx.core.content.ContextCompat;
import androidx.lifecycle.ViewModelProvider;
import com.pes.androidmaterialcolorpickerdialog.ColorPicker; import com.pes.androidmaterialcolorpickerdialog.ColorPicker;
import org.gitnex.tea4j.v2.models.CreateLabelOption; import org.gitnex.tea4j.v2.models.CreateLabelOption;
import org.gitnex.tea4j.v2.models.EditLabelOption; import org.gitnex.tea4j.v2.models.EditLabelOption;
@ -30,13 +31,15 @@ import retrofit2.Call;
import retrofit2.Callback; import retrofit2.Callback;
/** /**
* Author M M Arif * @author M M Arif
*/ */
public class CreateLabelActivity extends BaseActivity { public class CreateLabelActivity extends BaseActivity {
public static boolean refreshLabels = false; public static boolean refreshLabels = false;
private OrganizationLabelsViewModel organizationLabelsViewModel;
private LabelsViewModel labelsViewModel;
private View.OnClickListener onClickListener; private View.OnClickListener onClickListener;
private TextView colorPicker; private TextView colorPicker;
private EditText labelName; private EditText labelName;
@ -53,6 +56,8 @@ public class CreateLabelActivity extends BaseActivity {
ActivityCreateLabelBinding activityCreateLabelBinding = ActivityCreateLabelBinding.inflate(getLayoutInflater()); ActivityCreateLabelBinding activityCreateLabelBinding = ActivityCreateLabelBinding.inflate(getLayoutInflater());
setContentView(activityCreateLabelBinding.getRoot()); setContentView(activityCreateLabelBinding.getRoot());
labelsViewModel = new ViewModelProvider(this).get(LabelsViewModel.class);
organizationLabelsViewModel = new ViewModelProvider(this).get(OrganizationLabelsViewModel.class);
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
@ -345,11 +350,11 @@ public class CreateLabelActivity extends BaseActivity {
Toasty.success(ctx, getString(R.string.labelDeleteText)); Toasty.success(ctx, getString(R.string.labelDeleteText));
if(getIntent().getStringExtra("type") != null && Objects.requireNonNull(getIntent().getStringExtra("type")).equals("org")) { if(getIntent().getStringExtra("type") != null && Objects.requireNonNull(getIntent().getStringExtra("type")).equals("org")) {
OrganizationLabelsViewModel.loadOrgLabelsList(getIntent().getStringExtra("orgName"), ctx, null, null); organizationLabelsViewModel.loadOrgLabelsList(getIntent().getStringExtra("orgName"), ctx, null, null);
} }
else { else {
LabelsViewModel.loadLabelsList(repository.getOwner(), repository.getName(), ctx); labelsViewModel.loadLabelsList(repository.getOwner(), repository.getName(), ctx);
} }
} }
} }

View File

@ -45,7 +45,7 @@ public class CreatePullRequestActivity extends BaseActivity implements LabelsLis
private View.OnClickListener onClickListener; private View.OnClickListener onClickListener;
private ActivityCreatePrBinding viewBinding; private ActivityCreatePrBinding viewBinding;
private int resultLimit = Constants.resultLimitOldGiteaInstances; private int resultLimit;
private Dialog dialogLabels; private Dialog dialogLabels;
private List<Integer> labelsIds = new ArrayList<>(); private List<Integer> labelsIds = new ArrayList<>();
private final List<String> assignees = new ArrayList<>(); private final List<String> assignees = new ArrayList<>();
@ -71,11 +71,7 @@ public class CreatePullRequestActivity extends BaseActivity implements LabelsLis
repository = RepositoryContext.fromIntent(getIntent()); repository = RepositoryContext.fromIntent(getIntent());
// require gitea 1.12 or higher resultLimit = Constants.getCurrentResultLimit(ctx);
if(getAccount().requiresVersion("1.12.0")) {
resultLimit = Constants.resultLimitNewGiteaInstances;
}
viewBinding.prBody.setOnTouchListener((touchView, motionEvent) -> { viewBinding.prBody.setOnTouchListener((touchView, motionEvent) -> {

View File

@ -111,7 +111,6 @@ public class CreateReleaseActivity extends BaseActivity {
} }
createNewTag.setOnClickListener(v -> createNewTag()); createNewTag.setOnClickListener(v -> createNewTag());
} }
private void createNewTag() { private void createNewTag() {
@ -152,6 +151,10 @@ public class CreateReleaseActivity extends BaseActivity {
public void onResponse(@NonNull Call<Tag> call, @NonNull retrofit2.Response<Tag> response) { public void onResponse(@NonNull Call<Tag> call, @NonNull retrofit2.Response<Tag> response) {
if (response.code() == 201) { if (response.code() == 201) {
Intent result = new Intent();
result.putExtra("updateReleases", true);
setResult(201, result);
Toasty.success(ctx, getString(R.string.tagCreated)); Toasty.success(ctx, getString(R.string.tagCreated));
finish(); finish();
} }

View File

@ -49,7 +49,7 @@ import retrofit2.Callback;
public class EditIssueActivity extends BaseActivity implements View.OnClickListener { public class EditIssueActivity extends BaseActivity implements View.OnClickListener {
private View.OnClickListener onClickListener; private View.OnClickListener onClickListener;
private int resultLimit = Constants.resultLimitOldGiteaInstances; private int resultLimit;
private EditText editIssueTitle; private EditText editIssueTitle;
private EditText editIssueDescription; private EditText editIssueDescription;
@ -76,6 +76,7 @@ public class EditIssueActivity extends BaseActivity implements View.OnClickListe
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
resultLimit = Constants.getCurrentResultLimit(ctx);
issue = IssueContext.fromIntent(getIntent()); issue = IssueContext.fromIntent(getIntent());
ImageView closeActivity = activityEditIssueBinding.close; ImageView closeActivity = activityEditIssueBinding.close;
@ -85,12 +86,6 @@ public class EditIssueActivity extends BaseActivity implements View.OnClickListe
editIssueDescription = activityEditIssueBinding.editIssueDescription; editIssueDescription = activityEditIssueBinding.editIssueDescription;
editIssueDueDate = activityEditIssueBinding.editIssueDueDate; editIssueDueDate = activityEditIssueBinding.editIssueDueDate;
// if gitea is 1.12 or higher use the new limit
if(getAccount().requiresVersion("1.12.0")) {
resultLimit = Constants.resultLimitNewGiteaInstances;
}
editIssueTitle.requestFocus(); editIssueTitle.requestFocus();
assert imm != null; assert imm != null;
imm.showSoftInput(editIssueTitle, InputMethodManager.SHOW_IMPLICIT); imm.showSoftInput(editIssueTitle, InputMethodManager.SHOW_IMPLICIT);

View File

@ -20,9 +20,11 @@ import android.widget.ImageView;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import android.widget.RelativeLayout; import android.widget.RelativeLayout;
import android.widget.ScrollView; import android.widget.ScrollView;
import android.widget.TextView;
import androidx.activity.result.ActivityResultLauncher; import androidx.activity.result.ActivityResultLauncher;
import androidx.activity.result.contract.ActivityResultContracts; import androidx.activity.result.contract.ActivityResultContracts;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.appcompat.app.AlertDialog;
import androidx.core.content.ContextCompat; import androidx.core.content.ContextCompat;
import androidx.core.content.res.ResourcesCompat; import androidx.core.content.res.ResourcesCompat;
import androidx.core.text.HtmlCompat; import androidx.core.text.HtmlCompat;
@ -440,6 +442,9 @@ public class IssueDetailActivity extends BaseActivity implements LabelsListAdapt
MenuInflater inflater = getMenuInflater(); MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.generic_nav_dotted_menu, menu); inflater.inflate(R.menu.generic_nav_dotted_menu, menu);
if(issue.getIssueType().equalsIgnoreCase("pull")) {
inflater.inflate(R.menu.pr_info_menu, menu);
}
return true; return true;
} }
@ -466,6 +471,24 @@ public class IssueDetailActivity extends BaseActivity implements LabelsListAdapt
} }
return true; return true;
} }
else if(id == R.id.prInfo) {
View view = LayoutInflater.from(ctx).inflate(R.layout.custom_pr_info_dialog, null);
TextView baseBranch = view.findViewById(R.id.baseBranch);
TextView headBranch = view.findViewById(R.id.headBranch);
baseBranch.setText(issue.getPullRequest().getHead().getRef());
headBranch.setText(issue.getPullRequest().getHead().getRef());
AlertDialog.Builder alertDialog = new AlertDialog.Builder(ctx);
alertDialog.setTitle(getResources().getString(R.string.prMergeInfo));
alertDialog.setView(view);
alertDialog.setPositiveButton(getString(R.string.okButton), null);
alertDialog.create().show();
return true;
}
else { else {
return super.onOptionsItemSelected(item); return super.onOptionsItemSelected(item);
@ -780,7 +803,7 @@ public class IssueDetailActivity extends BaseActivity implements LabelsListAdapt
} }
else { else {
viewBinding.issueDueDate.setVisibility(View.GONE); viewBinding.dueDateFrame.setVisibility(View.GONE);
} }
String edited; String edited;
@ -847,12 +870,12 @@ public class IssueDetailActivity extends BaseActivity implements LabelsListAdapt
if(issue.getIssue().getMilestone() != null) { if(issue.getIssue().getMilestone() != null) {
viewBinding.issueMilestone.setVisibility(View.VISIBLE); viewBinding.milestoneFrame.setVisibility(View.VISIBLE);
viewBinding.issueMilestone.setText(getString(R.string.issueMilestone, issue.getIssue().getMilestone().getTitle())); viewBinding.issueMilestone.setText(issue.getIssue().getMilestone().getTitle());
} }
else { else {
viewBinding.issueMilestone.setVisibility(View.GONE); viewBinding.milestoneFrame.setVisibility(View.GONE);
} }
/*if(!issue.getIssue().getUser().getFull_name().equals("")) { /*if(!issue.getIssue().getUser().getFull_name().equals("")) {

View File

@ -12,6 +12,7 @@ import androidx.annotation.NonNull;
import androidx.appcompat.app.AlertDialog; import androidx.appcompat.app.AlertDialog;
import org.gitnex.tea4j.v2.models.AccessToken; import org.gitnex.tea4j.v2.models.AccessToken;
import org.gitnex.tea4j.v2.models.CreateAccessTokenOption; import org.gitnex.tea4j.v2.models.CreateAccessTokenOption;
import org.gitnex.tea4j.v2.models.GeneralAPISettings;
import org.gitnex.tea4j.v2.models.ServerVersion; import org.gitnex.tea4j.v2.models.ServerVersion;
import org.gitnex.tea4j.v2.models.User; import org.gitnex.tea4j.v2.models.User;
import org.mian.gitnex.R; import org.mian.gitnex.R;
@ -53,6 +54,8 @@ public class LoginActivity extends BaseActivity {
private URI instanceUrl; private URI instanceUrl;
private Version giteaVersion; private Version giteaVersion;
private int maxResponseItems = 50;
private int defaultPagingNumber = 25;
@Override @Override
public void onCreate(Bundle savedInstanceState) { public void onCreate(Bundle savedInstanceState) {
@ -195,6 +198,7 @@ public class LoginActivity extends BaseActivity {
} }
versionCheck(loginUid, loginPass, 123, loginToken, loginType); versionCheck(loginUid, loginPass, 123, loginToken, loginType);
serverPageLimitSettings();
} }
} }
@ -205,6 +209,31 @@ public class LoginActivity extends BaseActivity {
} }
} }
private void serverPageLimitSettings() {
Call<GeneralAPISettings> generalAPISettings = RetrofitClient.getApiInterface(ctx).getGeneralAPISettings();
generalAPISettings.enqueue(new Callback<>() {
@Override
public void onResponse(@NonNull final Call<GeneralAPISettings> generalAPISettings, @NonNull retrofit2.Response<GeneralAPISettings> response) {
if(response.code() == 200 && response.body() != null) {
if(response.body().getMaxResponseItems() != null) {
maxResponseItems = Math.toIntExact(response.body().getMaxResponseItems());
}
if(response.body().getDefaultPagingNum() != null) {
defaultPagingNumber = Math.toIntExact(response.body().getDefaultPagingNum());
}
}
}
@Override
public void onFailure(@NonNull Call<GeneralAPISettings> generalAPISettings, @NonNull Throwable t) {
}
});
}
private void versionCheck(final String loginUid, final String loginPass, final int loginOTP, final String loginToken, private void versionCheck(final String loginUid, final String loginPass, final int loginOTP, final String loginToken,
final LoginType loginType) { final LoginType loginType) {
@ -333,7 +362,7 @@ public class LoginActivity extends BaseActivity {
boolean userAccountExists = userAccountsApi.userAccountExists(accountName); boolean userAccountExists = userAccountsApi.userAccountExists(accountName);
UserAccount account; UserAccount account;
if(!userAccountExists) { if(!userAccountExists) {
long accountId = userAccountsApi.createNewAccount(accountName, instanceUrl.toString(), userDetails.getLogin(), loginToken, giteaVersion.toString()); long accountId = userAccountsApi.createNewAccount(accountName, instanceUrl.toString(), userDetails.getLogin(), loginToken, giteaVersion.toString(), maxResponseItems, defaultPagingNumber);
account = userAccountsApi.getAccountById((int) accountId); account = userAccountsApi.getAccountById((int) accountId);
} }
else { else {
@ -515,7 +544,7 @@ public class LoginActivity extends BaseActivity {
if(!userAccountExists) { if(!userAccountExists) {
long accountId = userAccountsApi long accountId = userAccountsApi
.createNewAccount(accountName, instanceUrl.toString(), userDetails.getLogin(), newToken.getSha1(), .createNewAccount(accountName, instanceUrl.toString(), userDetails.getLogin(), newToken.getSha1(),
giteaVersion.toString()); giteaVersion.toString(), maxResponseItems, defaultPagingNumber);
account = userAccountsApi.getAccountById((int) accountId); account = userAccountsApi.getAccountById((int) accountId);
} }
else { else {

View File

@ -5,7 +5,6 @@ import android.graphics.Typeface;
import android.os.Bundle; import android.os.Bundle;
import android.os.Handler; import android.os.Handler;
import android.text.Html; import android.text.Html;
import android.util.Log;
import android.view.Menu; import android.view.Menu;
import android.view.MenuItem; import android.view.MenuItem;
import android.view.View; import android.view.View;
@ -23,6 +22,7 @@ import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager; import androidx.fragment.app.FragmentManager;
import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import com.google.android.material.navigation.NavigationView; import com.google.android.material.navigation.NavigationView;
import org.gitnex.tea4j.v2.models.GeneralAPISettings;
import org.gitnex.tea4j.v2.models.NotificationCount; import org.gitnex.tea4j.v2.models.NotificationCount;
import org.gitnex.tea4j.v2.models.ServerVersion; import org.gitnex.tea4j.v2.models.ServerVersion;
import org.gitnex.tea4j.v2.models.User; import org.gitnex.tea4j.v2.models.User;
@ -439,9 +439,9 @@ public class MainActivity extends BaseActivity implements NavigationView.OnNavig
loadUserInfo(); loadUserInfo();
giteaVersion(); giteaVersion();
serverPageLimitSettings();
noConnection = false; noConnection = false;
} }
Log.e("Network status is: ", String.valueOf(connToInternet));
}, 1500); }, 1500);
// Changelog popup // Changelog popup
@ -520,6 +520,11 @@ public class MainActivity extends BaseActivity implements NavigationView.OnNavig
getFragmentRefreshListener().onRefresh("closed"); getFragmentRefreshListener().onRefresh("closed");
} }
break; break;
case "assignedToMe":
if(getFragmentRefreshListener() != null) {
getFragmentRefreshListener().onRefresh("assignedToMe");
}
break;
} }
} }
@ -627,10 +632,40 @@ public class MainActivity extends BaseActivity implements NavigationView.OnNavig
return super.onOptionsItemSelected(item); return super.onOptionsItemSelected(item);
} }
private void serverPageLimitSettings() {
Call<GeneralAPISettings> generalAPISettings = RetrofitClient.getApiInterface(ctx).getGeneralAPISettings();
generalAPISettings.enqueue(new Callback<>() {
@Override
public void onResponse(@NonNull final Call<GeneralAPISettings> generalAPISettings, @NonNull retrofit2.Response<GeneralAPISettings> response) {
if(response.code() == 200 && response.body() != null) {
int maxResponseItems = 50;
int defaultPagingNumber = 25;
if(response.body().getMaxResponseItems() != null) {
maxResponseItems = Math.toIntExact(response.body().getMaxResponseItems());
}
if(response.body().getDefaultPagingNum() != null) {
defaultPagingNumber = Math.toIntExact(response.body().getDefaultPagingNum());
}
BaseApi.getInstance(ctx, UserAccountsApi.class).updateServerPagingLimit(maxResponseItems, defaultPagingNumber, tinyDB.getInt("currentActiveAccountId"));
}
}
@Override
public void onFailure(@NonNull Call<GeneralAPISettings> generalAPISettings, @NonNull Throwable t) {
}
});
}
private void giteaVersion() { private void giteaVersion() {
Call<ServerVersion> callVersion = RetrofitClient.getApiInterface(ctx).getVersion(); Call<ServerVersion> callVersion = RetrofitClient.getApiInterface(ctx).getVersion();
callVersion.enqueue(new Callback<ServerVersion>() { callVersion.enqueue(new Callback<>() {
@Override @Override
public void onResponse(@NonNull final Call<ServerVersion> callVersion, @NonNull retrofit2.Response<ServerVersion> responseVersion) { public void onResponse(@NonNull final Call<ServerVersion> callVersion, @NonNull retrofit2.Response<ServerVersion> responseVersion) {
@ -645,7 +680,6 @@ public class MainActivity extends BaseActivity implements NavigationView.OnNavig
@Override @Override
public void onFailure(@NonNull Call<ServerVersion> callVersion, @NonNull Throwable t) { public void onFailure(@NonNull Call<ServerVersion> callVersion, @NonNull Throwable t) {
Log.e("onFailure-version", t.toString());
} }
}); });
} }
@ -653,7 +687,7 @@ public class MainActivity extends BaseActivity implements NavigationView.OnNavig
private void loadUserInfo() { private void loadUserInfo() {
Call<User> call = RetrofitClient.getApiInterface(ctx).userGetCurrent(); Call<User> call = RetrofitClient.getApiInterface(ctx).userGetCurrent();
call.enqueue(new Callback<User>() { call.enqueue(new Callback<>() {
@Override @Override
public void onResponse(@NonNull Call<User> call, @NonNull retrofit2.Response<User> response) { public void onResponse(@NonNull Call<User> call, @NonNull retrofit2.Response<User> response) {
@ -671,16 +705,18 @@ public class MainActivity extends BaseActivity implements NavigationView.OnNavig
if(!getAccount().getAccount().getUserName().equals(userDetails.getLogin())) { if(!getAccount().getAccount().getUserName().equals(userDetails.getLogin())) {
// user changed it's name -> update database // user changed it's name -> update database
int accountId = getAccount().getAccount().getAccountId(); int accountId = getAccount().getAccount().getAccountId();
BaseApi.getInstance(MainActivity.this, UserAccountsApi.class).updateUsername(accountId, BaseApi.getInstance(MainActivity.this, UserAccountsApi.class).updateUsername(accountId, userDetails.getLogin());
userDetails.getLogin());
getAccount().setAccount(BaseApi.getInstance(MainActivity.this, UserAccountsApi.class).getAccountById(accountId)); getAccount().setAccount(BaseApi.getInstance(MainActivity.this, UserAccountsApi.class).getAccountById(accountId));
} }
if(profileInitListener != null) profileInitListener.onButtonClicked(null); if(profileInitListener != null) {
profileInitListener.onButtonClicked(null);
}
} }
} }
else if(response.code() == 401) { else if(response.code() == 401) {
AlertDialogs.authorizationTokenRevokedDialog(ctx, getResources().getString(R.string.alertDialogTokenRevokedTitle), getResources().getString(R.string.alertDialogTokenRevokedMessage), getResources().getString(R.string.cancelButton), getResources().getString(R.string.navLogout)); AlertDialogs.authorizationTokenRevokedDialog(ctx, getResources().getString(R.string.alertDialogTokenRevokedTitle), getResources().getString(R.string.alertDialogTokenRevokedMessage), getResources().getString(R.string.cancelButton),
getResources().getString(R.string.navLogout));
} }
else { else {
@ -691,8 +727,6 @@ public class MainActivity extends BaseActivity implements NavigationView.OnNavig
@Override @Override
public void onFailure(@NonNull Call<User> call, @NonNull Throwable t) { public void onFailure(@NonNull Call<User> call, @NonNull Throwable t) {
Log.e("onFailure", t.toString());
} }
}); });
@ -719,8 +753,6 @@ public class MainActivity extends BaseActivity implements NavigationView.OnNavig
@Override @Override
public void onFailure(@NonNull Call<NotificationCount> call, @NonNull Throwable t) { public void onFailure(@NonNull Call<NotificationCount> call, @NonNull Throwable t) {
Log.e("onFailure-notification", t.toString());
} }
}); });
} }
@ -730,7 +762,7 @@ public class MainActivity extends BaseActivity implements NavigationView.OnNavig
this.profileInitListener = profileInitListener; this.profileInitListener = profileInitListener;
} }
// My issues-open-close interface // My issues interface
public FragmentRefreshListener getFragmentRefreshListener() { return fragmentRefreshListenerMyIssues; } public FragmentRefreshListener getFragmentRefreshListener() { return fragmentRefreshListenerMyIssues; }
public void setFragmentRefreshListenerMyIssues(FragmentRefreshListener fragmentRefreshListener) { this.fragmentRefreshListenerMyIssues = fragmentRefreshListener; } public void setFragmentRefreshListenerMyIssues(FragmentRefreshListener fragmentRefreshListener) { this.fragmentRefreshListenerMyIssues = fragmentRefreshListener; }
} }

View File

@ -1,8 +1,5 @@
package org.mian.gitnex.activities; package org.mian.gitnex.activities;
import android.content.ClipData;
import android.content.ClipboardManager;
import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.graphics.Typeface; import android.graphics.Typeface;
import android.os.Bundle; import android.os.Bundle;
@ -29,7 +26,7 @@ import org.mian.gitnex.fragments.OrganizationInfoFragment;
import org.mian.gitnex.fragments.OrganizationLabelsFragment; import org.mian.gitnex.fragments.OrganizationLabelsFragment;
import org.mian.gitnex.fragments.RepositoriesByOrgFragment; import org.mian.gitnex.fragments.RepositoriesByOrgFragment;
import org.mian.gitnex.fragments.TeamsByOrgFragment; import org.mian.gitnex.fragments.TeamsByOrgFragment;
import org.mian.gitnex.helpers.Toasty; import org.mian.gitnex.helpers.AppUtil;
import org.mian.gitnex.structs.BottomSheetListener; import org.mian.gitnex.structs.BottomSheetListener;
import java.util.Objects; import java.util.Objects;
import io.mikael.urlbuilder.UrlBuilder; import io.mikael.urlbuilder.UrlBuilder;
@ -38,7 +35,7 @@ import retrofit2.Callback;
import retrofit2.Response; import retrofit2.Response;
/** /**
* Author M M Arif * @author M M Arif
*/ */
public class OrganizationDetailActivity extends BaseActivity implements BottomSheetListener { public class OrganizationDetailActivity extends BaseActivity implements BottomSheetListener {
@ -200,6 +197,11 @@ public class OrganizationDetailActivity extends BaseActivity implements BottomSh
@Override @Override
public void onButtonClicked(String text) { public void onButtonClicked(String text) {
String url = UrlBuilder.fromString(getAccount().getAccount().getInstanceUrl())
.withPath("/")
.toString();
url = url + getIntent().getStringExtra("orgName");
switch (text) { switch (text) {
case "repository": case "repository":
Intent intentRepo = new Intent(this, CreateRepoActivity.class); Intent intentRepo = new Intent(this, CreateRepoActivity.class);
@ -221,15 +223,13 @@ public class OrganizationDetailActivity extends BaseActivity implements BottomSh
startActivity(intentTeam); startActivity(intentTeam);
break; break;
case "copyOrgUrl": case "copyOrgUrl":
AppUtil.copyToClipboard(this, url, ctx.getString(R.string.copyIssueUrlToastMsg));
String url = UrlBuilder.fromString(getAccount().getAccount().getInstanceUrl()) break;
.withPath("/") case "share":
.toString(); AppUtil.sharingIntent(this, url);
ClipboardManager clipboard = (ClipboardManager) Objects.requireNonNull(ctx).getSystemService(Context.CLIPBOARD_SERVICE); break;
ClipData clip = ClipData.newPlainText("orgUrl", url + getIntent().getStringExtra("orgName")); case "open":
assert clipboard != null; AppUtil.openUrlInBrowser(this, url);
clipboard.setPrimaryClip(clip);
Toasty.info(ctx, ctx.getString(R.string.copyIssueUrlToastMsg));
break; break;
} }
} }

View File

@ -2,9 +2,6 @@ package org.mian.gitnex.activities;
import android.annotation.SuppressLint; import android.annotation.SuppressLint;
import android.app.Dialog; import android.app.Dialog;
import android.content.ClipData;
import android.content.ClipboardManager;
import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.content.res.ColorStateList; import android.content.res.ColorStateList;
import android.graphics.Typeface; import android.graphics.Typeface;
@ -279,20 +276,10 @@ public class RepoDetailActivity extends BaseActivity implements BottomSheetListe
AppUtil.openUrlInBrowser(this, repository.getRepository().getHtmlUrl()); AppUtil.openUrlInBrowser(this, repository.getRepository().getHtmlUrl());
break; break;
case "shareRepo": case "shareRepo":
AppUtil.sharingIntent(this, repository.getRepository().getHtmlUrl());
Intent sharingIntent = new Intent(android.content.Intent.ACTION_SEND);
sharingIntent.setType("text/plain");
sharingIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, repository.getRepository().getHtmlUrl());
sharingIntent.putExtra(android.content.Intent.EXTRA_TEXT, repository.getRepository().getHtmlUrl());
startActivity(Intent.createChooser(sharingIntent, repository.getRepository().getHtmlUrl()));
break; break;
case "copyRepoUrl": case "copyRepoUrl":
AppUtil.copyToClipboard(this, repository.getRepository().getHtmlUrl(), ctx.getString(R.string.copyIssueUrlToastMsg));
ClipboardManager clipboard = (ClipboardManager) Objects.requireNonNull(ctx).getSystemService(Context.CLIPBOARD_SERVICE);
ClipData clip = ClipData.newPlainText("repoUrl", repository.getRepository().getHtmlUrl());
assert clipboard != null;
clipboard.setPrimaryClip(clip);
Toasty.info(ctx, ctx.getString(R.string.copyIssueUrlToastMsg));
break; break;
case "newFile": case "newFile":

View File

@ -42,7 +42,7 @@ public class RepoForksActivity extends BaseActivity {
private TextView noData; private TextView noData;
private ProgressBar progressBar; private ProgressBar progressBar;
private final String TAG = "RepositoryForks"; private final String TAG = "RepositoryForks";
private int resultLimit = Constants.resultLimitOldGiteaInstances; private int resultLimit;
private int pageSize = 1; private int pageSize = 1;
private RecyclerView recyclerView; private RecyclerView recyclerView;
@ -78,11 +78,7 @@ public class RepoForksActivity extends BaseActivity {
closeActivity.setOnClickListener(v -> finish()); closeActivity.setOnClickListener(v -> finish());
// if gitea is 1.12 or higher use the new limit (resultLimitNewGiteaInstances) resultLimit = Constants.getCurrentResultLimit(ctx);
if(getAccount().requiresVersion("1.12")) {
resultLimit = Constants.resultLimitNewGiteaInstances;
}
recyclerView = activityRepoForksBinding.recyclerView; recyclerView = activityRepoForksBinding.recyclerView;
forksList = new ArrayList<>(); forksList = new ArrayList<>();

View File

@ -43,7 +43,7 @@ import retrofit2.Call;
import retrofit2.Callback; import retrofit2.Callback;
/** /**
* Author M M Arif * @author M M Arif
*/ */
public class IssueCommentsAdapter extends RecyclerView.Adapter<IssueCommentsAdapter.IssueCommentViewHolder> { public class IssueCommentsAdapter extends RecyclerView.Adapter<IssueCommentsAdapter.IssueCommentViewHolder> {
@ -103,6 +103,7 @@ public class IssueCommentsAdapter extends RecyclerView.Adapter<IssueCommentsAdap
TextView commentMenuCopy = vw.findViewById(R.id.commentMenuCopy); TextView commentMenuCopy = vw.findViewById(R.id.commentMenuCopy);
TextView commentMenuDelete = vw.findViewById(R.id.commentMenuDelete); TextView commentMenuDelete = vw.findViewById(R.id.commentMenuDelete);
TextView issueCommentCopyUrl = vw.findViewById(R.id.issueCommentCopyUrl); TextView issueCommentCopyUrl = vw.findViewById(R.id.issueCommentCopyUrl);
TextView open = vw.findViewById(R.id.open);
LinearLayout linearLayout = vw.findViewById(R.id.commentReactionButtons); LinearLayout linearLayout = vw.findViewById(R.id.commentReactionButtons);
if(issue.getRepository().getRepository().isArchived()) { if(issue.getRepository().getRepository().isArchived()) {
@ -161,32 +162,21 @@ public class IssueCommentsAdapter extends RecyclerView.Adapter<IssueCommentsAdap
}); });
commentShare.setOnClickListener(v1 -> { commentShare.setOnClickListener(v1 -> {
// get comment Url
CharSequence commentUrl = issueComment.getHtmlUrl();
// share issue comment
Intent sharingIntent = new Intent(android.content.Intent.ACTION_SEND);
sharingIntent.setType("text/plain");
String intentHeader = issue.getIssueIndex() + context.getResources().getString(R.string.hash) + "issuecomment-" + issueComment.getId() + " " + issue.getIssue().getTitle();
sharingIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, intentHeader);
sharingIntent.putExtra(android.content.Intent.EXTRA_TEXT, commentUrl);
context.startActivity(Intent.createChooser(sharingIntent, intentHeader));
AppUtil.sharingIntent(context, issueComment.getHtmlUrl());
dialog.dismiss(); dialog.dismiss();
}); });
issueCommentCopyUrl.setOnClickListener(v1 -> { issueCommentCopyUrl.setOnClickListener(v1 -> {
// comment Url
CharSequence commentUrl = issueComment.getHtmlUrl();
ClipboardManager clipboard = (ClipboardManager) Objects.requireNonNull(context).getSystemService(Context.CLIPBOARD_SERVICE);
assert clipboard != null;
ClipData clip = ClipData.newPlainText(commentUrl, commentUrl);
clipboard.setPrimaryClip(clip);
AppUtil.copyToClipboard(context, issueComment.getHtmlUrl(), context.getString(R.string.copyIssueUrlToastMsg));
dialog.dismiss();
});
open.setOnClickListener(v1 -> {
AppUtil.openUrlInBrowser(context, issueComment.getHtmlUrl());
dialog.dismiss(); dialog.dismiss();
Toasty.success(context, context.getString(R.string.copyIssueUrlToastMsg));
}); });
commentMenuQuote.setOnClickListener(v1 -> { commentMenuQuote.setOnClickListener(v1 -> {

View File

@ -10,32 +10,38 @@ import android.widget.ImageView;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import android.widget.TextView; import android.widget.TextView;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.appcompat.app.AlertDialog;
import androidx.core.text.HtmlCompat; import androidx.core.text.HtmlCompat;
import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import com.google.android.material.bottomsheet.BottomSheetDialog; import com.google.android.material.bottomsheet.BottomSheetDialog;
import org.gitnex.tea4j.v2.models.Tag; import org.gitnex.tea4j.v2.models.Tag;
import org.mian.gitnex.R; import org.mian.gitnex.R;
import org.mian.gitnex.activities.RepoDetailActivity; import org.mian.gitnex.activities.RepoDetailActivity;
import org.mian.gitnex.helpers.AlertDialogs; import org.mian.gitnex.clients.RetrofitClient;
import org.mian.gitnex.helpers.Markdown; import org.mian.gitnex.helpers.Markdown;
import org.mian.gitnex.helpers.Toasty;
import java.util.List; import java.util.List;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
/** /**
* Author qwerty287 * @author qwerty287
*/ */
public class TagsAdapter extends RecyclerView.Adapter<TagsAdapter.TagsViewHolder> { public class TagsAdapter extends RecyclerView.Adapter<TagsAdapter.TagsViewHolder> {
private List<Tag> tags; private List<Tag> tags;
private final Context context; private final Context context;
private final String repo; private static String repo;
private final String owner; private static String owner;
private OnLoadMoreListener loadMoreListener; private OnLoadMoreListener loadMoreListener;
private boolean isLoading = false, isMoreDataAvailable = true; private boolean isLoading = false, isMoreDataAvailable = true;
static class TagsViewHolder extends RecyclerView.ViewHolder { class TagsViewHolder extends RecyclerView.ViewHolder {
private Tag tagsHolder;
private final TextView tagName; private final TextView tagName;
private final TextView tagBody; private final TextView tagBody;
private final LinearLayout downloadFrame; private final LinearLayout downloadFrame;
@ -57,6 +63,24 @@ public class TagsAdapter extends RecyclerView.Adapter<TagsAdapter.TagsViewHolder
releaseTarDownload = itemView.findViewById(R.id.releaseTarDownload); releaseTarDownload = itemView.findViewById(R.id.releaseTarDownload);
downloadDropdownIcon = itemView.findViewById(R.id.downloadDropdownIcon); downloadDropdownIcon = itemView.findViewById(R.id.downloadDropdownIcon);
options = itemView.findViewById(R.id.tagsOptionsMenu); options = itemView.findViewById(R.id.tagsOptionsMenu);
options.setOnClickListener(v -> {
final Context context = v.getContext();
@SuppressLint("InflateParams")
View view = LayoutInflater.from(context).inflate(R.layout.bottom_sheet_tag_in_list, null);
TextView delete = view.findViewById(R.id.tagMenuDelete);
BottomSheetDialog dialog = new BottomSheetDialog(context);
dialog.setContentView(view);
dialog.show();
delete.setOnClickListener(v1 -> {
tagDeleteDialog(context, tagsHolder.getName(), owner, repo, getBindingAdapterPosition());
dialog.dismiss();
});
});
} }
} }
@ -78,6 +102,7 @@ public class TagsAdapter extends RecyclerView.Adapter<TagsAdapter.TagsViewHolder
public void onBindViewHolder(@NonNull TagsViewHolder holder, int position) { public void onBindViewHolder(@NonNull TagsViewHolder holder, int position) {
Tag currentItem = tags.get(position); Tag currentItem = tags.get(position);
holder.tagsHolder = currentItem;
holder.tagName.setText(currentItem.getName()); holder.tagName.setText(currentItem.getName());
@ -106,24 +131,6 @@ public class TagsAdapter extends RecyclerView.Adapter<TagsAdapter.TagsViewHolder
holder.options.setVisibility(View.GONE); holder.options.setVisibility(View.GONE);
} }
holder.options.setOnClickListener(v -> {
final Context context = v.getContext();
@SuppressLint("InflateParams")
View view = LayoutInflater.from(context).inflate(R.layout.bottom_sheet_tag_in_list, null);
TextView delete = view.findViewById(R.id.tagMenuDelete);
BottomSheetDialog dialog = new BottomSheetDialog(context);
dialog.setContentView(view);
dialog.show();
delete.setOnClickListener(v1 -> {
AlertDialogs.tagDeleteDialog(context, currentItem.getName(), owner, repo);
dialog.dismiss();
});
});
holder.releaseZipDownload.setText( holder.releaseZipDownload.setText(
HtmlCompat.fromHtml("<a href='" + currentItem.getZipballUrl() + "'>" + context.getResources().getString(R.string.zipArchiveDownloadReleasesTab) + "</a> ", HtmlCompat.FROM_HTML_MODE_LEGACY)); HtmlCompat.fromHtml("<a href='" + currentItem.getZipballUrl() + "'>" + context.getResources().getString(R.string.zipArchiveDownloadReleasesTab) + "</a> ", HtmlCompat.FROM_HTML_MODE_LEGACY));
holder.releaseZipDownload.setMovementMethod(LinkMovementMethod.getInstance()); holder.releaseZipDownload.setMovementMethod(LinkMovementMethod.getInstance());
@ -150,6 +157,7 @@ public class TagsAdapter extends RecyclerView.Adapter<TagsAdapter.TagsViewHolder
} }
} }
@SuppressLint("NotifyDataSetChanged")
public void notifyDataChanged() { public void notifyDataChanged() {
notifyDataSetChanged(); notifyDataSetChanged();
isLoading = false; isLoading = false;
@ -170,4 +178,45 @@ public class TagsAdapter extends RecyclerView.Adapter<TagsAdapter.TagsViewHolder
notifyDataChanged(); notifyDataChanged();
} }
private void updateAdapter(int position) {
tags.remove(position);
notifyItemRemoved(position);
notifyItemRangeChanged(position, tags.size());
}
public void tagDeleteDialog(final Context context, final String tagName, final String owner, final String repo, int position) {
new AlertDialog.Builder(context)
.setTitle(String.format(context.getString(R.string.deleteTagTitle), tagName))
.setMessage(R.string.deleteTagConfirmation)
.setIcon(R.drawable.ic_delete)
.setPositiveButton(R.string.menuDeleteText, (dialog, whichButton) -> RetrofitClient
.getApiInterface(context).repoDeleteTag(owner, repo, tagName).enqueue(new Callback<>() {
@Override
public void onResponse(@NonNull Call<Void> call, @NonNull Response<Void> response) {
if(response.isSuccessful()) {
updateAdapter(position);
Toasty.success(context, context.getString(R.string.tagDeleted));
}
else if(response.code() == 403) {
Toasty.error(context, context.getString(R.string.authorizeError));
}
else if(response.code() == 409) {
Toasty.error(context, context.getString(R.string.tagDeleteError));
}
else {
Toasty.error(context, context.getString(R.string.genericError));
}
}
@Override
public void onFailure(@NonNull Call<Void> call, @NonNull Throwable t) {
Toasty.error(context, context.getString(R.string.genericError));
}
}))
.setNeutralButton(R.string.cancelButton, null).show();
}
} }

View File

@ -46,7 +46,7 @@ import retrofit2.converter.gson.GsonConverterFactory;
import retrofit2.converter.scalars.ScalarsConverterFactory; import retrofit2.converter.scalars.ScalarsConverterFactory;
/** /**
* Author M M Arif * @author M M Arif
*/ */
public class RetrofitClient { public class RetrofitClient {

View File

@ -8,7 +8,7 @@ import org.mian.gitnex.database.models.DraftWithRepository;
import java.util.List; import java.util.List;
/** /**
* Author M M Arif * @author M M Arif
*/ */
public class DraftsApi extends BaseApi { public class DraftsApi extends BaseApi {

View File

@ -7,7 +7,7 @@ import org.mian.gitnex.database.models.Repository;
import java.util.List; import java.util.List;
/** /**
* Author M M Arif * @author M M Arif
*/ */
public class RepositoriesApi extends BaseApi { public class RepositoriesApi extends BaseApi {

View File

@ -7,7 +7,7 @@ import org.mian.gitnex.database.models.UserAccount;
import java.util.List; import java.util.List;
/** /**
* Author M M Arif * @author M M Arif
*/ */
public class UserAccountsApi extends BaseApi { public class UserAccountsApi extends BaseApi {
@ -19,7 +19,7 @@ public class UserAccountsApi extends BaseApi {
userAccountsDao = gitnexDatabase.userAccountsDao(); userAccountsDao = gitnexDatabase.userAccountsDao();
} }
public long createNewAccount(String accountName, String instanceUrl, String userName, String token, String serverVersion) { public long createNewAccount(String accountName, String instanceUrl, String userName, String token, String serverVersion, int maxResponseItems, int defaultPagingNumber) {
UserAccount userAccount = new UserAccount(); UserAccount userAccount = new UserAccount();
userAccount.setAccountName(accountName); userAccount.setAccountName(accountName);
@ -28,6 +28,8 @@ public class UserAccountsApi extends BaseApi {
userAccount.setToken(token); userAccount.setToken(token);
userAccount.setServerVersion(serverVersion); userAccount.setServerVersion(serverVersion);
userAccount.setLoggedIn(true); userAccount.setLoggedIn(true);
userAccount.setMaxResponseItems(maxResponseItems);
userAccount.setDefaultPagingNumber(defaultPagingNumber);
return userAccountsDao.createAccount(userAccount); return userAccountsDao.createAccount(userAccount);
@ -37,6 +39,10 @@ public class UserAccountsApi extends BaseApi {
executorService.execute(() -> userAccountsDao.updateServerVersion(serverVersion, accountId)); executorService.execute(() -> userAccountsDao.updateServerVersion(serverVersion, accountId));
} }
public void updateServerPagingLimit(final int maxResponseItems, final int defaultPagingNumber, final int accountId) {
executorService.execute(() -> userAccountsDao.updateServerPagingLimit(maxResponseItems, defaultPagingNumber, accountId));
}
public void updateToken(final int accountId, final String token) { public void updateToken(final int accountId, final String token) {
executorService.execute(() -> userAccountsDao.updateAccountToken(accountId, token)); executorService.execute(() -> userAccountsDao.updateAccountToken(accountId, token));
} }

View File

@ -9,7 +9,7 @@ import org.mian.gitnex.database.models.DraftWithRepository;
import java.util.List; import java.util.List;
/** /**
* Author M M Arif * @author M M Arif
*/ */
@Dao @Dao

View File

@ -8,7 +8,7 @@ import org.mian.gitnex.database.models.Repository;
import java.util.List; import java.util.List;
/** /**
* Author M M Arif * @author M M Arif
*/ */
@Dao @Dao

View File

@ -8,7 +8,7 @@ import org.mian.gitnex.database.models.UserAccount;
import java.util.List; import java.util.List;
/** /**
* Author M M Arif * @author M M Arif
*/ */
@Dao @Dao
@ -44,6 +44,9 @@ public interface UserAccountsDao {
@Query("UPDATE UserAccounts SET serverVersion = :serverVersion WHERE accountId = :accountId") @Query("UPDATE UserAccounts SET serverVersion = :serverVersion WHERE accountId = :accountId")
void updateServerVersion(String serverVersion, int accountId); void updateServerVersion(String serverVersion, int accountId);
@Query("UPDATE UserAccounts SET maxResponseItems = :maxResponseItems, defaultPagingNumber = :defaultPagingNumber WHERE accountId = :accountId")
void updateServerPagingLimit(int maxResponseItems, int defaultPagingNumber, int accountId);
@Query("UPDATE UserAccounts SET accountName = :accountName WHERE accountId = :accountId") @Query("UPDATE UserAccounts SET accountName = :accountName WHERE accountId = :accountId")
void updateAccountName(String accountName, int accountId); void updateAccountName(String accountName, int accountId);

View File

@ -15,11 +15,11 @@ import org.mian.gitnex.database.models.Repository;
import org.mian.gitnex.database.models.UserAccount; import org.mian.gitnex.database.models.UserAccount;
/** /**
* Author M M Arif * @author M M Arif
*/ */
@Database(entities = {Draft.class, Repository.class, UserAccount.class}, @Database(entities = {Draft.class, Repository.class, UserAccount.class},
version = 4, exportSchema = false) version = 5, exportSchema = false)
public abstract class GitnexDatabase extends RoomDatabase { public abstract class GitnexDatabase extends RoomDatabase {
private static final String DB_NAME = "gitnex"; private static final String DB_NAME = "gitnex";
@ -52,6 +52,15 @@ public abstract class GitnexDatabase extends RoomDatabase {
} }
}; };
private static final Migration MIGRATION_4_5 = new Migration(4, 5) {
@Override
public void migrate(@NonNull SupportSQLiteDatabase database) {
database.execSQL("ALTER TABLE 'userAccounts' ADD COLUMN 'maxResponseItems' INTEGER NOT NULL DEFAULT 50");
database.execSQL("ALTER TABLE 'userAccounts' ADD COLUMN 'defaultPagingNumber' INTEGER NOT NULL DEFAULT 30");
}
};
public static GitnexDatabase getDatabaseInstance(Context context) { public static GitnexDatabase getDatabaseInstance(Context context) {
if (gitnexDatabase == null) { if (gitnexDatabase == null) {
@ -61,7 +70,7 @@ public abstract class GitnexDatabase extends RoomDatabase {
gitnexDatabase = Room.databaseBuilder(context, GitnexDatabase.class, DB_NAME) gitnexDatabase = Room.databaseBuilder(context, GitnexDatabase.class, DB_NAME)
// .fallbackToDestructiveMigration() // .fallbackToDestructiveMigration()
.allowMainThreadQueries() .allowMainThreadQueries()
.addMigrations(MIGRATION_1_2, MIGRATION_2_3, MIGRATION_3_4) .addMigrations(MIGRATION_1_2, MIGRATION_2_3, MIGRATION_3_4, MIGRATION_4_5)
.build(); .build();
} }

View File

@ -9,7 +9,7 @@ import java.io.Serializable;
import static androidx.room.ForeignKey.CASCADE; import static androidx.room.ForeignKey.CASCADE;
/** /**
* Author M M Arif * @author M M Arif
*/ */
@Entity(tableName = "Drafts", foreignKeys = @ForeignKey(entity = Repository.class, parentColumns = "repositoryId", childColumns = "draftRepositoryId", onDelete = CASCADE), indices = {@Index("draftRepositoryId")}) @Entity(tableName = "Drafts", foreignKeys = @ForeignKey(entity = Repository.class, parentColumns = "repositoryId", childColumns = "draftRepositoryId", onDelete = CASCADE), indices = {@Index("draftRepositoryId")})

View File

@ -1,7 +1,7 @@
package org.mian.gitnex.database.models; package org.mian.gitnex.database.models;
/** /**
* Author M M Arif * @author M M Arif
*/ */
public class DraftWithRepository { public class DraftWithRepository {

View File

@ -8,7 +8,7 @@ import java.io.Serializable;
import static androidx.room.ForeignKey.CASCADE; import static androidx.room.ForeignKey.CASCADE;
/** /**
* Author M M Arif * @author M M Arif
*/ */
@Entity(tableName = "Repositories", foreignKeys = @ForeignKey(entity = UserAccount.class, @Entity(tableName = "Repositories", foreignKeys = @ForeignKey(entity = UserAccount.class,

View File

@ -6,7 +6,7 @@ import androidx.room.PrimaryKey;
import java.io.Serializable; import java.io.Serializable;
/** /**
* Author M M Arif * @author M M Arif
*/ */
@Entity(tableName = "userAccounts") @Entity(tableName = "userAccounts")
@ -23,6 +23,8 @@ public class UserAccount implements Serializable {
@Nullable @Nullable
private String serverVersion; private String serverVersion;
private boolean isLoggedIn; private boolean isLoggedIn;
private int maxResponseItems;
private int defaultPagingNumber;
public int getAccountId() { public int getAccountId() {
return accountId; return accountId;
@ -82,4 +84,20 @@ public class UserAccount implements Serializable {
isLoggedIn = loggedIn; isLoggedIn = loggedIn;
} }
public int getMaxResponseItems() {
return maxResponseItems;
}
public void setMaxResponseItems(int maxResponseItems) {
this.maxResponseItems = maxResponseItems;
}
public int getDefaultPagingNumber() {
return defaultPagingNumber;
}
public void setDefaultPagingNumber(int defaultPagingNumber) {
this.defaultPagingNumber = defaultPagingNumber;
}
} }

View File

@ -35,6 +35,11 @@ public class BottomSheetMyIssuesFilterFragment extends BottomSheetDialogFragment
dismiss(); dismiss();
}); });
bottomSheetIssuesFilterBinding.assignedToMe.setOnClickListener(v12 -> {
bmListener.onButtonClicked("assignedToMe");
dismiss();
});
return bottomSheetIssuesFilterBinding.getRoot(); return bottomSheetIssuesFilterBinding.getRoot();
} }

View File

@ -13,7 +13,7 @@ import org.mian.gitnex.databinding.BottomSheetOrganizationBinding;
import org.mian.gitnex.structs.BottomSheetListener; import org.mian.gitnex.structs.BottomSheetListener;
/** /**
* Author M M Arif * @author M M Arif
*/ */
public class BottomSheetOrganizationFragment extends BottomSheetDialogFragment { public class BottomSheetOrganizationFragment extends BottomSheetDialogFragment {
@ -40,7 +40,7 @@ public class BottomSheetOrganizationFragment extends BottomSheetDialogFragment {
bottomSheetOrganizationBinding.createTeam.setVisibility(View.GONE); bottomSheetOrganizationBinding.createTeam.setVisibility(View.GONE);
} }
if(!permissions.isCanCreateRepository() || !permissions.isIsOwner()) { if(!permissions.isCanCreateRepository() || !permissions.isIsOwner()) {
bottomSheetOrganizationBinding.orgCreate.setVisibility(View.GONE); bottomSheetOrganizationBinding.organizationHeadFrame.setVisibility(View.GONE);
bottomSheetOrganizationBinding.orgCreateSection.setVisibility(View.GONE); bottomSheetOrganizationBinding.orgCreateSection.setVisibility(View.GONE);
bottomSheetOrganizationBinding.orgDivider.setVisibility(View.GONE); bottomSheetOrganizationBinding.orgDivider.setVisibility(View.GONE);
} }
@ -70,6 +70,18 @@ public class BottomSheetOrganizationFragment extends BottomSheetDialogFragment {
dismiss(); dismiss();
}); });
bottomSheetOrganizationBinding.share.setOnClickListener(v1 -> {
bmListener.onButtonClicked("share");
dismiss();
});
bottomSheetOrganizationBinding.open.setOnClickListener(v1 -> {
bmListener.onButtonClicked("open");
dismiss();
});
return bottomSheetOrganizationBinding.getRoot(); return bottomSheetOrganizationBinding.getRoot();
} }

View File

@ -1,9 +1,6 @@
package org.mian.gitnex.fragments; package org.mian.gitnex.fragments;
import android.content.ClipData;
import android.content.ClipboardManager;
import android.content.Context; import android.content.Context;
import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
import android.view.Gravity; import android.view.Gravity;
import android.view.LayoutInflater; import android.view.LayoutInflater;
@ -23,7 +20,7 @@ import org.mian.gitnex.activities.IssueDetailActivity;
import org.mian.gitnex.activities.MergePullRequestActivity; import org.mian.gitnex.activities.MergePullRequestActivity;
import org.mian.gitnex.databinding.BottomSheetSingleIssueBinding; import org.mian.gitnex.databinding.BottomSheetSingleIssueBinding;
import org.mian.gitnex.helpers.AlertDialogs; import org.mian.gitnex.helpers.AlertDialogs;
import org.mian.gitnex.helpers.Toasty; import org.mian.gitnex.helpers.AppUtil;
import org.mian.gitnex.helpers.contexts.IssueContext; import org.mian.gitnex.helpers.contexts.IssueContext;
import org.mian.gitnex.structs.BottomSheetListener; import org.mian.gitnex.structs.BottomSheetListener;
import org.mian.gitnex.views.ReactionSpinner; import org.mian.gitnex.views.ReactionSpinner;
@ -84,9 +81,7 @@ public class BottomSheetSingleIssueFragment extends BottomSheetDialogFragment {
if(issue.getIssueType().equalsIgnoreCase("Pull")) { if(issue.getIssueType().equalsIgnoreCase("Pull")) {
binding.editIssue.setText(R.string.editPrText); binding.editIssue.setText(R.string.menuEditText);
binding.copyIssueUrl.setText(R.string.copyPrUrlText);
binding.shareIssue.setText(R.string.sharePr);
boolean canPushPullSource = issue.getPullRequest().getHead().getRepo().getPermissions().isPush(); boolean canPushPullSource = issue.getPullRequest().getHead().getRepo().getPermissions().isPush();
if(issue.getPullRequest().isMerged() || issue.getIssue().getState().equals("closed")) { if(issue.getPullRequest().isMerged() || issue.getIssue().getState().equals("closed")) {
@ -176,35 +171,32 @@ public class BottomSheetSingleIssueFragment extends BottomSheetDialogFragment {
binding.shareIssue.setOnClickListener(v1 -> { binding.shareIssue.setOnClickListener(v1 -> {
Intent sharingIntent = new Intent(android.content.Intent.ACTION_SEND); AppUtil.sharingIntent(ctx, issue.getIssue().getHtmlUrl());
sharingIntent.setType("text/plain");
sharingIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, getResources().getString(R.string.hash) + issue.getIssueIndex() + " " + issue.getIssue().getTitle());
sharingIntent.putExtra(android.content.Intent.EXTRA_TEXT, issue.getIssue().getHtmlUrl());
startActivity(Intent.createChooser(sharingIntent, getResources().getString(R.string.hash) + issue.getIssueIndex() + " " + issue.getIssue().getTitle()));
dismiss(); dismiss();
}); });
binding.copyIssueUrl.setOnClickListener(v12 -> { binding.copyIssueUrl.setOnClickListener(v12 -> {
// copy to clipboard AppUtil.copyToClipboard(ctx, issue.getIssue().getHtmlUrl(), ctx.getString(R.string.copyIssueUrlToastMsg));
ClipboardManager clipboard = (ClipboardManager) Objects.requireNonNull(ctx).getSystemService(Context.CLIPBOARD_SERVICE);
ClipData clip = ClipData.newPlainText("issueUrl", issue.getIssue().getHtmlUrl());
assert clipboard != null;
clipboard.setPrimaryClip(clip);
Toasty.info(ctx, ctx.getString(R.string.copyIssueUrlToastMsg));
dismiss(); dismiss();
}); });
binding.open.setOnClickListener(v12 -> {
AppUtil.openUrlInBrowser(ctx, issue.getIssue().getHtmlUrl());
dismiss();
});
if(issue.getIssueType().equalsIgnoreCase("pull")) {
binding.bottomSheetHeader.setText(R.string.pullRequest);
}
if(issue.getIssue().getState().equals("open")) { // close issue if(issue.getIssue().getState().equals("open")) { // close issue
if(!userIsCreator && !canPush) { if(!userIsCreator && !canPush) {
binding.closeIssue.setVisibility(View.GONE); binding.closeIssue.setVisibility(View.GONE);
binding.dividerCloseReopenIssue.setVisibility(View.GONE);
} }
else if(issue.getIssueType().equalsIgnoreCase("Pull")) { else if(issue.getIssueType().equalsIgnoreCase("Pull")) {
binding.closeIssue.setText(R.string.closePr); binding.closeIssue.setText(R.string.close);
} }
binding.closeIssue.setOnClickListener(closeSingleIssue -> { binding.closeIssue.setOnClickListener(closeSingleIssue -> {
IssueActions.closeReopenIssue(ctx, "closed", issue); IssueActions.closeReopenIssue(ctx, "closed", issue);
@ -213,16 +205,10 @@ public class BottomSheetSingleIssueFragment extends BottomSheetDialogFragment {
} }
else if(issue.getIssue().getState().equals("closed")) { else if(issue.getIssue().getState().equals("closed")) {
if(userIsCreator || canPush) { if(userIsCreator || canPush) {
if(issue.getIssueType().equalsIgnoreCase("Pull")) { binding.closeIssue.setText(R.string.reopen);
binding.closeIssue.setText(R.string.reopenPr);
}
else {
binding.closeIssue.setText(R.string.reOpenIssue);
}
} }
else { else {
binding.closeIssue.setVisibility(View.GONE); binding.closeIssue.setVisibility(View.GONE);
binding.dividerCloseReopenIssue.setVisibility(View.GONE);
} }
binding.closeIssue.setOnClickListener(closeSingleIssue -> { binding.closeIssue.setOnClickListener(closeSingleIssue -> {
IssueActions.closeReopenIssue(ctx, "open", issue); IssueActions.closeReopenIssue(ctx, "open", issue);
@ -259,10 +245,15 @@ public class BottomSheetSingleIssueFragment extends BottomSheetDialogFragment {
binding.editIssue.setVisibility(View.GONE); binding.editIssue.setVisibility(View.GONE);
binding.editLabels.setVisibility(View.GONE); binding.editLabels.setVisibility(View.GONE);
binding.closeIssue.setVisibility(View.GONE); binding.closeIssue.setVisibility(View.GONE);
binding.dividerCloseReopenIssue.setVisibility(View.GONE);
binding.addRemoveAssignees.setVisibility(View.GONE); binding.addRemoveAssignees.setVisibility(View.GONE);
binding.commentReactionButtons.setVisibility(View.GONE); binding.commentReactionButtons.setVisibility(View.GONE);
binding.shareDivider.setVisibility(View.GONE); binding.reactionDivider.setVisibility(View.GONE);
binding.bottomSheetHeaderFrame.setVisibility(View.GONE);
binding.mergePullRequest.setVisibility(View.GONE);
binding.updatePullRequest.setVisibility(View.GONE);
if(issue.getIssueType().equalsIgnoreCase("issue")) {
binding.issuePrDivider.setVisibility(View.GONE);
}
} }
else if(!canPush) { else if(!canPush) {
binding.addRemoveAssignees.setVisibility(View.GONE); binding.addRemoveAssignees.setVisibility(View.GONE);

View File

@ -26,6 +26,7 @@ import org.mian.gitnex.viewmodels.IssuesViewModel;
public class ExploreIssuesFragment extends Fragment { public class ExploreIssuesFragment extends Fragment {
private IssuesViewModel issuesViewModel;
private FragmentSearchIssuesBinding viewBinding; private FragmentSearchIssuesBinding viewBinding;
private ExploreIssuesAdapter adapter; private ExploreIssuesAdapter adapter;
private int page = 1; private int page = 1;
@ -35,6 +36,7 @@ public class ExploreIssuesFragment extends Fragment {
viewBinding = FragmentSearchIssuesBinding.inflate(inflater, container, false); viewBinding = FragmentSearchIssuesBinding.inflate(inflater, container, false);
setHasOptionsMenu(true); setHasOptionsMenu(true);
issuesViewModel = new ViewModelProvider(this).get(IssuesViewModel.class);
viewBinding.pullToRefresh.setOnRefreshListener(() -> new Handler(Looper.getMainLooper()).postDelayed(() -> { viewBinding.pullToRefresh.setOnRefreshListener(() -> new Handler(Looper.getMainLooper()).postDelayed(() -> {
@ -55,9 +57,7 @@ public class ExploreIssuesFragment extends Fragment {
private void fetchDataAsync(String searchKeyword) { private void fetchDataAsync(String searchKeyword) {
IssuesViewModel issuesModel = new ViewModelProvider(this).get(IssuesViewModel.class); issuesViewModel.getIssuesList(searchKeyword, "issues", null, "open", null, getContext()).observe(getViewLifecycleOwner(), issuesListMain -> {
issuesModel.getIssuesList(searchKeyword, "issues", null, "open", getContext()).observe(getViewLifecycleOwner(), issuesListMain -> {
adapter = new ExploreIssuesAdapter(issuesListMain, getContext()); adapter = new ExploreIssuesAdapter(issuesListMain, getContext());
adapter.setLoadMoreListener(new ExploreIssuesAdapter.OnLoadMoreListener() { adapter.setLoadMoreListener(new ExploreIssuesAdapter.OnLoadMoreListener() {
@ -66,7 +66,7 @@ public class ExploreIssuesFragment extends Fragment {
public void onLoadMore() { public void onLoadMore() {
page += 1; page += 1;
IssuesViewModel.loadMoreIssues(searchKeyword, "issues", null, "open", page, getContext(), adapter); issuesViewModel.loadMoreIssues(searchKeyword, "issues", null, "open", page, null, getContext(), adapter);
viewBinding.progressBar.setVisibility(View.VISIBLE); viewBinding.progressBar.setVisibility(View.VISIBLE);
} }

View File

@ -101,7 +101,7 @@ public class ExploreRepositoriesFragment extends Fragment {
Call<SearchResults> call = RetrofitClient Call<SearchResults> call = RetrofitClient
.getApiInterface(context).repoSearch(searchKeyword, includeTopic, includeDescription, null, null, null, null, .getApiInterface(context).repoSearch(searchKeyword, includeTopic, includeDescription, null, null, null, null,
null, null, includeTemplate, onlyArchived, null, null, null, null, 1, resultLimit); repoTypeInclude, null, includeTemplate, onlyArchived, null, null, sort, order, 1, resultLimit);
call.enqueue(new Callback<>() { call.enqueue(new Callback<>() {
@Override @Override
public void onResponse(@NonNull Call<SearchResults> call, @NonNull Response<SearchResults> response) { public void onResponse(@NonNull Call<SearchResults> call, @NonNull Response<SearchResults> response) {
@ -141,7 +141,7 @@ public class ExploreRepositoriesFragment extends Fragment {
viewBinding.progressBar.setVisibility(View.VISIBLE); viewBinding.progressBar.setVisibility(View.VISIBLE);
Call<SearchResults> call = RetrofitClient.getApiInterface(context) Call<SearchResults> call = RetrofitClient.getApiInterface(context)
.repoSearch(searchKeyword, includeTopic, includeDescription, null, null, null, null, .repoSearch(searchKeyword, includeTopic, includeDescription, null, null, null, null,
null, null, includeTemplate, onlyArchived, null, null, null, null, page, resultLimit); repoTypeInclude, null, includeTemplate, onlyArchived, null, null, sort, order, page, resultLimit);
call.enqueue(new Callback<>() { call.enqueue(new Callback<>() {
@Override @Override

View File

@ -83,7 +83,7 @@ public class ExploreUsersFragment extends Fragment {
private void loadInitial(String searchKeyword, int resultLimit) { private void loadInitial(String searchKeyword, int resultLimit) {
Call<InlineResponse2001> call = RetrofitClient Call<InlineResponse2001> call = RetrofitClient
.getApiInterface(context).userSearch(searchKeyword, null, resultLimit, 1); .getApiInterface(context).userSearch(searchKeyword, null, 1, resultLimit);
call.enqueue(new Callback<>() { call.enqueue(new Callback<>() {
@Override @Override
public void onResponse(@NonNull Call<InlineResponse2001> call, @NonNull Response<InlineResponse2001> response) { public void onResponse(@NonNull Call<InlineResponse2001> call, @NonNull Response<InlineResponse2001> response) {
@ -121,7 +121,7 @@ public class ExploreUsersFragment extends Fragment {
private void loadMore(String searchKeyword, int resultLimit, int page) { private void loadMore(String searchKeyword, int resultLimit, int page) {
viewBinding.progressBar.setVisibility(View.VISIBLE); viewBinding.progressBar.setVisibility(View.VISIBLE);
Call<InlineResponse2001> call = RetrofitClient.getApiInterface(context).userSearch(searchKeyword, null, resultLimit, page); Call<InlineResponse2001> call = RetrofitClient.getApiInterface(context).userSearch(searchKeyword, null, page, resultLimit);
call.enqueue(new Callback<>() { call.enqueue(new Callback<>() {
@Override @Override
public void onResponse(@NonNull Call<InlineResponse2001> call, @NonNull Response<InlineResponse2001> response) { public void onResponse(@NonNull Call<InlineResponse2001> call, @NonNull Response<InlineResponse2001> response) {

View File

@ -4,7 +4,6 @@ import android.content.Context;
import android.os.Bundle; import android.os.Bundle;
import android.os.Handler; import android.os.Handler;
import android.os.Looper; import android.os.Looper;
import android.util.Log;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.Menu; import android.view.Menu;
import android.view.MenuInflater; import android.view.MenuInflater;
@ -19,13 +18,13 @@ import androidx.recyclerview.widget.DividerItemDecoration;
import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.LinearLayoutManager;
import org.gitnex.tea4j.v2.models.Issue; import org.gitnex.tea4j.v2.models.Issue;
import org.mian.gitnex.R; import org.mian.gitnex.R;
import org.mian.gitnex.activities.BaseActivity;
import org.mian.gitnex.activities.RepoDetailActivity; import org.mian.gitnex.activities.RepoDetailActivity;
import org.mian.gitnex.adapters.IssuesAdapter; import org.mian.gitnex.adapters.IssuesAdapter;
import org.mian.gitnex.clients.RetrofitClient; import org.mian.gitnex.clients.RetrofitClient;
import org.mian.gitnex.databinding.FragmentIssuesBinding; import org.mian.gitnex.databinding.FragmentIssuesBinding;
import org.mian.gitnex.helpers.Constants; import org.mian.gitnex.helpers.Constants;
import org.mian.gitnex.helpers.SnackBar; import org.mian.gitnex.helpers.SnackBar;
import org.mian.gitnex.helpers.Toasty;
import org.mian.gitnex.helpers.contexts.RepositoryContext; import org.mian.gitnex.helpers.contexts.RepositoryContext;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@ -34,7 +33,7 @@ import retrofit2.Callback;
import retrofit2.Response; import retrofit2.Response;
/** /**
* Author M M Arif * @author M M Arif
*/ */
public class IssuesFragment extends Fragment { public class IssuesFragment extends Fragment {
@ -49,8 +48,7 @@ public class IssuesFragment extends Fragment {
private IssuesAdapter adapter; private IssuesAdapter adapter;
private int pageSize = Constants.issuesPageInit; private int pageSize = Constants.issuesPageInit;
private final String TAG = Constants.tagIssuesList; private int resultLimit;
private int resultLimit = Constants.resultLimitOldGiteaInstances;
private final String requestType = Constants.issuesRequestType; private final String requestType = Constants.issuesRequestType;
private RepositoryContext repository; private RepositoryContext repository;
@ -71,16 +69,13 @@ public class IssuesFragment extends Fragment {
repository = RepositoryContext.fromBundle(requireArguments()); repository = RepositoryContext.fromBundle(requireArguments());
// if gitea is 1.12 or higher use the new limit resultLimit = Constants.getCurrentResultLimit(context);
if(((BaseActivity) requireActivity()).getAccount().requiresVersion("1.12.0")) {
resultLimit = Constants.resultLimitNewGiteaInstances;
}
issuesList = new ArrayList<>(); issuesList = new ArrayList<>();
fragmentIssuesBinding.pullToRefresh.setOnRefreshListener(() -> new Handler(Looper.getMainLooper()).postDelayed(() -> { fragmentIssuesBinding.pullToRefresh.setOnRefreshListener(() -> new Handler(Looper.getMainLooper()).postDelayed(() -> {
fragmentIssuesBinding.pullToRefresh.setRefreshing(false); fragmentIssuesBinding.pullToRefresh.setRefreshing(false);
loadInitial(repository.getOwner(), repository.getName(), resultLimit, requestType, repository.getIssueState().toString(), repository.getIssueMilestoneFilterName()); loadInitial(repository.getOwner(), repository.getName(), resultLimit, requestType, repository.getIssueState().toString(), repository.getIssueMilestoneFilterName(), null);
adapter.notifyDataChanged(); adapter.notifyDataChanged();
}, 200)); }, 200));
@ -121,7 +116,7 @@ public class IssuesFragment extends Fragment {
fragmentIssuesBinding.progressBar.setVisibility(View.VISIBLE); fragmentIssuesBinding.progressBar.setVisibility(View.VISIBLE);
fragmentIssuesBinding.noDataIssues.setVisibility(View.GONE); fragmentIssuesBinding.noDataIssues.setVisibility(View.GONE);
loadInitial(repository.getOwner(), repository.getName(), resultLimit, requestType, issueState, repository.getIssueMilestoneFilterName()); loadInitial(repository.getOwner(), repository.getName(), resultLimit, requestType, issueState, repository.getIssueMilestoneFilterName(), null);
fragmentIssuesBinding.recyclerView.setAdapter(adapter); fragmentIssuesBinding.recyclerView.setAdapter(adapter);
}); });
@ -141,11 +136,11 @@ public class IssuesFragment extends Fragment {
fragmentIssuesBinding.progressBar.setVisibility(View.VISIBLE); fragmentIssuesBinding.progressBar.setVisibility(View.VISIBLE);
fragmentIssuesBinding.noDataIssues.setVisibility(View.GONE); fragmentIssuesBinding.noDataIssues.setVisibility(View.GONE);
loadInitial(repository.getOwner(), repository.getName(), resultLimit, requestType, repository.getIssueState().toString(), filterIssueByMilestone); loadInitial(repository.getOwner(), repository.getName(), resultLimit, requestType, repository.getIssueState().toString(), filterIssueByMilestone, null);
fragmentIssuesBinding.recyclerView.setAdapter(adapter); fragmentIssuesBinding.recyclerView.setAdapter(adapter);
}); });
loadInitial(repository.getOwner(), repository.getName(), resultLimit, requestType, repository.getIssueState().toString(), repository.getIssueMilestoneFilterName()); loadInitial(repository.getOwner(), repository.getName(), resultLimit, requestType, repository.getIssueState().toString(), repository.getIssueMilestoneFilterName(), null);
return fragmentIssuesBinding.getRoot(); return fragmentIssuesBinding.getRoot();
} }
@ -154,17 +149,18 @@ public class IssuesFragment extends Fragment {
public void onResume() { public void onResume() {
super.onResume(); super.onResume();
if(resumeIssues) { if(resumeIssues) {
loadInitial(repository.getOwner(), repository.getName(), resultLimit, requestType, repository.getIssueState().toString(), repository.getIssueMilestoneFilterName()); loadInitial(repository.getOwner(), repository.getName(), resultLimit, requestType, repository.getIssueState().toString(), repository.getIssueMilestoneFilterName(), null);
resumeIssues = false; resumeIssues = false;
} }
} }
private void loadInitial(String repoOwner, String repoName, int resultLimit, String requestType, String issueState, String filterByMilestone) { private void loadInitial(String repoOwner, String repoName, int resultLimit, String requestType, String issueState, String filterByMilestone, String query) {
Call<List<Issue>> call = RetrofitClient.getApiInterface(context).issueListIssues(repoOwner, repoName, issueState, null, null, requestType, Call<List<Issue>> call = RetrofitClient.getApiInterface(context).issueListIssues(repoOwner, repoName, issueState, null, query, requestType,
filterByMilestone, null, null, null, null, null, 1, resultLimit); filterByMilestone, null, null, null, null, null, 1, resultLimit);
call.enqueue(new Callback<List<Issue>>() { call.enqueue(new Callback<>() {
@Override @Override
public void onResponse(@NonNull Call<List<Issue>> call, @NonNull Response<List<Issue>> response) { public void onResponse(@NonNull Call<List<Issue>> call, @NonNull Response<List<Issue>> response) {
@ -188,13 +184,13 @@ public class IssuesFragment extends Fragment {
fragmentIssuesBinding.progressBar.setVisibility(View.GONE); fragmentIssuesBinding.progressBar.setVisibility(View.GONE);
} }
else { else {
Log.e(TAG, String.valueOf(response.code())); Toasty.error(context, getString(R.string.genericError));
} }
} }
@Override @Override
public void onFailure(@NonNull Call<List<Issue>> call, @NonNull Throwable t) { public void onFailure(@NonNull Call<List<Issue>> call, @NonNull Throwable t) {
Log.e(TAG, t.toString()); Toasty.error(context, getString(R.string.genericServerResponseError));
} }
}); });
} }
@ -205,10 +201,11 @@ public class IssuesFragment extends Fragment {
Call<List<Issue>> call = RetrofitClient.getApiInterface(context).issueListIssues(repoOwner, repoName, issueState, null, null, requestType, Call<List<Issue>> call = RetrofitClient.getApiInterface(context).issueListIssues(repoOwner, repoName, issueState, null, null, requestType,
filterByMilestone, null, null, null, null, null, page, resultLimit); filterByMilestone, null, null, null, null, null, page, resultLimit);
call.enqueue(new Callback<List<Issue>>() { call.enqueue(new Callback<>() {
@Override @Override
public void onResponse(@NonNull Call<List<Issue>> call, @NonNull Response<List<Issue>> response) { public void onResponse(@NonNull Call<List<Issue>> call, @NonNull Response<List<Issue>> response) {
if(response.code() == 200) { if(response.code() == 200) {
List<Issue> result = response.body(); List<Issue> result = response.body();
assert result != null; assert result != null;
@ -224,13 +221,13 @@ public class IssuesFragment extends Fragment {
fragmentIssuesBinding.progressBar.setVisibility(View.GONE); fragmentIssuesBinding.progressBar.setVisibility(View.GONE);
} }
else { else {
Log.e(TAG, String.valueOf(response.code())); Toasty.error(context, getString(R.string.genericError));
} }
} }
@Override @Override
public void onFailure(@NonNull Call<List<Issue>> call, @NonNull Throwable t) { public void onFailure(@NonNull Call<List<Issue>> call, @NonNull Throwable t) {
Log.e(TAG, t.toString()); Toasty.error(context, getString(R.string.genericServerResponseError));
} }
}); });
} }
@ -258,30 +255,16 @@ public class IssuesFragment extends Fragment {
@Override @Override
public boolean onQueryTextSubmit(String query) { public boolean onQueryTextSubmit(String query) {
loadInitial(repository.getOwner(), repository.getName(), resultLimit, requestType, repository.getIssueState().toString(), repository.getIssueMilestoneFilterName(), query);
searchView.setQuery(null, false);
searchItem.collapseActionView();
return false; return false;
} }
@Override @Override
public boolean onQueryTextChange(String newText) { public boolean onQueryTextChange(String newText) {
filter(newText);
return false; return false;
} }
}); });
} }
private void filter(String text) {
List<Issue> arr = new ArrayList<>();
for(Issue d : issuesList) {
if(d == null || d.getTitle() == null || d.getBody() == null) {
continue;
}
if(d.getTitle().toLowerCase().contains(text) || d.getBody().toLowerCase().contains(text) || String.valueOf(d.getNumber()).startsWith(text)) {
arr.add(d);
}
}
adapter.updateList(arr);
}
} }

View File

@ -22,11 +22,12 @@ import org.mian.gitnex.helpers.contexts.RepositoryContext;
import org.mian.gitnex.viewmodels.LabelsViewModel; import org.mian.gitnex.viewmodels.LabelsViewModel;
/** /**
* Author M M Arif * @author M M Arif
*/ */
public class LabelsFragment extends Fragment { public class LabelsFragment extends Fragment {
private LabelsViewModel labelsViewModel;
private ProgressBar mProgressBar; private ProgressBar mProgressBar;
private RecyclerView mRecyclerView; private RecyclerView mRecyclerView;
private LabelsAdapter adapter; private LabelsAdapter adapter;
@ -55,6 +56,7 @@ public class LabelsFragment extends Fragment {
FragmentLabelsBinding fragmentLabelsBinding = FragmentLabelsBinding.inflate(inflater, container, false); FragmentLabelsBinding fragmentLabelsBinding = FragmentLabelsBinding.inflate(inflater, container, false);
setHasOptionsMenu(true); setHasOptionsMenu(true);
labelsViewModel = new ViewModelProvider(this).get(LabelsViewModel.class);
final SwipeRefreshLayout swipeRefresh = fragmentLabelsBinding.pullToRefresh; final SwipeRefreshLayout swipeRefresh = fragmentLabelsBinding.pullToRefresh;
noData = fragmentLabelsBinding.noData; noData = fragmentLabelsBinding.noData;
@ -72,7 +74,7 @@ public class LabelsFragment extends Fragment {
swipeRefresh.setOnRefreshListener(() -> new Handler(Looper.getMainLooper()).postDelayed(() -> { swipeRefresh.setOnRefreshListener(() -> new Handler(Looper.getMainLooper()).postDelayed(() -> {
swipeRefresh.setRefreshing(false); swipeRefresh.setRefreshing(false);
LabelsViewModel.loadLabelsList(repository.getOwner(), repository.getName(), getContext()); labelsViewModel.loadLabelsList(repository.getOwner(), repository.getName(), getContext());
}, 200)); }, 200));
fetchDataAsync(repository.getOwner(), repository.getName()); fetchDataAsync(repository.getOwner(), repository.getName());
@ -87,7 +89,7 @@ public class LabelsFragment extends Fragment {
if(CreateLabelActivity.refreshLabels) { if(CreateLabelActivity.refreshLabels) {
LabelsViewModel.loadLabelsList(repository.getOwner(), repository.getName(), getContext()); labelsViewModel.loadLabelsList(repository.getOwner(), repository.getName(), getContext());
CreateLabelActivity.refreshLabels = false; CreateLabelActivity.refreshLabels = false;
} }
} }

View File

@ -33,6 +33,7 @@ import java.util.List;
public class MilestonesFragment extends Fragment { public class MilestonesFragment extends Fragment {
private MilestonesViewModel milestonesViewModel;
private FragmentMilestonesBinding viewBinding; private FragmentMilestonesBinding viewBinding;
private Menu menu; private Menu menu;
private List<Milestone> dataList; private List<Milestone> dataList;
@ -60,6 +61,7 @@ public class MilestonesFragment extends Fragment {
viewBinding = FragmentMilestonesBinding.inflate(inflater, container, false); viewBinding = FragmentMilestonesBinding.inflate(inflater, container, false);
setHasOptionsMenu(true); setHasOptionsMenu(true);
Context ctx = getContext(); Context ctx = getContext();
milestonesViewModel = new ViewModelProvider(this).get(MilestonesViewModel.class);
milestoneId = requireActivity().getIntent().getStringExtra("milestoneId"); milestoneId = requireActivity().getIntent().getStringExtra("milestoneId");
requireActivity().getIntent().removeExtra("milestoneId"); requireActivity().getIntent().removeExtra("milestoneId");
@ -106,8 +108,6 @@ public class MilestonesFragment extends Fragment {
private void fetchDataAsync(String repoOwner, String repoName, String state) { private void fetchDataAsync(String repoOwner, String repoName, String state) {
MilestonesViewModel milestonesViewModel = new ViewModelProvider(this).get(MilestonesViewModel.class);
milestonesViewModel.getMilestonesList(repoOwner, repoName, state, getContext()).observe(getViewLifecycleOwner(), milestonesListMain -> { milestonesViewModel.getMilestonesList(repoOwner, repoName, state, getContext()).observe(getViewLifecycleOwner(), milestonesListMain -> {
adapter = new MilestonesAdapter(getContext(), milestonesListMain, repository); adapter = new MilestonesAdapter(getContext(), milestonesListMain, repository);
@ -117,7 +117,7 @@ public class MilestonesFragment extends Fragment {
public void onLoadMore() { public void onLoadMore() {
page += 1; page += 1;
MilestonesViewModel.loadMoreMilestones(repoOwner, repoName, page, state, getContext(), adapter); milestonesViewModel.loadMoreMilestones(repoOwner, repoName, page, state, getContext(), adapter);
viewBinding.progressBar.setVisibility(View.VISIBLE); viewBinding.progressBar.setVisibility(View.VISIBLE);
} }

View File

@ -27,17 +27,20 @@ import org.mian.gitnex.viewmodels.IssuesViewModel;
public class MyIssuesFragment extends Fragment { public class MyIssuesFragment extends Fragment {
private IssuesViewModel issuesViewModel;
private FragmentIssuesBinding fragmentIssuesBinding; private FragmentIssuesBinding fragmentIssuesBinding;
private ExploreIssuesAdapter adapter; private ExploreIssuesAdapter adapter;
private int page = 1; private int page = 1;
private Menu menu; private Menu menu;
public String state = "open"; public String state = "open";
public boolean assignedToMe = false;
@Override @Override
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
fragmentIssuesBinding = FragmentIssuesBinding.inflate(inflater, container, false); fragmentIssuesBinding = FragmentIssuesBinding.inflate(inflater, container, false);
setHasOptionsMenu(true); setHasOptionsMenu(true);
issuesViewModel = new ViewModelProvider(this).get(IssuesViewModel.class);
fragmentIssuesBinding.recyclerView.setHasFixedSize(true); fragmentIssuesBinding.recyclerView.setHasFixedSize(true);
fragmentIssuesBinding.recyclerView.setLayoutManager(new LinearLayoutManager(getContext())); fragmentIssuesBinding.recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
@ -45,40 +48,40 @@ public class MyIssuesFragment extends Fragment {
DividerItemDecoration.VERTICAL); DividerItemDecoration.VERTICAL);
fragmentIssuesBinding.recyclerView.addItemDecoration(dividerItemDecoration); fragmentIssuesBinding.recyclerView.addItemDecoration(dividerItemDecoration);
((MainActivity) requireActivity()).setFragmentRefreshListenerMyIssues(myIssuesState -> { ((MainActivity) requireActivity()).setFragmentRefreshListenerMyIssues(myIssues -> {
state = myIssuesState; state = myIssues;
if(myIssuesState.equals("open")) { if(state.equals("closed")) {
menu.getItem(1).setIcon(R.drawable.ic_filter);
}
else {
menu.getItem(1).setIcon(R.drawable.ic_filter_closed); menu.getItem(1).setIcon(R.drawable.ic_filter_closed);
} }
else {
menu.getItem(1).setIcon(R.drawable.ic_filter);
}
assignedToMe = state.equals("assignedToMe");
fragmentIssuesBinding.progressBar.setVisibility(View.VISIBLE); fragmentIssuesBinding.progressBar.setVisibility(View.VISIBLE);
fragmentIssuesBinding.noDataIssues.setVisibility(View.GONE); fragmentIssuesBinding.noDataIssues.setVisibility(View.GONE);
fetchDataAsync(null, myIssuesState); fetchDataAsync(null, state, assignedToMe);
}); });
fragmentIssuesBinding.pullToRefresh.setOnRefreshListener(() -> new Handler(Looper.getMainLooper()).postDelayed(() -> { fragmentIssuesBinding.pullToRefresh.setOnRefreshListener(() -> new Handler(Looper.getMainLooper()).postDelayed(() -> {
page = 1; page = 1;
fragmentIssuesBinding.pullToRefresh.setRefreshing(false); fragmentIssuesBinding.pullToRefresh.setRefreshing(false);
IssuesViewModel.loadIssuesList(null, "issues", true, state, getContext()); issuesViewModel.loadIssuesList(null, "issues", true, state, assignedToMe, getContext());
fragmentIssuesBinding.progressBar.setVisibility(View.VISIBLE); fragmentIssuesBinding.progressBar.setVisibility(View.VISIBLE);
}, 50)); }, 50));
fetchDataAsync(null, state); fetchDataAsync(null, state, assignedToMe);
return fragmentIssuesBinding.getRoot(); return fragmentIssuesBinding.getRoot();
}; };
private void fetchDataAsync(String query, String state) { private void fetchDataAsync(String query, String state, boolean assignedToMe) {
IssuesViewModel issuesModel = new ViewModelProvider(this).get(IssuesViewModel.class); issuesViewModel.getIssuesList(query, "issues", true, state, assignedToMe, getContext()).observe(getViewLifecycleOwner(), issuesListMain -> {
issuesModel.getIssuesList(query, "issues", true, state, getContext()).observe(getViewLifecycleOwner(), issuesListMain -> {
adapter = new ExploreIssuesAdapter(issuesListMain, getContext()); adapter = new ExploreIssuesAdapter(issuesListMain, getContext());
adapter.setLoadMoreListener(new ExploreIssuesAdapter.OnLoadMoreListener() { adapter.setLoadMoreListener(new ExploreIssuesAdapter.OnLoadMoreListener() {
@ -87,7 +90,7 @@ public class MyIssuesFragment extends Fragment {
public void onLoadMore() { public void onLoadMore() {
page += 1; page += 1;
IssuesViewModel.loadMoreIssues(query, "issues", true, state, page, getContext(), adapter); issuesViewModel.loadMoreIssues(query, "issues", true, state, page, assignedToMe, getContext(), adapter);
fragmentIssuesBinding.progressBar.setVisibility(View.VISIBLE); fragmentIssuesBinding.progressBar.setVisibility(View.VISIBLE);
} }
@ -128,7 +131,7 @@ public class MyIssuesFragment extends Fragment {
@Override @Override
public boolean onQueryTextSubmit(String query) { public boolean onQueryTextSubmit(String query) {
fetchDataAsync(query, state); fetchDataAsync(query, state, assignedToMe);
searchView.setQuery(null, false); searchView.setQuery(null, false);
searchItem.collapseActionView(); searchItem.collapseActionView();
return false; return false;

View File

@ -20,11 +20,12 @@ import org.mian.gitnex.databinding.FragmentProfileEmailsBinding;
import org.mian.gitnex.viewmodels.ProfileEmailsViewModel; import org.mian.gitnex.viewmodels.ProfileEmailsViewModel;
/** /**
* Author M M Arif * @author M M Arif
*/ */
public class MyProfileEmailsFragment extends Fragment { public class MyProfileEmailsFragment extends Fragment {
private ProfileEmailsViewModel profileEmailsViewModel;
public static boolean refreshEmails = false; public static boolean refreshEmails = false;
private ProgressBar mProgressBar; private ProgressBar mProgressBar;
@ -40,6 +41,7 @@ public class MyProfileEmailsFragment extends Fragment {
Bundle savedInstanceState) { Bundle savedInstanceState) {
FragmentProfileEmailsBinding fragmentProfileEmailsBinding = FragmentProfileEmailsBinding.inflate(inflater, container, false); FragmentProfileEmailsBinding fragmentProfileEmailsBinding = FragmentProfileEmailsBinding.inflate(inflater, container, false);
profileEmailsViewModel = new ViewModelProvider(this).get(ProfileEmailsViewModel.class);
final SwipeRefreshLayout swipeRefresh = fragmentProfileEmailsBinding.pullToRefresh; final SwipeRefreshLayout swipeRefresh = fragmentProfileEmailsBinding.pullToRefresh;
@ -57,21 +59,18 @@ public class MyProfileEmailsFragment extends Fragment {
swipeRefresh.setOnRefreshListener(() -> new Handler(Looper.getMainLooper()).postDelayed(() -> { swipeRefresh.setOnRefreshListener(() -> new Handler(Looper.getMainLooper()).postDelayed(() -> {
swipeRefresh.setRefreshing(false); swipeRefresh.setRefreshing(false);
ProfileEmailsViewModel.loadEmailsList(getContext()); profileEmailsViewModel.loadEmailsList(getContext());
}, 200)); }, 200));
fetchDataAsync(); fetchDataAsync();
return fragmentProfileEmailsBinding.getRoot(); return fragmentProfileEmailsBinding.getRoot();
} }
private void fetchDataAsync() { private void fetchDataAsync() {
ProfileEmailsViewModel profileEmailModel = new ViewModelProvider(this).get(ProfileEmailsViewModel.class); profileEmailsViewModel.getEmailsList(getContext()).observe(getViewLifecycleOwner(), emailsListMain -> {
profileEmailModel.getEmailsList(getContext()).observe(getViewLifecycleOwner(), emailsListMain -> {
adapter = new MyProfileEmailsAdapter(getContext(), emailsListMain); adapter = new MyProfileEmailsAdapter(getContext(), emailsListMain);
if(adapter.getItemCount() > 0) { if(adapter.getItemCount() > 0) {
mRecyclerView.setAdapter(adapter); mRecyclerView.setAdapter(adapter);
@ -89,13 +88,11 @@ public class MyProfileEmailsFragment extends Fragment {
@Override @Override
public void onResume() { public void onResume() {
super.onResume(); super.onResume();
if(refreshEmails) { if(refreshEmails) {
ProfileEmailsViewModel.loadEmailsList(getContext()); profileEmailsViewModel.loadEmailsList(getContext());
refreshEmails = false; refreshEmails = false;
} }
} }
} }

View File

@ -31,20 +31,24 @@ import org.mian.gitnex.viewmodels.RepositoriesViewModel;
public class MyRepositoriesFragment extends Fragment { public class MyRepositoriesFragment extends Fragment {
private RepositoriesViewModel repositoriesViewModel;
private FragmentRepositoriesBinding fragmentRepositoriesBinding; private FragmentRepositoriesBinding fragmentRepositoriesBinding;
private ReposListAdapter adapter; private ReposListAdapter adapter;
private int page = 1; private int page = 1;
private final int resultLimit = Constants.resultLimitNewGiteaInstances; private int resultLimit;
@Override @Override
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
fragmentRepositoriesBinding = FragmentRepositoriesBinding.inflate(inflater, container, false); fragmentRepositoriesBinding = FragmentRepositoriesBinding.inflate(inflater, container, false);
setHasOptionsMenu(true); setHasOptionsMenu(true);
((MainActivity) requireActivity()).setActionBarTitle(getResources().getString(R.string.navMyRepos)); ((MainActivity) requireActivity()).setActionBarTitle(getResources().getString(R.string.navMyRepos));
repositoriesViewModel = new ViewModelProvider(this).get(RepositoriesViewModel.class);
final String userLogin = ((BaseActivity) requireActivity()).getAccount().getAccount().getUserName(); final String userLogin = ((BaseActivity) requireActivity()).getAccount().getAccount().getUserName();
resultLimit = Constants.getCurrentResultLimit(getContext());
fragmentRepositoriesBinding.addNewRepo.setOnClickListener(view -> { fragmentRepositoriesBinding.addNewRepo.setOnClickListener(view -> {
Intent intent = new Intent(view.getContext(), CreateRepoActivity.class); Intent intent = new Intent(view.getContext(), CreateRepoActivity.class);
startActivity(intent); startActivity(intent);
@ -71,9 +75,7 @@ public class MyRepositoriesFragment extends Fragment {
private void fetchDataAsync(String userLogin) { private void fetchDataAsync(String userLogin) {
RepositoriesViewModel reposModel = new ViewModelProvider(this).get(RepositoriesViewModel.class); repositoriesViewModel.getRepositories(page, resultLimit, userLogin, "myRepos", null, getContext()).observe(getViewLifecycleOwner(), reposListMain -> {
reposModel.getRepositories(page, resultLimit, userLogin, "myRepos", null, getContext()).observe(getViewLifecycleOwner(), reposListMain -> {
adapter = new ReposListAdapter(reposListMain, getContext()); adapter = new ReposListAdapter(reposListMain, getContext());
adapter.setLoadMoreListener(new ReposListAdapter.OnLoadMoreListener() { adapter.setLoadMoreListener(new ReposListAdapter.OnLoadMoreListener() {
@ -82,7 +84,7 @@ public class MyRepositoriesFragment extends Fragment {
public void onLoadMore() { public void onLoadMore() {
page += 1; page += 1;
RepositoriesViewModel.loadMoreRepos(page, resultLimit, userLogin, "myRepos", null, getContext(), adapter); repositoriesViewModel.loadMoreRepos(page, resultLimit, userLogin, "myRepos", null, getContext(), adapter);
fragmentRepositoriesBinding.progressBar.setVisibility(View.VISIBLE); fragmentRepositoriesBinding.progressBar.setVisibility(View.VISIBLE);
} }

View File

@ -21,11 +21,12 @@ import org.mian.gitnex.databinding.FragmentLabelsBinding;
import org.mian.gitnex.viewmodels.OrganizationLabelsViewModel; import org.mian.gitnex.viewmodels.OrganizationLabelsViewModel;
/** /**
* Author M M Arif * @author M M Arif
*/ */
public class OrganizationLabelsFragment extends Fragment { public class OrganizationLabelsFragment extends Fragment {
private OrganizationLabelsViewModel organizationLabelsViewModel;
private ProgressBar mProgressBar; private ProgressBar mProgressBar;
private RecyclerView mRecyclerView; private RecyclerView mRecyclerView;
private LabelsAdapter adapter; private LabelsAdapter adapter;
@ -60,6 +61,7 @@ public class OrganizationLabelsFragment extends Fragment {
FragmentLabelsBinding fragmentLabelsBinding = FragmentLabelsBinding.inflate(inflater, container, false); FragmentLabelsBinding fragmentLabelsBinding = FragmentLabelsBinding.inflate(inflater, container, false);
setHasOptionsMenu(true); setHasOptionsMenu(true);
organizationLabelsViewModel = new ViewModelProvider(this).get(OrganizationLabelsViewModel.class);
final SwipeRefreshLayout swipeRefresh = fragmentLabelsBinding.pullToRefresh; final SwipeRefreshLayout swipeRefresh = fragmentLabelsBinding.pullToRefresh;
noData = fragmentLabelsBinding.noData; noData = fragmentLabelsBinding.noData;
@ -77,7 +79,7 @@ public class OrganizationLabelsFragment extends Fragment {
swipeRefresh.setOnRefreshListener(() -> new Handler(Looper.getMainLooper()).postDelayed(() -> { swipeRefresh.setOnRefreshListener(() -> new Handler(Looper.getMainLooper()).postDelayed(() -> {
swipeRefresh.setRefreshing(false); swipeRefresh.setRefreshing(false);
OrganizationLabelsViewModel.loadOrgLabelsList(repoOwner, getContext(), mProgressBar, noData); organizationLabelsViewModel.loadOrgLabelsList(repoOwner, getContext(), mProgressBar, noData);
}, 200)); }, 200));
@ -94,15 +96,13 @@ public class OrganizationLabelsFragment extends Fragment {
if(CreateLabelActivity.refreshLabels) { if(CreateLabelActivity.refreshLabels) {
OrganizationLabelsViewModel.loadOrgLabelsList(repoOwner, getContext(), mProgressBar, noData); organizationLabelsViewModel.loadOrgLabelsList(repoOwner, getContext(), mProgressBar, noData);
CreateLabelActivity.refreshLabels = false; CreateLabelActivity.refreshLabels = false;
} }
} }
private void fetchDataAsync(String owner) { private void fetchDataAsync(String owner) {
OrganizationLabelsViewModel organizationLabelsViewModel = new ViewModelProvider(this).get(OrganizationLabelsViewModel.class);
organizationLabelsViewModel.getOrgLabelsList(owner, getContext(), mProgressBar, noData).observe(getViewLifecycleOwner(), labelsListMain -> { organizationLabelsViewModel.getOrgLabelsList(owner, getContext(), mProgressBar, noData).observe(getViewLifecycleOwner(), labelsListMain -> {
adapter = new LabelsAdapter(getContext(), labelsListMain, type, owner); adapter = new LabelsAdapter(getContext(), labelsListMain, type, owner);

View File

@ -1,6 +1,5 @@
package org.mian.gitnex.fragments; package org.mian.gitnex.fragments;
import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
import android.os.Handler; import android.os.Handler;
import android.os.Looper; import android.os.Looper;
@ -19,7 +18,6 @@ import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import org.gitnex.tea4j.v2.models.Team; import org.gitnex.tea4j.v2.models.Team;
import org.mian.gitnex.R; import org.mian.gitnex.R;
import org.mian.gitnex.activities.CreateRepoActivity;
import org.mian.gitnex.activities.MainActivity; import org.mian.gitnex.activities.MainActivity;
import org.mian.gitnex.adapters.ReposListAdapter; import org.mian.gitnex.adapters.ReposListAdapter;
import org.mian.gitnex.databinding.FragmentRepositoriesBinding; import org.mian.gitnex.databinding.FragmentRepositoriesBinding;
@ -33,12 +31,13 @@ import org.mian.gitnex.viewmodels.RepositoriesViewModel;
public class OrganizationTeamInfoReposFragment extends Fragment { public class OrganizationTeamInfoReposFragment extends Fragment {
private RepositoriesViewModel repositoriesViewModel;
public static boolean repoAdded = false; public static boolean repoAdded = false;
private FragmentRepositoriesBinding fragmentRepositoriesBinding; private FragmentRepositoriesBinding fragmentRepositoriesBinding;
private ReposListAdapter adapter; private ReposListAdapter adapter;
private int page = 1; private int page = 1;
private final int resultLimit = Constants.resultLimitNewGiteaInstances; private int resultLimit;
private Team team; private Team team;
@ -57,9 +56,12 @@ public class OrganizationTeamInfoReposFragment extends Fragment {
fragmentRepositoriesBinding = FragmentRepositoriesBinding.inflate(inflater, container, false); fragmentRepositoriesBinding = FragmentRepositoriesBinding.inflate(inflater, container, false);
resultLimit = Constants.getCurrentResultLimit(getContext());
setHasOptionsMenu(true); setHasOptionsMenu(true);
team = (Team) requireArguments().getSerializable("team"); team = (Team) requireArguments().getSerializable("team");
repositoriesViewModel = new ViewModelProvider(this).get(RepositoriesViewModel.class);
fragmentRepositoriesBinding.addNewRepo.setVisibility(View.GONE); fragmentRepositoriesBinding.addNewRepo.setVisibility(View.GONE);
fragmentRepositoriesBinding.recyclerView.setHasFixedSize(true); fragmentRepositoriesBinding.recyclerView.setHasFixedSize(true);
@ -83,9 +85,7 @@ public class OrganizationTeamInfoReposFragment extends Fragment {
private void fetchDataAsync() { private void fetchDataAsync() {
RepositoriesViewModel reposModel = new ViewModelProvider(this).get(RepositoriesViewModel.class); repositoriesViewModel.getRepositories(page, resultLimit, String.valueOf(team.getId()), "team", null, getContext()).observe(getViewLifecycleOwner(), reposListMain -> {
reposModel.getRepositories(page, resultLimit, String.valueOf(team.getId()), "team", null, getContext()).observe(getViewLifecycleOwner(), reposListMain -> {
adapter = new ReposListAdapter(reposListMain, getContext()); adapter = new ReposListAdapter(reposListMain, getContext());
adapter.setLoadMoreListener(new ReposListAdapter.OnLoadMoreListener() { adapter.setLoadMoreListener(new ReposListAdapter.OnLoadMoreListener() {
@ -94,7 +94,7 @@ public class OrganizationTeamInfoReposFragment extends Fragment {
public void onLoadMore() { public void onLoadMore() {
page += 1; page += 1;
RepositoriesViewModel.loadMoreRepos(page, resultLimit, String.valueOf(team.getId()), "team", null, getContext(), adapter); repositoriesViewModel.loadMoreRepos(page, resultLimit, String.valueOf(team.getId()), "team", null, getContext(), adapter);
fragmentRepositoriesBinding.progressBar.setVisibility(View.VISIBLE); fragmentRepositoriesBinding.progressBar.setVisibility(View.VISIBLE);
} }

View File

@ -32,11 +32,12 @@ import org.mian.gitnex.viewmodels.OrganizationsViewModel;
public class OrganizationsFragment extends Fragment { public class OrganizationsFragment extends Fragment {
private OrganizationsViewModel organizationsViewModel;
public static boolean orgCreated = false; public static boolean orgCreated = false;
private FragmentOrganizationsBinding fragmentOrganizationsBinding; private FragmentOrganizationsBinding fragmentOrganizationsBinding;
private OrganizationsListAdapter adapter; private OrganizationsListAdapter adapter;
private int page = 1; private int page = 1;
private final int resultLimit = Constants.resultLimitNewGiteaInstances; private int resultLimit;
@Override @Override
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
@ -45,6 +46,9 @@ public class OrganizationsFragment extends Fragment {
setHasOptionsMenu(true); setHasOptionsMenu(true);
((MainActivity) requireActivity()).setActionBarTitle(getResources().getString(R.string.navOrg)); ((MainActivity) requireActivity()).setActionBarTitle(getResources().getString(R.string.navOrg));
organizationsViewModel = new ViewModelProvider(this).get(OrganizationsViewModel.class);
resultLimit = Constants.getCurrentResultLimit(getContext());
fragmentOrganizationsBinding.addNewOrganization.setOnClickListener(view -> { fragmentOrganizationsBinding.addNewOrganization.setOnClickListener(view -> {
Intent intent = new Intent(view.getContext(), CreateOrganizationActivity.class); Intent intent = new Intent(view.getContext(), CreateOrganizationActivity.class);
@ -72,9 +76,7 @@ public class OrganizationsFragment extends Fragment {
private void fetchDataAsync() { private void fetchDataAsync() {
OrganizationsViewModel orgModel = new ViewModelProvider(this).get(OrganizationsViewModel.class); organizationsViewModel.getUserOrg(page, resultLimit, getContext()).observe(getViewLifecycleOwner(), orgListMain -> {
orgModel.getUserOrg(page, resultLimit, getContext()).observe(getViewLifecycleOwner(), orgListMain -> {
adapter = new OrganizationsListAdapter(orgListMain, getContext()); adapter = new OrganizationsListAdapter(orgListMain, getContext());
adapter.setLoadMoreListener(new OrganizationsListAdapter.OnLoadMoreListener() { adapter.setLoadMoreListener(new OrganizationsListAdapter.OnLoadMoreListener() {
@ -83,7 +85,7 @@ public class OrganizationsFragment extends Fragment {
public void onLoadMore() { public void onLoadMore() {
page += 1; page += 1;
OrganizationsViewModel.loadMoreOrgList(page, resultLimit, getContext(), adapter); organizationsViewModel.loadMoreOrgList(page, resultLimit, getContext(), adapter);
fragmentOrganizationsBinding.progressBar.setVisibility(View.VISIBLE); fragmentOrganizationsBinding.progressBar.setVisibility(View.VISIBLE);
} }
@ -113,7 +115,7 @@ public class OrganizationsFragment extends Fragment {
super.onResume(); super.onResume();
if(orgCreated) { if(orgCreated) {
OrganizationsViewModel.loadOrgList(page, resultLimit, getContext()); organizationsViewModel.loadOrgList(page, resultLimit, getContext());
orgCreated = false; orgCreated = false;
} }
} }

View File

@ -25,11 +25,12 @@ import org.mian.gitnex.viewmodels.ReleasesViewModel;
import java.util.List; import java.util.List;
/** /**
* Author M M Arif * @author M M Arif
*/ */
public class ReleasesFragment extends Fragment { public class ReleasesFragment extends Fragment {
private ReleasesViewModel releasesViewModel;
private ReleasesAdapter adapter; private ReleasesAdapter adapter;
private TagsAdapter tagsAdapter; private TagsAdapter tagsAdapter;
private RepositoryContext repository; private RepositoryContext repository;
@ -38,7 +39,7 @@ public class ReleasesFragment extends Fragment {
private int page = 1; private int page = 1;
private int pageReleases = 1; private int pageReleases = 1;
public ReleasesFragment() { public ReleasesFragment() {
} }
public static ReleasesFragment newInstance(RepositoryContext repository) { public static ReleasesFragment newInstance(RepositoryContext repository) {
@ -59,6 +60,7 @@ public class ReleasesFragment extends Fragment {
Bundle savedInstanceState) { Bundle savedInstanceState) {
fragmentReleasesBinding = FragmentReleasesBinding.inflate(inflater, container, false); fragmentReleasesBinding = FragmentReleasesBinding.inflate(inflater, container, false);
releasesViewModel = new ViewModelProvider(this).get(ReleasesViewModel.class);
fragmentReleasesBinding.recyclerView.setHasFixedSize(true); fragmentReleasesBinding.recyclerView.setHasFixedSize(true);
fragmentReleasesBinding.recyclerView.setLayoutManager(new LinearLayoutManager(getContext())); fragmentReleasesBinding.recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
@ -70,9 +72,9 @@ public class ReleasesFragment extends Fragment {
fragmentReleasesBinding.pullToRefresh.setRefreshing(false); fragmentReleasesBinding.pullToRefresh.setRefreshing(false);
if(repository.isReleasesViewTypeIsTag()) { if(repository.isReleasesViewTypeIsTag()) {
ReleasesViewModel.loadTagsList(repository.getOwner(), repository.getName(), getContext()); releasesViewModel.loadTagsList(repository.getOwner(), repository.getName(), getContext());
} else { } else {
ReleasesViewModel.loadReleasesList(repository.getOwner(), repository.getName(), getContext()); releasesViewModel.loadReleasesList(repository.getOwner(), repository.getName(), getContext());
} }
fragmentReleasesBinding.progressBar.setVisibility(View.VISIBLE); fragmentReleasesBinding.progressBar.setVisibility(View.VISIBLE);
@ -86,9 +88,9 @@ public class ReleasesFragment extends Fragment {
page = 1; page = 1;
pageReleases = 1; pageReleases = 1;
if(repository.isReleasesViewTypeIsTag()) { if(repository.isReleasesViewTypeIsTag()) {
ReleasesViewModel.loadTagsList(repository.getOwner(), repository.getName(), getContext()); releasesViewModel.loadTagsList(repository.getOwner(), repository.getName(), getContext());
} else { } else {
ReleasesViewModel.loadReleasesList(repository.getOwner(), repository.getName(), getContext()); releasesViewModel.loadReleasesList(repository.getOwner(), repository.getName(), getContext());
} }
fragmentReleasesBinding.progressBar.setVisibility(View.VISIBLE); fragmentReleasesBinding.progressBar.setVisibility(View.VISIBLE);
}); });
@ -108,7 +110,7 @@ public class ReleasesFragment extends Fragment {
@Override @Override
public void onLoadMore() { public void onLoadMore() {
pageReleases += 1; pageReleases += 1;
ReleasesViewModel.loadMoreReleases(owner, repo, pageReleases, getContext(), adapter); releasesViewModel.loadMoreReleases(owner, repo, pageReleases, getContext(), adapter);
fragmentReleasesBinding.progressBar.setVisibility(View.VISIBLE); fragmentReleasesBinding.progressBar.setVisibility(View.VISIBLE);
} }
@ -145,7 +147,7 @@ public class ReleasesFragment extends Fragment {
@Override @Override
public void onLoadMore() { public void onLoadMore() {
page += 1; page += 1;
ReleasesViewModel.loadMoreTags(owner, repo , page, getContext(), tagsAdapter); releasesViewModel.loadMoreTags(owner, repo , page, getContext(), tagsAdapter);
fragmentReleasesBinding.progressBar.setVisibility(View.VISIBLE); fragmentReleasesBinding.progressBar.setVisibility(View.VISIBLE);
} }

View File

@ -28,10 +28,11 @@ import org.mian.gitnex.viewmodels.RepositoriesViewModel;
public class RepositoriesByOrgFragment extends Fragment { public class RepositoriesByOrgFragment extends Fragment {
private RepositoriesViewModel repositoriesViewModel;
private FragmentRepositoriesBinding fragmentRepositoriesBinding; private FragmentRepositoriesBinding fragmentRepositoriesBinding;
private ReposListAdapter adapter; private ReposListAdapter adapter;
private int page = 1; private int page = 1;
private final int resultLimit = Constants.resultLimitNewGiteaInstances; private int resultLimit;
private static final String getOrgName = null; private static final String getOrgName = null;
private String orgName; private String orgName;
@ -57,8 +58,10 @@ public class RepositoriesByOrgFragment extends Fragment {
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
fragmentRepositoriesBinding = FragmentRepositoriesBinding.inflate(inflater, container, false); fragmentRepositoriesBinding = FragmentRepositoriesBinding.inflate(inflater, container, false);
setHasOptionsMenu(true); setHasOptionsMenu(true);
repositoriesViewModel = new ViewModelProvider(this).get(RepositoriesViewModel.class);
resultLimit = Constants.getCurrentResultLimit(getContext());
fragmentRepositoriesBinding.addNewRepo.setVisibility(View.GONE); fragmentRepositoriesBinding.addNewRepo.setVisibility(View.GONE);
@ -84,9 +87,7 @@ public class RepositoriesByOrgFragment extends Fragment {
private void fetchDataAsync() { private void fetchDataAsync() {
RepositoriesViewModel reposModel = new ViewModelProvider(this).get(RepositoriesViewModel.class); repositoriesViewModel.getRepositories(page, resultLimit, "", "org", orgName, getContext()).observe(getViewLifecycleOwner(), reposListMain -> {
reposModel.getRepositories(page, resultLimit, "", "org", orgName, getContext()).observe(getViewLifecycleOwner(), reposListMain -> {
adapter = new ReposListAdapter(reposListMain, getContext()); adapter = new ReposListAdapter(reposListMain, getContext());
adapter.setLoadMoreListener(new ReposListAdapter.OnLoadMoreListener() { adapter.setLoadMoreListener(new ReposListAdapter.OnLoadMoreListener() {
@ -95,7 +96,7 @@ public class RepositoriesByOrgFragment extends Fragment {
public void onLoadMore() { public void onLoadMore() {
page += 1; page += 1;
RepositoriesViewModel.loadMoreRepos(page, resultLimit, "", "org", orgName, getContext(), adapter); repositoriesViewModel.loadMoreRepos(page, resultLimit, "", "org", orgName, getContext(), adapter);
fragmentRepositoriesBinding.progressBar.setVisibility(View.VISIBLE); fragmentRepositoriesBinding.progressBar.setVisibility(View.VISIBLE);
} }
@ -126,7 +127,7 @@ public class RepositoriesByOrgFragment extends Fragment {
super.onResume(); super.onResume();
if(MainActivity.repoCreated) { if(MainActivity.repoCreated) {
RepositoriesViewModel.loadReposList(page, resultLimit, null, "org", orgName, getContext()); repositoriesViewModel.loadReposList(page, resultLimit, null, "org", orgName, getContext());
MainActivity.repoCreated = false; MainActivity.repoCreated = false;
} }

View File

@ -32,18 +32,21 @@ import org.mian.gitnex.viewmodels.RepositoriesViewModel;
public class RepositoriesFragment extends Fragment { public class RepositoriesFragment extends Fragment {
private RepositoriesViewModel repositoriesViewModel;
private FragmentRepositoriesBinding fragmentRepositoriesBinding; private FragmentRepositoriesBinding fragmentRepositoriesBinding;
private ReposListAdapter adapter; private ReposListAdapter adapter;
private int page = 1; private int page = 1;
private final int resultLimit = Constants.resultLimitNewGiteaInstances; private int resultLimit;
@Override @Override
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
fragmentRepositoriesBinding = FragmentRepositoriesBinding.inflate(inflater, container, false); fragmentRepositoriesBinding = FragmentRepositoriesBinding.inflate(inflater, container, false);
setHasOptionsMenu(true); setHasOptionsMenu(true);
((MainActivity) requireActivity()).setActionBarTitle(getResources().getString(R.string.navRepos)); ((MainActivity) requireActivity()).setActionBarTitle(getResources().getString(R.string.navRepos));
repositoriesViewModel = new ViewModelProvider(this).get(RepositoriesViewModel.class);
resultLimit = Constants.getCurrentResultLimit(getContext());
fragmentRepositoriesBinding.addNewRepo.setOnClickListener(view -> { fragmentRepositoriesBinding.addNewRepo.setOnClickListener(view -> {
Intent intent = new Intent(view.getContext(), CreateRepoActivity.class); Intent intent = new Intent(view.getContext(), CreateRepoActivity.class);
@ -71,9 +74,7 @@ public class RepositoriesFragment extends Fragment {
private void fetchDataAsync() { private void fetchDataAsync() {
RepositoriesViewModel reposModel = new ViewModelProvider(this).get(RepositoriesViewModel.class); repositoriesViewModel.getRepositories(page, resultLimit, null, "repos", null, getContext()).observe(getViewLifecycleOwner(), reposListMain -> {
reposModel.getRepositories(page, resultLimit, null, "repos", null, getContext()).observe(getViewLifecycleOwner(), reposListMain -> {
adapter = new ReposListAdapter(reposListMain, getContext()); adapter = new ReposListAdapter(reposListMain, getContext());
adapter.setLoadMoreListener(new ReposListAdapter.OnLoadMoreListener() { adapter.setLoadMoreListener(new ReposListAdapter.OnLoadMoreListener() {
@ -82,7 +83,7 @@ public class RepositoriesFragment extends Fragment {
public void onLoadMore() { public void onLoadMore() {
page += 1; page += 1;
RepositoriesViewModel.loadMoreRepos(page, resultLimit, null, "repos", null, getContext(), adapter); repositoriesViewModel.loadMoreRepos(page, resultLimit, null, "repos", null, getContext(), adapter);
fragmentRepositoriesBinding.progressBar.setVisibility(View.VISIBLE); fragmentRepositoriesBinding.progressBar.setVisibility(View.VISIBLE);
} }

View File

@ -30,18 +30,21 @@ import org.mian.gitnex.viewmodels.RepositoriesViewModel;
public class StarredRepositoriesFragment extends Fragment { public class StarredRepositoriesFragment extends Fragment {
private RepositoriesViewModel repositoriesViewModel;
private FragmentRepositoriesBinding fragmentRepositoriesBinding; private FragmentRepositoriesBinding fragmentRepositoriesBinding;
private ReposListAdapter adapter; private ReposListAdapter adapter;
private int page = 1; private int page = 1;
private final int resultLimit = Constants.resultLimitNewGiteaInstances; private int resultLimit;
@Override @Override
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
fragmentRepositoriesBinding = FragmentRepositoriesBinding.inflate(inflater, container, false); fragmentRepositoriesBinding = FragmentRepositoriesBinding.inflate(inflater, container, false);
setHasOptionsMenu(true); setHasOptionsMenu(true);
((MainActivity) requireActivity()).setActionBarTitle(getResources().getString(R.string.navStarredRepos)); ((MainActivity) requireActivity()).setActionBarTitle(getResources().getString(R.string.navStarredRepos));
repositoriesViewModel = new ViewModelProvider(this).get(RepositoriesViewModel.class);
resultLimit = Constants.getCurrentResultLimit(getContext());
fragmentRepositoriesBinding.addNewRepo.setOnClickListener(view -> { fragmentRepositoriesBinding.addNewRepo.setOnClickListener(view -> {
Intent intent = new Intent(view.getContext(), CreateRepoActivity.class); Intent intent = new Intent(view.getContext(), CreateRepoActivity.class);
@ -69,9 +72,7 @@ public class StarredRepositoriesFragment extends Fragment {
private void fetchDataAsync() { private void fetchDataAsync() {
RepositoriesViewModel reposModel = new ViewModelProvider(this).get(RepositoriesViewModel.class); repositoriesViewModel.getRepositories(page, resultLimit, "", "starredRepos", null, getContext()).observe(getViewLifecycleOwner(), reposListMain -> {
reposModel.getRepositories(page, resultLimit, "", "starredRepos", null, getContext()).observe(getViewLifecycleOwner(), reposListMain -> {
adapter = new ReposListAdapter(reposListMain, getContext()); adapter = new ReposListAdapter(reposListMain, getContext());
adapter.setLoadMoreListener(new ReposListAdapter.OnLoadMoreListener() { adapter.setLoadMoreListener(new ReposListAdapter.OnLoadMoreListener() {
@ -80,7 +81,7 @@ public class StarredRepositoriesFragment extends Fragment {
public void onLoadMore() { public void onLoadMore() {
page += 1; page += 1;
RepositoriesViewModel.loadMoreRepos(page, resultLimit, "", "starredRepos", null, getContext(), adapter); repositoriesViewModel.loadMoreRepos(page, resultLimit, "", "starredRepos", null, getContext(), adapter);
fragmentRepositoriesBinding.progressBar.setVisibility(View.VISIBLE); fragmentRepositoriesBinding.progressBar.setVisibility(View.VISIBLE);
} }

View File

@ -31,6 +31,7 @@ import org.mian.gitnex.viewmodels.TeamsByOrgViewModel;
public class TeamsByOrgFragment extends Fragment { public class TeamsByOrgFragment extends Fragment {
private TeamsByOrgViewModel teamsByOrgViewModel;
public static boolean resumeTeams = false; public static boolean resumeTeams = false;
private ProgressBar mProgressBar; private ProgressBar mProgressBar;
@ -68,6 +69,7 @@ public class TeamsByOrgFragment extends Fragment {
FragmentTeamsByOrgBinding fragmentTeamsByOrgBinding = FragmentTeamsByOrgBinding.inflate(inflater, container, false); FragmentTeamsByOrgBinding fragmentTeamsByOrgBinding = FragmentTeamsByOrgBinding.inflate(inflater, container, false);
setHasOptionsMenu(true); setHasOptionsMenu(true);
teamsByOrgViewModel = new ViewModelProvider(this).get(TeamsByOrgViewModel.class);
noDataTeams = fragmentTeamsByOrgBinding.noDataTeams; noDataTeams = fragmentTeamsByOrgBinding.noDataTeams;
@ -86,7 +88,7 @@ public class TeamsByOrgFragment extends Fragment {
swipeRefresh.setOnRefreshListener(() -> new Handler(Looper.getMainLooper()).postDelayed(() -> { swipeRefresh.setOnRefreshListener(() -> new Handler(Looper.getMainLooper()).postDelayed(() -> {
swipeRefresh.setRefreshing(false); swipeRefresh.setRefreshing(false);
TeamsByOrgViewModel.loadTeamsByOrgList(orgName, getContext(), noDataTeams, mProgressBar); teamsByOrgViewModel.loadTeamsByOrgList(orgName, getContext(), noDataTeams, mProgressBar);
}, 200)); }, 200));
@ -99,16 +101,14 @@ public class TeamsByOrgFragment extends Fragment {
public void onResume() { public void onResume() {
super.onResume(); super.onResume();
if(resumeTeams) { if(resumeTeams) {
TeamsByOrgViewModel.loadTeamsByOrgList(orgName, getContext(), noDataTeams, mProgressBar); teamsByOrgViewModel.loadTeamsByOrgList(orgName, getContext(), noDataTeams, mProgressBar);
resumeTeams = false; resumeTeams = false;
} }
} }
private void fetchDataAsync(String owner) { private void fetchDataAsync(String owner) {
TeamsByOrgViewModel teamModel = new ViewModelProvider(this).get(TeamsByOrgViewModel.class); teamsByOrgViewModel.getTeamsByOrg(owner, getContext(), noDataTeams, mProgressBar).observe(getViewLifecycleOwner(), orgTeamsListMain -> {
teamModel.getTeamsByOrg(owner, getContext(), noDataTeams, mProgressBar).observe(getViewLifecycleOwner(), orgTeamsListMain -> {
adapter = new TeamsByOrgAdapter(getContext(), orgTeamsListMain, permissions, orgName); adapter = new TeamsByOrgAdapter(getContext(), orgTeamsListMain, permissions, orgName);
if(adapter.getItemCount() > 0) { if(adapter.getItemCount() > 0) {
mRecyclerView.setAdapter(adapter); mRecyclerView.setAdapter(adapter);

View File

@ -6,21 +6,16 @@ import android.content.Intent;
import android.graphics.Color; import android.graphics.Color;
import android.graphics.drawable.ColorDrawable; import android.graphics.drawable.ColorDrawable;
import android.widget.Button; import android.widget.Button;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AlertDialog; import androidx.appcompat.app.AlertDialog;
import org.mian.gitnex.R; import org.mian.gitnex.R;
import org.mian.gitnex.actions.CollaboratorActions; import org.mian.gitnex.actions.CollaboratorActions;
import org.mian.gitnex.actions.PullRequestActions; import org.mian.gitnex.actions.PullRequestActions;
import org.mian.gitnex.actions.TeamActions; import org.mian.gitnex.actions.TeamActions;
import org.mian.gitnex.activities.CreateLabelActivity; import org.mian.gitnex.activities.CreateLabelActivity;
import org.mian.gitnex.clients.RetrofitClient;
import org.mian.gitnex.helpers.contexts.RepositoryContext; import org.mian.gitnex.helpers.contexts.RepositoryContext;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
/** /**
* Author M M Arif * @author M M Arif
*/ */
public class AlertDialogs { public class AlertDialogs {
@ -80,34 +75,6 @@ public class AlertDialogs {
} }
public static void tagDeleteDialog(final Context context, final String tagName, final String owner, final String repo) {
new AlertDialog.Builder(context)
.setTitle(String.format(context.getString(R.string.deleteTagTitle), tagName))
.setMessage(R.string.deleteTagConfirmation)
.setIcon(R.drawable.ic_delete)
.setPositiveButton(R.string.menuDeleteText, (dialog, whichButton) -> RetrofitClient.getApiInterface(context).repoDeleteTag(owner, repo, tagName).enqueue(new Callback<Void>() {
@Override
public void onResponse(@NonNull Call<Void> call, @NonNull Response<Void> response) {
if(response.isSuccessful()) {
Toasty.success(context, context.getString(R.string.tagDeleted));
}
else if(response.code() == 403) {
Toasty.error(context, context.getString(R.string.authorizeError));
}
else {
Toasty.error(context, context.getString(R.string.genericError));
}
}
@Override
public void onFailure(@NonNull Call<Void> call, @NonNull Throwable t) {
Toasty.error(context, context.getString(R.string.genericError));
}
}))
.setNeutralButton(R.string.cancelButton, null).show();
}
public static void collaboratorRemoveDialog(final Context context, final String userNameMain, RepositoryContext repository) { public static void collaboratorRemoveDialog(final Context context, final String userNameMain, RepositoryContext repository) {
new AlertDialog.Builder(context) new AlertDialog.Builder(context)

View File

@ -43,7 +43,7 @@ import java.util.regex.Matcher;
import java.util.regex.Pattern; import java.util.regex.Pattern;
/** /**
* Author M M Arif * @author M M Arif
*/ */
public class AppUtil { public class AppUtil {
@ -363,7 +363,6 @@ public class AppUtil {
clipboard.setPrimaryClip(clip); clipboard.setPrimaryClip(clip);
Toasty.info(ctx, message); Toasty.info(ctx, message);
} }
public static boolean switchToAccount(Context context, UserAccount userAccount) { public static boolean switchToAccount(Context context, UserAccount userAccount) {
@ -374,6 +373,15 @@ public class AppUtil {
return ((MainApplication) context.getApplicationContext()).switchToAccount(userAccount, tmp); return ((MainApplication) context.getApplicationContext()).switchToAccount(userAccount, tmp);
} }
public static void sharingIntent(Context ctx, String url) {
Intent sharingIntent = new Intent(android.content.Intent.ACTION_SEND);
sharingIntent.setType("text/plain");
sharingIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, url);
sharingIntent.putExtra(android.content.Intent.EXTRA_TEXT, url);
ctx.startActivity(Intent.createChooser(sharingIntent, url));
}
public static void openUrlInBrowser(Context context, String url) { public static void openUrlInBrowser(Context context, String url) {
TinyDB tinyDB = TinyDB.getInstance(context); TinyDB tinyDB = TinyDB.getInstance(context);

View File

@ -4,22 +4,16 @@ import android.content.Context;
import org.mian.gitnex.activities.BaseActivity; import org.mian.gitnex.activities.BaseActivity;
/** /**
* Author M M Arif * @author M M Arif
*/ */
public class Constants { public class Constants {
// generic values
public static final int resultLimitNewGiteaInstances = 25; // Gitea 1.12 and above
public static final int resultLimitOldGiteaInstances = 10; // Gitea 1.11 and below
public static final String defaultOldestTimestamp = "1970-01-01T00:00:00+00:00";
public static int getCurrentResultLimit(Context context) { public static int getCurrentResultLimit(Context context) {
return ((BaseActivity) context).getAccount().requiresVersion("1.12") ? resultLimitNewGiteaInstances : resultLimitOldGiteaInstances; return ((BaseActivity) context).getAccount().requiresVersion("1.15") ? ((BaseActivity) context).getAccount().getDefaultPageLimit() : ((BaseActivity) context).getAccount().getMaxPageLimit();
} }
// tags // tags
public static final String tagMilestonesFragment = "MilestonesFragment";
public static final String tagPullRequestsList = "PullRequestFragment"; public static final String tagPullRequestsList = "PullRequestFragment";
public static final String tagIssuesList = "IssuesListFragment"; public static final String tagIssuesList = "IssuesListFragment";
public static final String tagMilestonesAdapter = "MilestonesAdapter"; public static final String tagMilestonesAdapter = "MilestonesAdapter";
@ -30,8 +24,6 @@ public class Constants {
public static final String publicOrganizations = "PublicOrganizations"; public static final String publicOrganizations = "PublicOrganizations";
public static final String exploreUsers = "ExploreUsers"; public static final String exploreUsers = "ExploreUsers";
public static final String exploreIssues = "ExploreIssues"; public static final String exploreIssues = "ExploreIssues";
public static final String exploreRepositories = "ExploreRepositories";
public static final String tagNotifications = "TagNotifications";
public static final String tagFollowers = "TagFollowers"; public static final String tagFollowers = "TagFollowers";
public static final String tagFollowing = "TagFollowing"; public static final String tagFollowing = "TagFollowing";
@ -42,9 +34,6 @@ public class Constants {
// pull request // pull request
public static final int prPageInit = 1; public static final int prPageInit = 1;
// milestone
public static final int milestonesPageInit = 1;
// drafts // drafts
public static final String draftTypeComment = "comment"; public static final String draftTypeComment = "comment";
public static final String draftTypeIssue = "Issue"; public static final String draftTypeIssue = "Issue";
@ -69,5 +58,4 @@ public class Constants {
// work managers // work managers
public static final String notificationsWorkerId = "notifications_worker"; public static final String notificationsWorkerId = "notifications_worker";
} }

View File

@ -48,6 +48,14 @@ public class AccountContext implements Serializable {
return getServerVersion().higherOrEqual(version); return getServerVersion().higherOrEqual(version);
} }
public int getDefaultPageLimit() {
return getAccount().getDefaultPagingNumber();
}
public int getMaxPageLimit() {
return getAccount().getMaxResponseItems();
}
public User getUserInfo() { public User getUserInfo() {
return userInfo; return userInfo;

View File

@ -21,7 +21,7 @@ import retrofit2.Response;
public class AdminCronTasksViewModel extends ViewModel { public class AdminCronTasksViewModel extends ViewModel {
private static MutableLiveData<List<Cron>> tasksList; private MutableLiveData<List<Cron>> tasksList;
public LiveData<List<Cron>> getCronTasksList(Context ctx, int page, int limit) { public LiveData<List<Cron>> getCronTasksList(Context ctx, int page, int limit) {
@ -31,7 +31,7 @@ public class AdminCronTasksViewModel extends ViewModel {
return tasksList; return tasksList;
} }
public static void loadCronTasksList(final Context ctx, int page, int limit) { public void loadCronTasksList(final Context ctx, int page, int limit) {
Call<List<Cron>> call = RetrofitClient Call<List<Cron>> call = RetrofitClient
.getApiInterface(ctx) .getApiInterface(ctx)

View File

@ -21,7 +21,7 @@ import retrofit2.Response;
public class AdminGetUsersViewModel extends ViewModel { public class AdminGetUsersViewModel extends ViewModel {
private static MutableLiveData<List<User>> usersList; private MutableLiveData<List<User>> usersList;
public LiveData<List<User>> getUsersList(int page, int resultLimit, Context ctx) { public LiveData<List<User>> getUsersList(int page, int resultLimit, Context ctx) {
@ -31,7 +31,7 @@ public class AdminGetUsersViewModel extends ViewModel {
return usersList; return usersList;
} }
public static void loadUsersList(int page, int resultLimit, Context ctx) { public void loadUsersList(int page, int resultLimit, Context ctx) {
Call<List<User>> call = RetrofitClient Call<List<User>> call = RetrofitClient
.getApiInterface(ctx) .getApiInterface(ctx)
@ -57,7 +57,7 @@ public class AdminGetUsersViewModel extends ViewModel {
}); });
} }
public static void loadMoreUsersList(int page, int resultLimit, Context ctx, AdminGetUsersAdapter adapter) { public void loadMoreUsersList(int page, int resultLimit, Context ctx, AdminGetUsersAdapter adapter) {
Call<List<User>> call = RetrofitClient Call<List<User>> call = RetrofitClient
.getApiInterface(ctx) .getApiInterface(ctx)

View File

@ -20,7 +20,7 @@ import retrofit2.Response;
public class CollaboratorsViewModel extends ViewModel { public class CollaboratorsViewModel extends ViewModel {
private static MutableLiveData<List<User>> collaboratorsList; private MutableLiveData<List<User>> collaboratorsList;
public LiveData<List<User>> getCollaboratorsList(String owner, String repo, Context ctx) { public LiveData<List<User>> getCollaboratorsList(String owner, String repo, Context ctx) {
@ -30,7 +30,7 @@ public class CollaboratorsViewModel extends ViewModel {
return collaboratorsList; return collaboratorsList;
} }
private static void loadCollaboratorsListList(String owner, String repo, Context ctx) { private void loadCollaboratorsListList(String owner, String repo, Context ctx) {
Call<List<User>> call = RetrofitClient Call<List<User>> call = RetrofitClient
.getApiInterface(ctx) .getApiInterface(ctx)

View File

@ -25,8 +25,8 @@ import retrofit2.Response;
public class FilesViewModel extends ViewModel { public class FilesViewModel extends ViewModel {
private static MutableLiveData<List<ContentsResponse>> filesList; private MutableLiveData<List<ContentsResponse>> filesList;
private static MutableLiveData<List<ContentsResponse>> filesList2; private MutableLiveData<List<ContentsResponse>> filesList2;
public LiveData<List<ContentsResponse>> getFilesList(String owner, String repo, String ref, Context ctx, ProgressBar progressBar, TextView noDataFiles) { public LiveData<List<ContentsResponse>> getFilesList(String owner, String repo, String ref, Context ctx, ProgressBar progressBar, TextView noDataFiles) {
@ -36,7 +36,7 @@ public class FilesViewModel extends ViewModel {
return filesList; return filesList;
} }
private static void loadFilesList(String owner, String repo, String ref, final Context ctx, ProgressBar progressBar, TextView noDataFiles) { private void loadFilesList(String owner, String repo, String ref, final Context ctx, ProgressBar progressBar, TextView noDataFiles) {
Call<List<ContentsResponse>> call = RetrofitClient Call<List<ContentsResponse>> call = RetrofitClient
.getApiInterface(ctx) .getApiInterface(ctx)
@ -73,7 +73,7 @@ public class FilesViewModel extends ViewModel {
return filesList2; return filesList2;
} }
private static void loadFilesList2(String owner, String repo, String filesDir, String ref, final Context ctx, ProgressBar progressBar, TextView noDataFiles) { private void loadFilesList2(String owner, String repo, String filesDir, String ref, final Context ctx, ProgressBar progressBar, TextView noDataFiles) {
Call<List<ContentsResponse>> call = RetrofitClient Call<List<ContentsResponse>> call = RetrofitClient
.getApiInterface(ctx) .getApiInterface(ctx)

View File

@ -7,7 +7,6 @@ import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.ViewModel; import androidx.lifecycle.ViewModel;
import org.gitnex.tea4j.v2.models.Issue; import org.gitnex.tea4j.v2.models.Issue;
import org.mian.gitnex.R; import org.mian.gitnex.R;
import org.mian.gitnex.activities.BaseActivity;
import org.mian.gitnex.adapters.ExploreIssuesAdapter; import org.mian.gitnex.adapters.ExploreIssuesAdapter;
import org.mian.gitnex.clients.RetrofitClient; import org.mian.gitnex.clients.RetrofitClient;
import org.mian.gitnex.helpers.Constants; import org.mian.gitnex.helpers.Constants;
@ -23,29 +22,22 @@ import retrofit2.Response;
public class IssuesViewModel extends ViewModel { public class IssuesViewModel extends ViewModel {
private static MutableLiveData<List<Issue>> issuesList; private MutableLiveData<List<Issue>> issuesList;
private static int resultLimit = Constants.resultLimitOldGiteaInstances; private int resultLimit;
public LiveData<List<Issue>> getIssuesList(String searchKeyword, String type, Boolean created, String state, Context ctx) { public LiveData<List<Issue>> getIssuesList(String searchKeyword, String type, Boolean created, String state, Boolean assignedToMe, Context ctx) {
issuesList = new MutableLiveData<>(); issuesList = new MutableLiveData<>();
resultLimit = Constants.getCurrentResultLimit(ctx);
// if gitea is 1.12 or higher use the new limit loadIssuesList(searchKeyword, type, created, state, assignedToMe, ctx);
if(((BaseActivity) ctx).getAccount().requiresVersion("1.12.0")) {
resultLimit = Constants.resultLimitNewGiteaInstances;
}
loadIssuesList(searchKeyword, type, created, state, ctx);
return issuesList; return issuesList;
} }
public static void loadIssuesList(String searchKeyword, String type, Boolean created, String state, Context ctx) { public void loadIssuesList(String searchKeyword, String type, Boolean created, String state, Boolean assignedToMe, Context ctx) {
Call<List<Issue>> call = RetrofitClient Call<List<Issue>> call = RetrofitClient.getApiInterface(ctx)
.getApiInterface(ctx) .issueSearchIssues(state, null, null, searchKeyword, null, type, null, null, assignedToMe, created, null, null, null, null, 1,
.issueSearchIssues(state, null, null, searchKeyword, null, type, null, null, resultLimit);
null, created, null, null, null, null, 1, resultLimit);
call.enqueue(new Callback<>() { call.enqueue(new Callback<>() {
@ -68,12 +60,10 @@ public class IssuesViewModel extends ViewModel {
}); });
} }
public static void loadMoreIssues(String searchKeyword, String type, Boolean created, String state, int page, Context ctx, ExploreIssuesAdapter adapter) { public void loadMoreIssues(String searchKeyword, String type, Boolean created, String state, int page, Boolean assignedToMe, Context ctx, ExploreIssuesAdapter adapter) {
Call<List<Issue>> call = RetrofitClient Call<List<Issue>> call = RetrofitClient.getApiInterface(ctx)
.getApiInterface(ctx) .issueSearchIssues(state, null, null, searchKeyword, null, type, null, null, assignedToMe, created, null, null, null, null, page, resultLimit);
.issueSearchIssues(state, null, null, searchKeyword, null, type, null, null,
null, created, null, null, null, null, page, resultLimit);
call.enqueue(new Callback<>() { call.enqueue(new Callback<>() {

View File

@ -20,7 +20,7 @@ import retrofit2.Response;
public class LabelsViewModel extends ViewModel { public class LabelsViewModel extends ViewModel {
private static MutableLiveData<List<Label>> labelsList; private MutableLiveData<List<Label>> labelsList;
public LiveData<List<Label>> getLabelsList(String owner, String repo, Context ctx) { public LiveData<List<Label>> getLabelsList(String owner, String repo, Context ctx) {
@ -30,7 +30,7 @@ public class LabelsViewModel extends ViewModel {
return labelsList; return labelsList;
} }
public static void loadLabelsList(String owner, String repo, Context ctx) { public void loadLabelsList(String owner, String repo, Context ctx) {
Call<List<Label>> call = RetrofitClient Call<List<Label>> call = RetrofitClient
.getApiInterface(ctx) .getApiInterface(ctx)

View File

@ -20,7 +20,7 @@ import retrofit2.Response;
public class MembersByOrgViewModel extends ViewModel { public class MembersByOrgViewModel extends ViewModel {
private static MutableLiveData<List<User>> membersList; private MutableLiveData<List<User>> membersList;
public LiveData<List<User>> getMembersList(String owner, Context ctx) { public LiveData<List<User>> getMembersList(String owner, Context ctx) {
@ -30,7 +30,7 @@ public class MembersByOrgViewModel extends ViewModel {
return membersList; return membersList;
} }
private static void loadMembersList(String owner, Context ctx) { private void loadMembersList(String owner, Context ctx) {
Call<List<User>> call = RetrofitClient Call<List<User>> call = RetrofitClient
.getApiInterface(ctx) .getApiInterface(ctx)

View File

@ -22,18 +22,18 @@ import retrofit2.Response;
public class MilestonesViewModel extends ViewModel { public class MilestonesViewModel extends ViewModel {
private static MutableLiveData<List<Milestone>> milestonesList; private MutableLiveData<List<Milestone>> milestonesList;
private static final int resultLimit = Constants.resultLimitNewGiteaInstances; private int resultLimit;
public LiveData<List<Milestone>> getMilestonesList(String repoOwner, String repoName, String milestoneState, Context ctx) { public LiveData<List<Milestone>> getMilestonesList(String repoOwner, String repoName, String milestoneState, Context ctx) {
milestonesList = new MutableLiveData<>(); milestonesList = new MutableLiveData<>();
loadMilestonesList(repoOwner, repoName, milestoneState, ctx); loadMilestonesList(repoOwner, repoName, milestoneState, ctx);
resultLimit = Constants.getCurrentResultLimit(ctx);
return milestonesList; return milestonesList;
} }
public static void loadMilestonesList(String repoOwner, String repoName, String milestoneState, Context ctx) { public void loadMilestonesList(String repoOwner, String repoName, String milestoneState, Context ctx) {
Call<List<Milestone>> call = RetrofitClient.getApiInterface(ctx).issueGetMilestonesList(repoOwner, repoName, milestoneState, null, 1, resultLimit); Call<List<Milestone>> call = RetrofitClient.getApiInterface(ctx).issueGetMilestonesList(repoOwner, repoName, milestoneState, null, 1, resultLimit);
@ -58,7 +58,7 @@ public class MilestonesViewModel extends ViewModel {
}); });
} }
public static void loadMoreMilestones(String repoOwner, String repoName, int page, String milestoneState, Context ctx, MilestonesAdapter adapter) { public void loadMoreMilestones(String repoOwner, String repoName, int page, String milestoneState, Context ctx, MilestonesAdapter adapter) {
Call<List<Milestone>> call = RetrofitClient.getApiInterface(ctx).issueGetMilestonesList(repoOwner, repoName, milestoneState, null, page, resultLimit); Call<List<Milestone>> call = RetrofitClient.getApiInterface(ctx).issueGetMilestonesList(repoOwner, repoName, milestoneState, null, page, resultLimit);

View File

@ -23,7 +23,7 @@ import retrofit2.Response;
public class OrganizationLabelsViewModel extends ViewModel { public class OrganizationLabelsViewModel extends ViewModel {
private static MutableLiveData<List<Label>> orgLabelsList; private MutableLiveData<List<Label>> orgLabelsList;
public LiveData<List<Label>> getOrgLabelsList(String owner, Context ctx, ProgressBar progressBar, TextView noData) { public LiveData<List<Label>> getOrgLabelsList(String owner, Context ctx, ProgressBar progressBar, TextView noData) {
@ -33,7 +33,7 @@ public class OrganizationLabelsViewModel extends ViewModel {
return orgLabelsList; return orgLabelsList;
} }
public static void loadOrgLabelsList(String owner, Context ctx, ProgressBar progressBar, TextView noData) { public void loadOrgLabelsList(String owner, Context ctx, ProgressBar progressBar, TextView noData) {
Call<List<Label>> call = RetrofitClient Call<List<Label>> call = RetrofitClient
.getApiInterface(ctx) .getApiInterface(ctx)

View File

@ -21,7 +21,7 @@ import retrofit2.Response;
public class OrganizationsViewModel extends ViewModel { public class OrganizationsViewModel extends ViewModel {
private static MutableLiveData<List<Organization>> orgList; private MutableLiveData<List<Organization>> orgList;
public LiveData<List<Organization>> getUserOrg(int page, int resultLimit, Context ctx) { public LiveData<List<Organization>> getUserOrg(int page, int resultLimit, Context ctx) {
@ -31,7 +31,7 @@ public class OrganizationsViewModel extends ViewModel {
return orgList; return orgList;
} }
public static void loadOrgList(int page, int resultLimit, Context ctx) { public void loadOrgList(int page, int resultLimit, Context ctx) {
Call<List<Organization>> call = RetrofitClient Call<List<Organization>> call = RetrofitClient
.getApiInterface(ctx) .getApiInterface(ctx)
@ -58,7 +58,7 @@ public class OrganizationsViewModel extends ViewModel {
}); });
} }
public static void loadMoreOrgList(int page, int resultLimit, Context ctx, OrganizationsListAdapter adapter) { public void loadMoreOrgList(int page, int resultLimit, Context ctx, OrganizationsListAdapter adapter) {
Call<List<Organization>> call = RetrofitClient Call<List<Organization>> call = RetrofitClient
.getApiInterface(ctx) .getApiInterface(ctx)

View File

@ -20,7 +20,7 @@ import retrofit2.Response;
public class ProfileEmailsViewModel extends ViewModel { public class ProfileEmailsViewModel extends ViewModel {
private static MutableLiveData<List<Email>> emailsList; private MutableLiveData<List<Email>> emailsList;
public LiveData<List<Email>> getEmailsList(Context ctx) { public LiveData<List<Email>> getEmailsList(Context ctx) {
@ -30,7 +30,7 @@ public class ProfileEmailsViewModel extends ViewModel {
return emailsList; return emailsList;
} }
public static void loadEmailsList(Context ctx) { public void loadEmailsList(Context ctx) {
Call<List<Email>> call = RetrofitClient Call<List<Email>> call = RetrofitClient
.getApiInterface(ctx) .getApiInterface(ctx)

View File

@ -8,7 +8,6 @@ import androidx.lifecycle.ViewModel;
import org.gitnex.tea4j.v2.models.Release; import org.gitnex.tea4j.v2.models.Release;
import org.gitnex.tea4j.v2.models.Tag; import org.gitnex.tea4j.v2.models.Tag;
import org.mian.gitnex.R; import org.mian.gitnex.R;
import org.mian.gitnex.activities.BaseActivity;
import org.mian.gitnex.adapters.ReleasesAdapter; import org.mian.gitnex.adapters.ReleasesAdapter;
import org.mian.gitnex.adapters.TagsAdapter; import org.mian.gitnex.adapters.TagsAdapter;
import org.mian.gitnex.clients.RetrofitClient; import org.mian.gitnex.clients.RetrofitClient;
@ -25,24 +24,18 @@ import retrofit2.Response;
public class ReleasesViewModel extends ViewModel { public class ReleasesViewModel extends ViewModel {
private static MutableLiveData<List<Release>> releasesList; private MutableLiveData<List<Release>> releasesList;
private static int resultLimit = Constants.resultLimitOldGiteaInstances; private int resultLimit;
public LiveData<List<Release>> getReleasesList(String owner, String repo, Context ctx) { public LiveData<List<Release>> getReleasesList(String owner, String repo, Context ctx) {
releasesList = new MutableLiveData<>(); releasesList = new MutableLiveData<>();
resultLimit = Constants.getCurrentResultLimit(ctx);
// if gitea is 1.12 or higher use the new limit
if(((BaseActivity) ctx).getAccount().requiresVersion("1.12.0")) {
resultLimit = Constants.resultLimitNewGiteaInstances;
}
loadReleasesList(owner, repo, ctx); loadReleasesList(owner, repo, ctx);
return releasesList; return releasesList;
} }
public static void loadReleasesList(String owner, String repo, Context ctx) { public void loadReleasesList(String owner, String repo, Context ctx) {
Call<List<Release>> call = RetrofitClient Call<List<Release>> call = RetrofitClient
.getApiInterface(ctx) .getApiInterface(ctx)
@ -69,7 +62,7 @@ public class ReleasesViewModel extends ViewModel {
}); });
} }
public static void loadMoreReleases(String owner, String repo, int page, Context ctx, ReleasesAdapter adapter) { public void loadMoreReleases(String owner, String repo, int page, Context ctx, ReleasesAdapter adapter) {
Call<List<Release>> call = RetrofitClient Call<List<Release>> call = RetrofitClient
.getApiInterface(ctx) .getApiInterface(ctx)
@ -106,23 +99,17 @@ public class ReleasesViewModel extends ViewModel {
}); });
} }
private static MutableLiveData<List<Tag>> tagsList; private MutableLiveData<List<Tag>> tagsList;
public LiveData<List<Tag>> getTagsList(String owner, String repo, Context ctx) { public LiveData<List<Tag>> getTagsList(String owner, String repo, Context ctx) {
tagsList = new MutableLiveData<>(); tagsList = new MutableLiveData<>();
resultLimit = Constants.getCurrentResultLimit(ctx);
// if gitea is 1.12 or higher use the new limit
if(((BaseActivity) ctx).getAccount().requiresVersion("1.12.0")) {
resultLimit = Constants.resultLimitNewGiteaInstances;
}
loadTagsList(owner, repo, ctx); loadTagsList(owner, repo, ctx);
return tagsList; return tagsList;
} }
public static void loadTagsList(String owner, String repo, Context ctx) { public void loadTagsList(String owner, String repo, Context ctx) {
Call<List<Tag>> call = RetrofitClient Call<List<Tag>> call = RetrofitClient
.getApiInterface(ctx) .getApiInterface(ctx)
@ -149,7 +136,7 @@ public class ReleasesViewModel extends ViewModel {
}); });
} }
public static void loadMoreTags(String owner, String repo, int page, Context ctx, TagsAdapter adapter) { public void loadMoreTags(String owner, String repo, int page, Context ctx, TagsAdapter adapter) {
Call<List<Tag>> call = RetrofitClient Call<List<Tag>> call = RetrofitClient
.getApiInterface(ctx) .getApiInterface(ctx)

View File

@ -20,7 +20,7 @@ import retrofit2.Response;
public class RepoStargazersViewModel extends ViewModel { public class RepoStargazersViewModel extends ViewModel {
private static MutableLiveData<List<User>> stargazersList; private MutableLiveData<List<User>> stargazersList;
public LiveData<List<User>> getRepoStargazers(String repoOwner, String repoName, Context ctx) { public LiveData<List<User>> getRepoStargazers(String repoOwner, String repoName, Context ctx) {
@ -30,7 +30,7 @@ public class RepoStargazersViewModel extends ViewModel {
return stargazersList; return stargazersList;
} }
private static void loadRepoStargazers(String repoOwner, String repoName, Context ctx) { private void loadRepoStargazers(String repoOwner, String repoName, Context ctx) {
Call<List<User>> call = RetrofitClient Call<List<User>> call = RetrofitClient
.getApiInterface(ctx) .getApiInterface(ctx)

View File

@ -20,7 +20,7 @@ import retrofit2.Response;
public class RepoWatchersViewModel extends ViewModel { public class RepoWatchersViewModel extends ViewModel {
private static MutableLiveData<List<User>> watchersList; private MutableLiveData<List<User>> watchersList;
public LiveData<List<User>> getRepoWatchers(String repoOwner, String repoName, Context ctx) { public LiveData<List<User>> getRepoWatchers(String repoOwner, String repoName, Context ctx) {
@ -30,7 +30,7 @@ public class RepoWatchersViewModel extends ViewModel {
return watchersList; return watchersList;
} }
private static void loadRepoWatchers(String repoOwner, String repoName, Context ctx) { private void loadRepoWatchers(String repoOwner, String repoName, Context ctx) {
Call<List<User>> call = RetrofitClient Call<List<User>> call = RetrofitClient
.getApiInterface(ctx) .getApiInterface(ctx)

View File

@ -21,7 +21,7 @@ import retrofit2.Response;
public class RepositoriesViewModel extends ViewModel { public class RepositoriesViewModel extends ViewModel {
private static MutableLiveData<List<Repository>> reposList; private MutableLiveData<List<Repository>> reposList;
public LiveData<List<Repository>> getRepositories(int page, int resultLimit, String userLogin, String type, String orgName, Context ctx) { public LiveData<List<Repository>> getRepositories(int page, int resultLimit, String userLogin, String type, String orgName, Context ctx) {
@ -31,7 +31,7 @@ public class RepositoriesViewModel extends ViewModel {
return reposList; return reposList;
} }
public static void loadReposList(int page, int resultLimit, String userLogin, String type, String orgName, Context ctx) { public void loadReposList(int page, int resultLimit, String userLogin, String type, String orgName, Context ctx) {
Call<List<Repository>> call; Call<List<Repository>> call;
@ -77,7 +77,7 @@ public class RepositoriesViewModel extends ViewModel {
}); });
} }
public static void loadMoreRepos(int page, int resultLimit, String userLogin, String type, String orgName, Context ctx, ReposListAdapter adapter) { public void loadMoreRepos(int page, int resultLimit, String userLogin, String type, String orgName, Context ctx, ReposListAdapter adapter) {
Call<List<Repository>> call; Call<List<Repository>> call;

View File

@ -23,7 +23,7 @@ import retrofit2.Response;
public class TeamsByOrgViewModel extends ViewModel { public class TeamsByOrgViewModel extends ViewModel {
private static MutableLiveData<List<Team>> teamsList; private MutableLiveData<List<Team>> teamsList;
public LiveData<List<Team>> getTeamsByOrg(String orgName, Context ctx, TextView noDataTeams, ProgressBar mProgressBar) { public LiveData<List<Team>> getTeamsByOrg(String orgName, Context ctx, TextView noDataTeams, ProgressBar mProgressBar) {
@ -33,7 +33,7 @@ public class TeamsByOrgViewModel extends ViewModel {
return teamsList; return teamsList;
} }
public static void loadTeamsByOrgList(String orgName, Context ctx, TextView noDataTeams, ProgressBar mProgressBar) { public void loadTeamsByOrgList(String orgName, Context ctx, TextView noDataTeams, ProgressBar mProgressBar) {
Call<List<Team>> call = RetrofitClient Call<List<Team>> call = RetrofitClient
.getApiInterface(ctx) .getApiInterface(ctx)

View File

@ -37,7 +37,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:text="@string/addNewMember" android:text="@string/addRemove"
android:textColor="?attr/primaryTextColor" android:textColor="?attr/primaryTextColor"
android:maxLines="1" android:maxLines="1"
android:textSize="20sp" /> android:textSize="20sp" />

View File

@ -2,6 +2,7 @@
<androidx.coordinatorlayout.widget.CoordinatorLayout <androidx.coordinatorlayout.widget.CoordinatorLayout
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical" android:orientation="vertical"
@ -111,36 +112,66 @@
android:textIsSelectable="true" android:textIsSelectable="true"
android:textSize="16sp" /> android:textSize="16sp" />
<RelativeLayout <LinearLayout
android:id="@+id/msdueFrame" android:id="@+id/msdueFrame"
android:layout_toEndOf="@+id/assigneeAvatar" android:layout_toEndOf="@+id/assigneeAvatar"
android:layout_below="@+id/issueTitle" android:layout_below="@+id/issueTitle"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="10dp" > android:layout_marginTop="10dp"
android:orientation="vertical">
<TextView <LinearLayout
android:id="@+id/issueDueDate" android:id="@+id/dueDateFrame"
android:gravity="start" android:layout_width="match_parent"
android:layout_alignParentStart="true"
android:layout_gravity="start"
android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textColor="?attr/primaryTextColor" android:gravity="end|center_vertical"
android:textSize="14sp" /> android:orientation="horizontal"
tools:ignore="UseCompoundDrawables">
<TextView <ImageView
android:layout_toEndOf="@+id/issueDueDate" android:layout_width="18dp"
android:id="@+id/issueMilestone" android:layout_height="wrap_content"
android:gravity="end" app:srcCompat="@drawable/ic_calendar"
android:layout_gravity="end" android:contentDescription="@string/generalImgContentText" />
android:layout_alignParentEnd="true"
android:layout_width="wrap_content" <TextView
android:id="@+id/issueDueDate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:singleLine="true"
android:textColor="?attr/primaryTextColor"
android:textSize="14sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/milestoneFrame"
android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textColor="?attr/primaryTextColor" android:gravity="end|center_vertical"
android:textSize="14sp" /> android:orientation="horizontal"
tools:ignore="UseCompoundDrawables">
</RelativeLayout> <ImageView
android:layout_width="18dp"
android:layout_height="wrap_content"
app:srcCompat="@drawable/ic_milestone"
android:contentDescription="@string/generalImgContentText" />
<TextView
android:id="@+id/issueMilestone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:singleLine="true"
android:textColor="?attr/primaryTextColor"
android:textSize="14sp" />
</LinearLayout>
</LinearLayout>
<HorizontalScrollView <HorizontalScrollView
android:layout_below="@+id/msdueFrame" android:layout_below="@+id/msdueFrame"

View File

@ -37,7 +37,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:text="@string/addRmRepo" android:text="@string/addButton"
android:textColor="?attr/primaryTextColor" android:textColor="?attr/primaryTextColor"
android:maxLines="1" android:maxLines="1"
android:textSize="20sp" /> android:textSize="20sp" />

View File

@ -18,20 +18,47 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical"> android:orientation="vertical">
<TextView <LinearLayout
android:id="@+id/createNewUser" android:id="@+id/adminUsersHeadFrame"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_vertical" android:padding="8dp"
android:background="?android:attr/selectableItemBackground" android:orientation="vertical">
android:focusable="true"
android:clickable="true" <TextView
android:drawablePadding="24dp" android:id="@+id/bottomSheetHeader"
android:padding="12dp" android:layout_width="match_parent"
android:text="@string/adminCreateNewUser" android:layout_height="wrap_content"
android:textColor="?attr/primaryTextColor" android:gravity="center"
android:textSize="16sp" android:text="@string/navAdministration"
app:drawableStartCompat="@drawable/ic_person_add" /> android:textColor="?attr/primaryTextColor"
android:textSize="16sp" />
</LinearLayout>
<com.google.android.flexbox.FlexboxLayout
android:id="@+id/giteaUsersAdminSection"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:flexWrap="wrap"
app:alignItems="stretch"
android:padding="8dp"
app:alignContent="stretch" >
<TextView
android:id="@+id/createNewUser"
android:layout_width="98dp"
android:layout_height="100dp"
android:padding="8dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:gravity="center"
app:layout_alignSelf="flex_start"
app:drawableTopCompat="@drawable/ic_person_add"
android:text="@string/adminCreateNewUser"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp" />
</com.google.android.flexbox.FlexboxLayout>
</LinearLayout> </LinearLayout>

View File

@ -18,20 +18,47 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical"> android:orientation="vertical">
<TextView <LinearLayout
android:id="@+id/deleteAllDrafts" android:id="@+id/draftsHeadFrame"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_vertical" android:padding="8dp"
android:background="?android:attr/selectableItemBackground" android:orientation="vertical">
android:focusable="true"
android:clickable="true" <TextView
android:drawablePadding="24dp" android:id="@+id/bottomSheetHeader"
android:padding="12dp" android:layout_width="match_parent"
android:text="@string/deleteAllDrafts" android:layout_height="wrap_content"
android:textColor="?attr/primaryTextColor" android:gravity="center"
android:textSize="16sp" android:text="@string/draftsHeader"
app:drawableStartCompat="@drawable/ic_delete" /> android:textColor="?attr/primaryTextColor"
android:textSize="16sp" />
</LinearLayout>
<com.google.android.flexbox.FlexboxLayout
android:id="@+id/draftsSection"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:flexWrap="wrap"
app:alignItems="stretch"
android:padding="8dp"
app:alignContent="stretch" >
<TextView
android:id="@+id/deleteAllDrafts"
android:layout_width="98dp"
android:layout_height="100dp"
android:padding="8dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:gravity="center"
app:layout_alignSelf="flex_start"
app:drawableTopCompat="@drawable/ic_delete"
android:text="@string/menuDeleteText"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp" />
</com.google.android.flexbox.FlexboxLayout>
</LinearLayout> </LinearLayout>

View File

@ -18,50 +18,73 @@
android:orientation="vertical" android:orientation="vertical"
android:layout_height="wrap_content"> android:layout_height="wrap_content">
<TextView <LinearLayout
android:id="@+id/editFile" android:id="@+id/filesHeadFrame"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_vertical" android:padding="8dp"
android:background="?android:attr/selectableItemBackground" android:orientation="vertical">
android:focusable="true"
android:clickable="true"
android:drawablePadding="24dp"
android:padding="12dp"
android:text="@string/editFile"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp"
app:drawableStartCompat="@drawable/ic_edit" />
<TextView <TextView
android:id="@+id/deleteFile" android:id="@+id/bottomSheetHeader"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_vertical" android:gravity="center"
android:background="?android:attr/selectableItemBackground" android:text="@string/file"
android:focusable="true" android:textColor="?attr/primaryTextColor"
android:clickable="true" android:textSize="16sp" />
android:drawablePadding="24dp"
android:padding="12dp"
android:text="@string/deleteFile"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp"
app:drawableStartCompat="@drawable/ic_delete" />
<TextView </LinearLayout>
android:id="@+id/downloadFile"
<com.google.android.flexbox.FlexboxLayout
android:id="@+id/filesSection"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="match_parent"
android:layout_gravity="center_vertical" app:flexWrap="wrap"
android:background="?android:attr/selectableItemBackground" app:alignItems="stretch"
android:focusable="true" android:padding="8dp"
android:clickable="true" app:alignContent="stretch" >
android:drawablePadding="24dp"
android:padding="12dp" <TextView
android:text="@string/downloadFile" android:id="@+id/editFile"
android:textColor="?attr/primaryTextColor" android:layout_width="98dp"
android:textSize="16sp" android:layout_height="100dp"
app:drawableStartCompat="@drawable/ic_download" /> android:padding="8dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:gravity="center"
app:layout_alignSelf="flex_start"
app:drawableTopCompat="@drawable/ic_edit"
android:text="@string/menuEditText"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp" />
<TextView
android:id="@+id/deleteFile"
android:layout_width="98dp"
android:layout_height="100dp"
android:padding="8dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:gravity="center"
app:layout_alignSelf="flex_start"
app:drawableTopCompat="@drawable/ic_delete"
android:text="@string/menuDeleteText"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp" />
<TextView
android:id="@+id/downloadFile"
android:layout_width="98dp"
android:layout_height="100dp"
android:padding="8dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:gravity="center"
app:layout_alignSelf="flex_start"
app:drawableTopCompat="@drawable/ic_download"
android:text="@string/download"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp" />
</com.google.android.flexbox.FlexboxLayout>
</LinearLayout> </LinearLayout>

View File

@ -25,95 +25,151 @@
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
android:orientation="horizontal" /> android:orientation="horizontal" />
<TextView <View
android:id="@+id/commentMenuEdit"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="4dp"
android:layout_gravity="center_vertical" android:id="@+id/reactionDivider"
android:background="?android:attr/selectableItemBackground" android:layout_marginTop="12dp"
android:focusable="true" android:layout_marginBottom="16dp"
android:clickable="true" android:background="?attr/dividerColor" />
android:drawablePadding="24dp"
android:padding="12dp"
android:text="@string/menuEditText"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp"
app:drawableStartCompat="@drawable/ic_edit" />
<TextView <LinearLayout
android:id="@+id/commentMenuDelete" android:id="@+id/issueComments"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_vertical" android:padding="8dp"
android:background="?android:attr/selectableItemBackground" android:orientation="vertical">
android:focusable="true"
android:clickable="true"
android:drawablePadding="24dp"
android:padding="12dp"
android:text="@string/menuDeleteText"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp"
app:drawableStartCompat="@drawable/ic_delete" />
<TextView <TextView
android:id="@+id/commentMenuQuote" android:id="@+id/bottomSheetHeader"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_vertical" android:gravity="center"
android:background="?android:attr/selectableItemBackground" android:text="@string/commentButtonText"
android:focusable="true" android:textColor="?attr/primaryTextColor"
android:clickable="true" android:textSize="16sp" />
android:drawablePadding="24dp"
android:padding="12dp"
android:text="@string/menuQuoteText"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp"
app:drawableStartCompat="@drawable/ic_comment" />
<TextView </LinearLayout>
android:id="@+id/commentMenuCopy"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:background="?android:attr/selectableItemBackground"
android:focusable="true"
android:clickable="true"
android:drawablePadding="24dp"
android:padding="12dp"
android:text="@string/copyCommentText"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp"
app:drawableStartCompat="@drawable/ic_copy" />
<TextView <com.google.android.flexbox.FlexboxLayout
android:id="@+id/issueCommentShare" android:id="@+id/issueCommentsSection"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="match_parent"
android:layout_gravity="center_vertical" app:flexWrap="wrap"
android:background="?android:attr/selectableItemBackground" app:alignItems="stretch"
android:focusable="true" android:padding="8dp"
android:clickable="true" app:alignContent="stretch" >
android:drawablePadding="24dp"
android:padding="12dp"
android:text="@string/issueCommentShare"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp"
app:drawableStartCompat="@drawable/ic_share" />
<TextView <TextView
android:id="@+id/issueCommentCopyUrl" android:id="@+id/commentMenuEdit"
android:layout_width="98dp"
android:layout_height="100dp"
android:padding="8dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:gravity="center"
app:layout_alignSelf="flex_start"
app:drawableTopCompat="@drawable/ic_edit"
android:text="@string/menuEditText"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp" />
<TextView
android:id="@+id/commentMenuDelete"
android:layout_width="98dp"
android:layout_height="100dp"
android:padding="8dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:gravity="center"
app:layout_alignSelf="flex_start"
app:drawableTopCompat="@drawable/ic_delete"
android:text="@string/menuDeleteText"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp" />
<TextView
android:id="@+id/commentMenuQuote"
android:layout_width="98dp"
android:layout_height="100dp"
android:padding="8dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:gravity="center"
app:layout_alignSelf="flex_start"
app:drawableTopCompat="@drawable/ic_comment"
android:text="@string/menuQuoteText"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp" />
<TextView
android:id="@+id/commentMenuCopy"
android:layout_width="98dp"
android:layout_height="100dp"
android:padding="8dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:gravity="center"
app:layout_alignSelf="flex_start"
app:drawableTopCompat="@drawable/ic_copy"
android:text="@string/menuCopyText"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp" />
</com.google.android.flexbox.FlexboxLayout>
<View
android:id="@+id/commentDivider"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="4dp"
android:layout_gravity="center_vertical" android:layout_marginBottom="16dp"
android:background="?android:attr/selectableItemBackground" android:background="?attr/dividerColor" />
android:focusable="true"
android:clickable="true" <com.google.android.flexbox.FlexboxLayout
android:drawablePadding="24dp" android:id="@+id/issueOtherSection"
android:padding="12dp" android:layout_width="match_parent"
android:text="@string/genericCopyUrl" android:layout_height="match_parent"
android:textColor="?attr/primaryTextColor" app:flexWrap="wrap"
android:textSize="16sp" app:alignItems="stretch"
app:drawableStartCompat="@drawable/ic_link" /> android:padding="8dp"
app:alignContent="stretch" >
<TextView
android:id="@+id/issueCommentCopyUrl"
android:layout_width="98dp"
android:layout_height="100dp"
android:padding="8dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:gravity="center"
app:layout_alignSelf="flex_start"
app:drawableTopCompat="@drawable/ic_link"
android:text="@string/genericCopyUrl"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp" />
<TextView
android:id="@+id/issueCommentShare"
android:layout_width="98dp"
android:layout_height="100dp"
android:padding="8dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:gravity="center"
app:layout_alignSelf="flex_start"
app:drawableTopCompat="@drawable/ic_share"
android:text="@string/share"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp" />
<TextView
android:id="@+id/open"
android:layout_width="98dp"
android:layout_height="100dp"
android:padding="8dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:gravity="center"
app:layout_alignSelf="flex_start"
app:drawableTopCompat="@drawable/ic_browser"
android:text="@string/openInBrowser"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp" />
</com.google.android.flexbox.FlexboxLayout>
</LinearLayout> </LinearLayout>

View File

@ -18,51 +18,73 @@
android:orientation="vertical" android:orientation="vertical"
android:layout_height="wrap_content"> android:layout_height="wrap_content">
<TextView <LinearLayout
android:id="@+id/filterByMilestone" android:id="@+id/issuesFilterHeadFrame"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_vertical" android:padding="8dp"
android:background="?android:attr/selectableItemBackground" android:orientation="vertical">
android:focusable="true"
android:clickable="true"
android:drawablePadding="24dp"
android:padding="12dp"
android:text="@string/newIssueMilestoneTitle"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp"
android:visibility="gone"
app:drawableStartCompat="@drawable/ic_milestone" />
<TextView <TextView
android:id="@+id/openIssues" android:id="@+id/bottomSheetHeader"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_vertical" android:gravity="center"
android:background="?android:attr/selectableItemBackground" android:text="@string/strFilter"
android:focusable="true" android:textColor="?attr/primaryTextColor"
android:clickable="true" android:textSize="16sp" />
android:drawablePadding="24dp"
android:padding="12dp"
android:text="@string/isOpen"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp"
app:drawableStartCompat="@drawable/ic_issue" />
<TextView </LinearLayout>
android:id="@+id/closedIssues"
<com.google.android.flexbox.FlexboxLayout
android:id="@+id/issuesFilterSection"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="match_parent"
android:layout_gravity="center_vertical" app:flexWrap="wrap"
android:background="?android:attr/selectableItemBackground" app:alignItems="stretch"
android:focusable="true" android:padding="8dp"
android:clickable="true" app:alignContent="stretch" >
android:drawablePadding="24dp"
android:padding="12dp" <TextView
android:text="@string/isClosed" android:id="@+id/filterByMilestone"
android:textColor="?attr/primaryTextColor" android:layout_width="98dp"
android:textSize="16sp" android:layout_height="100dp"
app:drawableStartCompat="@drawable/ic_issue_closed" /> android:padding="8dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:gravity="center"
app:layout_alignSelf="flex_start"
app:drawableTopCompat="@drawable/ic_milestone"
android:text="@string/newIssueMilestoneTitle"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp" />
<TextView
android:id="@+id/openIssues"
android:layout_width="98dp"
android:layout_height="100dp"
android:padding="8dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:gravity="center"
app:layout_alignSelf="flex_start"
app:drawableTopCompat="@drawable/ic_issue"
android:text="@string/isOpen"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp" />
<TextView
android:id="@+id/closedIssues"
android:layout_width="98dp"
android:layout_height="100dp"
android:padding="8dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:gravity="center"
app:layout_alignSelf="flex_start"
app:drawableTopCompat="@drawable/ic_issue_closed"
android:text="@string/isClosed"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp" />
</com.google.android.flexbox.FlexboxLayout>
</LinearLayout> </LinearLayout>

View File

@ -18,53 +18,60 @@
android:orientation="vertical" android:orientation="vertical"
android:layout_height="wrap_content"> android:layout_height="wrap_content">
<TextView <LinearLayout
android:id="@+id/bottomSheetHeader" android:id="@+id/labelsListHeadFrame"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingStart="18dp" android:padding="8dp"
android:paddingEnd="18dp" android:orientation="vertical">
android:paddingBottom="18dp"
android:text="@string/labelName"
android:textColor="?attr/primaryTextColor"
android:textSize="18sp" />
<View <TextView
android:layout_width="match_parent" android:id="@+id/bottomSheetHeader"
android:layout_height="1dp" android:layout_width="match_parent"
android:id="@+id/divider" android:layout_height="wrap_content"
android:layout_marginBottom="12dp" android:gravity="center"
android:background="?attr/dividerColor" /> android:text="@string/labelName"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp" />
<TextView </LinearLayout>
android:id="@+id/labelMenuEdit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:background="?android:attr/selectableItemBackground"
android:focusable="true"
android:clickable="true"
android:drawablePadding="24dp"
android:padding="12dp"
android:text="@string/menuEditText"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp"
app:drawableStartCompat="@drawable/ic_edit" />
<TextView <com.google.android.flexbox.FlexboxLayout
android:id="@+id/labelMenuDelete" android:id="@+id/labelsListSection"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="match_parent"
android:layout_gravity="center_vertical" app:flexWrap="wrap"
android:background="?android:attr/selectableItemBackground" app:alignItems="stretch"
android:focusable="true" android:padding="8dp"
android:clickable="true" app:alignContent="stretch" >
android:drawablePadding="24dp"
android:padding="12dp" <TextView
android:text="@string/menuDeleteText" android:id="@+id/labelMenuEdit"
android:textColor="?attr/primaryTextColor" android:layout_width="98dp"
android:textSize="16sp" android:layout_height="100dp"
app:drawableStartCompat="@drawable/ic_delete" /> android:padding="8dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:gravity="center"
app:layout_alignSelf="flex_start"
app:drawableTopCompat="@drawable/ic_edit"
android:text="@string/menuEditText"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp" />
<TextView
android:id="@+id/labelMenuDelete"
android:layout_width="98dp"
android:layout_height="100dp"
android:padding="8dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:gravity="center"
app:layout_alignSelf="flex_start"
app:drawableTopCompat="@drawable/ic_delete"
android:text="@string/menuDeleteText"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp" />
</com.google.android.flexbox.FlexboxLayout>
</LinearLayout> </LinearLayout>

View File

@ -18,35 +18,60 @@
android:orientation="vertical" android:orientation="vertical"
android:layout_height="wrap_content"> android:layout_height="wrap_content">
<TextView <LinearLayout
android:id="@+id/openMilestone" android:id="@+id/milestonesFilterHeadFrame"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_vertical" android:padding="8dp"
android:background="?android:attr/selectableItemBackground" android:orientation="vertical">
android:focusable="true"
android:clickable="true"
android:drawablePadding="24dp"
android:padding="12dp"
android:text="@string/isOpen"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp"
app:drawableStartCompat="@drawable/ic_milestone" />
<TextView <TextView
android:id="@+id/closedMilestone" android:id="@+id/bottomSheetHeader"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/strFilter"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp" />
</LinearLayout>
<com.google.android.flexbox.FlexboxLayout
android:id="@+id/milestonesFilterSection"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="match_parent"
android:layout_gravity="center_vertical" app:flexWrap="wrap"
android:background="?android:attr/selectableItemBackground" app:alignItems="stretch"
android:focusable="true" android:padding="8dp"
android:clickable="true" app:alignContent="stretch" >
android:drawablePadding="24dp"
android:padding="12dp" <TextView
android:text="@string/isClosed" android:id="@+id/openMilestone"
android:textColor="?attr/primaryTextColor" android:layout_width="98dp"
android:textSize="16sp" android:layout_height="100dp"
app:drawableStartCompat="@drawable/ic_done" /> android:padding="8dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:gravity="center"
app:layout_alignSelf="flex_start"
app:drawableTopCompat="@drawable/ic_milestone"
android:text="@string/isOpen"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp" />
<TextView
android:id="@+id/closedMilestone"
android:layout_width="98dp"
android:layout_height="100dp"
android:padding="8dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:gravity="center"
app:layout_alignSelf="flex_start"
app:drawableTopCompat="@drawable/ic_done"
android:text="@string/isClosed"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp" />
</com.google.android.flexbox.FlexboxLayout>
</LinearLayout> </LinearLayout>

View File

@ -18,35 +18,60 @@
android:orientation="vertical" android:orientation="vertical"
android:layout_height="wrap_content"> android:layout_height="wrap_content">
<TextView <LinearLayout
android:id="@+id/closeMilestone" android:id="@+id/milestonesListHeadFrame"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_vertical" android:padding="8dp"
android:background="?android:attr/selectableItemBackground" android:orientation="vertical">
android:focusable="true"
android:clickable="true"
android:drawablePadding="24dp"
android:padding="12dp"
android:text="@string/closeMilestone"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp"
app:drawableStartCompat="@drawable/ic_close" />
<TextView <TextView
android:id="@+id/openMilestone" android:id="@+id/bottomSheetHeader"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/newIssueMilestoneTitle"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp" />
</LinearLayout>
<com.google.android.flexbox.FlexboxLayout
android:id="@+id/milestonesListSection"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="match_parent"
android:layout_gravity="center_vertical" app:flexWrap="wrap"
android:background="?android:attr/selectableItemBackground" app:alignItems="stretch"
android:focusable="true" android:padding="8dp"
android:clickable="true" app:alignContent="stretch" >
android:drawablePadding="24dp"
android:padding="12dp" <TextView
android:text="@string/openMilestone" android:id="@+id/closeMilestone"
android:textColor="?attr/primaryTextColor" android:layout_width="98dp"
android:textSize="16sp" android:layout_height="100dp"
app:drawableStartCompat="@drawable/ic_check" /> android:padding="8dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:gravity="center"
app:layout_alignSelf="flex_start"
app:drawableTopCompat="@drawable/ic_close"
android:text="@string/close"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp" />
<TextView
android:id="@+id/openMilestone"
android:layout_width="98dp"
android:layout_height="100dp"
android:padding="8dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:gravity="center"
app:layout_alignSelf="flex_start"
app:drawableTopCompat="@drawable/ic_check"
android:text="@string/isOpen"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp" />
</com.google.android.flexbox.FlexboxLayout>
</LinearLayout> </LinearLayout>

View File

@ -19,9 +19,9 @@
android:layout_height="wrap_content"> android:layout_height="wrap_content">
<LinearLayout <LinearLayout
android:id="@+id/myIssuesFilterHeadFrame"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:id="@+id/repoCreate"
android:padding="8dp" android:padding="8dp"
android:orientation="vertical"> android:orientation="vertical">
@ -37,9 +37,9 @@
</LinearLayout> </LinearLayout>
<com.google.android.flexbox.FlexboxLayout <com.google.android.flexbox.FlexboxLayout
android:id="@+id/myIssuesSection"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:id="@+id/repoCreateSection"
app:flexWrap="wrap" app:flexWrap="wrap"
app:alignItems="stretch" app:alignItems="stretch"
android:padding="8dp" android:padding="8dp"
@ -71,6 +71,19 @@
android:textColor="?attr/primaryTextColor" android:textColor="?attr/primaryTextColor"
android:textSize="16sp" /> android:textSize="16sp" />
<TextView
android:id="@+id/assignedToMe"
android:layout_width="98dp"
android:layout_height="100dp"
android:padding="8dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
app:layout_alignSelf="flex_start"
android:gravity="center"
app:drawableTopCompat="@drawable/ic_person"
android:text="@string/assignedToMe"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp" />
</com.google.android.flexbox.FlexboxLayout> </com.google.android.flexbox.FlexboxLayout>
</LinearLayout> </LinearLayout>

View File

@ -1,70 +1,92 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical" android:orientation="vertical"
android:paddingTop="6dp" android:paddingTop="6dp"
android:paddingBottom="12dp" android:paddingBottom="12dp"
android:background="?attr/primaryBackgroundColor"> android:background="?attr/primaryBackgroundColor">
<androidx.core.widget.NestedScrollView <androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:orientation="vertical"
android:layout_height="wrap_content"> android:layout_height="wrap_content">
<TextView <LinearLayout
android:id="@+id/markPinned"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:orientation="vertical"
android:layout_gravity="center_vertical" android:layout_height="wrap_content">
android:background="?android:attr/selectableItemBackground"
android:focusable="true"
android:clickable="true"
android:drawablePadding="24dp"
android:padding="12dp"
android:text="@string/pinNotification"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp"
app:drawableStartCompat="@drawable/ic_pin" />
<TextView <LinearLayout
android:id="@+id/markRead" android:id="@+id/notificationsHeadFrame"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_vertical" android:padding="8dp"
android:background="?android:attr/selectableItemBackground" android:orientation="vertical">
android:focusable="true"
android:clickable="true"
android:drawablePadding="24dp"
android:padding="12dp"
android:text="@string/markAsRead"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp"
app:drawableStartCompat="@drawable/ic_unwatch" />
<TextView <TextView
android:id="@+id/markUnread" android:id="@+id/bottomSheetHeader"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_vertical" android:gravity="center"
android:background="?android:attr/selectableItemBackground" android:text="@string/pageTitleNotifications"
android:focusable="true" android:textColor="?attr/primaryTextColor"
android:clickable="true" android:textSize="16sp" />
android:drawablePadding="24dp"
android:padding="12dp"
android:text="@string/markAsUnread"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp"
app:drawableStartCompat="@drawable/ic_watchers" />
</LinearLayout> </LinearLayout>
</androidx.core.widget.NestedScrollView> <com.google.android.flexbox.FlexboxLayout
android:id="@+id/notificationsListSection"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:flexWrap="wrap"
app:alignItems="stretch"
android:padding="8dp"
app:alignContent="stretch" >
<TextView
android:id="@+id/markPinned"
android:layout_width="98dp"
android:layout_height="100dp"
android:padding="8dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:gravity="center"
app:layout_alignSelf="flex_start"
app:drawableTopCompat="@drawable/ic_pin"
android:text="@string/pinNotification"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp" />
<TextView
android:id="@+id/markRead"
android:layout_width="98dp"
android:layout_height="100dp"
android:padding="8dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:gravity="center"
app:layout_alignSelf="flex_start"
app:drawableTopCompat="@drawable/ic_unwatch"
android:text="@string/markAsRead"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp" />
<TextView
android:id="@+id/markUnread"
android:layout_width="98dp"
android:layout_height="100dp"
android:padding="8dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:gravity="center"
app:layout_alignSelf="flex_start"
app:drawableTopCompat="@drawable/ic_watchers"
android:text="@string/markAsUnread"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp" />
</com.google.android.flexbox.FlexboxLayout>
</LinearLayout>
</androidx.core.widget.NestedScrollView>
</LinearLayout> </LinearLayout>

View File

@ -18,35 +18,60 @@
android:orientation="vertical" android:orientation="vertical"
android:layout_height="wrap_content"> android:layout_height="wrap_content">
<TextView <LinearLayout
android:id="@+id/unreadNotifications" android:id="@+id/notificationsFilterHeadFrame"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_vertical" android:padding="8dp"
android:background="?android:attr/selectableItemBackground" android:orientation="vertical">
android:focusable="true"
android:clickable="true"
android:drawablePadding="24dp"
android:padding="12dp"
android:text="@string/isUnread"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp"
app:drawableStartCompat="@drawable/ic_watchers" />
<TextView <TextView
android:id="@+id/readNotifications" android:id="@+id/bottomSheetHeader"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/strFilter"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp" />
</LinearLayout>
<com.google.android.flexbox.FlexboxLayout
android:id="@+id/notificationsFilterSection"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="match_parent"
android:layout_gravity="center_vertical" app:flexWrap="wrap"
android:background="?android:attr/selectableItemBackground" app:alignItems="stretch"
android:focusable="true" android:padding="8dp"
android:clickable="true" app:alignContent="stretch" >
android:drawablePadding="24dp"
android:padding="12dp" <TextView
android:text="@string/isRead" android:id="@+id/unreadNotifications"
android:textColor="?attr/primaryTextColor" android:layout_width="98dp"
android:textSize="16sp" android:layout_height="100dp"
app:drawableStartCompat="@drawable/ic_unwatch" /> android:padding="8dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:gravity="center"
app:layout_alignSelf="flex_start"
app:drawableTopCompat="@drawable/ic_watchers"
android:text="@string/isUnread"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp" />
<TextView
android:id="@+id/readNotifications"
android:layout_width="98dp"
android:layout_height="100dp"
android:padding="8dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:gravity="center"
app:layout_alignSelf="flex_start"
app:drawableTopCompat="@drawable/ic_unwatch"
android:text="@string/isRead"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp" />
</com.google.android.flexbox.FlexboxLayout>
</LinearLayout> </LinearLayout>
</androidx.core.widget.NestedScrollView> </androidx.core.widget.NestedScrollView>

View File

@ -19,9 +19,9 @@
android:layout_height="wrap_content"> android:layout_height="wrap_content">
<LinearLayout <LinearLayout
android:id="@+id/organizationHeadFrame"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:id="@+id/orgCreate"
android:padding="8dp" android:padding="8dp"
android:orientation="vertical"> android:orientation="vertical">
@ -37,9 +37,9 @@
</LinearLayout> </LinearLayout>
<com.google.android.flexbox.FlexboxLayout <com.google.android.flexbox.FlexboxLayout
android:id="@+id/orgCreateSection"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:id="@+id/orgCreateSection"
app:flexWrap="wrap" app:flexWrap="wrap"
app:alignItems="stretch" app:alignItems="stretch"
android:padding="8dp" android:padding="8dp"
@ -94,6 +94,7 @@
android:background="?attr/dividerColor" /> android:background="?attr/dividerColor" />
<LinearLayout <LinearLayout
android:id="@+id/organizationShareHeadFrame"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:padding="8dp" android:padding="8dp"
@ -131,6 +132,32 @@
android:textColor="?attr/primaryTextColor" android:textColor="?attr/primaryTextColor"
android:textSize="16sp" /> android:textSize="16sp" />
<TextView
android:id="@+id/share"
android:layout_width="98dp"
android:layout_height="100dp"
android:padding="8dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:gravity="center"
app:layout_alignSelf="flex_start"
app:drawableTopCompat="@drawable/ic_share"
android:text="@string/share"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp" />
<TextView
android:id="@+id/open"
android:layout_width="98dp"
android:layout_height="100dp"
android:padding="8dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:gravity="center"
app:layout_alignSelf="flex_start"
app:drawableTopCompat="@drawable/ic_browser"
android:text="@string/openInBrowser"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp" />
</com.google.android.flexbox.FlexboxLayout> </com.google.android.flexbox.FlexboxLayout>
</LinearLayout> </LinearLayout>

View File

@ -18,35 +18,60 @@
android:orientation="vertical" android:orientation="vertical"
android:layout_height="wrap_content"> android:layout_height="wrap_content">
<TextView <LinearLayout
android:id="@+id/addNewMember" android:id="@+id/orgTeamHeadFrame"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_vertical" android:padding="8dp"
android:background="?android:attr/selectableItemBackground" android:orientation="vertical">
android:focusable="true"
android:clickable="true"
android:drawablePadding="24dp"
android:padding="12dp"
android:text="@string/addNewMember"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp"
app:drawableStartCompat="@drawable/ic_person_add" />
<TextView <TextView
android:id="@+id/addRepo" android:id="@+id/bottomSheetHeader"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/team"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp" />
</LinearLayout>
<com.google.android.flexbox.FlexboxLayout
android:id="@+id/orgTeamSection"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="match_parent"
android:layout_gravity="center_vertical" app:flexWrap="wrap"
android:background="?android:attr/selectableItemBackground" app:alignItems="stretch"
android:focusable="true" android:padding="8dp"
android:clickable="true" app:alignContent="stretch" >
android:drawablePadding="24dp"
android:padding="12dp" <TextView
android:text="@string/addRmRepo" android:id="@+id/addRepo"
android:textColor="?attr/primaryTextColor" android:layout_width="98dp"
android:textSize="16sp" android:layout_height="100dp"
app:drawableStartCompat="@drawable/ic_repo" /> android:padding="8dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:gravity="center"
app:layout_alignSelf="flex_start"
app:drawableTopCompat="@drawable/ic_repo"
android:text="@string/addButton"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp" />
<TextView
android:id="@+id/addNewMember"
android:layout_width="98dp"
android:layout_height="100dp"
android:padding="8dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:gravity="center"
app:layout_alignSelf="flex_start"
app:drawableTopCompat="@drawable/ic_person_add"
android:text="@string/addRemove"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp" />
</com.google.android.flexbox.FlexboxLayout>
</LinearLayout> </LinearLayout>

View File

@ -18,20 +18,47 @@
android:orientation="vertical" android:orientation="vertical"
android:layout_height="wrap_content"> android:layout_height="wrap_content">
<TextView <LinearLayout
android:id="@+id/addNewEmailAddress" android:id="@+id/myProfileHeadFrame"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_vertical" android:padding="8dp"
android:background="?android:attr/selectableItemBackground" android:orientation="vertical">
android:focusable="true"
android:clickable="true" <TextView
android:drawablePadding="24dp" android:id="@+id/bottomSheetHeader"
android:padding="12dp" android:layout_width="match_parent"
android:text="@string/profileCreateNewEmailAddress" android:layout_height="wrap_content"
android:textColor="?attr/primaryTextColor" android:gravity="center"
android:textSize="16sp" android:text="@string/navProfile"
app:drawableStartCompat="@drawable/ic_email" /> android:textColor="?attr/primaryTextColor"
android:textSize="16sp" />
</LinearLayout>
<com.google.android.flexbox.FlexboxLayout
android:id="@+id/myProfileSection"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:flexWrap="wrap"
app:alignItems="stretch"
android:padding="8dp"
app:alignContent="stretch" >
<TextView
android:id="@+id/addNewEmailAddress"
android:layout_width="98dp"
android:layout_height="100dp"
android:padding="8dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:gravity="center"
app:layout_alignSelf="flex_start"
app:drawableTopCompat="@drawable/ic_email"
android:text="@string/addButton"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp" />
</com.google.android.flexbox.FlexboxLayout>
</LinearLayout> </LinearLayout>

View File

@ -18,35 +18,60 @@
android:orientation="vertical" android:orientation="vertical"
android:layout_height="wrap_content"> android:layout_height="wrap_content">
<TextView <LinearLayout
android:id="@+id/openPr" android:id="@+id/prFilterHeadFrame"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_vertical" android:padding="8dp"
android:background="?android:attr/selectableItemBackground" android:orientation="vertical">
android:focusable="true"
android:clickable="true"
android:drawablePadding="24dp"
android:padding="12dp"
android:text="@string/isOpen"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp"
app:drawableStartCompat="@drawable/ic_pull_request" />
<TextView <TextView
android:id="@+id/closedPr" android:id="@+id/bottomSheetHeader"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/strFilter"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp" />
</LinearLayout>
<com.google.android.flexbox.FlexboxLayout
android:id="@+id/prFilterSection"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="match_parent"
android:layout_gravity="center_vertical" app:flexWrap="wrap"
android:background="?android:attr/selectableItemBackground" app:alignItems="stretch"
android:focusable="true" android:padding="8dp"
android:clickable="true" app:alignContent="stretch" >
android:drawablePadding="24dp"
android:padding="12dp" <TextView
android:text="@string/isClosed" android:id="@+id/openPr"
android:textColor="?attr/primaryTextColor" android:layout_width="98dp"
android:textSize="16sp" android:layout_height="100dp"
app:drawableStartCompat="@drawable/ic_issue_closed" /> android:padding="8dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:gravity="center"
app:layout_alignSelf="flex_start"
app:drawableTopCompat="@drawable/ic_pull_request"
android:text="@string/isOpen"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp" />
<TextView
android:id="@+id/closedPr"
android:layout_width="98dp"
android:layout_height="100dp"
android:padding="8dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:gravity="center"
app:layout_alignSelf="flex_start"
app:drawableTopCompat="@drawable/ic_issue_closed"
android:text="@string/isClosed"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp" />
</com.google.android.flexbox.FlexboxLayout>
</LinearLayout> </LinearLayout>

View File

@ -18,35 +18,60 @@
android:orientation="vertical" android:orientation="vertical"
android:layout_height="wrap_content"> android:layout_height="wrap_content">
<TextView <LinearLayout
android:id="@+id/releases" android:id="@+id/releasesTagsHeadFrame"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_vertical" android:padding="8dp"
android:background="?android:attr/selectableItemBackground" android:orientation="vertical">
android:focusable="true"
android:clickable="true"
android:drawablePadding="24dp"
android:padding="12dp"
android:text="@string/tabTextReleases"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp"
app:drawableStartCompat="@drawable/ic_release" />
<TextView <TextView
android:id="@+id/tags" android:id="@+id/bottomSheetHeader"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/strFilter"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp" />
</LinearLayout>
<com.google.android.flexbox.FlexboxLayout
android:id="@+id/releasesTagsFilterSection"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="match_parent"
android:layout_gravity="center_vertical" app:flexWrap="wrap"
android:background="?android:attr/selectableItemBackground" app:alignItems="stretch"
android:focusable="true" android:padding="8dp"
android:clickable="true" app:alignContent="stretch" >
android:drawablePadding="24dp"
android:padding="12dp" <TextView
android:text="@string/tags" android:id="@+id/releases"
android:textColor="?attr/primaryTextColor" android:layout_width="98dp"
android:textSize="16sp" android:layout_height="100dp"
app:drawableStartCompat="@drawable/ic_label" /> android:padding="8dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:gravity="center"
app:layout_alignSelf="flex_start"
app:drawableTopCompat="@drawable/ic_release"
android:text="@string/tabTextReleases"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp" />
<TextView
android:id="@+id/tags"
android:layout_width="98dp"
android:layout_height="100dp"
android:padding="8dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:gravity="center"
app:layout_alignSelf="flex_start"
app:drawableTopCompat="@drawable/ic_label"
android:text="@string/tags"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp" />
</com.google.android.flexbox.FlexboxLayout>
</LinearLayout> </LinearLayout>
</androidx.core.widget.NestedScrollView> </androidx.core.widget.NestedScrollView>

View File

@ -19,9 +19,9 @@
android:layout_height="wrap_content"> android:layout_height="wrap_content">
<LinearLayout <LinearLayout
android:id="@+id/repoCreateHeadFrame"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:id="@+id/repoCreate"
android:padding="8dp" android:padding="8dp"
android:orientation="vertical"> android:orientation="vertical">
@ -37,9 +37,9 @@
</LinearLayout> </LinearLayout>
<com.google.android.flexbox.FlexboxLayout <com.google.android.flexbox.FlexboxLayout
android:id="@+id/repoCreateSection"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:id="@+id/repoCreateSection"
app:flexWrap="wrap" app:flexWrap="wrap"
app:alignItems="stretch" app:alignItems="stretch"
android:padding="8dp" android:padding="8dp"
@ -146,6 +146,7 @@
android:background="?attr/dividerColor" /> android:background="?attr/dividerColor" />
<LinearLayout <LinearLayout
android:id="@+id/repoOthersHeadFrame"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:padding="8dp" android:padding="8dp"
@ -163,6 +164,7 @@
</LinearLayout> </LinearLayout>
<com.google.android.flexbox.FlexboxLayout <com.google.android.flexbox.FlexboxLayout
android:id="@+id/repoOthersSection"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
app:flexWrap="wrap" app:flexWrap="wrap"
@ -257,7 +259,7 @@
app:layout_alignSelf="flex_start" app:layout_alignSelf="flex_start"
android:gravity="center" android:gravity="center"
app:drawableTopCompat="@drawable/ic_browser" app:drawableTopCompat="@drawable/ic_browser"
android:text="@string/isOpen" android:text="@string/openInBrowser"
android:textColor="?attr/primaryTextColor" android:textColor="?attr/primaryTextColor"
android:textSize="16sp" /> android:textSize="16sp" />

View File

@ -2,7 +2,6 @@
<LinearLayout <LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical" android:orientation="vertical"
@ -26,207 +25,233 @@
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
android:orientation="horizontal" /> android:orientation="horizontal" />
<TextView
android:id="@+id/openFilesDiff"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:background="?android:attr/selectableItemBackground"
android:focusable="true"
android:clickable="true"
android:drawablePadding="24dp"
android:padding="12dp"
android:text="@string/openFileDiffText"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp"
android:visibility="gone"
app:drawableStartCompat="@drawable/ic_file"
tools:visibility="visible" />
<TextView
android:id="@+id/mergePullRequest"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:background="?android:attr/selectableItemBackground"
android:focusable="true"
android:clickable="true"
android:drawablePadding="24dp"
android:padding="12dp"
android:text="@string/mergePullRequestText"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp"
app:drawableStartCompat="@drawable/ic_pull_request" />
<TextView
android:id="@+id/updatePullRequest"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:background="?android:attr/selectableItemBackground"
android:focusable="true"
android:clickable="true"
android:drawablePadding="24dp"
android:padding="12dp"
android:text="@string/updatePullRequestText"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp"
app:drawableStartCompat="@drawable/ic_update" />
<TextView
android:id="@+id/deletePrHeadBranch"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:background="?android:attr/selectableItemBackground"
android:focusable="true"
android:clickable="true"
android:drawablePadding="24dp"
android:padding="12dp"
android:text="@string/deletePrHeadBranch"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp"
app:drawableStartCompat="@drawable/ic_branch" />
<TextView
android:id="@+id/editIssue"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:background="?android:attr/selectableItemBackground"
android:focusable="true"
android:clickable="true"
android:drawablePadding="24dp"
android:padding="12dp"
android:text="@string/editIssue"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp"
app:drawableStartCompat="@drawable/ic_edit" />
<TextView
android:id="@+id/addRemoveAssignees"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:background="?android:attr/selectableItemBackground"
android:focusable="true"
android:clickable="true"
android:drawablePadding="24dp"
android:padding="12dp"
android:text="@string/addRemoveAssignees"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp"
app:drawableStartCompat="@drawable/ic_person_add" />
<TextView
android:id="@+id/editLabels"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:background="?android:attr/selectableItemBackground"
android:focusable="true"
android:clickable="true"
android:drawablePadding="24dp"
android:padding="12dp"
android:text="@string/singleIssueEditLabels"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp"
app:drawableStartCompat="@drawable/ic_label" />
<TextView
android:id="@+id/subscribeIssue"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:background="?android:attr/selectableItemBackground"
android:focusable="true"
android:clickable="true"
android:drawablePadding="24dp"
android:padding="12dp"
android:text="@string/singleIssueSubscribe"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp"
app:drawableStartCompat="@drawable/ic_unwatch" />
<TextView
android:id="@+id/unsubscribeIssue"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:background="?android:attr/selectableItemBackground"
android:focusable="true"
android:clickable="true"
android:drawablePadding="24dp"
android:padding="12dp"
android:text="@string/singleIssueUnSubscribe"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp"
android:visibility="gone"
app:drawableStartCompat="@drawable/ic_watchers"
tools:visibility="visible" />
<View <View
android:id="@+id/shareDivider" android:id="@+id/reactionDivider"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="1dp" android:layout_height="4dp"
android:layout_marginTop="12dp" android:layout_marginTop="12dp"
android:layout_marginBottom="12dp" android:layout_marginBottom="16dp"
android:layout_marginStart="64dp"
android:background="?attr/dividerColor" /> android:background="?attr/dividerColor" />
<TextView <LinearLayout
android:id="@+id/shareIssue" android:id="@+id/bottomSheetHeaderFrame"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_vertical" android:padding="8dp"
android:background="?android:attr/selectableItemBackground" android:orientation="vertical">
android:focusable="true"
android:clickable="true"
android:drawablePadding="24dp"
android:padding="12dp"
android:text="@string/shareIssue"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp"
app:drawableStartCompat="@drawable/ic_share" />
<TextView <TextView
android:id="@+id/copyIssueUrl" android:id="@+id/bottomSheetHeader"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/issue"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp" />
</LinearLayout>
<com.google.android.flexbox.FlexboxLayout
android:id="@+id/issuePrtSection"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="match_parent"
android:layout_gravity="center_vertical" app:flexWrap="wrap"
android:background="?android:attr/selectableItemBackground" app:alignItems="stretch"
android:focusable="true" android:padding="8dp"
android:clickable="true" app:alignContent="stretch" >
android:drawablePadding="24dp"
android:padding="12dp" <TextView
android:text="@string/copyIssueUrl" android:id="@+id/openFilesDiff"
android:textColor="?attr/primaryTextColor" android:layout_width="98dp"
android:textSize="16sp" android:layout_height="100dp"
app:drawableStartCompat="@drawable/ic_copy" /> android:padding="8dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:gravity="center"
app:layout_alignSelf="flex_start"
app:drawableTopCompat="@drawable/ic_file"
android:text="@string/tabTextFiles"
android:textColor="?attr/primaryTextColor"
android:visibility="gone"
android:textSize="16sp" />
<TextView
android:id="@+id/mergePullRequest"
android:layout_width="98dp"
android:layout_height="100dp"
android:padding="8dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:gravity="center"
app:layout_alignSelf="flex_start"
app:drawableTopCompat="@drawable/ic_pull_request"
android:text="@string/mergePullRequestButtonText"
android:textColor="?attr/primaryTextColor"
android:visibility="gone"
android:textSize="16sp" />
<TextView
android:id="@+id/updatePullRequest"
android:layout_width="98dp"
android:layout_height="100dp"
android:padding="8dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:gravity="center"
app:layout_alignSelf="flex_start"
app:drawableTopCompat="@drawable/ic_update"
android:text="@string/newUpdateButtonCopy"
android:textColor="?attr/primaryTextColor"
android:visibility="gone"
android:textSize="16sp" />
<TextView
android:id="@+id/deletePrHeadBranch"
android:layout_width="98dp"
android:layout_height="100dp"
android:padding="8dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:gravity="center"
app:layout_alignSelf="flex_start"
app:drawableTopCompat="@drawable/ic_branch"
android:text="@string/deleteBranch"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp" />
<TextView
android:id="@+id/editIssue"
android:layout_width="98dp"
android:layout_height="100dp"
android:padding="8dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:gravity="center"
app:layout_alignSelf="flex_start"
app:drawableTopCompat="@drawable/ic_edit"
android:text="@string/menuEditText"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp" />
<TextView
android:id="@+id/addRemoveAssignees"
android:layout_width="98dp"
android:layout_height="100dp"
android:padding="8dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:gravity="center"
app:layout_alignSelf="flex_start"
app:drawableTopCompat="@drawable/ic_person_add"
android:text="@string/newIssueAssigneesListTitle"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp" />
<TextView
android:id="@+id/editLabels"
android:layout_width="98dp"
android:layout_height="100dp"
android:padding="8dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:gravity="center"
app:layout_alignSelf="flex_start"
app:drawableTopCompat="@drawable/ic_label"
android:text="@string/newIssueLabelsTitle"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp" />
<TextView
android:id="@+id/subscribeIssue"
android:layout_width="98dp"
android:layout_height="100dp"
android:padding="8dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:gravity="center"
app:layout_alignSelf="flex_start"
app:drawableTopCompat="@drawable/ic_unwatch"
android:text="@string/singleIssueSubscribe"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp" />
<TextView
android:id="@+id/unsubscribeIssue"
android:layout_width="98dp"
android:layout_height="100dp"
android:padding="8dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:gravity="center"
app:layout_alignSelf="flex_start"
app:drawableTopCompat="@drawable/ic_watchers"
android:text="@string/singleIssueUnSubscribe"
android:textColor="?attr/primaryTextColor"
android:visibility="gone"
android:textSize="16sp" />
<TextView
android:id="@+id/closeIssue"
android:layout_width="98dp"
android:layout_height="100dp"
android:padding="8dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:gravity="center"
app:layout_alignSelf="flex_start"
app:drawableTopCompat="@drawable/ic_issue_closed"
android:text="@string/close"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp" />
</com.google.android.flexbox.FlexboxLayout>
<View <View
android:id="@+id/dividerCloseReopenIssue" android:id="@+id/issuePrDivider"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="1dp" android:layout_height="4dp"
android:layout_marginTop="12dp" android:layout_marginBottom="16dp"
android:layout_marginBottom="12dp"
android:layout_marginStart="64dp"
android:background="?attr/dividerColor" /> android:background="?attr/dividerColor" />
<TextView <com.google.android.flexbox.FlexboxLayout
android:id="@+id/closeIssue" android:id="@+id/issuePrShareSection"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="match_parent"
android:layout_gravity="center_vertical" app:flexWrap="wrap"
android:background="?android:attr/selectableItemBackground" app:alignItems="stretch"
android:focusable="true" android:padding="8dp"
android:clickable="true" app:alignContent="stretch" >
android:drawablePadding="24dp"
android:padding="12dp" <TextView
android:text="@string/closeIssue" android:id="@+id/copyIssueUrl"
android:textColor="?attr/primaryTextColor" android:layout_width="98dp"
android:textSize="16sp" android:layout_height="100dp"
app:drawableStartCompat="@drawable/ic_issue_closed" /> android:padding="8dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:gravity="center"
app:layout_alignSelf="flex_start"
app:drawableTopCompat="@drawable/ic_copy"
android:text="@string/genericCopyUrl"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp" />
<TextView
android:id="@+id/shareIssue"
android:layout_width="98dp"
android:layout_height="100dp"
android:padding="8dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:gravity="center"
app:layout_alignSelf="flex_start"
app:drawableTopCompat="@drawable/ic_share"
android:text="@string/share"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp" />
<TextView
android:id="@+id/open"
android:layout_width="98dp"
android:layout_height="100dp"
android:padding="8dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:gravity="center"
app:layout_alignSelf="flex_start"
app:drawableTopCompat="@drawable/ic_browser"
android:text="@string/openInBrowser"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp" />
</com.google.android.flexbox.FlexboxLayout>
</LinearLayout> </LinearLayout>

View File

@ -18,20 +18,47 @@
android:orientation="vertical" android:orientation="vertical"
android:layout_height="wrap_content"> android:layout_height="wrap_content">
<TextView <LinearLayout
android:id="@+id/tagMenuDelete" android:id="@+id/tagsListHeadFrame"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_vertical" android:padding="8dp"
android:background="?android:attr/selectableItemBackground" android:orientation="vertical">
android:focusable="true"
android:clickable="true" <TextView
android:drawablePadding="24dp" android:id="@+id/bottomSheetHeader"
android:padding="12dp" android:layout_width="match_parent"
android:text="@string/menuDeleteText" android:layout_height="wrap_content"
android:textColor="?attr/primaryTextColor" android:gravity="center"
android:textSize="16sp" android:text="@string/tags"
app:drawableStartCompat="@drawable/ic_delete" /> android:textColor="?attr/primaryTextColor"
android:textSize="16sp" />
</LinearLayout>
<com.google.android.flexbox.FlexboxLayout
android:id="@+id/tagsListSection"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:flexWrap="wrap"
app:alignItems="stretch"
android:padding="8dp"
app:alignContent="stretch" >
<TextView
android:id="@+id/tagMenuDelete"
android:layout_width="98dp"
android:layout_height="100dp"
android:padding="8dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:gravity="center"
app:layout_alignSelf="flex_start"
app:drawableTopCompat="@drawable/ic_delete"
android:text="@string/menuDeleteText"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp" />
</com.google.android.flexbox.FlexboxLayout>
</LinearLayout> </LinearLayout>

View File

@ -18,20 +18,47 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical"> android:orientation="vertical">
<TextView <LinearLayout
android:id="@+id/followUnfollowUser" android:id="@+id/usersProfileHeadFrame"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_vertical" android:padding="8dp"
android:background="?android:attr/selectableItemBackground" android:orientation="vertical">
android:focusable="true"
android:clickable="true" <TextView
android:drawablePadding="24dp" android:id="@+id/bottomSheetHeader"
android:padding="12dp" android:layout_width="match_parent"
android:text="@string/userFollow" android:layout_height="wrap_content"
android:textColor="?attr/primaryTextColor" android:gravity="center"
android:textSize="16sp" android:text="@string/pageTitleUsers"
app:drawableStartCompat="@drawable/ic_person_add" /> android:textColor="?attr/primaryTextColor"
android:textSize="16sp" />
</LinearLayout>
<com.google.android.flexbox.FlexboxLayout
android:id="@+id/usersProfileSection"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:flexWrap="wrap"
app:alignItems="stretch"
android:padding="8dp"
app:alignContent="stretch" >
<TextView
android:id="@+id/followUnfollowUser"
android:layout_width="98dp"
android:layout_height="100dp"
android:padding="8dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:gravity="center"
app:layout_alignSelf="flex_start"
app:drawableTopCompat="@drawable/ic_person_add"
android:text="@string/userFollow"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp" />
</com.google.android.flexbox.FlexboxLayout>
</LinearLayout> </LinearLayout>

View File

@ -0,0 +1,55 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="25dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:id="@+id/headBranchHeader"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="?attr/primaryTextColor"
android:text="@string/pullFromBranch"
android:layout_marginBottom="4dp"
android:textSize="16sp" />
<TextView
android:id="@+id/headBranch"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="14sp"
android:textColor="?attr/primaryTextColor" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="16dp"
android:orientation="vertical">
<TextView
android:id="@+id/baseBranchHeader"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="?attr/primaryTextColor"
android:text="@string/mergeIntoBranch"
android:layout_marginBottom="4dp"
android:textSize="16sp" />
<TextView
android:id="@+id/baseBranch"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="14sp"
android:textColor="?attr/primaryTextColor" />
</LinearLayout>
</LinearLayout>

View File

@ -94,7 +94,7 @@
android:id="@+id/releaseTag" android:id="@+id/releaseTag"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="5dp" android:layout_marginStart="8dp"
android:singleLine="true" android:singleLine="true"
android:textColor="?attr/primaryTextColor" android:textColor="?attr/primaryTextColor"
android:textSize="14sp" /> android:textSize="14sp" />
@ -119,7 +119,7 @@
android:id="@+id/releaseCommitSha" android:id="@+id/releaseCommitSha"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="5dp" android:layout_marginStart="8dp"
android:singleLine="true" android:singleLine="true"
android:textColor="?attr/primaryTextColor" android:textColor="?attr/primaryTextColor"
android:textSize="14sp" /> android:textSize="14sp" />
@ -143,7 +143,7 @@
android:id="@+id/releaseDate" android:id="@+id/releaseDate"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="5dp" android:layout_marginStart="8dp"
android:singleLine="true" android:singleLine="true"
android:textColor="?attr/primaryTextColor" android:textColor="?attr/primaryTextColor"
android:textSize="14sp" /> android:textSize="14sp" />

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:id="@+id/prInfo"
android:icon="@drawable/ic_info"
android:title="@string/infoMoreInformation"
android:orderInCategory="0"
app:showAsAction="ifRoom" />
</menu>

View File

@ -123,6 +123,7 @@
<string name="tabTextBranches">Branches</string> <string name="tabTextBranches">Branches</string>
<string name="tabTextCollaborators">Collaborators</string> <string name="tabTextCollaborators">Collaborators</string>
<string name="tabPullRequests">Pull Requests</string> <string name="tabPullRequests">Pull Requests</string>
<string name="pullRequest">Pull Request</string>
<string name="infoTabRepoSize">Size</string> <string name="infoTabRepoSize">Size</string>
<string name="infoTabRepoDefaultBranch">Default Branch</string> <string name="infoTabRepoDefaultBranch">Default Branch</string>
@ -145,6 +146,7 @@
<string name="issueMilestone">Milestone %1$s</string> <string name="issueMilestone">Milestone %1$s</string>
<string name="dueDate">Due on %1$s</string> <string name="dueDate">Due on %1$s</string>
<string name="assignedTo">Assigned to: %1$s</string> <string name="assignedTo">Assigned to: %1$s</string>
<string name="assignedToMe">Assigned to Me</string>
<string name="commentButtonText">Comment</string> <string name="commentButtonText">Comment</string>
<string name="commentEmptyError">Please write your comment</string> <string name="commentEmptyError">Please write your comment</string>
<string name="commentSuccess">Comment posted</string> <string name="commentSuccess">Comment posted</string>
@ -285,8 +287,6 @@
<string name="teamShowAll">show all</string> <string name="teamShowAll">show all</string>
<string name="orgMember">Org members</string> <string name="orgMember">Org members</string>
<string name="orgTeamMembers">Organization team members</string> <string name="orgTeamMembers">Organization team members</string>
<string name="addNewMember">Add / Remove New Member</string>
<string name="addRmRepo">Add Repository</string>
<string name="removeTeamMemberTitle">Remove\u0020</string> <string name="removeTeamMemberTitle">Remove\u0020</string>
<string name="addTeamMemberTitle">Add\u0020</string> <string name="addTeamMemberTitle">Add\u0020</string>
<string name="addTeamMemberMessage">Do you want to add this user to the team?</string> <string name="addTeamMemberMessage">Do you want to add this user to the team?</string>
@ -365,7 +365,7 @@
<string name="repoMetaData">Repository Meta</string> <string name="repoMetaData">Repository Meta</string>
<!-- admin --> <!-- admin -->
<string name="adminCreateNewUser">Add New User</string> <string name="adminCreateNewUser">New User</string>
<string name="adminUsers">System Users</string> <string name="adminUsers">System Users</string>
<string name="userRoleAdmin">Admin</string> <string name="userRoleAdmin">Admin</string>
<string name="adminCron">Cron Tasks</string> <string name="adminCron">Cron Tasks</string>
@ -502,6 +502,10 @@
<string name="repository">Repository</string> <string name="repository">Repository</string>
<string name="team">Team</string> <string name="team">Team</string>
<string name="organization">Organization</string> <string name="organization">Organization</string>
<string name="addRemove">Add / Remove</string>
<string name="download">Download</string>
<string name="reopen">Reopen</string>
<string name="openInBrowser">Open in Browser</string>
<!-- generic copy --> <!-- generic copy -->
<string name="exploreUsers">Explore users</string> <string name="exploreUsers">Explore users</string>
@ -525,8 +529,6 @@
<string name="loginTokenError">Token is required</string> <string name="loginTokenError">Token is required</string>
<string name="prDeletedFork">Deleted Fork</string> <string name="prDeletedFork">Deleted Fork</string>
<string name="editPrText">Edit Pull Request</string>
<string name="copyPrUrlText">Copy Pull Request URL</string>
<string name="editPrNavHeader">Edit Pull Request #%1$s</string> <string name="editPrNavHeader">Edit Pull Request #%1$s</string>
<string name="editPrSuccessMessage">Pull Request updated</string> <string name="editPrSuccessMessage">Pull Request updated</string>
<string name="fileDiffViewHeader">%1$s Files Changed</string> <string name="fileDiffViewHeader">%1$s Files Changed</string>
@ -534,7 +536,6 @@
<string name="updatePullRequestText">Update Pull Request</string> <string name="updatePullRequestText">Update Pull Request</string>
<string name="openFileDiffText">Show Changed Files</string> <string name="openFileDiffText">Show Changed Files</string>
<string name="mergePullRequestText">Merge Pull Request</string> <string name="mergePullRequestText">Merge Pull Request</string>
<string name="deletePrHeadBranch">Delete head branch</string>
<string name="deleteBranchSuccess">Branch deleted successfully</string> <string name="deleteBranchSuccess">Branch deleted successfully</string>
<string name="deleteBranchError">Could not delete branch</string> <string name="deleteBranchError">Could not delete branch</string>
<string name="deleteBranchErrorNotFound">Branch does not exist</string> <string name="deleteBranchErrorNotFound">Branch does not exist</string>
@ -553,8 +554,8 @@
<string name="mergeStrategy">Merge Strategy</string> <string name="mergeStrategy">Merge Strategy</string>
<string name="selectMergeStrategy">Select merge strategy</string> <string name="selectMergeStrategy">Select merge strategy</string>
<string name="mergeNotAllowed">Not allowed to merge [Reason: Does not have enough approvals]</string> <string name="mergeNotAllowed">Not allowed to merge [Reason: Does not have enough approvals]</string>
<string name="deleteBranch">Delete Branch</string>
<string name="downloadFile">Download This File</string>
<string name="waitLoadingDownloadFile">Please wait for the file to load to memory</string> <string name="waitLoadingDownloadFile">Please wait for the file to load to memory</string>
<string name="downloadFileSaved">File saved successfully</string> <string name="downloadFileSaved">File saved successfully</string>
<string name="excludeFilesInFileViewer">This file type/size is not supported in file viewer. You can download it from the menu.</string> <string name="excludeFilesInFileViewer">This file type/size is not supported in file viewer. You can download it from the menu.</string>
@ -567,7 +568,6 @@
<string name="sizeCopy">Size</string> <string name="sizeCopy">Size</string>
<string name="shareIssue">Share Issue</string> <string name="shareIssue">Share Issue</string>
<string name="sharePr">Share Pull Request</string>
<string name="shareRepository">Share Repository</string> <string name="shareRepository">Share Repository</string>
<string name="createRepository">Create Repository</string> <string name="createRepository">Create Repository</string>
<string name="commitTitle">Commits</string> <string name="commitTitle">Commits</string>
@ -641,9 +641,9 @@
<string name="pollingDelaySelectedText">%d Minutes</string> <string name="pollingDelaySelectedText">%d Minutes</string>
<string name="pollingDelayDialogHeaderText">Select Polling Delay</string> <string name="pollingDelayDialogHeaderText">Select Polling Delay</string>
<string name="pollingDelayDialogDescriptionText">Choose a minutely delay in which GitNex tries to poll new notifications</string> <string name="pollingDelayDialogDescriptionText">Choose a minutely delay in which GitNex tries to poll new notifications</string>
<string name="markAsRead">Mark as Read</string> <string name="markAsRead">Mark Read</string>
<string name="markAsUnread">Mark as Unread</string> <string name="markAsUnread">Mark Unread</string>
<string name="pinNotification">Pin Notification</string> <string name="pinNotification">Pin</string>
<string name="markedNotificationsAsRead">Successfully marked all notifications as read</string> <string name="markedNotificationsAsRead">Successfully marked all notifications as read</string>
<string name="notificationsHintText">Polling delay, light, vibration</string> <string name="notificationsHintText">Polling delay, light, vibration</string>
<string name="enableNotificationsHeaderText">Enable Notifications</string> <string name="enableNotificationsHeaderText">Enable Notifications</string>
@ -704,6 +704,7 @@
<string name="prAlreadyExists">A pull request between these branches already exists</string> <string name="prAlreadyExists">A pull request between these branches already exists</string>
<string name="prClosed">Pull Request closed</string> <string name="prClosed">Pull Request closed</string>
<string name="prReopened">Pull Request reopened</string> <string name="prReopened">Pull Request reopened</string>
<string name="prMergeInfo">Pull Request Info</string>
<string name="accountDoesNotExist">It seems that account for URI %1$s does not exists in the app. You can add one by tapping on the Add New Account button.</string> <string name="accountDoesNotExist">It seems that account for URI %1$s does not exists in the app. You can add one by tapping on the Add New Account button.</string>
<string name="launchApp">Go to App</string> <string name="launchApp">Go to App</string>
@ -742,8 +743,6 @@
<string name="updateStrategyRebase">Rebase</string> <string name="updateStrategyRebase">Rebase</string>
<string name="selectUpdateStrategy">Select Update Strategy</string> <string name="selectUpdateStrategy">Select Update Strategy</string>
<string name="closePr">Close Pull Request</string>
<string name="reopenPr">Reopen Pull Request</string>
<string name="userAvatar">Avatar</string> <string name="userAvatar">Avatar</string>
<string name="tags">Tags</string> <string name="tags">Tags</string>
<string name="releasesTags">Releases/Tags</string> <string name="releasesTags">Releases/Tags</string>
@ -753,6 +752,7 @@
<string name="deleteTagConfirmation">Do you really want to delete this tag?</string> <string name="deleteTagConfirmation">Do you really want to delete this tag?</string>
<string name="deleteTagTitle">Delete tag %s</string> <string name="deleteTagTitle">Delete tag %s</string>
<string name="tagDeleted">Tag deleted</string> <string name="tagDeleted">Tag deleted</string>
<string name="tagDeleteError">A tag attached to a release cannot be deleted directly</string>
<string name="useCustomTabs">Use Custom Tabs</string> <string name="useCustomTabs">Use Custom Tabs</string>
<string name="browserOpenFailed">No application found to open this link. SSH URLs and URLs with another prefix the http:// or https:// are not supported by most browser</string> <string name="browserOpenFailed">No application found to open this link. SSH URLs and URLs with another prefix the http:// or https:// are not supported by most browser</string>
<string name="logInAgain">Log in again</string> <string name="logInAgain">Log in again</string>