mirror of
https://codeberg.org/gitnex/GitNex
synced 2025-03-08 23:57:44 +01:00
- [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:
parent
a05216e18a
commit
c67b3c178f
@ -8,6 +8,7 @@ import android.view.View;
|
||||
import android.widget.ArrayAdapter;
|
||||
import androidx.annotation.NonNull;
|
||||
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.User;
|
||||
import org.mian.gitnex.R;
|
||||
@ -39,6 +40,8 @@ public class AddNewAccountActivity extends BaseActivity {
|
||||
|
||||
private String spinnerSelectedValue;
|
||||
private Version giteaVersion;
|
||||
private int maxResponseItems = 50;
|
||||
private int defaultPagingNumber = 30;
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
@ -115,6 +118,7 @@ public class AddNewAccountActivity extends BaseActivity {
|
||||
.toUri();
|
||||
|
||||
versionCheck(instanceUrl.toString(), loginToken);
|
||||
serverPageLimitSettings();
|
||||
|
||||
}
|
||||
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) {
|
||||
|
||||
Call<User> call = RetrofitClient.getApiInterface(ctx, instanceUrl, "token " + loginToken).userGetCurrent();
|
||||
@ -219,7 +248,7 @@ public class AddNewAccountActivity extends BaseActivity {
|
||||
|
||||
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);
|
||||
AppUtil.switchToAccount(AddNewAccountActivity.this, account);
|
||||
Toasty.success(ctx, getResources().getString(R.string.accountAddedMessage));
|
||||
|
@ -10,6 +10,7 @@ import org.mian.gitnex.R;
|
||||
import org.mian.gitnex.adapters.TeamRepositoriesAdapter;
|
||||
import org.mian.gitnex.clients.RetrofitClient;
|
||||
import org.mian.gitnex.databinding.AddNewTeamRepositoryBinding;
|
||||
import org.mian.gitnex.helpers.Constants;
|
||||
import org.mian.gitnex.helpers.Toasty;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@ -27,6 +28,7 @@ public class AddNewTeamRepoActivity extends BaseActivity {
|
||||
private View.OnClickListener onClickListener;
|
||||
private List<Repository> dataList;
|
||||
private TeamRepositoriesAdapter adapter;
|
||||
private int resultLimit;
|
||||
|
||||
private long teamId;
|
||||
private String teamName;
|
||||
@ -39,6 +41,7 @@ public class AddNewTeamRepoActivity extends BaseActivity {
|
||||
addNewTeamRepositoryBinding = AddNewTeamRepositoryBinding.inflate(getLayoutInflater());
|
||||
setContentView(addNewTeamRepositoryBinding.getRoot());
|
||||
|
||||
resultLimit = Constants.getCurrentResultLimit(ctx);
|
||||
initCloseListener();
|
||||
addNewTeamRepositoryBinding.close.setOnClickListener(onClickListener);
|
||||
|
||||
@ -58,7 +61,7 @@ public class AddNewTeamRepoActivity extends BaseActivity {
|
||||
|
||||
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);
|
||||
|
||||
|
@ -14,11 +14,12 @@ import org.mian.gitnex.databinding.ActivityAdminCronTasksBinding;
|
||||
import org.mian.gitnex.viewmodels.AdminCronTasksViewModel;
|
||||
|
||||
/**
|
||||
* Author M M Arif
|
||||
* @author M M Arif
|
||||
*/
|
||||
|
||||
public class AdminCronTasksActivity extends BaseActivity {
|
||||
|
||||
private AdminCronTasksViewModel adminCronTasksViewModel;
|
||||
private View.OnClickListener onClickListener;
|
||||
private AdminCronTasksAdapter adapter;
|
||||
|
||||
@ -34,6 +35,7 @@ public class AdminCronTasksActivity extends BaseActivity {
|
||||
|
||||
activityAdminCronTasksBinding = ActivityAdminCronTasksBinding.inflate(getLayoutInflater());
|
||||
setContentView(activityAdminCronTasksBinding.getRoot());
|
||||
adminCronTasksViewModel = new ViewModelProvider(this).get(AdminCronTasksViewModel.class);
|
||||
|
||||
initCloseListener();
|
||||
activityAdminCronTasksBinding.close.setOnClickListener(onClickListener);
|
||||
@ -51,7 +53,7 @@ public class AdminCronTasksActivity extends BaseActivity {
|
||||
activityAdminCronTasksBinding.pullToRefresh.setOnRefreshListener(() -> new Handler(Looper.getMainLooper()).postDelayed(() -> {
|
||||
|
||||
activityAdminCronTasksBinding.pullToRefresh.setRefreshing(false);
|
||||
AdminCronTasksViewModel.loadCronTasksList(ctx, PAGE, LIMIT);
|
||||
adminCronTasksViewModel.loadCronTasksList(ctx, PAGE, LIMIT);
|
||||
|
||||
}, 500));
|
||||
|
||||
|
@ -29,11 +29,12 @@ import org.mian.gitnex.viewmodels.AdminGetUsersViewModel;
|
||||
|
||||
public class AdminGetUsersActivity extends BaseActivity implements BottomSheetListener {
|
||||
|
||||
private AdminGetUsersViewModel adminGetUsersViewModel;
|
||||
private View.OnClickListener onClickListener;
|
||||
private ActivityAdminGetUsersBinding activityAdminGetUsersBinding;
|
||||
private AdminGetUsersAdapter adapter;
|
||||
private int page = 1;
|
||||
private int resultLimit = Constants.resultLimitNewGiteaInstances;
|
||||
private int resultLimit;
|
||||
private Boolean searchFilter = false;
|
||||
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
@ -42,6 +43,7 @@ public class AdminGetUsersActivity extends BaseActivity implements BottomSheetLi
|
||||
|
||||
activityAdminGetUsersBinding = ActivityAdminGetUsersBinding.inflate(getLayoutInflater());
|
||||
setContentView(activityAdminGetUsersBinding.getRoot());
|
||||
adminGetUsersViewModel = new ViewModelProvider(this).get(AdminGetUsersViewModel.class);
|
||||
|
||||
Toolbar toolbar = activityAdminGetUsersBinding.toolbar;
|
||||
setSupportActionBar(toolbar);
|
||||
@ -49,6 +51,8 @@ public class AdminGetUsersActivity extends BaseActivity implements BottomSheetLi
|
||||
initCloseListener();
|
||||
activityAdminGetUsersBinding.close.setOnClickListener(onClickListener);
|
||||
|
||||
resultLimit = Constants.getCurrentResultLimit(ctx);
|
||||
|
||||
activityAdminGetUsersBinding.recyclerView.setHasFixedSize(true);
|
||||
activityAdminGetUsersBinding.recyclerView.setLayoutManager(new LinearLayoutManager(ctx));
|
||||
DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(activityAdminGetUsersBinding.recyclerView.getContext(),
|
||||
@ -79,7 +83,7 @@ public class AdminGetUsersActivity extends BaseActivity implements BottomSheetLi
|
||||
public void onLoadMore() {
|
||||
|
||||
page += 1;
|
||||
AdminGetUsersViewModel.loadMoreUsersList(page, resultLimit, ctx, adapter);
|
||||
adminGetUsersViewModel.loadMoreUsersList(page, resultLimit, ctx, adapter);
|
||||
activityAdminGetUsersBinding.progressBar.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
|
@ -42,7 +42,7 @@ public class CommitsActivity extends BaseActivity {
|
||||
private TextView noData;
|
||||
private ProgressBar progressBar;
|
||||
private final String TAG = "CommitsActivity";
|
||||
private int resultLimit = Constants.resultLimitOldGiteaInstances;
|
||||
private int resultLimit;
|
||||
private int pageSize = 1;
|
||||
|
||||
private RecyclerView recyclerView;
|
||||
@ -80,11 +80,7 @@ public class CommitsActivity extends BaseActivity {
|
||||
initCloseListener();
|
||||
closeActivity.setOnClickListener(onClickListener);
|
||||
|
||||
// if gitea is 1.12 or higher use the new limit (resultLimitNewGiteaInstances)
|
||||
if(getAccount().requiresVersion("1.12")) {
|
||||
|
||||
resultLimit = Constants.resultLimitNewGiteaInstances;
|
||||
}
|
||||
resultLimit = Constants.getCurrentResultLimit(ctx);
|
||||
|
||||
recyclerView = activityCommitsBinding.recyclerView;
|
||||
commitsList = new ArrayList<>();
|
||||
|
@ -53,7 +53,7 @@ public class CreateIssueActivity extends BaseActivity implements View.OnClickLis
|
||||
private CustomLabelsSelectionDialogBinding labelsBinding;
|
||||
private CustomAssigneesSelectionDialogBinding assigneesBinding;
|
||||
private View.OnClickListener onClickListener;
|
||||
private int resultLimit = Constants.resultLimitOldGiteaInstances;
|
||||
private int resultLimit;
|
||||
private Dialog dialogLabels;
|
||||
private Dialog dialogAssignees;
|
||||
private String labelsSetter;
|
||||
@ -87,11 +87,7 @@ public class CreateIssueActivity extends BaseActivity implements View.OnClickLis
|
||||
|
||||
repository = RepositoryContext.fromIntent(getIntent());
|
||||
|
||||
// require gitea 1.12 or higher
|
||||
if(getAccount().requiresVersion("1.12.0")) {
|
||||
|
||||
resultLimit = Constants.resultLimitNewGiteaInstances;
|
||||
}
|
||||
resultLimit = Constants.getCurrentResultLimit(ctx);
|
||||
|
||||
viewBinding.newIssueTitle.requestFocus();
|
||||
assert imm != null;
|
||||
|
@ -12,6 +12,7 @@ import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
import com.pes.androidmaterialcolorpickerdialog.ColorPicker;
|
||||
import org.gitnex.tea4j.v2.models.CreateLabelOption;
|
||||
import org.gitnex.tea4j.v2.models.EditLabelOption;
|
||||
@ -30,13 +31,15 @@ import retrofit2.Call;
|
||||
import retrofit2.Callback;
|
||||
|
||||
/**
|
||||
* Author M M Arif
|
||||
* @author M M Arif
|
||||
*/
|
||||
|
||||
public class CreateLabelActivity extends BaseActivity {
|
||||
|
||||
public static boolean refreshLabels = false;
|
||||
|
||||
private OrganizationLabelsViewModel organizationLabelsViewModel;
|
||||
private LabelsViewModel labelsViewModel;
|
||||
private View.OnClickListener onClickListener;
|
||||
private TextView colorPicker;
|
||||
private EditText labelName;
|
||||
@ -53,6 +56,8 @@ public class CreateLabelActivity extends BaseActivity {
|
||||
|
||||
ActivityCreateLabelBinding activityCreateLabelBinding = ActivityCreateLabelBinding.inflate(getLayoutInflater());
|
||||
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);
|
||||
|
||||
@ -345,11 +350,11 @@ public class CreateLabelActivity extends BaseActivity {
|
||||
Toasty.success(ctx, getString(R.string.labelDeleteText));
|
||||
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 {
|
||||
|
||||
LabelsViewModel.loadLabelsList(repository.getOwner(), repository.getName(), ctx);
|
||||
labelsViewModel.loadLabelsList(repository.getOwner(), repository.getName(), ctx);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -45,7 +45,7 @@ public class CreatePullRequestActivity extends BaseActivity implements LabelsLis
|
||||
|
||||
private View.OnClickListener onClickListener;
|
||||
private ActivityCreatePrBinding viewBinding;
|
||||
private int resultLimit = Constants.resultLimitOldGiteaInstances;
|
||||
private int resultLimit;
|
||||
private Dialog dialogLabels;
|
||||
private List<Integer> labelsIds = new ArrayList<>();
|
||||
private final List<String> assignees = new ArrayList<>();
|
||||
@ -71,11 +71,7 @@ public class CreatePullRequestActivity extends BaseActivity implements LabelsLis
|
||||
|
||||
repository = RepositoryContext.fromIntent(getIntent());
|
||||
|
||||
// require gitea 1.12 or higher
|
||||
if(getAccount().requiresVersion("1.12.0")) {
|
||||
|
||||
resultLimit = Constants.resultLimitNewGiteaInstances;
|
||||
}
|
||||
resultLimit = Constants.getCurrentResultLimit(ctx);
|
||||
|
||||
viewBinding.prBody.setOnTouchListener((touchView, motionEvent) -> {
|
||||
|
||||
|
@ -111,7 +111,6 @@ public class CreateReleaseActivity extends BaseActivity {
|
||||
}
|
||||
|
||||
createNewTag.setOnClickListener(v -> 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) {
|
||||
|
||||
if (response.code() == 201) {
|
||||
|
||||
Intent result = new Intent();
|
||||
result.putExtra("updateReleases", true);
|
||||
setResult(201, result);
|
||||
Toasty.success(ctx, getString(R.string.tagCreated));
|
||||
finish();
|
||||
}
|
||||
|
@ -49,7 +49,7 @@ import retrofit2.Callback;
|
||||
public class EditIssueActivity extends BaseActivity implements View.OnClickListener {
|
||||
|
||||
private View.OnClickListener onClickListener;
|
||||
private int resultLimit = Constants.resultLimitOldGiteaInstances;
|
||||
private int resultLimit;
|
||||
|
||||
private EditText editIssueTitle;
|
||||
private EditText editIssueDescription;
|
||||
@ -76,6 +76,7 @@ public class EditIssueActivity extends BaseActivity implements View.OnClickListe
|
||||
|
||||
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||
|
||||
resultLimit = Constants.getCurrentResultLimit(ctx);
|
||||
issue = IssueContext.fromIntent(getIntent());
|
||||
|
||||
ImageView closeActivity = activityEditIssueBinding.close;
|
||||
@ -85,12 +86,6 @@ public class EditIssueActivity extends BaseActivity implements View.OnClickListe
|
||||
editIssueDescription = activityEditIssueBinding.editIssueDescription;
|
||||
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();
|
||||
assert imm != null;
|
||||
imm.showSoftInput(editIssueTitle, InputMethodManager.SHOW_IMPLICIT);
|
||||
|
@ -20,9 +20,11 @@ import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.ScrollView;
|
||||
import android.widget.TextView;
|
||||
import androidx.activity.result.ActivityResultLauncher;
|
||||
import androidx.activity.result.contract.ActivityResultContracts;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.core.content.res.ResourcesCompat;
|
||||
import androidx.core.text.HtmlCompat;
|
||||
@ -440,6 +442,9 @@ public class IssueDetailActivity extends BaseActivity implements LabelsListAdapt
|
||||
|
||||
MenuInflater inflater = getMenuInflater();
|
||||
inflater.inflate(R.menu.generic_nav_dotted_menu, menu);
|
||||
if(issue.getIssueType().equalsIgnoreCase("pull")) {
|
||||
inflater.inflate(R.menu.pr_info_menu, menu);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -466,6 +471,24 @@ public class IssueDetailActivity extends BaseActivity implements LabelsListAdapt
|
||||
}
|
||||
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 {
|
||||
|
||||
return super.onOptionsItemSelected(item);
|
||||
@ -780,7 +803,7 @@ public class IssueDetailActivity extends BaseActivity implements LabelsListAdapt
|
||||
}
|
||||
else {
|
||||
|
||||
viewBinding.issueDueDate.setVisibility(View.GONE);
|
||||
viewBinding.dueDateFrame.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
String edited;
|
||||
@ -847,12 +870,12 @@ public class IssueDetailActivity extends BaseActivity implements LabelsListAdapt
|
||||
|
||||
if(issue.getIssue().getMilestone() != null) {
|
||||
|
||||
viewBinding.issueMilestone.setVisibility(View.VISIBLE);
|
||||
viewBinding.issueMilestone.setText(getString(R.string.issueMilestone, issue.getIssue().getMilestone().getTitle()));
|
||||
viewBinding.milestoneFrame.setVisibility(View.VISIBLE);
|
||||
viewBinding.issueMilestone.setText(issue.getIssue().getMilestone().getTitle());
|
||||
}
|
||||
else {
|
||||
|
||||
viewBinding.issueMilestone.setVisibility(View.GONE);
|
||||
viewBinding.milestoneFrame.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
/*if(!issue.getIssue().getUser().getFull_name().equals("")) {
|
||||
|
@ -12,6 +12,7 @@ import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import org.gitnex.tea4j.v2.models.AccessToken;
|
||||
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.User;
|
||||
import org.mian.gitnex.R;
|
||||
@ -53,6 +54,8 @@ public class LoginActivity extends BaseActivity {
|
||||
|
||||
private URI instanceUrl;
|
||||
private Version giteaVersion;
|
||||
private int maxResponseItems = 50;
|
||||
private int defaultPagingNumber = 25;
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
@ -195,6 +198,7 @@ public class LoginActivity extends BaseActivity {
|
||||
}
|
||||
|
||||
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,
|
||||
final LoginType loginType) {
|
||||
|
||||
@ -333,7 +362,7 @@ public class LoginActivity extends BaseActivity {
|
||||
boolean userAccountExists = userAccountsApi.userAccountExists(accountName);
|
||||
UserAccount account;
|
||||
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);
|
||||
}
|
||||
else {
|
||||
@ -515,7 +544,7 @@ public class LoginActivity extends BaseActivity {
|
||||
if(!userAccountExists) {
|
||||
long accountId = userAccountsApi
|
||||
.createNewAccount(accountName, instanceUrl.toString(), userDetails.getLogin(), newToken.getSha1(),
|
||||
giteaVersion.toString());
|
||||
giteaVersion.toString(), maxResponseItems, defaultPagingNumber);
|
||||
account = userAccountsApi.getAccountById((int) accountId);
|
||||
}
|
||||
else {
|
||||
|
@ -5,7 +5,6 @@ import android.graphics.Typeface;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.text.Html;
|
||||
import android.util.Log;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
@ -23,6 +22,7 @@ import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
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.ServerVersion;
|
||||
import org.gitnex.tea4j.v2.models.User;
|
||||
@ -439,9 +439,9 @@ public class MainActivity extends BaseActivity implements NavigationView.OnNavig
|
||||
|
||||
loadUserInfo();
|
||||
giteaVersion();
|
||||
serverPageLimitSettings();
|
||||
noConnection = false;
|
||||
}
|
||||
Log.e("Network status is: ", String.valueOf(connToInternet));
|
||||
}, 1500);
|
||||
|
||||
// Changelog popup
|
||||
@ -520,6 +520,11 @@ public class MainActivity extends BaseActivity implements NavigationView.OnNavig
|
||||
getFragmentRefreshListener().onRefresh("closed");
|
||||
}
|
||||
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);
|
||||
}
|
||||
|
||||
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() {
|
||||
|
||||
Call<ServerVersion> callVersion = RetrofitClient.getApiInterface(ctx).getVersion();
|
||||
callVersion.enqueue(new Callback<ServerVersion>() {
|
||||
callVersion.enqueue(new Callback<>() {
|
||||
|
||||
@Override
|
||||
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
|
||||
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() {
|
||||
Call<User> call = RetrofitClient.getApiInterface(ctx).userGetCurrent();
|
||||
|
||||
call.enqueue(new Callback<User>() {
|
||||
call.enqueue(new Callback<>() {
|
||||
|
||||
@Override
|
||||
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())) {
|
||||
// user changed it's name -> update database
|
||||
int accountId = getAccount().getAccount().getAccountId();
|
||||
BaseApi.getInstance(MainActivity.this, UserAccountsApi.class).updateUsername(accountId,
|
||||
userDetails.getLogin());
|
||||
BaseApi.getInstance(MainActivity.this, UserAccountsApi.class).updateUsername(accountId, userDetails.getLogin());
|
||||
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) {
|
||||
|
||||
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 {
|
||||
|
||||
@ -691,8 +727,6 @@ public class MainActivity extends BaseActivity implements NavigationView.OnNavig
|
||||
|
||||
@Override
|
||||
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
|
||||
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;
|
||||
}
|
||||
|
||||
// My issues-open-close interface
|
||||
// My issues interface
|
||||
public FragmentRefreshListener getFragmentRefreshListener() { return fragmentRefreshListenerMyIssues; }
|
||||
public void setFragmentRefreshListenerMyIssues(FragmentRefreshListener fragmentRefreshListener) { this.fragmentRefreshListenerMyIssues = fragmentRefreshListener; }
|
||||
}
|
||||
|
@ -1,8 +1,5 @@
|
||||
package org.mian.gitnex.activities;
|
||||
|
||||
import android.content.ClipData;
|
||||
import android.content.ClipboardManager;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Typeface;
|
||||
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.RepositoriesByOrgFragment;
|
||||
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 java.util.Objects;
|
||||
import io.mikael.urlbuilder.UrlBuilder;
|
||||
@ -38,7 +35,7 @@ import retrofit2.Callback;
|
||||
import retrofit2.Response;
|
||||
|
||||
/**
|
||||
* Author M M Arif
|
||||
* @author M M Arif
|
||||
*/
|
||||
|
||||
public class OrganizationDetailActivity extends BaseActivity implements BottomSheetListener {
|
||||
@ -200,6 +197,11 @@ public class OrganizationDetailActivity extends BaseActivity implements BottomSh
|
||||
@Override
|
||||
public void onButtonClicked(String text) {
|
||||
|
||||
String url = UrlBuilder.fromString(getAccount().getAccount().getInstanceUrl())
|
||||
.withPath("/")
|
||||
.toString();
|
||||
url = url + getIntent().getStringExtra("orgName");
|
||||
|
||||
switch (text) {
|
||||
case "repository":
|
||||
Intent intentRepo = new Intent(this, CreateRepoActivity.class);
|
||||
@ -221,15 +223,13 @@ public class OrganizationDetailActivity extends BaseActivity implements BottomSh
|
||||
startActivity(intentTeam);
|
||||
break;
|
||||
case "copyOrgUrl":
|
||||
|
||||
String url = UrlBuilder.fromString(getAccount().getAccount().getInstanceUrl())
|
||||
.withPath("/")
|
||||
.toString();
|
||||
ClipboardManager clipboard = (ClipboardManager) Objects.requireNonNull(ctx).getSystemService(Context.CLIPBOARD_SERVICE);
|
||||
ClipData clip = ClipData.newPlainText("orgUrl", url + getIntent().getStringExtra("orgName"));
|
||||
assert clipboard != null;
|
||||
clipboard.setPrimaryClip(clip);
|
||||
Toasty.info(ctx, ctx.getString(R.string.copyIssueUrlToastMsg));
|
||||
AppUtil.copyToClipboard(this, url, ctx.getString(R.string.copyIssueUrlToastMsg));
|
||||
break;
|
||||
case "share":
|
||||
AppUtil.sharingIntent(this, url);
|
||||
break;
|
||||
case "open":
|
||||
AppUtil.openUrlInBrowser(this, url);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -2,9 +2,6 @@ package org.mian.gitnex.activities;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.Dialog;
|
||||
import android.content.ClipData;
|
||||
import android.content.ClipboardManager;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.res.ColorStateList;
|
||||
import android.graphics.Typeface;
|
||||
@ -279,20 +276,10 @@ public class RepoDetailActivity extends BaseActivity implements BottomSheetListe
|
||||
AppUtil.openUrlInBrowser(this, repository.getRepository().getHtmlUrl());
|
||||
break;
|
||||
case "shareRepo":
|
||||
|
||||
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()));
|
||||
AppUtil.sharingIntent(this, repository.getRepository().getHtmlUrl());
|
||||
break;
|
||||
case "copyRepoUrl":
|
||||
|
||||
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));
|
||||
AppUtil.copyToClipboard(this, repository.getRepository().getHtmlUrl(), ctx.getString(R.string.copyIssueUrlToastMsg));
|
||||
break;
|
||||
case "newFile":
|
||||
|
||||
|
@ -42,7 +42,7 @@ public class RepoForksActivity extends BaseActivity {
|
||||
private TextView noData;
|
||||
private ProgressBar progressBar;
|
||||
private final String TAG = "RepositoryForks";
|
||||
private int resultLimit = Constants.resultLimitOldGiteaInstances;
|
||||
private int resultLimit;
|
||||
private int pageSize = 1;
|
||||
|
||||
private RecyclerView recyclerView;
|
||||
@ -78,11 +78,7 @@ public class RepoForksActivity extends BaseActivity {
|
||||
|
||||
closeActivity.setOnClickListener(v -> finish());
|
||||
|
||||
// if gitea is 1.12 or higher use the new limit (resultLimitNewGiteaInstances)
|
||||
if(getAccount().requiresVersion("1.12")) {
|
||||
|
||||
resultLimit = Constants.resultLimitNewGiteaInstances;
|
||||
}
|
||||
resultLimit = Constants.getCurrentResultLimit(ctx);
|
||||
|
||||
recyclerView = activityRepoForksBinding.recyclerView;
|
||||
forksList = new ArrayList<>();
|
||||
|
@ -43,7 +43,7 @@ import retrofit2.Call;
|
||||
import retrofit2.Callback;
|
||||
|
||||
/**
|
||||
* Author M M Arif
|
||||
* @author M M Arif
|
||||
*/
|
||||
|
||||
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 commentMenuDelete = vw.findViewById(R.id.commentMenuDelete);
|
||||
TextView issueCommentCopyUrl = vw.findViewById(R.id.issueCommentCopyUrl);
|
||||
TextView open = vw.findViewById(R.id.open);
|
||||
LinearLayout linearLayout = vw.findViewById(R.id.commentReactionButtons);
|
||||
|
||||
if(issue.getRepository().getRepository().isArchived()) {
|
||||
@ -161,32 +162,21 @@ public class IssueCommentsAdapter extends RecyclerView.Adapter<IssueCommentsAdap
|
||||
});
|
||||
|
||||
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();
|
||||
});
|
||||
|
||||
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();
|
||||
Toasty.success(context, context.getString(R.string.copyIssueUrlToastMsg));
|
||||
});
|
||||
|
||||
commentMenuQuote.setOnClickListener(v1 -> {
|
||||
|
@ -10,32 +10,38 @@ import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.core.text.HtmlCompat;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import com.google.android.material.bottomsheet.BottomSheetDialog;
|
||||
import org.gitnex.tea4j.v2.models.Tag;
|
||||
import org.mian.gitnex.R;
|
||||
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.Toasty;
|
||||
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> {
|
||||
|
||||
private List<Tag> tags;
|
||||
private final Context context;
|
||||
private final String repo;
|
||||
private final String owner;
|
||||
private static String repo;
|
||||
private static String owner;
|
||||
|
||||
private OnLoadMoreListener loadMoreListener;
|
||||
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 tagBody;
|
||||
private final LinearLayout downloadFrame;
|
||||
@ -57,6 +63,24 @@ public class TagsAdapter extends RecyclerView.Adapter<TagsAdapter.TagsViewHolder
|
||||
releaseTarDownload = itemView.findViewById(R.id.releaseTarDownload);
|
||||
downloadDropdownIcon = itemView.findViewById(R.id.downloadDropdownIcon);
|
||||
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) {
|
||||
|
||||
Tag currentItem = tags.get(position);
|
||||
holder.tagsHolder = currentItem;
|
||||
|
||||
holder.tagName.setText(currentItem.getName());
|
||||
|
||||
@ -106,24 +131,6 @@ public class TagsAdapter extends RecyclerView.Adapter<TagsAdapter.TagsViewHolder
|
||||
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(
|
||||
HtmlCompat.fromHtml("<a href='" + currentItem.getZipballUrl() + "'>" + context.getResources().getString(R.string.zipArchiveDownloadReleasesTab) + "</a> ", HtmlCompat.FROM_HTML_MODE_LEGACY));
|
||||
holder.releaseZipDownload.setMovementMethod(LinkMovementMethod.getInstance());
|
||||
@ -150,6 +157,7 @@ public class TagsAdapter extends RecyclerView.Adapter<TagsAdapter.TagsViewHolder
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressLint("NotifyDataSetChanged")
|
||||
public void notifyDataChanged() {
|
||||
notifyDataSetChanged();
|
||||
isLoading = false;
|
||||
@ -170,4 +178,45 @@ public class TagsAdapter extends RecyclerView.Adapter<TagsAdapter.TagsViewHolder
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
@ -46,7 +46,7 @@ import retrofit2.converter.gson.GsonConverterFactory;
|
||||
import retrofit2.converter.scalars.ScalarsConverterFactory;
|
||||
|
||||
/**
|
||||
* Author M M Arif
|
||||
* @author M M Arif
|
||||
*/
|
||||
|
||||
public class RetrofitClient {
|
||||
|
@ -8,7 +8,7 @@ import org.mian.gitnex.database.models.DraftWithRepository;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Author M M Arif
|
||||
* @author M M Arif
|
||||
*/
|
||||
|
||||
public class DraftsApi extends BaseApi {
|
||||
|
@ -7,7 +7,7 @@ import org.mian.gitnex.database.models.Repository;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Author M M Arif
|
||||
* @author M M Arif
|
||||
*/
|
||||
|
||||
public class RepositoriesApi extends BaseApi {
|
||||
|
@ -7,7 +7,7 @@ import org.mian.gitnex.database.models.UserAccount;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Author M M Arif
|
||||
* @author M M Arif
|
||||
*/
|
||||
|
||||
public class UserAccountsApi extends BaseApi {
|
||||
@ -19,7 +19,7 @@ public class UserAccountsApi extends BaseApi {
|
||||
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.setAccountName(accountName);
|
||||
@ -28,6 +28,8 @@ public class UserAccountsApi extends BaseApi {
|
||||
userAccount.setToken(token);
|
||||
userAccount.setServerVersion(serverVersion);
|
||||
userAccount.setLoggedIn(true);
|
||||
userAccount.setMaxResponseItems(maxResponseItems);
|
||||
userAccount.setDefaultPagingNumber(defaultPagingNumber);
|
||||
|
||||
return userAccountsDao.createAccount(userAccount);
|
||||
|
||||
@ -37,6 +39,10 @@ public class UserAccountsApi extends BaseApi {
|
||||
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) {
|
||||
executorService.execute(() -> userAccountsDao.updateAccountToken(accountId, token));
|
||||
}
|
||||
|
@ -9,7 +9,7 @@ import org.mian.gitnex.database.models.DraftWithRepository;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Author M M Arif
|
||||
* @author M M Arif
|
||||
*/
|
||||
|
||||
@Dao
|
||||
|
@ -8,7 +8,7 @@ import org.mian.gitnex.database.models.Repository;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Author M M Arif
|
||||
* @author M M Arif
|
||||
*/
|
||||
|
||||
@Dao
|
||||
|
@ -8,7 +8,7 @@ import org.mian.gitnex.database.models.UserAccount;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Author M M Arif
|
||||
* @author M M Arif
|
||||
*/
|
||||
|
||||
@Dao
|
||||
@ -44,6 +44,9 @@ public interface UserAccountsDao {
|
||||
@Query("UPDATE UserAccounts SET serverVersion = :serverVersion WHERE accountId = :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")
|
||||
void updateAccountName(String accountName, int accountId);
|
||||
|
||||
|
@ -15,11 +15,11 @@ import org.mian.gitnex.database.models.Repository;
|
||||
import org.mian.gitnex.database.models.UserAccount;
|
||||
|
||||
/**
|
||||
* Author M M Arif
|
||||
* @author M M Arif
|
||||
*/
|
||||
|
||||
@Database(entities = {Draft.class, Repository.class, UserAccount.class},
|
||||
version = 4, exportSchema = false)
|
||||
version = 5, exportSchema = false)
|
||||
public abstract class GitnexDatabase extends RoomDatabase {
|
||||
|
||||
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) {
|
||||
|
||||
if (gitnexDatabase == null) {
|
||||
@ -61,7 +70,7 @@ public abstract class GitnexDatabase extends RoomDatabase {
|
||||
gitnexDatabase = Room.databaseBuilder(context, GitnexDatabase.class, DB_NAME)
|
||||
// .fallbackToDestructiveMigration()
|
||||
.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();
|
||||
|
||||
}
|
||||
|
@ -9,7 +9,7 @@ import java.io.Serializable;
|
||||
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")})
|
||||
|
@ -1,7 +1,7 @@
|
||||
package org.mian.gitnex.database.models;
|
||||
|
||||
/**
|
||||
* Author M M Arif
|
||||
* @author M M Arif
|
||||
*/
|
||||
|
||||
public class DraftWithRepository {
|
||||
|
@ -8,7 +8,7 @@ import java.io.Serializable;
|
||||
import static androidx.room.ForeignKey.CASCADE;
|
||||
|
||||
/**
|
||||
* Author M M Arif
|
||||
* @author M M Arif
|
||||
*/
|
||||
|
||||
@Entity(tableName = "Repositories", foreignKeys = @ForeignKey(entity = UserAccount.class,
|
||||
|
@ -6,7 +6,7 @@ import androidx.room.PrimaryKey;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* Author M M Arif
|
||||
* @author M M Arif
|
||||
*/
|
||||
|
||||
@Entity(tableName = "userAccounts")
|
||||
@ -23,6 +23,8 @@ public class UserAccount implements Serializable {
|
||||
@Nullable
|
||||
private String serverVersion;
|
||||
private boolean isLoggedIn;
|
||||
private int maxResponseItems;
|
||||
private int defaultPagingNumber;
|
||||
|
||||
public int getAccountId() {
|
||||
return accountId;
|
||||
@ -82,4 +84,20 @@ public class UserAccount implements Serializable {
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -35,6 +35,11 @@ public class BottomSheetMyIssuesFilterFragment extends BottomSheetDialogFragment
|
||||
dismiss();
|
||||
});
|
||||
|
||||
bottomSheetIssuesFilterBinding.assignedToMe.setOnClickListener(v12 -> {
|
||||
bmListener.onButtonClicked("assignedToMe");
|
||||
dismiss();
|
||||
});
|
||||
|
||||
return bottomSheetIssuesFilterBinding.getRoot();
|
||||
}
|
||||
|
||||
|
@ -13,7 +13,7 @@ import org.mian.gitnex.databinding.BottomSheetOrganizationBinding;
|
||||
import org.mian.gitnex.structs.BottomSheetListener;
|
||||
|
||||
/**
|
||||
* Author M M Arif
|
||||
* @author M M Arif
|
||||
*/
|
||||
|
||||
public class BottomSheetOrganizationFragment extends BottomSheetDialogFragment {
|
||||
@ -40,7 +40,7 @@ public class BottomSheetOrganizationFragment extends BottomSheetDialogFragment {
|
||||
bottomSheetOrganizationBinding.createTeam.setVisibility(View.GONE);
|
||||
}
|
||||
if(!permissions.isCanCreateRepository() || !permissions.isIsOwner()) {
|
||||
bottomSheetOrganizationBinding.orgCreate.setVisibility(View.GONE);
|
||||
bottomSheetOrganizationBinding.organizationHeadFrame.setVisibility(View.GONE);
|
||||
bottomSheetOrganizationBinding.orgCreateSection.setVisibility(View.GONE);
|
||||
bottomSheetOrganizationBinding.orgDivider.setVisibility(View.GONE);
|
||||
}
|
||||
@ -70,6 +70,18 @@ public class BottomSheetOrganizationFragment extends BottomSheetDialogFragment {
|
||||
dismiss();
|
||||
});
|
||||
|
||||
bottomSheetOrganizationBinding.share.setOnClickListener(v1 -> {
|
||||
|
||||
bmListener.onButtonClicked("share");
|
||||
dismiss();
|
||||
});
|
||||
|
||||
bottomSheetOrganizationBinding.open.setOnClickListener(v1 -> {
|
||||
|
||||
bmListener.onButtonClicked("open");
|
||||
dismiss();
|
||||
});
|
||||
|
||||
return bottomSheetOrganizationBinding.getRoot();
|
||||
}
|
||||
|
||||
|
@ -1,9 +1,6 @@
|
||||
package org.mian.gitnex.fragments;
|
||||
|
||||
import android.content.ClipData;
|
||||
import android.content.ClipboardManager;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.view.Gravity;
|
||||
import android.view.LayoutInflater;
|
||||
@ -23,7 +20,7 @@ import org.mian.gitnex.activities.IssueDetailActivity;
|
||||
import org.mian.gitnex.activities.MergePullRequestActivity;
|
||||
import org.mian.gitnex.databinding.BottomSheetSingleIssueBinding;
|
||||
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.structs.BottomSheetListener;
|
||||
import org.mian.gitnex.views.ReactionSpinner;
|
||||
@ -84,9 +81,7 @@ public class BottomSheetSingleIssueFragment extends BottomSheetDialogFragment {
|
||||
|
||||
if(issue.getIssueType().equalsIgnoreCase("Pull")) {
|
||||
|
||||
binding.editIssue.setText(R.string.editPrText);
|
||||
binding.copyIssueUrl.setText(R.string.copyPrUrlText);
|
||||
binding.shareIssue.setText(R.string.sharePr);
|
||||
binding.editIssue.setText(R.string.menuEditText);
|
||||
|
||||
boolean canPushPullSource = issue.getPullRequest().getHead().getRepo().getPermissions().isPush();
|
||||
if(issue.getPullRequest().isMerged() || issue.getIssue().getState().equals("closed")) {
|
||||
@ -176,35 +171,32 @@ public class BottomSheetSingleIssueFragment extends BottomSheetDialogFragment {
|
||||
|
||||
binding.shareIssue.setOnClickListener(v1 -> {
|
||||
|
||||
Intent sharingIntent = new Intent(android.content.Intent.ACTION_SEND);
|
||||
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()));
|
||||
|
||||
AppUtil.sharingIntent(ctx, issue.getIssue().getHtmlUrl());
|
||||
dismiss();
|
||||
});
|
||||
|
||||
binding.copyIssueUrl.setOnClickListener(v12 -> {
|
||||
|
||||
// copy to clipboard
|
||||
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));
|
||||
|
||||
AppUtil.copyToClipboard(ctx, issue.getIssue().getHtmlUrl(), ctx.getString(R.string.copyIssueUrlToastMsg));
|
||||
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(!userIsCreator && !canPush) {
|
||||
binding.closeIssue.setVisibility(View.GONE);
|
||||
binding.dividerCloseReopenIssue.setVisibility(View.GONE);
|
||||
}
|
||||
else if(issue.getIssueType().equalsIgnoreCase("Pull")) {
|
||||
binding.closeIssue.setText(R.string.closePr);
|
||||
binding.closeIssue.setText(R.string.close);
|
||||
}
|
||||
binding.closeIssue.setOnClickListener(closeSingleIssue -> {
|
||||
IssueActions.closeReopenIssue(ctx, "closed", issue);
|
||||
@ -213,16 +205,10 @@ public class BottomSheetSingleIssueFragment extends BottomSheetDialogFragment {
|
||||
}
|
||||
else if(issue.getIssue().getState().equals("closed")) {
|
||||
if(userIsCreator || canPush) {
|
||||
if(issue.getIssueType().equalsIgnoreCase("Pull")) {
|
||||
binding.closeIssue.setText(R.string.reopenPr);
|
||||
}
|
||||
else {
|
||||
binding.closeIssue.setText(R.string.reOpenIssue);
|
||||
}
|
||||
binding.closeIssue.setText(R.string.reopen);
|
||||
}
|
||||
else {
|
||||
binding.closeIssue.setVisibility(View.GONE);
|
||||
binding.dividerCloseReopenIssue.setVisibility(View.GONE);
|
||||
}
|
||||
binding.closeIssue.setOnClickListener(closeSingleIssue -> {
|
||||
IssueActions.closeReopenIssue(ctx, "open", issue);
|
||||
@ -259,10 +245,15 @@ public class BottomSheetSingleIssueFragment extends BottomSheetDialogFragment {
|
||||
binding.editIssue.setVisibility(View.GONE);
|
||||
binding.editLabels.setVisibility(View.GONE);
|
||||
binding.closeIssue.setVisibility(View.GONE);
|
||||
binding.dividerCloseReopenIssue.setVisibility(View.GONE);
|
||||
binding.addRemoveAssignees.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) {
|
||||
binding.addRemoveAssignees.setVisibility(View.GONE);
|
||||
|
@ -26,6 +26,7 @@ import org.mian.gitnex.viewmodels.IssuesViewModel;
|
||||
|
||||
public class ExploreIssuesFragment extends Fragment {
|
||||
|
||||
private IssuesViewModel issuesViewModel;
|
||||
private FragmentSearchIssuesBinding viewBinding;
|
||||
private ExploreIssuesAdapter adapter;
|
||||
private int page = 1;
|
||||
@ -35,6 +36,7 @@ public class ExploreIssuesFragment extends Fragment {
|
||||
|
||||
viewBinding = FragmentSearchIssuesBinding.inflate(inflater, container, false);
|
||||
setHasOptionsMenu(true);
|
||||
issuesViewModel = new ViewModelProvider(this).get(IssuesViewModel.class);
|
||||
|
||||
viewBinding.pullToRefresh.setOnRefreshListener(() -> new Handler(Looper.getMainLooper()).postDelayed(() -> {
|
||||
|
||||
@ -55,9 +57,7 @@ public class ExploreIssuesFragment extends Fragment {
|
||||
|
||||
private void fetchDataAsync(String searchKeyword) {
|
||||
|
||||
IssuesViewModel issuesModel = new ViewModelProvider(this).get(IssuesViewModel.class);
|
||||
|
||||
issuesModel.getIssuesList(searchKeyword, "issues", null, "open", getContext()).observe(getViewLifecycleOwner(), issuesListMain -> {
|
||||
issuesViewModel.getIssuesList(searchKeyword, "issues", null, "open", null, getContext()).observe(getViewLifecycleOwner(), issuesListMain -> {
|
||||
|
||||
adapter = new ExploreIssuesAdapter(issuesListMain, getContext());
|
||||
adapter.setLoadMoreListener(new ExploreIssuesAdapter.OnLoadMoreListener() {
|
||||
@ -66,7 +66,7 @@ public class ExploreIssuesFragment extends Fragment {
|
||||
public void onLoadMore() {
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
|
@ -101,7 +101,7 @@ public class ExploreRepositoriesFragment extends Fragment {
|
||||
|
||||
Call<SearchResults> call = RetrofitClient
|
||||
.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<>() {
|
||||
@Override
|
||||
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);
|
||||
Call<SearchResults> call = RetrofitClient.getApiInterface(context)
|
||||
.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<>() {
|
||||
@Override
|
||||
|
@ -83,7 +83,7 @@ public class ExploreUsersFragment extends Fragment {
|
||||
private void loadInitial(String searchKeyword, int resultLimit) {
|
||||
|
||||
Call<InlineResponse2001> call = RetrofitClient
|
||||
.getApiInterface(context).userSearch(searchKeyword, null, resultLimit, 1);
|
||||
.getApiInterface(context).userSearch(searchKeyword, null, 1, resultLimit);
|
||||
call.enqueue(new Callback<>() {
|
||||
@Override
|
||||
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) {
|
||||
|
||||
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<>() {
|
||||
@Override
|
||||
public void onResponse(@NonNull Call<InlineResponse2001> call, @NonNull Response<InlineResponse2001> response) {
|
||||
|
@ -4,7 +4,6 @@ import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuInflater;
|
||||
@ -19,13 +18,13 @@ import androidx.recyclerview.widget.DividerItemDecoration;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import org.gitnex.tea4j.v2.models.Issue;
|
||||
import org.mian.gitnex.R;
|
||||
import org.mian.gitnex.activities.BaseActivity;
|
||||
import org.mian.gitnex.activities.RepoDetailActivity;
|
||||
import org.mian.gitnex.adapters.IssuesAdapter;
|
||||
import org.mian.gitnex.clients.RetrofitClient;
|
||||
import org.mian.gitnex.databinding.FragmentIssuesBinding;
|
||||
import org.mian.gitnex.helpers.Constants;
|
||||
import org.mian.gitnex.helpers.SnackBar;
|
||||
import org.mian.gitnex.helpers.Toasty;
|
||||
import org.mian.gitnex.helpers.contexts.RepositoryContext;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@ -34,7 +33,7 @@ import retrofit2.Callback;
|
||||
import retrofit2.Response;
|
||||
|
||||
/**
|
||||
* Author M M Arif
|
||||
* @author M M Arif
|
||||
*/
|
||||
|
||||
public class IssuesFragment extends Fragment {
|
||||
@ -49,8 +48,7 @@ public class IssuesFragment extends Fragment {
|
||||
private IssuesAdapter adapter;
|
||||
|
||||
private int pageSize = Constants.issuesPageInit;
|
||||
private final String TAG = Constants.tagIssuesList;
|
||||
private int resultLimit = Constants.resultLimitOldGiteaInstances;
|
||||
private int resultLimit;
|
||||
private final String requestType = Constants.issuesRequestType;
|
||||
|
||||
private RepositoryContext repository;
|
||||
@ -71,16 +69,13 @@ public class IssuesFragment extends Fragment {
|
||||
|
||||
repository = RepositoryContext.fromBundle(requireArguments());
|
||||
|
||||
// if gitea is 1.12 or higher use the new limit
|
||||
if(((BaseActivity) requireActivity()).getAccount().requiresVersion("1.12.0")) {
|
||||
resultLimit = Constants.resultLimitNewGiteaInstances;
|
||||
}
|
||||
resultLimit = Constants.getCurrentResultLimit(context);
|
||||
|
||||
issuesList = new ArrayList<>();
|
||||
|
||||
fragmentIssuesBinding.pullToRefresh.setOnRefreshListener(() -> new Handler(Looper.getMainLooper()).postDelayed(() -> {
|
||||
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();
|
||||
}, 200));
|
||||
|
||||
@ -121,7 +116,7 @@ public class IssuesFragment extends Fragment {
|
||||
fragmentIssuesBinding.progressBar.setVisibility(View.VISIBLE);
|
||||
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);
|
||||
});
|
||||
|
||||
@ -141,11 +136,11 @@ public class IssuesFragment extends Fragment {
|
||||
fragmentIssuesBinding.progressBar.setVisibility(View.VISIBLE);
|
||||
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);
|
||||
});
|
||||
|
||||
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();
|
||||
}
|
||||
@ -154,17 +149,18 @@ public class IssuesFragment extends Fragment {
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
call.enqueue(new Callback<List<Issue>>() {
|
||||
call.enqueue(new Callback<>() {
|
||||
|
||||
@Override
|
||||
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);
|
||||
}
|
||||
else {
|
||||
Log.e(TAG, String.valueOf(response.code()));
|
||||
Toasty.error(context, getString(R.string.genericError));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
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,
|
||||
filterByMilestone, null, null, null, null, null, page, resultLimit);
|
||||
call.enqueue(new Callback<List<Issue>>() {
|
||||
call.enqueue(new Callback<>() {
|
||||
|
||||
@Override
|
||||
public void onResponse(@NonNull Call<List<Issue>> call, @NonNull Response<List<Issue>> response) {
|
||||
|
||||
if(response.code() == 200) {
|
||||
List<Issue> result = response.body();
|
||||
assert result != null;
|
||||
@ -224,13 +221,13 @@ public class IssuesFragment extends Fragment {
|
||||
fragmentIssuesBinding.progressBar.setVisibility(View.GONE);
|
||||
}
|
||||
else {
|
||||
Log.e(TAG, String.valueOf(response.code()));
|
||||
Toasty.error(context, getString(R.string.genericError));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
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
|
||||
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;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onQueryTextChange(String newText) {
|
||||
filter(newText);
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
@ -22,11 +22,12 @@ import org.mian.gitnex.helpers.contexts.RepositoryContext;
|
||||
import org.mian.gitnex.viewmodels.LabelsViewModel;
|
||||
|
||||
/**
|
||||
* Author M M Arif
|
||||
* @author M M Arif
|
||||
*/
|
||||
|
||||
public class LabelsFragment extends Fragment {
|
||||
|
||||
private LabelsViewModel labelsViewModel;
|
||||
private ProgressBar mProgressBar;
|
||||
private RecyclerView mRecyclerView;
|
||||
private LabelsAdapter adapter;
|
||||
@ -55,6 +56,7 @@ public class LabelsFragment extends Fragment {
|
||||
|
||||
FragmentLabelsBinding fragmentLabelsBinding = FragmentLabelsBinding.inflate(inflater, container, false);
|
||||
setHasOptionsMenu(true);
|
||||
labelsViewModel = new ViewModelProvider(this).get(LabelsViewModel.class);
|
||||
|
||||
final SwipeRefreshLayout swipeRefresh = fragmentLabelsBinding.pullToRefresh;
|
||||
noData = fragmentLabelsBinding.noData;
|
||||
@ -72,7 +74,7 @@ public class LabelsFragment extends Fragment {
|
||||
swipeRefresh.setOnRefreshListener(() -> new Handler(Looper.getMainLooper()).postDelayed(() -> {
|
||||
|
||||
swipeRefresh.setRefreshing(false);
|
||||
LabelsViewModel.loadLabelsList(repository.getOwner(), repository.getName(), getContext());
|
||||
labelsViewModel.loadLabelsList(repository.getOwner(), repository.getName(), getContext());
|
||||
}, 200));
|
||||
|
||||
fetchDataAsync(repository.getOwner(), repository.getName());
|
||||
@ -87,7 +89,7 @@ public class LabelsFragment extends Fragment {
|
||||
|
||||
if(CreateLabelActivity.refreshLabels) {
|
||||
|
||||
LabelsViewModel.loadLabelsList(repository.getOwner(), repository.getName(), getContext());
|
||||
labelsViewModel.loadLabelsList(repository.getOwner(), repository.getName(), getContext());
|
||||
CreateLabelActivity.refreshLabels = false;
|
||||
}
|
||||
}
|
||||
|
@ -33,6 +33,7 @@ import java.util.List;
|
||||
|
||||
public class MilestonesFragment extends Fragment {
|
||||
|
||||
private MilestonesViewModel milestonesViewModel;
|
||||
private FragmentMilestonesBinding viewBinding;
|
||||
private Menu menu;
|
||||
private List<Milestone> dataList;
|
||||
@ -60,6 +61,7 @@ public class MilestonesFragment extends Fragment {
|
||||
viewBinding = FragmentMilestonesBinding.inflate(inflater, container, false);
|
||||
setHasOptionsMenu(true);
|
||||
Context ctx = getContext();
|
||||
milestonesViewModel = new ViewModelProvider(this).get(MilestonesViewModel.class);
|
||||
|
||||
milestoneId = requireActivity().getIntent().getStringExtra("milestoneId");
|
||||
requireActivity().getIntent().removeExtra("milestoneId");
|
||||
@ -106,8 +108,6 @@ public class MilestonesFragment extends Fragment {
|
||||
|
||||
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 -> {
|
||||
|
||||
adapter = new MilestonesAdapter(getContext(), milestonesListMain, repository);
|
||||
@ -117,7 +117,7 @@ public class MilestonesFragment extends Fragment {
|
||||
public void onLoadMore() {
|
||||
|
||||
page += 1;
|
||||
MilestonesViewModel.loadMoreMilestones(repoOwner, repoName, page, state, getContext(), adapter);
|
||||
milestonesViewModel.loadMoreMilestones(repoOwner, repoName, page, state, getContext(), adapter);
|
||||
viewBinding.progressBar.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
|
@ -27,17 +27,20 @@ import org.mian.gitnex.viewmodels.IssuesViewModel;
|
||||
|
||||
public class MyIssuesFragment extends Fragment {
|
||||
|
||||
private IssuesViewModel issuesViewModel;
|
||||
private FragmentIssuesBinding fragmentIssuesBinding;
|
||||
private ExploreIssuesAdapter adapter;
|
||||
private int page = 1;
|
||||
private Menu menu;
|
||||
public String state = "open";
|
||||
public boolean assignedToMe = false;
|
||||
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
|
||||
fragmentIssuesBinding = FragmentIssuesBinding.inflate(inflater, container, false);
|
||||
setHasOptionsMenu(true);
|
||||
issuesViewModel = new ViewModelProvider(this).get(IssuesViewModel.class);
|
||||
|
||||
fragmentIssuesBinding.recyclerView.setHasFixedSize(true);
|
||||
fragmentIssuesBinding.recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
|
||||
@ -45,40 +48,40 @@ public class MyIssuesFragment extends Fragment {
|
||||
DividerItemDecoration.VERTICAL);
|
||||
fragmentIssuesBinding.recyclerView.addItemDecoration(dividerItemDecoration);
|
||||
|
||||
((MainActivity) requireActivity()).setFragmentRefreshListenerMyIssues(myIssuesState -> {
|
||||
((MainActivity) requireActivity()).setFragmentRefreshListenerMyIssues(myIssues -> {
|
||||
|
||||
state = myIssuesState;
|
||||
if(myIssuesState.equals("open")) {
|
||||
menu.getItem(1).setIcon(R.drawable.ic_filter);
|
||||
}
|
||||
else {
|
||||
state = myIssues;
|
||||
if(state.equals("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.noDataIssues.setVisibility(View.GONE);
|
||||
|
||||
fetchDataAsync(null, myIssuesState);
|
||||
fetchDataAsync(null, state, assignedToMe);
|
||||
});
|
||||
|
||||
fragmentIssuesBinding.pullToRefresh.setOnRefreshListener(() -> new Handler(Looper.getMainLooper()).postDelayed(() -> {
|
||||
|
||||
page = 1;
|
||||
fragmentIssuesBinding.pullToRefresh.setRefreshing(false);
|
||||
IssuesViewModel.loadIssuesList(null, "issues", true, state, getContext());
|
||||
issuesViewModel.loadIssuesList(null, "issues", true, state, assignedToMe, getContext());
|
||||
fragmentIssuesBinding.progressBar.setVisibility(View.VISIBLE);
|
||||
}, 50));
|
||||
|
||||
fetchDataAsync(null, state);
|
||||
fetchDataAsync(null, state, assignedToMe);
|
||||
|
||||
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);
|
||||
|
||||
issuesModel.getIssuesList(query, "issues", true, state, getContext()).observe(getViewLifecycleOwner(), issuesListMain -> {
|
||||
issuesViewModel.getIssuesList(query, "issues", true, state, assignedToMe, getContext()).observe(getViewLifecycleOwner(), issuesListMain -> {
|
||||
|
||||
adapter = new ExploreIssuesAdapter(issuesListMain, getContext());
|
||||
adapter.setLoadMoreListener(new ExploreIssuesAdapter.OnLoadMoreListener() {
|
||||
@ -87,7 +90,7 @@ public class MyIssuesFragment extends Fragment {
|
||||
public void onLoadMore() {
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
@ -128,7 +131,7 @@ public class MyIssuesFragment extends Fragment {
|
||||
|
||||
@Override
|
||||
public boolean onQueryTextSubmit(String query) {
|
||||
fetchDataAsync(query, state);
|
||||
fetchDataAsync(query, state, assignedToMe);
|
||||
searchView.setQuery(null, false);
|
||||
searchItem.collapseActionView();
|
||||
return false;
|
||||
|
@ -20,11 +20,12 @@ import org.mian.gitnex.databinding.FragmentProfileEmailsBinding;
|
||||
import org.mian.gitnex.viewmodels.ProfileEmailsViewModel;
|
||||
|
||||
/**
|
||||
* Author M M Arif
|
||||
* @author M M Arif
|
||||
*/
|
||||
|
||||
public class MyProfileEmailsFragment extends Fragment {
|
||||
|
||||
private ProfileEmailsViewModel profileEmailsViewModel;
|
||||
public static boolean refreshEmails = false;
|
||||
|
||||
private ProgressBar mProgressBar;
|
||||
@ -40,6 +41,7 @@ public class MyProfileEmailsFragment extends Fragment {
|
||||
Bundle savedInstanceState) {
|
||||
|
||||
FragmentProfileEmailsBinding fragmentProfileEmailsBinding = FragmentProfileEmailsBinding.inflate(inflater, container, false);
|
||||
profileEmailsViewModel = new ViewModelProvider(this).get(ProfileEmailsViewModel.class);
|
||||
|
||||
final SwipeRefreshLayout swipeRefresh = fragmentProfileEmailsBinding.pullToRefresh;
|
||||
|
||||
@ -57,21 +59,18 @@ public class MyProfileEmailsFragment extends Fragment {
|
||||
swipeRefresh.setOnRefreshListener(() -> new Handler(Looper.getMainLooper()).postDelayed(() -> {
|
||||
|
||||
swipeRefresh.setRefreshing(false);
|
||||
ProfileEmailsViewModel.loadEmailsList(getContext());
|
||||
profileEmailsViewModel.loadEmailsList(getContext());
|
||||
|
||||
}, 200));
|
||||
|
||||
fetchDataAsync();
|
||||
|
||||
return fragmentProfileEmailsBinding.getRoot();
|
||||
|
||||
}
|
||||
|
||||
private void fetchDataAsync() {
|
||||
|
||||
ProfileEmailsViewModel profileEmailModel = new ViewModelProvider(this).get(ProfileEmailsViewModel.class);
|
||||
|
||||
profileEmailModel.getEmailsList(getContext()).observe(getViewLifecycleOwner(), emailsListMain -> {
|
||||
profileEmailsViewModel.getEmailsList(getContext()).observe(getViewLifecycleOwner(), emailsListMain -> {
|
||||
adapter = new MyProfileEmailsAdapter(getContext(), emailsListMain);
|
||||
if(adapter.getItemCount() > 0) {
|
||||
mRecyclerView.setAdapter(adapter);
|
||||
@ -89,13 +88,11 @@ public class MyProfileEmailsFragment extends Fragment {
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
|
||||
super.onResume();
|
||||
|
||||
if(refreshEmails) {
|
||||
ProfileEmailsViewModel.loadEmailsList(getContext());
|
||||
profileEmailsViewModel.loadEmailsList(getContext());
|
||||
refreshEmails = false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -31,20 +31,24 @@ import org.mian.gitnex.viewmodels.RepositoriesViewModel;
|
||||
|
||||
public class MyRepositoriesFragment extends Fragment {
|
||||
|
||||
private RepositoriesViewModel repositoriesViewModel;
|
||||
private FragmentRepositoriesBinding fragmentRepositoriesBinding;
|
||||
private ReposListAdapter adapter;
|
||||
private int page = 1;
|
||||
private final int resultLimit = Constants.resultLimitNewGiteaInstances;
|
||||
private int resultLimit;
|
||||
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
|
||||
fragmentRepositoriesBinding = FragmentRepositoriesBinding.inflate(inflater, container, false);
|
||||
|
||||
setHasOptionsMenu(true);
|
||||
((MainActivity) requireActivity()).setActionBarTitle(getResources().getString(R.string.navMyRepos));
|
||||
repositoriesViewModel = new ViewModelProvider(this).get(RepositoriesViewModel.class);
|
||||
|
||||
final String userLogin = ((BaseActivity) requireActivity()).getAccount().getAccount().getUserName();
|
||||
|
||||
resultLimit = Constants.getCurrentResultLimit(getContext());
|
||||
|
||||
fragmentRepositoriesBinding.addNewRepo.setOnClickListener(view -> {
|
||||
Intent intent = new Intent(view.getContext(), CreateRepoActivity.class);
|
||||
startActivity(intent);
|
||||
@ -71,9 +75,7 @@ public class MyRepositoriesFragment extends Fragment {
|
||||
|
||||
private void fetchDataAsync(String userLogin) {
|
||||
|
||||
RepositoriesViewModel reposModel = new ViewModelProvider(this).get(RepositoriesViewModel.class);
|
||||
|
||||
reposModel.getRepositories(page, resultLimit, userLogin, "myRepos", null, getContext()).observe(getViewLifecycleOwner(), reposListMain -> {
|
||||
repositoriesViewModel.getRepositories(page, resultLimit, userLogin, "myRepos", null, getContext()).observe(getViewLifecycleOwner(), reposListMain -> {
|
||||
|
||||
adapter = new ReposListAdapter(reposListMain, getContext());
|
||||
adapter.setLoadMoreListener(new ReposListAdapter.OnLoadMoreListener() {
|
||||
@ -82,7 +84,7 @@ public class MyRepositoriesFragment extends Fragment {
|
||||
public void onLoadMore() {
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
|
@ -21,11 +21,12 @@ import org.mian.gitnex.databinding.FragmentLabelsBinding;
|
||||
import org.mian.gitnex.viewmodels.OrganizationLabelsViewModel;
|
||||
|
||||
/**
|
||||
* Author M M Arif
|
||||
* @author M M Arif
|
||||
*/
|
||||
|
||||
public class OrganizationLabelsFragment extends Fragment {
|
||||
|
||||
private OrganizationLabelsViewModel organizationLabelsViewModel;
|
||||
private ProgressBar mProgressBar;
|
||||
private RecyclerView mRecyclerView;
|
||||
private LabelsAdapter adapter;
|
||||
@ -60,6 +61,7 @@ public class OrganizationLabelsFragment extends Fragment {
|
||||
|
||||
FragmentLabelsBinding fragmentLabelsBinding = FragmentLabelsBinding.inflate(inflater, container, false);
|
||||
setHasOptionsMenu(true);
|
||||
organizationLabelsViewModel = new ViewModelProvider(this).get(OrganizationLabelsViewModel.class);
|
||||
|
||||
final SwipeRefreshLayout swipeRefresh = fragmentLabelsBinding.pullToRefresh;
|
||||
noData = fragmentLabelsBinding.noData;
|
||||
@ -77,7 +79,7 @@ public class OrganizationLabelsFragment extends Fragment {
|
||||
swipeRefresh.setOnRefreshListener(() -> new Handler(Looper.getMainLooper()).postDelayed(() -> {
|
||||
|
||||
swipeRefresh.setRefreshing(false);
|
||||
OrganizationLabelsViewModel.loadOrgLabelsList(repoOwner, getContext(), mProgressBar, noData);
|
||||
organizationLabelsViewModel.loadOrgLabelsList(repoOwner, getContext(), mProgressBar, noData);
|
||||
|
||||
}, 200));
|
||||
|
||||
@ -94,15 +96,13 @@ public class OrganizationLabelsFragment extends Fragment {
|
||||
|
||||
if(CreateLabelActivity.refreshLabels) {
|
||||
|
||||
OrganizationLabelsViewModel.loadOrgLabelsList(repoOwner, getContext(), mProgressBar, noData);
|
||||
organizationLabelsViewModel.loadOrgLabelsList(repoOwner, getContext(), mProgressBar, noData);
|
||||
CreateLabelActivity.refreshLabels = false;
|
||||
}
|
||||
}
|
||||
|
||||
private void fetchDataAsync(String owner) {
|
||||
|
||||
OrganizationLabelsViewModel organizationLabelsViewModel = new ViewModelProvider(this).get(OrganizationLabelsViewModel.class);
|
||||
|
||||
organizationLabelsViewModel.getOrgLabelsList(owner, getContext(), mProgressBar, noData).observe(getViewLifecycleOwner(), labelsListMain -> {
|
||||
|
||||
adapter = new LabelsAdapter(getContext(), labelsListMain, type, owner);
|
||||
|
@ -1,6 +1,5 @@
|
||||
package org.mian.gitnex.fragments;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
@ -19,7 +18,6 @@ import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import org.gitnex.tea4j.v2.models.Team;
|
||||
import org.mian.gitnex.R;
|
||||
import org.mian.gitnex.activities.CreateRepoActivity;
|
||||
import org.mian.gitnex.activities.MainActivity;
|
||||
import org.mian.gitnex.adapters.ReposListAdapter;
|
||||
import org.mian.gitnex.databinding.FragmentRepositoriesBinding;
|
||||
@ -33,12 +31,13 @@ import org.mian.gitnex.viewmodels.RepositoriesViewModel;
|
||||
|
||||
public class OrganizationTeamInfoReposFragment extends Fragment {
|
||||
|
||||
private RepositoriesViewModel repositoriesViewModel;
|
||||
public static boolean repoAdded = false;
|
||||
|
||||
private FragmentRepositoriesBinding fragmentRepositoriesBinding;
|
||||
private ReposListAdapter adapter;
|
||||
private int page = 1;
|
||||
private final int resultLimit = Constants.resultLimitNewGiteaInstances;
|
||||
private int resultLimit;
|
||||
|
||||
private Team team;
|
||||
|
||||
@ -57,9 +56,12 @@ public class OrganizationTeamInfoReposFragment extends Fragment {
|
||||
|
||||
fragmentRepositoriesBinding = FragmentRepositoriesBinding.inflate(inflater, container, false);
|
||||
|
||||
resultLimit = Constants.getCurrentResultLimit(getContext());
|
||||
setHasOptionsMenu(true);
|
||||
team = (Team) requireArguments().getSerializable("team");
|
||||
|
||||
repositoriesViewModel = new ViewModelProvider(this).get(RepositoriesViewModel.class);
|
||||
|
||||
fragmentRepositoriesBinding.addNewRepo.setVisibility(View.GONE);
|
||||
|
||||
fragmentRepositoriesBinding.recyclerView.setHasFixedSize(true);
|
||||
@ -83,9 +85,7 @@ public class OrganizationTeamInfoReposFragment extends Fragment {
|
||||
|
||||
private void fetchDataAsync() {
|
||||
|
||||
RepositoriesViewModel reposModel = new ViewModelProvider(this).get(RepositoriesViewModel.class);
|
||||
|
||||
reposModel.getRepositories(page, resultLimit, String.valueOf(team.getId()), "team", null, getContext()).observe(getViewLifecycleOwner(), reposListMain -> {
|
||||
repositoriesViewModel.getRepositories(page, resultLimit, String.valueOf(team.getId()), "team", null, getContext()).observe(getViewLifecycleOwner(), reposListMain -> {
|
||||
|
||||
adapter = new ReposListAdapter(reposListMain, getContext());
|
||||
adapter.setLoadMoreListener(new ReposListAdapter.OnLoadMoreListener() {
|
||||
@ -94,7 +94,7 @@ public class OrganizationTeamInfoReposFragment extends Fragment {
|
||||
public void onLoadMore() {
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
|
@ -32,11 +32,12 @@ import org.mian.gitnex.viewmodels.OrganizationsViewModel;
|
||||
|
||||
public class OrganizationsFragment extends Fragment {
|
||||
|
||||
private OrganizationsViewModel organizationsViewModel;
|
||||
public static boolean orgCreated = false;
|
||||
private FragmentOrganizationsBinding fragmentOrganizationsBinding;
|
||||
private OrganizationsListAdapter adapter;
|
||||
private int page = 1;
|
||||
private final int resultLimit = Constants.resultLimitNewGiteaInstances;
|
||||
private int resultLimit;
|
||||
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
@ -45,6 +46,9 @@ public class OrganizationsFragment extends Fragment {
|
||||
|
||||
setHasOptionsMenu(true);
|
||||
((MainActivity) requireActivity()).setActionBarTitle(getResources().getString(R.string.navOrg));
|
||||
organizationsViewModel = new ViewModelProvider(this).get(OrganizationsViewModel.class);
|
||||
|
||||
resultLimit = Constants.getCurrentResultLimit(getContext());
|
||||
|
||||
fragmentOrganizationsBinding.addNewOrganization.setOnClickListener(view -> {
|
||||
Intent intent = new Intent(view.getContext(), CreateOrganizationActivity.class);
|
||||
@ -72,9 +76,7 @@ public class OrganizationsFragment extends Fragment {
|
||||
|
||||
private void fetchDataAsync() {
|
||||
|
||||
OrganizationsViewModel orgModel = new ViewModelProvider(this).get(OrganizationsViewModel.class);
|
||||
|
||||
orgModel.getUserOrg(page, resultLimit, getContext()).observe(getViewLifecycleOwner(), orgListMain -> {
|
||||
organizationsViewModel.getUserOrg(page, resultLimit, getContext()).observe(getViewLifecycleOwner(), orgListMain -> {
|
||||
|
||||
adapter = new OrganizationsListAdapter(orgListMain, getContext());
|
||||
adapter.setLoadMoreListener(new OrganizationsListAdapter.OnLoadMoreListener() {
|
||||
@ -83,7 +85,7 @@ public class OrganizationsFragment extends Fragment {
|
||||
public void onLoadMore() {
|
||||
|
||||
page += 1;
|
||||
OrganizationsViewModel.loadMoreOrgList(page, resultLimit, getContext(), adapter);
|
||||
organizationsViewModel.loadMoreOrgList(page, resultLimit, getContext(), adapter);
|
||||
fragmentOrganizationsBinding.progressBar.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
@ -113,7 +115,7 @@ public class OrganizationsFragment extends Fragment {
|
||||
super.onResume();
|
||||
|
||||
if(orgCreated) {
|
||||
OrganizationsViewModel.loadOrgList(page, resultLimit, getContext());
|
||||
organizationsViewModel.loadOrgList(page, resultLimit, getContext());
|
||||
orgCreated = false;
|
||||
}
|
||||
}
|
||||
|
@ -25,11 +25,12 @@ import org.mian.gitnex.viewmodels.ReleasesViewModel;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Author M M Arif
|
||||
* @author M M Arif
|
||||
*/
|
||||
|
||||
public class ReleasesFragment extends Fragment {
|
||||
|
||||
private ReleasesViewModel releasesViewModel;
|
||||
private ReleasesAdapter adapter;
|
||||
private TagsAdapter tagsAdapter;
|
||||
private RepositoryContext repository;
|
||||
@ -38,7 +39,7 @@ public class ReleasesFragment extends Fragment {
|
||||
private int page = 1;
|
||||
private int pageReleases = 1;
|
||||
|
||||
public ReleasesFragment() {
|
||||
public ReleasesFragment() {
|
||||
}
|
||||
|
||||
public static ReleasesFragment newInstance(RepositoryContext repository) {
|
||||
@ -59,6 +60,7 @@ public class ReleasesFragment extends Fragment {
|
||||
Bundle savedInstanceState) {
|
||||
|
||||
fragmentReleasesBinding = FragmentReleasesBinding.inflate(inflater, container, false);
|
||||
releasesViewModel = new ViewModelProvider(this).get(ReleasesViewModel.class);
|
||||
|
||||
fragmentReleasesBinding.recyclerView.setHasFixedSize(true);
|
||||
fragmentReleasesBinding.recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
|
||||
@ -70,9 +72,9 @@ public class ReleasesFragment extends Fragment {
|
||||
|
||||
fragmentReleasesBinding.pullToRefresh.setRefreshing(false);
|
||||
if(repository.isReleasesViewTypeIsTag()) {
|
||||
ReleasesViewModel.loadTagsList(repository.getOwner(), repository.getName(), getContext());
|
||||
releasesViewModel.loadTagsList(repository.getOwner(), repository.getName(), getContext());
|
||||
} else {
|
||||
ReleasesViewModel.loadReleasesList(repository.getOwner(), repository.getName(), getContext());
|
||||
releasesViewModel.loadReleasesList(repository.getOwner(), repository.getName(), getContext());
|
||||
}
|
||||
fragmentReleasesBinding.progressBar.setVisibility(View.VISIBLE);
|
||||
|
||||
@ -86,9 +88,9 @@ public class ReleasesFragment extends Fragment {
|
||||
page = 1;
|
||||
pageReleases = 1;
|
||||
if(repository.isReleasesViewTypeIsTag()) {
|
||||
ReleasesViewModel.loadTagsList(repository.getOwner(), repository.getName(), getContext());
|
||||
releasesViewModel.loadTagsList(repository.getOwner(), repository.getName(), getContext());
|
||||
} else {
|
||||
ReleasesViewModel.loadReleasesList(repository.getOwner(), repository.getName(), getContext());
|
||||
releasesViewModel.loadReleasesList(repository.getOwner(), repository.getName(), getContext());
|
||||
}
|
||||
fragmentReleasesBinding.progressBar.setVisibility(View.VISIBLE);
|
||||
});
|
||||
@ -108,7 +110,7 @@ public class ReleasesFragment extends Fragment {
|
||||
@Override
|
||||
public void onLoadMore() {
|
||||
pageReleases += 1;
|
||||
ReleasesViewModel.loadMoreReleases(owner, repo, pageReleases, getContext(), adapter);
|
||||
releasesViewModel.loadMoreReleases(owner, repo, pageReleases, getContext(), adapter);
|
||||
fragmentReleasesBinding.progressBar.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
@ -145,7 +147,7 @@ public class ReleasesFragment extends Fragment {
|
||||
@Override
|
||||
public void onLoadMore() {
|
||||
page += 1;
|
||||
ReleasesViewModel.loadMoreTags(owner, repo , page, getContext(), tagsAdapter);
|
||||
releasesViewModel.loadMoreTags(owner, repo , page, getContext(), tagsAdapter);
|
||||
fragmentReleasesBinding.progressBar.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
|
@ -28,10 +28,11 @@ import org.mian.gitnex.viewmodels.RepositoriesViewModel;
|
||||
|
||||
public class RepositoriesByOrgFragment extends Fragment {
|
||||
|
||||
private RepositoriesViewModel repositoriesViewModel;
|
||||
private FragmentRepositoriesBinding fragmentRepositoriesBinding;
|
||||
private ReposListAdapter adapter;
|
||||
private int page = 1;
|
||||
private final int resultLimit = Constants.resultLimitNewGiteaInstances;
|
||||
private int resultLimit;
|
||||
private static final String getOrgName = null;
|
||||
private String orgName;
|
||||
|
||||
@ -57,8 +58,10 @@ public class RepositoriesByOrgFragment extends Fragment {
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
|
||||
fragmentRepositoriesBinding = FragmentRepositoriesBinding.inflate(inflater, container, false);
|
||||
|
||||
setHasOptionsMenu(true);
|
||||
repositoriesViewModel = new ViewModelProvider(this).get(RepositoriesViewModel.class);
|
||||
|
||||
resultLimit = Constants.getCurrentResultLimit(getContext());
|
||||
|
||||
fragmentRepositoriesBinding.addNewRepo.setVisibility(View.GONE);
|
||||
|
||||
@ -84,9 +87,7 @@ public class RepositoriesByOrgFragment extends Fragment {
|
||||
|
||||
private void fetchDataAsync() {
|
||||
|
||||
RepositoriesViewModel reposModel = new ViewModelProvider(this).get(RepositoriesViewModel.class);
|
||||
|
||||
reposModel.getRepositories(page, resultLimit, "", "org", orgName, getContext()).observe(getViewLifecycleOwner(), reposListMain -> {
|
||||
repositoriesViewModel.getRepositories(page, resultLimit, "", "org", orgName, getContext()).observe(getViewLifecycleOwner(), reposListMain -> {
|
||||
|
||||
adapter = new ReposListAdapter(reposListMain, getContext());
|
||||
adapter.setLoadMoreListener(new ReposListAdapter.OnLoadMoreListener() {
|
||||
@ -95,7 +96,7 @@ public class RepositoriesByOrgFragment extends Fragment {
|
||||
public void onLoadMore() {
|
||||
|
||||
page += 1;
|
||||
RepositoriesViewModel.loadMoreRepos(page, resultLimit, "", "org", orgName, getContext(), adapter);
|
||||
repositoriesViewModel.loadMoreRepos(page, resultLimit, "", "org", orgName, getContext(), adapter);
|
||||
fragmentRepositoriesBinding.progressBar.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
@ -126,7 +127,7 @@ public class RepositoriesByOrgFragment extends Fragment {
|
||||
super.onResume();
|
||||
|
||||
if(MainActivity.repoCreated) {
|
||||
RepositoriesViewModel.loadReposList(page, resultLimit, null, "org", orgName, getContext());
|
||||
repositoriesViewModel.loadReposList(page, resultLimit, null, "org", orgName, getContext());
|
||||
MainActivity.repoCreated = false;
|
||||
}
|
||||
|
||||
|
@ -32,18 +32,21 @@ import org.mian.gitnex.viewmodels.RepositoriesViewModel;
|
||||
|
||||
public class RepositoriesFragment extends Fragment {
|
||||
|
||||
private RepositoriesViewModel repositoriesViewModel;
|
||||
private FragmentRepositoriesBinding fragmentRepositoriesBinding;
|
||||
private ReposListAdapter adapter;
|
||||
private int page = 1;
|
||||
private final int resultLimit = Constants.resultLimitNewGiteaInstances;
|
||||
private int resultLimit;
|
||||
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
|
||||
fragmentRepositoriesBinding = FragmentRepositoriesBinding.inflate(inflater, container, false);
|
||||
|
||||
setHasOptionsMenu(true);
|
||||
((MainActivity) requireActivity()).setActionBarTitle(getResources().getString(R.string.navRepos));
|
||||
repositoriesViewModel = new ViewModelProvider(this).get(RepositoriesViewModel.class);
|
||||
|
||||
resultLimit = Constants.getCurrentResultLimit(getContext());
|
||||
|
||||
fragmentRepositoriesBinding.addNewRepo.setOnClickListener(view -> {
|
||||
Intent intent = new Intent(view.getContext(), CreateRepoActivity.class);
|
||||
@ -71,9 +74,7 @@ public class RepositoriesFragment extends Fragment {
|
||||
|
||||
private void fetchDataAsync() {
|
||||
|
||||
RepositoriesViewModel reposModel = new ViewModelProvider(this).get(RepositoriesViewModel.class);
|
||||
|
||||
reposModel.getRepositories(page, resultLimit, null, "repos", null, getContext()).observe(getViewLifecycleOwner(), reposListMain -> {
|
||||
repositoriesViewModel.getRepositories(page, resultLimit, null, "repos", null, getContext()).observe(getViewLifecycleOwner(), reposListMain -> {
|
||||
|
||||
adapter = new ReposListAdapter(reposListMain, getContext());
|
||||
adapter.setLoadMoreListener(new ReposListAdapter.OnLoadMoreListener() {
|
||||
@ -82,7 +83,7 @@ public class RepositoriesFragment extends Fragment {
|
||||
public void onLoadMore() {
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
|
@ -30,18 +30,21 @@ import org.mian.gitnex.viewmodels.RepositoriesViewModel;
|
||||
|
||||
public class StarredRepositoriesFragment extends Fragment {
|
||||
|
||||
private RepositoriesViewModel repositoriesViewModel;
|
||||
private FragmentRepositoriesBinding fragmentRepositoriesBinding;
|
||||
private ReposListAdapter adapter;
|
||||
private int page = 1;
|
||||
private final int resultLimit = Constants.resultLimitNewGiteaInstances;
|
||||
private int resultLimit;
|
||||
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
|
||||
fragmentRepositoriesBinding = FragmentRepositoriesBinding.inflate(inflater, container, false);
|
||||
|
||||
setHasOptionsMenu(true);
|
||||
((MainActivity) requireActivity()).setActionBarTitle(getResources().getString(R.string.navStarredRepos));
|
||||
repositoriesViewModel = new ViewModelProvider(this).get(RepositoriesViewModel.class);
|
||||
|
||||
resultLimit = Constants.getCurrentResultLimit(getContext());
|
||||
|
||||
fragmentRepositoriesBinding.addNewRepo.setOnClickListener(view -> {
|
||||
Intent intent = new Intent(view.getContext(), CreateRepoActivity.class);
|
||||
@ -69,9 +72,7 @@ public class StarredRepositoriesFragment extends Fragment {
|
||||
|
||||
private void fetchDataAsync() {
|
||||
|
||||
RepositoriesViewModel reposModel = new ViewModelProvider(this).get(RepositoriesViewModel.class);
|
||||
|
||||
reposModel.getRepositories(page, resultLimit, "", "starredRepos", null, getContext()).observe(getViewLifecycleOwner(), reposListMain -> {
|
||||
repositoriesViewModel.getRepositories(page, resultLimit, "", "starredRepos", null, getContext()).observe(getViewLifecycleOwner(), reposListMain -> {
|
||||
|
||||
adapter = new ReposListAdapter(reposListMain, getContext());
|
||||
adapter.setLoadMoreListener(new ReposListAdapter.OnLoadMoreListener() {
|
||||
@ -80,7 +81,7 @@ public class StarredRepositoriesFragment extends Fragment {
|
||||
public void onLoadMore() {
|
||||
|
||||
page += 1;
|
||||
RepositoriesViewModel.loadMoreRepos(page, resultLimit, "", "starredRepos", null, getContext(), adapter);
|
||||
repositoriesViewModel.loadMoreRepos(page, resultLimit, "", "starredRepos", null, getContext(), adapter);
|
||||
fragmentRepositoriesBinding.progressBar.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
|
@ -31,6 +31,7 @@ import org.mian.gitnex.viewmodels.TeamsByOrgViewModel;
|
||||
|
||||
public class TeamsByOrgFragment extends Fragment {
|
||||
|
||||
private TeamsByOrgViewModel teamsByOrgViewModel;
|
||||
public static boolean resumeTeams = false;
|
||||
|
||||
private ProgressBar mProgressBar;
|
||||
@ -68,6 +69,7 @@ public class TeamsByOrgFragment extends Fragment {
|
||||
|
||||
FragmentTeamsByOrgBinding fragmentTeamsByOrgBinding = FragmentTeamsByOrgBinding.inflate(inflater, container, false);
|
||||
setHasOptionsMenu(true);
|
||||
teamsByOrgViewModel = new ViewModelProvider(this).get(TeamsByOrgViewModel.class);
|
||||
|
||||
noDataTeams = fragmentTeamsByOrgBinding.noDataTeams;
|
||||
|
||||
@ -86,7 +88,7 @@ public class TeamsByOrgFragment extends Fragment {
|
||||
swipeRefresh.setOnRefreshListener(() -> new Handler(Looper.getMainLooper()).postDelayed(() -> {
|
||||
|
||||
swipeRefresh.setRefreshing(false);
|
||||
TeamsByOrgViewModel.loadTeamsByOrgList(orgName, getContext(), noDataTeams, mProgressBar);
|
||||
teamsByOrgViewModel.loadTeamsByOrgList(orgName, getContext(), noDataTeams, mProgressBar);
|
||||
|
||||
}, 200));
|
||||
|
||||
@ -99,16 +101,14 @@ public class TeamsByOrgFragment extends Fragment {
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
if(resumeTeams) {
|
||||
TeamsByOrgViewModel.loadTeamsByOrgList(orgName, getContext(), noDataTeams, mProgressBar);
|
||||
teamsByOrgViewModel.loadTeamsByOrgList(orgName, getContext(), noDataTeams, mProgressBar);
|
||||
resumeTeams = false;
|
||||
}
|
||||
}
|
||||
|
||||
private void fetchDataAsync(String owner) {
|
||||
|
||||
TeamsByOrgViewModel teamModel = new ViewModelProvider(this).get(TeamsByOrgViewModel.class);
|
||||
|
||||
teamModel.getTeamsByOrg(owner, getContext(), noDataTeams, mProgressBar).observe(getViewLifecycleOwner(), orgTeamsListMain -> {
|
||||
teamsByOrgViewModel.getTeamsByOrg(owner, getContext(), noDataTeams, mProgressBar).observe(getViewLifecycleOwner(), orgTeamsListMain -> {
|
||||
adapter = new TeamsByOrgAdapter(getContext(), orgTeamsListMain, permissions, orgName);
|
||||
if(adapter.getItemCount() > 0) {
|
||||
mRecyclerView.setAdapter(adapter);
|
||||
|
@ -6,21 +6,16 @@ import android.content.Intent;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.widget.Button;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import org.mian.gitnex.R;
|
||||
import org.mian.gitnex.actions.CollaboratorActions;
|
||||
import org.mian.gitnex.actions.PullRequestActions;
|
||||
import org.mian.gitnex.actions.TeamActions;
|
||||
import org.mian.gitnex.activities.CreateLabelActivity;
|
||||
import org.mian.gitnex.clients.RetrofitClient;
|
||||
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 {
|
||||
@ -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) {
|
||||
|
||||
new AlertDialog.Builder(context)
|
||||
|
@ -43,7 +43,7 @@ import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/**
|
||||
* Author M M Arif
|
||||
* @author M M Arif
|
||||
*/
|
||||
|
||||
public class AppUtil {
|
||||
@ -363,7 +363,6 @@ public class AppUtil {
|
||||
clipboard.setPrimaryClip(clip);
|
||||
|
||||
Toasty.info(ctx, message);
|
||||
|
||||
}
|
||||
|
||||
public static boolean switchToAccount(Context context, UserAccount userAccount) {
|
||||
@ -374,6 +373,15 @@ public class AppUtil {
|
||||
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) {
|
||||
TinyDB tinyDB = TinyDB.getInstance(context);
|
||||
|
||||
|
@ -4,22 +4,16 @@ import android.content.Context;
|
||||
import org.mian.gitnex.activities.BaseActivity;
|
||||
|
||||
/**
|
||||
* Author M M Arif
|
||||
* @author M M Arif
|
||||
*/
|
||||
|
||||
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) {
|
||||
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
|
||||
public static final String tagMilestonesFragment = "MilestonesFragment";
|
||||
public static final String tagPullRequestsList = "PullRequestFragment";
|
||||
public static final String tagIssuesList = "IssuesListFragment";
|
||||
public static final String tagMilestonesAdapter = "MilestonesAdapter";
|
||||
@ -30,8 +24,6 @@ public class Constants {
|
||||
public static final String publicOrganizations = "PublicOrganizations";
|
||||
public static final String exploreUsers = "ExploreUsers";
|
||||
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 tagFollowing = "TagFollowing";
|
||||
|
||||
@ -42,9 +34,6 @@ public class Constants {
|
||||
// pull request
|
||||
public static final int prPageInit = 1;
|
||||
|
||||
// milestone
|
||||
public static final int milestonesPageInit = 1;
|
||||
|
||||
// drafts
|
||||
public static final String draftTypeComment = "comment";
|
||||
public static final String draftTypeIssue = "Issue";
|
||||
@ -69,5 +58,4 @@ public class Constants {
|
||||
|
||||
// work managers
|
||||
public static final String notificationsWorkerId = "notifications_worker";
|
||||
|
||||
}
|
||||
|
@ -48,6 +48,14 @@ public class AccountContext implements Serializable {
|
||||
return getServerVersion().higherOrEqual(version);
|
||||
}
|
||||
|
||||
public int getDefaultPageLimit() {
|
||||
return getAccount().getDefaultPagingNumber();
|
||||
}
|
||||
|
||||
public int getMaxPageLimit() {
|
||||
return getAccount().getMaxResponseItems();
|
||||
}
|
||||
|
||||
public User getUserInfo() {
|
||||
|
||||
return userInfo;
|
||||
|
@ -21,7 +21,7 @@ import retrofit2.Response;
|
||||
|
||||
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) {
|
||||
|
||||
@ -31,7 +31,7 @@ public class AdminCronTasksViewModel extends ViewModel {
|
||||
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
|
||||
.getApiInterface(ctx)
|
||||
|
@ -21,7 +21,7 @@ import retrofit2.Response;
|
||||
|
||||
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) {
|
||||
|
||||
@ -31,7 +31,7 @@ public class AdminGetUsersViewModel extends ViewModel {
|
||||
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
|
||||
.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
|
||||
.getApiInterface(ctx)
|
||||
|
@ -20,7 +20,7 @@ import retrofit2.Response;
|
||||
|
||||
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) {
|
||||
|
||||
@ -30,7 +30,7 @@ public class CollaboratorsViewModel extends ViewModel {
|
||||
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
|
||||
.getApiInterface(ctx)
|
||||
|
@ -25,8 +25,8 @@ import retrofit2.Response;
|
||||
|
||||
public class FilesViewModel extends ViewModel {
|
||||
|
||||
private static MutableLiveData<List<ContentsResponse>> filesList;
|
||||
private static MutableLiveData<List<ContentsResponse>> filesList2;
|
||||
private MutableLiveData<List<ContentsResponse>> filesList;
|
||||
private MutableLiveData<List<ContentsResponse>> filesList2;
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
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
|
||||
.getApiInterface(ctx)
|
||||
@ -73,7 +73,7 @@ public class FilesViewModel extends ViewModel {
|
||||
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
|
||||
.getApiInterface(ctx)
|
||||
|
@ -7,7 +7,6 @@ import androidx.lifecycle.MutableLiveData;
|
||||
import androidx.lifecycle.ViewModel;
|
||||
import org.gitnex.tea4j.v2.models.Issue;
|
||||
import org.mian.gitnex.R;
|
||||
import org.mian.gitnex.activities.BaseActivity;
|
||||
import org.mian.gitnex.adapters.ExploreIssuesAdapter;
|
||||
import org.mian.gitnex.clients.RetrofitClient;
|
||||
import org.mian.gitnex.helpers.Constants;
|
||||
@ -23,29 +22,22 @@ import retrofit2.Response;
|
||||
|
||||
public class IssuesViewModel extends ViewModel {
|
||||
|
||||
private static MutableLiveData<List<Issue>> issuesList;
|
||||
private static int resultLimit = Constants.resultLimitOldGiteaInstances;
|
||||
private MutableLiveData<List<Issue>> issuesList;
|
||||
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<>();
|
||||
|
||||
// if gitea is 1.12 or higher use the new limit
|
||||
if(((BaseActivity) ctx).getAccount().requiresVersion("1.12.0")) {
|
||||
resultLimit = Constants.resultLimitNewGiteaInstances;
|
||||
}
|
||||
|
||||
loadIssuesList(searchKeyword, type, created, state, ctx);
|
||||
|
||||
resultLimit = Constants.getCurrentResultLimit(ctx);
|
||||
loadIssuesList(searchKeyword, type, created, state, assignedToMe, ctx);
|
||||
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
|
||||
.getApiInterface(ctx)
|
||||
.issueSearchIssues(state, null, null, searchKeyword, null, type, null, null,
|
||||
null, created, null, null, null, null, 1, resultLimit);
|
||||
Call<List<Issue>> call = RetrofitClient.getApiInterface(ctx)
|
||||
.issueSearchIssues(state, null, null, searchKeyword, null, type, null, null, assignedToMe, created, null, null, null, null, 1,
|
||||
resultLimit);
|
||||
|
||||
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
|
||||
.getApiInterface(ctx)
|
||||
.issueSearchIssues(state, null, null, searchKeyword, null, type, null, null,
|
||||
null, created, null, null, null, null, page, resultLimit);
|
||||
Call<List<Issue>> call = RetrofitClient.getApiInterface(ctx)
|
||||
.issueSearchIssues(state, null, null, searchKeyword, null, type, null, null, assignedToMe, created, null, null, null, null, page, resultLimit);
|
||||
|
||||
call.enqueue(new Callback<>() {
|
||||
|
||||
|
@ -20,7 +20,7 @@ import retrofit2.Response;
|
||||
|
||||
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) {
|
||||
|
||||
@ -30,7 +30,7 @@ public class LabelsViewModel extends ViewModel {
|
||||
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
|
||||
.getApiInterface(ctx)
|
||||
|
@ -20,7 +20,7 @@ import retrofit2.Response;
|
||||
|
||||
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) {
|
||||
|
||||
@ -30,7 +30,7 @@ public class MembersByOrgViewModel extends ViewModel {
|
||||
return membersList;
|
||||
}
|
||||
|
||||
private static void loadMembersList(String owner, Context ctx) {
|
||||
private void loadMembersList(String owner, Context ctx) {
|
||||
|
||||
Call<List<User>> call = RetrofitClient
|
||||
.getApiInterface(ctx)
|
||||
|
@ -22,18 +22,18 @@ import retrofit2.Response;
|
||||
|
||||
public class MilestonesViewModel extends ViewModel {
|
||||
|
||||
private static MutableLiveData<List<Milestone>> milestonesList;
|
||||
private static final int resultLimit = Constants.resultLimitNewGiteaInstances;
|
||||
private MutableLiveData<List<Milestone>> milestonesList;
|
||||
private int resultLimit;
|
||||
|
||||
public LiveData<List<Milestone>> getMilestonesList(String repoOwner, String repoName, String milestoneState, Context ctx) {
|
||||
|
||||
milestonesList = new MutableLiveData<>();
|
||||
loadMilestonesList(repoOwner, repoName, milestoneState, ctx);
|
||||
|
||||
resultLimit = Constants.getCurrentResultLimit(ctx);
|
||||
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);
|
||||
|
||||
@ -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);
|
||||
|
||||
|
@ -23,7 +23,7 @@ import retrofit2.Response;
|
||||
|
||||
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) {
|
||||
|
||||
@ -33,7 +33,7 @@ public class OrganizationLabelsViewModel extends ViewModel {
|
||||
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
|
||||
.getApiInterface(ctx)
|
||||
|
@ -21,7 +21,7 @@ import retrofit2.Response;
|
||||
|
||||
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) {
|
||||
|
||||
@ -31,7 +31,7 @@ public class OrganizationsViewModel extends ViewModel {
|
||||
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
|
||||
.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
|
||||
.getApiInterface(ctx)
|
||||
|
@ -20,7 +20,7 @@ import retrofit2.Response;
|
||||
|
||||
public class ProfileEmailsViewModel extends ViewModel {
|
||||
|
||||
private static MutableLiveData<List<Email>> emailsList;
|
||||
private MutableLiveData<List<Email>> emailsList;
|
||||
|
||||
public LiveData<List<Email>> getEmailsList(Context ctx) {
|
||||
|
||||
@ -30,7 +30,7 @@ public class ProfileEmailsViewModel extends ViewModel {
|
||||
return emailsList;
|
||||
}
|
||||
|
||||
public static void loadEmailsList(Context ctx) {
|
||||
public void loadEmailsList(Context ctx) {
|
||||
|
||||
Call<List<Email>> call = RetrofitClient
|
||||
.getApiInterface(ctx)
|
||||
|
@ -8,7 +8,6 @@ import androidx.lifecycle.ViewModel;
|
||||
import org.gitnex.tea4j.v2.models.Release;
|
||||
import org.gitnex.tea4j.v2.models.Tag;
|
||||
import org.mian.gitnex.R;
|
||||
import org.mian.gitnex.activities.BaseActivity;
|
||||
import org.mian.gitnex.adapters.ReleasesAdapter;
|
||||
import org.mian.gitnex.adapters.TagsAdapter;
|
||||
import org.mian.gitnex.clients.RetrofitClient;
|
||||
@ -25,24 +24,18 @@ import retrofit2.Response;
|
||||
|
||||
public class ReleasesViewModel extends ViewModel {
|
||||
|
||||
private static MutableLiveData<List<Release>> releasesList;
|
||||
private static int resultLimit = Constants.resultLimitOldGiteaInstances;
|
||||
private MutableLiveData<List<Release>> releasesList;
|
||||
private int resultLimit;
|
||||
|
||||
public LiveData<List<Release>> getReleasesList(String owner, String repo, Context ctx) {
|
||||
|
||||
releasesList = new MutableLiveData<>();
|
||||
|
||||
// if gitea is 1.12 or higher use the new limit
|
||||
if(((BaseActivity) ctx).getAccount().requiresVersion("1.12.0")) {
|
||||
resultLimit = Constants.resultLimitNewGiteaInstances;
|
||||
}
|
||||
|
||||
resultLimit = Constants.getCurrentResultLimit(ctx);
|
||||
loadReleasesList(owner, repo, ctx);
|
||||
|
||||
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
|
||||
.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
|
||||
.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) {
|
||||
|
||||
tagsList = new MutableLiveData<>();
|
||||
|
||||
// if gitea is 1.12 or higher use the new limit
|
||||
if(((BaseActivity) ctx).getAccount().requiresVersion("1.12.0")) {
|
||||
resultLimit = Constants.resultLimitNewGiteaInstances;
|
||||
}
|
||||
|
||||
resultLimit = Constants.getCurrentResultLimit(ctx);
|
||||
loadTagsList(owner, repo, ctx);
|
||||
|
||||
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
|
||||
.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
|
||||
.getApiInterface(ctx)
|
||||
|
@ -20,7 +20,7 @@ import retrofit2.Response;
|
||||
|
||||
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) {
|
||||
|
||||
@ -30,7 +30,7 @@ public class RepoStargazersViewModel extends ViewModel {
|
||||
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
|
||||
.getApiInterface(ctx)
|
||||
|
@ -20,7 +20,7 @@ import retrofit2.Response;
|
||||
|
||||
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) {
|
||||
|
||||
@ -30,7 +30,7 @@ public class RepoWatchersViewModel extends ViewModel {
|
||||
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
|
||||
.getApiInterface(ctx)
|
||||
|
@ -21,7 +21,7 @@ import retrofit2.Response;
|
||||
|
||||
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) {
|
||||
|
||||
@ -31,7 +31,7 @@ public class RepositoriesViewModel extends ViewModel {
|
||||
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;
|
||||
|
||||
@ -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;
|
||||
|
||||
|
@ -23,7 +23,7 @@ import retrofit2.Response;
|
||||
|
||||
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) {
|
||||
|
||||
@ -33,7 +33,7 @@ public class TeamsByOrgViewModel extends ViewModel {
|
||||
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
|
||||
.getApiInterface(ctx)
|
||||
|
@ -37,7 +37,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:text="@string/addNewMember"
|
||||
android:text="@string/addRemove"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:maxLines="1"
|
||||
android:textSize="20sp" />
|
||||
|
@ -2,6 +2,7 @@
|
||||
<androidx.coordinatorlayout.widget.CoordinatorLayout
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
@ -111,36 +112,66 @@
|
||||
android:textIsSelectable="true"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<RelativeLayout
|
||||
<LinearLayout
|
||||
android:id="@+id/msdueFrame"
|
||||
android:layout_toEndOf="@+id/assigneeAvatar"
|
||||
android:layout_below="@+id/issueTitle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp" >
|
||||
android:layout_marginTop="10dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/issueDueDate"
|
||||
android:gravity="start"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_gravity="start"
|
||||
android:layout_width="wrap_content"
|
||||
<LinearLayout
|
||||
android:id="@+id/dueDateFrame"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="14sp" />
|
||||
android:gravity="end|center_vertical"
|
||||
android:orientation="horizontal"
|
||||
tools:ignore="UseCompoundDrawables">
|
||||
|
||||
<TextView
|
||||
android:layout_toEndOf="@+id/issueDueDate"
|
||||
android:id="@+id/issueMilestone"
|
||||
android:gravity="end"
|
||||
android:layout_gravity="end"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_width="wrap_content"
|
||||
<ImageView
|
||||
android:layout_width="18dp"
|
||||
android:layout_height="wrap_content"
|
||||
app:srcCompat="@drawable/ic_calendar"
|
||||
android:contentDescription="@string/generalImgContentText" />
|
||||
|
||||
<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:textColor="?attr/primaryTextColor"
|
||||
android:textSize="14sp" />
|
||||
android:gravity="end|center_vertical"
|
||||
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
|
||||
android:layout_below="@+id/msdueFrame"
|
||||
|
@ -37,7 +37,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:text="@string/addRmRepo"
|
||||
android:text="@string/addButton"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:maxLines="1"
|
||||
android:textSize="20sp" />
|
||||
|
@ -18,20 +18,47 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/createNewUser"
|
||||
<LinearLayout
|
||||
android:id="@+id/adminUsersHeadFrame"
|
||||
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/adminCreateNewUser"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="16sp"
|
||||
app:drawableStartCompat="@drawable/ic_person_add" />
|
||||
android:padding="8dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/bottomSheetHeader"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="@string/navAdministration"
|
||||
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>
|
||||
|
||||
|
@ -18,20 +18,47 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/deleteAllDrafts"
|
||||
<LinearLayout
|
||||
android:id="@+id/draftsHeadFrame"
|
||||
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/deleteAllDrafts"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="16sp"
|
||||
app:drawableStartCompat="@drawable/ic_delete" />
|
||||
android:padding="8dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/bottomSheetHeader"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="@string/draftsHeader"
|
||||
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>
|
||||
|
||||
|
@ -18,50 +18,73 @@
|
||||
android:orientation="vertical"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/editFile"
|
||||
<LinearLayout
|
||||
android:id="@+id/filesHeadFrame"
|
||||
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/editFile"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="16sp"
|
||||
app:drawableStartCompat="@drawable/ic_edit" />
|
||||
android:padding="8dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/deleteFile"
|
||||
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/deleteFile"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="16sp"
|
||||
app:drawableStartCompat="@drawable/ic_delete" />
|
||||
<TextView
|
||||
android:id="@+id/bottomSheetHeader"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="@string/file"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/downloadFile"
|
||||
</LinearLayout>
|
||||
|
||||
<com.google.android.flexbox.FlexboxLayout
|
||||
android:id="@+id/filesSection"
|
||||
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/downloadFile"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="16sp"
|
||||
app:drawableStartCompat="@drawable/ic_download" />
|
||||
android:layout_height="match_parent"
|
||||
app:flexWrap="wrap"
|
||||
app:alignItems="stretch"
|
||||
android:padding="8dp"
|
||||
app:alignContent="stretch" >
|
||||
|
||||
<TextView
|
||||
android:id="@+id/editFile"
|
||||
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/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>
|
||||
|
||||
|
@ -25,95 +25,151 @@
|
||||
android:layout_marginBottom="5dp"
|
||||
android:orientation="horizontal" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/commentMenuEdit"
|
||||
<View
|
||||
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" />
|
||||
android:layout_height="4dp"
|
||||
android:id="@+id/reactionDivider"
|
||||
android:layout_marginTop="12dp"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:background="?attr/dividerColor" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/commentMenuDelete"
|
||||
<LinearLayout
|
||||
android:id="@+id/issueComments"
|
||||
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/menuDeleteText"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="16sp"
|
||||
app:drawableStartCompat="@drawable/ic_delete" />
|
||||
android:padding="8dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/commentMenuQuote"
|
||||
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/menuQuoteText"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="16sp"
|
||||
app:drawableStartCompat="@drawable/ic_comment" />
|
||||
<TextView
|
||||
android:id="@+id/bottomSheetHeader"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="@string/commentButtonText"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<TextView
|
||||
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" />
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/issueCommentShare"
|
||||
<com.google.android.flexbox.FlexboxLayout
|
||||
android:id="@+id/issueCommentsSection"
|
||||
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/issueCommentShare"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="16sp"
|
||||
app:drawableStartCompat="@drawable/ic_share" />
|
||||
android:layout_height="match_parent"
|
||||
app:flexWrap="wrap"
|
||||
app:alignItems="stretch"
|
||||
android:padding="8dp"
|
||||
app:alignContent="stretch" >
|
||||
|
||||
<TextView
|
||||
android:id="@+id/issueCommentCopyUrl"
|
||||
<TextView
|
||||
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_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/genericCopyUrl"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="16sp"
|
||||
app:drawableStartCompat="@drawable/ic_link" />
|
||||
android:layout_height="4dp"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:background="?attr/dividerColor" />
|
||||
|
||||
<com.google.android.flexbox.FlexboxLayout
|
||||
android:id="@+id/issueOtherSection"
|
||||
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/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>
|
||||
|
||||
|
@ -18,51 +18,73 @@
|
||||
android:orientation="vertical"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/filterByMilestone"
|
||||
<LinearLayout
|
||||
android:id="@+id/issuesFilterHeadFrame"
|
||||
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/newIssueMilestoneTitle"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="16sp"
|
||||
android:visibility="gone"
|
||||
app:drawableStartCompat="@drawable/ic_milestone" />
|
||||
android:padding="8dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/openIssues"
|
||||
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/isOpen"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="16sp"
|
||||
app:drawableStartCompat="@drawable/ic_issue" />
|
||||
<TextView
|
||||
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" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/closedIssues"
|
||||
</LinearLayout>
|
||||
|
||||
<com.google.android.flexbox.FlexboxLayout
|
||||
android:id="@+id/issuesFilterSection"
|
||||
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/isClosed"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="16sp"
|
||||
app:drawableStartCompat="@drawable/ic_issue_closed" />
|
||||
android:layout_height="match_parent"
|
||||
app:flexWrap="wrap"
|
||||
app:alignItems="stretch"
|
||||
android:padding="8dp"
|
||||
app:alignContent="stretch" >
|
||||
|
||||
<TextView
|
||||
android:id="@+id/filterByMilestone"
|
||||
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_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>
|
||||
|
||||
|
@ -18,53 +18,60 @@
|
||||
android:orientation="vertical"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/bottomSheetHeader"
|
||||
<LinearLayout
|
||||
android:id="@+id/labelsListHeadFrame"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingStart="18dp"
|
||||
android:paddingEnd="18dp"
|
||||
android:paddingBottom="18dp"
|
||||
android:text="@string/labelName"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="18sp" />
|
||||
android:padding="8dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:id="@+id/divider"
|
||||
android:layout_marginBottom="12dp"
|
||||
android:background="?attr/dividerColor" />
|
||||
<TextView
|
||||
android:id="@+id/bottomSheetHeader"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="@string/labelName"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<TextView
|
||||
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" />
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/labelMenuDelete"
|
||||
<com.google.android.flexbox.FlexboxLayout
|
||||
android:id="@+id/labelsListSection"
|
||||
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/menuDeleteText"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="16sp"
|
||||
app:drawableStartCompat="@drawable/ic_delete" />
|
||||
android:layout_height="match_parent"
|
||||
app:flexWrap="wrap"
|
||||
app:alignItems="stretch"
|
||||
android:padding="8dp"
|
||||
app:alignContent="stretch" >
|
||||
|
||||
<TextView
|
||||
android:id="@+id/labelMenuEdit"
|
||||
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/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>
|
||||
|
||||
|
@ -18,35 +18,60 @@
|
||||
android:orientation="vertical"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/openMilestone"
|
||||
<LinearLayout
|
||||
android:id="@+id/milestonesFilterHeadFrame"
|
||||
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/isOpen"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="16sp"
|
||||
app:drawableStartCompat="@drawable/ic_milestone" />
|
||||
android:padding="8dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/closedMilestone"
|
||||
<TextView
|
||||
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_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/isClosed"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="16sp"
|
||||
app:drawableStartCompat="@drawable/ic_done" />
|
||||
android:layout_height="match_parent"
|
||||
app:flexWrap="wrap"
|
||||
app:alignItems="stretch"
|
||||
android:padding="8dp"
|
||||
app:alignContent="stretch" >
|
||||
|
||||
<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_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>
|
||||
|
||||
|
@ -18,35 +18,60 @@
|
||||
android:orientation="vertical"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/closeMilestone"
|
||||
<LinearLayout
|
||||
android:id="@+id/milestonesListHeadFrame"
|
||||
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/closeMilestone"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="16sp"
|
||||
app:drawableStartCompat="@drawable/ic_close" />
|
||||
android:padding="8dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/openMilestone"
|
||||
<TextView
|
||||
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_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/openMilestone"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="16sp"
|
||||
app:drawableStartCompat="@drawable/ic_check" />
|
||||
android:layout_height="match_parent"
|
||||
app:flexWrap="wrap"
|
||||
app:alignItems="stretch"
|
||||
android:padding="8dp"
|
||||
app:alignContent="stretch" >
|
||||
|
||||
<TextView
|
||||
android:id="@+id/closeMilestone"
|
||||
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_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>
|
||||
|
||||
|
@ -19,9 +19,9 @@
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/myIssuesFilterHeadFrame"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/repoCreate"
|
||||
android:padding="8dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
@ -37,9 +37,9 @@
|
||||
</LinearLayout>
|
||||
|
||||
<com.google.android.flexbox.FlexboxLayout
|
||||
android:id="@+id/myIssuesSection"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:id="@+id/repoCreateSection"
|
||||
app:flexWrap="wrap"
|
||||
app:alignItems="stretch"
|
||||
android:padding="8dp"
|
||||
@ -71,6 +71,19 @@
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
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>
|
||||
|
||||
</LinearLayout>
|
||||
|
@ -1,70 +1,92 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:paddingTop="6dp"
|
||||
android:paddingBottom="12dp"
|
||||
android:background="?attr/primaryBackgroundColor">
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:paddingTop="6dp"
|
||||
android:paddingBottom="12dp"
|
||||
android:background="?attr/primaryBackgroundColor">
|
||||
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<LinearLayout
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/markPinned"
|
||||
<LinearLayout
|
||||
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/pinNotification"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="16sp"
|
||||
app:drawableStartCompat="@drawable/ic_pin" />
|
||||
android:orientation="vertical"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/markRead"
|
||||
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/markAsRead"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="16sp"
|
||||
app:drawableStartCompat="@drawable/ic_unwatch" />
|
||||
<LinearLayout
|
||||
android:id="@+id/notificationsHeadFrame"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="8dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/markUnread"
|
||||
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/markAsUnread"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="16sp"
|
||||
app:drawableStartCompat="@drawable/ic_watchers" />
|
||||
<TextView
|
||||
android:id="@+id/bottomSheetHeader"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="@string/pageTitleNotifications"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="16sp" />
|
||||
|
||||
</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>
|
||||
|
@ -18,35 +18,60 @@
|
||||
android:orientation="vertical"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/unreadNotifications"
|
||||
<LinearLayout
|
||||
android:id="@+id/notificationsFilterHeadFrame"
|
||||
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/isUnread"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="16sp"
|
||||
app:drawableStartCompat="@drawable/ic_watchers" />
|
||||
android:padding="8dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/readNotifications"
|
||||
<TextView
|
||||
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_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/isRead"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="16sp"
|
||||
app:drawableStartCompat="@drawable/ic_unwatch" />
|
||||
android:layout_height="match_parent"
|
||||
app:flexWrap="wrap"
|
||||
app:alignItems="stretch"
|
||||
android:padding="8dp"
|
||||
app:alignContent="stretch" >
|
||||
|
||||
<TextView
|
||||
android:id="@+id/unreadNotifications"
|
||||
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/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>
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
|
@ -19,9 +19,9 @@
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/organizationHeadFrame"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/orgCreate"
|
||||
android:padding="8dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
@ -37,9 +37,9 @@
|
||||
</LinearLayout>
|
||||
|
||||
<com.google.android.flexbox.FlexboxLayout
|
||||
android:id="@+id/orgCreateSection"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:id="@+id/orgCreateSection"
|
||||
app:flexWrap="wrap"
|
||||
app:alignItems="stretch"
|
||||
android:padding="8dp"
|
||||
@ -94,6 +94,7 @@
|
||||
android:background="?attr/dividerColor" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/organizationShareHeadFrame"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="8dp"
|
||||
@ -131,6 +132,32 @@
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
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>
|
||||
|
||||
</LinearLayout>
|
||||
|
@ -18,35 +18,60 @@
|
||||
android:orientation="vertical"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/addNewMember"
|
||||
<LinearLayout
|
||||
android:id="@+id/orgTeamHeadFrame"
|
||||
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/addNewMember"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="16sp"
|
||||
app:drawableStartCompat="@drawable/ic_person_add" />
|
||||
android:padding="8dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/addRepo"
|
||||
<TextView
|
||||
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_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/addRmRepo"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="16sp"
|
||||
app:drawableStartCompat="@drawable/ic_repo" />
|
||||
android:layout_height="match_parent"
|
||||
app:flexWrap="wrap"
|
||||
app:alignItems="stretch"
|
||||
android:padding="8dp"
|
||||
app:alignContent="stretch" >
|
||||
|
||||
<TextView
|
||||
android:id="@+id/addRepo"
|
||||
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_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>
|
||||
|
||||
|
@ -18,20 +18,47 @@
|
||||
android:orientation="vertical"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/addNewEmailAddress"
|
||||
<LinearLayout
|
||||
android:id="@+id/myProfileHeadFrame"
|
||||
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/profileCreateNewEmailAddress"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="16sp"
|
||||
app:drawableStartCompat="@drawable/ic_email" />
|
||||
android:padding="8dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/bottomSheetHeader"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="@string/navProfile"
|
||||
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>
|
||||
|
||||
|
@ -18,35 +18,60 @@
|
||||
android:orientation="vertical"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/openPr"
|
||||
<LinearLayout
|
||||
android:id="@+id/prFilterHeadFrame"
|
||||
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/isOpen"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="16sp"
|
||||
app:drawableStartCompat="@drawable/ic_pull_request" />
|
||||
android:padding="8dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/closedPr"
|
||||
<TextView
|
||||
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_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/isClosed"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="16sp"
|
||||
app:drawableStartCompat="@drawable/ic_issue_closed" />
|
||||
android:layout_height="match_parent"
|
||||
app:flexWrap="wrap"
|
||||
app:alignItems="stretch"
|
||||
android:padding="8dp"
|
||||
app:alignContent="stretch" >
|
||||
|
||||
<TextView
|
||||
android:id="@+id/openPr"
|
||||
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/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>
|
||||
|
||||
|
@ -18,35 +18,60 @@
|
||||
android:orientation="vertical"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/releases"
|
||||
<LinearLayout
|
||||
android:id="@+id/releasesTagsHeadFrame"
|
||||
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/tabTextReleases"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="16sp"
|
||||
app:drawableStartCompat="@drawable/ic_release" />
|
||||
android:padding="8dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tags"
|
||||
<TextView
|
||||
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_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/tags"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="16sp"
|
||||
app:drawableStartCompat="@drawable/ic_label" />
|
||||
android:layout_height="match_parent"
|
||||
app:flexWrap="wrap"
|
||||
app:alignItems="stretch"
|
||||
android:padding="8dp"
|
||||
app:alignContent="stretch" >
|
||||
|
||||
<TextView
|
||||
android:id="@+id/releases"
|
||||
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_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>
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
|
@ -19,9 +19,9 @@
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/repoCreateHeadFrame"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/repoCreate"
|
||||
android:padding="8dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
@ -37,9 +37,9 @@
|
||||
</LinearLayout>
|
||||
|
||||
<com.google.android.flexbox.FlexboxLayout
|
||||
android:id="@+id/repoCreateSection"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:id="@+id/repoCreateSection"
|
||||
app:flexWrap="wrap"
|
||||
app:alignItems="stretch"
|
||||
android:padding="8dp"
|
||||
@ -146,6 +146,7 @@
|
||||
android:background="?attr/dividerColor" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/repoOthersHeadFrame"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="8dp"
|
||||
@ -163,6 +164,7 @@
|
||||
</LinearLayout>
|
||||
|
||||
<com.google.android.flexbox.FlexboxLayout
|
||||
android:id="@+id/repoOthersSection"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:flexWrap="wrap"
|
||||
@ -257,7 +259,7 @@
|
||||
app:layout_alignSelf="flex_start"
|
||||
android:gravity="center"
|
||||
app:drawableTopCompat="@drawable/ic_browser"
|
||||
android:text="@string/isOpen"
|
||||
android:text="@string/openInBrowser"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="16sp" />
|
||||
|
||||
|
@ -2,7 +2,6 @@
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
@ -26,207 +25,233 @@
|
||||
android:layout_marginBottom="5dp"
|
||||
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
|
||||
android:id="@+id/shareDivider"
|
||||
android:id="@+id/reactionDivider"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_height="4dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:layout_marginBottom="12dp"
|
||||
android:layout_marginStart="64dp"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:background="?attr/dividerColor" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/shareIssue"
|
||||
<LinearLayout
|
||||
android:id="@+id/bottomSheetHeaderFrame"
|
||||
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/shareIssue"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="16sp"
|
||||
app:drawableStartCompat="@drawable/ic_share" />
|
||||
android:padding="8dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/copyIssueUrl"
|
||||
<TextView
|
||||
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_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/copyIssueUrl"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="16sp"
|
||||
app:drawableStartCompat="@drawable/ic_copy" />
|
||||
android:layout_height="match_parent"
|
||||
app:flexWrap="wrap"
|
||||
app:alignItems="stretch"
|
||||
android:padding="8dp"
|
||||
app:alignContent="stretch" >
|
||||
|
||||
<TextView
|
||||
android:id="@+id/openFilesDiff"
|
||||
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_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
|
||||
android:id="@+id/dividerCloseReopenIssue"
|
||||
android:id="@+id/issuePrDivider"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:layout_marginBottom="12dp"
|
||||
android:layout_marginStart="64dp"
|
||||
android:layout_height="4dp"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:background="?attr/dividerColor" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/closeIssue"
|
||||
<com.google.android.flexbox.FlexboxLayout
|
||||
android:id="@+id/issuePrShareSection"
|
||||
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/closeIssue"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="16sp"
|
||||
app:drawableStartCompat="@drawable/ic_issue_closed" />
|
||||
android:layout_height="match_parent"
|
||||
app:flexWrap="wrap"
|
||||
app:alignItems="stretch"
|
||||
android:padding="8dp"
|
||||
app:alignContent="stretch" >
|
||||
|
||||
<TextView
|
||||
android:id="@+id/copyIssueUrl"
|
||||
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/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>
|
||||
|
||||
|
@ -18,20 +18,47 @@
|
||||
android:orientation="vertical"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tagMenuDelete"
|
||||
<LinearLayout
|
||||
android:id="@+id/tagsListHeadFrame"
|
||||
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/menuDeleteText"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="16sp"
|
||||
app:drawableStartCompat="@drawable/ic_delete" />
|
||||
android:padding="8dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/bottomSheetHeader"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="@string/tags"
|
||||
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>
|
||||
|
||||
|
@ -18,20 +18,47 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/followUnfollowUser"
|
||||
<LinearLayout
|
||||
android:id="@+id/usersProfileHeadFrame"
|
||||
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/userFollow"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="16sp"
|
||||
app:drawableStartCompat="@drawable/ic_person_add" />
|
||||
android:padding="8dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/bottomSheetHeader"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="@string/pageTitleUsers"
|
||||
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>
|
||||
|
||||
|
55
app/src/main/res/layout/custom_pr_info_dialog.xml
Normal file
55
app/src/main/res/layout/custom_pr_info_dialog.xml
Normal 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>
|
@ -94,7 +94,7 @@
|
||||
android:id="@+id/releaseTag"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="5dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:singleLine="true"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="14sp" />
|
||||
@ -119,7 +119,7 @@
|
||||
android:id="@+id/releaseCommitSha"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="5dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:singleLine="true"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="14sp" />
|
||||
@ -143,7 +143,7 @@
|
||||
android:id="@+id/releaseDate"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="5dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:singleLine="true"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="14sp" />
|
||||
|
12
app/src/main/res/menu/pr_info_menu.xml
Normal file
12
app/src/main/res/menu/pr_info_menu.xml
Normal 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>
|
@ -123,6 +123,7 @@
|
||||
<string name="tabTextBranches">Branches</string>
|
||||
<string name="tabTextCollaborators">Collaborators</string>
|
||||
<string name="tabPullRequests">Pull Requests</string>
|
||||
<string name="pullRequest">Pull Request</string>
|
||||
|
||||
<string name="infoTabRepoSize">Size</string>
|
||||
<string name="infoTabRepoDefaultBranch">Default Branch</string>
|
||||
@ -145,6 +146,7 @@
|
||||
<string name="issueMilestone">Milestone %1$s</string>
|
||||
<string name="dueDate">Due on %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="commentEmptyError">Please write your comment</string>
|
||||
<string name="commentSuccess">Comment posted</string>
|
||||
@ -285,8 +287,6 @@
|
||||
<string name="teamShowAll">show all</string>
|
||||
<string name="orgMember">Org 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="addTeamMemberTitle">Add\u0020</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>
|
||||
|
||||
<!-- admin -->
|
||||
<string name="adminCreateNewUser">Add New User</string>
|
||||
<string name="adminCreateNewUser">New User</string>
|
||||
<string name="adminUsers">System Users</string>
|
||||
<string name="userRoleAdmin">Admin</string>
|
||||
<string name="adminCron">Cron Tasks</string>
|
||||
@ -502,6 +502,10 @@
|
||||
<string name="repository">Repository</string>
|
||||
<string name="team">Team</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 -->
|
||||
|
||||
<string name="exploreUsers">Explore users</string>
|
||||
@ -525,8 +529,6 @@
|
||||
<string name="loginTokenError">Token is required</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="editPrSuccessMessage">Pull Request updated</string>
|
||||
<string name="fileDiffViewHeader">%1$s Files Changed</string>
|
||||
@ -534,7 +536,6 @@
|
||||
<string name="updatePullRequestText">Update Pull Request</string>
|
||||
<string name="openFileDiffText">Show Changed Files</string>
|
||||
<string name="mergePullRequestText">Merge Pull Request</string>
|
||||
<string name="deletePrHeadBranch">Delete head branch</string>
|
||||
<string name="deleteBranchSuccess">Branch deleted successfully</string>
|
||||
<string name="deleteBranchError">Could not delete branch</string>
|
||||
<string name="deleteBranchErrorNotFound">Branch does not exist</string>
|
||||
@ -553,8 +554,8 @@
|
||||
<string name="mergeStrategy">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="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="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>
|
||||
@ -567,7 +568,6 @@
|
||||
|
||||
<string name="sizeCopy">Size</string>
|
||||
<string name="shareIssue">Share Issue</string>
|
||||
<string name="sharePr">Share Pull Request</string>
|
||||
<string name="shareRepository">Share Repository</string>
|
||||
<string name="createRepository">Create Repository</string>
|
||||
<string name="commitTitle">Commits</string>
|
||||
@ -641,9 +641,9 @@
|
||||
<string name="pollingDelaySelectedText">%d Minutes</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="markAsRead">Mark as Read</string>
|
||||
<string name="markAsUnread">Mark as Unread</string>
|
||||
<string name="pinNotification">Pin Notification</string>
|
||||
<string name="markAsRead">Mark Read</string>
|
||||
<string name="markAsUnread">Mark Unread</string>
|
||||
<string name="pinNotification">Pin</string>
|
||||
<string name="markedNotificationsAsRead">Successfully marked all notifications as read</string>
|
||||
<string name="notificationsHintText">Polling delay, light, vibration</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="prClosed">Pull Request closed</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="launchApp">Go to App</string>
|
||||
@ -742,8 +743,6 @@
|
||||
<string name="updateStrategyRebase">Rebase</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="tags">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="deleteTagTitle">Delete tag %s</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="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>
|
||||
|
Loading…
x
Reference in New Issue
Block a user