mirror of
https://codeberg.org/gitnex/GitNex.git
synced 2024-12-16 15:48:13 +08:00
Revamp app UI according to Material design (#1185)
As title Co-authored-by: M M Arif <mmarif@swatian.com> Co-authored-by: 6543 <6543@obermui.de> Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/1185 Reviewed-by: 6543 <6543@noreply.codeberg.org>
This commit is contained in:
parent
3d711a81b3
commit
848e7ef8fa
@ -1,11 +1,11 @@
|
||||
apply plugin: 'com.android.application'
|
||||
|
||||
android {
|
||||
compileSdkVersion 33
|
||||
compileSdkVersion 32
|
||||
defaultConfig {
|
||||
applicationId "org.mian.gitnex"
|
||||
minSdkVersion 23
|
||||
targetSdkVersion 33
|
||||
targetSdkVersion 32
|
||||
versionCode 445
|
||||
versionName "4.5.0-dev"
|
||||
multiDexEnabled true
|
||||
@ -58,8 +58,8 @@ dependencies {
|
||||
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
||||
implementation 'androidx.appcompat:appcompat:1.5.0'
|
||||
implementation 'com.google.android.material:material:1.6.1'
|
||||
implementation 'androidx.compose.material3:material3:1.0.0-alpha16'
|
||||
implementation 'androidx.compose.material3:material3-window-size-class:1.0.0-alpha16'
|
||||
implementation 'androidx.compose.material3:material3:1.0.0-alpha15'
|
||||
implementation 'androidx.compose.material3:material3-window-size-class:1.0.0-alpha15'
|
||||
implementation 'androidx.viewpager2:viewpager2:1.1.0-beta01'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
|
||||
implementation "androidx.legacy:legacy-support-v4:1.0.0"
|
||||
|
@ -3,7 +3,11 @@ package org.mian.gitnex.actions;
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import androidx.annotation.NonNull;
|
||||
import org.gitnex.tea4j.v2.models.*;
|
||||
import org.gitnex.tea4j.v2.models.Comment;
|
||||
import org.gitnex.tea4j.v2.models.CreateIssueCommentOption;
|
||||
import org.gitnex.tea4j.v2.models.EditIssueCommentOption;
|
||||
import org.gitnex.tea4j.v2.models.EditIssueOption;
|
||||
import org.gitnex.tea4j.v2.models.Issue;
|
||||
import org.mian.gitnex.R;
|
||||
import org.mian.gitnex.activities.BaseActivity;
|
||||
import org.mian.gitnex.activities.IssueDetailActivity;
|
||||
|
@ -6,7 +6,6 @@ import android.view.View;
|
||||
import android.view.inputmethod.EditorInfo;
|
||||
import android.view.inputmethod.InputMethodManager;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.DividerItemDecoration;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import org.gitnex.tea4j.v2.models.InlineResponse2001;
|
||||
import org.gitnex.tea4j.v2.models.User;
|
||||
@ -101,8 +100,6 @@ public class AddCollaboratorToRepositoryActivity extends BaseActivity {
|
||||
|
||||
activityAddCollaboratorToRepositoryBinding.recyclerViewUserSearch.setHasFixedSize(true);
|
||||
activityAddCollaboratorToRepositoryBinding.recyclerViewUserSearch.setLayoutManager(new LinearLayoutManager(ctx));
|
||||
DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(activityAddCollaboratorToRepositoryBinding.recyclerViewUserSearch.getContext(), DividerItemDecoration.VERTICAL);
|
||||
activityAddCollaboratorToRepositoryBinding.recyclerViewUserSearch.addItemDecoration(dividerItemDecoration);
|
||||
|
||||
activityAddCollaboratorToRepositoryBinding.progressBar.setVisibility(View.VISIBLE);
|
||||
|
||||
|
@ -11,12 +11,11 @@ import android.widget.ImageView;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.TextView;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.DividerItemDecoration;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import org.gitnex.tea4j.v2.models.InlineResponse2001;
|
||||
import org.gitnex.tea4j.v2.models.User;
|
||||
import org.mian.gitnex.adapters.UserSearchForTeamMemberAdapter;
|
||||
import org.mian.gitnex.adapters.OrganizationAddUserToTeamMemberAdapter;
|
||||
import org.mian.gitnex.clients.RetrofitClient;
|
||||
import org.mian.gitnex.databinding.ActivityAddNewTeamMemberBinding;
|
||||
import java.util.ArrayList;
|
||||
@ -38,7 +37,7 @@ public class AddNewTeamMemberActivity extends BaseActivity {
|
||||
|
||||
private RecyclerView mRecyclerView;
|
||||
private List<User> dataList;
|
||||
private UserSearchForTeamMemberAdapter adapter;
|
||||
private OrganizationAddUserToTeamMemberAdapter adapter;
|
||||
|
||||
private long teamId;
|
||||
|
||||
@ -70,9 +69,6 @@ public class AddNewTeamMemberActivity extends BaseActivity {
|
||||
mRecyclerView.setHasFixedSize(true);
|
||||
mRecyclerView.setLayoutManager(new LinearLayoutManager(ctx));
|
||||
|
||||
DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(mRecyclerView.getContext(), DividerItemDecoration.VERTICAL);
|
||||
mRecyclerView.addItemDecoration(dividerItemDecoration);
|
||||
|
||||
dataList = new ArrayList<>();
|
||||
|
||||
addNewTeamMember.addTextChangedListener(new TextWatcher() {
|
||||
@ -82,7 +78,7 @@ public class AddNewTeamMemberActivity extends BaseActivity {
|
||||
|
||||
if(!addNewTeamMember.getText().toString().equals("") && addNewTeamMember.getText().toString().length() > 1) {
|
||||
|
||||
adapter = new UserSearchForTeamMemberAdapter(dataList, ctx, Math.toIntExact(teamId), getIntent().getStringExtra("orgName"));
|
||||
adapter = new OrganizationAddUserToTeamMemberAdapter(dataList, ctx, Math.toIntExact(teamId), getIntent().getStringExtra("orgName"));
|
||||
loadUserSearchList(addNewTeamMember.getText().toString());
|
||||
}
|
||||
}
|
||||
|
@ -3,11 +3,10 @@ package org.mian.gitnex.activities;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.DividerItemDecoration;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import org.gitnex.tea4j.v2.models.Repository;
|
||||
import org.mian.gitnex.R;
|
||||
import org.mian.gitnex.adapters.TeamRepositoriesAdapter;
|
||||
import org.mian.gitnex.adapters.OrganizationTeamRepositoriesAdapter;
|
||||
import org.mian.gitnex.clients.RetrofitClient;
|
||||
import org.mian.gitnex.databinding.AddNewTeamRepositoryBinding;
|
||||
import org.mian.gitnex.helpers.Constants;
|
||||
@ -27,7 +26,7 @@ public class AddNewTeamRepoActivity extends BaseActivity {
|
||||
private AddNewTeamRepositoryBinding addNewTeamRepositoryBinding;
|
||||
private View.OnClickListener onClickListener;
|
||||
private List<Repository> dataList;
|
||||
private TeamRepositoriesAdapter adapter;
|
||||
private OrganizationTeamRepositoriesAdapter adapter;
|
||||
private int resultLimit;
|
||||
|
||||
private long teamId;
|
||||
@ -51,9 +50,6 @@ public class AddNewTeamRepoActivity extends BaseActivity {
|
||||
addNewTeamRepositoryBinding.recyclerViewTeamRepos.setHasFixedSize(true);
|
||||
addNewTeamRepositoryBinding.recyclerViewTeamRepos.setLayoutManager(new LinearLayoutManager(ctx));
|
||||
|
||||
DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(addNewTeamRepositoryBinding.recyclerViewTeamRepos.getContext(), DividerItemDecoration.VERTICAL);
|
||||
addNewTeamRepositoryBinding.recyclerViewTeamRepos.addItemDecoration(dividerItemDecoration);
|
||||
|
||||
dataList = new ArrayList<>();
|
||||
|
||||
loadRepos();
|
||||
@ -78,7 +74,7 @@ public class AddNewTeamRepoActivity extends BaseActivity {
|
||||
dataList.clear();
|
||||
dataList.addAll(response.body());
|
||||
|
||||
adapter = new TeamRepositoriesAdapter(dataList, ctx, Math.toIntExact(teamId), getIntent().getStringExtra("orgName"), teamName);
|
||||
adapter = new OrganizationTeamRepositoriesAdapter(dataList, ctx, Math.toIntExact(teamId), getIntent().getStringExtra("orgName"), teamName);
|
||||
|
||||
addNewTeamRepositoryBinding.recyclerViewTeamRepos.setAdapter(adapter);
|
||||
addNewTeamRepositoryBinding.noData.setVisibility(View.GONE);
|
||||
|
@ -7,7 +7,6 @@ import android.os.Looper;
|
||||
import android.view.View;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
import androidx.recyclerview.widget.DividerItemDecoration;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import org.mian.gitnex.adapters.AdminCronTasksAdapter;
|
||||
import org.mian.gitnex.databinding.ActivityAdminCronTasksBinding;
|
||||
@ -20,11 +19,13 @@ import org.mian.gitnex.viewmodels.AdminCronTasksViewModel;
|
||||
|
||||
public class AdminCronTasksActivity extends BaseActivity {
|
||||
|
||||
private final int PAGE = 1;
|
||||
private AdminCronTasksViewModel adminCronTasksViewModel;
|
||||
private View.OnClickListener onClickListener;
|
||||
private AdminCronTasksAdapter adapter;
|
||||
|
||||
private ActivityAdminCronTasksBinding activityAdminCronTasksBinding;
|
||||
|
||||
private final int PAGE = 1;
|
||||
private int resultLimit;
|
||||
|
||||
@Override
|
||||
@ -46,9 +47,6 @@ public class AdminCronTasksActivity extends BaseActivity {
|
||||
activityAdminCronTasksBinding.recyclerView.setHasFixedSize(true);
|
||||
activityAdminCronTasksBinding.recyclerView.setLayoutManager(new LinearLayoutManager(ctx));
|
||||
|
||||
DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(activityAdminCronTasksBinding.recyclerView.getContext(), DividerItemDecoration.VERTICAL);
|
||||
activityAdminCronTasksBinding.recyclerView.addItemDecoration(dividerItemDecoration);
|
||||
|
||||
activityAdminCronTasksBinding.pullToRefresh.setOnRefreshListener(() -> new Handler(Looper.getMainLooper()).postDelayed(() -> {
|
||||
|
||||
activityAdminCronTasksBinding.progressBar.setVisibility(View.VISIBLE);
|
||||
|
@ -12,7 +12,6 @@ import android.view.inputmethod.EditorInfo;
|
||||
import androidx.appcompat.widget.SearchView;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
import androidx.recyclerview.widget.DividerItemDecoration;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import org.mian.gitnex.R;
|
||||
import org.mian.gitnex.adapters.AdminGetUsersAdapter;
|
||||
@ -55,8 +54,6 @@ public class AdminGetUsersActivity extends BaseActivity implements BottomSheetLi
|
||||
|
||||
activityAdminGetUsersBinding.recyclerView.setHasFixedSize(true);
|
||||
activityAdminGetUsersBinding.recyclerView.setLayoutManager(new LinearLayoutManager(ctx));
|
||||
DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(activityAdminGetUsersBinding.recyclerView.getContext(), DividerItemDecoration.VERTICAL);
|
||||
activityAdminGetUsersBinding.recyclerView.addItemDecoration(dividerItemDecoration);
|
||||
|
||||
activityAdminGetUsersBinding.pullToRefresh.setOnRefreshListener(() -> new Handler(Looper.getMainLooper()).postDelayed(() -> {
|
||||
|
||||
@ -69,6 +66,8 @@ public class AdminGetUsersActivity extends BaseActivity implements BottomSheetLi
|
||||
fetchDataAsync();
|
||||
}
|
||||
|
||||
;
|
||||
|
||||
private void fetchDataAsync() {
|
||||
|
||||
AdminGetUsersViewModel adminUsersModel = new ViewModelProvider(this).get(AdminGetUsersViewModel.class);
|
||||
|
@ -7,7 +7,6 @@ import android.os.Looper;
|
||||
import android.view.View;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
import androidx.recyclerview.widget.DividerItemDecoration;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import org.mian.gitnex.R;
|
||||
import org.mian.gitnex.adapters.AdminUnadoptedReposAdapter;
|
||||
@ -55,9 +54,6 @@ public class AdminUnadoptedReposActivity extends BaseActivity {
|
||||
binding.recyclerView.setHasFixedSize(true);
|
||||
binding.recyclerView.setLayoutManager(new LinearLayoutManager(ctx));
|
||||
|
||||
DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(binding.recyclerView.getContext(), DividerItemDecoration.VERTICAL);
|
||||
binding.recyclerView.addItemDecoration(dividerItemDecoration);
|
||||
|
||||
binding.pullToRefresh.setOnRefreshListener(() -> new Handler(Looper.getMainLooper()).postDelayed(() -> {
|
||||
|
||||
binding.pullToRefresh.setRefreshing(false);
|
||||
|
@ -69,7 +69,7 @@ public class CodeEditorActivity extends BaseActivity {
|
||||
// Setup Line number feature
|
||||
binding.codeView.setEnableLineNumber(true);
|
||||
binding.codeView.setLineNumberTextColor(Color.GRAY);
|
||||
binding.codeView.setLineNumberTextSize(44f);
|
||||
binding.codeView.setLineNumberTextSize(32f);
|
||||
|
||||
// Setup Auto indenting feature
|
||||
binding.codeView.setTabLength(4);
|
||||
|
@ -17,7 +17,7 @@ import org.gitnex.tea4j.v2.models.Team;
|
||||
import org.mian.gitnex.R;
|
||||
import org.mian.gitnex.clients.RetrofitClient;
|
||||
import org.mian.gitnex.databinding.ActivityCreateTeamByOrgBinding;
|
||||
import org.mian.gitnex.fragments.TeamsByOrgFragment;
|
||||
import org.mian.gitnex.fragments.OrganizationTeamsFragment;
|
||||
import org.mian.gitnex.helpers.AlertDialogs;
|
||||
import org.mian.gitnex.helpers.AppUtil;
|
||||
import org.mian.gitnex.helpers.Toasty;
|
||||
@ -33,10 +33,6 @@ import retrofit2.Callback;
|
||||
|
||||
public class CreateTeamByOrgActivity extends BaseActivity implements View.OnClickListener {
|
||||
|
||||
private final String[] permissionList = {"Read", "Write", "Admin"};
|
||||
private final String[] accessControlsList = new String[]{"Code", "Issues", "Pull Request", "Releases", "Wiki", "External Wiki", "External Issues"};
|
||||
private final boolean[] selectedAccessControlsTrueFalse = new boolean[]{false, false, false, false, false, false, false};
|
||||
public int permissionSelectedChoice = -1;
|
||||
private View.OnClickListener onClickListener;
|
||||
private TextView teamName;
|
||||
private TextView teamDesc;
|
||||
@ -45,8 +41,15 @@ public class CreateTeamByOrgActivity extends BaseActivity implements View.OnClic
|
||||
private TextView teamAccessControls;
|
||||
private TextView teamAccessControlsArray;
|
||||
private Button createTeamButton;
|
||||
private final String[] permissionList = {"Read", "Write", "Admin"};
|
||||
public int permissionSelectedChoice = -1;
|
||||
|
||||
private final String[] accessControlsList = new String[]{"Code", "Issues", "Pull Request", "Releases", "Wiki", "External Wiki", "External Issues"};
|
||||
|
||||
private List<String> pushAccessList;
|
||||
|
||||
private final boolean[] selectedAccessControlsTrueFalse = new boolean[]{false, false, false, false, false, false, false};
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
|
||||
@ -279,7 +282,7 @@ public class CreateTeamByOrgActivity extends BaseActivity implements View.OnClic
|
||||
|
||||
if(response2.code() == 201) {
|
||||
|
||||
TeamsByOrgFragment.resumeTeams = true;
|
||||
OrganizationTeamsFragment.resumeTeams = true;
|
||||
|
||||
Toasty.success(ctx, getString(R.string.teamCreated));
|
||||
finish();
|
||||
|
@ -8,7 +8,12 @@ import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.util.Log;
|
||||
import android.view.*;
|
||||
import android.view.Gravity;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuInflater;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.RelativeLayout;
|
||||
@ -16,17 +21,22 @@ import android.widget.ScrollView;
|
||||
import androidx.activity.result.ActivityResultLauncher;
|
||||
import androidx.activity.result.contract.ActivityResultContracts;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.core.content.res.ResourcesCompat;
|
||||
import androidx.core.text.HtmlCompat;
|
||||
import androidx.core.widget.ImageViewCompat;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import com.amulyakhare.textdrawable.TextDrawable;
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
|
||||
import com.vdurmont.emoji.EmojiParser;
|
||||
import org.gitnex.tea4j.v2.models.*;
|
||||
import org.gitnex.tea4j.v2.models.EditIssueOption;
|
||||
import org.gitnex.tea4j.v2.models.Issue;
|
||||
import org.gitnex.tea4j.v2.models.IssueLabelsOption;
|
||||
import org.gitnex.tea4j.v2.models.Label;
|
||||
import org.gitnex.tea4j.v2.models.PullRequest;
|
||||
import org.gitnex.tea4j.v2.models.Repository;
|
||||
import org.gitnex.tea4j.v2.models.User;
|
||||
import org.gitnex.tea4j.v2.models.WatchInfo;
|
||||
import org.mian.gitnex.R;
|
||||
import org.mian.gitnex.actions.AssigneesActions;
|
||||
import org.mian.gitnex.actions.LabelsActions;
|
||||
@ -42,14 +52,28 @@ import org.mian.gitnex.databinding.CustomPrInfoDialogBinding;
|
||||
import org.mian.gitnex.fragments.BottomSheetReplyFragment;
|
||||
import org.mian.gitnex.fragments.BottomSheetSingleIssueFragment;
|
||||
import org.mian.gitnex.fragments.IssuesFragment;
|
||||
import org.mian.gitnex.helpers.*;
|
||||
import org.mian.gitnex.helpers.AlertDialogs;
|
||||
import org.mian.gitnex.helpers.AppUtil;
|
||||
import org.mian.gitnex.helpers.ClickListener;
|
||||
import org.mian.gitnex.helpers.ColorInverter;
|
||||
import org.mian.gitnex.helpers.LabelWidthCalculator;
|
||||
import org.mian.gitnex.helpers.Markdown;
|
||||
import org.mian.gitnex.helpers.RoundedTransformation;
|
||||
import org.mian.gitnex.helpers.TimeHelper;
|
||||
import org.mian.gitnex.helpers.TinyDB;
|
||||
import org.mian.gitnex.helpers.Toasty;
|
||||
import org.mian.gitnex.helpers.contexts.IssueContext;
|
||||
import org.mian.gitnex.structs.BottomSheetListener;
|
||||
import org.mian.gitnex.viewmodels.IssueCommentsViewModel;
|
||||
import org.mian.gitnex.views.ReactionList;
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Objects;
|
||||
import retrofit2.Call;
|
||||
import retrofit2.Callback;
|
||||
import retrofit2.Response;
|
||||
@ -126,9 +150,6 @@ public class IssueDetailActivity extends BaseActivity implements LabelsListAdapt
|
||||
viewBinding.recyclerView.setNestedScrollingEnabled(false);
|
||||
viewBinding.recyclerView.setLayoutManager(new LinearLayoutManager(ctx));
|
||||
|
||||
RecyclerView.ItemDecoration dividerItemDecoration = new DividerItemDecorator(ContextCompat.getDrawable(this, R.drawable.shape_list_divider));
|
||||
viewBinding.recyclerView.addItemDecoration(dividerItemDecoration);
|
||||
|
||||
viewBinding.addNewComment.setOnClickListener(v -> {
|
||||
|
||||
BottomSheetReplyFragment bottomSheetReplyFragment = BottomSheetReplyFragment.newInstance(new Bundle(), issue);
|
||||
@ -354,7 +375,7 @@ public class IssueDetailActivity extends BaseActivity implements LabelsListAdapt
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCreateOptionsMenu(Menu menu) {
|
||||
public boolean onCreateOptionsMenu(@NonNull Menu menu) {
|
||||
|
||||
MenuInflater inflater = getMenuInflater();
|
||||
showMenu = () -> {
|
||||
@ -463,11 +484,6 @@ public class IssueDetailActivity extends BaseActivity implements LabelsListAdapt
|
||||
|
||||
assert issueCommentsMain != null;
|
||||
|
||||
if(issueCommentsMain.size() > 0) {
|
||||
|
||||
viewBinding.divider.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString("repoOwner", repoOwner);
|
||||
bundle.putString("repoName", repoName);
|
||||
@ -570,30 +586,56 @@ public class IssueDetailActivity extends BaseActivity implements LabelsListAdapt
|
||||
if(issue.getIssue().getPullRequest().isMerged()) { // merged
|
||||
|
||||
viewBinding.issuePrState.setImageResource(R.drawable.ic_pull_request);
|
||||
ImageViewCompat.setImageTintList(viewBinding.issuePrState, ColorStateList.valueOf(ctx.getResources().getColor(R.color.iconPrMergedColor)));
|
||||
ImageViewCompat.setImageTintList(viewBinding.issuePrState, ColorStateList.valueOf(ctx.getResources().getColor(R.color.iconPrMergedColor, null)));
|
||||
}
|
||||
else if(!issue.getIssue().getPullRequest().isMerged() && issue.getIssue().getState().equals("closed")) { // closed
|
||||
|
||||
viewBinding.issuePrState.setImageResource(R.drawable.ic_pull_request);
|
||||
ImageViewCompat.setImageTintList(viewBinding.issuePrState, ColorStateList.valueOf(ctx.getResources().getColor(R.color.iconIssuePrClosedColor)));
|
||||
ImageViewCompat.setImageTintList(viewBinding.issuePrState, ColorStateList.valueOf(ctx.getResources().getColor(R.color.iconIssuePrClosedColor, null)));
|
||||
}
|
||||
else { // open
|
||||
|
||||
viewBinding.issuePrState.setImageResource(R.drawable.ic_pull_request);
|
||||
ImageViewCompat.setImageTintList(viewBinding.issuePrState, ColorStateList.valueOf(ctx.getResources().getColor(R.color.darkGreen)));
|
||||
if(tinyDB.getInt("themeId") == 3) {
|
||||
ImageViewCompat.setImageTintList(viewBinding.issuePrState, ColorStateList.valueOf(ctx.getResources().getColor(R.color.retroThemeColorPrimary, null)));
|
||||
}
|
||||
else if(tinyDB.getInt("themeId") == 4) {
|
||||
if(TimeHelper.timeBetweenHours(tinyDB.getInt("darkThemeTimeHour", 18), tinyDB.getInt("lightThemeTimeHour", 6), tinyDB.getInt("darkThemeTimeMinute", 0), tinyDB.getInt("lightThemeTimeMinute", 0))) {
|
||||
ImageViewCompat.setImageTintList(viewBinding.issuePrState, ColorStateList.valueOf(ctx.getResources().getColor(R.color.darkGreen, null)));
|
||||
}
|
||||
else {
|
||||
ImageViewCompat.setImageTintList(viewBinding.issuePrState, ColorStateList.valueOf(ctx.getResources().getColor(R.color.retroThemeColorPrimary, null)));
|
||||
}
|
||||
}
|
||||
else {
|
||||
ImageViewCompat.setImageTintList(viewBinding.issuePrState, ColorStateList.valueOf(ctx.getResources().getColor(R.color.darkGreen, null)));
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(issue.getIssue().getState().equals("closed")) { // issue closed
|
||||
loadingFinishedPr = true;
|
||||
updateMenuState();
|
||||
viewBinding.issuePrState.setImageResource(R.drawable.ic_issue);
|
||||
ImageViewCompat.setImageTintList(viewBinding.issuePrState, ColorStateList.valueOf(ctx.getResources().getColor(R.color.iconIssuePrClosedColor)));
|
||||
ImageViewCompat.setImageTintList(viewBinding.issuePrState, ColorStateList.valueOf(ctx.getResources().getColor(R.color.iconIssuePrClosedColor, null)));
|
||||
}
|
||||
else {
|
||||
loadingFinishedPr = true;
|
||||
updateMenuState();
|
||||
viewBinding.issuePrState.setImageResource(R.drawable.ic_issue);
|
||||
ImageViewCompat.setImageTintList(viewBinding.issuePrState, ColorStateList.valueOf(ctx.getResources().getColor(R.color.darkGreen)));
|
||||
if(tinyDB.getInt("themeId") == 3) {
|
||||
ImageViewCompat.setImageTintList(viewBinding.issuePrState, ColorStateList.valueOf(ctx.getResources().getColor(R.color.retroThemeColorPrimary, null)));
|
||||
}
|
||||
else if(tinyDB.getInt("themeId") == 4) {
|
||||
if(TimeHelper.timeBetweenHours(tinyDB.getInt("darkThemeTimeHour", 18), tinyDB.getInt("lightThemeTimeHour", 6), tinyDB.getInt("darkThemeTimeMinute", 0), tinyDB.getInt("lightThemeTimeMinute", 0))) {
|
||||
ImageViewCompat.setImageTintList(viewBinding.issuePrState, ColorStateList.valueOf(ctx.getResources().getColor(R.color.darkGreen, null)));
|
||||
}
|
||||
else {
|
||||
ImageViewCompat.setImageTintList(viewBinding.issuePrState, ColorStateList.valueOf(ctx.getResources().getColor(R.color.retroThemeColorPrimary, null)));
|
||||
}
|
||||
}
|
||||
else {
|
||||
ImageViewCompat.setImageTintList(viewBinding.issuePrState, ColorStateList.valueOf(ctx.getResources().getColor(R.color.darkGreen, null)));
|
||||
}
|
||||
}
|
||||
|
||||
TinyDB tinyDb = TinyDB.getInstance(appCtx);
|
||||
|
@ -203,7 +203,7 @@ public class MainActivity extends BaseActivity implements NavigationView.OnNavig
|
||||
|
||||
if(!userAvatarNav.equals("")) {
|
||||
|
||||
int avatarRadius = AppUtil.getPixelsFromDensity(ctx, 3);
|
||||
int avatarRadius = AppUtil.getPixelsFromDensity(ctx, 60);
|
||||
|
||||
PicassoService.getInstance(ctx).get().load(userAvatarNav).placeholder(R.drawable.loader_animated).transform(new RoundedTransformation(avatarRadius, 0)).resize(160, 160).centerCrop()
|
||||
.into(userAvatar);
|
||||
|
@ -3,7 +3,11 @@ package org.mian.gitnex.activities;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Typeface;
|
||||
import android.os.Bundle;
|
||||
import android.view.*;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuInflater;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.TextView;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
@ -15,7 +19,12 @@ import com.google.android.material.tabs.TabLayout;
|
||||
import org.gitnex.tea4j.v2.models.OrganizationPermissions;
|
||||
import org.mian.gitnex.R;
|
||||
import org.mian.gitnex.clients.RetrofitClient;
|
||||
import org.mian.gitnex.fragments.*;
|
||||
import org.mian.gitnex.fragments.BottomSheetOrganizationFragment;
|
||||
import org.mian.gitnex.fragments.OrganizationInfoFragment;
|
||||
import org.mian.gitnex.fragments.OrganizationLabelsFragment;
|
||||
import org.mian.gitnex.fragments.OrganizationMembersFragment;
|
||||
import org.mian.gitnex.fragments.OrganizationRepositoriesFragment;
|
||||
import org.mian.gitnex.fragments.OrganizationTeamsFragment;
|
||||
import org.mian.gitnex.helpers.AppUtil;
|
||||
import org.mian.gitnex.structs.BottomSheetListener;
|
||||
import java.util.Objects;
|
||||
@ -225,22 +234,22 @@ public class OrganizationDetailActivity extends BaseActivity implements BottomSh
|
||||
return OrganizationInfoFragment.newInstance(orgName);
|
||||
case 1: // repos
|
||||
|
||||
return RepositoriesByOrgFragment.newInstance(orgName);
|
||||
return OrganizationRepositoriesFragment.newInstance(orgName);
|
||||
case 2: // labels
|
||||
|
||||
return OrganizationLabelsFragment.newInstance(orgName);
|
||||
case 3: // teams / members
|
||||
|
||||
if(isMember) {
|
||||
return TeamsByOrgFragment.newInstance(orgName, permissions);
|
||||
return OrganizationTeamsFragment.newInstance(orgName, permissions);
|
||||
}
|
||||
else {
|
||||
return MembersByOrgFragment.newInstance(orgName);
|
||||
return OrganizationMembersFragment.newInstance(orgName);
|
||||
}
|
||||
case 4: // members
|
||||
|
||||
if(isMember) {
|
||||
return MembersByOrgFragment.newInstance(orgName);
|
||||
return OrganizationMembersFragment.newInstance(orgName);
|
||||
}
|
||||
}
|
||||
return fragment;
|
||||
|
@ -10,16 +10,10 @@ import android.view.MenuInflater;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.inputmethod.EditorInfo;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.TextView;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.widget.SearchView;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
import androidx.recyclerview.widget.DividerItemDecoration;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
|
||||
import org.gitnex.tea4j.v2.models.Repository;
|
||||
import org.mian.gitnex.R;
|
||||
import org.mian.gitnex.adapters.RepoForksAdapter;
|
||||
@ -39,16 +33,13 @@ import retrofit2.Response;
|
||||
|
||||
public class RepoForksActivity extends BaseActivity {
|
||||
|
||||
private ActivityRepoForksBinding activityRepoForksBinding;
|
||||
private final String TAG = "RepositoryForks";
|
||||
private TextView noData;
|
||||
private ProgressBar progressBar;
|
||||
|
||||
private int resultLimit;
|
||||
private int pageSize = 1;
|
||||
|
||||
private RecyclerView recyclerView;
|
||||
private List<Repository> forksList;
|
||||
private RepoForksAdapter adapter;
|
||||
private ProgressBar progressLoadMore;
|
||||
|
||||
private RepositoryContext repository;
|
||||
|
||||
@ -58,7 +49,7 @@ public class RepoForksActivity extends BaseActivity {
|
||||
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
ActivityRepoForksBinding activityRepoForksBinding = ActivityRepoForksBinding.inflate(getLayoutInflater());
|
||||
activityRepoForksBinding = ActivityRepoForksBinding.inflate(getLayoutInflater());
|
||||
setContentView(activityRepoForksBinding.getRoot());
|
||||
|
||||
Toolbar toolbar = activityRepoForksBinding.toolbar;
|
||||
@ -70,32 +61,21 @@ public class RepoForksActivity extends BaseActivity {
|
||||
|
||||
activityRepoForksBinding.toolbarTitle.setText(ctx.getResources().getString(R.string.infoTabRepoForksCount));
|
||||
|
||||
ImageView closeActivity = activityRepoForksBinding.close;
|
||||
noData = activityRepoForksBinding.noData;
|
||||
progressLoadMore = activityRepoForksBinding.progressLoadMore;
|
||||
progressBar = activityRepoForksBinding.progressBar;
|
||||
SwipeRefreshLayout swipeRefresh = activityRepoForksBinding.pullToRefresh;
|
||||
|
||||
closeActivity.setOnClickListener(v -> finish());
|
||||
|
||||
activityRepoForksBinding.close.setOnClickListener(v -> finish());
|
||||
resultLimit = Constants.getCurrentResultLimit(ctx);
|
||||
|
||||
recyclerView = activityRepoForksBinding.recyclerView;
|
||||
forksList = new ArrayList<>();
|
||||
|
||||
recyclerView.addItemDecoration(new DividerItemDecoration(recyclerView.getContext(), DividerItemDecoration.VERTICAL));
|
||||
|
||||
swipeRefresh.setOnRefreshListener(() -> new Handler(Looper.getMainLooper()).postDelayed(() -> {
|
||||
activityRepoForksBinding.pullToRefresh.setOnRefreshListener(() -> new Handler(Looper.getMainLooper()).postDelayed(() -> {
|
||||
|
||||
pageSize = 1;
|
||||
swipeRefresh.setRefreshing(false);
|
||||
activityRepoForksBinding.pullToRefresh.setRefreshing(false);
|
||||
loadInitial(repoOwner, repoName, pageSize, resultLimit);
|
||||
adapter.notifyDataChanged();
|
||||
|
||||
}, 200));
|
||||
|
||||
adapter = new RepoForksAdapter(ctx, forksList);
|
||||
adapter.setLoadMoreListener(() -> recyclerView.post(() -> {
|
||||
adapter.setLoadMoreListener(() -> activityRepoForksBinding.recyclerView.post(() -> {
|
||||
|
||||
if(forksList.size() == resultLimit || pageSize == resultLimit) {
|
||||
|
||||
@ -104,9 +84,9 @@ public class RepoForksActivity extends BaseActivity {
|
||||
}
|
||||
}));
|
||||
|
||||
recyclerView.setHasFixedSize(true);
|
||||
recyclerView.setLayoutManager(new LinearLayoutManager(ctx));
|
||||
recyclerView.setAdapter(adapter);
|
||||
activityRepoForksBinding.recyclerView.setHasFixedSize(true);
|
||||
activityRepoForksBinding.recyclerView.setLayoutManager(new LinearLayoutManager(ctx));
|
||||
activityRepoForksBinding.recyclerView.setAdapter(adapter);
|
||||
|
||||
loadInitial(repoOwner, repoName, pageSize, resultLimit);
|
||||
}
|
||||
@ -128,15 +108,15 @@ public class RepoForksActivity extends BaseActivity {
|
||||
forksList.clear();
|
||||
forksList.addAll(response.body());
|
||||
adapter.notifyDataChanged();
|
||||
noData.setVisibility(View.GONE);
|
||||
activityRepoForksBinding.noData.setVisibility(View.GONE);
|
||||
}
|
||||
else {
|
||||
forksList.clear();
|
||||
adapter.notifyDataChanged();
|
||||
noData.setVisibility(View.VISIBLE);
|
||||
activityRepoForksBinding.noData.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
progressBar.setVisibility(View.GONE);
|
||||
activityRepoForksBinding.progressBar.setVisibility(View.GONE);
|
||||
}
|
||||
else {
|
||||
Log.e(TAG, String.valueOf(response.code()));
|
||||
@ -148,12 +128,11 @@ public class RepoForksActivity extends BaseActivity {
|
||||
Log.e(TAG, t.toString());
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
private void loadMore(String repoOwner, String repoName, int page, int resultLimit) {
|
||||
|
||||
progressLoadMore.setVisibility(View.VISIBLE);
|
||||
activityRepoForksBinding.progressLoadMore.setVisibility(View.VISIBLE);
|
||||
|
||||
Call<List<Repository>> call = RetrofitClient.getApiInterface(ctx).listForks(repoOwner, repoName, page, resultLimit);
|
||||
|
||||
@ -179,7 +158,7 @@ public class RepoForksActivity extends BaseActivity {
|
||||
}
|
||||
|
||||
adapter.notifyDataChanged();
|
||||
progressLoadMore.setVisibility(View.GONE);
|
||||
activityRepoForksBinding.progressLoadMore.setVisibility(View.GONE);
|
||||
}
|
||||
else {
|
||||
Log.e(TAG, String.valueOf(response.code()));
|
||||
|
@ -38,13 +38,8 @@ public class RepositorySettingsActivity extends BaseActivity {
|
||||
private CustomRepositoryTransferDialogBinding transferRepoBinding;
|
||||
|
||||
private AlertDialog dialogRepo;
|
||||
//private AlertDialog dialogRepoDelete;
|
||||
|
||||
private MaterialAlertDialogBuilder materialAlertDialogBuilder;
|
||||
//private Dialog dialogProp;
|
||||
|
||||
//private Dialog dialogDeleteRepository;
|
||||
//private Dialog dialogTransferRepository;
|
||||
private View.OnClickListener onClickListener;
|
||||
|
||||
private RepositoryContext repository;
|
||||
@ -75,20 +70,11 @@ public class RepositorySettingsActivity extends BaseActivity {
|
||||
|
||||
private void showTransferRepository() {
|
||||
|
||||
/*dialogTransferRepository = new Dialog(ctx, R.style.ThemeOverlay_MaterialComponents_Dialog_Alert);
|
||||
|
||||
if (dialogTransferRepository.getWindow() != null) {
|
||||
|
||||
dialogTransferRepository.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
||||
}*/
|
||||
|
||||
transferRepoBinding = CustomRepositoryTransferDialogBinding.inflate(LayoutInflater.from(ctx));
|
||||
|
||||
View view = transferRepoBinding.getRoot();
|
||||
materialAlertDialogBuilder.setView(view);
|
||||
|
||||
//transferRepoBinding.cancel.setOnClickListener(editProperties -> dialogRepo.dismiss());
|
||||
|
||||
transferRepoBinding.transfer.setOnClickListener(deleteRepo -> {
|
||||
|
||||
String newOwner = String.valueOf(transferRepoBinding.ownerNameForTransfer.getText());
|
||||
@ -118,7 +104,7 @@ public class RepositorySettingsActivity extends BaseActivity {
|
||||
|
||||
Call<Repository> transferCall = RetrofitClient.getApiInterface(ctx).repoTransfer(repositoryTransfer, repository.getOwner(), repository.getName());
|
||||
|
||||
transferCall.enqueue(new Callback<Repository>() {
|
||||
transferCall.enqueue(new Callback<>() {
|
||||
|
||||
@Override
|
||||
public void onResponse(@NonNull Call<Repository> call, @NonNull retrofit2.Response<Repository> response) {
|
||||
@ -126,15 +112,15 @@ public class RepositorySettingsActivity extends BaseActivity {
|
||||
transferRepoBinding.transfer.setVisibility(View.GONE);
|
||||
transferRepoBinding.processingRequest.setVisibility(View.VISIBLE);
|
||||
|
||||
if(response.code() == 202) {
|
||||
if(response.code() == 202 || response.code() == 201) {
|
||||
|
||||
dialogRepo.dismiss();
|
||||
Toasty.success(ctx, getString(R.string.repoTransferSuccess));
|
||||
|
||||
finish();
|
||||
Objects.requireNonNull(BaseApi.getInstance(ctx, RepositoriesApi.class)).deleteRepository(repository.getRepositoryId());
|
||||
Intent intent = new Intent(RepositorySettingsActivity.this, MainActivity.class);
|
||||
RepositorySettingsActivity.this.startActivity(intent);
|
||||
finish();
|
||||
}
|
||||
else if(response.code() == 404) {
|
||||
|
||||
@ -187,7 +173,7 @@ public class RepositorySettingsActivity extends BaseActivity {
|
||||
|
||||
Call<Void> deleteCall = RetrofitClient.getApiInterface(ctx).repoDelete(repository.getOwner(), repository.getName());
|
||||
|
||||
deleteCall.enqueue(new Callback<Void>() {
|
||||
deleteCall.enqueue(new Callback<>() {
|
||||
|
||||
@Override
|
||||
public void onResponse(@NonNull Call<Void> call, @NonNull retrofit2.Response<Void> response) {
|
||||
@ -200,10 +186,10 @@ public class RepositorySettingsActivity extends BaseActivity {
|
||||
dialogRepo.dismiss();
|
||||
Toasty.success(ctx, getString(R.string.repoDeletionSuccess));
|
||||
|
||||
finish();
|
||||
Objects.requireNonNull(BaseApi.getInstance(ctx, RepositoriesApi.class)).deleteRepository(repository.getRepositoryId());
|
||||
Intent intent = new Intent(RepositorySettingsActivity.this, MainActivity.class);
|
||||
RepositorySettingsActivity.this.startActivity(intent);
|
||||
finish();
|
||||
}
|
||||
else {
|
||||
|
||||
@ -300,7 +286,7 @@ public class RepositorySettingsActivity extends BaseActivity {
|
||||
|
||||
Call<Repository> propsCall = RetrofitClient.getApiInterface(ctx).repoEdit(repository.getOwner(), repository.getName(), repoProps);
|
||||
|
||||
propsCall.enqueue(new Callback<Repository>() {
|
||||
propsCall.enqueue(new Callback<>() {
|
||||
|
||||
@Override
|
||||
public void onResponse(@NonNull Call<Repository> call, @NonNull retrofit2.Response<Repository> response) {
|
||||
|
@ -31,10 +31,84 @@ public class AdminCronTasksAdapter extends RecyclerView.Adapter<AdminCronTasksAd
|
||||
|
||||
private final List<Cron> tasksList;
|
||||
|
||||
static class CronTasksViewHolder extends RecyclerView.ViewHolder {
|
||||
|
||||
private Cron cronTasks;
|
||||
|
||||
private final TextView taskName;
|
||||
|
||||
private CronTasksViewHolder(View itemView) {
|
||||
|
||||
super(itemView);
|
||||
Context ctx = itemView.getContext();
|
||||
|
||||
final Locale locale = ctx.getResources().getConfiguration().locale;
|
||||
final String timeFormat = TinyDB.getInstance(ctx).getString("dateFormat", "pretty");
|
||||
|
||||
ImageView runTask = itemView.findViewById(R.id.runTask);
|
||||
taskName = itemView.findViewById(R.id.taskName);
|
||||
LinearLayout cronTasksInfo = itemView.findViewById(R.id.cronTasksInfo);
|
||||
LinearLayout cronTasksRun = itemView.findViewById(R.id.cronTasksRun);
|
||||
|
||||
cronTasksInfo.setOnClickListener(taskInfo -> {
|
||||
|
||||
String nextRun = "";
|
||||
String lastRun = "";
|
||||
|
||||
if(cronTasks.getNext() != null) {
|
||||
nextRun = TimeHelper.formatTime(cronTasks.getNext(), locale, timeFormat, ctx);
|
||||
}
|
||||
if(cronTasks.getPrev() != null) {
|
||||
lastRun = TimeHelper.formatTime(cronTasks.getPrev(), locale, timeFormat, ctx);
|
||||
}
|
||||
|
||||
View view = LayoutInflater.from(ctx).inflate(R.layout.layout_cron_task_info, null);
|
||||
|
||||
TextView taskScheduleContent = view.findViewById(R.id.taskScheduleContent);
|
||||
TextView nextRunContent = view.findViewById(R.id.nextRunContent);
|
||||
TextView lastRunContent = view.findViewById(R.id.lastRunContent);
|
||||
TextView execTimeContent = view.findViewById(R.id.execTimeContent);
|
||||
|
||||
taskScheduleContent.setText(cronTasks.getSchedule());
|
||||
nextRunContent.setText(nextRun);
|
||||
lastRunContent.setText(lastRun);
|
||||
execTimeContent.setText(String.valueOf(cronTasks.getExecTimes()));
|
||||
|
||||
MaterialAlertDialogBuilder materialAlertDialogBuilder = new MaterialAlertDialogBuilder(ctx).setTitle(StringUtils.capitalize(cronTasks.getName().replace("_", " "))).setView(view)
|
||||
.setNeutralButton(ctx.getString(R.string.close), null);
|
||||
|
||||
materialAlertDialogBuilder.create().show();
|
||||
});
|
||||
|
||||
cronTasksRun.setOnClickListener(taskInfo -> {
|
||||
|
||||
runCronTask(ctx, cronTasks.getName());
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public AdminCronTasksAdapter(List<Cron> tasksListMain) {
|
||||
this.tasksList = tasksListMain;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public AdminCronTasksAdapter.CronTasksViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
|
||||
View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.list_admin_cron_tasks, parent, false);
|
||||
return new AdminCronTasksAdapter.CronTasksViewHolder(v);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull AdminCronTasksAdapter.CronTasksViewHolder holder, int position) {
|
||||
|
||||
Cron currentItem = tasksList.get(position);
|
||||
|
||||
holder.cronTasks = currentItem;
|
||||
holder.taskName.setText(StringUtils.capitalize(currentItem.getName().replace("_", " ")));
|
||||
}
|
||||
|
||||
private static void runCronTask(final Context ctx, final String taskName) {
|
||||
|
||||
Call<Void> call = RetrofitClient.getApiInterface(ctx).adminCronRun(taskName);
|
||||
@ -76,82 +150,9 @@ public class AdminCronTasksAdapter extends RecyclerView.Adapter<AdminCronTasksAd
|
||||
});
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public AdminCronTasksAdapter.CronTasksViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
|
||||
View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.list_admin_cron_tasks, parent, false);
|
||||
return new AdminCronTasksAdapter.CronTasksViewHolder(v);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull AdminCronTasksAdapter.CronTasksViewHolder holder, int position) {
|
||||
|
||||
Cron currentItem = tasksList.get(position);
|
||||
|
||||
holder.cronTasks = currentItem;
|
||||
holder.taskName.setText(StringUtils.capitalize(currentItem.getName().replace("_", " ")));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return tasksList.size();
|
||||
}
|
||||
|
||||
static class CronTasksViewHolder extends RecyclerView.ViewHolder {
|
||||
|
||||
private final TextView taskName;
|
||||
private Cron cronTasks;
|
||||
|
||||
private CronTasksViewHolder(View itemView) {
|
||||
|
||||
super(itemView);
|
||||
Context ctx = itemView.getContext();
|
||||
|
||||
final Locale locale = ctx.getResources().getConfiguration().locale;
|
||||
final String timeFormat = TinyDB.getInstance(ctx).getString("dateFormat", "pretty");
|
||||
|
||||
ImageView runTask = itemView.findViewById(R.id.runTask);
|
||||
taskName = itemView.findViewById(R.id.taskName);
|
||||
LinearLayout cronTasksInfo = itemView.findViewById(R.id.cronTasksInfo);
|
||||
LinearLayout cronTasksRun = itemView.findViewById(R.id.cronTasksRun);
|
||||
|
||||
cronTasksInfo.setOnClickListener(taskInfo -> {
|
||||
|
||||
String nextRun = "";
|
||||
String lastRun = "";
|
||||
|
||||
if(cronTasks.getNext() != null) {
|
||||
nextRun = TimeHelper.formatTime(cronTasks.getNext(), locale, timeFormat, ctx);
|
||||
}
|
||||
if(cronTasks.getPrev() != null) {
|
||||
lastRun = TimeHelper.formatTime(cronTasks.getPrev(), locale, timeFormat, ctx);
|
||||
}
|
||||
|
||||
View view = LayoutInflater.from(ctx).inflate(R.layout.layout_cron_task_info, null);
|
||||
|
||||
TextView taskScheduleContent = view.findViewById(R.id.taskScheduleContent);
|
||||
TextView nextRunContent = view.findViewById(R.id.nextRunContent);
|
||||
TextView lastRunContent = view.findViewById(R.id.lastRunContent);
|
||||
TextView execTimeContent = view.findViewById(R.id.execTimeContent);
|
||||
|
||||
taskScheduleContent.setText(cronTasks.getSchedule());
|
||||
nextRunContent.setText(nextRun);
|
||||
lastRunContent.setText(lastRun);
|
||||
execTimeContent.setText(String.valueOf(cronTasks.getExecTimes()));
|
||||
|
||||
MaterialAlertDialogBuilder materialAlertDialogBuilder = new MaterialAlertDialogBuilder(ctx).setTitle(StringUtils.capitalize(cronTasks.getName().replace("_", " "))).setView(view)
|
||||
.setPositiveButton(ctx.getString(R.string.close), null);
|
||||
|
||||
materialAlertDialogBuilder.create().show();
|
||||
});
|
||||
|
||||
cronTasksRun.setOnClickListener(taskInfo -> {
|
||||
|
||||
runCronTask(ctx, cronTasks.getName());
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -82,10 +82,12 @@ public class CollaboratorsAdapter extends BaseAdapter {
|
||||
if(!currentItem.getFullName().equals("")) {
|
||||
|
||||
viewHolder.collaboratorName.setText(Html.fromHtml(currentItem.getFullName()));
|
||||
viewHolder.userName.setText(context.getResources().getString(R.string.usernameWithAt, currentItem.getLogin()));
|
||||
}
|
||||
else {
|
||||
|
||||
viewHolder.collaboratorName.setText(currentItem.getLogin());
|
||||
viewHolder.userName.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
}
|
||||
@ -94,20 +96,22 @@ public class CollaboratorsAdapter extends BaseAdapter {
|
||||
|
||||
private final ImageView collaboratorAvatar;
|
||||
private final TextView collaboratorName;
|
||||
private final TextView userName;
|
||||
private String userLoginId;
|
||||
|
||||
ViewHolder(View v) {
|
||||
|
||||
collaboratorAvatar = v.findViewById(R.id.collaboratorAvatar);
|
||||
collaboratorName = v.findViewById(R.id.collaboratorName);
|
||||
userName = v.findViewById(R.id.userName);
|
||||
|
||||
collaboratorAvatar.setOnClickListener(loginId -> {
|
||||
v.setOnClickListener(loginId -> {
|
||||
Intent intent = new Intent(context, ProfileActivity.class);
|
||||
intent.putExtra("username", userLoginId);
|
||||
context.startActivity(intent);
|
||||
});
|
||||
|
||||
collaboratorAvatar.setOnLongClickListener(loginId -> {
|
||||
v.setOnLongClickListener(loginId -> {
|
||||
AppUtil.copyToClipboard(context, userLoginId, context.getString(R.string.copyLoginIdToClipBoard, userLoginId));
|
||||
return true;
|
||||
});
|
||||
|
@ -13,10 +13,14 @@ import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import com.amulyakhare.textdrawable.TextDrawable;
|
||||
import com.amulyakhare.textdrawable.util.ColorGenerator;
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
|
||||
import org.mian.gitnex.R;
|
||||
import org.mian.gitnex.activities.RepoDetailActivity;
|
||||
import org.mian.gitnex.database.api.BaseApi;
|
||||
import org.mian.gitnex.database.api.RepositoriesApi;
|
||||
import org.mian.gitnex.database.models.Repository;
|
||||
import org.mian.gitnex.helpers.AppUtil;
|
||||
import org.mian.gitnex.helpers.Toasty;
|
||||
import org.mian.gitnex.helpers.contexts.RepositoryContext;
|
||||
import java.util.List;
|
||||
|
||||
@ -27,8 +31,65 @@ import java.util.List;
|
||||
public class MostVisitedReposAdapter extends RecyclerView.Adapter<MostVisitedReposAdapter.MostVisitedViewHolder> {
|
||||
|
||||
private List<Repository> mostVisitedReposList;
|
||||
private final Context ctx;
|
||||
|
||||
public MostVisitedReposAdapter(List<Repository> reposListMain) {
|
||||
class MostVisitedViewHolder extends RecyclerView.ViewHolder {
|
||||
|
||||
private Repository repository;
|
||||
|
||||
private final ImageView image;
|
||||
private final TextView repoName;
|
||||
private final TextView orgName;
|
||||
private final TextView mostVisited;
|
||||
private final ImageView resetCounter;
|
||||
|
||||
private MostVisitedViewHolder(View itemView) {
|
||||
|
||||
super(itemView);
|
||||
|
||||
image = itemView.findViewById(R.id.image);
|
||||
repoName = itemView.findViewById(R.id.repo_name);
|
||||
orgName = itemView.findViewById(R.id.org_name);
|
||||
mostVisited = itemView.findViewById(R.id.most_visited);
|
||||
resetCounter = itemView.findViewById(R.id.reset_counter);
|
||||
|
||||
itemView.setOnClickListener(v -> {
|
||||
|
||||
Context context = v.getContext();
|
||||
RepositoryContext repositoryContext = new RepositoryContext(repository.getRepositoryOwner(), repository.getRepositoryName(), context);
|
||||
Intent intent = repositoryContext.getIntent(context, RepoDetailActivity.class);
|
||||
context.startActivity(intent);
|
||||
});
|
||||
|
||||
resetCounter.setOnClickListener(itemDelete -> {
|
||||
|
||||
MaterialAlertDialogBuilder materialAlertDialogBuilder = new MaterialAlertDialogBuilder(ctx, R.style.ThemeOverlay_Material3_Dialog_Alert);
|
||||
|
||||
materialAlertDialogBuilder.setTitle(ctx.getString(R.string.reset)).setMessage(ctx.getString(R.string.resetCounterDialogMessage, repository.getRepositoryName()))
|
||||
.setPositiveButton(R.string.reset, (dialog, whichButton) -> {
|
||||
|
||||
int getRepositoryId = repository.getRepositoryId();
|
||||
resetRepositoryCounter(getBindingAdapterPosition());
|
||||
|
||||
RepositoriesApi repositoriesApi = BaseApi.getInstance(ctx, RepositoriesApi.class);
|
||||
assert repositoriesApi != null;
|
||||
repositoriesApi.updateRepositoryMostVisited(0, getRepositoryId);
|
||||
}).setNeutralButton(R.string.cancelButton, null).show();
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void resetRepositoryCounter(int position) {
|
||||
|
||||
mostVisitedReposList.remove(position);
|
||||
notifyItemRemoved(position);
|
||||
notifyItemRangeChanged(position, mostVisitedReposList.size());
|
||||
Toasty.success(ctx, ctx.getResources().getString(R.string.resetMostReposCounter));
|
||||
}
|
||||
|
||||
public MostVisitedReposAdapter(Context ctx, List<Repository> reposListMain) {
|
||||
this.ctx = ctx;
|
||||
this.mostVisitedReposList = reposListMain;
|
||||
}
|
||||
|
||||
@ -73,32 +134,4 @@ public class MostVisitedReposAdapter extends RecyclerView.Adapter<MostVisitedRep
|
||||
notifyDataChanged();
|
||||
}
|
||||
|
||||
static class MostVisitedViewHolder extends RecyclerView.ViewHolder {
|
||||
|
||||
private final ImageView image;
|
||||
private final TextView repoName;
|
||||
private final TextView orgName;
|
||||
private final TextView mostVisited;
|
||||
private Repository repository;
|
||||
|
||||
private MostVisitedViewHolder(View itemView) {
|
||||
|
||||
super(itemView);
|
||||
|
||||
image = itemView.findViewById(R.id.image);
|
||||
repoName = itemView.findViewById(R.id.repo_name);
|
||||
orgName = itemView.findViewById(R.id.org_name);
|
||||
mostVisited = itemView.findViewById(R.id.most_visited);
|
||||
|
||||
itemView.setOnClickListener(v -> {
|
||||
|
||||
Context context = v.getContext();
|
||||
RepositoryContext repositoryContext = new RepositoryContext(repository.getRepositoryOwner(), repository.getRepositoryName(), context);
|
||||
Intent intent = repositoryContext.getIntent(context, RepoDetailActivity.class);
|
||||
context.startActivity(intent);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -30,14 +30,14 @@ import retrofit2.Response;
|
||||
* @author M M Arif
|
||||
*/
|
||||
|
||||
public class UserSearchForTeamMemberAdapter extends RecyclerView.Adapter<UserSearchForTeamMemberAdapter.UserSearchViewHolder> {
|
||||
public class OrganizationAddUserToTeamMemberAdapter extends RecyclerView.Adapter<OrganizationAddUserToTeamMemberAdapter.UserSearchViewHolder> {
|
||||
|
||||
private final List<User> usersSearchList;
|
||||
private final Context context;
|
||||
private final int teamId;
|
||||
private final String orgName;
|
||||
|
||||
public UserSearchForTeamMemberAdapter(List<User> dataList, Context ctx, int teamId, String orgName) {
|
||||
public OrganizationAddUserToTeamMemberAdapter(List<User> dataList, Context ctx, int teamId, String orgName) {
|
||||
this.context = ctx;
|
||||
this.usersSearchList = dataList;
|
||||
this.teamId = teamId;
|
||||
@ -46,13 +46,13 @@ public class UserSearchForTeamMemberAdapter extends RecyclerView.Adapter<UserSea
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public UserSearchForTeamMemberAdapter.UserSearchViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
public OrganizationAddUserToTeamMemberAdapter.UserSearchViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.list_collaborators_search, parent, false);
|
||||
return new UserSearchForTeamMemberAdapter.UserSearchViewHolder(v);
|
||||
return new OrganizationAddUserToTeamMemberAdapter.UserSearchViewHolder(v);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull final UserSearchForTeamMemberAdapter.UserSearchViewHolder holder, int position) {
|
||||
public void onBindViewHolder(@NonNull final OrganizationAddUserToTeamMemberAdapter.UserSearchViewHolder holder, int position) {
|
||||
|
||||
User currentItem = usersSearchList.get(position);
|
||||
holder.userInfo = currentItem;
|
@ -18,12 +18,12 @@ import java.util.List;
|
||||
* @author opyale
|
||||
*/
|
||||
|
||||
public class TeamMembersByOrgPreviewAdapter extends RecyclerView.Adapter<TeamMembersByOrgPreviewAdapter.ViewHolder> {
|
||||
public class OrganizationTeamMembersPreviewAdapter extends RecyclerView.Adapter<OrganizationTeamMembersPreviewAdapter.ViewHolder> {
|
||||
|
||||
private final Context context;
|
||||
private final List<User> userData;
|
||||
|
||||
public TeamMembersByOrgPreviewAdapter(Context context, List<User> userInfo) {
|
||||
public OrganizationTeamMembersPreviewAdapter(Context context, List<User> userInfo) {
|
||||
this.context = context;
|
||||
this.userData = userInfo;
|
||||
}
|
||||
@ -31,7 +31,7 @@ public class TeamMembersByOrgPreviewAdapter extends RecyclerView.Adapter<TeamMem
|
||||
@NonNull
|
||||
@Override
|
||||
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View v = LayoutInflater.from(context).inflate(R.layout.list_members_by_org_preview, parent, false);
|
||||
View v = LayoutInflater.from(context).inflate(R.layout.list_organization_members_preview, parent, false);
|
||||
return new ViewHolder(v);
|
||||
}
|
||||
|
@ -31,7 +31,7 @@ import retrofit2.Response;
|
||||
* @author M M Arif
|
||||
*/
|
||||
|
||||
public class TeamRepositoriesAdapter extends RecyclerView.Adapter<TeamRepositoriesAdapter.TeamReposViewHolder> {
|
||||
public class OrganizationTeamRepositoriesAdapter extends RecyclerView.Adapter<OrganizationTeamRepositoriesAdapter.TeamReposViewHolder> {
|
||||
|
||||
private final List<Repository> reposList;
|
||||
private final Context context;
|
||||
@ -40,7 +40,7 @@ public class TeamRepositoriesAdapter extends RecyclerView.Adapter<TeamRepositori
|
||||
private final String teamName;
|
||||
private final List<Repository> reposArr;
|
||||
|
||||
public TeamRepositoriesAdapter(List<Repository> dataList, Context ctx, int teamId, String orgName, String teamName) {
|
||||
public OrganizationTeamRepositoriesAdapter(List<Repository> dataList, Context ctx, int teamId, String orgName, String teamName) {
|
||||
this.context = ctx;
|
||||
this.reposList = dataList;
|
||||
this.teamId = teamId;
|
||||
@ -49,15 +49,60 @@ public class TeamRepositoriesAdapter extends RecyclerView.Adapter<TeamRepositori
|
||||
reposArr = new ArrayList<>();
|
||||
}
|
||||
|
||||
class TeamReposViewHolder extends RecyclerView.ViewHolder {
|
||||
|
||||
private Repository repoInfo;
|
||||
|
||||
private final ImageView repoAvatar;
|
||||
private final TextView name;
|
||||
private final ImageView addRepoButtonAdd;
|
||||
|
||||
private TeamReposViewHolder(View itemView) {
|
||||
|
||||
super(itemView);
|
||||
repoAvatar = itemView.findViewById(R.id.userAvatar);
|
||||
name = itemView.findViewById(R.id.userFullName);
|
||||
itemView.findViewById(R.id.userName).setVisibility(View.GONE);
|
||||
addRepoButtonAdd = itemView.findViewById(R.id.addCollaboratorButtonAdd);
|
||||
ImageView addRepoButtonRemove = itemView.findViewById(R.id.addCollaboratorButtonRemove);
|
||||
//addRepoButtonAdd.setVisibility(View.VISIBLE);
|
||||
//addRepoButtonRemove.setVisibility(View.GONE);
|
||||
|
||||
new Handler(Looper.getMainLooper()).postDelayed(OrganizationTeamRepositoriesAdapter.this::getTeamRepos, 200);
|
||||
|
||||
new Handler(Looper.getMainLooper()).postDelayed(() -> {
|
||||
|
||||
if(reposArr.size() > 0) {
|
||||
for(int i = 0; i < reposArr.size(); i++) {
|
||||
if(!reposArr.get(i).getName().equals(repoInfo.getName())) {
|
||||
addRepoButtonAdd.setVisibility(View.VISIBLE);
|
||||
}
|
||||
else {
|
||||
addRepoButtonAdd.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
addRepoButtonAdd.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}, 500);
|
||||
|
||||
addRepoButtonAdd.setOnClickListener(v -> AlertDialogs.addRepoDialog(context, orgName, repoInfo.getName(), Integer.parseInt(String.valueOf(teamId)), teamName));
|
||||
|
||||
addRepoButtonRemove.setOnClickListener(v -> AlertDialogs.removeRepoDialog(context, orgName, repoInfo.getName(), Integer.parseInt(String.valueOf(teamId)), teamName));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public TeamRepositoriesAdapter.TeamReposViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
public OrganizationTeamRepositoriesAdapter.TeamReposViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.list_collaborators_search, parent, false);
|
||||
return new TeamRepositoriesAdapter.TeamReposViewHolder(v);
|
||||
return new OrganizationTeamRepositoriesAdapter.TeamReposViewHolder(v);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull final TeamRepositoriesAdapter.TeamReposViewHolder holder, int position) {
|
||||
public void onBindViewHolder(@NonNull final OrganizationTeamRepositoriesAdapter.TeamReposViewHolder holder, int position) {
|
||||
|
||||
Repository currentItem = reposList.get(position);
|
||||
holder.repoInfo = currentItem;
|
||||
@ -107,48 +152,4 @@ public class TeamRepositoriesAdapter extends RecyclerView.Adapter<TeamRepositori
|
||||
}
|
||||
}
|
||||
|
||||
class TeamReposViewHolder extends RecyclerView.ViewHolder {
|
||||
|
||||
private final ImageView repoAvatar;
|
||||
private final TextView name;
|
||||
private final ImageView addRepoButtonAdd;
|
||||
private Repository repoInfo;
|
||||
|
||||
private TeamReposViewHolder(View itemView) {
|
||||
|
||||
super(itemView);
|
||||
repoAvatar = itemView.findViewById(R.id.userAvatar);
|
||||
name = itemView.findViewById(R.id.userFullName);
|
||||
itemView.findViewById(R.id.userName).setVisibility(View.GONE);
|
||||
addRepoButtonAdd = itemView.findViewById(R.id.addCollaboratorButtonAdd);
|
||||
ImageView addRepoButtonRemove = itemView.findViewById(R.id.addCollaboratorButtonRemove);
|
||||
//addRepoButtonAdd.setVisibility(View.VISIBLE);
|
||||
//addRepoButtonRemove.setVisibility(View.GONE);
|
||||
|
||||
new Handler(Looper.getMainLooper()).postDelayed(TeamRepositoriesAdapter.this::getTeamRepos, 200);
|
||||
|
||||
new Handler(Looper.getMainLooper()).postDelayed(() -> {
|
||||
|
||||
if(reposArr.size() > 0) {
|
||||
for(int i = 0; i < reposArr.size(); i++) {
|
||||
if(!reposArr.get(i).getName().equals(repoInfo.getName())) {
|
||||
addRepoButtonAdd.setVisibility(View.VISIBLE);
|
||||
}
|
||||
else {
|
||||
addRepoButtonAdd.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
addRepoButtonAdd.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}, 500);
|
||||
|
||||
addRepoButtonAdd.setOnClickListener(v -> AlertDialogs.addRepoDialog(context, orgName, repoInfo.getName(), Integer.parseInt(String.valueOf(teamId)), teamName));
|
||||
|
||||
addRepoButtonRemove.setOnClickListener(v -> AlertDialogs.removeRepoDialog(context, orgName, repoInfo.getName(), Integer.parseInt(String.valueOf(teamId)), teamName));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -29,47 +29,56 @@ import retrofit2.Response;
|
||||
* @author M M Arif
|
||||
*/
|
||||
|
||||
public class TeamsByOrgAdapter extends RecyclerView.Adapter<TeamsByOrgAdapter.OrgTeamsViewHolder> implements Filterable {
|
||||
public class OrganizationTeamsAdapter extends RecyclerView.Adapter<OrganizationTeamsAdapter.OrgTeamsViewHolder> implements Filterable {
|
||||
|
||||
private final List<Team> teamList;
|
||||
private final Context context;
|
||||
private final List<Team> teamListFull;
|
||||
private final OrganizationPermissions permissions;
|
||||
private final String orgName;
|
||||
private final Filter orgTeamsFilter = new Filter() {
|
||||
|
||||
@Override
|
||||
protected FilterResults performFiltering(CharSequence constraint) {
|
||||
List<Team> filteredList = new ArrayList<>();
|
||||
static class OrgTeamsViewHolder extends RecyclerView.ViewHolder {
|
||||
|
||||
if(constraint == null || constraint.length() == 0) {
|
||||
filteredList.addAll(teamListFull);
|
||||
}
|
||||
else {
|
||||
String filterPattern = constraint.toString().toLowerCase().trim();
|
||||
private Team team;
|
||||
|
||||
for(Team item : teamListFull) {
|
||||
if(item.getName().toLowerCase().contains(filterPattern) || item.getDescription().toLowerCase().contains(filterPattern)) {
|
||||
filteredList.add(item);
|
||||
}
|
||||
}
|
||||
private OrganizationPermissions permissions;
|
||||
private final TextView teamTitle;
|
||||
private final TextView teamDescription;
|
||||
private final LinearLayout membersPreviewFrame;
|
||||
|
||||
private final List<User> userInfos;
|
||||
private final OrganizationTeamMembersPreviewAdapter adapter;
|
||||
private String orgName;
|
||||
|
||||
private OrgTeamsViewHolder(View itemView) {
|
||||
super(itemView);
|
||||
|
||||
teamTitle = itemView.findViewById(R.id.teamTitle);
|
||||
teamDescription = itemView.findViewById(R.id.teamDescription);
|
||||
membersPreviewFrame = itemView.findViewById(R.id.membersPreviewFrame);
|
||||
|
||||
RecyclerView membersPreview = itemView.findViewById(R.id.membersPreview);
|
||||
|
||||
userInfos = new ArrayList<>();
|
||||
adapter = new OrganizationTeamMembersPreviewAdapter(itemView.getContext(), userInfos);
|
||||
|
||||
membersPreview.setLayoutManager(new LinearLayoutManager(itemView.getContext(), RecyclerView.HORIZONTAL, false));
|
||||
membersPreview.setAdapter(adapter);
|
||||
|
||||
itemView.setOnClickListener(v -> {
|
||||
Context context = v.getContext();
|
||||
|
||||
Intent intent = new Intent(context, OrganizationTeamInfoActivity.class);
|
||||
intent.putExtra("team", team);
|
||||
intent.putExtra("permissions", permissions);
|
||||
intent.putExtra("orgName", orgName);
|
||||
context.startActivity(intent);
|
||||
});
|
||||
}
|
||||
|
||||
FilterResults results = new FilterResults();
|
||||
results.values = filteredList;
|
||||
|
||||
return results;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void publishResults(CharSequence constraint, FilterResults results) {
|
||||
teamList.clear();
|
||||
teamList.addAll((List<Team>) results.values);
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
};
|
||||
|
||||
public TeamsByOrgAdapter(Context ctx, List<Team> teamListMain, OrganizationPermissions permissions, String orgName) {
|
||||
public OrganizationTeamsAdapter(Context ctx, List<Team> teamListMain, OrganizationPermissions permissions, String orgName) {
|
||||
this.context = ctx;
|
||||
this.teamList = teamListMain;
|
||||
this.permissions = permissions;
|
||||
@ -79,13 +88,13 @@ public class TeamsByOrgAdapter extends RecyclerView.Adapter<TeamsByOrgAdapter.Or
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public TeamsByOrgAdapter.OrgTeamsViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.list_teams_by_org, parent, false);
|
||||
return new TeamsByOrgAdapter.OrgTeamsViewHolder(v);
|
||||
public OrganizationTeamsAdapter.OrgTeamsViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.list_organization_teams, parent, false);
|
||||
return new OrganizationTeamsAdapter.OrgTeamsViewHolder(v);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull TeamsByOrgAdapter.OrgTeamsViewHolder holder, int position) {
|
||||
public void onBindViewHolder(@NonNull OrganizationTeamsAdapter.OrgTeamsViewHolder holder, int position) {
|
||||
|
||||
Team currentItem = teamList.get(position);
|
||||
|
||||
@ -99,7 +108,6 @@ public class TeamsByOrgAdapter extends RecyclerView.Adapter<TeamsByOrgAdapter.Or
|
||||
holder.adapter.notifyDataSetChanged();
|
||||
|
||||
RetrofitClient.getApiInterface(context).orgListTeamMembers(currentItem.getId(), null, null).enqueue(new Callback<List<User>>() {
|
||||
|
||||
@Override
|
||||
public void onResponse(@NonNull Call<List<User>> call, @NonNull Response<List<User>> response) {
|
||||
if(response.isSuccessful() && response.body() != null && response.body().size() > 0) {
|
||||
@ -136,43 +144,36 @@ public class TeamsByOrgAdapter extends RecyclerView.Adapter<TeamsByOrgAdapter.Or
|
||||
return orgTeamsFilter;
|
||||
}
|
||||
|
||||
static class OrgTeamsViewHolder extends RecyclerView.ViewHolder {
|
||||
private final Filter orgTeamsFilter = new Filter() {
|
||||
@Override
|
||||
protected FilterResults performFiltering(CharSequence constraint) {
|
||||
List<Team> filteredList = new ArrayList<>();
|
||||
|
||||
private final TextView teamTitle;
|
||||
private final TextView teamDescription;
|
||||
private final LinearLayout membersPreviewFrame;
|
||||
private final List<User> userInfos;
|
||||
private final TeamMembersByOrgPreviewAdapter adapter;
|
||||
private Team team;
|
||||
private OrganizationPermissions permissions;
|
||||
private String orgName;
|
||||
if(constraint == null || constraint.length() == 0) {
|
||||
filteredList.addAll(teamListFull);
|
||||
}
|
||||
else {
|
||||
String filterPattern = constraint.toString().toLowerCase().trim();
|
||||
|
||||
private OrgTeamsViewHolder(View itemView) {
|
||||
super(itemView);
|
||||
|
||||
teamTitle = itemView.findViewById(R.id.teamTitle);
|
||||
teamDescription = itemView.findViewById(R.id.teamDescription);
|
||||
membersPreviewFrame = itemView.findViewById(R.id.membersPreviewFrame);
|
||||
|
||||
RecyclerView membersPreview = itemView.findViewById(R.id.membersPreview);
|
||||
|
||||
userInfos = new ArrayList<>();
|
||||
adapter = new TeamMembersByOrgPreviewAdapter(itemView.getContext(), userInfos);
|
||||
|
||||
membersPreview.setLayoutManager(new LinearLayoutManager(itemView.getContext(), RecyclerView.HORIZONTAL, false));
|
||||
membersPreview.setAdapter(adapter);
|
||||
|
||||
itemView.setOnClickListener(v -> {
|
||||
Context context = v.getContext();
|
||||
|
||||
Intent intent = new Intent(context, OrganizationTeamInfoActivity.class);
|
||||
intent.putExtra("team", team);
|
||||
intent.putExtra("permissions", permissions);
|
||||
intent.putExtra("orgName", orgName);
|
||||
context.startActivity(intent);
|
||||
});
|
||||
for(Team item : teamListFull) {
|
||||
if(item.getName().toLowerCase().contains(filterPattern) || item.getDescription().toLowerCase().contains(filterPattern)) {
|
||||
filteredList.add(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
FilterResults results = new FilterResults();
|
||||
results.values = filteredList;
|
||||
|
||||
return results;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void publishResults(CharSequence constraint, FilterResults results) {
|
||||
teamList.clear();
|
||||
teamList.addAll((List<Team>) results.values);
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
};
|
||||
|
||||
}
|
@ -212,10 +212,6 @@ public class PullRequestsAdapter extends RecyclerView.Adapter<RecyclerView.ViewH
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
labelsScrollViewDots.setVisibility(View.GONE);
|
||||
labelsScrollViewWithText.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
String prNumber_ = "<font color='" + ResourcesCompat.getColor(context.getResources(), R.color.lightGray, null) + "'>" + context.getResources().getString(R.string.hash) + pullRequest.getNumber() + "</font>";
|
||||
|
||||
|
@ -41,11 +41,13 @@ public class UserAccountsAdapter extends RecyclerView.Adapter<UserAccountsAdapte
|
||||
private final List<UserAccount> userAccountsList;
|
||||
private final Context context;
|
||||
private final Dialog dialog;
|
||||
private final TinyDB tinyDB;
|
||||
|
||||
public UserAccountsAdapter(Context ctx, Dialog dialog) {
|
||||
this.dialog = dialog;
|
||||
this.context = ctx;
|
||||
this.userAccountsList = Objects.requireNonNull(BaseApi.getInstance(context, UserAccountsApi.class)).usersAccounts();
|
||||
this.tinyDB = TinyDB.getInstance(context);
|
||||
}
|
||||
|
||||
private void updateLayoutByPosition(int position) {
|
||||
@ -96,7 +98,6 @@ public class UserAccountsAdapter extends RecyclerView.Adapter<UserAccountsAdapte
|
||||
public void onBindViewHolder(@NonNull UserAccountsAdapter.UserAccountsViewHolder holder, int position) {
|
||||
|
||||
UserAccount currentItem = userAccountsList.get(position);
|
||||
TinyDB tinyDB = TinyDB.getInstance(context);
|
||||
|
||||
String url = UrlBuilder.fromString(currentItem.getInstanceUrl()).withPath("/").toString();
|
||||
|
||||
@ -111,7 +112,7 @@ public class UserAccountsAdapter extends RecyclerView.Adapter<UserAccountsAdapte
|
||||
holder.accountUrl.setText(context.getString(R.string.notLoggedIn, url));
|
||||
}
|
||||
|
||||
int imgRadius = AppUtil.getPixelsFromDensity(context, 3);
|
||||
int imgRadius = AppUtil.getPixelsFromDensity(context, 60);
|
||||
|
||||
PicassoService.getInstance(context).get().load(url + "assets/img/favicon.png").placeholder(R.drawable.loader_animated).transform(new RoundedTransformation(imgRadius, 0)).resize(120, 120).centerCrop()
|
||||
.into(holder.repoAvatar);
|
||||
@ -202,6 +203,7 @@ public class UserAccountsAdapter extends RecyclerView.Adapter<UserAccountsAdapte
|
||||
return;
|
||||
}
|
||||
|
||||
if(tinyDB.getInt("currentActiveAccountId") != userAccount.getAccountId()) {
|
||||
if(AppUtil.switchToAccount(context, userAccount)) {
|
||||
|
||||
String url = UrlBuilder.fromString(userAccount.getInstanceUrl()).withPath("/").toString();
|
||||
@ -210,10 +212,9 @@ public class UserAccountsAdapter extends RecyclerView.Adapter<UserAccountsAdapte
|
||||
getNotificationsCount();
|
||||
((Activity) context).recreate();
|
||||
dialog.dismiss();
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -57,16 +57,16 @@ public class UserAccountsNavAdapter extends RecyclerView.Adapter<UserAccountsNav
|
||||
|
||||
String url = UrlBuilder.fromString(currentItem.getInstanceUrl()).withPath("/").toString();
|
||||
|
||||
int imageSize = AppUtil.getPixelsFromDensity(context, 35);
|
||||
int imageSize = AppUtil.getPixelsFromDensity(context, 36);
|
||||
|
||||
PicassoService.getInstance(context).get().load(url + "assets/img/favicon.png").placeholder(R.drawable.loader_animated).transform(new RoundedTransformation(8, 0)).resize(imageSize, imageSize).centerCrop()
|
||||
PicassoService.getInstance(context).get().load(url + "assets/img/favicon.png").placeholder(R.drawable.loader_animated).transform(new RoundedTransformation(18, 0)).resize(imageSize, imageSize).centerCrop()
|
||||
.into(holder.userAccountAvatar);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
|
||||
return userAccountsList.size();
|
||||
return Math.min(userAccountsList.size(), 3);
|
||||
}
|
||||
|
||||
private void customDialogUserAccountsList() {
|
||||
|
@ -7,7 +7,11 @@ import android.text.Html;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.*;
|
||||
import android.widget.BaseAdapter;
|
||||
import android.widget.Filter;
|
||||
import android.widget.Filterable;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
import org.gitnex.tea4j.v2.models.User;
|
||||
import org.mian.gitnex.R;
|
||||
import org.mian.gitnex.activities.ProfileActivity;
|
||||
@ -26,41 +30,35 @@ public class UserGridAdapter extends BaseAdapter implements Filterable {
|
||||
private final List<User> membersList;
|
||||
private final Context context;
|
||||
private final List<User> membersListFull;
|
||||
private final Filter membersFilter = new Filter() {
|
||||
@Override
|
||||
protected FilterResults performFiltering(CharSequence constraint) {
|
||||
List<User> filteredList = new ArrayList<>();
|
||||
|
||||
if(constraint == null || constraint.length() == 0) {
|
||||
private class ViewHolder {
|
||||
|
||||
filteredList.addAll(membersListFull);
|
||||
}
|
||||
else {
|
||||
private String userLoginId;
|
||||
|
||||
String filterPattern = constraint.toString().toLowerCase().trim();
|
||||
private final ImageView memberAvatar;
|
||||
private final TextView memberName;
|
||||
private final TextView userName;
|
||||
|
||||
for(User item : membersListFull) {
|
||||
if(item.getFullName().toLowerCase().contains(filterPattern) || item.getLogin().toLowerCase().contains(filterPattern)) {
|
||||
filteredList.add(item);
|
||||
}
|
||||
}
|
||||
ViewHolder(View v) {
|
||||
|
||||
memberAvatar = v.findViewById(R.id.userAvatarImageView);
|
||||
memberName = v.findViewById(R.id.userNameTv);
|
||||
userName = v.findViewById(R.id.userName);
|
||||
|
||||
v.setOnClickListener(loginId -> {
|
||||
Intent intent = new Intent(context, ProfileActivity.class);
|
||||
intent.putExtra("username", userLoginId);
|
||||
context.startActivity(intent);
|
||||
});
|
||||
|
||||
v.setOnLongClickListener(loginId -> {
|
||||
AppUtil.copyToClipboard(context, userLoginId, context.getString(R.string.copyLoginIdToClipBoard, userLoginId));
|
||||
return true;
|
||||
});
|
||||
}
|
||||
|
||||
FilterResults results = new FilterResults();
|
||||
results.values = filteredList;
|
||||
|
||||
return results;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void publishResults(CharSequence constraint, FilterResults results) {
|
||||
|
||||
membersList.clear();
|
||||
membersList.addAll((List) results.values);
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
};
|
||||
|
||||
public UserGridAdapter(Context ctx, List<User> membersListMain) {
|
||||
|
||||
this.context = ctx;
|
||||
@ -117,10 +115,12 @@ public class UserGridAdapter extends BaseAdapter implements Filterable {
|
||||
if(!currentItem.getFullName().equals("")) {
|
||||
|
||||
viewHolder.memberName.setText(Html.fromHtml(currentItem.getFullName()));
|
||||
viewHolder.userName.setText(context.getResources().getString(R.string.usernameWithAt, currentItem.getLogin()));
|
||||
}
|
||||
else {
|
||||
|
||||
viewHolder.memberName.setText(currentItem.getLogin());
|
||||
viewHolder.userName.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
|
||||
@ -129,29 +129,39 @@ public class UserGridAdapter extends BaseAdapter implements Filterable {
|
||||
return membersFilter;
|
||||
}
|
||||
|
||||
private class ViewHolder {
|
||||
private final Filter membersFilter = new Filter() {
|
||||
@Override
|
||||
protected FilterResults performFiltering(CharSequence constraint) {
|
||||
List<User> filteredList = new ArrayList<>();
|
||||
|
||||
private final ImageView memberAvatar;
|
||||
private final TextView memberName;
|
||||
private String userLoginId;
|
||||
if(constraint == null || constraint.length() == 0) {
|
||||
|
||||
ViewHolder(View v) {
|
||||
filteredList.addAll(membersListFull);
|
||||
}
|
||||
else {
|
||||
|
||||
memberAvatar = v.findViewById(R.id.userAvatarImageView);
|
||||
memberName = v.findViewById(R.id.userNameTv);
|
||||
String filterPattern = constraint.toString().toLowerCase().trim();
|
||||
|
||||
v.setOnClickListener(loginId -> {
|
||||
Intent intent = new Intent(context, ProfileActivity.class);
|
||||
intent.putExtra("username", userLoginId);
|
||||
context.startActivity(intent);
|
||||
});
|
||||
|
||||
v.setOnLongClickListener(loginId -> {
|
||||
AppUtil.copyToClipboard(context, userLoginId, context.getString(R.string.copyLoginIdToClipBoard, userLoginId));
|
||||
return true;
|
||||
});
|
||||
for(User item : membersListFull) {
|
||||
if(item.getFullName().toLowerCase().contains(filterPattern) || item.getLogin().toLowerCase().contains(filterPattern)) {
|
||||
filteredList.add(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
FilterResults results = new FilterResults();
|
||||
results.values = filteredList;
|
||||
|
||||
return results;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void publishResults(CharSequence constraint, FilterResults results) {
|
||||
|
||||
membersList.clear();
|
||||
membersList.addAll((List) results.values);
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -222,7 +222,7 @@ public class WikiListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolde
|
||||
int color = generator.getColor(wikiPageMetaData.getTitle());
|
||||
String firstCharacter = String.valueOf(wikiPageMetaData.getTitle().charAt(0));
|
||||
|
||||
TextDrawable drawable = TextDrawable.builder().beginConfig().useFont(Typeface.DEFAULT).fontSize(18).toUpperCase().width(28).height(28).endConfig().buildRoundRect(firstCharacter, color, 3);
|
||||
TextDrawable drawable = TextDrawable.builder().beginConfig().useFont(Typeface.DEFAULT).fontSize(18).toUpperCase().width(28).height(28).endConfig().buildRoundRect(firstCharacter, color, 14);
|
||||
avatar.setImageDrawable(drawable);
|
||||
|
||||
if(!((RepoDetailActivity) ctx).repository.getPermissions().isPush()) {
|
||||
|
@ -3,7 +3,15 @@ package org.mian.gitnex.clients;
|
||||
import android.content.Context;
|
||||
import android.util.Log;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import org.gitnex.tea4j.v2.apis.*;
|
||||
import org.gitnex.tea4j.v2.apis.AdminApi;
|
||||
import org.gitnex.tea4j.v2.apis.IssueApi;
|
||||
import org.gitnex.tea4j.v2.apis.MiscellaneousApi;
|
||||
import org.gitnex.tea4j.v2.apis.NotificationApi;
|
||||
import org.gitnex.tea4j.v2.apis.OrganizationApi;
|
||||
import org.gitnex.tea4j.v2.apis.PackageApi;
|
||||
import org.gitnex.tea4j.v2.apis.RepositoryApi;
|
||||
import org.gitnex.tea4j.v2.apis.SettingsApi;
|
||||
import org.gitnex.tea4j.v2.apis.UserApi;
|
||||
import org.gitnex.tea4j.v2.apis.custom.CustomApi;
|
||||
import org.gitnex.tea4j.v2.apis.custom.OTPApi;
|
||||
import org.gitnex.tea4j.v2.apis.custom.WebApi;
|
||||
|
@ -74,6 +74,10 @@ public class RepositoriesApi extends BaseApi {
|
||||
executorService.execute(() -> repositoriesDao.updateRepositoryMostVisited(mostVisited, repositoryId));
|
||||
}
|
||||
|
||||
public void resetAllRepositoryMostVisited(int repoAccountId) {
|
||||
executorService.execute(() -> repositoriesDao.resetAllRepositoryMostVisited(repoAccountId));
|
||||
}
|
||||
|
||||
public LiveData<List<Repository>> fetchAllMostVisited(int repoAccountId) {
|
||||
return repositoriesDao.fetchAllMostVisited(repoAccountId);
|
||||
}
|
||||
|
@ -50,4 +50,7 @@ public interface RepositoriesDao {
|
||||
@Query("SELECT * FROM Repositories WHERE mostVisited > 0 AND repoAccountId = :repoAccountId ORDER BY mostVisited DESC LIMIT 50")
|
||||
LiveData<List<Repository>> fetchAllMostVisited(int repoAccountId);
|
||||
|
||||
@Query("UPDATE Repositories SET mostVisited = 0 WHERE repoAccountId = :repoAccountId")
|
||||
void resetAllRepositoryMostVisited(int repoAccountId);
|
||||
|
||||
}
|
||||
|
@ -12,6 +12,7 @@ public class DraftWithRepository {
|
||||
private int repoAccountId;
|
||||
private String repositoryOwner;
|
||||
private String repositoryName;
|
||||
private int mostVisited;
|
||||
|
||||
private int draftRepositoryId;
|
||||
private int draftAccountId;
|
||||
@ -141,4 +142,12 @@ public class DraftWithRepository {
|
||||
this.issueType = issueType;
|
||||
}
|
||||
|
||||
public int getMostVisited() {
|
||||
return mostVisited;
|
||||
}
|
||||
|
||||
public void setMostVisited(int mostVisited) {
|
||||
this.mostVisited = mostVisited;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -4,9 +4,6 @@ import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.GridView;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.TextView;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
@ -22,12 +19,8 @@ import org.mian.gitnex.viewmodels.CollaboratorsViewModel;
|
||||
public class CollaboratorsFragment extends Fragment {
|
||||
|
||||
public static boolean refreshCollaborators = false;
|
||||
|
||||
private ProgressBar mProgressBar;
|
||||
private FragmentCollaboratorsBinding fragmentCollaboratorsBinding;
|
||||
private CollaboratorsAdapter adapter;
|
||||
private GridView mGridView;
|
||||
private TextView noDataCollaborators;
|
||||
|
||||
private RepositoryContext repository;
|
||||
|
||||
public CollaboratorsFragment() {
|
||||
@ -48,11 +41,7 @@ public class CollaboratorsFragment extends Fragment {
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
|
||||
FragmentCollaboratorsBinding fragmentCollaboratorsBinding = FragmentCollaboratorsBinding.inflate(inflater, container, false);
|
||||
|
||||
noDataCollaborators = fragmentCollaboratorsBinding.noDataCollaborators;
|
||||
mProgressBar = fragmentCollaboratorsBinding.progressBar;
|
||||
mGridView = fragmentCollaboratorsBinding.gridView;
|
||||
fragmentCollaboratorsBinding = FragmentCollaboratorsBinding.inflate(inflater, container, false);
|
||||
|
||||
fetchDataAsync(repository.getOwner(), repository.getName());
|
||||
return fragmentCollaboratorsBinding.getRoot();
|
||||
@ -66,15 +55,15 @@ public class CollaboratorsFragment extends Fragment {
|
||||
collaboratorsModel.getCollaboratorsList(owner, repo, getContext()).observe(getViewLifecycleOwner(), collaboratorsListMain -> {
|
||||
adapter = new CollaboratorsAdapter(getContext(), collaboratorsListMain);
|
||||
if(adapter.getCount() > 0) {
|
||||
mGridView.setAdapter(adapter);
|
||||
noDataCollaborators.setVisibility(View.GONE);
|
||||
fragmentCollaboratorsBinding.gridView.setAdapter(adapter);
|
||||
fragmentCollaboratorsBinding.noDataCollaborators.setVisibility(View.GONE);
|
||||
}
|
||||
else {
|
||||
adapter.notifyDataSetChanged();
|
||||
mGridView.setAdapter(adapter);
|
||||
noDataCollaborators.setVisibility(View.VISIBLE);
|
||||
fragmentCollaboratorsBinding.gridView.setAdapter(adapter);
|
||||
fragmentCollaboratorsBinding.noDataCollaborators.setVisibility(View.VISIBLE);
|
||||
}
|
||||
mProgressBar.setVisibility(View.GONE);
|
||||
fragmentCollaboratorsBinding.progressBar.setVisibility(View.GONE);
|
||||
});
|
||||
|
||||
}
|
||||
|
@ -4,16 +4,17 @@ import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.view.*;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuInflater;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.inputmethod.EditorInfo;
|
||||
import android.widget.TextView;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.widget.SearchView;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.recyclerview.widget.DividerItemDecoration;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
|
||||
import org.mian.gitnex.R;
|
||||
import org.mian.gitnex.activities.MainActivity;
|
||||
import org.mian.gitnex.adapters.DraftsAdapter;
|
||||
@ -25,6 +26,7 @@ import org.mian.gitnex.helpers.TinyDB;
|
||||
import org.mian.gitnex.helpers.Toasty;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @author M M Arif
|
||||
@ -32,19 +34,17 @@ import java.util.List;
|
||||
|
||||
public class DraftsFragment extends Fragment {
|
||||
|
||||
private FragmentDraftsBinding fragmentDraftsBinding;
|
||||
private Context ctx;
|
||||
private DraftsAdapter adapter;
|
||||
private RecyclerView mRecyclerView;
|
||||
private DraftsApi draftsApi;
|
||||
private TextView noData;
|
||||
private List<DraftWithRepository> draftsList_;
|
||||
private int currentActiveAccountId;
|
||||
private SwipeRefreshLayout swipeRefresh;
|
||||
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
|
||||
FragmentDraftsBinding fragmentDraftsBinding = FragmentDraftsBinding.inflate(inflater, container, false);
|
||||
fragmentDraftsBinding = FragmentDraftsBinding.inflate(inflater, container, false);
|
||||
|
||||
ctx = getContext();
|
||||
setHasOptionsMenu(true);
|
||||
@ -56,19 +56,12 @@ public class DraftsFragment extends Fragment {
|
||||
draftsList_ = new ArrayList<>();
|
||||
draftsApi = BaseApi.getInstance(ctx, DraftsApi.class);
|
||||
|
||||
noData = fragmentDraftsBinding.noData;
|
||||
mRecyclerView = fragmentDraftsBinding.recyclerView;
|
||||
swipeRefresh = fragmentDraftsBinding.pullToRefresh;
|
||||
|
||||
mRecyclerView.setHasFixedSize(true);
|
||||
mRecyclerView.setLayoutManager(new LinearLayoutManager(ctx));
|
||||
|
||||
DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(mRecyclerView.getContext(), DividerItemDecoration.VERTICAL);
|
||||
mRecyclerView.addItemDecoration(dividerItemDecoration);
|
||||
fragmentDraftsBinding.recyclerView.setHasFixedSize(true);
|
||||
fragmentDraftsBinding.recyclerView.setLayoutManager(new LinearLayoutManager(ctx));
|
||||
|
||||
adapter = new DraftsAdapter(getContext(), getChildFragmentManager(), draftsList_);
|
||||
currentActiveAccountId = tinyDb.getInt("currentActiveAccountId");
|
||||
swipeRefresh.setOnRefreshListener(() -> new Handler(Looper.getMainLooper()).postDelayed(() -> {
|
||||
fragmentDraftsBinding.pullToRefresh.setOnRefreshListener(() -> new Handler(Looper.getMainLooper()).postDelayed(() -> {
|
||||
|
||||
draftsList_.clear();
|
||||
fetchDataAsync(currentActiveAccountId);
|
||||
@ -84,19 +77,19 @@ public class DraftsFragment extends Fragment {
|
||||
|
||||
draftsApi.getDrafts(accountId).observe(getViewLifecycleOwner(), drafts -> {
|
||||
|
||||
swipeRefresh.setRefreshing(false);
|
||||
fragmentDraftsBinding.pullToRefresh.setRefreshing(false);
|
||||
assert drafts != null;
|
||||
if(drafts.size() > 0) {
|
||||
|
||||
draftsList_.clear();
|
||||
noData.setVisibility(View.GONE);
|
||||
fragmentDraftsBinding.noData.setVisibility(View.GONE);
|
||||
draftsList_.addAll(drafts);
|
||||
adapter.notifyDataChanged();
|
||||
mRecyclerView.setAdapter(adapter);
|
||||
fragmentDraftsBinding.recyclerView.setAdapter(adapter);
|
||||
}
|
||||
else {
|
||||
|
||||
noData.setVisibility(View.VISIBLE);
|
||||
fragmentDraftsBinding.noData.setVisibility(View.VISIBLE);
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -112,7 +105,7 @@ public class DraftsFragment extends Fragment {
|
||||
|
||||
if(draftsList_.size() > 0) {
|
||||
|
||||
BaseApi.getInstance(ctx, DraftsApi.class).deleteAllDrafts(accountId);
|
||||
Objects.requireNonNull(BaseApi.getInstance(ctx, DraftsApi.class)).deleteAllDrafts(accountId);
|
||||
draftsList_.clear();
|
||||
adapter.notifyDataChanged();
|
||||
Toasty.success(ctx, getResources().getString(R.string.draftsDeleteSuccess));
|
||||
|
@ -8,7 +8,6 @@ import android.view.inputmethod.EditorInfo;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
import androidx.recyclerview.widget.DividerItemDecoration;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import org.mian.gitnex.R;
|
||||
import org.mian.gitnex.adapters.ExploreIssuesAdapter;
|
||||
@ -40,9 +39,7 @@ public class ExploreIssuesFragment extends Fragment {
|
||||
viewBinding.progressBar.setVisibility(View.VISIBLE);
|
||||
}, 50));
|
||||
|
||||
DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(requireActivity(), DividerItemDecoration.VERTICAL);
|
||||
viewBinding.recyclerViewSearchIssues.setHasFixedSize(true);
|
||||
viewBinding.recyclerViewSearchIssues.addItemDecoration(dividerItemDecoration);
|
||||
viewBinding.recyclerViewSearchIssues.setLayoutManager(new LinearLayoutManager(requireActivity()));
|
||||
|
||||
fetchDataAsync("");
|
||||
|
@ -11,7 +11,6 @@ import android.view.ViewGroup;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.recyclerview.widget.DividerItemDecoration;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import org.gitnex.tea4j.v2.models.Organization;
|
||||
import org.mian.gitnex.R;
|
||||
@ -72,9 +71,7 @@ public class ExplorePublicOrganizationsFragment extends Fragment {
|
||||
}
|
||||
});
|
||||
|
||||
DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(fragmentPublicOrgBinding.recyclerView.getContext(), DividerItemDecoration.VERTICAL);
|
||||
fragmentPublicOrgBinding.recyclerView.setHasFixedSize(true);
|
||||
fragmentPublicOrgBinding.recyclerView.addItemDecoration(dividerItemDecoration);
|
||||
fragmentPublicOrgBinding.recyclerView.setLayoutManager(new LinearLayoutManager(context));
|
||||
fragmentPublicOrgBinding.recyclerView.setAdapter(adapter);
|
||||
|
||||
|
@ -8,7 +8,6 @@ import android.view.*;
|
||||
import android.view.inputmethod.EditorInfo;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.recyclerview.widget.DividerItemDecoration;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
|
||||
import org.gitnex.tea4j.v2.models.Repository;
|
||||
@ -77,9 +76,7 @@ public class ExploreRepositoriesFragment extends Fragment {
|
||||
}
|
||||
}));
|
||||
|
||||
DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(context, DividerItemDecoration.VERTICAL);
|
||||
viewBinding.recyclerViewReposSearch.setHasFixedSize(true);
|
||||
viewBinding.recyclerViewReposSearch.addItemDecoration(dividerItemDecoration);
|
||||
viewBinding.recyclerViewReposSearch.setLayoutManager(new LinearLayoutManager(context));
|
||||
viewBinding.recyclerViewReposSearch.setAdapter(adapter);
|
||||
|
||||
|
@ -8,7 +8,6 @@ import android.view.*;
|
||||
import android.view.inputmethod.EditorInfo;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.recyclerview.widget.DividerItemDecoration;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import org.gitnex.tea4j.v2.models.InlineResponse2001;
|
||||
import org.gitnex.tea4j.v2.models.User;
|
||||
@ -64,9 +63,7 @@ public class ExploreUsersFragment extends Fragment {
|
||||
}
|
||||
}));
|
||||
|
||||
DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(context, DividerItemDecoration.VERTICAL);
|
||||
viewBinding.recyclerViewExploreUsers.setHasFixedSize(true);
|
||||
viewBinding.recyclerViewExploreUsers.addItemDecoration(dividerItemDecoration);
|
||||
viewBinding.recyclerViewExploreUsers.setLayoutManager(new LinearLayoutManager(context));
|
||||
viewBinding.recyclerViewExploreUsers.setAdapter(adapter);
|
||||
|
||||
|
@ -11,7 +11,6 @@ import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.widget.SearchView;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
import androidx.recyclerview.widget.DividerItemDecoration;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import org.gitnex.tea4j.v2.models.ContentsResponse;
|
||||
import org.mian.gitnex.R;
|
||||
@ -71,7 +70,6 @@ public class FilesFragment extends Fragment implements FilesAdapter.FilesAdapter
|
||||
binding.recyclerView.setHasFixedSize(true);
|
||||
binding.recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
|
||||
binding.recyclerView.setAdapter(filesAdapter);
|
||||
binding.recyclerView.addItemDecoration(new DividerItemDecoration(binding.recyclerView.getContext(), DividerItemDecoration.VERTICAL));
|
||||
|
||||
binding.breadcrumbsView.setItems(new ArrayList<>(
|
||||
Collections.singletonList(BreadcrumbItem.createSimpleItem(getResources().getString(R.string.filesBreadcrumbRoot) + getResources().getString(R.string.colonDivider) + repository.getBranchRef()))));
|
||||
|
@ -9,7 +9,6 @@ import android.view.inputmethod.EditorInfo;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.recyclerview.widget.DividerItemDecoration;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import org.gitnex.tea4j.v2.models.Issue;
|
||||
import org.mian.gitnex.R;
|
||||
@ -78,9 +77,7 @@ public class IssuesFragment extends Fragment {
|
||||
}
|
||||
}));
|
||||
|
||||
DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(fragmentIssuesBinding.recyclerView.getContext(), DividerItemDecoration.VERTICAL);
|
||||
fragmentIssuesBinding.recyclerView.setHasFixedSize(true);
|
||||
fragmentIssuesBinding.recyclerView.addItemDecoration(dividerItemDecoration);
|
||||
fragmentIssuesBinding.recyclerView.setLayoutManager(new LinearLayoutManager(context));
|
||||
fragmentIssuesBinding.recyclerView.setAdapter(adapter);
|
||||
|
||||
|
@ -11,7 +11,6 @@ import android.widget.TextView;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
import androidx.recyclerview.widget.DividerItemDecoration;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
|
||||
@ -63,9 +62,6 @@ public class LabelsFragment extends Fragment {
|
||||
mRecyclerView.setHasFixedSize(true);
|
||||
mRecyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
|
||||
|
||||
DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(mRecyclerView.getContext(), DividerItemDecoration.VERTICAL);
|
||||
mRecyclerView.addItemDecoration(dividerItemDecoration);
|
||||
|
||||
mProgressBar = fragmentLabelsBinding.progressBar;
|
||||
|
||||
swipeRefresh.setOnRefreshListener(() -> new Handler(Looper.getMainLooper()).postDelayed(() -> {
|
||||
|
@ -4,13 +4,17 @@ import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.view.*;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuInflater;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.inputmethod.EditorInfo;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
import androidx.recyclerview.widget.DividerItemDecoration;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import org.gitnex.tea4j.v2.models.Milestone;
|
||||
import org.mian.gitnex.R;
|
||||
@ -28,7 +32,6 @@ import java.util.List;
|
||||
|
||||
public class MilestonesFragment extends Fragment {
|
||||
|
||||
public String state = "open";
|
||||
private MilestonesViewModel milestonesViewModel;
|
||||
private FragmentMilestonesBinding viewBinding;
|
||||
private Menu menu;
|
||||
@ -37,6 +40,7 @@ public class MilestonesFragment extends Fragment {
|
||||
private RepositoryContext repository;
|
||||
private String milestoneId;
|
||||
private int page = 1;
|
||||
public String state = "open";
|
||||
|
||||
public static MilestonesFragment newInstance(RepositoryContext repository) {
|
||||
MilestonesFragment fragment = new MilestonesFragment();
|
||||
@ -44,15 +48,6 @@ public class MilestonesFragment extends Fragment {
|
||||
return fragment;
|
||||
}
|
||||
|
||||
private static int getMilestoneIndex(int milestoneId, List<Milestone> milestones) {
|
||||
for(Milestone milestone : milestones) {
|
||||
if(milestone.getId() == milestoneId) {
|
||||
return milestones.indexOf(milestone);
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
repository = RepositoryContext.fromBundle(requireArguments());
|
||||
@ -75,8 +70,6 @@ public class MilestonesFragment extends Fragment {
|
||||
|
||||
dataList = new ArrayList<>();
|
||||
|
||||
DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(viewBinding.recyclerView.getContext(), DividerItemDecoration.VERTICAL);
|
||||
viewBinding.recyclerView.addItemDecoration(dividerItemDecoration);
|
||||
viewBinding.recyclerView.setHasFixedSize(true);
|
||||
viewBinding.recyclerView.setLayoutManager(new LinearLayoutManager(ctx));
|
||||
|
||||
@ -150,6 +143,15 @@ public class MilestonesFragment extends Fragment {
|
||||
});
|
||||
}
|
||||
|
||||
private static int getMilestoneIndex(int milestoneId, List<Milestone> milestones) {
|
||||
for(Milestone milestone : milestones) {
|
||||
if(milestone.getId() == milestoneId) {
|
||||
return milestones.indexOf(milestone);
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreateOptionsMenu(@NonNull Menu menu, @NonNull MenuInflater inflater) {
|
||||
|
||||
|
@ -5,15 +5,17 @@ import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuInflater;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.TextView;
|
||||
import android.view.inputmethod.EditorInfo;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.widget.SearchView;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.recyclerview.widget.DividerItemDecoration;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
|
||||
import org.mian.gitnex.R;
|
||||
import org.mian.gitnex.activities.MainActivity;
|
||||
import org.mian.gitnex.adapters.MostVisitedReposAdapter;
|
||||
@ -22,8 +24,10 @@ import org.mian.gitnex.database.api.RepositoriesApi;
|
||||
import org.mian.gitnex.database.models.Repository;
|
||||
import org.mian.gitnex.databinding.FragmentDraftsBinding;
|
||||
import org.mian.gitnex.helpers.TinyDB;
|
||||
import org.mian.gitnex.helpers.Toasty;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @author M M Arif
|
||||
@ -31,19 +35,17 @@ import java.util.List;
|
||||
|
||||
public class MostVisitedReposFragment extends Fragment {
|
||||
|
||||
private FragmentDraftsBinding fragmentDraftsBinding;
|
||||
private Context ctx;
|
||||
private MostVisitedReposAdapter adapter;
|
||||
private RecyclerView mRecyclerView;
|
||||
private RepositoriesApi repositoriesApi;
|
||||
private TextView noData;
|
||||
private List<Repository> mostVisitedReposList;
|
||||
private int currentActiveAccountId;
|
||||
private SwipeRefreshLayout swipeRefresh;
|
||||
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
|
||||
FragmentDraftsBinding fragmentDraftsBinding = FragmentDraftsBinding.inflate(inflater, container, false);
|
||||
fragmentDraftsBinding = FragmentDraftsBinding.inflate(inflater, container, false);
|
||||
|
||||
ctx = getContext();
|
||||
setHasOptionsMenu(true);
|
||||
@ -55,19 +57,12 @@ public class MostVisitedReposFragment extends Fragment {
|
||||
mostVisitedReposList = new ArrayList<>();
|
||||
repositoriesApi = BaseApi.getInstance(ctx, RepositoriesApi.class);
|
||||
|
||||
noData = fragmentDraftsBinding.noData;
|
||||
mRecyclerView = fragmentDraftsBinding.recyclerView;
|
||||
swipeRefresh = fragmentDraftsBinding.pullToRefresh;
|
||||
fragmentDraftsBinding.recyclerView.setHasFixedSize(true);
|
||||
fragmentDraftsBinding.recyclerView.setLayoutManager(new LinearLayoutManager(ctx));
|
||||
|
||||
mRecyclerView.setHasFixedSize(true);
|
||||
mRecyclerView.setLayoutManager(new LinearLayoutManager(ctx));
|
||||
|
||||
DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(mRecyclerView.getContext(), DividerItemDecoration.VERTICAL);
|
||||
mRecyclerView.addItemDecoration(dividerItemDecoration);
|
||||
|
||||
adapter = new MostVisitedReposAdapter(mostVisitedReposList);
|
||||
adapter = new MostVisitedReposAdapter(ctx, mostVisitedReposList);
|
||||
currentActiveAccountId = tinyDb.getInt("currentActiveAccountId");
|
||||
swipeRefresh.setOnRefreshListener(() -> new Handler(Looper.getMainLooper()).postDelayed(() -> {
|
||||
fragmentDraftsBinding.pullToRefresh.setOnRefreshListener(() -> new Handler(Looper.getMainLooper()).postDelayed(() -> {
|
||||
|
||||
mostVisitedReposList.clear();
|
||||
fetchDataAsync(currentActiveAccountId);
|
||||
@ -82,21 +77,101 @@ public class MostVisitedReposFragment extends Fragment {
|
||||
|
||||
repositoriesApi.fetchAllMostVisited(accountId).observe(getViewLifecycleOwner(), mostVisitedRepos -> {
|
||||
|
||||
swipeRefresh.setRefreshing(false);
|
||||
fragmentDraftsBinding.pullToRefresh.setRefreshing(false);
|
||||
assert mostVisitedRepos != null;
|
||||
if(mostVisitedRepos.size() > 0) {
|
||||
|
||||
mostVisitedReposList.clear();
|
||||
noData.setVisibility(View.GONE);
|
||||
fragmentDraftsBinding.noData.setVisibility(View.GONE);
|
||||
mostVisitedReposList.addAll(mostVisitedRepos);
|
||||
adapter.notifyDataChanged();
|
||||
mRecyclerView.setAdapter(adapter);
|
||||
fragmentDraftsBinding.recyclerView.setAdapter(adapter);
|
||||
}
|
||||
else {
|
||||
|
||||
noData.setVisibility(View.VISIBLE);
|
||||
fragmentDraftsBinding.noData.setVisibility(View.VISIBLE);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void resetAllRepositoryCounter(int accountId) {
|
||||
|
||||
if(mostVisitedReposList.size() > 0) {
|
||||
|
||||
Objects.requireNonNull(BaseApi.getInstance(ctx, RepositoriesApi.class)).resetAllRepositoryMostVisited(accountId);
|
||||
mostVisitedReposList.clear();
|
||||
adapter.notifyDataChanged();
|
||||
Toasty.success(ctx, getResources().getString(R.string.resetMostReposCounter));
|
||||
}
|
||||
else {
|
||||
Toasty.warning(ctx, getResources().getString(R.string.noDataFound));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreateOptionsMenu(@NonNull Menu menu, @NonNull MenuInflater inflater) {
|
||||
|
||||
inflater.inflate(R.menu.reset_menu, menu);
|
||||
inflater.inflate(R.menu.search_menu, menu);
|
||||
super.onCreateOptionsMenu(menu, inflater);
|
||||
|
||||
MenuItem searchItem = menu.findItem(R.id.action_search);
|
||||
SearchView searchView = (SearchView) searchItem.getActionView();
|
||||
searchView.setImeOptions(EditorInfo.IME_ACTION_DONE);
|
||||
|
||||
searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {
|
||||
|
||||
@Override
|
||||
public boolean onQueryTextSubmit(String query) {
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onQueryTextChange(String newText) {
|
||||
|
||||
filter(newText);
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
|
||||
if(item.getItemId() == R.id.reset_menu_item) {
|
||||
|
||||
if(mostVisitedReposList.size() == 0) {
|
||||
Toasty.warning(ctx, getResources().getString(R.string.noDataFound));
|
||||
}
|
||||
else {
|
||||
new MaterialAlertDialogBuilder(ctx).setTitle(R.string.reset).setMessage(R.string.resetCounterAllDialogMessage).setPositiveButton(R.string.reset, (dialog, which) -> {
|
||||
|
||||
resetAllRepositoryCounter(currentActiveAccountId);
|
||||
dialog.dismiss();
|
||||
}).setNeutralButton(R.string.cancelButton, null).show();
|
||||
}
|
||||
}
|
||||
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
|
||||
private void filter(String text) {
|
||||
|
||||
List<Repository> arr = new ArrayList<>();
|
||||
|
||||
for(Repository d : mostVisitedReposList) {
|
||||
|
||||
if(d == null || d.getRepositoryOwner() == null || d.getRepositoryName() == null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if(d.getRepositoryOwner().toLowerCase().contains(text) || d.getRepositoryName().toLowerCase().contains(text)) {
|
||||
arr.add(d);
|
||||
}
|
||||
}
|
||||
|
||||
adapter.updateList(arr);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -3,12 +3,16 @@ package org.mian.gitnex.fragments;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.view.*;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuInflater;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.inputmethod.EditorInfo;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
import androidx.recyclerview.widget.DividerItemDecoration;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import org.mian.gitnex.R;
|
||||
import org.mian.gitnex.activities.MainActivity;
|
||||
@ -22,13 +26,13 @@ import org.mian.gitnex.viewmodels.IssuesViewModel;
|
||||
|
||||
public class MyIssuesFragment extends Fragment {
|
||||
|
||||
public String state = "open";
|
||||
public boolean assignedToMe = false;
|
||||
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) {
|
||||
@ -39,8 +43,6 @@ public class MyIssuesFragment extends Fragment {
|
||||
|
||||
fragmentIssuesBinding.recyclerView.setHasFixedSize(true);
|
||||
fragmentIssuesBinding.recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
|
||||
DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(fragmentIssuesBinding.recyclerView.getContext(), DividerItemDecoration.VERTICAL);
|
||||
fragmentIssuesBinding.recyclerView.addItemDecoration(dividerItemDecoration);
|
||||
|
||||
((MainActivity) requireActivity()).setFragmentRefreshListenerMyIssues(myIssues -> {
|
||||
|
||||
@ -73,6 +75,8 @@ public class MyIssuesFragment extends Fragment {
|
||||
return fragmentIssuesBinding.getRoot();
|
||||
}
|
||||
|
||||
;
|
||||
|
||||
private void fetchDataAsync(String query, String state, boolean assignedToMe) {
|
||||
|
||||
issuesViewModel.getIssuesList(query, "issues", true, state, assignedToMe, getContext()).observe(getViewLifecycleOwner(), issuesListMain -> {
|
||||
|
@ -7,11 +7,9 @@ import android.os.Looper;
|
||||
import android.view.*;
|
||||
import android.view.inputmethod.EditorInfo;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import org.mian.gitnex.R;
|
||||
import org.mian.gitnex.activities.BaseActivity;
|
||||
import org.mian.gitnex.activities.CreateRepoActivity;
|
||||
@ -19,7 +17,6 @@ import org.mian.gitnex.activities.MainActivity;
|
||||
import org.mian.gitnex.adapters.ReposListAdapter;
|
||||
import org.mian.gitnex.databinding.FragmentRepositoriesBinding;
|
||||
import org.mian.gitnex.helpers.Constants;
|
||||
import org.mian.gitnex.helpers.DividerItemDecorator;
|
||||
import org.mian.gitnex.viewmodels.RepositoriesViewModel;
|
||||
|
||||
/**
|
||||
@ -54,10 +51,7 @@ public class MyRepositoriesFragment extends Fragment {
|
||||
fragmentRepositoriesBinding.recyclerView.setHasFixedSize(true);
|
||||
fragmentRepositoriesBinding.recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
|
||||
|
||||
RecyclerView.ItemDecoration dividerItemDecoration = new DividerItemDecorator(ContextCompat.getDrawable(requireContext(), R.drawable.shape_list_divider));
|
||||
fragmentRepositoriesBinding.recyclerView.addItemDecoration(dividerItemDecoration);
|
||||
|
||||
fragmentRepositoriesBinding.recyclerView.setPadding(0, 0, 0, 240);
|
||||
fragmentRepositoriesBinding.recyclerView.setPadding(0, 0, 0, 220);
|
||||
fragmentRepositoriesBinding.recyclerView.setClipToPadding(false);
|
||||
|
||||
fragmentRepositoriesBinding.pullToRefresh.setOnRefreshListener(() -> new Handler(Looper.getMainLooper()).postDelayed(() -> {
|
||||
|
@ -8,7 +8,6 @@ import android.view.*;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.recyclerview.widget.DividerItemDecoration;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
@ -71,12 +70,9 @@ public class NotificationsFragment extends Fragment implements NotificationsAdap
|
||||
|
||||
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(context);
|
||||
|
||||
DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(viewBinding.notifications.getContext(), DividerItemDecoration.VERTICAL);
|
||||
|
||||
viewBinding.notifications.setHasFixedSize(true);
|
||||
viewBinding.notifications.setLayoutManager(linearLayoutManager);
|
||||
viewBinding.notifications.setAdapter(notificationsAdapter);
|
||||
viewBinding.notifications.addItemDecoration(dividerItemDecoration);
|
||||
|
||||
viewBinding.notifications.addOnScrollListener(new RecyclerView.OnScrollListener() {
|
||||
|
||||
|
@ -11,7 +11,6 @@ import android.widget.TextView;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
import androidx.recyclerview.widget.DividerItemDecoration;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
|
||||
@ -26,13 +25,14 @@ import org.mian.gitnex.viewmodels.OrganizationLabelsViewModel;
|
||||
|
||||
public class OrganizationLabelsFragment extends Fragment {
|
||||
|
||||
private static final String repoOwnerF = "param1";
|
||||
private final String type = "org";
|
||||
private OrganizationLabelsViewModel organizationLabelsViewModel;
|
||||
private ProgressBar mProgressBar;
|
||||
private RecyclerView mRecyclerView;
|
||||
private LabelsAdapter adapter;
|
||||
private TextView noData;
|
||||
private static final String repoOwnerF = "param1";
|
||||
private final String type = "org";
|
||||
|
||||
private String repoOwner;
|
||||
|
||||
public static OrganizationLabelsFragment newInstance(String param1) {
|
||||
@ -69,9 +69,6 @@ public class OrganizationLabelsFragment extends Fragment {
|
||||
mRecyclerView.setHasFixedSize(true);
|
||||
mRecyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
|
||||
|
||||
DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(mRecyclerView.getContext(), DividerItemDecoration.VERTICAL);
|
||||
mRecyclerView.addItemDecoration(dividerItemDecoration);
|
||||
|
||||
mProgressBar = fragmentLabelsBinding.progressBar;
|
||||
|
||||
swipeRefresh.setOnRefreshListener(() -> new Handler(Looper.getMainLooper()).postDelayed(() -> {
|
||||
|
@ -1,7 +1,12 @@
|
||||
package org.mian.gitnex.fragments;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.*;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuInflater;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.inputmethod.EditorInfo;
|
||||
import android.widget.GridView;
|
||||
import android.widget.ProgressBar;
|
||||
@ -11,7 +16,7 @@ import androidx.fragment.app.Fragment;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
import org.mian.gitnex.R;
|
||||
import org.mian.gitnex.adapters.UserGridAdapter;
|
||||
import org.mian.gitnex.databinding.FragmentMembersByOrgBinding;
|
||||
import org.mian.gitnex.databinding.FragmentOrganizationMembersBinding;
|
||||
import org.mian.gitnex.helpers.AppUtil;
|
||||
import org.mian.gitnex.viewmodels.MembersByOrgViewModel;
|
||||
|
||||
@ -19,20 +24,20 @@ import org.mian.gitnex.viewmodels.MembersByOrgViewModel;
|
||||
* @author M M Arif
|
||||
*/
|
||||
|
||||
public class MembersByOrgFragment extends Fragment {
|
||||
public class OrganizationMembersFragment extends Fragment {
|
||||
|
||||
private static final String orgNameF = "param2";
|
||||
private TextView noDataMembers;
|
||||
private static String orgNameF = "param2";
|
||||
private String orgName;
|
||||
private UserGridAdapter adapter;
|
||||
private GridView mGridView;
|
||||
private ProgressBar progressBar;
|
||||
|
||||
public MembersByOrgFragment() {
|
||||
public OrganizationMembersFragment() {
|
||||
}
|
||||
|
||||
public static MembersByOrgFragment newInstance(String param1) {
|
||||
MembersByOrgFragment fragment = new MembersByOrgFragment();
|
||||
public static OrganizationMembersFragment newInstance(String param1) {
|
||||
OrganizationMembersFragment fragment = new OrganizationMembersFragment();
|
||||
Bundle args = new Bundle();
|
||||
args.putString(orgNameF, param1);
|
||||
fragment.setArguments(args);
|
||||
@ -48,9 +53,9 @@ public class MembersByOrgFragment extends Fragment {
|
||||
}
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
|
||||
FragmentMembersByOrgBinding fragmentMembersByOrgBinding = FragmentMembersByOrgBinding.inflate(inflater, container, false);
|
||||
FragmentOrganizationMembersBinding fragmentMembersByOrgBinding = FragmentOrganizationMembersBinding.inflate(inflater, container, false);
|
||||
setHasOptionsMenu(true);
|
||||
|
||||
noDataMembers = fragmentMembersByOrgBinding.noDataMembers;
|
||||
@ -102,7 +107,6 @@ public class MembersByOrgFragment extends Fragment {
|
||||
}
|
||||
|
||||
searchView.setOnQueryTextListener(new androidx.appcompat.widget.SearchView.OnQueryTextListener() {
|
||||
|
||||
@Override
|
||||
public boolean onQueryTextSubmit(String query) {
|
||||
return false;
|
@ -3,12 +3,16 @@ package org.mian.gitnex.fragments;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.view.*;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuInflater;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.inputmethod.EditorInfo;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
import androidx.recyclerview.widget.DividerItemDecoration;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import org.mian.gitnex.R;
|
||||
import org.mian.gitnex.activities.MainActivity;
|
||||
@ -21,21 +25,21 @@ import org.mian.gitnex.viewmodels.RepositoriesViewModel;
|
||||
* @author M M Arif
|
||||
*/
|
||||
|
||||
public class RepositoriesByOrgFragment extends Fragment {
|
||||
public class OrganizationRepositoriesFragment extends Fragment {
|
||||
|
||||
private static final String getOrgName = null;
|
||||
private RepositoriesViewModel repositoriesViewModel;
|
||||
private FragmentRepositoriesBinding fragmentRepositoriesBinding;
|
||||
private ReposListAdapter adapter;
|
||||
private int page = 1;
|
||||
private int resultLimit;
|
||||
private static final String getOrgName = null;
|
||||
private String orgName;
|
||||
|
||||
public RepositoriesByOrgFragment() {
|
||||
public OrganizationRepositoriesFragment() {
|
||||
}
|
||||
|
||||
public static RepositoriesByOrgFragment newInstance(String orgName) {
|
||||
RepositoriesByOrgFragment fragment = new RepositoriesByOrgFragment();
|
||||
public static OrganizationRepositoriesFragment newInstance(String orgName) {
|
||||
OrganizationRepositoriesFragment fragment = new OrganizationRepositoriesFragment();
|
||||
Bundle args = new Bundle();
|
||||
args.putString(getOrgName, orgName);
|
||||
fragment.setArguments(args);
|
||||
@ -63,8 +67,6 @@ public class RepositoriesByOrgFragment extends Fragment {
|
||||
|
||||
fragmentRepositoriesBinding.recyclerView.setHasFixedSize(true);
|
||||
fragmentRepositoriesBinding.recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
|
||||
DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(fragmentRepositoriesBinding.recyclerView.getContext(), DividerItemDecoration.VERTICAL);
|
||||
fragmentRepositoriesBinding.recyclerView.addItemDecoration(dividerItemDecoration);
|
||||
|
||||
fragmentRepositoriesBinding.pullToRefresh.setOnRefreshListener(() -> new Handler(Looper.getMainLooper()).postDelayed(() -> {
|
||||
|
||||
@ -80,6 +82,8 @@ public class RepositoriesByOrgFragment extends Fragment {
|
||||
return fragmentRepositoriesBinding.getRoot();
|
||||
}
|
||||
|
||||
;
|
||||
|
||||
private void fetchDataAsync() {
|
||||
|
||||
repositoriesViewModel.getRepositories(page, resultLimit, "", "org", orgName, getContext()).observe(getViewLifecycleOwner(), reposListMain -> {
|
||||
@ -140,7 +144,6 @@ public class RepositoriesByOrgFragment extends Fragment {
|
||||
searchView.setImeOptions(EditorInfo.IME_ACTION_DONE);
|
||||
|
||||
searchView.setOnQueryTextListener(new androidx.appcompat.widget.SearchView.OnQueryTextListener() {
|
||||
|
||||
@Override
|
||||
public boolean onQueryTextSubmit(String query) {
|
||||
return false;
|
@ -6,18 +6,15 @@ import android.os.Looper;
|
||||
import android.view.*;
|
||||
import android.view.inputmethod.EditorInfo;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
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.MainActivity;
|
||||
import org.mian.gitnex.adapters.ReposListAdapter;
|
||||
import org.mian.gitnex.databinding.FragmentRepositoriesBinding;
|
||||
import org.mian.gitnex.helpers.Constants;
|
||||
import org.mian.gitnex.helpers.DividerItemDecorator;
|
||||
import org.mian.gitnex.viewmodels.RepositoriesViewModel;
|
||||
|
||||
/**
|
||||
@ -61,9 +58,6 @@ public class OrganizationTeamInfoReposFragment extends Fragment {
|
||||
fragmentRepositoriesBinding.recyclerView.setHasFixedSize(true);
|
||||
fragmentRepositoriesBinding.recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
|
||||
|
||||
RecyclerView.ItemDecoration dividerItemDecoration = new DividerItemDecorator(ContextCompat.getDrawable(requireContext(), R.drawable.shape_list_divider));
|
||||
fragmentRepositoriesBinding.recyclerView.addItemDecoration(dividerItemDecoration);
|
||||
|
||||
fragmentRepositoriesBinding.pullToRefresh.setOnRefreshListener(() -> new Handler(Looper.getMainLooper()).postDelayed(() -> {
|
||||
|
||||
page = 1;
|
||||
|
@ -3,44 +3,49 @@ package org.mian.gitnex.fragments;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.view.*;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuInflater;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.inputmethod.EditorInfo;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.TextView;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
import androidx.recyclerview.widget.DividerItemDecoration;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
|
||||
import org.gitnex.tea4j.v2.models.OrganizationPermissions;
|
||||
import org.mian.gitnex.R;
|
||||
import org.mian.gitnex.adapters.TeamsByOrgAdapter;
|
||||
import org.mian.gitnex.databinding.FragmentTeamsByOrgBinding;
|
||||
import org.mian.gitnex.adapters.OrganizationTeamsAdapter;
|
||||
import org.mian.gitnex.databinding.FragmentOrganizationTeamsBinding;
|
||||
import org.mian.gitnex.viewmodels.TeamsByOrgViewModel;
|
||||
|
||||
/**
|
||||
* @author M M Arif
|
||||
*/
|
||||
|
||||
public class TeamsByOrgFragment extends Fragment {
|
||||
public class OrganizationTeamsFragment extends Fragment {
|
||||
|
||||
private static final String orgNameF = "param2";
|
||||
public static boolean resumeTeams = false;
|
||||
private TeamsByOrgViewModel teamsByOrgViewModel;
|
||||
public static boolean resumeTeams = false;
|
||||
|
||||
private ProgressBar mProgressBar;
|
||||
private RecyclerView mRecyclerView;
|
||||
private TextView noDataTeams;
|
||||
private static final String orgNameF = "param2";
|
||||
private String orgName;
|
||||
private OrganizationPermissions permissions;
|
||||
private TeamsByOrgAdapter adapter;
|
||||
private OrganizationTeamsAdapter adapter;
|
||||
|
||||
public TeamsByOrgFragment() {
|
||||
public OrganizationTeamsFragment() {
|
||||
}
|
||||
|
||||
public static TeamsByOrgFragment newInstance(String param1, OrganizationPermissions permissions) {
|
||||
TeamsByOrgFragment fragment = new TeamsByOrgFragment();
|
||||
public static OrganizationTeamsFragment newInstance(String param1, OrganizationPermissions permissions) {
|
||||
OrganizationTeamsFragment fragment = new OrganizationTeamsFragment();
|
||||
Bundle args = new Bundle();
|
||||
args.putString(orgNameF, param1);
|
||||
args.putSerializable("permissions", permissions);
|
||||
@ -60,7 +65,7 @@ public class TeamsByOrgFragment extends Fragment {
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
|
||||
FragmentTeamsByOrgBinding fragmentTeamsByOrgBinding = FragmentTeamsByOrgBinding.inflate(inflater, container, false);
|
||||
FragmentOrganizationTeamsBinding fragmentTeamsByOrgBinding = FragmentOrganizationTeamsBinding.inflate(inflater, container, false);
|
||||
setHasOptionsMenu(true);
|
||||
teamsByOrgViewModel = new ViewModelProvider(this).get(TeamsByOrgViewModel.class);
|
||||
|
||||
@ -72,9 +77,6 @@ public class TeamsByOrgFragment extends Fragment {
|
||||
mRecyclerView.setHasFixedSize(true);
|
||||
mRecyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
|
||||
|
||||
DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(mRecyclerView.getContext(), DividerItemDecoration.VERTICAL);
|
||||
mRecyclerView.addItemDecoration(dividerItemDecoration);
|
||||
|
||||
mProgressBar = fragmentTeamsByOrgBinding.progressBar;
|
||||
|
||||
swipeRefresh.setOnRefreshListener(() -> new Handler(Looper.getMainLooper()).postDelayed(() -> {
|
||||
@ -101,7 +103,7 @@ public class TeamsByOrgFragment extends Fragment {
|
||||
private void fetchDataAsync(String owner) {
|
||||
|
||||
teamsByOrgViewModel.getTeamsByOrg(owner, getContext(), noDataTeams, mProgressBar).observe(getViewLifecycleOwner(), orgTeamsListMain -> {
|
||||
adapter = new TeamsByOrgAdapter(getContext(), orgTeamsListMain, permissions, orgName);
|
||||
adapter = new OrganizationTeamsAdapter(getContext(), orgTeamsListMain, permissions, orgName);
|
||||
if(adapter.getItemCount() > 0) {
|
||||
mRecyclerView.setAdapter(adapter);
|
||||
noDataTeams.setVisibility(View.GONE);
|
||||
@ -127,7 +129,6 @@ public class TeamsByOrgFragment extends Fragment {
|
||||
searchView.setImeOptions(EditorInfo.IME_ACTION_DONE);
|
||||
|
||||
searchView.setOnQueryTextListener(new androidx.appcompat.widget.SearchView.OnQueryTextListener() {
|
||||
|
||||
@Override
|
||||
public boolean onQueryTextSubmit(String query) {
|
||||
return false;
|
@ -7,18 +7,15 @@ import android.os.Looper;
|
||||
import android.view.*;
|
||||
import android.view.inputmethod.EditorInfo;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import org.mian.gitnex.R;
|
||||
import org.mian.gitnex.activities.CreateOrganizationActivity;
|
||||
import org.mian.gitnex.activities.MainActivity;
|
||||
import org.mian.gitnex.adapters.OrganizationsListAdapter;
|
||||
import org.mian.gitnex.databinding.FragmentOrganizationsBinding;
|
||||
import org.mian.gitnex.helpers.Constants;
|
||||
import org.mian.gitnex.helpers.DividerItemDecorator;
|
||||
import org.mian.gitnex.viewmodels.OrganizationsViewModel;
|
||||
|
||||
/**
|
||||
@ -53,10 +50,7 @@ public class OrganizationsFragment extends Fragment {
|
||||
fragmentOrganizationsBinding.recyclerView.setHasFixedSize(true);
|
||||
fragmentOrganizationsBinding.recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
|
||||
|
||||
RecyclerView.ItemDecoration dividerItemDecoration = new DividerItemDecorator(ContextCompat.getDrawable(requireContext(), R.drawable.shape_list_divider));
|
||||
fragmentOrganizationsBinding.recyclerView.addItemDecoration(dividerItemDecoration);
|
||||
|
||||
fragmentOrganizationsBinding.recyclerView.setPadding(0, 0, 0, 240);
|
||||
fragmentOrganizationsBinding.recyclerView.setPadding(0, 0, 0, 220);
|
||||
fragmentOrganizationsBinding.recyclerView.setClipToPadding(false);
|
||||
|
||||
fragmentOrganizationsBinding.pullToRefresh.setOnRefreshListener(() -> new Handler(Looper.getMainLooper()).postDelayed(() -> {
|
||||
|
@ -10,7 +10,6 @@ import android.view.inputmethod.EditorInfo;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.recyclerview.widget.DividerItemDecoration;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
|
||||
import org.gitnex.tea4j.v2.models.PullRequest;
|
||||
@ -82,9 +81,7 @@ public class PullRequestsFragment extends Fragment {
|
||||
|
||||
}));
|
||||
|
||||
DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(fragmentPullRequestsBinding.recyclerView.getContext(), DividerItemDecoration.VERTICAL);
|
||||
fragmentPullRequestsBinding.recyclerView.setHasFixedSize(true);
|
||||
fragmentPullRequestsBinding.recyclerView.addItemDecoration(dividerItemDecoration);
|
||||
fragmentPullRequestsBinding.recyclerView.setLayoutManager(new LinearLayoutManager(context));
|
||||
fragmentPullRequestsBinding.recyclerView.setAdapter(adapter);
|
||||
|
||||
|
@ -8,14 +8,17 @@ import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.view.*;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import androidx.activity.result.ActivityResultLauncher;
|
||||
import androidx.activity.result.contract.ActivityResultContracts;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.core.app.NotificationCompat;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
import androidx.recyclerview.widget.DividerItemDecoration;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import org.gitnex.tea4j.v2.auth.ApiKeyAuth;
|
||||
import org.gitnex.tea4j.v2.models.Release;
|
||||
@ -41,7 +44,11 @@ import java.util.Objects;
|
||||
import javax.net.ssl.HttpsURLConnection;
|
||||
import javax.net.ssl.SSLContext;
|
||||
import javax.net.ssl.X509TrustManager;
|
||||
import okhttp3.*;
|
||||
import okhttp3.Call;
|
||||
import okhttp3.Callback;
|
||||
import okhttp3.OkHttpClient;
|
||||
import okhttp3.Request;
|
||||
import okhttp3.Response;
|
||||
|
||||
/**
|
||||
* @author M M Arif
|
||||
@ -49,65 +56,6 @@ import okhttp3.*;
|
||||
|
||||
public class ReleasesFragment extends Fragment {
|
||||
|
||||
public static String currentDownloadUrl = null;
|
||||
ActivityResultLauncher<Intent> downloadLauncher = registerForActivityResult(new ActivityResultContracts.StartActivityForResult(), result -> {
|
||||
|
||||
if(result.getResultCode() == Activity.RESULT_OK && result.getData() != null) {
|
||||
|
||||
try {
|
||||
|
||||
NotificationCompat.Builder builder = new NotificationCompat.Builder(requireContext(), requireContext().getPackageName()).setContentTitle(getString(R.string.fileViewerNotificationTitleStarted))
|
||||
.setContentText(getString(R.string.fileViewerNotificationDescriptionStarted, Uri.parse(currentDownloadUrl).getLastPathSegment())).setSmallIcon(R.drawable.gitnex_transparent)
|
||||
.setPriority(NotificationCompat.PRIORITY_LOW).setChannelId(Constants.downloadNotificationChannelId).setOngoing(true);
|
||||
|
||||
int notificationId = Notifications.uniqueNotificationId(requireContext());
|
||||
|
||||
NotificationManager notificationManager = (NotificationManager) requireContext().getSystemService(Context.NOTIFICATION_SERVICE);
|
||||
notificationManager.notify(notificationId, builder.build());
|
||||
|
||||
SSLContext sslContext = SSLContext.getInstance("TLS");
|
||||
MemorizingTrustManager memorizingTrustManager = new MemorizingTrustManager(requireContext());
|
||||
sslContext.init(null, new X509TrustManager[]{memorizingTrustManager}, new SecureRandom());
|
||||
|
||||
ApiKeyAuth auth = new ApiKeyAuth("header", "Authorization");
|
||||
auth.setApiKey(((BaseActivity) requireActivity()).getAccount().getWebAuthorization());
|
||||
OkHttpClient okHttpClient = new OkHttpClient.Builder().addInterceptor(auth).sslSocketFactory(sslContext.getSocketFactory(), memorizingTrustManager)
|
||||
.hostnameVerifier(memorizingTrustManager.wrapHostnameVerifier(HttpsURLConnection.getDefaultHostnameVerifier())).build();
|
||||
|
||||
okHttpClient.newCall(new Request.Builder().url(currentDownloadUrl).build()).enqueue(new Callback() {
|
||||
|
||||
@Override
|
||||
public void onFailure(@NonNull Call call, @NonNull IOException e) {
|
||||
|
||||
builder.setContentTitle(getString(R.string.fileViewerNotificationTitleFailed))
|
||||
.setContentText(getString(R.string.fileViewerNotificationDescriptionFailed, Uri.parse(currentDownloadUrl).getLastPathSegment())).setOngoing(false);
|
||||
notificationManager.notify(notificationId, builder.build());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResponse(@NonNull Call call, @NonNull Response response) throws IOException {
|
||||
|
||||
if(!response.isSuccessful() || response.body() == null) {
|
||||
onFailure(call, new IOException());
|
||||
return;
|
||||
}
|
||||
|
||||
OutputStream outputStream = requireContext().getContentResolver().openOutputStream(result.getData().getData());
|
||||
|
||||
AppUtil.copyProgress(Objects.requireNonNull(response.body()).byteStream(), outputStream, 0, p -> {
|
||||
});
|
||||
builder.setContentTitle(getString(R.string.fileViewerNotificationTitleFinished))
|
||||
.setContentText(getString(R.string.fileViewerNotificationDescriptionFinished, Uri.parse(currentDownloadUrl).getLastPathSegment())).setOngoing(false);
|
||||
notificationManager.notify(notificationId, builder.build());
|
||||
}
|
||||
});
|
||||
}
|
||||
catch(NoSuchAlgorithmException | KeyManagementException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
private ReleasesViewModel releasesViewModel;
|
||||
private ReleasesAdapter adapter;
|
||||
private TagsAdapter tagsAdapter;
|
||||
@ -117,6 +65,8 @@ public class ReleasesFragment extends Fragment {
|
||||
private int page = 1;
|
||||
private int pageReleases = 1;
|
||||
|
||||
public static String currentDownloadUrl = null;
|
||||
|
||||
public ReleasesFragment() {
|
||||
}
|
||||
|
||||
@ -126,15 +76,6 @@ public class ReleasesFragment extends Fragment {
|
||||
return fragment;
|
||||
}
|
||||
|
||||
private static int getReleaseIndex(String tag, List<Release> releases) {
|
||||
for(Release release : releases) {
|
||||
if(release.getTagName().equals(tag)) {
|
||||
return releases.indexOf(release);
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
@ -150,8 +91,6 @@ public class ReleasesFragment extends Fragment {
|
||||
|
||||
fragmentReleasesBinding.recyclerView.setHasFixedSize(true);
|
||||
fragmentReleasesBinding.recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
|
||||
DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(fragmentReleasesBinding.recyclerView.getContext(), DividerItemDecoration.VERTICAL);
|
||||
fragmentReleasesBinding.recyclerView.addItemDecoration(dividerItemDecoration);
|
||||
|
||||
fragmentReleasesBinding.pullToRefresh.setOnRefreshListener(() -> new Handler(Looper.getMainLooper()).postDelayed(() -> {
|
||||
|
||||
@ -260,6 +199,15 @@ public class ReleasesFragment extends Fragment {
|
||||
|
||||
}
|
||||
|
||||
private static int getReleaseIndex(String tag, List<Release> releases) {
|
||||
for(Release release : releases) {
|
||||
if(release.getTagName().equals(tag)) {
|
||||
return releases.indexOf(release);
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreateOptionsMenu(@NonNull Menu menu, @NonNull MenuInflater inflater) {
|
||||
if(!((BaseActivity) requireActivity()).getAccount().requiresVersion("1.15.0")) {
|
||||
@ -279,4 +227,63 @@ public class ReleasesFragment extends Fragment {
|
||||
downloadLauncher.launch(intent);
|
||||
}
|
||||
|
||||
ActivityResultLauncher<Intent> downloadLauncher = registerForActivityResult(new ActivityResultContracts.StartActivityForResult(), result -> {
|
||||
|
||||
if(result.getResultCode() == Activity.RESULT_OK && result.getData() != null) {
|
||||
|
||||
try {
|
||||
|
||||
NotificationCompat.Builder builder = new NotificationCompat.Builder(requireContext(), requireContext().getPackageName()).setContentTitle(getString(R.string.fileViewerNotificationTitleStarted))
|
||||
.setContentText(getString(R.string.fileViewerNotificationDescriptionStarted, Uri.parse(currentDownloadUrl).getLastPathSegment())).setSmallIcon(R.drawable.gitnex_transparent)
|
||||
.setPriority(NotificationCompat.PRIORITY_LOW).setChannelId(Constants.downloadNotificationChannelId).setOngoing(true);
|
||||
|
||||
int notificationId = Notifications.uniqueNotificationId(requireContext());
|
||||
|
||||
NotificationManager notificationManager = (NotificationManager) requireContext().getSystemService(Context.NOTIFICATION_SERVICE);
|
||||
notificationManager.notify(notificationId, builder.build());
|
||||
|
||||
SSLContext sslContext = SSLContext.getInstance("TLS");
|
||||
MemorizingTrustManager memorizingTrustManager = new MemorizingTrustManager(requireContext());
|
||||
sslContext.init(null, new X509TrustManager[]{memorizingTrustManager}, new SecureRandom());
|
||||
|
||||
ApiKeyAuth auth = new ApiKeyAuth("header", "Authorization");
|
||||
auth.setApiKey(((BaseActivity) requireActivity()).getAccount().getWebAuthorization());
|
||||
OkHttpClient okHttpClient = new OkHttpClient.Builder().addInterceptor(auth).sslSocketFactory(sslContext.getSocketFactory(), memorizingTrustManager)
|
||||
.hostnameVerifier(memorizingTrustManager.wrapHostnameVerifier(HttpsURLConnection.getDefaultHostnameVerifier())).build();
|
||||
|
||||
okHttpClient.newCall(new Request.Builder().url(currentDownloadUrl).build()).enqueue(new Callback() {
|
||||
|
||||
@Override
|
||||
public void onFailure(@NonNull Call call, @NonNull IOException e) {
|
||||
|
||||
builder.setContentTitle(getString(R.string.fileViewerNotificationTitleFailed))
|
||||
.setContentText(getString(R.string.fileViewerNotificationDescriptionFailed, Uri.parse(currentDownloadUrl).getLastPathSegment())).setOngoing(false);
|
||||
notificationManager.notify(notificationId, builder.build());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResponse(@NonNull Call call, @NonNull Response response) throws IOException {
|
||||
|
||||
if(!response.isSuccessful() || response.body() == null) {
|
||||
onFailure(call, new IOException());
|
||||
return;
|
||||
}
|
||||
|
||||
OutputStream outputStream = requireContext().getContentResolver().openOutputStream(result.getData().getData());
|
||||
|
||||
AppUtil.copyProgress(Objects.requireNonNull(response.body()).byteStream(), outputStream, 0, p -> {
|
||||
});
|
||||
builder.setContentTitle(getString(R.string.fileViewerNotificationTitleFinished))
|
||||
.setContentText(getString(R.string.fileViewerNotificationDescriptionFinished, Uri.parse(currentDownloadUrl).getLastPathSegment())).setOngoing(false);
|
||||
notificationManager.notify(notificationId, builder.build());
|
||||
}
|
||||
});
|
||||
}
|
||||
catch(NoSuchAlgorithmException | KeyManagementException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
@ -7,18 +7,15 @@ import android.os.Looper;
|
||||
import android.view.*;
|
||||
import android.view.inputmethod.EditorInfo;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
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;
|
||||
import org.mian.gitnex.helpers.Constants;
|
||||
import org.mian.gitnex.helpers.DividerItemDecorator;
|
||||
import org.mian.gitnex.viewmodels.RepositoriesViewModel;
|
||||
|
||||
/**
|
||||
@ -51,10 +48,7 @@ public class RepositoriesFragment extends Fragment {
|
||||
fragmentRepositoriesBinding.recyclerView.setHasFixedSize(true);
|
||||
fragmentRepositoriesBinding.recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
|
||||
|
||||
RecyclerView.ItemDecoration dividerItemDecoration = new DividerItemDecorator(ContextCompat.getDrawable(requireContext(), R.drawable.shape_list_divider));
|
||||
fragmentRepositoriesBinding.recyclerView.addItemDecoration(dividerItemDecoration);
|
||||
|
||||
fragmentRepositoriesBinding.recyclerView.setPadding(0, 0, 0, 240);
|
||||
fragmentRepositoriesBinding.recyclerView.setPadding(0, 0, 0, 220);
|
||||
fragmentRepositoriesBinding.recyclerView.setClipToPadding(false);
|
||||
|
||||
fragmentRepositoriesBinding.pullToRefresh.setOnRefreshListener(() -> new Handler(Looper.getMainLooper()).postDelayed(() -> {
|
||||
|
@ -7,18 +7,15 @@ import android.os.Looper;
|
||||
import android.view.*;
|
||||
import android.view.inputmethod.EditorInfo;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
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;
|
||||
import org.mian.gitnex.helpers.Constants;
|
||||
import org.mian.gitnex.helpers.DividerItemDecorator;
|
||||
import org.mian.gitnex.viewmodels.RepositoriesViewModel;
|
||||
|
||||
/**
|
||||
@ -51,10 +48,7 @@ public class StarredRepositoriesFragment extends Fragment {
|
||||
fragmentRepositoriesBinding.recyclerView.setHasFixedSize(true);
|
||||
fragmentRepositoriesBinding.recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
|
||||
|
||||
RecyclerView.ItemDecoration dividerItemDecoration = new DividerItemDecorator(ContextCompat.getDrawable(requireContext(), R.drawable.shape_list_divider));
|
||||
fragmentRepositoriesBinding.recyclerView.addItemDecoration(dividerItemDecoration);
|
||||
|
||||
fragmentRepositoriesBinding.recyclerView.setPadding(0, 0, 0, 240);
|
||||
fragmentRepositoriesBinding.recyclerView.setPadding(0, 0, 0, 220);
|
||||
fragmentRepositoriesBinding.recyclerView.setClipToPadding(false);
|
||||
|
||||
fragmentRepositoriesBinding.pullToRefresh.setOnRefreshListener(() -> new Handler(Looper.getMainLooper()).postDelayed(() -> {
|
||||
|
@ -7,16 +7,12 @@ import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import org.mian.gitnex.R;
|
||||
import org.mian.gitnex.adapters.WikiListAdapter;
|
||||
import org.mian.gitnex.databinding.FragmentWikiBinding;
|
||||
import org.mian.gitnex.helpers.Constants;
|
||||
import org.mian.gitnex.helpers.DividerItemDecorator;
|
||||
import org.mian.gitnex.helpers.contexts.RepositoryContext;
|
||||
import org.mian.gitnex.viewmodels.WikiViewModel;
|
||||
|
||||
@ -60,9 +56,6 @@ public class WikiFragment extends Fragment {
|
||||
fragmentWikiBinding.recyclerView.setHasFixedSize(true);
|
||||
fragmentWikiBinding.recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
|
||||
|
||||
RecyclerView.ItemDecoration dividerItemDecoration = new DividerItemDecorator(ContextCompat.getDrawable(requireContext(), R.drawable.shape_list_divider));
|
||||
fragmentWikiBinding.recyclerView.addItemDecoration(dividerItemDecoration);
|
||||
|
||||
fragmentWikiBinding.pullToRefresh.setOnRefreshListener(() -> new Handler(Looper.getMainLooper()).postDelayed(() -> {
|
||||
|
||||
page = 1;
|
||||
|
@ -9,7 +9,6 @@ import android.view.inputmethod.EditorInfo;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.recyclerview.widget.DividerItemDecoration;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import org.gitnex.tea4j.v2.models.User;
|
||||
import org.mian.gitnex.R;
|
||||
@ -85,9 +84,7 @@ public class FollowersFragment extends Fragment {
|
||||
}
|
||||
}));
|
||||
|
||||
DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(context, DividerItemDecoration.VERTICAL);
|
||||
fragmentProfileFollowersFollowingBinding.recyclerView.setHasFixedSize(true);
|
||||
fragmentProfileFollowersFollowingBinding.recyclerView.addItemDecoration(dividerItemDecoration);
|
||||
fragmentProfileFollowersFollowingBinding.recyclerView.setLayoutManager(new LinearLayoutManager(context));
|
||||
fragmentProfileFollowersFollowingBinding.recyclerView.setAdapter(adapter);
|
||||
|
||||
|
@ -9,7 +9,6 @@ import android.view.inputmethod.EditorInfo;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.recyclerview.widget.DividerItemDecoration;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import org.gitnex.tea4j.v2.models.User;
|
||||
import org.mian.gitnex.R;
|
||||
@ -85,9 +84,7 @@ public class FollowingFragment extends Fragment {
|
||||
}
|
||||
}));
|
||||
|
||||
DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(context, DividerItemDecoration.VERTICAL);
|
||||
fragmentProfileFollowersFollowingBinding.recyclerView.setHasFixedSize(true);
|
||||
fragmentProfileFollowersFollowingBinding.recyclerView.addItemDecoration(dividerItemDecoration);
|
||||
fragmentProfileFollowersFollowingBinding.recyclerView.setLayoutManager(new LinearLayoutManager(context));
|
||||
fragmentProfileFollowersFollowingBinding.recyclerView.setAdapter(adapter);
|
||||
|
||||
|
@ -9,7 +9,6 @@ import android.view.inputmethod.EditorInfo;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.recyclerview.widget.DividerItemDecoration;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import org.gitnex.tea4j.v2.models.Organization;
|
||||
import org.mian.gitnex.R;
|
||||
@ -93,9 +92,7 @@ public class OrganizationsFragment extends Fragment {
|
||||
}
|
||||
});
|
||||
|
||||
DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(context, DividerItemDecoration.VERTICAL);
|
||||
fragmentOrganizationsBinding.recyclerView.setHasFixedSize(true);
|
||||
fragmentOrganizationsBinding.recyclerView.addItemDecoration(dividerItemDecoration);
|
||||
fragmentOrganizationsBinding.recyclerView.setLayoutManager(new LinearLayoutManager(context));
|
||||
fragmentOrganizationsBinding.recyclerView.setAdapter(adapter);
|
||||
|
||||
|
@ -9,7 +9,6 @@ import android.view.inputmethod.EditorInfo;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.recyclerview.widget.DividerItemDecoration;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import org.gitnex.tea4j.v2.models.Repository;
|
||||
import org.mian.gitnex.R;
|
||||
@ -99,9 +98,7 @@ public class RepositoriesFragment extends Fragment {
|
||||
}
|
||||
});
|
||||
|
||||
DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(context, DividerItemDecoration.VERTICAL);
|
||||
fragmentRepositoriesBinding.recyclerView.setHasFixedSize(true);
|
||||
fragmentRepositoriesBinding.recyclerView.addItemDecoration(dividerItemDecoration);
|
||||
fragmentRepositoriesBinding.recyclerView.setLayoutManager(new LinearLayoutManager(context));
|
||||
fragmentRepositoriesBinding.recyclerView.setAdapter(adapter);
|
||||
|
||||
|
@ -9,7 +9,6 @@ import android.view.inputmethod.EditorInfo;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.recyclerview.widget.DividerItemDecoration;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import org.gitnex.tea4j.v2.models.Repository;
|
||||
import org.mian.gitnex.R;
|
||||
@ -98,9 +97,7 @@ public class StarredRepositoriesFragment extends Fragment {
|
||||
}
|
||||
});
|
||||
|
||||
DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(context, DividerItemDecoration.VERTICAL);
|
||||
fragmentRepositoriesBinding.recyclerView.setHasFixedSize(true);
|
||||
fragmentRepositoriesBinding.recyclerView.addItemDecoration(dividerItemDecoration);
|
||||
fragmentRepositoriesBinding.recyclerView.setLayoutManager(new LinearLayoutManager(context));
|
||||
fragmentRepositoriesBinding.recyclerView.setAdapter(adapter);
|
||||
|
||||
|
@ -1,41 +0,0 @@
|
||||
package org.mian.gitnex.helpers;
|
||||
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.view.View;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
/**
|
||||
* @author M M Arif
|
||||
*/
|
||||
|
||||
public class DividerItemDecorator extends RecyclerView.ItemDecoration {
|
||||
|
||||
private final Drawable rvDivider;
|
||||
|
||||
public DividerItemDecorator(Drawable divider) {
|
||||
rvDivider = divider;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDrawOver(@NonNull Canvas canvas, RecyclerView parent, @NonNull RecyclerView.State state) {
|
||||
|
||||
int dividerLeft = parent.getPaddingLeft();
|
||||
int dividerRight = parent.getWidth() - parent.getPaddingRight();
|
||||
|
||||
int childCount = parent.getChildCount();
|
||||
for(int i = 0; i <= childCount - 2; i++) {
|
||||
View child = parent.getChildAt(i);
|
||||
|
||||
RecyclerView.LayoutParams params = (RecyclerView.LayoutParams) child.getLayoutParams();
|
||||
|
||||
int dividerTop = child.getBottom() + params.bottomMargin;
|
||||
int dividerBottom = dividerTop + rvDivider.getIntrinsicHeight();
|
||||
|
||||
rvDivider.setBounds(dividerLeft, dividerTop, dividerRight, dividerBottom);
|
||||
rvDivider.draw(canvas);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -4,12 +4,10 @@ import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
import androidx.annotation.NonNull;
|
||||
import com.amrdeveloper.codeview.Code;
|
||||
import com.amrdeveloper.codeview.CodeViewAdapter;
|
||||
import com.amrdeveloper.codeview.Snippet;
|
||||
import org.mian.gitnex.R;
|
||||
import java.util.List;
|
||||
|
||||
@ -33,17 +31,16 @@ public class CustomCodeViewAdapter extends CodeViewAdapter {
|
||||
convertView = layoutInflater.inflate(R.layout.list_items_autocomplete, parent, false);
|
||||
}
|
||||
|
||||
ImageView codeType = convertView.findViewById(R.id.code_type);
|
||||
//ImageView codeType = convertView.findViewById(R.id.code_type);
|
||||
TextView codeTitle = convertView.findViewById(R.id.code_title);
|
||||
Code currentCode = (Code) getItem(position);
|
||||
if(currentCode != null) {
|
||||
codeTitle.setText(currentCode.getCodeTitle());
|
||||
if(currentCode instanceof Snippet) {
|
||||
codeType.setImageResource(R.drawable.ic_snippet);
|
||||
}
|
||||
else {
|
||||
codeType.setImageResource(R.drawable.ic_keyword);
|
||||
}
|
||||
/*if (currentCode instanceof Snippet) {
|
||||
//codeType.setImageResource(R.drawable.ic_snippet);
|
||||
} else {
|
||||
//codeType.setImageResource(R.drawable.ic_keyword);
|
||||
}*/
|
||||
}
|
||||
|
||||
return convertView;
|
||||
|
@ -4,9 +4,11 @@ import android.content.Context;
|
||||
import com.amrdeveloper.codeview.Code;
|
||||
import com.amrdeveloper.codeview.CodeView;
|
||||
import org.mian.gitnex.helpers.codeeditor.languages.GoLanguage;
|
||||
import org.mian.gitnex.helpers.codeeditor.languages.HtmlLanguage;
|
||||
import org.mian.gitnex.helpers.codeeditor.languages.JavaLanguage;
|
||||
import org.mian.gitnex.helpers.codeeditor.languages.PhpLanguage;
|
||||
import org.mian.gitnex.helpers.codeeditor.languages.PythonLanguage;
|
||||
import org.mian.gitnex.helpers.codeeditor.languages.XmlLanguage;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
@ -44,6 +46,10 @@ public class LanguageManager {
|
||||
return GoLanguage.getKeywords(context);
|
||||
case PHP:
|
||||
return PhpLanguage.getKeywords(context);
|
||||
case XML:
|
||||
return XmlLanguage.getKeywords(context);
|
||||
case HTML:
|
||||
return HtmlLanguage.getKeywords(context);
|
||||
default:
|
||||
return new String[]{};
|
||||
}
|
||||
@ -59,6 +65,10 @@ public class LanguageManager {
|
||||
return GoLanguage.getCodeList(context);
|
||||
case PHP:
|
||||
return PhpLanguage.getCodeList(context);
|
||||
case XML:
|
||||
return XmlLanguage.getCodeList(context);
|
||||
case HTML:
|
||||
return HtmlLanguage.getCodeList(context);
|
||||
default:
|
||||
return new ArrayList<>();
|
||||
}
|
||||
@ -74,6 +84,10 @@ public class LanguageManager {
|
||||
return GoLanguage.getIndentationStarts();
|
||||
case PHP:
|
||||
return PhpLanguage.getIndentationStarts();
|
||||
case XML:
|
||||
return XmlLanguage.getIndentationStarts();
|
||||
case HTML:
|
||||
return HtmlLanguage.getIndentationStarts();
|
||||
default:
|
||||
return new HashSet<>();
|
||||
}
|
||||
@ -89,6 +103,10 @@ public class LanguageManager {
|
||||
return GoLanguage.getIndentationEnds();
|
||||
case PHP:
|
||||
return PhpLanguage.getIndentationEnds();
|
||||
case XML:
|
||||
return XmlLanguage.getIndentationEnds();
|
||||
case HTML:
|
||||
return HtmlLanguage.getIndentationEnds();
|
||||
default:
|
||||
return new HashSet<>();
|
||||
}
|
||||
@ -108,6 +126,12 @@ public class LanguageManager {
|
||||
case PHP:
|
||||
PhpLanguage.applyFiveColorsDarkTheme(context, codeView);
|
||||
break;
|
||||
case XML:
|
||||
XmlLanguage.applyFiveColorsDarkTheme(context, codeView);
|
||||
break;
|
||||
case HTML:
|
||||
HtmlLanguage.applyFiveColorsDarkTheme(context, codeView);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -10,5 +10,7 @@ public enum LanguageName {
|
||||
JAVA, // java
|
||||
PY, // python with py extension
|
||||
GO, // go lang
|
||||
PHP // php
|
||||
PHP, // php
|
||||
XML, // xml
|
||||
HTML // html
|
||||
}
|
||||
|
@ -12,9 +12,17 @@ import android.widget.EditText;
|
||||
|
||||
public class SourcePositionListener {
|
||||
|
||||
private final EditText editText;
|
||||
@FunctionalInterface
|
||||
public interface OnPositionChanged {
|
||||
|
||||
void onPositionChange(int line, int column);
|
||||
|
||||
}
|
||||
|
||||
private OnPositionChanged onPositionChanged;
|
||||
private final View.AccessibilityDelegate viewAccessibility = new View.AccessibilityDelegate() {
|
||||
|
||||
public SourcePositionListener(EditText editText) {
|
||||
View.AccessibilityDelegate viewAccessibility = new View.AccessibilityDelegate() {
|
||||
|
||||
@Override
|
||||
public void sendAccessibilityEvent(View host, int eventType) {
|
||||
@ -31,9 +39,6 @@ public class SourcePositionListener {
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
public SourcePositionListener(EditText editText) {
|
||||
this.editText = editText;
|
||||
editText.setAccessibilityDelegate(viewAccessibility);
|
||||
}
|
||||
|
||||
@ -41,11 +46,4 @@ public class SourcePositionListener {
|
||||
onPositionChanged = listener;
|
||||
}
|
||||
|
||||
@FunctionalInterface
|
||||
public interface OnPositionChanged {
|
||||
|
||||
void onPositionChange(int line, int column);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,98 @@
|
||||
package org.mian.gitnex.helpers.codeeditor.languages;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.Resources;
|
||||
import com.amrdeveloper.codeview.Code;
|
||||
import com.amrdeveloper.codeview.CodeView;
|
||||
import com.amrdeveloper.codeview.Keyword;
|
||||
import org.mian.gitnex.R;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/**
|
||||
* @author M M Arif
|
||||
*/
|
||||
|
||||
public class HtmlLanguage {
|
||||
|
||||
//Language Keywords
|
||||
private static final Pattern PATTERN_KEYWORDS = Pattern.compile(
|
||||
"\\b(<html|<DOCTYPE|<head|<title|<body|<style|<script|src|href" + "<h1|<h2|<h3|<h4|<h5|<h6|<br|<hr|<section|<header|<footer|<select|<img|<embed|<iframe|<div|<p|code|strong|small|template|" + "input|form|textarea|button|option|label|fieldset|legend|datalist|frame|map|area|canvas|picture|svg|audio|source|track|video|" + "link|nav|ul|ol|li|table|caption|th|tr|td|thead|tbody|tfooter|col|span|main|article|aside|meta|base|noscript|object|param|)\\b");
|
||||
|
||||
//Brackets and Colons
|
||||
private static final Pattern PATTERN_BUILTINS = Pattern.compile("[,:;[->]{}()]");
|
||||
|
||||
//Data
|
||||
private static final Pattern PATTERN_NUMBERS = Pattern.compile("\\b(\\d*[.]?\\d+)\\b");
|
||||
private static final Pattern PATTERN_CHAR = Pattern.compile("['](.*?)[']");
|
||||
private static final Pattern PATTERN_STRING = Pattern.compile("[\"](.*?)[\"]");
|
||||
private static final Pattern PATTERN_HEX = Pattern.compile("0x[0-9a-fA-F]+");
|
||||
private static final Pattern PATTERN_SINGLE_LINE_COMMENT = Pattern.compile("//[^\\n]*");
|
||||
private static final Pattern PATTERN_MULTI_LINE_COMMENT = Pattern.compile("/\\*[^*]*\\*+(?:[^/*][^*]*\\*+)*/");
|
||||
private static final Pattern PATTERN_ATTRIBUTE = Pattern.compile("\\.[a-zA-Z0-9_]+");
|
||||
private static final Pattern PATTERN_OPERATION = Pattern.compile(":|==|>|<|!=|>=|<=|->|=|>|<|%|-|-=|%=|\\+|\\-|\\-=|\\+=|\\^|\\&|\\|::|\\?|\\*");
|
||||
|
||||
public static void applyFiveColorsDarkTheme(Context context, CodeView codeView) {
|
||||
codeView.resetSyntaxPatternList();
|
||||
codeView.resetHighlighter();
|
||||
|
||||
Resources resources = context.getResources();
|
||||
|
||||
//View Background
|
||||
codeView.setBackgroundColor(resources.getColor(R.color.five_dark_black, null));
|
||||
|
||||
//Syntax Colors
|
||||
codeView.addSyntaxPattern(PATTERN_HEX, resources.getColor(R.color.five_dark_purple, null));
|
||||
codeView.addSyntaxPattern(PATTERN_CHAR, resources.getColor(R.color.five_dark_yellow, null));
|
||||
codeView.addSyntaxPattern(PATTERN_STRING, resources.getColor(R.color.five_dark_yellow, null));
|
||||
codeView.addSyntaxPattern(PATTERN_NUMBERS, resources.getColor(R.color.five_dark_purple, null));
|
||||
codeView.addSyntaxPattern(PATTERN_KEYWORDS, resources.getColor(R.color.five_dark_purple, null));
|
||||
codeView.addSyntaxPattern(PATTERN_BUILTINS, resources.getColor(R.color.five_dark_white, null));
|
||||
codeView.addSyntaxPattern(PATTERN_SINGLE_LINE_COMMENT, resources.getColor(R.color.five_dark_grey, null));
|
||||
codeView.addSyntaxPattern(PATTERN_MULTI_LINE_COMMENT, resources.getColor(R.color.five_dark_grey, null));
|
||||
codeView.addSyntaxPattern(PATTERN_ATTRIBUTE, resources.getColor(R.color.five_dark_blue, null));
|
||||
codeView.addSyntaxPattern(PATTERN_OPERATION, resources.getColor(R.color.five_dark_purple, null));
|
||||
|
||||
//Default Color
|
||||
codeView.setTextColor(resources.getColor(R.color.five_dark_white, null));
|
||||
|
||||
codeView.reHighlightSyntax();
|
||||
}
|
||||
|
||||
public static String[] getKeywords(Context context) {
|
||||
return context.getResources().getStringArray(R.array.html_keywords);
|
||||
}
|
||||
|
||||
public static List<Code> getCodeList(Context context) {
|
||||
List<Code> codeList = new ArrayList<>();
|
||||
String[] keywords = getKeywords(context);
|
||||
for(String keyword : keywords) {
|
||||
codeList.add(new Keyword(keyword));
|
||||
}
|
||||
return codeList;
|
||||
}
|
||||
|
||||
public static Set<Character> getIndentationStarts() {
|
||||
Set<Character> characterSet = new HashSet<>();
|
||||
characterSet.add('{');
|
||||
return characterSet;
|
||||
}
|
||||
|
||||
public static Set<Character> getIndentationEnds() {
|
||||
Set<Character> characterSet = new HashSet<>();
|
||||
characterSet.add('}');
|
||||
return characterSet;
|
||||
}
|
||||
|
||||
public static String getCommentStart() {
|
||||
return "//";
|
||||
}
|
||||
|
||||
public static String getCommentEnd() {
|
||||
return "";
|
||||
}
|
||||
|
||||
}
|
@ -20,7 +20,7 @@ public class PhpLanguage {
|
||||
|
||||
//Language Keywords
|
||||
private static final Pattern PATTERN_KEYWORDS = Pattern.compile(
|
||||
"\\b(php|__construct|var_dump|define|echo|var|float|" + "int|bool|false|true|function|private|public|protected|interface|return|copy|struct|abstract|extends|" + "trait|static|namespace|implements|__set|__get|unlink|this|try|catch|Throwable|Exception|pdo|" + "str_replace|form|date|abs|min|max|strtotime|mktime|" + "foreach|require_once|include_once|hash|array|range|break|continue|preg_match|preg_match_all|preg_replace|" + "throw|new|and|or|if|else|elseif|switch|case|default|match|require|include|goto|do|while|for|map|)\\b");
|
||||
"\\b(<?php|__construct|var_dump|define|echo|var|float|" + "int|bool|false|true|function|private|public|protected|interface|return|copy|struct|abstract|extends|" + "trait|static|namespace|implements|__set|__get|unlink|this|try|catch|Throwable|Exception|pdo|" + "str_replace|form|date|abs|min|max|strtotime|mktime|" + "foreach|require_once|include_once|hash|array|range|break|continue|preg_match|preg_match_all|preg_replace|" + "throw|new|and|or|if|else|elseif|switch|case|default|match|require|include|goto|do|while|for|map|)\\b");
|
||||
|
||||
//Brackets and Colons
|
||||
private static final Pattern PATTERN_BUILTINS = Pattern.compile("[,:;[->]{}()]");
|
||||
|
@ -0,0 +1,97 @@
|
||||
package org.mian.gitnex.helpers.codeeditor.languages;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.Resources;
|
||||
import com.amrdeveloper.codeview.Code;
|
||||
import com.amrdeveloper.codeview.CodeView;
|
||||
import com.amrdeveloper.codeview.Keyword;
|
||||
import org.mian.gitnex.R;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/**
|
||||
* @author M M Arif
|
||||
*/
|
||||
|
||||
public class XmlLanguage {
|
||||
|
||||
//Language Keywords
|
||||
private static final Pattern PATTERN_KEYWORDS = Pattern.compile("\\b(<xml|version|encoding)\\b");
|
||||
|
||||
//Brackets and Colons
|
||||
private static final Pattern PATTERN_BUILTINS = Pattern.compile("[,:;[->]{}()]");
|
||||
|
||||
//Data
|
||||
private static final Pattern PATTERN_NUMBERS = Pattern.compile("\\b(\\d*[.]?\\d+)\\b");
|
||||
private static final Pattern PATTERN_CHAR = Pattern.compile("['](.*?)[']");
|
||||
private static final Pattern PATTERN_STRING = Pattern.compile("[\"](.*?)[\"]");
|
||||
private static final Pattern PATTERN_HEX = Pattern.compile("0x[0-9a-fA-F]+");
|
||||
private static final Pattern PATTERN_SINGLE_LINE_COMMENT = Pattern.compile("//[^\\n]*");
|
||||
private static final Pattern PATTERN_MULTI_LINE_COMMENT = Pattern.compile("/\\*[^*]*\\*+(?:[^/*][^*]*\\*+)*/");
|
||||
private static final Pattern PATTERN_ATTRIBUTE = Pattern.compile("\\.[a-zA-Z0-9_]+");
|
||||
private static final Pattern PATTERN_OPERATION = Pattern.compile(":|==|>|<|!=|>=|<=|->|=|>|<|%|-|-=|%=|\\+|\\-|\\-=|\\+=|\\^|\\&|\\|::|\\?|\\*");
|
||||
|
||||
public static void applyFiveColorsDarkTheme(Context context, CodeView codeView) {
|
||||
codeView.resetSyntaxPatternList();
|
||||
codeView.resetHighlighter();
|
||||
|
||||
Resources resources = context.getResources();
|
||||
|
||||
//View Background
|
||||
codeView.setBackgroundColor(resources.getColor(R.color.five_dark_black, null));
|
||||
|
||||
//Syntax Colors
|
||||
codeView.addSyntaxPattern(PATTERN_HEX, resources.getColor(R.color.five_dark_purple, null));
|
||||
codeView.addSyntaxPattern(PATTERN_CHAR, resources.getColor(R.color.five_dark_yellow, null));
|
||||
codeView.addSyntaxPattern(PATTERN_STRING, resources.getColor(R.color.five_dark_yellow, null));
|
||||
codeView.addSyntaxPattern(PATTERN_NUMBERS, resources.getColor(R.color.five_dark_purple, null));
|
||||
codeView.addSyntaxPattern(PATTERN_KEYWORDS, resources.getColor(R.color.five_dark_purple, null));
|
||||
codeView.addSyntaxPattern(PATTERN_BUILTINS, resources.getColor(R.color.five_dark_white, null));
|
||||
codeView.addSyntaxPattern(PATTERN_SINGLE_LINE_COMMENT, resources.getColor(R.color.five_dark_grey, null));
|
||||
codeView.addSyntaxPattern(PATTERN_MULTI_LINE_COMMENT, resources.getColor(R.color.five_dark_grey, null));
|
||||
codeView.addSyntaxPattern(PATTERN_ATTRIBUTE, resources.getColor(R.color.five_dark_blue, null));
|
||||
codeView.addSyntaxPattern(PATTERN_OPERATION, resources.getColor(R.color.five_dark_purple, null));
|
||||
|
||||
//Default Color
|
||||
codeView.setTextColor(resources.getColor(R.color.five_dark_white, null));
|
||||
|
||||
codeView.reHighlightSyntax();
|
||||
}
|
||||
|
||||
public static String[] getKeywords(Context context) {
|
||||
return context.getResources().getStringArray(R.array.xml_keywords);
|
||||
}
|
||||
|
||||
public static List<Code> getCodeList(Context context) {
|
||||
List<Code> codeList = new ArrayList<>();
|
||||
String[] keywords = getKeywords(context);
|
||||
for(String keyword : keywords) {
|
||||
codeList.add(new Keyword(keyword));
|
||||
}
|
||||
return codeList;
|
||||
}
|
||||
|
||||
public static Set<Character> getIndentationStarts() {
|
||||
Set<Character> characterSet = new HashSet<>();
|
||||
characterSet.add('{');
|
||||
return characterSet;
|
||||
}
|
||||
|
||||
public static Set<Character> getIndentationEnds() {
|
||||
Set<Character> characterSet = new HashSet<>();
|
||||
characterSet.add('}');
|
||||
return characterSet;
|
||||
}
|
||||
|
||||
public static String getCommentStart() {
|
||||
return "//";
|
||||
}
|
||||
|
||||
public static String getCommentEnd() {
|
||||
return "";
|
||||
}
|
||||
|
||||
}
|
@ -21,13 +21,23 @@ import java.security.KeyStore;
|
||||
import java.security.KeyStoreException;
|
||||
import java.security.MessageDigest;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.security.cert.*;
|
||||
import java.security.cert.CertPathValidatorException;
|
||||
import java.security.cert.Certificate;
|
||||
import java.security.cert.CertificateEncodingException;
|
||||
import java.security.cert.CertificateException;
|
||||
import java.security.cert.CertificateExpiredException;
|
||||
import java.security.cert.CertificateParsingException;
|
||||
import java.security.cert.X509Certificate;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Collection;
|
||||
import java.util.Enumeration;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import javax.net.ssl.*;
|
||||
import javax.net.ssl.HostnameVerifier;
|
||||
import javax.net.ssl.SSLSession;
|
||||
import javax.net.ssl.TrustManager;
|
||||
import javax.net.ssl.TrustManagerFactory;
|
||||
import javax.net.ssl.X509TrustManager;
|
||||
|
||||
/**
|
||||
* @author Georg Lukas, modified by opyale
|
||||
|
@ -1,12 +0,0 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="25dp"
|
||||
android:height="25dp"
|
||||
android:viewportWidth="25"
|
||||
android:viewportHeight="25">
|
||||
<path
|
||||
android:fillColor="#89D0E9"
|
||||
android:pathData="M12.5,12.5m-12.5,0a12.5,12.5 0,1 1,25 0a12.5,12.5 0,1 1,-25 0"/>
|
||||
<path
|
||||
android:fillColor="#486069"
|
||||
android:pathData="M11.972,13.052L10.256,14.792V17H9.368V8.6H10.256V13.676L15.188,8.6H16.208L12.572,12.404L16.46,17H15.404L11.972,13.052Z"/>
|
||||
</vector>
|
13
app/src/main/res/drawable/ic_reset.xml
Normal file
13
app/src/main/res/drawable/ic_reset.xml
Normal file
@ -0,0 +1,13 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:pathData="M4,4v5h0.582m15.356,2A8.001,8.001 0,0 0,4.582 9m0,0H9m11,11v-5h-0.581m0,0a8.003,8.003 0,0 1,-15.357 -2m15.357,2H15"
|
||||
android:strokeLineJoin="round"
|
||||
android:strokeWidth="2"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="?attr/iconsColor"
|
||||
android:strokeLineCap="round"/>
|
||||
</vector>
|
@ -2,7 +2,7 @@
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<corners android:radius="3dp"/>
|
||||
<corners android:radius="@dimen/dimen8dp"/>
|
||||
<solid android:color="@color/releasePre"/>
|
||||
|
||||
</shape>
|
||||
|
@ -1,5 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<size android:width="1dp" android:height="1dp"/>
|
||||
<solid android:color="?attr/dividerColor"/>
|
||||
</shape>
|
@ -1,17 +1,17 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
<LinearLayout android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/primaryBackgroundColor"
|
||||
android:orientation="vertical">
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:orientation="vertical"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:background="?attr/primaryBackgroundColor">
|
||||
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:id="@+id/appbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:theme="@style/Widget.AppCompat.SearchView"
|
||||
app:elevation="@dimen/dimen0dp">
|
||||
app:elevation="@dimen/dimen0dp"
|
||||
android:theme="@style/Widget.AppCompat.SearchView">
|
||||
|
||||
<com.google.android.material.appbar.MaterialToolbar
|
||||
android:id="@+id/toolbar"
|
||||
@ -23,13 +23,13 @@
|
||||
android:id="@+id/close"
|
||||
android:layout_width="@dimen/dimen26dp"
|
||||
android:layout_height="@dimen/dimen26dp"
|
||||
android:layout_marginStart="@dimen/dimen16dp"
|
||||
android:layout_marginEnd="@dimen/dimen16dp"
|
||||
android:background="?android:attr/selectableItemBackgroundBorderless"
|
||||
android:clickable="true"
|
||||
android:contentDescription="@string/close"
|
||||
android:focusable="true"
|
||||
android:layout_marginStart="@dimen/dimen16dp"
|
||||
android:gravity="center_vertical"
|
||||
android:contentDescription="@string/close"
|
||||
android:background="?android:attr/selectableItemBackgroundBorderless"
|
||||
android:focusable="true"
|
||||
android:clickable="true"
|
||||
android:src="@drawable/ic_close"/>
|
||||
|
||||
<TextView
|
||||
@ -37,9 +37,9 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:maxLines="1"
|
||||
android:text="@string/collaborator"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:maxLines="1"
|
||||
android:textSize="@dimen/dimen20sp"/>
|
||||
|
||||
</com.google.android.material.appbar.MaterialToolbar>
|
||||
@ -48,10 +48,10 @@
|
||||
|
||||
<com.google.android.material.progressindicator.LinearProgressIndicator
|
||||
android:id="@+id/progressBar"
|
||||
style="@style/Widget.MaterialComponents.LinearProgressIndicator"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:indeterminate="true"
|
||||
style="@style/Widget.MaterialComponents.LinearProgressIndicator"
|
||||
android:visibility="gone"
|
||||
app:indicatorColor="?attr/progressIndicatorColor"/>
|
||||
|
||||
@ -59,36 +59,36 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dimen10dp"
|
||||
android:layout_marginTop="@dimen/dimen10dp"
|
||||
android:layout_marginEnd="@dimen/dimen10dp"
|
||||
android:layout_marginTop="@dimen/dimen10dp"
|
||||
android:layout_marginBottom="@dimen/dimen10dp">
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/addCollaboratorSearchLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:boxBackgroundColor="?attr/inputBackgroundColor"
|
||||
android:textColorHint="?attr/hintColor"
|
||||
app:hintTextColor="?attr/hintColor"
|
||||
app:boxStrokeErrorColor="@color/darkRed"
|
||||
android:layout_marginTop="@dimen/dimen8dp"
|
||||
android:layout_marginBottom="@dimen/dimen8dp"
|
||||
android:hint="@string/addCollaboratorSearchHint"
|
||||
android:textColorHint="?attr/hintColor"
|
||||
app:boxBackgroundColor="?attr/inputBackgroundColor"
|
||||
app:boxStrokeErrorColor="@color/darkRed"
|
||||
app:startIconDrawable="@drawable/ic_search"
|
||||
app:startIconTint="?attr/iconsColor"
|
||||
app:endIconMode="clear_text"
|
||||
app:endIconTint="?attr/iconsColor"
|
||||
app:hintTextColor="?attr/hintColor"
|
||||
app:startIconDrawable="@drawable/ic_search"
|
||||
app:startIconTint="?attr/iconsColor">
|
||||
android:hint="@string/addCollaboratorSearchHint">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/addCollaboratorSearch"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:imeOptions="actionSend"
|
||||
android:inputType="text"
|
||||
android:singleLine="true"
|
||||
android:textColor="?attr/inputTextColor"
|
||||
android:textColorHighlight="?attr/hintColor"
|
||||
android:textColorHint="?attr/hintColor"
|
||||
android:singleLine="true"
|
||||
android:imeOptions="actionSend"
|
||||
android:inputType="text"
|
||||
android:textSize="@dimen/dimen16sp"/>
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
@ -106,15 +106,17 @@
|
||||
android:textSize="@dimen/dimen20sp"
|
||||
android:visibility="gone"/>
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/primaryBackgroundColor"
|
||||
android:padding="@dimen/dimen8dp">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recyclerViewUserSearch"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="@dimen/dimen0dp"
|
||||
android:layout_marginTop="@dimen/dimen6dp"
|
||||
android:layout_marginEnd="@dimen/dimen0dp"
|
||||
android:layout_marginBottom="@dimen/dimen0dp"
|
||||
android:background="?attr/primaryBackgroundColor"
|
||||
android:scrollbars="vertical"/>
|
||||
android:layout_height="match_parent"/>
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
@ -1,17 +1,17 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
<LinearLayout android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/primaryBackgroundColor"
|
||||
android:orientation="vertical">
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:orientation="vertical"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:background="?attr/primaryBackgroundColor">
|
||||
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:id="@+id/appbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:theme="@style/Widget.AppCompat.SearchView"
|
||||
app:elevation="@dimen/dimen0dp">
|
||||
app:elevation="@dimen/dimen0dp"
|
||||
android:theme="@style/Widget.AppCompat.SearchView">
|
||||
|
||||
<com.google.android.material.appbar.MaterialToolbar
|
||||
android:id="@+id/toolbar"
|
||||
@ -23,13 +23,13 @@
|
||||
android:id="@+id/close"
|
||||
android:layout_width="@dimen/dimen26dp"
|
||||
android:layout_height="@dimen/dimen26dp"
|
||||
android:layout_marginStart="@dimen/dimen16dp"
|
||||
android:layout_marginEnd="@dimen/dimen16dp"
|
||||
android:background="?android:attr/selectableItemBackgroundBorderless"
|
||||
android:clickable="true"
|
||||
android:contentDescription="@string/close"
|
||||
android:focusable="true"
|
||||
android:layout_marginStart="@dimen/dimen16dp"
|
||||
android:gravity="center_vertical"
|
||||
android:contentDescription="@string/close"
|
||||
android:background="?android:attr/selectableItemBackgroundBorderless"
|
||||
android:focusable="true"
|
||||
android:clickable="true"
|
||||
android:src="@drawable/ic_close"/>
|
||||
|
||||
<TextView
|
||||
@ -37,9 +37,9 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:maxLines="1"
|
||||
android:text="@string/addRemove"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:maxLines="1"
|
||||
android:textSize="@dimen/dimen20sp"/>
|
||||
|
||||
</com.google.android.material.appbar.MaterialToolbar>
|
||||
@ -48,46 +48,46 @@
|
||||
|
||||
<com.google.android.material.progressindicator.LinearProgressIndicator
|
||||
android:id="@+id/progress_bar"
|
||||
style="@style/Widget.MaterialComponents.LinearProgressIndicator"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:indeterminate="true"
|
||||
android:visibility="gone"
|
||||
android:indeterminate="true"
|
||||
style="@style/Widget.MaterialComponents.LinearProgressIndicator"
|
||||
app:indicatorColor="?attr/progressIndicatorColor"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dimen10dp"
|
||||
android:layout_marginTop="@dimen/dimen10dp"
|
||||
android:layout_marginEnd="@dimen/dimen10dp"
|
||||
android:layout_marginTop="@dimen/dimen10dp"
|
||||
android:layout_marginBottom="@dimen/dimen10dp">
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/addNewTeamMemberLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:boxBackgroundColor="?attr/inputBackgroundColor"
|
||||
android:textColorHint="?attr/hintColor"
|
||||
app:hintTextColor="?attr/hintColor"
|
||||
app:boxStrokeErrorColor="@color/darkRed"
|
||||
android:layout_marginTop="@dimen/dimen8dp"
|
||||
android:layout_marginBottom="@dimen/dimen8dp"
|
||||
android:hint="@string/addCollaboratorSearchHint"
|
||||
android:textColorHint="?attr/hintColor"
|
||||
app:boxBackgroundColor="?attr/inputBackgroundColor"
|
||||
app:boxStrokeErrorColor="@color/darkRed"
|
||||
app:startIconDrawable="@drawable/ic_search"
|
||||
app:startIconTint="?attr/iconsColor"
|
||||
app:endIconMode="clear_text"
|
||||
app:endIconTint="?attr/iconsColor"
|
||||
app:hintTextColor="?attr/hintColor"
|
||||
app:startIconDrawable="@drawable/ic_search"
|
||||
app:startIconTint="?attr/iconsColor">
|
||||
android:hint="@string/addCollaboratorSearchHint">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/addNewTeamMember"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:inputType="text"
|
||||
android:singleLine="true"
|
||||
android:textColor="?attr/inputTextColor"
|
||||
android:textColorHighlight="?attr/hintColor"
|
||||
android:textColorHint="?attr/hintColor"
|
||||
android:singleLine="true"
|
||||
android:inputType="text"
|
||||
android:textSize="@dimen/dimen16sp"/>
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
@ -105,15 +105,17 @@
|
||||
android:textSize="@dimen/dimen20sp"
|
||||
android:visibility="gone"/>
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/primaryBackgroundColor"
|
||||
android:padding="@dimen/dimen8dp">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recyclerViewUserSearch"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="@dimen/dimen0dp"
|
||||
android:layout_marginTop="@dimen/dimen6dp"
|
||||
android:layout_marginEnd="@dimen/dimen0dp"
|
||||
android:layout_marginBottom="@dimen/dimen0dp"
|
||||
android:background="?attr/primaryBackgroundColor"
|
||||
android:scrollbars="vertical"/>
|
||||
android:layout_height="match_parent"/>
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
@ -1,18 +1,17 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout 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="match_parent"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:background="?attr/primaryBackgroundColor"
|
||||
android:fitsSystemWindows="true"
|
||||
android:orientation="vertical">
|
||||
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:id="@+id/appbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:theme="@style/Widget.AppCompat.SearchView"
|
||||
app:elevation="@dimen/dimen0dp">
|
||||
app:elevation="@dimen/dimen0dp"
|
||||
android:theme="@style/Widget.AppCompat.SearchView">
|
||||
|
||||
<com.google.android.material.appbar.MaterialToolbar
|
||||
android:id="@+id/toolbar"
|
||||
@ -24,13 +23,13 @@
|
||||
android:id="@+id/close"
|
||||
android:layout_width="@dimen/dimen26dp"
|
||||
android:layout_height="@dimen/dimen26dp"
|
||||
android:layout_marginStart="@dimen/dimen16dp"
|
||||
android:layout_marginEnd="@dimen/dimen16dp"
|
||||
android:background="?android:attr/selectableItemBackgroundBorderless"
|
||||
android:clickable="true"
|
||||
android:contentDescription="@string/close"
|
||||
android:focusable="true"
|
||||
android:layout_marginStart="@dimen/dimen16dp"
|
||||
android:gravity="center_vertical"
|
||||
android:contentDescription="@string/close"
|
||||
android:background="?android:attr/selectableItemBackgroundBorderless"
|
||||
android:focusable="true"
|
||||
android:clickable="true"
|
||||
android:src="@drawable/ic_close"/>
|
||||
|
||||
<TextView
|
||||
@ -38,40 +37,45 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:maxLines="1"
|
||||
android:text="@string/adminCron"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:maxLines="1"
|
||||
android:textSize="@dimen/dimen20sp"/>
|
||||
|
||||
</com.google.android.material.appbar.MaterialToolbar>
|
||||
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
<com.google.android.material.progressindicator.LinearProgressIndicator
|
||||
android:id="@+id/progress_bar"
|
||||
style="@style/Widget.MaterialComponents.LinearProgressIndicator"
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/appbar"
|
||||
android:indeterminate="true"
|
||||
android:visibility="visible"
|
||||
app:indicatorColor="?attr/progressIndicatorColor"/>
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/primaryBackgroundColor"
|
||||
android:layout_marginTop="@dimen/dimen56dp"
|
||||
android:padding="@dimen/dimen8dp">
|
||||
|
||||
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
||||
android:id="@+id/pullToRefresh"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/progress_bar">
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recyclerView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/primaryBackgroundColor"
|
||||
android:scrollbars="vertical"/>
|
||||
android:layout_height="match_parent"/>
|
||||
|
||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
<com.google.android.material.progressindicator.LinearProgressIndicator
|
||||
android:id="@+id/progress_bar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dimen56dp"
|
||||
android:indeterminate="true"
|
||||
style="@style/Widget.Material3.LinearProgressIndicator"
|
||||
app:indicatorColor="?attr/progressIndicatorColor"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/noData"
|
||||
android:layout_width="match_parent"
|
||||
|
@ -1,17 +1,38 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:orientation="vertical"
|
||||
android:background="?attr/primaryBackgroundColor">
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/primaryBackgroundColor"
|
||||
android:orientation="vertical">
|
||||
android:padding="@dimen/dimen8dp">
|
||||
|
||||
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
||||
android:id="@+id/pull_to_refresh"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_marginTop="@dimen/dimen56dp"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recycler_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"/>
|
||||
|
||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:id="@+id/appbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:theme="@style/Widget.AppCompat.SearchView"
|
||||
app:elevation="@dimen/dimen0dp">
|
||||
app:elevation="@dimen/dimen0dp"
|
||||
android:theme="@style/Widget.AppCompat.SearchView">
|
||||
|
||||
<com.google.android.material.appbar.MaterialToolbar
|
||||
android:id="@+id/toolbar"
|
||||
@ -23,13 +44,13 @@
|
||||
android:id="@+id/close"
|
||||
android:layout_width="@dimen/dimen26dp"
|
||||
android:layout_height="@dimen/dimen26dp"
|
||||
android:layout_marginStart="@dimen/dimen16dp"
|
||||
android:layout_marginEnd="@dimen/dimen16dp"
|
||||
android:background="?android:attr/selectableItemBackgroundBorderless"
|
||||
android:clickable="true"
|
||||
android:contentDescription="@string/close"
|
||||
android:focusable="true"
|
||||
android:layout_marginStart="@dimen/dimen16dp"
|
||||
android:gravity="center_vertical"
|
||||
android:contentDescription="@string/close"
|
||||
android:background="?android:attr/selectableItemBackgroundBorderless"
|
||||
android:focusable="true"
|
||||
android:clickable="true"
|
||||
android:src="@drawable/ic_close"/>
|
||||
|
||||
<TextView
|
||||
@ -37,40 +58,25 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginEnd="@dimen/dimen20dp"
|
||||
android:text="@string/adminUsers"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:ellipsize="none"
|
||||
android:scrollbars="horizontal"
|
||||
android:singleLine="true"
|
||||
android:text="@string/adminUsers"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:layout_marginEnd="@dimen/dimen20dp"
|
||||
android:textSize="@dimen/dimen20sp"/>
|
||||
|
||||
</com.google.android.material.appbar.MaterialToolbar>
|
||||
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
||||
android:id="@+id/pull_to_refresh"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dimen56dp">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recycler_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/primaryBackgroundColor"
|
||||
android:scrollbars="vertical"/>
|
||||
|
||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||
|
||||
<com.google.android.material.progressindicator.LinearProgressIndicator
|
||||
android:id="@+id/progress_bar"
|
||||
style="@style/Widget.Material3.LinearProgressIndicator"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dimen56dp"
|
||||
android:indeterminate="true"
|
||||
style="@style/Widget.Material3.LinearProgressIndicator"
|
||||
app:indicatorColor="?attr/progressIndicatorColor"/>
|
||||
|
||||
<TextView
|
||||
|
@ -52,15 +52,21 @@
|
||||
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
||||
android:id="@+id/pullToRefresh"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dimen56dp">
|
||||
android:layout_marginTop="@dimen/dimen56dp"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/primaryBackgroundColor"
|
||||
android:padding="@dimen/dimen8dp">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recyclerView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/primaryBackgroundColor"
|
||||
android:scrollbars="vertical"/>
|
||||
android:layout_height="match_parent"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||
|
||||
|
@ -1,19 +1,19 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.coordinatorlayout.widget.CoordinatorLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
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:background="?attr/primaryBackgroundColor"
|
||||
android:orientation="vertical">
|
||||
android:orientation="vertical"
|
||||
android:background="?attr/primaryBackgroundColor">
|
||||
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:id="@+id/appbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:theme="@style/Widget.AppCompat.SearchView"
|
||||
app:elevation="@dimen/dimen0dp">
|
||||
app:elevation="@dimen/dimen0dp"
|
||||
android:theme="@style/Widget.AppCompat.SearchView">
|
||||
|
||||
<com.google.android.material.appbar.MaterialToolbar
|
||||
android:id="@+id/toolbar"
|
||||
@ -25,20 +25,20 @@
|
||||
android:id="@+id/issuePrState"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:contentDescription="@string/generalImgContentText"
|
||||
android:src="@drawable/ic_issue"
|
||||
android:paddingStart="@dimen/dimen0dp"
|
||||
android:paddingEnd="@dimen/dimen8dp"
|
||||
android:src="@drawable/ic_issue"
|
||||
android:visibility="gone"/>
|
||||
android:visibility="gone"
|
||||
android:contentDescription="@string/generalImgContentText"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/toolbar_title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:gravity="center_vertical"
|
||||
android:textSize="@dimen/dimen20sp"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="@dimen/dimen20sp"/>
|
||||
android:id="@+id/toolbar_title"/>
|
||||
|
||||
</com.google.android.material.appbar.MaterialToolbar>
|
||||
|
||||
@ -46,31 +46,31 @@
|
||||
|
||||
<com.google.android.material.progressindicator.LinearProgressIndicator
|
||||
android:id="@+id/progressBar"
|
||||
style="@style/Widget.Material3.LinearProgressIndicator"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dimen56dp"
|
||||
android:indeterminate="true"
|
||||
style="@style/Widget.Material3.LinearProgressIndicator"
|
||||
app:indicatorColor="?attr/progressIndicatorColor"/>
|
||||
|
||||
<com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton
|
||||
android:id="@+id/addNewComment"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom|end"
|
||||
android:layout_margin="@dimen/dimen16dp"
|
||||
android:backgroundTint="?attr/fabColor"
|
||||
android:contentDescription="@string/commentButtonText"
|
||||
android:text="@string/commentButtonText"
|
||||
android:contentDescription="@string/commentButtonText"
|
||||
android:textColor="@color/colorWhite"
|
||||
app:icon="@drawable/ic_reply"
|
||||
app:iconTint="@color/colorWhite"/>
|
||||
android:backgroundTint="?attr/fabColor"
|
||||
android:layout_gravity="bottom|end"
|
||||
app:iconTint="@color/colorWhite"
|
||||
app:icon="@drawable/ic_reply"/>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/relativeMainLayoutFrame"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="@dimen/dimen56dp">
|
||||
android:layout_marginTop="@dimen/dimen56dp"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
||||
android:id="@+id/pullToRefresh"
|
||||
@ -78,15 +78,31 @@
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:id="@+id/scrollViewComments"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/scrollViewComments"
|
||||
android:fillViewport="true">
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/relativeLayoutFrame"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="@dimen/dimen8dp">
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:id="@+id/mainThreadCard"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
style="?attr/materialCardViewFilledStyle"
|
||||
android:layout_marginBottom="@dimen/dimen4dp"
|
||||
app:cardElevation="@dimen/dimen0dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:foreground="?android:attr/selectableItemBackground"
|
||||
android:background="?attr/materialCardBackgroundColor"
|
||||
android:orientation="vertical">
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/mainIssueLayout"
|
||||
@ -97,12 +113,12 @@
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:id="@+id/assigneeAvatarFrame"
|
||||
style="?attr/materialCardViewFilledStyle"
|
||||
android:layout_width="@dimen/dimen24dp"
|
||||
android:layout_height="@dimen/dimen24dp"
|
||||
style="?attr/materialCardViewFilledStyle"
|
||||
app:cardElevation="@dimen/dimen0dp"
|
||||
android:layout_marginEnd="@dimen/dimen12dp"
|
||||
app:cardCornerRadius="@dimen/dimen12dp"
|
||||
app:cardElevation="@dimen/dimen0dp">
|
||||
app:cardCornerRadius="@dimen/dimen12dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/assigneeAvatar"
|
||||
@ -114,9 +130,9 @@
|
||||
|
||||
<TextView
|
||||
android:id="@+id/issueTitle"
|
||||
android:layout_toEndOf="@+id/assigneeAvatarFrame"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_toEndOf="@+id/assigneeAvatarFrame"
|
||||
android:gravity="start"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textIsSelectable="true"
|
||||
@ -124,11 +140,11 @@
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/msdueFrame"
|
||||
android:layout_toEndOf="@+id/assigneeAvatarFrame"
|
||||
android:layout_below="@+id/issueTitle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/issueTitle"
|
||||
android:layout_marginTop="@dimen/dimen10dp"
|
||||
android:layout_toEndOf="@+id/assigneeAvatarFrame"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
@ -143,8 +159,8 @@
|
||||
<ImageView
|
||||
android:layout_width="@dimen/dimen20dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:contentDescription="@string/generalImgContentText"
|
||||
app:srcCompat="@drawable/ic_calendar"/>
|
||||
app:srcCompat="@drawable/ic_calendar"
|
||||
android:contentDescription="@string/generalImgContentText"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/issueDueDate"
|
||||
@ -169,8 +185,8 @@
|
||||
<ImageView
|
||||
android:layout_width="@dimen/dimen20dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:contentDescription="@string/generalImgContentText"
|
||||
app:srcCompat="@drawable/ic_milestone"/>
|
||||
app:srcCompat="@drawable/ic_milestone"
|
||||
android:contentDescription="@string/generalImgContentText"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/issueMilestone"
|
||||
@ -186,85 +202,85 @@
|
||||
</LinearLayout>
|
||||
|
||||
<HorizontalScrollView
|
||||
android:id="@+id/assigneesScrollView"
|
||||
android:layout_below="@+id/msdueFrame"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/msdueFrame"
|
||||
android:id="@+id/assigneesScrollView"
|
||||
android:layout_alignParentEnd="false"
|
||||
android:fillViewport="true"
|
||||
android:foregroundGravity="right"
|
||||
android:scrollbarThumbHorizontal="@android:color/transparent">
|
||||
android:scrollbarThumbHorizontal="@android:color/transparent"
|
||||
android:fillViewport="true">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/frameAssignees"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:layout_gravity="end"
|
||||
android:layout_marginTop="@dimen/dimen10dp"
|
||||
android:gravity="end"
|
||||
android:orientation="horizontal">
|
||||
android:layout_marginTop="@dimen/dimen10dp">
|
||||
|
||||
</LinearLayout>
|
||||
</HorizontalScrollView>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/issueDescription"
|
||||
android:layout_below="@+id/assigneesScrollView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/assigneesScrollView"
|
||||
android:autoLink="web"
|
||||
android:gravity="start"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:autoLink="web"
|
||||
android:textColorLink="@color/lightBlue"
|
||||
android:textIsSelectable="true"
|
||||
android:textSize="@dimen/dimen14sp"/>
|
||||
|
||||
<HorizontalScrollView
|
||||
android:id="@+id/labelsScrollView"
|
||||
android:layout_below="@+id/issueDescription"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/issueDescription"
|
||||
android:id="@+id/labelsScrollView"
|
||||
android:layout_alignParentEnd="false"
|
||||
android:fillViewport="true"
|
||||
android:foregroundGravity="right"
|
||||
android:scrollbarThumbHorizontal="@android:color/transparent">
|
||||
android:scrollbarThumbHorizontal="@android:color/transparent"
|
||||
android:fillViewport="true">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/frameLabels"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dimen10dp"
|
||||
android:orientation="horizontal">
|
||||
android:orientation="horizontal"
|
||||
android:layout_marginTop="@dimen/dimen10dp">
|
||||
|
||||
</LinearLayout>
|
||||
</HorizontalScrollView>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/issueTimeFrame"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/issueTimeFrame"
|
||||
android:layout_below="@+id/labelsScrollView"
|
||||
android:layout_marginTop="@dimen/dimen10dp"
|
||||
android:orientation="horizontal">
|
||||
android:orientation="horizontal"
|
||||
android:layout_marginTop="@dimen/dimen10dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/issueCreatedTime"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="start"
|
||||
android:visibility="gone"
|
||||
android:textColor="?attr/hintColor"
|
||||
android:textSize="@dimen/dimen12sp"
|
||||
android:visibility="gone"/>
|
||||
android:textSize="@dimen/dimen12sp"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/issueModified"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_toEndOf="@+id/issueCreatedTime"
|
||||
android:text="@string/modifiedText"
|
||||
android:textColor="?attr/hintColor"
|
||||
android:layout_toEndOf="@+id/issueCreatedTime"
|
||||
android:textSize="@dimen/dimen12sp"
|
||||
android:visibility="gone"/>
|
||||
android:visibility="gone"
|
||||
android:text="@string/modifiedText"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
@ -273,35 +289,30 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/issueTimeFrame"
|
||||
android:visibility="gone"
|
||||
android:layout_marginTop="@dimen/dimen10dp"
|
||||
android:orientation="horizontal"
|
||||
android:visibility="gone"/>
|
||||
android:orientation="horizontal"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<View
|
||||
android:id="@+id/divider"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dimen1dp"
|
||||
android:layout_below="@id/mainIssueLayout"
|
||||
android:background="?attr/dividerColor"
|
||||
android:visibility="gone"/>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/divider">
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/primaryBackgroundColor"
|
||||
android:layout_below="@+id/mainThreadCard">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recyclerView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/primaryBackgroundColor"
|
||||
android:clipToPadding="false"
|
||||
android:paddingBottom="@dimen/dimen64dp"
|
||||
android:scrollbars="vertical"/>
|
||||
android:paddingBottom="@dimen/dimen72dp"
|
||||
android:clipToPadding="false"/>
|
||||
|
||||
</LinearLayout>
|
||||
</FrameLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
@ -3,10 +3,10 @@
|
||||
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:id="@+id/drawer_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".activities.MainActivity"
|
||||
android:id="@+id/drawer_layout"
|
||||
tools:openDrawer="start">
|
||||
|
||||
<LinearLayout
|
||||
@ -15,22 +15,22 @@
|
||||
android:orientation="vertical">
|
||||
|
||||
<com.google.android.material.appbar.MaterialToolbar
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:background="?attr/primaryBackgroundColor"
|
||||
android:elevation="@dimen/dimen0dp"
|
||||
android:id="@+id/toolbar"
|
||||
app:titleTextColor="?attr/primaryTextColor"
|
||||
android:theme="@style/Widget.AppCompat.SearchView"
|
||||
app:titleTextColor="?attr/primaryTextColor">
|
||||
android:elevation="@dimen/dimen0dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/toolbar_title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:gravity="center_vertical"
|
||||
android:textSize="@dimen/dimen20sp"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="@dimen/dimen20sp"/>
|
||||
android:id="@+id/toolbar_title"/>
|
||||
|
||||
</com.google.android.material.appbar.MaterialToolbar>
|
||||
|
||||
@ -42,11 +42,12 @@
|
||||
</LinearLayout>
|
||||
|
||||
<com.google.android.material.navigation.NavigationView
|
||||
android:id="@+id/nav_view"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="start"
|
||||
android:id="@+id/nav_view"
|
||||
app:headerLayout="@layout/nav_header"
|
||||
android:background="?attr/primaryBackgroundColor"
|
||||
app:menu="@menu/drawer_menu"/>
|
||||
|
||||
</androidx.drawerlayout.widget.DrawerLayout>
|
||||
|
@ -55,12 +55,18 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dimen56dp">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recyclerView"
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/primaryBackgroundColor"
|
||||
android:scrollbars="vertical"/>
|
||||
android:padding="@dimen/dimen8dp">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recyclerView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||
|
||||
|
@ -1,9 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:background="?attr/primaryBackgroundColor"
|
||||
android:orientation="vertical">
|
||||
|
||||
@ -11,8 +11,8 @@
|
||||
android:id="@+id/appbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:theme="@style/Widget.AppCompat.SearchView"
|
||||
app:elevation="@dimen/dimen0dp">
|
||||
app:elevation="@dimen/dimen0dp"
|
||||
android:theme="@style/Widget.AppCompat.SearchView">
|
||||
|
||||
<com.google.android.material.appbar.MaterialToolbar
|
||||
android:id="@+id/toolbar"
|
||||
@ -24,13 +24,13 @@
|
||||
android:id="@+id/close"
|
||||
android:layout_width="@dimen/dimen26dp"
|
||||
android:layout_height="@dimen/dimen26dp"
|
||||
android:layout_marginStart="@dimen/dimen16dp"
|
||||
android:layout_marginEnd="@dimen/dimen16dp"
|
||||
android:background="?android:attr/selectableItemBackgroundBorderless"
|
||||
android:clickable="true"
|
||||
android:contentDescription="@string/close"
|
||||
android:focusable="true"
|
||||
android:layout_marginStart="@dimen/dimen16dp"
|
||||
android:gravity="center_vertical"
|
||||
android:contentDescription="@string/close"
|
||||
android:background="?android:attr/selectableItemBackgroundBorderless"
|
||||
android:focusable="true"
|
||||
android:clickable="true"
|
||||
android:src="@drawable/ic_close"/>
|
||||
|
||||
<TextView
|
||||
@ -38,8 +38,8 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:maxLines="1"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:maxLines="1"
|
||||
android:textSize="@dimen/dimen20sp"/>
|
||||
|
||||
</com.google.android.material.appbar.MaterialToolbar>
|
||||
@ -48,21 +48,20 @@
|
||||
|
||||
<GridView
|
||||
android:id="@+id/gridView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/primaryBackgroundColor"
|
||||
android:columnWidth="@dimen/dimen80dp"
|
||||
android:scrollbars="none"
|
||||
android:numColumns="2"
|
||||
android:gravity="center"
|
||||
android:horizontalSpacing="@dimen/dimen10dp"
|
||||
android:numColumns="4"
|
||||
android:stretchMode="columnWidth"/>
|
||||
android:background="?attr/primaryBackgroundColor"
|
||||
android:padding="@dimen/dimen4dp"/>
|
||||
|
||||
<com.google.android.material.progressindicator.LinearProgressIndicator
|
||||
android:id="@+id/progress_bar"
|
||||
style="@style/Widget.MaterialComponents.LinearProgressIndicator"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:indeterminate="true"
|
||||
style="@style/Widget.MaterialComponents.LinearProgressIndicator"
|
||||
app:indicatorColor="?attr/progressIndicatorColor"/>
|
||||
|
||||
<TextView
|
||||
|
@ -1,9 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:background="?attr/primaryBackgroundColor"
|
||||
android:orientation="vertical">
|
||||
|
||||
@ -11,8 +11,8 @@
|
||||
android:id="@+id/appbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:theme="@style/Widget.AppCompat.SearchView"
|
||||
app:elevation="@dimen/dimen0dp">
|
||||
app:elevation="@dimen/dimen0dp"
|
||||
android:theme="@style/Widget.AppCompat.SearchView">
|
||||
|
||||
<com.google.android.material.appbar.MaterialToolbar
|
||||
android:id="@+id/toolbar"
|
||||
@ -24,13 +24,13 @@
|
||||
android:id="@+id/close"
|
||||
android:layout_width="@dimen/dimen26dp"
|
||||
android:layout_height="@dimen/dimen26dp"
|
||||
android:layout_marginStart="@dimen/dimen16dp"
|
||||
android:layout_marginEnd="@dimen/dimen16dp"
|
||||
android:background="?android:attr/selectableItemBackgroundBorderless"
|
||||
android:clickable="true"
|
||||
android:contentDescription="@string/close"
|
||||
android:focusable="true"
|
||||
android:layout_marginStart="@dimen/dimen16dp"
|
||||
android:gravity="center_vertical"
|
||||
android:contentDescription="@string/close"
|
||||
android:background="?android:attr/selectableItemBackgroundBorderless"
|
||||
android:focusable="true"
|
||||
android:clickable="true"
|
||||
android:src="@drawable/ic_close"/>
|
||||
|
||||
<TextView
|
||||
@ -38,8 +38,8 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:maxLines="1"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:maxLines="1"
|
||||
android:textSize="@dimen/dimen20sp"/>
|
||||
|
||||
</com.google.android.material.appbar.MaterialToolbar>
|
||||
@ -48,21 +48,20 @@
|
||||
|
||||
<GridView
|
||||
android:id="@+id/gridView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/primaryBackgroundColor"
|
||||
android:columnWidth="@dimen/dimen80dp"
|
||||
android:gravity="center"
|
||||
android:horizontalSpacing="@dimen/dimen10dp"
|
||||
android:numColumns="4"
|
||||
android:stretchMode="columnWidth"/>
|
||||
android:padding="@dimen/dimen4dp"
|
||||
android:scrollbars="none"
|
||||
android:numColumns="2"
|
||||
android:gravity="center"/>
|
||||
|
||||
<com.google.android.material.progressindicator.LinearProgressIndicator
|
||||
android:id="@+id/progress_bar"
|
||||
style="@style/Widget.MaterialComponents.LinearProgressIndicator"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:indeterminate="true"
|
||||
style="@style/Widget.MaterialComponents.LinearProgressIndicator"
|
||||
app:indicatorColor="?attr/progressIndicatorColor"/>
|
||||
|
||||
<TextView
|
||||
|
@ -255,37 +255,51 @@
|
||||
android:orientation="horizontal"
|
||||
android:padding="@dimen/dimen16dp">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/label_title_frame"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:weightSum="100"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvLabelsInListHeader"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="90"
|
||||
android:layout_marginStart="@dimen/dimen24dp"
|
||||
android:layout_marginEnd="@dimen/dimen48dp"
|
||||
android:text="@string/settingsLabelsInListHeader"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="@dimen/dimen18sp"/>
|
||||
android:textSize="@dimen/dimen18sp" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="10"
|
||||
android:gravity="center_vertical|end"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<com.google.android.material.switchmaterial.SwitchMaterial
|
||||
android:id="@+id/switchLabelsInListBadge"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dimen32dp"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_gravity="end"
|
||||
android:layout_toEndOf="@+id/tvLabelsInListHeader"
|
||||
android:gravity="end"
|
||||
android:paddingStart="@dimen/dimen0dp"
|
||||
android:paddingStart="@dimen/dimen24dp"
|
||||
android:paddingEnd="@dimen/dimen24dp"
|
||||
android:switchMinWidth="@dimen/dimen56dp"/>
|
||||
android:switchMinWidth="@dimen/dimen56dp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/switchLabelsInListBadge"
|
||||
android:layout_below="@+id/label_title_frame"
|
||||
android:layout_marginStart="@dimen/dimen24dp"
|
||||
android:layout_marginEnd="@dimen/dimen72dp"
|
||||
android:text="@string/settingsLabelsInListHint"
|
||||
android:textColor="?attr/hintColor"
|
||||
android:textSize="@dimen/dimen12sp"/>
|
||||
android:textSize="@dimen/dimen12sp" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
@ -57,34 +57,47 @@
|
||||
android:orientation="horizontal"
|
||||
android:padding="@dimen/dimen16dp">
|
||||
|
||||
<TextView
|
||||
<LinearLayout
|
||||
android:id="@+id/enableCommentsDeletionHeader"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:weightSum="100"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="90"
|
||||
android:layout_marginStart="@dimen/dimen24dp"
|
||||
android:layout_marginEnd="@dimen/dimen72dp"
|
||||
android:text="@string/settingsEnableCommentsDeletionText"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="@dimen/dimen18sp"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="10"
|
||||
android:gravity="center_vertical|end"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<com.google.android.material.switchmaterial.SwitchMaterial
|
||||
android:id="@+id/commentsDeletionSwitch"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dimen24dp"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_gravity="end"
|
||||
android:layout_toEndOf="@+id/enableCommentsDeletionHeader"
|
||||
android:gravity="end"
|
||||
android:paddingStart="@dimen/dimen0dp"
|
||||
android:layout_height="@dimen/dimen32dp"
|
||||
android:paddingStart="@dimen/dimen24dp"
|
||||
android:paddingEnd="@dimen/dimen24dp"
|
||||
android:switchMinWidth="@dimen/dimen56dp"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/enableCommentsDeletionHeader"
|
||||
android:layout_marginStart="@dimen/dimen24dp"
|
||||
android:layout_marginEnd="@dimen/dimen48dp"
|
||||
android:layout_marginEnd="@dimen/dimen72dp"
|
||||
android:text="@string/settingsEnableCommentsDeletionHintText"
|
||||
android:textColor="?attr/hintColor"
|
||||
android:textSize="@dimen/dimen12sp"/>
|
||||
|
@ -50,38 +50,44 @@
|
||||
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
<RelativeLayout
|
||||
<LinearLayout
|
||||
android:id="@+id/enableNotificationsFrame"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/dimen6dp"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:orientation="horizontal"
|
||||
android:weightSum="100"
|
||||
android:padding="@dimen/dimen16dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/enableNotificationsHeader"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="90"
|
||||
android:layout_marginStart="@dimen/dimen24dp"
|
||||
android:layout_marginEnd="@dimen/dimen72dp"
|
||||
android:text="@string/enableNotificationsHeaderText"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="@dimen/dimen18sp"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="10"
|
||||
android:gravity="center_vertical|end"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<com.google.android.material.switchmaterial.SwitchMaterial
|
||||
android:id="@+id/enableNotificationsMode"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dimen24dp"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_gravity="end"
|
||||
android:layout_toEndOf="@+id/enableNotificationsHeader"
|
||||
android:gravity="end"
|
||||
android:paddingStart="0dp"
|
||||
android:layout_height="@dimen/dimen32dp"
|
||||
android:paddingStart="@dimen/dimen24dp"
|
||||
android:paddingEnd="@dimen/dimen24dp"
|
||||
android:switchMinWidth="@dimen/dimen56dp"/>
|
||||
|
||||
</RelativeLayout>
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/pollingDelayFrame"
|
||||
|
@ -47,37 +47,43 @@
|
||||
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
<RelativeLayout
|
||||
<LinearLayout
|
||||
android:id="@+id/enableSendReports"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/dimen6dp"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:orientation="horizontal"
|
||||
android:weightSum="100"
|
||||
android:padding="@dimen/dimen16dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/enableReportsHeader"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="90"
|
||||
android:layout_marginStart="@dimen/dimen24dp"
|
||||
android:layout_marginEnd="@dimen/dimen72dp"
|
||||
android:text="@string/settingsEnableReportsText"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="@dimen/dimen18sp"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="10"
|
||||
android:gravity="center_vertical|end"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<com.google.android.material.switchmaterial.SwitchMaterial
|
||||
android:id="@+id/crashReportsSwitch"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dimen24dp"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_gravity="end"
|
||||
android:layout_toEndOf="@+id/enableReportsHeader"
|
||||
android:gravity="end"
|
||||
android:paddingStart="@dimen/dimen0dp"
|
||||
android:layout_height="@dimen/dimen32dp"
|
||||
android:paddingStart="@dimen/dimen24dp"
|
||||
android:paddingEnd="@dimen/dimen24dp"
|
||||
android:switchMinWidth="@dimen/dimen56dp"/>
|
||||
|
||||
</RelativeLayout>
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
@ -1,17 +1,16 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
<LinearLayout android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/primaryBackgroundColor"
|
||||
android:orientation="vertical">
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:orientation="vertical"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:id="@+id/appbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:theme="@style/Widget.AppCompat.SearchView"
|
||||
app:elevation="@dimen/dimen0dp">
|
||||
app:elevation="@dimen/dimen0dp"
|
||||
android:theme="@style/Widget.AppCompat.SearchView">
|
||||
|
||||
<com.google.android.material.appbar.MaterialToolbar
|
||||
android:id="@+id/toolbar"
|
||||
@ -23,13 +22,13 @@
|
||||
android:id="@+id/close"
|
||||
android:layout_width="@dimen/dimen26dp"
|
||||
android:layout_height="@dimen/dimen26dp"
|
||||
android:layout_marginStart="@dimen/dimen16dp"
|
||||
android:layout_marginEnd="@dimen/dimen16dp"
|
||||
android:background="?android:attr/selectableItemBackgroundBorderless"
|
||||
android:clickable="true"
|
||||
android:contentDescription="@string/close"
|
||||
android:focusable="true"
|
||||
android:layout_marginStart="@dimen/dimen16dp"
|
||||
android:gravity="center_vertical"
|
||||
android:contentDescription="@string/close"
|
||||
android:background="?android:attr/selectableItemBackgroundBorderless"
|
||||
android:focusable="true"
|
||||
android:clickable="true"
|
||||
android:src="@drawable/ic_close"/>
|
||||
|
||||
<TextView
|
||||
@ -37,9 +36,9 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:maxLines="1"
|
||||
android:text="@string/addButton"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:maxLines="1"
|
||||
android:textSize="@dimen/dimen20sp"/>
|
||||
|
||||
</com.google.android.material.appbar.MaterialToolbar>
|
||||
@ -48,11 +47,11 @@
|
||||
|
||||
<com.google.android.material.progressindicator.LinearProgressIndicator
|
||||
android:id="@+id/progressBar"
|
||||
style="@style/Widget.MaterialComponents.LinearProgressIndicator"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:indeterminate="true"
|
||||
android:visibility="gone"
|
||||
android:indeterminate="true"
|
||||
style="@style/Widget.MaterialComponents.LinearProgressIndicator"
|
||||
app:indicatorColor="?attr/progressIndicatorColor"/>
|
||||
|
||||
<TextView
|
||||
@ -66,15 +65,23 @@
|
||||
android:textSize="@dimen/dimen20sp"
|
||||
android:visibility="gone"/>
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/primaryBackgroundColor"
|
||||
android:padding="@dimen/dimen8dp">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recyclerViewTeamRepos"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="@dimen/dimen0dp"
|
||||
android:layout_marginTop="@dimen/dimen6dp"
|
||||
android:layout_marginEnd="@dimen/dimen0dp"
|
||||
android:layout_marginBottom="@dimen/dimen0dp"
|
||||
android:background="?attr/primaryBackgroundColor"
|
||||
android:layout_marginStart="@dimen/dimen0dp"
|
||||
android:layout_marginEnd="@dimen/dimen0dp"
|
||||
android:layout_marginTop="@dimen/dimen6dp"
|
||||
android:layout_marginBottom="@dimen/dimen0dp"
|
||||
android:scrollbars="vertical"/>
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
@ -1,23 +1,23 @@
|
||||
<?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"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="@dimen/dimen48dp"
|
||||
android:layout_marginBottom="@dimen/dimen48dp"
|
||||
android:background="@drawable/shape_round_corners"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical"
|
||||
android:padding="16dp">
|
||||
android:padding="@dimen/dimen16dp">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/accountsList"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/primaryBackgroundColor"
|
||||
android:scrollbars="vertical"/>
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
@ -25,7 +25,7 @@
|
||||
android:id="@+id/divider"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="?attr/dividerColor"/>
|
||||
android:background="?attr/dividerColor" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/newAccount"
|
||||
@ -37,7 +37,6 @@
|
||||
android:text="@string/addNewAccount"
|
||||
android:textColor="@color/colorWhite"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"/>
|
||||
android:textStyle="bold" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
@ -1,28 +1,27 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout 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="match_parent"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:background="?attr/primaryBackgroundColor"
|
||||
android:orientation="vertical">
|
||||
|
||||
<GridView
|
||||
android:id="@+id/gridView"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:columnWidth="80dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:scrollbars="none"
|
||||
android:numColumns="2"
|
||||
android:gravity="center"
|
||||
android:horizontalSpacing="10dp"
|
||||
android:numColumns="4"
|
||||
android:padding="10dp"
|
||||
android:stretchMode="columnWidth"/>
|
||||
android:background="?attr/primaryBackgroundColor"
|
||||
android:padding="@dimen/dimen4dp"/>
|
||||
|
||||
<com.google.android.material.progressindicator.LinearProgressIndicator
|
||||
android:id="@+id/progress_bar"
|
||||
style="@style/Widget.MaterialComponents.LinearProgressIndicator"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:indeterminate="true"
|
||||
style="@style/Widget.MaterialComponents.LinearProgressIndicator"
|
||||
app:indicatorColor="?attr/progressIndicatorColor"/>
|
||||
|
||||
<TextView
|
||||
|
@ -12,7 +12,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:theme="@style/Widget.AppCompat.SearchView"
|
||||
app:elevation="0dp"
|
||||
app:elevation="@dimen/dimen0dp"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<com.google.android.material.appbar.MaterialToolbar
|
||||
@ -39,12 +39,12 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:layout_marginEnd="@dimen/dimen20dp"
|
||||
android:ellipsize="none"
|
||||
android:scrollbars="horizontal"
|
||||
android:singleLine="true"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="18sp"/>
|
||||
android:textSize="@dimen/dimen18sp"/>
|
||||
|
||||
</com.google.android.material.appbar.MaterialToolbar>
|
||||
|
||||
@ -52,10 +52,10 @@
|
||||
|
||||
<com.google.android.material.progressindicator.LinearProgressIndicator
|
||||
android:id="@+id/progress_bar"
|
||||
style="@style/Widget.MaterialComponents.LinearProgressIndicator"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:indeterminate="true"
|
||||
style="@style/Widget.MaterialComponents.LinearProgressIndicator"
|
||||
app:indicatorColor="?attr/progressIndicatorColor"/>
|
||||
|
||||
<androidx.core.widget.NestedScrollView
|
||||
@ -65,40 +65,47 @@
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/primaryBackgroundColor"
|
||||
android:padding="@dimen/dimen8dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/linearLayoutFrame"
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/primaryBackgroundColor"
|
||||
android:orientation="vertical"
|
||||
android:padding="16dp">
|
||||
style="?attr/materialCardViewFilledStyle"
|
||||
android:layout_marginBottom="@dimen/dimen4dp"
|
||||
app:cardElevation="@dimen/dimen0dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:foreground="?android:attr/selectableItemBackground"
|
||||
android:background="?attr/materialCardBackgroundColor"
|
||||
android:padding="@dimen/dimen12dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/commitSubject"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:layout_marginBottom="@dimen/dimen8dp"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="18sp"
|
||||
android:textSize="@dimen/dimen18sp"
|
||||
tools:text="This is a test"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/commitBody"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:layout_marginBottom="@dimen/dimen8dp"
|
||||
android:alpha=".8"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="14sp"
|
||||
android:textSize="@dimen/dimen14sp"
|
||||
tools:text="This is a test commit message"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginTop="@dimen/dimen6dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
@ -130,9 +137,9 @@
|
||||
android:id="@+id/commitAuthorAndCommitter"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:layout_marginEnd="@dimen/dimen10dp"
|
||||
android:textSize="@dimen/dimen12sp"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="12sp"
|
||||
tools:text="opyale authored and opyale committed"/>
|
||||
|
||||
</LinearLayout>
|
||||
@ -141,32 +148,26 @@
|
||||
android:id="@+id/commitSha"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_weight="0"
|
||||
android:alpha=".8"
|
||||
android:drawablePadding="10dp"
|
||||
android:drawablePadding="@dimen/dimen10dp"
|
||||
android:textSize="@dimen/dimen12sp"
|
||||
android:layout_marginStart="@dimen/dimen10dp"
|
||||
android:gravity="center_vertical"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="12sp"
|
||||
app:drawableLeftCompat="@drawable/ic_commit"
|
||||
tools:text="357f3qd5s"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="?attr/dividerColor"/>
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/diff_files"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="4dp"
|
||||
android:background="?attr/primaryBackgroundColor"
|
||||
android:headerDividersEnabled="true"
|
||||
android:nestedScrollingEnabled="false"
|
||||
tools:listitem="@layout/list_diff_files"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
@ -1,9 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<com.google.android.material.progressindicator.LinearProgressIndicator
|
||||
android:id="@+id/progress_bar"
|
||||
@ -18,22 +18,28 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:text="@string/fileDiffViewHeader"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:ellipsize="none"
|
||||
android:scrollbars="horizontal"
|
||||
android:singleLine="true"
|
||||
android:text="@string/fileDiffViewHeader"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="15sp"
|
||||
android:layout_marginStart="@dimen/dimen20dp"
|
||||
android:layout_marginTop="@dimen/dimen8dp"
|
||||
android:layout_marginBottom="@dimen/dimen8dp"
|
||||
android:textSize="@dimen/dimen16sp"
|
||||
android:visibility="gone"/>
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/primaryBackgroundColor"
|
||||
android:padding="@dimen/dimen8dp">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/diff_files"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/primaryBackgroundColor"
|
||||
android:scrollbars="vertical"/>
|
||||
android:layout_height="match_parent"/>
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
@ -1,11 +1,17 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/draftsFrame"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/draftsFrame"
|
||||
android:background="?attr/primaryBackgroundColor">
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/primaryBackgroundColor"
|
||||
android:padding="@dimen/dimen8dp">
|
||||
|
||||
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
||||
android:id="@+id/pullToRefresh"
|
||||
android:layout_width="match_parent"
|
||||
@ -14,20 +20,20 @@
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recyclerView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/primaryBackgroundColor"
|
||||
android:scrollbars="vertical"/>
|
||||
android:layout_height="match_parent"/>
|
||||
|
||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/noData"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_margin="16dp"
|
||||
android:gravity="center"
|
||||
android:text="@string/noDataFound"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:gravity="center"
|
||||
android:textSize="20sp"
|
||||
android:visibility="visible"/>
|
||||
|
||||
|
@ -1,17 +1,17 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:background="?attr/primaryBackgroundColor"
|
||||
android:orientation="vertical">
|
||||
|
||||
<com.google.android.material.progressindicator.LinearProgressIndicator
|
||||
android:id="@+id/progressBar"
|
||||
style="@style/Widget.MaterialComponents.LinearProgressIndicator"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:indeterminate="true"
|
||||
style="@style/Widget.MaterialComponents.LinearProgressIndicator"
|
||||
app:indicatorColor="?attr/progressIndicatorColor"/>
|
||||
|
||||
<TextView
|
||||
@ -25,6 +25,12 @@
|
||||
android:textSize="20sp"
|
||||
android:visibility="gone"/>
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/primaryBackgroundColor"
|
||||
android:padding="@dimen/dimen8dp">
|
||||
|
||||
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
||||
android:id="@+id/pullToRefresh"
|
||||
android:layout_width="match_parent"
|
||||
@ -33,10 +39,10 @@
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recyclerViewReposSearch"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/primaryBackgroundColor"
|
||||
android:scrollbars="vertical"/>
|
||||
android:layout_height="match_parent"/>
|
||||
|
||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
@ -1,17 +1,17 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:background="?attr/primaryBackgroundColor"
|
||||
android:orientation="vertical">
|
||||
|
||||
<com.google.android.material.progressindicator.LinearProgressIndicator
|
||||
android:id="@+id/progressBar"
|
||||
style="@style/Widget.MaterialComponents.LinearProgressIndicator"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:indeterminate="true"
|
||||
style="@style/Widget.MaterialComponents.LinearProgressIndicator"
|
||||
app:indicatorColor="?attr/progressIndicatorColor"/>
|
||||
|
||||
<TextView
|
||||
@ -25,6 +25,12 @@
|
||||
android:textSize="20sp"
|
||||
android:visibility="gone"/>
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/primaryBackgroundColor"
|
||||
android:padding="@dimen/dimen8dp">
|
||||
|
||||
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
||||
android:id="@+id/pullToRefresh"
|
||||
android:layout_width="match_parent"
|
||||
@ -33,10 +39,10 @@
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recyclerViewExploreUsers"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/primaryBackgroundColor"
|
||||
android:scrollbars="vertical"/>
|
||||
android:layout_height="match_parent"/>
|
||||
|
||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
@ -15,16 +15,40 @@
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible">
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
style="?attr/materialCardViewFilledStyle"
|
||||
android:layout_margin="@dimen/dimen8dp"
|
||||
app:cardElevation="@dimen/dimen0dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:foreground="?android:attr/selectableItemBackground"
|
||||
android:background="?attr/materialCardBackgroundColor"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<moe.feng.common.view.breadcrumbs.BreadcrumbsView
|
||||
android:id="@+id/breadcrumbs_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:saveEnabled="false"
|
||||
android:text="@string/filesBreadcrumbRoot"
|
||||
app:CustomTextSize="16sp"
|
||||
app:CustomTextSize="@dimen/dimen16sp"
|
||||
app:SelectedTextColor="?attr/primaryTextColor"
|
||||
app:UnSelectedTextColor="@color/lightGray"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/primaryBackgroundColor"
|
||||
android:padding="@dimen/dimen8dp">
|
||||
|
||||
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
||||
android:id="@+id/pullToRefresh"
|
||||
android:layout_width="match_parent"
|
||||
@ -33,12 +57,12 @@
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recyclerView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/primaryBackgroundColor"
|
||||
android:scrollbars="vertical"/>
|
||||
android:layout_height="match_parent"/>
|
||||
|
||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
|
@ -1,11 +1,17 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout 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"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
tools:context=".activities.RepoDetailActivity">
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/primaryBackgroundColor"
|
||||
android:padding="@dimen/dimen8dp">
|
||||
|
||||
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
||||
android:id="@+id/pullToRefresh"
|
||||
android:layout_width="match_parent"
|
||||
@ -14,18 +20,18 @@
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recyclerView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/primaryBackgroundColor"
|
||||
android:scrollbars="vertical"/>
|
||||
android:layout_height="match_parent"/>
|
||||
|
||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
<com.google.android.material.progressindicator.LinearProgressIndicator
|
||||
android:id="@+id/progressBar"
|
||||
style="@style/Widget.MaterialComponents.LinearProgressIndicator"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:indeterminate="true"
|
||||
style="@style/Widget.MaterialComponents.LinearProgressIndicator"
|
||||
app:indicatorColor="?attr/progressIndicatorColor"/>
|
||||
|
||||
<TextView
|
||||
@ -33,9 +39,9 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_margin="15dp"
|
||||
android:gravity="center"
|
||||
android:text="@string/noDataFound"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:gravity="center"
|
||||
android:textSize="18sp"
|
||||
android:visibility="gone"/>
|
||||
|
||||
|
@ -1,11 +1,17 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout 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"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
tools:context=".activities.RepoDetailActivity">
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/primaryBackgroundColor"
|
||||
android:padding="@dimen/dimen8dp">
|
||||
|
||||
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
||||
android:id="@+id/pullToRefresh"
|
||||
android:layout_width="match_parent"
|
||||
@ -14,18 +20,18 @@
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recyclerView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/primaryBackgroundColor"
|
||||
android:scrollbars="vertical"/>
|
||||
android:layout_height="match_parent"/>
|
||||
|
||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
<com.google.android.material.progressindicator.LinearProgressIndicator
|
||||
android:id="@+id/progressBar"
|
||||
style="@style/Widget.MaterialComponents.LinearProgressIndicator"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:indeterminate="true"
|
||||
style="@style/Widget.MaterialComponents.LinearProgressIndicator"
|
||||
app:indicatorColor="?attr/progressIndicatorColor"/>
|
||||
|
||||
<TextView
|
||||
|
@ -1,11 +1,17 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout 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"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
tools:context=".activities.RepoDetailActivity">
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/primaryBackgroundColor"
|
||||
android:padding="@dimen/dimen8dp">
|
||||
|
||||
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
||||
android:id="@+id/pullToRefresh"
|
||||
android:layout_width="match_parent"
|
||||
@ -14,27 +20,27 @@
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recyclerView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/primaryBackgroundColor"
|
||||
android:scrollbars="vertical"/>
|
||||
android:layout_height="match_parent"/>
|
||||
|
||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
<com.google.android.material.progressindicator.LinearProgressIndicator
|
||||
android:id="@+id/progress_bar"
|
||||
style="@style/Widget.MaterialComponents.LinearProgressIndicator"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:indeterminate="true"
|
||||
style="@style/Widget.MaterialComponents.LinearProgressIndicator"
|
||||
app:indicatorColor="?attr/progressIndicatorColor"/>
|
||||
|
||||
<com.google.android.material.progressindicator.LinearProgressIndicator
|
||||
android:id="@+id/progressLoadMore"
|
||||
style="@style/Widget.MaterialComponents.LinearProgressIndicator"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:indeterminate="true"
|
||||
android:visibility="gone"
|
||||
android:indeterminate="true"
|
||||
style="@style/Widget.MaterialComponents.LinearProgressIndicator"
|
||||
app:indicatorColor="?attr/progressIndicatorColor"/>
|
||||
|
||||
<TextView
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user