mirror of
https://codeberg.org/gitnex/GitNex.git
synced 2023-12-13 20:50:18 +01: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'
|
apply plugin: 'com.android.application'
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion 33
|
compileSdkVersion 32
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "org.mian.gitnex"
|
applicationId "org.mian.gitnex"
|
||||||
minSdkVersion 23
|
minSdkVersion 23
|
||||||
targetSdkVersion 33
|
targetSdkVersion 32
|
||||||
versionCode 445
|
versionCode 445
|
||||||
versionName "4.5.0-dev"
|
versionName "4.5.0-dev"
|
||||||
multiDexEnabled true
|
multiDexEnabled true
|
||||||
|
@ -58,8 +58,8 @@ dependencies {
|
||||||
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
||||||
implementation 'androidx.appcompat:appcompat:1.5.0'
|
implementation 'androidx.appcompat:appcompat:1.5.0'
|
||||||
implementation 'com.google.android.material:material:1.6.1'
|
implementation 'com.google.android.material:material:1.6.1'
|
||||||
implementation 'androidx.compose.material3:material3:1.0.0-alpha16'
|
implementation 'androidx.compose.material3:material3:1.0.0-alpha15'
|
||||||
implementation 'androidx.compose.material3:material3-window-size-class:1.0.0-alpha16'
|
implementation 'androidx.compose.material3:material3-window-size-class:1.0.0-alpha15'
|
||||||
implementation 'androidx.viewpager2:viewpager2:1.1.0-beta01'
|
implementation 'androidx.viewpager2:viewpager2:1.1.0-beta01'
|
||||||
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
|
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
|
||||||
implementation "androidx.legacy:legacy-support-v4:1.0.0"
|
implementation "androidx.legacy:legacy-support-v4:1.0.0"
|
||||||
|
|
|
@ -3,7 +3,11 @@ package org.mian.gitnex.actions;
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import androidx.annotation.NonNull;
|
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.R;
|
||||||
import org.mian.gitnex.activities.BaseActivity;
|
import org.mian.gitnex.activities.BaseActivity;
|
||||||
import org.mian.gitnex.activities.IssueDetailActivity;
|
import org.mian.gitnex.activities.IssueDetailActivity;
|
||||||
|
|
|
@ -6,7 +6,6 @@ import android.view.View;
|
||||||
import android.view.inputmethod.EditorInfo;
|
import android.view.inputmethod.EditorInfo;
|
||||||
import android.view.inputmethod.InputMethodManager;
|
import android.view.inputmethod.InputMethodManager;
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.recyclerview.widget.DividerItemDecoration;
|
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
import org.gitnex.tea4j.v2.models.InlineResponse2001;
|
import org.gitnex.tea4j.v2.models.InlineResponse2001;
|
||||||
import org.gitnex.tea4j.v2.models.User;
|
import org.gitnex.tea4j.v2.models.User;
|
||||||
|
@ -101,8 +100,6 @@ public class AddCollaboratorToRepositoryActivity extends BaseActivity {
|
||||||
|
|
||||||
activityAddCollaboratorToRepositoryBinding.recyclerViewUserSearch.setHasFixedSize(true);
|
activityAddCollaboratorToRepositoryBinding.recyclerViewUserSearch.setHasFixedSize(true);
|
||||||
activityAddCollaboratorToRepositoryBinding.recyclerViewUserSearch.setLayoutManager(new LinearLayoutManager(ctx));
|
activityAddCollaboratorToRepositoryBinding.recyclerViewUserSearch.setLayoutManager(new LinearLayoutManager(ctx));
|
||||||
DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(activityAddCollaboratorToRepositoryBinding.recyclerViewUserSearch.getContext(), DividerItemDecoration.VERTICAL);
|
|
||||||
activityAddCollaboratorToRepositoryBinding.recyclerViewUserSearch.addItemDecoration(dividerItemDecoration);
|
|
||||||
|
|
||||||
activityAddCollaboratorToRepositoryBinding.progressBar.setVisibility(View.VISIBLE);
|
activityAddCollaboratorToRepositoryBinding.progressBar.setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
|
|
|
@ -11,12 +11,11 @@ import android.widget.ImageView;
|
||||||
import android.widget.ProgressBar;
|
import android.widget.ProgressBar;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.recyclerview.widget.DividerItemDecoration;
|
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
import org.gitnex.tea4j.v2.models.InlineResponse2001;
|
import org.gitnex.tea4j.v2.models.InlineResponse2001;
|
||||||
import org.gitnex.tea4j.v2.models.User;
|
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.clients.RetrofitClient;
|
||||||
import org.mian.gitnex.databinding.ActivityAddNewTeamMemberBinding;
|
import org.mian.gitnex.databinding.ActivityAddNewTeamMemberBinding;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
@ -38,7 +37,7 @@ public class AddNewTeamMemberActivity extends BaseActivity {
|
||||||
|
|
||||||
private RecyclerView mRecyclerView;
|
private RecyclerView mRecyclerView;
|
||||||
private List<User> dataList;
|
private List<User> dataList;
|
||||||
private UserSearchForTeamMemberAdapter adapter;
|
private OrganizationAddUserToTeamMemberAdapter adapter;
|
||||||
|
|
||||||
private long teamId;
|
private long teamId;
|
||||||
|
|
||||||
|
@ -70,9 +69,6 @@ public class AddNewTeamMemberActivity extends BaseActivity {
|
||||||
mRecyclerView.setHasFixedSize(true);
|
mRecyclerView.setHasFixedSize(true);
|
||||||
mRecyclerView.setLayoutManager(new LinearLayoutManager(ctx));
|
mRecyclerView.setLayoutManager(new LinearLayoutManager(ctx));
|
||||||
|
|
||||||
DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(mRecyclerView.getContext(), DividerItemDecoration.VERTICAL);
|
|
||||||
mRecyclerView.addItemDecoration(dividerItemDecoration);
|
|
||||||
|
|
||||||
dataList = new ArrayList<>();
|
dataList = new ArrayList<>();
|
||||||
|
|
||||||
addNewTeamMember.addTextChangedListener(new TextWatcher() {
|
addNewTeamMember.addTextChangedListener(new TextWatcher() {
|
||||||
|
@ -82,7 +78,7 @@ public class AddNewTeamMemberActivity extends BaseActivity {
|
||||||
|
|
||||||
if(!addNewTeamMember.getText().toString().equals("") && addNewTeamMember.getText().toString().length() > 1) {
|
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());
|
loadUserSearchList(addNewTeamMember.getText().toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,11 +3,10 @@ package org.mian.gitnex.activities;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.recyclerview.widget.DividerItemDecoration;
|
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
import org.gitnex.tea4j.v2.models.Repository;
|
import org.gitnex.tea4j.v2.models.Repository;
|
||||||
import org.mian.gitnex.R;
|
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.clients.RetrofitClient;
|
||||||
import org.mian.gitnex.databinding.AddNewTeamRepositoryBinding;
|
import org.mian.gitnex.databinding.AddNewTeamRepositoryBinding;
|
||||||
import org.mian.gitnex.helpers.Constants;
|
import org.mian.gitnex.helpers.Constants;
|
||||||
|
@ -27,7 +26,7 @@ public class AddNewTeamRepoActivity extends BaseActivity {
|
||||||
private AddNewTeamRepositoryBinding addNewTeamRepositoryBinding;
|
private AddNewTeamRepositoryBinding addNewTeamRepositoryBinding;
|
||||||
private View.OnClickListener onClickListener;
|
private View.OnClickListener onClickListener;
|
||||||
private List<Repository> dataList;
|
private List<Repository> dataList;
|
||||||
private TeamRepositoriesAdapter adapter;
|
private OrganizationTeamRepositoriesAdapter adapter;
|
||||||
private int resultLimit;
|
private int resultLimit;
|
||||||
|
|
||||||
private long teamId;
|
private long teamId;
|
||||||
|
@ -51,9 +50,6 @@ public class AddNewTeamRepoActivity extends BaseActivity {
|
||||||
addNewTeamRepositoryBinding.recyclerViewTeamRepos.setHasFixedSize(true);
|
addNewTeamRepositoryBinding.recyclerViewTeamRepos.setHasFixedSize(true);
|
||||||
addNewTeamRepositoryBinding.recyclerViewTeamRepos.setLayoutManager(new LinearLayoutManager(ctx));
|
addNewTeamRepositoryBinding.recyclerViewTeamRepos.setLayoutManager(new LinearLayoutManager(ctx));
|
||||||
|
|
||||||
DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(addNewTeamRepositoryBinding.recyclerViewTeamRepos.getContext(), DividerItemDecoration.VERTICAL);
|
|
||||||
addNewTeamRepositoryBinding.recyclerViewTeamRepos.addItemDecoration(dividerItemDecoration);
|
|
||||||
|
|
||||||
dataList = new ArrayList<>();
|
dataList = new ArrayList<>();
|
||||||
|
|
||||||
loadRepos();
|
loadRepos();
|
||||||
|
@ -78,7 +74,7 @@ public class AddNewTeamRepoActivity extends BaseActivity {
|
||||||
dataList.clear();
|
dataList.clear();
|
||||||
dataList.addAll(response.body());
|
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.recyclerViewTeamRepos.setAdapter(adapter);
|
||||||
addNewTeamRepositoryBinding.noData.setVisibility(View.GONE);
|
addNewTeamRepositoryBinding.noData.setVisibility(View.GONE);
|
||||||
|
|
|
@ -7,7 +7,6 @@ import android.os.Looper;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import androidx.appcompat.widget.Toolbar;
|
import androidx.appcompat.widget.Toolbar;
|
||||||
import androidx.lifecycle.ViewModelProvider;
|
import androidx.lifecycle.ViewModelProvider;
|
||||||
import androidx.recyclerview.widget.DividerItemDecoration;
|
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
import org.mian.gitnex.adapters.AdminCronTasksAdapter;
|
import org.mian.gitnex.adapters.AdminCronTasksAdapter;
|
||||||
import org.mian.gitnex.databinding.ActivityAdminCronTasksBinding;
|
import org.mian.gitnex.databinding.ActivityAdminCronTasksBinding;
|
||||||
|
@ -20,11 +19,13 @@ import org.mian.gitnex.viewmodels.AdminCronTasksViewModel;
|
||||||
|
|
||||||
public class AdminCronTasksActivity extends BaseActivity {
|
public class AdminCronTasksActivity extends BaseActivity {
|
||||||
|
|
||||||
private final int PAGE = 1;
|
|
||||||
private AdminCronTasksViewModel adminCronTasksViewModel;
|
private AdminCronTasksViewModel adminCronTasksViewModel;
|
||||||
private View.OnClickListener onClickListener;
|
private View.OnClickListener onClickListener;
|
||||||
private AdminCronTasksAdapter adapter;
|
private AdminCronTasksAdapter adapter;
|
||||||
|
|
||||||
private ActivityAdminCronTasksBinding activityAdminCronTasksBinding;
|
private ActivityAdminCronTasksBinding activityAdminCronTasksBinding;
|
||||||
|
|
||||||
|
private final int PAGE = 1;
|
||||||
private int resultLimit;
|
private int resultLimit;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -46,9 +47,6 @@ public class AdminCronTasksActivity extends BaseActivity {
|
||||||
activityAdminCronTasksBinding.recyclerView.setHasFixedSize(true);
|
activityAdminCronTasksBinding.recyclerView.setHasFixedSize(true);
|
||||||
activityAdminCronTasksBinding.recyclerView.setLayoutManager(new LinearLayoutManager(ctx));
|
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.pullToRefresh.setOnRefreshListener(() -> new Handler(Looper.getMainLooper()).postDelayed(() -> {
|
||||||
|
|
||||||
activityAdminCronTasksBinding.progressBar.setVisibility(View.VISIBLE);
|
activityAdminCronTasksBinding.progressBar.setVisibility(View.VISIBLE);
|
||||||
|
|
|
@ -12,7 +12,6 @@ import android.view.inputmethod.EditorInfo;
|
||||||
import androidx.appcompat.widget.SearchView;
|
import androidx.appcompat.widget.SearchView;
|
||||||
import androidx.appcompat.widget.Toolbar;
|
import androidx.appcompat.widget.Toolbar;
|
||||||
import androidx.lifecycle.ViewModelProvider;
|
import androidx.lifecycle.ViewModelProvider;
|
||||||
import androidx.recyclerview.widget.DividerItemDecoration;
|
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
import org.mian.gitnex.R;
|
import org.mian.gitnex.R;
|
||||||
import org.mian.gitnex.adapters.AdminGetUsersAdapter;
|
import org.mian.gitnex.adapters.AdminGetUsersAdapter;
|
||||||
|
@ -55,8 +54,6 @@ public class AdminGetUsersActivity extends BaseActivity implements BottomSheetLi
|
||||||
|
|
||||||
activityAdminGetUsersBinding.recyclerView.setHasFixedSize(true);
|
activityAdminGetUsersBinding.recyclerView.setHasFixedSize(true);
|
||||||
activityAdminGetUsersBinding.recyclerView.setLayoutManager(new LinearLayoutManager(ctx));
|
activityAdminGetUsersBinding.recyclerView.setLayoutManager(new LinearLayoutManager(ctx));
|
||||||
DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(activityAdminGetUsersBinding.recyclerView.getContext(), DividerItemDecoration.VERTICAL);
|
|
||||||
activityAdminGetUsersBinding.recyclerView.addItemDecoration(dividerItemDecoration);
|
|
||||||
|
|
||||||
activityAdminGetUsersBinding.pullToRefresh.setOnRefreshListener(() -> new Handler(Looper.getMainLooper()).postDelayed(() -> {
|
activityAdminGetUsersBinding.pullToRefresh.setOnRefreshListener(() -> new Handler(Looper.getMainLooper()).postDelayed(() -> {
|
||||||
|
|
||||||
|
@ -69,6 +66,8 @@ public class AdminGetUsersActivity extends BaseActivity implements BottomSheetLi
|
||||||
fetchDataAsync();
|
fetchDataAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
;
|
||||||
|
|
||||||
private void fetchDataAsync() {
|
private void fetchDataAsync() {
|
||||||
|
|
||||||
AdminGetUsersViewModel adminUsersModel = new ViewModelProvider(this).get(AdminGetUsersViewModel.class);
|
AdminGetUsersViewModel adminUsersModel = new ViewModelProvider(this).get(AdminGetUsersViewModel.class);
|
||||||
|
|
|
@ -7,7 +7,6 @@ import android.os.Looper;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import androidx.appcompat.widget.Toolbar;
|
import androidx.appcompat.widget.Toolbar;
|
||||||
import androidx.lifecycle.ViewModelProvider;
|
import androidx.lifecycle.ViewModelProvider;
|
||||||
import androidx.recyclerview.widget.DividerItemDecoration;
|
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
import org.mian.gitnex.R;
|
import org.mian.gitnex.R;
|
||||||
import org.mian.gitnex.adapters.AdminUnadoptedReposAdapter;
|
import org.mian.gitnex.adapters.AdminUnadoptedReposAdapter;
|
||||||
|
@ -55,9 +54,6 @@ public class AdminUnadoptedReposActivity extends BaseActivity {
|
||||||
binding.recyclerView.setHasFixedSize(true);
|
binding.recyclerView.setHasFixedSize(true);
|
||||||
binding.recyclerView.setLayoutManager(new LinearLayoutManager(ctx));
|
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.setOnRefreshListener(() -> new Handler(Looper.getMainLooper()).postDelayed(() -> {
|
||||||
|
|
||||||
binding.pullToRefresh.setRefreshing(false);
|
binding.pullToRefresh.setRefreshing(false);
|
||||||
|
|
|
@ -69,7 +69,7 @@ public class CodeEditorActivity extends BaseActivity {
|
||||||
// Setup Line number feature
|
// Setup Line number feature
|
||||||
binding.codeView.setEnableLineNumber(true);
|
binding.codeView.setEnableLineNumber(true);
|
||||||
binding.codeView.setLineNumberTextColor(Color.GRAY);
|
binding.codeView.setLineNumberTextColor(Color.GRAY);
|
||||||
binding.codeView.setLineNumberTextSize(44f);
|
binding.codeView.setLineNumberTextSize(32f);
|
||||||
|
|
||||||
// Setup Auto indenting feature
|
// Setup Auto indenting feature
|
||||||
binding.codeView.setTabLength(4);
|
binding.codeView.setTabLength(4);
|
||||||
|
|
|
@ -17,7 +17,7 @@ import org.gitnex.tea4j.v2.models.Team;
|
||||||
import org.mian.gitnex.R;
|
import org.mian.gitnex.R;
|
||||||
import org.mian.gitnex.clients.RetrofitClient;
|
import org.mian.gitnex.clients.RetrofitClient;
|
||||||
import org.mian.gitnex.databinding.ActivityCreateTeamByOrgBinding;
|
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.AlertDialogs;
|
||||||
import org.mian.gitnex.helpers.AppUtil;
|
import org.mian.gitnex.helpers.AppUtil;
|
||||||
import org.mian.gitnex.helpers.Toasty;
|
import org.mian.gitnex.helpers.Toasty;
|
||||||
|
@ -33,10 +33,6 @@ import retrofit2.Callback;
|
||||||
|
|
||||||
public class CreateTeamByOrgActivity extends BaseActivity implements View.OnClickListener {
|
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 View.OnClickListener onClickListener;
|
||||||
private TextView teamName;
|
private TextView teamName;
|
||||||
private TextView teamDesc;
|
private TextView teamDesc;
|
||||||
|
@ -45,8 +41,15 @@ public class CreateTeamByOrgActivity extends BaseActivity implements View.OnClic
|
||||||
private TextView teamAccessControls;
|
private TextView teamAccessControls;
|
||||||
private TextView teamAccessControlsArray;
|
private TextView teamAccessControlsArray;
|
||||||
private Button createTeamButton;
|
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 List<String> pushAccessList;
|
||||||
|
|
||||||
|
private final boolean[] selectedAccessControlsTrueFalse = new boolean[]{false, false, false, false, false, false, false};
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
|
|
||||||
|
@ -279,7 +282,7 @@ public class CreateTeamByOrgActivity extends BaseActivity implements View.OnClic
|
||||||
|
|
||||||
if(response2.code() == 201) {
|
if(response2.code() == 201) {
|
||||||
|
|
||||||
TeamsByOrgFragment.resumeTeams = true;
|
OrganizationTeamsFragment.resumeTeams = true;
|
||||||
|
|
||||||
Toasty.success(ctx, getString(R.string.teamCreated));
|
Toasty.success(ctx, getString(R.string.teamCreated));
|
||||||
finish();
|
finish();
|
||||||
|
|
|
@ -8,7 +8,12 @@ import android.os.Bundle;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.os.Looper;
|
import android.os.Looper;
|
||||||
import android.util.Log;
|
import android.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.ImageView;
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
import android.widget.RelativeLayout;
|
import android.widget.RelativeLayout;
|
||||||
|
@ -16,17 +21,22 @@ import android.widget.ScrollView;
|
||||||
import androidx.activity.result.ActivityResultLauncher;
|
import androidx.activity.result.ActivityResultLauncher;
|
||||||
import androidx.activity.result.contract.ActivityResultContracts;
|
import androidx.activity.result.contract.ActivityResultContracts;
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.core.content.ContextCompat;
|
|
||||||
import androidx.core.content.res.ResourcesCompat;
|
import androidx.core.content.res.ResourcesCompat;
|
||||||
import androidx.core.text.HtmlCompat;
|
import androidx.core.text.HtmlCompat;
|
||||||
import androidx.core.widget.ImageViewCompat;
|
import androidx.core.widget.ImageViewCompat;
|
||||||
import androidx.lifecycle.ViewModelProvider;
|
import androidx.lifecycle.ViewModelProvider;
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
|
||||||
import com.amulyakhare.textdrawable.TextDrawable;
|
import com.amulyakhare.textdrawable.TextDrawable;
|
||||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
|
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
|
||||||
import com.vdurmont.emoji.EmojiParser;
|
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.R;
|
||||||
import org.mian.gitnex.actions.AssigneesActions;
|
import org.mian.gitnex.actions.AssigneesActions;
|
||||||
import org.mian.gitnex.actions.LabelsActions;
|
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.BottomSheetReplyFragment;
|
||||||
import org.mian.gitnex.fragments.BottomSheetSingleIssueFragment;
|
import org.mian.gitnex.fragments.BottomSheetSingleIssueFragment;
|
||||||
import org.mian.gitnex.fragments.IssuesFragment;
|
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.helpers.contexts.IssueContext;
|
||||||
import org.mian.gitnex.structs.BottomSheetListener;
|
import org.mian.gitnex.structs.BottomSheetListener;
|
||||||
import org.mian.gitnex.viewmodels.IssueCommentsViewModel;
|
import org.mian.gitnex.viewmodels.IssueCommentsViewModel;
|
||||||
import org.mian.gitnex.views.ReactionList;
|
import org.mian.gitnex.views.ReactionList;
|
||||||
import java.text.DateFormat;
|
import java.text.DateFormat;
|
||||||
import java.text.SimpleDateFormat;
|
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.Call;
|
||||||
import retrofit2.Callback;
|
import retrofit2.Callback;
|
||||||
import retrofit2.Response;
|
import retrofit2.Response;
|
||||||
|
@ -126,9 +150,6 @@ public class IssueDetailActivity extends BaseActivity implements LabelsListAdapt
|
||||||
viewBinding.recyclerView.setNestedScrollingEnabled(false);
|
viewBinding.recyclerView.setNestedScrollingEnabled(false);
|
||||||
viewBinding.recyclerView.setLayoutManager(new LinearLayoutManager(ctx));
|
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 -> {
|
viewBinding.addNewComment.setOnClickListener(v -> {
|
||||||
|
|
||||||
BottomSheetReplyFragment bottomSheetReplyFragment = BottomSheetReplyFragment.newInstance(new Bundle(), issue);
|
BottomSheetReplyFragment bottomSheetReplyFragment = BottomSheetReplyFragment.newInstance(new Bundle(), issue);
|
||||||
|
@ -354,7 +375,7 @@ public class IssueDetailActivity extends BaseActivity implements LabelsListAdapt
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onCreateOptionsMenu(Menu menu) {
|
public boolean onCreateOptionsMenu(@NonNull Menu menu) {
|
||||||
|
|
||||||
MenuInflater inflater = getMenuInflater();
|
MenuInflater inflater = getMenuInflater();
|
||||||
showMenu = () -> {
|
showMenu = () -> {
|
||||||
|
@ -463,11 +484,6 @@ public class IssueDetailActivity extends BaseActivity implements LabelsListAdapt
|
||||||
|
|
||||||
assert issueCommentsMain != null;
|
assert issueCommentsMain != null;
|
||||||
|
|
||||||
if(issueCommentsMain.size() > 0) {
|
|
||||||
|
|
||||||
viewBinding.divider.setVisibility(View.VISIBLE);
|
|
||||||
}
|
|
||||||
|
|
||||||
Bundle bundle = new Bundle();
|
Bundle bundle = new Bundle();
|
||||||
bundle.putString("repoOwner", repoOwner);
|
bundle.putString("repoOwner", repoOwner);
|
||||||
bundle.putString("repoName", repoName);
|
bundle.putString("repoName", repoName);
|
||||||
|
@ -570,30 +586,56 @@ public class IssueDetailActivity extends BaseActivity implements LabelsListAdapt
|
||||||
if(issue.getIssue().getPullRequest().isMerged()) { // merged
|
if(issue.getIssue().getPullRequest().isMerged()) { // merged
|
||||||
|
|
||||||
viewBinding.issuePrState.setImageResource(R.drawable.ic_pull_request);
|
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
|
else if(!issue.getIssue().getPullRequest().isMerged() && issue.getIssue().getState().equals("closed")) { // closed
|
||||||
|
|
||||||
viewBinding.issuePrState.setImageResource(R.drawable.ic_pull_request);
|
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
|
else { // open
|
||||||
|
|
||||||
viewBinding.issuePrState.setImageResource(R.drawable.ic_pull_request);
|
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
|
else if(issue.getIssue().getState().equals("closed")) { // issue closed
|
||||||
loadingFinishedPr = true;
|
loadingFinishedPr = true;
|
||||||
updateMenuState();
|
updateMenuState();
|
||||||
viewBinding.issuePrState.setImageResource(R.drawable.ic_issue);
|
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 {
|
else {
|
||||||
loadingFinishedPr = true;
|
loadingFinishedPr = true;
|
||||||
updateMenuState();
|
updateMenuState();
|
||||||
viewBinding.issuePrState.setImageResource(R.drawable.ic_issue);
|
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);
|
TinyDB tinyDb = TinyDB.getInstance(appCtx);
|
||||||
|
|
|
@ -203,7 +203,7 @@ public class MainActivity extends BaseActivity implements NavigationView.OnNavig
|
||||||
|
|
||||||
if(!userAvatarNav.equals("")) {
|
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()
|
PicassoService.getInstance(ctx).get().load(userAvatarNav).placeholder(R.drawable.loader_animated).transform(new RoundedTransformation(avatarRadius, 0)).resize(160, 160).centerCrop()
|
||||||
.into(userAvatar);
|
.into(userAvatar);
|
||||||
|
|
|
@ -3,7 +3,11 @@ package org.mian.gitnex.activities;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.graphics.Typeface;
|
import android.graphics.Typeface;
|
||||||
import android.os.Bundle;
|
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 android.widget.TextView;
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.appcompat.widget.Toolbar;
|
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.gitnex.tea4j.v2.models.OrganizationPermissions;
|
||||||
import org.mian.gitnex.R;
|
import org.mian.gitnex.R;
|
||||||
import org.mian.gitnex.clients.RetrofitClient;
|
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.helpers.AppUtil;
|
||||||
import org.mian.gitnex.structs.BottomSheetListener;
|
import org.mian.gitnex.structs.BottomSheetListener;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
@ -225,22 +234,22 @@ public class OrganizationDetailActivity extends BaseActivity implements BottomSh
|
||||||
return OrganizationInfoFragment.newInstance(orgName);
|
return OrganizationInfoFragment.newInstance(orgName);
|
||||||
case 1: // repos
|
case 1: // repos
|
||||||
|
|
||||||
return RepositoriesByOrgFragment.newInstance(orgName);
|
return OrganizationRepositoriesFragment.newInstance(orgName);
|
||||||
case 2: // labels
|
case 2: // labels
|
||||||
|
|
||||||
return OrganizationLabelsFragment.newInstance(orgName);
|
return OrganizationLabelsFragment.newInstance(orgName);
|
||||||
case 3: // teams / members
|
case 3: // teams / members
|
||||||
|
|
||||||
if(isMember) {
|
if(isMember) {
|
||||||
return TeamsByOrgFragment.newInstance(orgName, permissions);
|
return OrganizationTeamsFragment.newInstance(orgName, permissions);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return MembersByOrgFragment.newInstance(orgName);
|
return OrganizationMembersFragment.newInstance(orgName);
|
||||||
}
|
}
|
||||||
case 4: // members
|
case 4: // members
|
||||||
|
|
||||||
if(isMember) {
|
if(isMember) {
|
||||||
return MembersByOrgFragment.newInstance(orgName);
|
return OrganizationMembersFragment.newInstance(orgName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return fragment;
|
return fragment;
|
||||||
|
|
|
@ -10,16 +10,10 @@ import android.view.MenuInflater;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.inputmethod.EditorInfo;
|
import android.view.inputmethod.EditorInfo;
|
||||||
import android.widget.ImageView;
|
|
||||||
import android.widget.ProgressBar;
|
|
||||||
import android.widget.TextView;
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.appcompat.widget.SearchView;
|
import androidx.appcompat.widget.SearchView;
|
||||||
import androidx.appcompat.widget.Toolbar;
|
import androidx.appcompat.widget.Toolbar;
|
||||||
import androidx.recyclerview.widget.DividerItemDecoration;
|
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
|
||||||
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
|
|
||||||
import org.gitnex.tea4j.v2.models.Repository;
|
import org.gitnex.tea4j.v2.models.Repository;
|
||||||
import org.mian.gitnex.R;
|
import org.mian.gitnex.R;
|
||||||
import org.mian.gitnex.adapters.RepoForksAdapter;
|
import org.mian.gitnex.adapters.RepoForksAdapter;
|
||||||
|
@ -39,16 +33,13 @@ import retrofit2.Response;
|
||||||
|
|
||||||
public class RepoForksActivity extends BaseActivity {
|
public class RepoForksActivity extends BaseActivity {
|
||||||
|
|
||||||
|
private ActivityRepoForksBinding activityRepoForksBinding;
|
||||||
private final String TAG = "RepositoryForks";
|
private final String TAG = "RepositoryForks";
|
||||||
private TextView noData;
|
|
||||||
private ProgressBar progressBar;
|
|
||||||
private int resultLimit;
|
private int resultLimit;
|
||||||
private int pageSize = 1;
|
private int pageSize = 1;
|
||||||
|
|
||||||
private RecyclerView recyclerView;
|
|
||||||
private List<Repository> forksList;
|
private List<Repository> forksList;
|
||||||
private RepoForksAdapter adapter;
|
private RepoForksAdapter adapter;
|
||||||
private ProgressBar progressLoadMore;
|
|
||||||
|
|
||||||
private RepositoryContext repository;
|
private RepositoryContext repository;
|
||||||
|
|
||||||
|
@ -58,7 +49,7 @@ public class RepoForksActivity extends BaseActivity {
|
||||||
|
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
ActivityRepoForksBinding activityRepoForksBinding = ActivityRepoForksBinding.inflate(getLayoutInflater());
|
activityRepoForksBinding = ActivityRepoForksBinding.inflate(getLayoutInflater());
|
||||||
setContentView(activityRepoForksBinding.getRoot());
|
setContentView(activityRepoForksBinding.getRoot());
|
||||||
|
|
||||||
Toolbar toolbar = activityRepoForksBinding.toolbar;
|
Toolbar toolbar = activityRepoForksBinding.toolbar;
|
||||||
|
@ -70,32 +61,21 @@ public class RepoForksActivity extends BaseActivity {
|
||||||
|
|
||||||
activityRepoForksBinding.toolbarTitle.setText(ctx.getResources().getString(R.string.infoTabRepoForksCount));
|
activityRepoForksBinding.toolbarTitle.setText(ctx.getResources().getString(R.string.infoTabRepoForksCount));
|
||||||
|
|
||||||
ImageView closeActivity = activityRepoForksBinding.close;
|
activityRepoForksBinding.close.setOnClickListener(v -> finish());
|
||||||
noData = activityRepoForksBinding.noData;
|
|
||||||
progressLoadMore = activityRepoForksBinding.progressLoadMore;
|
|
||||||
progressBar = activityRepoForksBinding.progressBar;
|
|
||||||
SwipeRefreshLayout swipeRefresh = activityRepoForksBinding.pullToRefresh;
|
|
||||||
|
|
||||||
closeActivity.setOnClickListener(v -> finish());
|
|
||||||
|
|
||||||
resultLimit = Constants.getCurrentResultLimit(ctx);
|
resultLimit = Constants.getCurrentResultLimit(ctx);
|
||||||
|
|
||||||
recyclerView = activityRepoForksBinding.recyclerView;
|
|
||||||
forksList = new ArrayList<>();
|
forksList = new ArrayList<>();
|
||||||
|
|
||||||
recyclerView.addItemDecoration(new DividerItemDecoration(recyclerView.getContext(), DividerItemDecoration.VERTICAL));
|
activityRepoForksBinding.pullToRefresh.setOnRefreshListener(() -> new Handler(Looper.getMainLooper()).postDelayed(() -> {
|
||||||
|
|
||||||
swipeRefresh.setOnRefreshListener(() -> new Handler(Looper.getMainLooper()).postDelayed(() -> {
|
|
||||||
|
|
||||||
pageSize = 1;
|
pageSize = 1;
|
||||||
swipeRefresh.setRefreshing(false);
|
activityRepoForksBinding.pullToRefresh.setRefreshing(false);
|
||||||
loadInitial(repoOwner, repoName, pageSize, resultLimit);
|
loadInitial(repoOwner, repoName, pageSize, resultLimit);
|
||||||
adapter.notifyDataChanged();
|
adapter.notifyDataChanged();
|
||||||
|
|
||||||
}, 200));
|
}, 200));
|
||||||
|
|
||||||
adapter = new RepoForksAdapter(ctx, forksList);
|
adapter = new RepoForksAdapter(ctx, forksList);
|
||||||
adapter.setLoadMoreListener(() -> recyclerView.post(() -> {
|
adapter.setLoadMoreListener(() -> activityRepoForksBinding.recyclerView.post(() -> {
|
||||||
|
|
||||||
if(forksList.size() == resultLimit || pageSize == resultLimit) {
|
if(forksList.size() == resultLimit || pageSize == resultLimit) {
|
||||||
|
|
||||||
|
@ -104,9 +84,9 @@ public class RepoForksActivity extends BaseActivity {
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
|
|
||||||
recyclerView.setHasFixedSize(true);
|
activityRepoForksBinding.recyclerView.setHasFixedSize(true);
|
||||||
recyclerView.setLayoutManager(new LinearLayoutManager(ctx));
|
activityRepoForksBinding.recyclerView.setLayoutManager(new LinearLayoutManager(ctx));
|
||||||
recyclerView.setAdapter(adapter);
|
activityRepoForksBinding.recyclerView.setAdapter(adapter);
|
||||||
|
|
||||||
loadInitial(repoOwner, repoName, pageSize, resultLimit);
|
loadInitial(repoOwner, repoName, pageSize, resultLimit);
|
||||||
}
|
}
|
||||||
|
@ -128,15 +108,15 @@ public class RepoForksActivity extends BaseActivity {
|
||||||
forksList.clear();
|
forksList.clear();
|
||||||
forksList.addAll(response.body());
|
forksList.addAll(response.body());
|
||||||
adapter.notifyDataChanged();
|
adapter.notifyDataChanged();
|
||||||
noData.setVisibility(View.GONE);
|
activityRepoForksBinding.noData.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
forksList.clear();
|
forksList.clear();
|
||||||
adapter.notifyDataChanged();
|
adapter.notifyDataChanged();
|
||||||
noData.setVisibility(View.VISIBLE);
|
activityRepoForksBinding.noData.setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
progressBar.setVisibility(View.GONE);
|
activityRepoForksBinding.progressBar.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Log.e(TAG, String.valueOf(response.code()));
|
Log.e(TAG, String.valueOf(response.code()));
|
||||||
|
@ -148,12 +128,11 @@ public class RepoForksActivity extends BaseActivity {
|
||||||
Log.e(TAG, t.toString());
|
Log.e(TAG, t.toString());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void loadMore(String repoOwner, String repoName, int page, int resultLimit) {
|
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);
|
Call<List<Repository>> call = RetrofitClient.getApiInterface(ctx).listForks(repoOwner, repoName, page, resultLimit);
|
||||||
|
|
||||||
|
@ -179,7 +158,7 @@ public class RepoForksActivity extends BaseActivity {
|
||||||
}
|
}
|
||||||
|
|
||||||
adapter.notifyDataChanged();
|
adapter.notifyDataChanged();
|
||||||
progressLoadMore.setVisibility(View.GONE);
|
activityRepoForksBinding.progressLoadMore.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Log.e(TAG, String.valueOf(response.code()));
|
Log.e(TAG, String.valueOf(response.code()));
|
||||||
|
|
|
@ -38,13 +38,8 @@ public class RepositorySettingsActivity extends BaseActivity {
|
||||||
private CustomRepositoryTransferDialogBinding transferRepoBinding;
|
private CustomRepositoryTransferDialogBinding transferRepoBinding;
|
||||||
|
|
||||||
private AlertDialog dialogRepo;
|
private AlertDialog dialogRepo;
|
||||||
//private AlertDialog dialogRepoDelete;
|
|
||||||
|
|
||||||
private MaterialAlertDialogBuilder materialAlertDialogBuilder;
|
private MaterialAlertDialogBuilder materialAlertDialogBuilder;
|
||||||
//private Dialog dialogProp;
|
|
||||||
|
|
||||||
//private Dialog dialogDeleteRepository;
|
|
||||||
//private Dialog dialogTransferRepository;
|
|
||||||
private View.OnClickListener onClickListener;
|
private View.OnClickListener onClickListener;
|
||||||
|
|
||||||
private RepositoryContext repository;
|
private RepositoryContext repository;
|
||||||
|
@ -75,20 +70,11 @@ public class RepositorySettingsActivity extends BaseActivity {
|
||||||
|
|
||||||
private void showTransferRepository() {
|
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));
|
transferRepoBinding = CustomRepositoryTransferDialogBinding.inflate(LayoutInflater.from(ctx));
|
||||||
|
|
||||||
View view = transferRepoBinding.getRoot();
|
View view = transferRepoBinding.getRoot();
|
||||||
materialAlertDialogBuilder.setView(view);
|
materialAlertDialogBuilder.setView(view);
|
||||||
|
|
||||||
//transferRepoBinding.cancel.setOnClickListener(editProperties -> dialogRepo.dismiss());
|
|
||||||
|
|
||||||
transferRepoBinding.transfer.setOnClickListener(deleteRepo -> {
|
transferRepoBinding.transfer.setOnClickListener(deleteRepo -> {
|
||||||
|
|
||||||
String newOwner = String.valueOf(transferRepoBinding.ownerNameForTransfer.getText());
|
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());
|
Call<Repository> transferCall = RetrofitClient.getApiInterface(ctx).repoTransfer(repositoryTransfer, repository.getOwner(), repository.getName());
|
||||||
|
|
||||||
transferCall.enqueue(new Callback<Repository>() {
|
transferCall.enqueue(new Callback<>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(@NonNull Call<Repository> call, @NonNull retrofit2.Response<Repository> response) {
|
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.transfer.setVisibility(View.GONE);
|
||||||
transferRepoBinding.processingRequest.setVisibility(View.VISIBLE);
|
transferRepoBinding.processingRequest.setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
if(response.code() == 202) {
|
if(response.code() == 202 || response.code() == 201) {
|
||||||
|
|
||||||
dialogRepo.dismiss();
|
dialogRepo.dismiss();
|
||||||
Toasty.success(ctx, getString(R.string.repoTransferSuccess));
|
Toasty.success(ctx, getString(R.string.repoTransferSuccess));
|
||||||
|
|
||||||
finish();
|
|
||||||
Objects.requireNonNull(BaseApi.getInstance(ctx, RepositoriesApi.class)).deleteRepository(repository.getRepositoryId());
|
Objects.requireNonNull(BaseApi.getInstance(ctx, RepositoriesApi.class)).deleteRepository(repository.getRepositoryId());
|
||||||
Intent intent = new Intent(RepositorySettingsActivity.this, MainActivity.class);
|
Intent intent = new Intent(RepositorySettingsActivity.this, MainActivity.class);
|
||||||
RepositorySettingsActivity.this.startActivity(intent);
|
RepositorySettingsActivity.this.startActivity(intent);
|
||||||
|
finish();
|
||||||
}
|
}
|
||||||
else if(response.code() == 404) {
|
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());
|
Call<Void> deleteCall = RetrofitClient.getApiInterface(ctx).repoDelete(repository.getOwner(), repository.getName());
|
||||||
|
|
||||||
deleteCall.enqueue(new Callback<Void>() {
|
deleteCall.enqueue(new Callback<>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(@NonNull Call<Void> call, @NonNull retrofit2.Response<Void> response) {
|
public void onResponse(@NonNull Call<Void> call, @NonNull retrofit2.Response<Void> response) {
|
||||||
|
@ -200,10 +186,10 @@ public class RepositorySettingsActivity extends BaseActivity {
|
||||||
dialogRepo.dismiss();
|
dialogRepo.dismiss();
|
||||||
Toasty.success(ctx, getString(R.string.repoDeletionSuccess));
|
Toasty.success(ctx, getString(R.string.repoDeletionSuccess));
|
||||||
|
|
||||||
finish();
|
|
||||||
Objects.requireNonNull(BaseApi.getInstance(ctx, RepositoriesApi.class)).deleteRepository(repository.getRepositoryId());
|
Objects.requireNonNull(BaseApi.getInstance(ctx, RepositoriesApi.class)).deleteRepository(repository.getRepositoryId());
|
||||||
Intent intent = new Intent(RepositorySettingsActivity.this, MainActivity.class);
|
Intent intent = new Intent(RepositorySettingsActivity.this, MainActivity.class);
|
||||||
RepositorySettingsActivity.this.startActivity(intent);
|
RepositorySettingsActivity.this.startActivity(intent);
|
||||||
|
finish();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
||||||
|
@ -300,7 +286,7 @@ public class RepositorySettingsActivity extends BaseActivity {
|
||||||
|
|
||||||
Call<Repository> propsCall = RetrofitClient.getApiInterface(ctx).repoEdit(repository.getOwner(), repository.getName(), repoProps);
|
Call<Repository> propsCall = RetrofitClient.getApiInterface(ctx).repoEdit(repository.getOwner(), repository.getName(), repoProps);
|
||||||
|
|
||||||
propsCall.enqueue(new Callback<Repository>() {
|
propsCall.enqueue(new Callback<>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(@NonNull Call<Repository> call, @NonNull retrofit2.Response<Repository> response) {
|
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;
|
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) {
|
public AdminCronTasksAdapter(List<Cron> tasksListMain) {
|
||||||
this.tasksList = 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) {
|
private static void runCronTask(final Context ctx, final String taskName) {
|
||||||
|
|
||||||
Call<Void> call = RetrofitClient.getApiInterface(ctx).adminCronRun(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
|
@Override
|
||||||
public int getItemCount() {
|
public int getItemCount() {
|
||||||
return tasksList.size();
|
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("")) {
|
if(!currentItem.getFullName().equals("")) {
|
||||||
|
|
||||||
viewHolder.collaboratorName.setText(Html.fromHtml(currentItem.getFullName()));
|
viewHolder.collaboratorName.setText(Html.fromHtml(currentItem.getFullName()));
|
||||||
|
viewHolder.userName.setText(context.getResources().getString(R.string.usernameWithAt, currentItem.getLogin()));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
||||||
viewHolder.collaboratorName.setText(currentItem.getLogin());
|
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 ImageView collaboratorAvatar;
|
||||||
private final TextView collaboratorName;
|
private final TextView collaboratorName;
|
||||||
|
private final TextView userName;
|
||||||
private String userLoginId;
|
private String userLoginId;
|
||||||
|
|
||||||
ViewHolder(View v) {
|
ViewHolder(View v) {
|
||||||
|
|
||||||
collaboratorAvatar = v.findViewById(R.id.collaboratorAvatar);
|
collaboratorAvatar = v.findViewById(R.id.collaboratorAvatar);
|
||||||
collaboratorName = v.findViewById(R.id.collaboratorName);
|
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 intent = new Intent(context, ProfileActivity.class);
|
||||||
intent.putExtra("username", userLoginId);
|
intent.putExtra("username", userLoginId);
|
||||||
context.startActivity(intent);
|
context.startActivity(intent);
|
||||||
});
|
});
|
||||||
|
|
||||||
collaboratorAvatar.setOnLongClickListener(loginId -> {
|
v.setOnLongClickListener(loginId -> {
|
||||||
AppUtil.copyToClipboard(context, userLoginId, context.getString(R.string.copyLoginIdToClipBoard, userLoginId));
|
AppUtil.copyToClipboard(context, userLoginId, context.getString(R.string.copyLoginIdToClipBoard, userLoginId));
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
|
|
|
@ -13,10 +13,14 @@ import androidx.annotation.NonNull;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
import com.amulyakhare.textdrawable.TextDrawable;
|
import com.amulyakhare.textdrawable.TextDrawable;
|
||||||
import com.amulyakhare.textdrawable.util.ColorGenerator;
|
import com.amulyakhare.textdrawable.util.ColorGenerator;
|
||||||
|
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
|
||||||
import org.mian.gitnex.R;
|
import org.mian.gitnex.R;
|
||||||
import org.mian.gitnex.activities.RepoDetailActivity;
|
import org.mian.gitnex.activities.RepoDetailActivity;
|
||||||
|
import org.mian.gitnex.database.api.BaseApi;
|
||||||
|
import org.mian.gitnex.database.api.RepositoriesApi;
|
||||||
import org.mian.gitnex.database.models.Repository;
|
import org.mian.gitnex.database.models.Repository;
|
||||||
import org.mian.gitnex.helpers.AppUtil;
|
import org.mian.gitnex.helpers.AppUtil;
|
||||||
|
import org.mian.gitnex.helpers.Toasty;
|
||||||
import org.mian.gitnex.helpers.contexts.RepositoryContext;
|
import org.mian.gitnex.helpers.contexts.RepositoryContext;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -27,8 +31,65 @@ import java.util.List;
|
||||||
public class MostVisitedReposAdapter extends RecyclerView.Adapter<MostVisitedReposAdapter.MostVisitedViewHolder> {
|
public class MostVisitedReposAdapter extends RecyclerView.Adapter<MostVisitedReposAdapter.MostVisitedViewHolder> {
|
||||||
|
|
||||||
private List<Repository> mostVisitedReposList;
|
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;
|
this.mostVisitedReposList = reposListMain;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -73,32 +134,4 @@ public class MostVisitedReposAdapter extends RecyclerView.Adapter<MostVisitedRep
|
||||||
notifyDataChanged();
|
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
|
* @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 List<User> usersSearchList;
|
||||||
private final Context context;
|
private final Context context;
|
||||||
private final int teamId;
|
private final int teamId;
|
||||||
private final String orgName;
|
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.context = ctx;
|
||||||
this.usersSearchList = dataList;
|
this.usersSearchList = dataList;
|
||||||
this.teamId = teamId;
|
this.teamId = teamId;
|
||||||
|
@ -46,13 +46,13 @@ public class UserSearchForTeamMemberAdapter extends RecyclerView.Adapter<UserSea
|
||||||
|
|
||||||
@NonNull
|
@NonNull
|
||||||
@Override
|
@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);
|
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
|
@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);
|
User currentItem = usersSearchList.get(position);
|
||||||
holder.userInfo = currentItem;
|
holder.userInfo = currentItem;
|
|
@ -18,12 +18,12 @@ import java.util.List;
|
||||||
* @author opyale
|
* @author opyale
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class TeamMembersByOrgPreviewAdapter extends RecyclerView.Adapter<TeamMembersByOrgPreviewAdapter.ViewHolder> {
|
public class OrganizationTeamMembersPreviewAdapter extends RecyclerView.Adapter<OrganizationTeamMembersPreviewAdapter.ViewHolder> {
|
||||||
|
|
||||||
private final Context context;
|
private final Context context;
|
||||||
private final List<User> userData;
|
private final List<User> userData;
|
||||||
|
|
||||||
public TeamMembersByOrgPreviewAdapter(Context context, List<User> userInfo) {
|
public OrganizationTeamMembersPreviewAdapter(Context context, List<User> userInfo) {
|
||||||
this.context = context;
|
this.context = context;
|
||||||
this.userData = userInfo;
|
this.userData = userInfo;
|
||||||
}
|
}
|
||||||
|
@ -31,7 +31,7 @@ public class TeamMembersByOrgPreviewAdapter extends RecyclerView.Adapter<TeamMem
|
||||||
@NonNull
|
@NonNull
|
||||||
@Override
|
@Override
|
||||||
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
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);
|
return new ViewHolder(v);
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,7 +31,7 @@ import retrofit2.Response;
|
||||||
* @author M M Arif
|
* @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 List<Repository> reposList;
|
||||||
private final Context context;
|
private final Context context;
|
||||||
|
@ -40,7 +40,7 @@ public class TeamRepositoriesAdapter extends RecyclerView.Adapter<TeamRepositori
|
||||||
private final String teamName;
|
private final String teamName;
|
||||||
private final List<Repository> reposArr;
|
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.context = ctx;
|
||||||
this.reposList = dataList;
|
this.reposList = dataList;
|
||||||
this.teamId = teamId;
|
this.teamId = teamId;
|
||||||
|
@ -49,15 +49,60 @@ public class TeamRepositoriesAdapter extends RecyclerView.Adapter<TeamRepositori
|
||||||
reposArr = new ArrayList<>();
|
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
|
@NonNull
|
||||||
@Override
|
@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);
|
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
|
@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);
|
Repository currentItem = reposList.get(position);
|
||||||
holder.repoInfo = currentItem;
|
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
|
* @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 List<Team> teamList;
|
||||||
private final Context context;
|
private final Context context;
|
||||||
private final List<Team> teamListFull;
|
private final List<Team> teamListFull;
|
||||||
private final OrganizationPermissions permissions;
|
private final OrganizationPermissions permissions;
|
||||||
private final String orgName;
|
private final String orgName;
|
||||||
private final Filter orgTeamsFilter = new Filter() {
|
|
||||||
|
|
||||||
@Override
|
static class OrgTeamsViewHolder extends RecyclerView.ViewHolder {
|
||||||
protected FilterResults performFiltering(CharSequence constraint) {
|
|
||||||
List<Team> filteredList = new ArrayList<>();
|
|
||||||
|
|
||||||
if(constraint == null || constraint.length() == 0) {
|
private Team team;
|
||||||
filteredList.addAll(teamListFull);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
String filterPattern = constraint.toString().toLowerCase().trim();
|
|
||||||
|
|
||||||
for(Team item : teamListFull) {
|
private OrganizationPermissions permissions;
|
||||||
if(item.getName().toLowerCase().contains(filterPattern) || item.getDescription().toLowerCase().contains(filterPattern)) {
|
private final TextView teamTitle;
|
||||||
filteredList.add(item);
|
private final TextView teamDescription;
|
||||||
}
|
private final LinearLayout membersPreviewFrame;
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
FilterResults results = new FilterResults();
|
private final List<User> userInfos;
|
||||||
results.values = filteredList;
|
private final OrganizationTeamMembersPreviewAdapter adapter;
|
||||||
|
private String orgName;
|
||||||
|
|
||||||
return results;
|
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);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@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.context = ctx;
|
||||||
this.teamList = teamListMain;
|
this.teamList = teamListMain;
|
||||||
this.permissions = permissions;
|
this.permissions = permissions;
|
||||||
|
@ -79,13 +88,13 @@ public class TeamsByOrgAdapter extends RecyclerView.Adapter<TeamsByOrgAdapter.Or
|
||||||
|
|
||||||
@NonNull
|
@NonNull
|
||||||
@Override
|
@Override
|
||||||
public TeamsByOrgAdapter.OrgTeamsViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
public OrganizationTeamsAdapter.OrgTeamsViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||||
View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.list_teams_by_org, parent, false);
|
View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.list_organization_teams, parent, false);
|
||||||
return new TeamsByOrgAdapter.OrgTeamsViewHolder(v);
|
return new OrganizationTeamsAdapter.OrgTeamsViewHolder(v);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onBindViewHolder(@NonNull TeamsByOrgAdapter.OrgTeamsViewHolder holder, int position) {
|
public void onBindViewHolder(@NonNull OrganizationTeamsAdapter.OrgTeamsViewHolder holder, int position) {
|
||||||
|
|
||||||
Team currentItem = teamList.get(position);
|
Team currentItem = teamList.get(position);
|
||||||
|
|
||||||
|
@ -99,7 +108,6 @@ public class TeamsByOrgAdapter extends RecyclerView.Adapter<TeamsByOrgAdapter.Or
|
||||||
holder.adapter.notifyDataSetChanged();
|
holder.adapter.notifyDataSetChanged();
|
||||||
|
|
||||||
RetrofitClient.getApiInterface(context).orgListTeamMembers(currentItem.getId(), null, null).enqueue(new Callback<List<User>>() {
|
RetrofitClient.getApiInterface(context).orgListTeamMembers(currentItem.getId(), null, null).enqueue(new Callback<List<User>>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(@NonNull Call<List<User>> call, @NonNull Response<List<User>> response) {
|
public void onResponse(@NonNull Call<List<User>> call, @NonNull Response<List<User>> response) {
|
||||||
if(response.isSuccessful() && response.body() != null && response.body().size() > 0) {
|
if(response.isSuccessful() && response.body() != null && response.body().size() > 0) {
|
||||||
|
@ -136,43 +144,36 @@ public class TeamsByOrgAdapter extends RecyclerView.Adapter<TeamsByOrgAdapter.Or
|
||||||
return orgTeamsFilter;
|
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;
|
if(constraint == null || constraint.length() == 0) {
|
||||||
private final TextView teamDescription;
|
filteredList.addAll(teamListFull);
|
||||||
private final LinearLayout membersPreviewFrame;
|
}
|
||||||
private final List<User> userInfos;
|
else {
|
||||||
private final TeamMembersByOrgPreviewAdapter adapter;
|
String filterPattern = constraint.toString().toLowerCase().trim();
|
||||||
private Team team;
|
|
||||||
private OrganizationPermissions permissions;
|
|
||||||
private String orgName;
|
|
||||||
|
|
||||||
private OrgTeamsViewHolder(View itemView) {
|
for(Team item : teamListFull) {
|
||||||
super(itemView);
|
if(item.getName().toLowerCase().contains(filterPattern) || item.getDescription().toLowerCase().contains(filterPattern)) {
|
||||||
|
filteredList.add(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
teamTitle = itemView.findViewById(R.id.teamTitle);
|
FilterResults results = new FilterResults();
|
||||||
teamDescription = itemView.findViewById(R.id.teamDescription);
|
results.values = filteredList;
|
||||||
membersPreviewFrame = itemView.findViewById(R.id.membersPreviewFrame);
|
|
||||||
|
|
||||||
RecyclerView membersPreview = itemView.findViewById(R.id.membersPreview);
|
return results;
|
||||||
|
|
||||||
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);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
@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>";
|
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 List<UserAccount> userAccountsList;
|
||||||
private final Context context;
|
private final Context context;
|
||||||
private final Dialog dialog;
|
private final Dialog dialog;
|
||||||
|
private final TinyDB tinyDB;
|
||||||
|
|
||||||
public UserAccountsAdapter(Context ctx, Dialog dialog) {
|
public UserAccountsAdapter(Context ctx, Dialog dialog) {
|
||||||
this.dialog = dialog;
|
this.dialog = dialog;
|
||||||
this.context = ctx;
|
this.context = ctx;
|
||||||
this.userAccountsList = Objects.requireNonNull(BaseApi.getInstance(context, UserAccountsApi.class)).usersAccounts();
|
this.userAccountsList = Objects.requireNonNull(BaseApi.getInstance(context, UserAccountsApi.class)).usersAccounts();
|
||||||
|
this.tinyDB = TinyDB.getInstance(context);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateLayoutByPosition(int position) {
|
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) {
|
public void onBindViewHolder(@NonNull UserAccountsAdapter.UserAccountsViewHolder holder, int position) {
|
||||||
|
|
||||||
UserAccount currentItem = userAccountsList.get(position);
|
UserAccount currentItem = userAccountsList.get(position);
|
||||||
TinyDB tinyDB = TinyDB.getInstance(context);
|
|
||||||
|
|
||||||
String url = UrlBuilder.fromString(currentItem.getInstanceUrl()).withPath("/").toString();
|
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));
|
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()
|
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);
|
.into(holder.repoAvatar);
|
||||||
|
@ -202,18 +203,18 @@ public class UserAccountsAdapter extends RecyclerView.Adapter<UserAccountsAdapte
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(AppUtil.switchToAccount(context, userAccount)) {
|
if(tinyDB.getInt("currentActiveAccountId") != userAccount.getAccountId()) {
|
||||||
|
if(AppUtil.switchToAccount(context, userAccount)) {
|
||||||
|
|
||||||
String url = UrlBuilder.fromString(userAccount.getInstanceUrl()).withPath("/").toString();
|
String url = UrlBuilder.fromString(userAccount.getInstanceUrl()).withPath("/").toString();
|
||||||
|
|
||||||
Toasty.success(context, context.getResources().getString(R.string.switchAccountSuccess, userAccount.getUserName(), url));
|
|
||||||
getNotificationsCount();
|
|
||||||
((Activity) context).recreate();
|
|
||||||
dialog.dismiss();
|
|
||||||
|
|
||||||
|
Toasty.success(context, context.getResources().getString(R.string.switchAccountSuccess, userAccount.getUserName(), url));
|
||||||
|
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();
|
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);
|
.into(holder.userAccountAvatar);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getItemCount() {
|
public int getItemCount() {
|
||||||
|
|
||||||
return userAccountsList.size();
|
return Math.min(userAccountsList.size(), 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void customDialogUserAccountsList() {
|
private void customDialogUserAccountsList() {
|
||||||
|
|
|
@ -7,7 +7,11 @@ import android.text.Html;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
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.gitnex.tea4j.v2.models.User;
|
||||||
import org.mian.gitnex.R;
|
import org.mian.gitnex.R;
|
||||||
import org.mian.gitnex.activities.ProfileActivity;
|
import org.mian.gitnex.activities.ProfileActivity;
|
||||||
|
@ -26,40 +30,34 @@ public class UserGridAdapter extends BaseAdapter implements Filterable {
|
||||||
private final List<User> membersList;
|
private final List<User> membersList;
|
||||||
private final Context context;
|
private final Context context;
|
||||||
private final List<User> membersListFull;
|
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);
|
private String userLoginId;
|
||||||
}
|
|
||||||
else {
|
|
||||||
|
|
||||||
String filterPattern = constraint.toString().toLowerCase().trim();
|
private final ImageView memberAvatar;
|
||||||
|
private final TextView memberName;
|
||||||
|
private final TextView userName;
|
||||||
|
|
||||||
for(User item : membersListFull) {
|
ViewHolder(View v) {
|
||||||
if(item.getFullName().toLowerCase().contains(filterPattern) || item.getLogin().toLowerCase().contains(filterPattern)) {
|
|
||||||
filteredList.add(item);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
FilterResults results = new FilterResults();
|
memberAvatar = v.findViewById(R.id.userAvatarImageView);
|
||||||
results.values = filteredList;
|
memberName = v.findViewById(R.id.userNameTv);
|
||||||
|
userName = v.findViewById(R.id.userName);
|
||||||
|
|
||||||
return results;
|
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;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
}
|
||||||
protected void publishResults(CharSequence constraint, FilterResults results) {
|
|
||||||
|
|
||||||
membersList.clear();
|
|
||||||
membersList.addAll((List) results.values);
|
|
||||||
notifyDataSetChanged();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
public UserGridAdapter(Context ctx, List<User> membersListMain) {
|
public UserGridAdapter(Context ctx, List<User> membersListMain) {
|
||||||
|
|
||||||
|
@ -117,10 +115,12 @@ public class UserGridAdapter extends BaseAdapter implements Filterable {
|
||||||
if(!currentItem.getFullName().equals("")) {
|
if(!currentItem.getFullName().equals("")) {
|
||||||
|
|
||||||
viewHolder.memberName.setText(Html.fromHtml(currentItem.getFullName()));
|
viewHolder.memberName.setText(Html.fromHtml(currentItem.getFullName()));
|
||||||
|
viewHolder.userName.setText(context.getResources().getString(R.string.usernameWithAt, currentItem.getLogin()));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
||||||
viewHolder.memberName.setText(currentItem.getLogin());
|
viewHolder.memberName.setText(currentItem.getLogin());
|
||||||
|
viewHolder.userName.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -129,29 +129,39 @@ public class UserGridAdapter extends BaseAdapter implements Filterable {
|
||||||
return membersFilter;
|
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;
|
if(constraint == null || constraint.length() == 0) {
|
||||||
private final TextView memberName;
|
|
||||||
private String userLoginId;
|
|
||||||
|
|
||||||
ViewHolder(View v) {
|
filteredList.addAll(membersListFull);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
|
||||||
memberAvatar = v.findViewById(R.id.userAvatarImageView);
|
String filterPattern = constraint.toString().toLowerCase().trim();
|
||||||
memberName = v.findViewById(R.id.userNameTv);
|
|
||||||
|
|
||||||
v.setOnClickListener(loginId -> {
|
for(User item : membersListFull) {
|
||||||
Intent intent = new Intent(context, ProfileActivity.class);
|
if(item.getFullName().toLowerCase().contains(filterPattern) || item.getLogin().toLowerCase().contains(filterPattern)) {
|
||||||
intent.putExtra("username", userLoginId);
|
filteredList.add(item);
|
||||||
context.startActivity(intent);
|
}
|
||||||
});
|
}
|
||||||
|
}
|
||||||
|
|
||||||
v.setOnLongClickListener(loginId -> {
|
FilterResults results = new FilterResults();
|
||||||
AppUtil.copyToClipboard(context, userLoginId, context.getString(R.string.copyLoginIdToClipBoard, userLoginId));
|
results.values = filteredList;
|
||||||
return true;
|
|
||||||
});
|
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());
|
int color = generator.getColor(wikiPageMetaData.getTitle());
|
||||||
String firstCharacter = String.valueOf(wikiPageMetaData.getTitle().charAt(0));
|
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);
|
avatar.setImageDrawable(drawable);
|
||||||
|
|
||||||
if(!((RepoDetailActivity) ctx).repository.getPermissions().isPush()) {
|
if(!((RepoDetailActivity) ctx).repository.getPermissions().isPush()) {
|
||||||
|
|
|
@ -3,7 +3,15 @@ package org.mian.gitnex.clients;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import com.google.gson.GsonBuilder;
|
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.CustomApi;
|
||||||
import org.gitnex.tea4j.v2.apis.custom.OTPApi;
|
import org.gitnex.tea4j.v2.apis.custom.OTPApi;
|
||||||
import org.gitnex.tea4j.v2.apis.custom.WebApi;
|
import org.gitnex.tea4j.v2.apis.custom.WebApi;
|
||||||
|
|
|
@ -74,6 +74,10 @@ public class RepositoriesApi extends BaseApi {
|
||||||
executorService.execute(() -> repositoriesDao.updateRepositoryMostVisited(mostVisited, repositoryId));
|
executorService.execute(() -> repositoriesDao.updateRepositoryMostVisited(mostVisited, repositoryId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void resetAllRepositoryMostVisited(int repoAccountId) {
|
||||||
|
executorService.execute(() -> repositoriesDao.resetAllRepositoryMostVisited(repoAccountId));
|
||||||
|
}
|
||||||
|
|
||||||
public LiveData<List<Repository>> fetchAllMostVisited(int repoAccountId) {
|
public LiveData<List<Repository>> fetchAllMostVisited(int repoAccountId) {
|
||||||
return repositoriesDao.fetchAllMostVisited(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")
|
@Query("SELECT * FROM Repositories WHERE mostVisited > 0 AND repoAccountId = :repoAccountId ORDER BY mostVisited DESC LIMIT 50")
|
||||||
LiveData<List<Repository>> fetchAllMostVisited(int repoAccountId);
|
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 int repoAccountId;
|
||||||
private String repositoryOwner;
|
private String repositoryOwner;
|
||||||
private String repositoryName;
|
private String repositoryName;
|
||||||
|
private int mostVisited;
|
||||||
|
|
||||||
private int draftRepositoryId;
|
private int draftRepositoryId;
|
||||||
private int draftAccountId;
|
private int draftAccountId;
|
||||||
|
@ -141,4 +142,12 @@ public class DraftWithRepository {
|
||||||
this.issueType = issueType;
|
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.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.GridView;
|
|
||||||
import android.widget.ProgressBar;
|
|
||||||
import android.widget.TextView;
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
import androidx.lifecycle.ViewModelProvider;
|
import androidx.lifecycle.ViewModelProvider;
|
||||||
|
@ -22,12 +19,8 @@ import org.mian.gitnex.viewmodels.CollaboratorsViewModel;
|
||||||
public class CollaboratorsFragment extends Fragment {
|
public class CollaboratorsFragment extends Fragment {
|
||||||
|
|
||||||
public static boolean refreshCollaborators = false;
|
public static boolean refreshCollaborators = false;
|
||||||
|
private FragmentCollaboratorsBinding fragmentCollaboratorsBinding;
|
||||||
private ProgressBar mProgressBar;
|
|
||||||
private CollaboratorsAdapter adapter;
|
private CollaboratorsAdapter adapter;
|
||||||
private GridView mGridView;
|
|
||||||
private TextView noDataCollaborators;
|
|
||||||
|
|
||||||
private RepositoryContext repository;
|
private RepositoryContext repository;
|
||||||
|
|
||||||
public CollaboratorsFragment() {
|
public CollaboratorsFragment() {
|
||||||
|
@ -48,11 +41,7 @@ public class CollaboratorsFragment extends Fragment {
|
||||||
@Override
|
@Override
|
||||||
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||||
|
|
||||||
FragmentCollaboratorsBinding fragmentCollaboratorsBinding = FragmentCollaboratorsBinding.inflate(inflater, container, false);
|
fragmentCollaboratorsBinding = FragmentCollaboratorsBinding.inflate(inflater, container, false);
|
||||||
|
|
||||||
noDataCollaborators = fragmentCollaboratorsBinding.noDataCollaborators;
|
|
||||||
mProgressBar = fragmentCollaboratorsBinding.progressBar;
|
|
||||||
mGridView = fragmentCollaboratorsBinding.gridView;
|
|
||||||
|
|
||||||
fetchDataAsync(repository.getOwner(), repository.getName());
|
fetchDataAsync(repository.getOwner(), repository.getName());
|
||||||
return fragmentCollaboratorsBinding.getRoot();
|
return fragmentCollaboratorsBinding.getRoot();
|
||||||
|
@ -66,15 +55,15 @@ public class CollaboratorsFragment extends Fragment {
|
||||||
collaboratorsModel.getCollaboratorsList(owner, repo, getContext()).observe(getViewLifecycleOwner(), collaboratorsListMain -> {
|
collaboratorsModel.getCollaboratorsList(owner, repo, getContext()).observe(getViewLifecycleOwner(), collaboratorsListMain -> {
|
||||||
adapter = new CollaboratorsAdapter(getContext(), collaboratorsListMain);
|
adapter = new CollaboratorsAdapter(getContext(), collaboratorsListMain);
|
||||||
if(adapter.getCount() > 0) {
|
if(adapter.getCount() > 0) {
|
||||||
mGridView.setAdapter(adapter);
|
fragmentCollaboratorsBinding.gridView.setAdapter(adapter);
|
||||||
noDataCollaborators.setVisibility(View.GONE);
|
fragmentCollaboratorsBinding.noDataCollaborators.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
adapter.notifyDataSetChanged();
|
adapter.notifyDataSetChanged();
|
||||||
mGridView.setAdapter(adapter);
|
fragmentCollaboratorsBinding.gridView.setAdapter(adapter);
|
||||||
noDataCollaborators.setVisibility(View.VISIBLE);
|
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.Bundle;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.os.Looper;
|
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.view.inputmethod.EditorInfo;
|
||||||
import android.widget.TextView;
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.appcompat.widget.SearchView;
|
import androidx.appcompat.widget.SearchView;
|
||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
import androidx.recyclerview.widget.DividerItemDecoration;
|
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
|
||||||
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
|
|
||||||
import org.mian.gitnex.R;
|
import org.mian.gitnex.R;
|
||||||
import org.mian.gitnex.activities.MainActivity;
|
import org.mian.gitnex.activities.MainActivity;
|
||||||
import org.mian.gitnex.adapters.DraftsAdapter;
|
import org.mian.gitnex.adapters.DraftsAdapter;
|
||||||
|
@ -25,6 +26,7 @@ import org.mian.gitnex.helpers.TinyDB;
|
||||||
import org.mian.gitnex.helpers.Toasty;
|
import org.mian.gitnex.helpers.Toasty;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author M M Arif
|
* @author M M Arif
|
||||||
|
@ -32,19 +34,17 @@ import java.util.List;
|
||||||
|
|
||||||
public class DraftsFragment extends Fragment {
|
public class DraftsFragment extends Fragment {
|
||||||
|
|
||||||
|
private FragmentDraftsBinding fragmentDraftsBinding;
|
||||||
private Context ctx;
|
private Context ctx;
|
||||||
private DraftsAdapter adapter;
|
private DraftsAdapter adapter;
|
||||||
private RecyclerView mRecyclerView;
|
|
||||||
private DraftsApi draftsApi;
|
private DraftsApi draftsApi;
|
||||||
private TextView noData;
|
|
||||||
private List<DraftWithRepository> draftsList_;
|
private List<DraftWithRepository> draftsList_;
|
||||||
private int currentActiveAccountId;
|
private int currentActiveAccountId;
|
||||||
private SwipeRefreshLayout swipeRefresh;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
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();
|
ctx = getContext();
|
||||||
setHasOptionsMenu(true);
|
setHasOptionsMenu(true);
|
||||||
|
@ -56,19 +56,12 @@ public class DraftsFragment extends Fragment {
|
||||||
draftsList_ = new ArrayList<>();
|
draftsList_ = new ArrayList<>();
|
||||||
draftsApi = BaseApi.getInstance(ctx, DraftsApi.class);
|
draftsApi = BaseApi.getInstance(ctx, DraftsApi.class);
|
||||||
|
|
||||||
noData = fragmentDraftsBinding.noData;
|
fragmentDraftsBinding.recyclerView.setHasFixedSize(true);
|
||||||
mRecyclerView = fragmentDraftsBinding.recyclerView;
|
fragmentDraftsBinding.recyclerView.setLayoutManager(new LinearLayoutManager(ctx));
|
||||||
swipeRefresh = fragmentDraftsBinding.pullToRefresh;
|
|
||||||
|
|
||||||
mRecyclerView.setHasFixedSize(true);
|
|
||||||
mRecyclerView.setLayoutManager(new LinearLayoutManager(ctx));
|
|
||||||
|
|
||||||
DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(mRecyclerView.getContext(), DividerItemDecoration.VERTICAL);
|
|
||||||
mRecyclerView.addItemDecoration(dividerItemDecoration);
|
|
||||||
|
|
||||||
adapter = new DraftsAdapter(getContext(), getChildFragmentManager(), draftsList_);
|
adapter = new DraftsAdapter(getContext(), getChildFragmentManager(), draftsList_);
|
||||||
currentActiveAccountId = tinyDb.getInt("currentActiveAccountId");
|
currentActiveAccountId = tinyDb.getInt("currentActiveAccountId");
|
||||||
swipeRefresh.setOnRefreshListener(() -> new Handler(Looper.getMainLooper()).postDelayed(() -> {
|
fragmentDraftsBinding.pullToRefresh.setOnRefreshListener(() -> new Handler(Looper.getMainLooper()).postDelayed(() -> {
|
||||||
|
|
||||||
draftsList_.clear();
|
draftsList_.clear();
|
||||||
fetchDataAsync(currentActiveAccountId);
|
fetchDataAsync(currentActiveAccountId);
|
||||||
|
@ -84,19 +77,19 @@ public class DraftsFragment extends Fragment {
|
||||||
|
|
||||||
draftsApi.getDrafts(accountId).observe(getViewLifecycleOwner(), drafts -> {
|
draftsApi.getDrafts(accountId).observe(getViewLifecycleOwner(), drafts -> {
|
||||||
|
|
||||||
swipeRefresh.setRefreshing(false);
|
fragmentDraftsBinding.pullToRefresh.setRefreshing(false);
|
||||||
assert drafts != null;
|
assert drafts != null;
|
||||||
if(drafts.size() > 0) {
|
if(drafts.size() > 0) {
|
||||||
|
|
||||||
draftsList_.clear();
|
draftsList_.clear();
|
||||||
noData.setVisibility(View.GONE);
|
fragmentDraftsBinding.noData.setVisibility(View.GONE);
|
||||||
draftsList_.addAll(drafts);
|
draftsList_.addAll(drafts);
|
||||||
adapter.notifyDataChanged();
|
adapter.notifyDataChanged();
|
||||||
mRecyclerView.setAdapter(adapter);
|
fragmentDraftsBinding.recyclerView.setAdapter(adapter);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
||||||
noData.setVisibility(View.VISIBLE);
|
fragmentDraftsBinding.noData.setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -112,7 +105,7 @@ public class DraftsFragment extends Fragment {
|
||||||
|
|
||||||
if(draftsList_.size() > 0) {
|
if(draftsList_.size() > 0) {
|
||||||
|
|
||||||
BaseApi.getInstance(ctx, DraftsApi.class).deleteAllDrafts(accountId);
|
Objects.requireNonNull(BaseApi.getInstance(ctx, DraftsApi.class)).deleteAllDrafts(accountId);
|
||||||
draftsList_.clear();
|
draftsList_.clear();
|
||||||
adapter.notifyDataChanged();
|
adapter.notifyDataChanged();
|
||||||
Toasty.success(ctx, getResources().getString(R.string.draftsDeleteSuccess));
|
Toasty.success(ctx, getResources().getString(R.string.draftsDeleteSuccess));
|
||||||
|
|
|
@ -8,7 +8,6 @@ import android.view.inputmethod.EditorInfo;
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
import androidx.lifecycle.ViewModelProvider;
|
import androidx.lifecycle.ViewModelProvider;
|
||||||
import androidx.recyclerview.widget.DividerItemDecoration;
|
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
import org.mian.gitnex.R;
|
import org.mian.gitnex.R;
|
||||||
import org.mian.gitnex.adapters.ExploreIssuesAdapter;
|
import org.mian.gitnex.adapters.ExploreIssuesAdapter;
|
||||||
|
@ -40,9 +39,7 @@ public class ExploreIssuesFragment extends Fragment {
|
||||||
viewBinding.progressBar.setVisibility(View.VISIBLE);
|
viewBinding.progressBar.setVisibility(View.VISIBLE);
|
||||||
}, 50));
|
}, 50));
|
||||||
|
|
||||||
DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(requireActivity(), DividerItemDecoration.VERTICAL);
|
|
||||||
viewBinding.recyclerViewSearchIssues.setHasFixedSize(true);
|
viewBinding.recyclerViewSearchIssues.setHasFixedSize(true);
|
||||||
viewBinding.recyclerViewSearchIssues.addItemDecoration(dividerItemDecoration);
|
|
||||||
viewBinding.recyclerViewSearchIssues.setLayoutManager(new LinearLayoutManager(requireActivity()));
|
viewBinding.recyclerViewSearchIssues.setLayoutManager(new LinearLayoutManager(requireActivity()));
|
||||||
|
|
||||||
fetchDataAsync("");
|
fetchDataAsync("");
|
||||||
|
|
|
@ -11,7 +11,6 @@ import android.view.ViewGroup;
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
import androidx.recyclerview.widget.DividerItemDecoration;
|
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
import org.gitnex.tea4j.v2.models.Organization;
|
import org.gitnex.tea4j.v2.models.Organization;
|
||||||
import org.mian.gitnex.R;
|
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.setHasFixedSize(true);
|
||||||
fragmentPublicOrgBinding.recyclerView.addItemDecoration(dividerItemDecoration);
|
|
||||||
fragmentPublicOrgBinding.recyclerView.setLayoutManager(new LinearLayoutManager(context));
|
fragmentPublicOrgBinding.recyclerView.setLayoutManager(new LinearLayoutManager(context));
|
||||||
fragmentPublicOrgBinding.recyclerView.setAdapter(adapter);
|
fragmentPublicOrgBinding.recyclerView.setAdapter(adapter);
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,6 @@ import android.view.*;
|
||||||
import android.view.inputmethod.EditorInfo;
|
import android.view.inputmethod.EditorInfo;
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
import androidx.recyclerview.widget.DividerItemDecoration;
|
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
|
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
|
||||||
import org.gitnex.tea4j.v2.models.Repository;
|
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.setHasFixedSize(true);
|
||||||
viewBinding.recyclerViewReposSearch.addItemDecoration(dividerItemDecoration);
|
|
||||||
viewBinding.recyclerViewReposSearch.setLayoutManager(new LinearLayoutManager(context));
|
viewBinding.recyclerViewReposSearch.setLayoutManager(new LinearLayoutManager(context));
|
||||||
viewBinding.recyclerViewReposSearch.setAdapter(adapter);
|
viewBinding.recyclerViewReposSearch.setAdapter(adapter);
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,6 @@ import android.view.*;
|
||||||
import android.view.inputmethod.EditorInfo;
|
import android.view.inputmethod.EditorInfo;
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
import androidx.recyclerview.widget.DividerItemDecoration;
|
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
import org.gitnex.tea4j.v2.models.InlineResponse2001;
|
import org.gitnex.tea4j.v2.models.InlineResponse2001;
|
||||||
import org.gitnex.tea4j.v2.models.User;
|
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.setHasFixedSize(true);
|
||||||
viewBinding.recyclerViewExploreUsers.addItemDecoration(dividerItemDecoration);
|
|
||||||
viewBinding.recyclerViewExploreUsers.setLayoutManager(new LinearLayoutManager(context));
|
viewBinding.recyclerViewExploreUsers.setLayoutManager(new LinearLayoutManager(context));
|
||||||
viewBinding.recyclerViewExploreUsers.setAdapter(adapter);
|
viewBinding.recyclerViewExploreUsers.setAdapter(adapter);
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,6 @@ import androidx.annotation.NonNull;
|
||||||
import androidx.appcompat.widget.SearchView;
|
import androidx.appcompat.widget.SearchView;
|
||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
import androidx.lifecycle.ViewModelProvider;
|
import androidx.lifecycle.ViewModelProvider;
|
||||||
import androidx.recyclerview.widget.DividerItemDecoration;
|
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
import org.gitnex.tea4j.v2.models.ContentsResponse;
|
import org.gitnex.tea4j.v2.models.ContentsResponse;
|
||||||
import org.mian.gitnex.R;
|
import org.mian.gitnex.R;
|
||||||
|
@ -71,7 +70,6 @@ public class FilesFragment extends Fragment implements FilesAdapter.FilesAdapter
|
||||||
binding.recyclerView.setHasFixedSize(true);
|
binding.recyclerView.setHasFixedSize(true);
|
||||||
binding.recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
|
binding.recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
|
||||||
binding.recyclerView.setAdapter(filesAdapter);
|
binding.recyclerView.setAdapter(filesAdapter);
|
||||||
binding.recyclerView.addItemDecoration(new DividerItemDecoration(binding.recyclerView.getContext(), DividerItemDecoration.VERTICAL));
|
|
||||||
|
|
||||||
binding.breadcrumbsView.setItems(new ArrayList<>(
|
binding.breadcrumbsView.setItems(new ArrayList<>(
|
||||||
Collections.singletonList(BreadcrumbItem.createSimpleItem(getResources().getString(R.string.filesBreadcrumbRoot) + getResources().getString(R.string.colonDivider) + repository.getBranchRef()))));
|
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.NonNull;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
import androidx.recyclerview.widget.DividerItemDecoration;
|
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
import org.gitnex.tea4j.v2.models.Issue;
|
import org.gitnex.tea4j.v2.models.Issue;
|
||||||
import org.mian.gitnex.R;
|
import org.mian.gitnex.R;
|
||||||
|
@ -78,9 +77,7 @@ public class IssuesFragment extends Fragment {
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
|
|
||||||
DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(fragmentIssuesBinding.recyclerView.getContext(), DividerItemDecoration.VERTICAL);
|
|
||||||
fragmentIssuesBinding.recyclerView.setHasFixedSize(true);
|
fragmentIssuesBinding.recyclerView.setHasFixedSize(true);
|
||||||
fragmentIssuesBinding.recyclerView.addItemDecoration(dividerItemDecoration);
|
|
||||||
fragmentIssuesBinding.recyclerView.setLayoutManager(new LinearLayoutManager(context));
|
fragmentIssuesBinding.recyclerView.setLayoutManager(new LinearLayoutManager(context));
|
||||||
fragmentIssuesBinding.recyclerView.setAdapter(adapter);
|
fragmentIssuesBinding.recyclerView.setAdapter(adapter);
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,6 @@ import android.widget.TextView;
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
import androidx.lifecycle.ViewModelProvider;
|
import androidx.lifecycle.ViewModelProvider;
|
||||||
import androidx.recyclerview.widget.DividerItemDecoration;
|
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
|
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
|
||||||
|
@ -63,9 +62,6 @@ public class LabelsFragment extends Fragment {
|
||||||
mRecyclerView.setHasFixedSize(true);
|
mRecyclerView.setHasFixedSize(true);
|
||||||
mRecyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
|
mRecyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
|
||||||
|
|
||||||
DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(mRecyclerView.getContext(), DividerItemDecoration.VERTICAL);
|
|
||||||
mRecyclerView.addItemDecoration(dividerItemDecoration);
|
|
||||||
|
|
||||||
mProgressBar = fragmentLabelsBinding.progressBar;
|
mProgressBar = fragmentLabelsBinding.progressBar;
|
||||||
|
|
||||||
swipeRefresh.setOnRefreshListener(() -> new Handler(Looper.getMainLooper()).postDelayed(() -> {
|
swipeRefresh.setOnRefreshListener(() -> new Handler(Looper.getMainLooper()).postDelayed(() -> {
|
||||||
|
|
|
@ -4,13 +4,17 @@ import android.content.Context;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.os.Looper;
|
import android.os.Looper;
|
||||||
import android.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.view.inputmethod.EditorInfo;
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
import androidx.lifecycle.ViewModelProvider;
|
import androidx.lifecycle.ViewModelProvider;
|
||||||
import androidx.recyclerview.widget.DividerItemDecoration;
|
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
import org.gitnex.tea4j.v2.models.Milestone;
|
import org.gitnex.tea4j.v2.models.Milestone;
|
||||||
import org.mian.gitnex.R;
|
import org.mian.gitnex.R;
|
||||||
|
@ -28,7 +32,6 @@ import java.util.List;
|
||||||
|
|
||||||
public class MilestonesFragment extends Fragment {
|
public class MilestonesFragment extends Fragment {
|
||||||
|
|
||||||
public String state = "open";
|
|
||||||
private MilestonesViewModel milestonesViewModel;
|
private MilestonesViewModel milestonesViewModel;
|
||||||
private FragmentMilestonesBinding viewBinding;
|
private FragmentMilestonesBinding viewBinding;
|
||||||
private Menu menu;
|
private Menu menu;
|
||||||
|
@ -37,6 +40,7 @@ public class MilestonesFragment extends Fragment {
|
||||||
private RepositoryContext repository;
|
private RepositoryContext repository;
|
||||||
private String milestoneId;
|
private String milestoneId;
|
||||||
private int page = 1;
|
private int page = 1;
|
||||||
|
public String state = "open";
|
||||||
|
|
||||||
public static MilestonesFragment newInstance(RepositoryContext repository) {
|
public static MilestonesFragment newInstance(RepositoryContext repository) {
|
||||||
MilestonesFragment fragment = new MilestonesFragment();
|
MilestonesFragment fragment = new MilestonesFragment();
|
||||||
|
@ -44,15 +48,6 @@ public class MilestonesFragment extends Fragment {
|
||||||
return 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
|
@Override
|
||||||
public void onCreate(@Nullable Bundle savedInstanceState) {
|
public void onCreate(@Nullable Bundle savedInstanceState) {
|
||||||
repository = RepositoryContext.fromBundle(requireArguments());
|
repository = RepositoryContext.fromBundle(requireArguments());
|
||||||
|
@ -75,8 +70,6 @@ public class MilestonesFragment extends Fragment {
|
||||||
|
|
||||||
dataList = new ArrayList<>();
|
dataList = new ArrayList<>();
|
||||||
|
|
||||||
DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(viewBinding.recyclerView.getContext(), DividerItemDecoration.VERTICAL);
|
|
||||||
viewBinding.recyclerView.addItemDecoration(dividerItemDecoration);
|
|
||||||
viewBinding.recyclerView.setHasFixedSize(true);
|
viewBinding.recyclerView.setHasFixedSize(true);
|
||||||
viewBinding.recyclerView.setLayoutManager(new LinearLayoutManager(ctx));
|
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
|
@Override
|
||||||
public void onCreateOptionsMenu(@NonNull Menu menu, @NonNull MenuInflater inflater) {
|
public void onCreateOptionsMenu(@NonNull Menu menu, @NonNull MenuInflater inflater) {
|
||||||
|
|
||||||
|
|
|
@ -5,15 +5,17 @@ import android.os.Bundle;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.os.Looper;
|
import android.os.Looper;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.Menu;
|
||||||
|
import android.view.MenuInflater;
|
||||||
|
import android.view.MenuItem;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.TextView;
|
import android.view.inputmethod.EditorInfo;
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.appcompat.widget.SearchView;
|
||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
import androidx.recyclerview.widget.DividerItemDecoration;
|
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
|
||||||
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
|
|
||||||
import org.mian.gitnex.R;
|
import org.mian.gitnex.R;
|
||||||
import org.mian.gitnex.activities.MainActivity;
|
import org.mian.gitnex.activities.MainActivity;
|
||||||
import org.mian.gitnex.adapters.MostVisitedReposAdapter;
|
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.database.models.Repository;
|
||||||
import org.mian.gitnex.databinding.FragmentDraftsBinding;
|
import org.mian.gitnex.databinding.FragmentDraftsBinding;
|
||||||
import org.mian.gitnex.helpers.TinyDB;
|
import org.mian.gitnex.helpers.TinyDB;
|
||||||
|
import org.mian.gitnex.helpers.Toasty;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author M M Arif
|
* @author M M Arif
|
||||||
|
@ -31,19 +35,17 @@ import java.util.List;
|
||||||
|
|
||||||
public class MostVisitedReposFragment extends Fragment {
|
public class MostVisitedReposFragment extends Fragment {
|
||||||
|
|
||||||
|
private FragmentDraftsBinding fragmentDraftsBinding;
|
||||||
private Context ctx;
|
private Context ctx;
|
||||||
private MostVisitedReposAdapter adapter;
|
private MostVisitedReposAdapter adapter;
|
||||||
private RecyclerView mRecyclerView;
|
|
||||||
private RepositoriesApi repositoriesApi;
|
private RepositoriesApi repositoriesApi;
|
||||||
private TextView noData;
|
|
||||||
private List<Repository> mostVisitedReposList;
|
private List<Repository> mostVisitedReposList;
|
||||||
private int currentActiveAccountId;
|
private int currentActiveAccountId;
|
||||||
private SwipeRefreshLayout swipeRefresh;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
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();
|
ctx = getContext();
|
||||||
setHasOptionsMenu(true);
|
setHasOptionsMenu(true);
|
||||||
|
@ -55,19 +57,12 @@ public class MostVisitedReposFragment extends Fragment {
|
||||||
mostVisitedReposList = new ArrayList<>();
|
mostVisitedReposList = new ArrayList<>();
|
||||||
repositoriesApi = BaseApi.getInstance(ctx, RepositoriesApi.class);
|
repositoriesApi = BaseApi.getInstance(ctx, RepositoriesApi.class);
|
||||||
|
|
||||||
noData = fragmentDraftsBinding.noData;
|
fragmentDraftsBinding.recyclerView.setHasFixedSize(true);
|
||||||
mRecyclerView = fragmentDraftsBinding.recyclerView;
|
fragmentDraftsBinding.recyclerView.setLayoutManager(new LinearLayoutManager(ctx));
|
||||||
swipeRefresh = fragmentDraftsBinding.pullToRefresh;
|
|
||||||
|
|
||||||
mRecyclerView.setHasFixedSize(true);
|
adapter = new MostVisitedReposAdapter(ctx, mostVisitedReposList);
|
||||||
mRecyclerView.setLayoutManager(new LinearLayoutManager(ctx));
|
|
||||||
|
|
||||||
DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(mRecyclerView.getContext(), DividerItemDecoration.VERTICAL);
|
|
||||||
mRecyclerView.addItemDecoration(dividerItemDecoration);
|
|
||||||
|
|
||||||
adapter = new MostVisitedReposAdapter(mostVisitedReposList);
|
|
||||||
currentActiveAccountId = tinyDb.getInt("currentActiveAccountId");
|
currentActiveAccountId = tinyDb.getInt("currentActiveAccountId");
|
||||||
swipeRefresh.setOnRefreshListener(() -> new Handler(Looper.getMainLooper()).postDelayed(() -> {
|
fragmentDraftsBinding.pullToRefresh.setOnRefreshListener(() -> new Handler(Looper.getMainLooper()).postDelayed(() -> {
|
||||||
|
|
||||||
mostVisitedReposList.clear();
|
mostVisitedReposList.clear();
|
||||||
fetchDataAsync(currentActiveAccountId);
|
fetchDataAsync(currentActiveAccountId);
|
||||||
|
@ -82,21 +77,101 @@ public class MostVisitedReposFragment extends Fragment {
|
||||||
|
|
||||||
repositoriesApi.fetchAllMostVisited(accountId).observe(getViewLifecycleOwner(), mostVisitedRepos -> {
|
repositoriesApi.fetchAllMostVisited(accountId).observe(getViewLifecycleOwner(), mostVisitedRepos -> {
|
||||||
|
|
||||||
swipeRefresh.setRefreshing(false);
|
fragmentDraftsBinding.pullToRefresh.setRefreshing(false);
|
||||||
assert mostVisitedRepos != null;
|
assert mostVisitedRepos != null;
|
||||||
if(mostVisitedRepos.size() > 0) {
|
if(mostVisitedRepos.size() > 0) {
|
||||||
|
|
||||||
mostVisitedReposList.clear();
|
mostVisitedReposList.clear();
|
||||||
noData.setVisibility(View.GONE);
|
fragmentDraftsBinding.noData.setVisibility(View.GONE);
|
||||||
mostVisitedReposList.addAll(mostVisitedRepos);
|
mostVisitedReposList.addAll(mostVisitedRepos);
|
||||||
adapter.notifyDataChanged();
|
adapter.notifyDataChanged();
|
||||||
mRecyclerView.setAdapter(adapter);
|
fragmentDraftsBinding.recyclerView.setAdapter(adapter);
|
||||||
}
|
}
|
||||||
else {
|
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.Bundle;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.os.Looper;
|
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.view.inputmethod.EditorInfo;
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
import androidx.lifecycle.ViewModelProvider;
|
import androidx.lifecycle.ViewModelProvider;
|
||||||
import androidx.recyclerview.widget.DividerItemDecoration;
|
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
import org.mian.gitnex.R;
|
import org.mian.gitnex.R;
|
||||||
import org.mian.gitnex.activities.MainActivity;
|
import org.mian.gitnex.activities.MainActivity;
|
||||||
|
@ -22,13 +26,13 @@ import org.mian.gitnex.viewmodels.IssuesViewModel;
|
||||||
|
|
||||||
public class MyIssuesFragment extends Fragment {
|
public class MyIssuesFragment extends Fragment {
|
||||||
|
|
||||||
public String state = "open";
|
|
||||||
public boolean assignedToMe = false;
|
|
||||||
private IssuesViewModel issuesViewModel;
|
private IssuesViewModel issuesViewModel;
|
||||||
private FragmentIssuesBinding fragmentIssuesBinding;
|
private FragmentIssuesBinding fragmentIssuesBinding;
|
||||||
private ExploreIssuesAdapter adapter;
|
private ExploreIssuesAdapter adapter;
|
||||||
private int page = 1;
|
private int page = 1;
|
||||||
private Menu menu;
|
private Menu menu;
|
||||||
|
public String state = "open";
|
||||||
|
public boolean assignedToMe = false;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||||
|
@ -39,8 +43,6 @@ public class MyIssuesFragment extends Fragment {
|
||||||
|
|
||||||
fragmentIssuesBinding.recyclerView.setHasFixedSize(true);
|
fragmentIssuesBinding.recyclerView.setHasFixedSize(true);
|
||||||
fragmentIssuesBinding.recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
|
fragmentIssuesBinding.recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
|
||||||
DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(fragmentIssuesBinding.recyclerView.getContext(), DividerItemDecoration.VERTICAL);
|
|
||||||
fragmentIssuesBinding.recyclerView.addItemDecoration(dividerItemDecoration);
|
|
||||||
|
|
||||||
((MainActivity) requireActivity()).setFragmentRefreshListenerMyIssues(myIssues -> {
|
((MainActivity) requireActivity()).setFragmentRefreshListenerMyIssues(myIssues -> {
|
||||||
|
|
||||||
|
@ -73,6 +75,8 @@ public class MyIssuesFragment extends Fragment {
|
||||||
return fragmentIssuesBinding.getRoot();
|
return fragmentIssuesBinding.getRoot();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
;
|
||||||
|
|
||||||
private void fetchDataAsync(String query, String state, boolean assignedToMe) {
|
private void fetchDataAsync(String query, String state, boolean assignedToMe) {
|
||||||
|
|
||||||
issuesViewModel.getIssuesList(query, "issues", true, state, assignedToMe, getContext()).observe(getViewLifecycleOwner(), issuesListMain -> {
|
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.*;
|
||||||
import android.view.inputmethod.EditorInfo;
|
import android.view.inputmethod.EditorInfo;
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.core.content.ContextCompat;
|
|
||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
import androidx.lifecycle.ViewModelProvider;
|
import androidx.lifecycle.ViewModelProvider;
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
|
||||||
import org.mian.gitnex.R;
|
import org.mian.gitnex.R;
|
||||||
import org.mian.gitnex.activities.BaseActivity;
|
import org.mian.gitnex.activities.BaseActivity;
|
||||||
import org.mian.gitnex.activities.CreateRepoActivity;
|
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.adapters.ReposListAdapter;
|
||||||
import org.mian.gitnex.databinding.FragmentRepositoriesBinding;
|
import org.mian.gitnex.databinding.FragmentRepositoriesBinding;
|
||||||
import org.mian.gitnex.helpers.Constants;
|
import org.mian.gitnex.helpers.Constants;
|
||||||
import org.mian.gitnex.helpers.DividerItemDecorator;
|
|
||||||
import org.mian.gitnex.viewmodels.RepositoriesViewModel;
|
import org.mian.gitnex.viewmodels.RepositoriesViewModel;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -54,10 +51,7 @@ public class MyRepositoriesFragment extends Fragment {
|
||||||
fragmentRepositoriesBinding.recyclerView.setHasFixedSize(true);
|
fragmentRepositoriesBinding.recyclerView.setHasFixedSize(true);
|
||||||
fragmentRepositoriesBinding.recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
|
fragmentRepositoriesBinding.recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
|
||||||
|
|
||||||
RecyclerView.ItemDecoration dividerItemDecoration = new DividerItemDecorator(ContextCompat.getDrawable(requireContext(), R.drawable.shape_list_divider));
|
fragmentRepositoriesBinding.recyclerView.setPadding(0, 0, 0, 220);
|
||||||
fragmentRepositoriesBinding.recyclerView.addItemDecoration(dividerItemDecoration);
|
|
||||||
|
|
||||||
fragmentRepositoriesBinding.recyclerView.setPadding(0, 0, 0, 240);
|
|
||||||
fragmentRepositoriesBinding.recyclerView.setClipToPadding(false);
|
fragmentRepositoriesBinding.recyclerView.setClipToPadding(false);
|
||||||
|
|
||||||
fragmentRepositoriesBinding.pullToRefresh.setOnRefreshListener(() -> new Handler(Looper.getMainLooper()).postDelayed(() -> {
|
fragmentRepositoriesBinding.pullToRefresh.setOnRefreshListener(() -> new Handler(Looper.getMainLooper()).postDelayed(() -> {
|
||||||
|
|
|
@ -8,7 +8,6 @@ import android.view.*;
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
import androidx.recyclerview.widget.DividerItemDecoration;
|
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
@ -71,12 +70,9 @@ public class NotificationsFragment extends Fragment implements NotificationsAdap
|
||||||
|
|
||||||
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(context);
|
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(context);
|
||||||
|
|
||||||
DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(viewBinding.notifications.getContext(), DividerItemDecoration.VERTICAL);
|
|
||||||
|
|
||||||
viewBinding.notifications.setHasFixedSize(true);
|
viewBinding.notifications.setHasFixedSize(true);
|
||||||
viewBinding.notifications.setLayoutManager(linearLayoutManager);
|
viewBinding.notifications.setLayoutManager(linearLayoutManager);
|
||||||
viewBinding.notifications.setAdapter(notificationsAdapter);
|
viewBinding.notifications.setAdapter(notificationsAdapter);
|
||||||
viewBinding.notifications.addItemDecoration(dividerItemDecoration);
|
|
||||||
|
|
||||||
viewBinding.notifications.addOnScrollListener(new RecyclerView.OnScrollListener() {
|
viewBinding.notifications.addOnScrollListener(new RecyclerView.OnScrollListener() {
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,6 @@ import android.widget.TextView;
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
import androidx.lifecycle.ViewModelProvider;
|
import androidx.lifecycle.ViewModelProvider;
|
||||||
import androidx.recyclerview.widget.DividerItemDecoration;
|
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
|
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
|
||||||
|
@ -26,13 +25,14 @@ import org.mian.gitnex.viewmodels.OrganizationLabelsViewModel;
|
||||||
|
|
||||||
public class OrganizationLabelsFragment extends Fragment {
|
public class OrganizationLabelsFragment extends Fragment {
|
||||||
|
|
||||||
private static final String repoOwnerF = "param1";
|
|
||||||
private final String type = "org";
|
|
||||||
private OrganizationLabelsViewModel organizationLabelsViewModel;
|
private OrganizationLabelsViewModel organizationLabelsViewModel;
|
||||||
private ProgressBar mProgressBar;
|
private ProgressBar mProgressBar;
|
||||||
private RecyclerView mRecyclerView;
|
private RecyclerView mRecyclerView;
|
||||||
private LabelsAdapter adapter;
|
private LabelsAdapter adapter;
|
||||||
private TextView noData;
|
private TextView noData;
|
||||||
|
private static final String repoOwnerF = "param1";
|
||||||
|
private final String type = "org";
|
||||||
|
|
||||||
private String repoOwner;
|
private String repoOwner;
|
||||||
|
|
||||||
public static OrganizationLabelsFragment newInstance(String param1) {
|
public static OrganizationLabelsFragment newInstance(String param1) {
|
||||||
|
@ -69,9 +69,6 @@ public class OrganizationLabelsFragment extends Fragment {
|
||||||
mRecyclerView.setHasFixedSize(true);
|
mRecyclerView.setHasFixedSize(true);
|
||||||
mRecyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
|
mRecyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
|
||||||
|
|
||||||
DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(mRecyclerView.getContext(), DividerItemDecoration.VERTICAL);
|
|
||||||
mRecyclerView.addItemDecoration(dividerItemDecoration);
|
|
||||||
|
|
||||||
mProgressBar = fragmentLabelsBinding.progressBar;
|
mProgressBar = fragmentLabelsBinding.progressBar;
|
||||||
|
|
||||||
swipeRefresh.setOnRefreshListener(() -> new Handler(Looper.getMainLooper()).postDelayed(() -> {
|
swipeRefresh.setOnRefreshListener(() -> new Handler(Looper.getMainLooper()).postDelayed(() -> {
|
||||||
|
|
|
@ -1,7 +1,12 @@
|
||||||
package org.mian.gitnex.fragments;
|
package org.mian.gitnex.fragments;
|
||||||
|
|
||||||
import android.os.Bundle;
|
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.view.inputmethod.EditorInfo;
|
||||||
import android.widget.GridView;
|
import android.widget.GridView;
|
||||||
import android.widget.ProgressBar;
|
import android.widget.ProgressBar;
|
||||||
|
@ -11,7 +16,7 @@ import androidx.fragment.app.Fragment;
|
||||||
import androidx.lifecycle.ViewModelProvider;
|
import androidx.lifecycle.ViewModelProvider;
|
||||||
import org.mian.gitnex.R;
|
import org.mian.gitnex.R;
|
||||||
import org.mian.gitnex.adapters.UserGridAdapter;
|
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.helpers.AppUtil;
|
||||||
import org.mian.gitnex.viewmodels.MembersByOrgViewModel;
|
import org.mian.gitnex.viewmodels.MembersByOrgViewModel;
|
||||||
|
|
||||||
|
@ -19,20 +24,20 @@ import org.mian.gitnex.viewmodels.MembersByOrgViewModel;
|
||||||
* @author M M Arif
|
* @author M M Arif
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class MembersByOrgFragment extends Fragment {
|
public class OrganizationMembersFragment extends Fragment {
|
||||||
|
|
||||||
private static final String orgNameF = "param2";
|
|
||||||
private TextView noDataMembers;
|
private TextView noDataMembers;
|
||||||
|
private static String orgNameF = "param2";
|
||||||
private String orgName;
|
private String orgName;
|
||||||
private UserGridAdapter adapter;
|
private UserGridAdapter adapter;
|
||||||
private GridView mGridView;
|
private GridView mGridView;
|
||||||
private ProgressBar progressBar;
|
private ProgressBar progressBar;
|
||||||
|
|
||||||
public MembersByOrgFragment() {
|
public OrganizationMembersFragment() {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static MembersByOrgFragment newInstance(String param1) {
|
public static OrganizationMembersFragment newInstance(String param1) {
|
||||||
MembersByOrgFragment fragment = new MembersByOrgFragment();
|
OrganizationMembersFragment fragment = new OrganizationMembersFragment();
|
||||||
Bundle args = new Bundle();
|
Bundle args = new Bundle();
|
||||||
args.putString(orgNameF, param1);
|
args.putString(orgNameF, param1);
|
||||||
fragment.setArguments(args);
|
fragment.setArguments(args);
|
||||||
|
@ -48,9 +53,9 @@ public class MembersByOrgFragment extends Fragment {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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);
|
setHasOptionsMenu(true);
|
||||||
|
|
||||||
noDataMembers = fragmentMembersByOrgBinding.noDataMembers;
|
noDataMembers = fragmentMembersByOrgBinding.noDataMembers;
|
||||||
|
@ -102,7 +107,6 @@ public class MembersByOrgFragment extends Fragment {
|
||||||
}
|
}
|
||||||
|
|
||||||
searchView.setOnQueryTextListener(new androidx.appcompat.widget.SearchView.OnQueryTextListener() {
|
searchView.setOnQueryTextListener(new androidx.appcompat.widget.SearchView.OnQueryTextListener() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onQueryTextSubmit(String query) {
|
public boolean onQueryTextSubmit(String query) {
|
||||||
return false;
|
return false;
|
|
@ -3,12 +3,16 @@ package org.mian.gitnex.fragments;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.os.Looper;
|
import android.os.Looper;
|
||||||
import android.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.view.inputmethod.EditorInfo;
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
import androidx.lifecycle.ViewModelProvider;
|
import androidx.lifecycle.ViewModelProvider;
|
||||||
import androidx.recyclerview.widget.DividerItemDecoration;
|
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
import org.mian.gitnex.R;
|
import org.mian.gitnex.R;
|
||||||
import org.mian.gitnex.activities.MainActivity;
|
import org.mian.gitnex.activities.MainActivity;
|
||||||
|
@ -21,21 +25,21 @@ import org.mian.gitnex.viewmodels.RepositoriesViewModel;
|
||||||
* @author M M Arif
|
* @author M M Arif
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class RepositoriesByOrgFragment extends Fragment {
|
public class OrganizationRepositoriesFragment extends Fragment {
|
||||||
|
|
||||||
private static final String getOrgName = null;
|
|
||||||
private RepositoriesViewModel repositoriesViewModel;
|
private RepositoriesViewModel repositoriesViewModel;
|
||||||
private FragmentRepositoriesBinding fragmentRepositoriesBinding;
|
private FragmentRepositoriesBinding fragmentRepositoriesBinding;
|
||||||
private ReposListAdapter adapter;
|
private ReposListAdapter adapter;
|
||||||
private int page = 1;
|
private int page = 1;
|
||||||
private int resultLimit;
|
private int resultLimit;
|
||||||
|
private static final String getOrgName = null;
|
||||||
private String orgName;
|
private String orgName;
|
||||||
|
|
||||||
public RepositoriesByOrgFragment() {
|
public OrganizationRepositoriesFragment() {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static RepositoriesByOrgFragment newInstance(String orgName) {
|
public static OrganizationRepositoriesFragment newInstance(String orgName) {
|
||||||
RepositoriesByOrgFragment fragment = new RepositoriesByOrgFragment();
|
OrganizationRepositoriesFragment fragment = new OrganizationRepositoriesFragment();
|
||||||
Bundle args = new Bundle();
|
Bundle args = new Bundle();
|
||||||
args.putString(getOrgName, orgName);
|
args.putString(getOrgName, orgName);
|
||||||
fragment.setArguments(args);
|
fragment.setArguments(args);
|
||||||
|
@ -63,8 +67,6 @@ public class RepositoriesByOrgFragment extends Fragment {
|
||||||
|
|
||||||
fragmentRepositoriesBinding.recyclerView.setHasFixedSize(true);
|
fragmentRepositoriesBinding.recyclerView.setHasFixedSize(true);
|
||||||
fragmentRepositoriesBinding.recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
|
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(() -> {
|
fragmentRepositoriesBinding.pullToRefresh.setOnRefreshListener(() -> new Handler(Looper.getMainLooper()).postDelayed(() -> {
|
||||||
|
|
||||||
|
@ -80,6 +82,8 @@ public class RepositoriesByOrgFragment extends Fragment {
|
||||||
return fragmentRepositoriesBinding.getRoot();
|
return fragmentRepositoriesBinding.getRoot();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
;
|
||||||
|
|
||||||
private void fetchDataAsync() {
|
private void fetchDataAsync() {
|
||||||
|
|
||||||
repositoriesViewModel.getRepositories(page, resultLimit, "", "org", orgName, getContext()).observe(getViewLifecycleOwner(), reposListMain -> {
|
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.setImeOptions(EditorInfo.IME_ACTION_DONE);
|
||||||
|
|
||||||
searchView.setOnQueryTextListener(new androidx.appcompat.widget.SearchView.OnQueryTextListener() {
|
searchView.setOnQueryTextListener(new androidx.appcompat.widget.SearchView.OnQueryTextListener() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onQueryTextSubmit(String query) {
|
public boolean onQueryTextSubmit(String query) {
|
||||||
return false;
|
return false;
|
|
@ -6,18 +6,15 @@ import android.os.Looper;
|
||||||
import android.view.*;
|
import android.view.*;
|
||||||
import android.view.inputmethod.EditorInfo;
|
import android.view.inputmethod.EditorInfo;
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.core.content.ContextCompat;
|
|
||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
import androidx.lifecycle.ViewModelProvider;
|
import androidx.lifecycle.ViewModelProvider;
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
|
||||||
import org.gitnex.tea4j.v2.models.Team;
|
import org.gitnex.tea4j.v2.models.Team;
|
||||||
import org.mian.gitnex.R;
|
import org.mian.gitnex.R;
|
||||||
import org.mian.gitnex.activities.MainActivity;
|
import org.mian.gitnex.activities.MainActivity;
|
||||||
import org.mian.gitnex.adapters.ReposListAdapter;
|
import org.mian.gitnex.adapters.ReposListAdapter;
|
||||||
import org.mian.gitnex.databinding.FragmentRepositoriesBinding;
|
import org.mian.gitnex.databinding.FragmentRepositoriesBinding;
|
||||||
import org.mian.gitnex.helpers.Constants;
|
import org.mian.gitnex.helpers.Constants;
|
||||||
import org.mian.gitnex.helpers.DividerItemDecorator;
|
|
||||||
import org.mian.gitnex.viewmodels.RepositoriesViewModel;
|
import org.mian.gitnex.viewmodels.RepositoriesViewModel;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -61,9 +58,6 @@ public class OrganizationTeamInfoReposFragment extends Fragment {
|
||||||
fragmentRepositoriesBinding.recyclerView.setHasFixedSize(true);
|
fragmentRepositoriesBinding.recyclerView.setHasFixedSize(true);
|
||||||
fragmentRepositoriesBinding.recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
|
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(() -> {
|
fragmentRepositoriesBinding.pullToRefresh.setOnRefreshListener(() -> new Handler(Looper.getMainLooper()).postDelayed(() -> {
|
||||||
|
|
||||||
page = 1;
|
page = 1;
|
||||||
|
|
|
@ -3,44 +3,49 @@ package org.mian.gitnex.fragments;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.os.Looper;
|
import android.os.Looper;
|
||||||
import android.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.view.inputmethod.EditorInfo;
|
||||||
import android.widget.ProgressBar;
|
import android.widget.ProgressBar;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
import androidx.lifecycle.ViewModelProvider;
|
import androidx.lifecycle.ViewModelProvider;
|
||||||
import androidx.recyclerview.widget.DividerItemDecoration;
|
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
|
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
|
||||||
import org.gitnex.tea4j.v2.models.OrganizationPermissions;
|
import org.gitnex.tea4j.v2.models.OrganizationPermissions;
|
||||||
import org.mian.gitnex.R;
|
import org.mian.gitnex.R;
|
||||||
import org.mian.gitnex.adapters.TeamsByOrgAdapter;
|
import org.mian.gitnex.adapters.OrganizationTeamsAdapter;
|
||||||
import org.mian.gitnex.databinding.FragmentTeamsByOrgBinding;
|
import org.mian.gitnex.databinding.FragmentOrganizationTeamsBinding;
|
||||||
import org.mian.gitnex.viewmodels.TeamsByOrgViewModel;
|
import org.mian.gitnex.viewmodels.TeamsByOrgViewModel;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author M M Arif
|
* @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;
|
private TeamsByOrgViewModel teamsByOrgViewModel;
|
||||||
|
public static boolean resumeTeams = false;
|
||||||
|
|
||||||
private ProgressBar mProgressBar;
|
private ProgressBar mProgressBar;
|
||||||
private RecyclerView mRecyclerView;
|
private RecyclerView mRecyclerView;
|
||||||
private TextView noDataTeams;
|
private TextView noDataTeams;
|
||||||
|
private static final String orgNameF = "param2";
|
||||||
private String orgName;
|
private String orgName;
|
||||||
private OrganizationPermissions permissions;
|
private OrganizationPermissions permissions;
|
||||||
private TeamsByOrgAdapter adapter;
|
private OrganizationTeamsAdapter adapter;
|
||||||
|
|
||||||
public TeamsByOrgFragment() {
|
public OrganizationTeamsFragment() {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static TeamsByOrgFragment newInstance(String param1, OrganizationPermissions permissions) {
|
public static OrganizationTeamsFragment newInstance(String param1, OrganizationPermissions permissions) {
|
||||||
TeamsByOrgFragment fragment = new TeamsByOrgFragment();
|
OrganizationTeamsFragment fragment = new OrganizationTeamsFragment();
|
||||||
Bundle args = new Bundle();
|
Bundle args = new Bundle();
|
||||||
args.putString(orgNameF, param1);
|
args.putString(orgNameF, param1);
|
||||||
args.putSerializable("permissions", permissions);
|
args.putSerializable("permissions", permissions);
|
||||||
|
@ -60,7 +65,7 @@ public class TeamsByOrgFragment extends Fragment {
|
||||||
@Override
|
@Override
|
||||||
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
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);
|
setHasOptionsMenu(true);
|
||||||
teamsByOrgViewModel = new ViewModelProvider(this).get(TeamsByOrgViewModel.class);
|
teamsByOrgViewModel = new ViewModelProvider(this).get(TeamsByOrgViewModel.class);
|
||||||
|
|
||||||
|
@ -72,9 +77,6 @@ public class TeamsByOrgFragment extends Fragment {
|
||||||
mRecyclerView.setHasFixedSize(true);
|
mRecyclerView.setHasFixedSize(true);
|
||||||
mRecyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
|
mRecyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
|
||||||
|
|
||||||
DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(mRecyclerView.getContext(), DividerItemDecoration.VERTICAL);
|
|
||||||
mRecyclerView.addItemDecoration(dividerItemDecoration);
|
|
||||||
|
|
||||||
mProgressBar = fragmentTeamsByOrgBinding.progressBar;
|
mProgressBar = fragmentTeamsByOrgBinding.progressBar;
|
||||||
|
|
||||||
swipeRefresh.setOnRefreshListener(() -> new Handler(Looper.getMainLooper()).postDelayed(() -> {
|
swipeRefresh.setOnRefreshListener(() -> new Handler(Looper.getMainLooper()).postDelayed(() -> {
|
||||||
|
@ -101,7 +103,7 @@ public class TeamsByOrgFragment extends Fragment {
|
||||||
private void fetchDataAsync(String owner) {
|
private void fetchDataAsync(String owner) {
|
||||||
|
|
||||||
teamsByOrgViewModel.getTeamsByOrg(owner, getContext(), noDataTeams, mProgressBar).observe(getViewLifecycleOwner(), orgTeamsListMain -> {
|
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) {
|
if(adapter.getItemCount() > 0) {
|
||||||
mRecyclerView.setAdapter(adapter);
|
mRecyclerView.setAdapter(adapter);
|
||||||
noDataTeams.setVisibility(View.GONE);
|
noDataTeams.setVisibility(View.GONE);
|
||||||
|
@ -127,7 +129,6 @@ public class TeamsByOrgFragment extends Fragment {
|
||||||
searchView.setImeOptions(EditorInfo.IME_ACTION_DONE);
|
searchView.setImeOptions(EditorInfo.IME_ACTION_DONE);
|
||||||
|
|
||||||
searchView.setOnQueryTextListener(new androidx.appcompat.widget.SearchView.OnQueryTextListener() {
|
searchView.setOnQueryTextListener(new androidx.appcompat.widget.SearchView.OnQueryTextListener() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onQueryTextSubmit(String query) {
|
public boolean onQueryTextSubmit(String query) {
|
||||||
return false;
|
return false;
|
|
@ -7,18 +7,15 @@ import android.os.Looper;
|
||||||
import android.view.*;
|
import android.view.*;
|
||||||
import android.view.inputmethod.EditorInfo;
|
import android.view.inputmethod.EditorInfo;
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.core.content.ContextCompat;
|
|
||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
import androidx.lifecycle.ViewModelProvider;
|
import androidx.lifecycle.ViewModelProvider;
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
|
||||||
import org.mian.gitnex.R;
|
import org.mian.gitnex.R;
|
||||||
import org.mian.gitnex.activities.CreateOrganizationActivity;
|
import org.mian.gitnex.activities.CreateOrganizationActivity;
|
||||||
import org.mian.gitnex.activities.MainActivity;
|
import org.mian.gitnex.activities.MainActivity;
|
||||||
import org.mian.gitnex.adapters.OrganizationsListAdapter;
|
import org.mian.gitnex.adapters.OrganizationsListAdapter;
|
||||||
import org.mian.gitnex.databinding.FragmentOrganizationsBinding;
|
import org.mian.gitnex.databinding.FragmentOrganizationsBinding;
|
||||||
import org.mian.gitnex.helpers.Constants;
|
import org.mian.gitnex.helpers.Constants;
|
||||||
import org.mian.gitnex.helpers.DividerItemDecorator;
|
|
||||||
import org.mian.gitnex.viewmodels.OrganizationsViewModel;
|
import org.mian.gitnex.viewmodels.OrganizationsViewModel;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -53,10 +50,7 @@ public class OrganizationsFragment extends Fragment {
|
||||||
fragmentOrganizationsBinding.recyclerView.setHasFixedSize(true);
|
fragmentOrganizationsBinding.recyclerView.setHasFixedSize(true);
|
||||||
fragmentOrganizationsBinding.recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
|
fragmentOrganizationsBinding.recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
|
||||||
|
|
||||||
RecyclerView.ItemDecoration dividerItemDecoration = new DividerItemDecorator(ContextCompat.getDrawable(requireContext(), R.drawable.shape_list_divider));
|
fragmentOrganizationsBinding.recyclerView.setPadding(0, 0, 0, 220);
|
||||||
fragmentOrganizationsBinding.recyclerView.addItemDecoration(dividerItemDecoration);
|
|
||||||
|
|
||||||
fragmentOrganizationsBinding.recyclerView.setPadding(0, 0, 0, 240);
|
|
||||||
fragmentOrganizationsBinding.recyclerView.setClipToPadding(false);
|
fragmentOrganizationsBinding.recyclerView.setClipToPadding(false);
|
||||||
|
|
||||||
fragmentOrganizationsBinding.pullToRefresh.setOnRefreshListener(() -> new Handler(Looper.getMainLooper()).postDelayed(() -> {
|
fragmentOrganizationsBinding.pullToRefresh.setOnRefreshListener(() -> new Handler(Looper.getMainLooper()).postDelayed(() -> {
|
||||||
|
|
|
@ -10,7 +10,6 @@ import android.view.inputmethod.EditorInfo;
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
import androidx.recyclerview.widget.DividerItemDecoration;
|
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
|
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
|
||||||
import org.gitnex.tea4j.v2.models.PullRequest;
|
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.setHasFixedSize(true);
|
||||||
fragmentPullRequestsBinding.recyclerView.addItemDecoration(dividerItemDecoration);
|
|
||||||
fragmentPullRequestsBinding.recyclerView.setLayoutManager(new LinearLayoutManager(context));
|
fragmentPullRequestsBinding.recyclerView.setLayoutManager(new LinearLayoutManager(context));
|
||||||
fragmentPullRequestsBinding.recyclerView.setAdapter(adapter);
|
fragmentPullRequestsBinding.recyclerView.setAdapter(adapter);
|
||||||
|
|
||||||
|
|
|
@ -8,14 +8,17 @@ import android.net.Uri;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.os.Looper;
|
import android.os.Looper;
|
||||||
import android.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.ActivityResultLauncher;
|
||||||
import androidx.activity.result.contract.ActivityResultContracts;
|
import androidx.activity.result.contract.ActivityResultContracts;
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.core.app.NotificationCompat;
|
import androidx.core.app.NotificationCompat;
|
||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
import androidx.lifecycle.ViewModelProvider;
|
import androidx.lifecycle.ViewModelProvider;
|
||||||
import androidx.recyclerview.widget.DividerItemDecoration;
|
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
import org.gitnex.tea4j.v2.auth.ApiKeyAuth;
|
import org.gitnex.tea4j.v2.auth.ApiKeyAuth;
|
||||||
import org.gitnex.tea4j.v2.models.Release;
|
import org.gitnex.tea4j.v2.models.Release;
|
||||||
|
@ -41,7 +44,11 @@ import java.util.Objects;
|
||||||
import javax.net.ssl.HttpsURLConnection;
|
import javax.net.ssl.HttpsURLConnection;
|
||||||
import javax.net.ssl.SSLContext;
|
import javax.net.ssl.SSLContext;
|
||||||
import javax.net.ssl.X509TrustManager;
|
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
|
* @author M M Arif
|
||||||
|
@ -49,65 +56,6 @@ import okhttp3.*;
|
||||||
|
|
||||||
public class ReleasesFragment extends Fragment {
|
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 ReleasesViewModel releasesViewModel;
|
||||||
private ReleasesAdapter adapter;
|
private ReleasesAdapter adapter;
|
||||||
private TagsAdapter tagsAdapter;
|
private TagsAdapter tagsAdapter;
|
||||||
|
@ -117,6 +65,8 @@ public class ReleasesFragment extends Fragment {
|
||||||
private int page = 1;
|
private int page = 1;
|
||||||
private int pageReleases = 1;
|
private int pageReleases = 1;
|
||||||
|
|
||||||
|
public static String currentDownloadUrl = null;
|
||||||
|
|
||||||
public ReleasesFragment() {
|
public ReleasesFragment() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -126,15 +76,6 @@ public class ReleasesFragment extends Fragment {
|
||||||
return 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
|
@Override
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
@ -150,8 +91,6 @@ public class ReleasesFragment extends Fragment {
|
||||||
|
|
||||||
fragmentReleasesBinding.recyclerView.setHasFixedSize(true);
|
fragmentReleasesBinding.recyclerView.setHasFixedSize(true);
|
||||||
fragmentReleasesBinding.recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
|
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(() -> {
|
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
|
@Override
|
||||||
public void onCreateOptionsMenu(@NonNull Menu menu, @NonNull MenuInflater inflater) {
|
public void onCreateOptionsMenu(@NonNull Menu menu, @NonNull MenuInflater inflater) {
|
||||||
if(!((BaseActivity) requireActivity()).getAccount().requiresVersion("1.15.0")) {
|
if(!((BaseActivity) requireActivity()).getAccount().requiresVersion("1.15.0")) {
|
||||||
|
@ -279,4 +227,63 @@ public class ReleasesFragment extends Fragment {
|
||||||
downloadLauncher.launch(intent);
|
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.*;
|
||||||
import android.view.inputmethod.EditorInfo;
|
import android.view.inputmethod.EditorInfo;
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.core.content.ContextCompat;
|
|
||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
import androidx.lifecycle.ViewModelProvider;
|
import androidx.lifecycle.ViewModelProvider;
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
|
||||||
import org.mian.gitnex.R;
|
import org.mian.gitnex.R;
|
||||||
import org.mian.gitnex.activities.CreateRepoActivity;
|
import org.mian.gitnex.activities.CreateRepoActivity;
|
||||||
import org.mian.gitnex.activities.MainActivity;
|
import org.mian.gitnex.activities.MainActivity;
|
||||||
import org.mian.gitnex.adapters.ReposListAdapter;
|
import org.mian.gitnex.adapters.ReposListAdapter;
|
||||||
import org.mian.gitnex.databinding.FragmentRepositoriesBinding;
|
import org.mian.gitnex.databinding.FragmentRepositoriesBinding;
|
||||||
import org.mian.gitnex.helpers.Constants;
|
import org.mian.gitnex.helpers.Constants;
|
||||||
import org.mian.gitnex.helpers.DividerItemDecorator;
|
|
||||||
import org.mian.gitnex.viewmodels.RepositoriesViewModel;
|
import org.mian.gitnex.viewmodels.RepositoriesViewModel;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -51,10 +48,7 @@ public class RepositoriesFragment extends Fragment {
|
||||||
fragmentRepositoriesBinding.recyclerView.setHasFixedSize(true);
|
fragmentRepositoriesBinding.recyclerView.setHasFixedSize(true);
|
||||||
fragmentRepositoriesBinding.recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
|
fragmentRepositoriesBinding.recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
|
||||||
|
|
||||||
RecyclerView.ItemDecoration dividerItemDecoration = new DividerItemDecorator(ContextCompat.getDrawable(requireContext(), R.drawable.shape_list_divider));
|
fragmentRepositoriesBinding.recyclerView.setPadding(0, 0, 0, 220);
|
||||||
fragmentRepositoriesBinding.recyclerView.addItemDecoration(dividerItemDecoration);
|
|
||||||
|
|
||||||
fragmentRepositoriesBinding.recyclerView.setPadding(0, 0, 0, 240);
|
|
||||||
fragmentRepositoriesBinding.recyclerView.setClipToPadding(false);
|
fragmentRepositoriesBinding.recyclerView.setClipToPadding(false);
|
||||||
|
|
||||||
fragmentRepositoriesBinding.pullToRefresh.setOnRefreshListener(() -> new Handler(Looper.getMainLooper()).postDelayed(() -> {
|
fragmentRepositoriesBinding.pullToRefresh.setOnRefreshListener(() -> new Handler(Looper.getMainLooper()).postDelayed(() -> {
|
||||||
|
|
|
@ -7,18 +7,15 @@ import android.os.Looper;
|
||||||
import android.view.*;
|
import android.view.*;
|
||||||
import android.view.inputmethod.EditorInfo;
|
import android.view.inputmethod.EditorInfo;
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.core.content.ContextCompat;
|
|
||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
import androidx.lifecycle.ViewModelProvider;
|
import androidx.lifecycle.ViewModelProvider;
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
|
||||||
import org.mian.gitnex.R;
|
import org.mian.gitnex.R;
|
||||||
import org.mian.gitnex.activities.CreateRepoActivity;
|
import org.mian.gitnex.activities.CreateRepoActivity;
|
||||||
import org.mian.gitnex.activities.MainActivity;
|
import org.mian.gitnex.activities.MainActivity;
|
||||||
import org.mian.gitnex.adapters.ReposListAdapter;
|
import org.mian.gitnex.adapters.ReposListAdapter;
|
||||||
import org.mian.gitnex.databinding.FragmentRepositoriesBinding;
|
import org.mian.gitnex.databinding.FragmentRepositoriesBinding;
|
||||||
import org.mian.gitnex.helpers.Constants;
|
import org.mian.gitnex.helpers.Constants;
|
||||||
import org.mian.gitnex.helpers.DividerItemDecorator;
|
|
||||||
import org.mian.gitnex.viewmodels.RepositoriesViewModel;
|
import org.mian.gitnex.viewmodels.RepositoriesViewModel;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -51,10 +48,7 @@ public class StarredRepositoriesFragment extends Fragment {
|
||||||
fragmentRepositoriesBinding.recyclerView.setHasFixedSize(true);
|
fragmentRepositoriesBinding.recyclerView.setHasFixedSize(true);
|
||||||
fragmentRepositoriesBinding.recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
|
fragmentRepositoriesBinding.recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
|
||||||
|
|
||||||
RecyclerView.ItemDecoration dividerItemDecoration = new DividerItemDecorator(ContextCompat.getDrawable(requireContext(), R.drawable.shape_list_divider));
|
fragmentRepositoriesBinding.recyclerView.setPadding(0, 0, 0, 220);
|
||||||
fragmentRepositoriesBinding.recyclerView.addItemDecoration(dividerItemDecoration);
|
|
||||||
|
|
||||||
fragmentRepositoriesBinding.recyclerView.setPadding(0, 0, 0, 240);
|
|
||||||
fragmentRepositoriesBinding.recyclerView.setClipToPadding(false);
|
fragmentRepositoriesBinding.recyclerView.setClipToPadding(false);
|
||||||
|
|
||||||
fragmentRepositoriesBinding.pullToRefresh.setOnRefreshListener(() -> new Handler(Looper.getMainLooper()).postDelayed(() -> {
|
fragmentRepositoriesBinding.pullToRefresh.setOnRefreshListener(() -> new Handler(Looper.getMainLooper()).postDelayed(() -> {
|
||||||
|
|
|
@ -7,16 +7,12 @@ import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.core.content.ContextCompat;
|
|
||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
import androidx.lifecycle.ViewModelProvider;
|
import androidx.lifecycle.ViewModelProvider;
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
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.adapters.WikiListAdapter;
|
||||||
import org.mian.gitnex.databinding.FragmentWikiBinding;
|
import org.mian.gitnex.databinding.FragmentWikiBinding;
|
||||||
import org.mian.gitnex.helpers.Constants;
|
import org.mian.gitnex.helpers.Constants;
|
||||||
import org.mian.gitnex.helpers.DividerItemDecorator;
|
|
||||||
import org.mian.gitnex.helpers.contexts.RepositoryContext;
|
import org.mian.gitnex.helpers.contexts.RepositoryContext;
|
||||||
import org.mian.gitnex.viewmodels.WikiViewModel;
|
import org.mian.gitnex.viewmodels.WikiViewModel;
|
||||||
|
|
||||||
|
@ -60,9 +56,6 @@ public class WikiFragment extends Fragment {
|
||||||
fragmentWikiBinding.recyclerView.setHasFixedSize(true);
|
fragmentWikiBinding.recyclerView.setHasFixedSize(true);
|
||||||
fragmentWikiBinding.recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
|
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(() -> {
|
fragmentWikiBinding.pullToRefresh.setOnRefreshListener(() -> new Handler(Looper.getMainLooper()).postDelayed(() -> {
|
||||||
|
|
||||||
page = 1;
|
page = 1;
|
||||||
|
|
|
@ -9,7 +9,6 @@ import android.view.inputmethod.EditorInfo;
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
import androidx.recyclerview.widget.DividerItemDecoration;
|
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
import org.gitnex.tea4j.v2.models.User;
|
import org.gitnex.tea4j.v2.models.User;
|
||||||
import org.mian.gitnex.R;
|
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.setHasFixedSize(true);
|
||||||
fragmentProfileFollowersFollowingBinding.recyclerView.addItemDecoration(dividerItemDecoration);
|
|
||||||
fragmentProfileFollowersFollowingBinding.recyclerView.setLayoutManager(new LinearLayoutManager(context));
|
fragmentProfileFollowersFollowingBinding.recyclerView.setLayoutManager(new LinearLayoutManager(context));
|
||||||
fragmentProfileFollowersFollowingBinding.recyclerView.setAdapter(adapter);
|
fragmentProfileFollowersFollowingBinding.recyclerView.setAdapter(adapter);
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,6 @@ import android.view.inputmethod.EditorInfo;
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
import androidx.recyclerview.widget.DividerItemDecoration;
|
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
import org.gitnex.tea4j.v2.models.User;
|
import org.gitnex.tea4j.v2.models.User;
|
||||||
import org.mian.gitnex.R;
|
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.setHasFixedSize(true);
|
||||||
fragmentProfileFollowersFollowingBinding.recyclerView.addItemDecoration(dividerItemDecoration);
|
|
||||||
fragmentProfileFollowersFollowingBinding.recyclerView.setLayoutManager(new LinearLayoutManager(context));
|
fragmentProfileFollowersFollowingBinding.recyclerView.setLayoutManager(new LinearLayoutManager(context));
|
||||||
fragmentProfileFollowersFollowingBinding.recyclerView.setAdapter(adapter);
|
fragmentProfileFollowersFollowingBinding.recyclerView.setAdapter(adapter);
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,6 @@ import android.view.inputmethod.EditorInfo;
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
import androidx.recyclerview.widget.DividerItemDecoration;
|
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
import org.gitnex.tea4j.v2.models.Organization;
|
import org.gitnex.tea4j.v2.models.Organization;
|
||||||
import org.mian.gitnex.R;
|
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.setHasFixedSize(true);
|
||||||
fragmentOrganizationsBinding.recyclerView.addItemDecoration(dividerItemDecoration);
|
|
||||||
fragmentOrganizationsBinding.recyclerView.setLayoutManager(new LinearLayoutManager(context));
|
fragmentOrganizationsBinding.recyclerView.setLayoutManager(new LinearLayoutManager(context));
|
||||||
fragmentOrganizationsBinding.recyclerView.setAdapter(adapter);
|
fragmentOrganizationsBinding.recyclerView.setAdapter(adapter);
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,6 @@ import android.view.inputmethod.EditorInfo;
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
import androidx.recyclerview.widget.DividerItemDecoration;
|
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
import org.gitnex.tea4j.v2.models.Repository;
|
import org.gitnex.tea4j.v2.models.Repository;
|
||||||
import org.mian.gitnex.R;
|
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.setHasFixedSize(true);
|
||||||
fragmentRepositoriesBinding.recyclerView.addItemDecoration(dividerItemDecoration);
|
|
||||||
fragmentRepositoriesBinding.recyclerView.setLayoutManager(new LinearLayoutManager(context));
|
fragmentRepositoriesBinding.recyclerView.setLayoutManager(new LinearLayoutManager(context));
|
||||||
fragmentRepositoriesBinding.recyclerView.setAdapter(adapter);
|
fragmentRepositoriesBinding.recyclerView.setAdapter(adapter);
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,6 @@ import android.view.inputmethod.EditorInfo;
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
import androidx.recyclerview.widget.DividerItemDecoration;
|
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
import org.gitnex.tea4j.v2.models.Repository;
|
import org.gitnex.tea4j.v2.models.Repository;
|
||||||
import org.mian.gitnex.R;
|
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.setHasFixedSize(true);
|
||||||
fragmentRepositoriesBinding.recyclerView.addItemDecoration(dividerItemDecoration);
|
|
||||||
fragmentRepositoriesBinding.recyclerView.setLayoutManager(new LinearLayoutManager(context));
|
fragmentRepositoriesBinding.recyclerView.setLayoutManager(new LinearLayoutManager(context));
|
||||||
fragmentRepositoriesBinding.recyclerView.setAdapter(adapter);
|
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.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.ImageView;
|
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import com.amrdeveloper.codeview.Code;
|
import com.amrdeveloper.codeview.Code;
|
||||||
import com.amrdeveloper.codeview.CodeViewAdapter;
|
import com.amrdeveloper.codeview.CodeViewAdapter;
|
||||||
import com.amrdeveloper.codeview.Snippet;
|
|
||||||
import org.mian.gitnex.R;
|
import org.mian.gitnex.R;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -33,17 +31,16 @@ public class CustomCodeViewAdapter extends CodeViewAdapter {
|
||||||
convertView = layoutInflater.inflate(R.layout.list_items_autocomplete, parent, false);
|
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);
|
TextView codeTitle = convertView.findViewById(R.id.code_title);
|
||||||
Code currentCode = (Code) getItem(position);
|
Code currentCode = (Code) getItem(position);
|
||||||
if(currentCode != null) {
|
if(currentCode != null) {
|
||||||
codeTitle.setText(currentCode.getCodeTitle());
|
codeTitle.setText(currentCode.getCodeTitle());
|
||||||
if(currentCode instanceof Snippet) {
|
/*if (currentCode instanceof Snippet) {
|
||||||
codeType.setImageResource(R.drawable.ic_snippet);
|
//codeType.setImageResource(R.drawable.ic_snippet);
|
||||||
}
|
} else {
|
||||||
else {
|
//codeType.setImageResource(R.drawable.ic_keyword);
|
||||||
codeType.setImageResource(R.drawable.ic_keyword);
|
}*/
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return convertView;
|
return convertView;
|
||||||
|
|
|
@ -4,9 +4,11 @@ import android.content.Context;
|
||||||
import com.amrdeveloper.codeview.Code;
|
import com.amrdeveloper.codeview.Code;
|
||||||
import com.amrdeveloper.codeview.CodeView;
|
import com.amrdeveloper.codeview.CodeView;
|
||||||
import org.mian.gitnex.helpers.codeeditor.languages.GoLanguage;
|
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.JavaLanguage;
|
||||||
import org.mian.gitnex.helpers.codeeditor.languages.PhpLanguage;
|
import org.mian.gitnex.helpers.codeeditor.languages.PhpLanguage;
|
||||||
import org.mian.gitnex.helpers.codeeditor.languages.PythonLanguage;
|
import org.mian.gitnex.helpers.codeeditor.languages.PythonLanguage;
|
||||||
|
import org.mian.gitnex.helpers.codeeditor.languages.XmlLanguage;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -44,6 +46,10 @@ public class LanguageManager {
|
||||||
return GoLanguage.getKeywords(context);
|
return GoLanguage.getKeywords(context);
|
||||||
case PHP:
|
case PHP:
|
||||||
return PhpLanguage.getKeywords(context);
|
return PhpLanguage.getKeywords(context);
|
||||||
|
case XML:
|
||||||
|
return XmlLanguage.getKeywords(context);
|
||||||
|
case HTML:
|
||||||
|
return HtmlLanguage.getKeywords(context);
|
||||||
default:
|
default:
|
||||||
return new String[]{};
|
return new String[]{};
|
||||||
}
|
}
|
||||||
|
@ -59,6 +65,10 @@ public class LanguageManager {
|
||||||
return GoLanguage.getCodeList(context);
|
return GoLanguage.getCodeList(context);
|
||||||
case PHP:
|
case PHP:
|
||||||
return PhpLanguage.getCodeList(context);
|
return PhpLanguage.getCodeList(context);
|
||||||
|
case XML:
|
||||||
|
return XmlLanguage.getCodeList(context);
|
||||||
|
case HTML:
|
||||||
|
return HtmlLanguage.getCodeList(context);
|
||||||
default:
|
default:
|
||||||
return new ArrayList<>();
|
return new ArrayList<>();
|
||||||
}
|
}
|
||||||
|
@ -74,6 +84,10 @@ public class LanguageManager {
|
||||||
return GoLanguage.getIndentationStarts();
|
return GoLanguage.getIndentationStarts();
|
||||||
case PHP:
|
case PHP:
|
||||||
return PhpLanguage.getIndentationStarts();
|
return PhpLanguage.getIndentationStarts();
|
||||||
|
case XML:
|
||||||
|
return XmlLanguage.getIndentationStarts();
|
||||||
|
case HTML:
|
||||||
|
return HtmlLanguage.getIndentationStarts();
|
||||||
default:
|
default:
|
||||||
return new HashSet<>();
|
return new HashSet<>();
|
||||||
}
|
}
|
||||||
|
@ -89,6 +103,10 @@ public class LanguageManager {
|
||||||
return GoLanguage.getIndentationEnds();
|
return GoLanguage.getIndentationEnds();
|
||||||
case PHP:
|
case PHP:
|
||||||
return PhpLanguage.getIndentationEnds();
|
return PhpLanguage.getIndentationEnds();
|
||||||
|
case XML:
|
||||||
|
return XmlLanguage.getIndentationEnds();
|
||||||
|
case HTML:
|
||||||
|
return HtmlLanguage.getIndentationEnds();
|
||||||
default:
|
default:
|
||||||
return new HashSet<>();
|
return new HashSet<>();
|
||||||
}
|
}
|
||||||
|
@ -108,6 +126,12 @@ public class LanguageManager {
|
||||||
case PHP:
|
case PHP:
|
||||||
PhpLanguage.applyFiveColorsDarkTheme(context, codeView);
|
PhpLanguage.applyFiveColorsDarkTheme(context, codeView);
|
||||||
break;
|
break;
|
||||||
|
case XML:
|
||||||
|
XmlLanguage.applyFiveColorsDarkTheme(context, codeView);
|
||||||
|
break;
|
||||||
|
case HTML:
|
||||||
|
HtmlLanguage.applyFiveColorsDarkTheme(context, codeView);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -10,5 +10,7 @@ public enum LanguageName {
|
||||||
JAVA, // java
|
JAVA, // java
|
||||||
PY, // python with py extension
|
PY, // python with py extension
|
||||||
GO, // go lang
|
GO, // go lang
|
||||||
PHP // php
|
PHP, // php
|
||||||
|
XML, // xml
|
||||||
|
HTML // html
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,35 +12,6 @@ import android.widget.EditText;
|
||||||
|
|
||||||
public class SourcePositionListener {
|
public class SourcePositionListener {
|
||||||
|
|
||||||
private final EditText editText;
|
|
||||||
private OnPositionChanged onPositionChanged;
|
|
||||||
private final View.AccessibilityDelegate viewAccessibility = new View.AccessibilityDelegate() {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void sendAccessibilityEvent(View host, int eventType) {
|
|
||||||
super.sendAccessibilityEvent(host, eventType);
|
|
||||||
if(eventType == AccessibilityEvent.TYPE_VIEW_TEXT_SELECTION_CHANGED && onPositionChanged != null) {
|
|
||||||
int selectionStart = editText.getSelectionStart();
|
|
||||||
Layout layout = editText.getLayout();
|
|
||||||
if(layout == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
int line = editText.getLayout().getLineForOffset(selectionStart);
|
|
||||||
int column = selectionStart - editText.getLayout().getLineStart(line);
|
|
||||||
onPositionChanged.onPositionChange(line + 1, column + 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
public SourcePositionListener(EditText editText) {
|
|
||||||
this.editText = editText;
|
|
||||||
editText.setAccessibilityDelegate(viewAccessibility);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setOnPositionChanged(OnPositionChanged listener) {
|
|
||||||
onPositionChanged = listener;
|
|
||||||
}
|
|
||||||
|
|
||||||
@FunctionalInterface
|
@FunctionalInterface
|
||||||
public interface OnPositionChanged {
|
public interface OnPositionChanged {
|
||||||
|
|
||||||
|
@ -48,4 +19,31 @@ public class SourcePositionListener {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private OnPositionChanged onPositionChanged;
|
||||||
|
|
||||||
|
public SourcePositionListener(EditText editText) {
|
||||||
|
View.AccessibilityDelegate viewAccessibility = new View.AccessibilityDelegate() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void sendAccessibilityEvent(View host, int eventType) {
|
||||||
|
super.sendAccessibilityEvent(host, eventType);
|
||||||
|
if(eventType == AccessibilityEvent.TYPE_VIEW_TEXT_SELECTION_CHANGED && onPositionChanged != null) {
|
||||||
|
int selectionStart = editText.getSelectionStart();
|
||||||
|
Layout layout = editText.getLayout();
|
||||||
|
if(layout == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
int line = editText.getLayout().getLineForOffset(selectionStart);
|
||||||
|
int column = selectionStart - editText.getLayout().getLineStart(line);
|
||||||
|
onPositionChanged.onPositionChange(line + 1, column + 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
editText.setAccessibilityDelegate(viewAccessibility);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOnPositionChanged(OnPositionChanged listener) {
|
||||||
|
onPositionChanged = listener;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
//Language Keywords
|
||||||
private static final Pattern PATTERN_KEYWORDS = Pattern.compile(
|
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
|
//Brackets and Colons
|
||||||
private static final Pattern PATTERN_BUILTINS = Pattern.compile("[,:;[->]{}()]");
|
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.KeyStoreException;
|
||||||
import java.security.MessageDigest;
|
import java.security.MessageDigest;
|
||||||
import java.security.NoSuchAlgorithmException;
|
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.text.SimpleDateFormat;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Enumeration;
|
import java.util.Enumeration;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Locale;
|
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
|
* @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"
|
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:shape="rectangle">
|
android:shape="rectangle">
|
||||||
|
|
||||||
<corners android:radius="3dp"/>
|
<corners android:radius="@dimen/dimen8dp"/>
|
||||||
<solid android:color="@color/releasePre"/>
|
<solid android:color="@color/releasePre"/>
|
||||||
|
|
||||||
</shape>
|
</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"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout android:layout_width="match_parent"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="?attr/primaryBackgroundColor"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical"
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:background="?attr/primaryBackgroundColor">
|
||||||
|
|
||||||
<com.google.android.material.appbar.AppBarLayout
|
<com.google.android.material.appbar.AppBarLayout
|
||||||
android:id="@+id/appbar"
|
android:id="@+id/appbar"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
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
|
<com.google.android.material.appbar.MaterialToolbar
|
||||||
android:id="@+id/toolbar"
|
android:id="@+id/toolbar"
|
||||||
|
@ -23,13 +23,13 @@
|
||||||
android:id="@+id/close"
|
android:id="@+id/close"
|
||||||
android:layout_width="@dimen/dimen26dp"
|
android:layout_width="@dimen/dimen26dp"
|
||||||
android:layout_height="@dimen/dimen26dp"
|
android:layout_height="@dimen/dimen26dp"
|
||||||
android:layout_marginStart="@dimen/dimen16dp"
|
|
||||||
android:layout_marginEnd="@dimen/dimen16dp"
|
android:layout_marginEnd="@dimen/dimen16dp"
|
||||||
android:background="?android:attr/selectableItemBackgroundBorderless"
|
android:layout_marginStart="@dimen/dimen16dp"
|
||||||
android:clickable="true"
|
|
||||||
android:contentDescription="@string/close"
|
|
||||||
android:focusable="true"
|
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
|
android:contentDescription="@string/close"
|
||||||
|
android:background="?android:attr/selectableItemBackgroundBorderless"
|
||||||
|
android:focusable="true"
|
||||||
|
android:clickable="true"
|
||||||
android:src="@drawable/ic_close"/>
|
android:src="@drawable/ic_close"/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
@ -37,9 +37,9 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
android:maxLines="1"
|
|
||||||
android:text="@string/collaborator"
|
android:text="@string/collaborator"
|
||||||
android:textColor="?attr/primaryTextColor"
|
android:textColor="?attr/primaryTextColor"
|
||||||
|
android:maxLines="1"
|
||||||
android:textSize="@dimen/dimen20sp"/>
|
android:textSize="@dimen/dimen20sp"/>
|
||||||
|
|
||||||
</com.google.android.material.appbar.MaterialToolbar>
|
</com.google.android.material.appbar.MaterialToolbar>
|
||||||
|
@ -48,10 +48,10 @@
|
||||||
|
|
||||||
<com.google.android.material.progressindicator.LinearProgressIndicator
|
<com.google.android.material.progressindicator.LinearProgressIndicator
|
||||||
android:id="@+id/progressBar"
|
android:id="@+id/progressBar"
|
||||||
style="@style/Widget.MaterialComponents.LinearProgressIndicator"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:indeterminate="true"
|
android:indeterminate="true"
|
||||||
|
style="@style/Widget.MaterialComponents.LinearProgressIndicator"
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
app:indicatorColor="?attr/progressIndicatorColor"/>
|
app:indicatorColor="?attr/progressIndicatorColor"/>
|
||||||
|
|
||||||
|
@ -59,36 +59,36 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="@dimen/dimen10dp"
|
android:layout_marginStart="@dimen/dimen10dp"
|
||||||
android:layout_marginTop="@dimen/dimen10dp"
|
|
||||||
android:layout_marginEnd="@dimen/dimen10dp"
|
android:layout_marginEnd="@dimen/dimen10dp"
|
||||||
|
android:layout_marginTop="@dimen/dimen10dp"
|
||||||
android:layout_marginBottom="@dimen/dimen10dp">
|
android:layout_marginBottom="@dimen/dimen10dp">
|
||||||
|
|
||||||
<com.google.android.material.textfield.TextInputLayout
|
<com.google.android.material.textfield.TextInputLayout
|
||||||
android:id="@+id/addCollaboratorSearchLayout"
|
android:id="@+id/addCollaboratorSearchLayout"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
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_marginTop="@dimen/dimen8dp"
|
||||||
android:layout_marginBottom="@dimen/dimen8dp"
|
android:layout_marginBottom="@dimen/dimen8dp"
|
||||||
android:hint="@string/addCollaboratorSearchHint"
|
app:startIconDrawable="@drawable/ic_search"
|
||||||
android:textColorHint="?attr/hintColor"
|
app:startIconTint="?attr/iconsColor"
|
||||||
app:boxBackgroundColor="?attr/inputBackgroundColor"
|
|
||||||
app:boxStrokeErrorColor="@color/darkRed"
|
|
||||||
app:endIconMode="clear_text"
|
app:endIconMode="clear_text"
|
||||||
app:endIconTint="?attr/iconsColor"
|
app:endIconTint="?attr/iconsColor"
|
||||||
app:hintTextColor="?attr/hintColor"
|
android:hint="@string/addCollaboratorSearchHint">
|
||||||
app:startIconDrawable="@drawable/ic_search"
|
|
||||||
app:startIconTint="?attr/iconsColor">
|
|
||||||
|
|
||||||
<com.google.android.material.textfield.TextInputEditText
|
<com.google.android.material.textfield.TextInputEditText
|
||||||
android:id="@+id/addCollaboratorSearch"
|
android:id="@+id/addCollaboratorSearch"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:imeOptions="actionSend"
|
|
||||||
android:inputType="text"
|
|
||||||
android:singleLine="true"
|
|
||||||
android:textColor="?attr/inputTextColor"
|
android:textColor="?attr/inputTextColor"
|
||||||
android:textColorHighlight="?attr/hintColor"
|
android:textColorHighlight="?attr/hintColor"
|
||||||
android:textColorHint="?attr/hintColor"
|
android:textColorHint="?attr/hintColor"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:imeOptions="actionSend"
|
||||||
|
android:inputType="text"
|
||||||
android:textSize="@dimen/dimen16sp"/>
|
android:textSize="@dimen/dimen16sp"/>
|
||||||
|
|
||||||
</com.google.android.material.textfield.TextInputLayout>
|
</com.google.android.material.textfield.TextInputLayout>
|
||||||
|
@ -106,15 +106,17 @@
|
||||||
android:textSize="@dimen/dimen20sp"
|
android:textSize="@dimen/dimen20sp"
|
||||||
android:visibility="gone"/>
|
android:visibility="gone"/>
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
<FrameLayout
|
||||||
android:id="@+id/recyclerViewUserSearch"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="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:background="?attr/primaryBackgroundColor"
|
||||||
android:scrollbars="vertical"/>
|
android:padding="@dimen/dimen8dp">
|
||||||
|
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/recyclerViewUserSearch"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"/>
|
||||||
|
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
|
@ -1,17 +1,17 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout android:layout_width="match_parent"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="?attr/primaryBackgroundColor"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical"
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:background="?attr/primaryBackgroundColor">
|
||||||
|
|
||||||
<com.google.android.material.appbar.AppBarLayout
|
<com.google.android.material.appbar.AppBarLayout
|
||||||
android:id="@+id/appbar"
|
android:id="@+id/appbar"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
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
|
<com.google.android.material.appbar.MaterialToolbar
|
||||||
android:id="@+id/toolbar"
|
android:id="@+id/toolbar"
|
||||||
|
@ -23,13 +23,13 @@
|
||||||
android:id="@+id/close"
|
android:id="@+id/close"
|
||||||
android:layout_width="@dimen/dimen26dp"
|
android:layout_width="@dimen/dimen26dp"
|
||||||
android:layout_height="@dimen/dimen26dp"
|
android:layout_height="@dimen/dimen26dp"
|
||||||
android:layout_marginStart="@dimen/dimen16dp"
|
|
||||||
android:layout_marginEnd="@dimen/dimen16dp"
|
android:layout_marginEnd="@dimen/dimen16dp"
|
||||||
android:background="?android:attr/selectableItemBackgroundBorderless"
|
android:layout_marginStart="@dimen/dimen16dp"
|
||||||
android:clickable="true"
|
|
||||||
android:contentDescription="@string/close"
|
|
||||||
android:focusable="true"
|
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
|
android:contentDescription="@string/close"
|
||||||
|
android:background="?android:attr/selectableItemBackgroundBorderless"
|
||||||
|
android:focusable="true"
|
||||||
|
android:clickable="true"
|
||||||
android:src="@drawable/ic_close"/>
|
android:src="@drawable/ic_close"/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
@ -37,9 +37,9 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
android:maxLines="1"
|
|
||||||
android:text="@string/addRemove"
|
android:text="@string/addRemove"
|
||||||
android:textColor="?attr/primaryTextColor"
|
android:textColor="?attr/primaryTextColor"
|
||||||
|
android:maxLines="1"
|
||||||
android:textSize="@dimen/dimen20sp"/>
|
android:textSize="@dimen/dimen20sp"/>
|
||||||
|
|
||||||
</com.google.android.material.appbar.MaterialToolbar>
|
</com.google.android.material.appbar.MaterialToolbar>
|
||||||
|
@ -48,46 +48,46 @@
|
||||||
|
|
||||||
<com.google.android.material.progressindicator.LinearProgressIndicator
|
<com.google.android.material.progressindicator.LinearProgressIndicator
|
||||||
android:id="@+id/progress_bar"
|
android:id="@+id/progress_bar"
|
||||||
style="@style/Widget.MaterialComponents.LinearProgressIndicator"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:indeterminate="true"
|
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
|
android:indeterminate="true"
|
||||||
|
style="@style/Widget.MaterialComponents.LinearProgressIndicator"
|
||||||
app:indicatorColor="?attr/progressIndicatorColor"/>
|
app:indicatorColor="?attr/progressIndicatorColor"/>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="@dimen/dimen10dp"
|
android:layout_marginStart="@dimen/dimen10dp"
|
||||||
android:layout_marginTop="@dimen/dimen10dp"
|
|
||||||
android:layout_marginEnd="@dimen/dimen10dp"
|
android:layout_marginEnd="@dimen/dimen10dp"
|
||||||
|
android:layout_marginTop="@dimen/dimen10dp"
|
||||||
android:layout_marginBottom="@dimen/dimen10dp">
|
android:layout_marginBottom="@dimen/dimen10dp">
|
||||||
|
|
||||||
<com.google.android.material.textfield.TextInputLayout
|
<com.google.android.material.textfield.TextInputLayout
|
||||||
android:id="@+id/addNewTeamMemberLayout"
|
android:id="@+id/addNewTeamMemberLayout"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
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_marginTop="@dimen/dimen8dp"
|
||||||
android:layout_marginBottom="@dimen/dimen8dp"
|
android:layout_marginBottom="@dimen/dimen8dp"
|
||||||
android:hint="@string/addCollaboratorSearchHint"
|
app:startIconDrawable="@drawable/ic_search"
|
||||||
android:textColorHint="?attr/hintColor"
|
app:startIconTint="?attr/iconsColor"
|
||||||
app:boxBackgroundColor="?attr/inputBackgroundColor"
|
|
||||||
app:boxStrokeErrorColor="@color/darkRed"
|
|
||||||
app:endIconMode="clear_text"
|
app:endIconMode="clear_text"
|
||||||
app:endIconTint="?attr/iconsColor"
|
app:endIconTint="?attr/iconsColor"
|
||||||
app:hintTextColor="?attr/hintColor"
|
android:hint="@string/addCollaboratorSearchHint">
|
||||||
app:startIconDrawable="@drawable/ic_search"
|
|
||||||
app:startIconTint="?attr/iconsColor">
|
|
||||||
|
|
||||||
<com.google.android.material.textfield.TextInputEditText
|
<com.google.android.material.textfield.TextInputEditText
|
||||||
android:id="@+id/addNewTeamMember"
|
android:id="@+id/addNewTeamMember"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:inputType="text"
|
|
||||||
android:singleLine="true"
|
|
||||||
android:textColor="?attr/inputTextColor"
|
android:textColor="?attr/inputTextColor"
|
||||||
android:textColorHighlight="?attr/hintColor"
|
android:textColorHighlight="?attr/hintColor"
|
||||||
android:textColorHint="?attr/hintColor"
|
android:textColorHint="?attr/hintColor"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:inputType="text"
|
||||||
android:textSize="@dimen/dimen16sp"/>
|
android:textSize="@dimen/dimen16sp"/>
|
||||||
|
|
||||||
</com.google.android.material.textfield.TextInputLayout>
|
</com.google.android.material.textfield.TextInputLayout>
|
||||||
|
@ -105,15 +105,17 @@
|
||||||
android:textSize="@dimen/dimen20sp"
|
android:textSize="@dimen/dimen20sp"
|
||||||
android:visibility="gone"/>
|
android:visibility="gone"/>
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
<FrameLayout
|
||||||
android:id="@+id/recyclerViewUserSearch"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="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:background="?attr/primaryBackgroundColor"
|
||||||
android:scrollbars="vertical"/>
|
android:padding="@dimen/dimen8dp">
|
||||||
|
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/recyclerViewUserSearch"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"/>
|
||||||
|
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
|
@ -1,18 +1,17 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<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_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:background="?attr/primaryBackgroundColor"
|
android:background="?attr/primaryBackgroundColor"
|
||||||
android:fitsSystemWindows="true"
|
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<com.google.android.material.appbar.AppBarLayout
|
<com.google.android.material.appbar.AppBarLayout
|
||||||
android:id="@+id/appbar"
|
android:id="@+id/appbar"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
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
|
<com.google.android.material.appbar.MaterialToolbar
|
||||||
android:id="@+id/toolbar"
|
android:id="@+id/toolbar"
|
||||||
|
@ -24,13 +23,13 @@
|
||||||
android:id="@+id/close"
|
android:id="@+id/close"
|
||||||
android:layout_width="@dimen/dimen26dp"
|
android:layout_width="@dimen/dimen26dp"
|
||||||
android:layout_height="@dimen/dimen26dp"
|
android:layout_height="@dimen/dimen26dp"
|
||||||
android:layout_marginStart="@dimen/dimen16dp"
|
|
||||||
android:layout_marginEnd="@dimen/dimen16dp"
|
android:layout_marginEnd="@dimen/dimen16dp"
|
||||||
android:background="?android:attr/selectableItemBackgroundBorderless"
|
android:layout_marginStart="@dimen/dimen16dp"
|
||||||
android:clickable="true"
|
|
||||||
android:contentDescription="@string/close"
|
|
||||||
android:focusable="true"
|
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
|
android:contentDescription="@string/close"
|
||||||
|
android:background="?android:attr/selectableItemBackgroundBorderless"
|
||||||
|
android:focusable="true"
|
||||||
|
android:clickable="true"
|
||||||
android:src="@drawable/ic_close"/>
|
android:src="@drawable/ic_close"/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
@ -38,40 +37,45 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
android:maxLines="1"
|
|
||||||
android:text="@string/adminCron"
|
android:text="@string/adminCron"
|
||||||
android:textColor="?attr/primaryTextColor"
|
android:textColor="?attr/primaryTextColor"
|
||||||
|
android:maxLines="1"
|
||||||
android:textSize="@dimen/dimen20sp"/>
|
android:textSize="@dimen/dimen20sp"/>
|
||||||
|
|
||||||
</com.google.android.material.appbar.MaterialToolbar>
|
</com.google.android.material.appbar.MaterialToolbar>
|
||||||
|
|
||||||
</com.google.android.material.appbar.AppBarLayout>
|
</com.google.android.material.appbar.AppBarLayout>
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
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">
|
||||||
|
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/recyclerView"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"/>
|
||||||
|
|
||||||
|
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||||
|
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
<com.google.android.material.progressindicator.LinearProgressIndicator
|
<com.google.android.material.progressindicator.LinearProgressIndicator
|
||||||
android:id="@+id/progress_bar"
|
android:id="@+id/progress_bar"
|
||||||
style="@style/Widget.MaterialComponents.LinearProgressIndicator"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_below="@+id/appbar"
|
android:layout_marginTop="@dimen/dimen56dp"
|
||||||
android:indeterminate="true"
|
android:indeterminate="true"
|
||||||
android:visibility="visible"
|
style="@style/Widget.Material3.LinearProgressIndicator"
|
||||||
app:indicatorColor="?attr/progressIndicatorColor"/>
|
app:indicatorColor="?attr/progressIndicatorColor"/>
|
||||||
|
|
||||||
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
|
||||||
android:id="@+id/pullToRefresh"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_below="@+id/progress_bar">
|
|
||||||
|
|
||||||
<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"/>
|
|
||||||
|
|
||||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/noData"
|
android:id="@+id/noData"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
|
|
@ -1,17 +1,38 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<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_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="?attr/primaryBackgroundColor"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical"
|
||||||
|
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/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
|
<com.google.android.material.appbar.AppBarLayout
|
||||||
android:id="@+id/appbar"
|
android:id="@+id/appbar"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
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
|
<com.google.android.material.appbar.MaterialToolbar
|
||||||
android:id="@+id/toolbar"
|
android:id="@+id/toolbar"
|
||||||
|
@ -23,13 +44,13 @@
|
||||||
android:id="@+id/close"
|
android:id="@+id/close"
|
||||||
android:layout_width="@dimen/dimen26dp"
|
android:layout_width="@dimen/dimen26dp"
|
||||||
android:layout_height="@dimen/dimen26dp"
|
android:layout_height="@dimen/dimen26dp"
|
||||||
android:layout_marginStart="@dimen/dimen16dp"
|
|
||||||
android:layout_marginEnd="@dimen/dimen16dp"
|
android:layout_marginEnd="@dimen/dimen16dp"
|
||||||
android:background="?android:attr/selectableItemBackgroundBorderless"
|
android:layout_marginStart="@dimen/dimen16dp"
|
||||||
android:clickable="true"
|
|
||||||
android:contentDescription="@string/close"
|
|
||||||
android:focusable="true"
|
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
|
android:contentDescription="@string/close"
|
||||||
|
android:background="?android:attr/selectableItemBackgroundBorderless"
|
||||||
|
android:focusable="true"
|
||||||
|
android:clickable="true"
|
||||||
android:src="@drawable/ic_close"/>
|
android:src="@drawable/ic_close"/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
@ -37,40 +58,25 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
android:layout_marginEnd="@dimen/dimen20dp"
|
android:text="@string/adminUsers"
|
||||||
|
android:textColor="?attr/primaryTextColor"
|
||||||
android:ellipsize="none"
|
android:ellipsize="none"
|
||||||
android:scrollbars="horizontal"
|
android:scrollbars="horizontal"
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:text="@string/adminUsers"
|
android:layout_marginEnd="@dimen/dimen20dp"
|
||||||
android:textColor="?attr/primaryTextColor"
|
|
||||||
android:textSize="@dimen/dimen20sp"/>
|
android:textSize="@dimen/dimen20sp"/>
|
||||||
|
|
||||||
</com.google.android.material.appbar.MaterialToolbar>
|
</com.google.android.material.appbar.MaterialToolbar>
|
||||||
|
|
||||||
</com.google.android.material.appbar.AppBarLayout>
|
</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
|
<com.google.android.material.progressindicator.LinearProgressIndicator
|
||||||
android:id="@+id/progress_bar"
|
android:id="@+id/progress_bar"
|
||||||
style="@style/Widget.Material3.LinearProgressIndicator"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="@dimen/dimen56dp"
|
android:layout_marginTop="@dimen/dimen56dp"
|
||||||
android:indeterminate="true"
|
android:indeterminate="true"
|
||||||
|
style="@style/Widget.Material3.LinearProgressIndicator"
|
||||||
app:indicatorColor="?attr/progressIndicatorColor"/>
|
app:indicatorColor="?attr/progressIndicatorColor"/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
|
|
@ -52,15 +52,21 @@
|
||||||
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
||||||
android:id="@+id/pullToRefresh"
|
android:id="@+id/pullToRefresh"
|
||||||
android:layout_width="match_parent"
|
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">
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
<RelativeLayout
|
||||||
android:id="@+id/recyclerView"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="?attr/primaryBackgroundColor"
|
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"/>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||||
|
|
||||||
|
|
|
@ -1,19 +1,19 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<androidx.coordinatorlayout.widget.CoordinatorLayout
|
<androidx.coordinatorlayout.widget.CoordinatorLayout
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="?attr/primaryBackgroundColor"
|
android:orientation="vertical"
|
||||||
android:orientation="vertical">
|
android:background="?attr/primaryBackgroundColor">
|
||||||
|
|
||||||
<com.google.android.material.appbar.AppBarLayout
|
<com.google.android.material.appbar.AppBarLayout
|
||||||
android:id="@+id/appbar"
|
android:id="@+id/appbar"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
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
|
<com.google.android.material.appbar.MaterialToolbar
|
||||||
android:id="@+id/toolbar"
|
android:id="@+id/toolbar"
|
||||||
|
@ -25,20 +25,20 @@
|
||||||
android:id="@+id/issuePrState"
|
android:id="@+id/issuePrState"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:contentDescription="@string/generalImgContentText"
|
android:src="@drawable/ic_issue"
|
||||||
android:paddingStart="@dimen/dimen0dp"
|
android:paddingStart="@dimen/dimen0dp"
|
||||||
android:paddingEnd="@dimen/dimen8dp"
|
android:paddingEnd="@dimen/dimen8dp"
|
||||||
android:src="@drawable/ic_issue"
|
android:visibility="gone"
|
||||||
android:visibility="gone"/>
|
android:contentDescription="@string/generalImgContentText"/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/toolbar_title"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
|
android:textSize="@dimen/dimen20sp"
|
||||||
android:textColor="?attr/primaryTextColor"
|
android:textColor="?attr/primaryTextColor"
|
||||||
android:textSize="@dimen/dimen20sp"/>
|
android:id="@+id/toolbar_title"/>
|
||||||
|
|
||||||
</com.google.android.material.appbar.MaterialToolbar>
|
</com.google.android.material.appbar.MaterialToolbar>
|
||||||
|
|
||||||
|
@ -46,31 +46,31 @@
|
||||||
|
|
||||||
<com.google.android.material.progressindicator.LinearProgressIndicator
|
<com.google.android.material.progressindicator.LinearProgressIndicator
|
||||||
android:id="@+id/progressBar"
|
android:id="@+id/progressBar"
|
||||||
style="@style/Widget.Material3.LinearProgressIndicator"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="@dimen/dimen56dp"
|
android:layout_marginTop="@dimen/dimen56dp"
|
||||||
android:indeterminate="true"
|
android:indeterminate="true"
|
||||||
|
style="@style/Widget.Material3.LinearProgressIndicator"
|
||||||
app:indicatorColor="?attr/progressIndicatorColor"/>
|
app:indicatorColor="?attr/progressIndicatorColor"/>
|
||||||
|
|
||||||
<com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton
|
<com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton
|
||||||
android:id="@+id/addNewComment"
|
android:id="@+id/addNewComment"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="bottom|end"
|
|
||||||
android:layout_margin="@dimen/dimen16dp"
|
android:layout_margin="@dimen/dimen16dp"
|
||||||
android:backgroundTint="?attr/fabColor"
|
|
||||||
android:contentDescription="@string/commentButtonText"
|
|
||||||
android:text="@string/commentButtonText"
|
android:text="@string/commentButtonText"
|
||||||
|
android:contentDescription="@string/commentButtonText"
|
||||||
android:textColor="@color/colorWhite"
|
android:textColor="@color/colorWhite"
|
||||||
app:icon="@drawable/ic_reply"
|
android:backgroundTint="?attr/fabColor"
|
||||||
app:iconTint="@color/colorWhite"/>
|
android:layout_gravity="bottom|end"
|
||||||
|
app:iconTint="@color/colorWhite"
|
||||||
|
app:icon="@drawable/ic_reply"/>
|
||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:id="@+id/relativeMainLayoutFrame"
|
android:id="@+id/relativeMainLayoutFrame"
|
||||||
android:layout_width="match_parent"
|
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
|
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
||||||
android:id="@+id/pullToRefresh"
|
android:id="@+id/pullToRefresh"
|
||||||
|
@ -78,230 +78,241 @@
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
<androidx.core.widget.NestedScrollView
|
<androidx.core.widget.NestedScrollView
|
||||||
android:id="@+id/scrollViewComments"
|
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:id="@+id/scrollViewComments"
|
||||||
android:fillViewport="true">
|
android:fillViewport="true">
|
||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:id="@+id/relativeLayoutFrame"
|
android:id="@+id/relativeLayoutFrame"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content"
|
||||||
|
android:padding="@dimen/dimen8dp">
|
||||||
|
|
||||||
<RelativeLayout
|
<com.google.android.material.card.MaterialCardView
|
||||||
android:id="@+id/mainIssueLayout"
|
android:id="@+id/mainThreadCard"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical"
|
style="?attr/materialCardViewFilledStyle"
|
||||||
android:padding="@dimen/dimen16dp">
|
android:layout_marginBottom="@dimen/dimen4dp"
|
||||||
|
app:cardElevation="@dimen/dimen0dp">
|
||||||
<com.google.android.material.card.MaterialCardView
|
|
||||||
android:id="@+id/assigneeAvatarFrame"
|
|
||||||
style="?attr/materialCardViewFilledStyle"
|
|
||||||
android:layout_width="@dimen/dimen24dp"
|
|
||||||
android:layout_height="@dimen/dimen24dp"
|
|
||||||
android:layout_marginEnd="@dimen/dimen12dp"
|
|
||||||
app:cardCornerRadius="@dimen/dimen12dp"
|
|
||||||
app:cardElevation="@dimen/dimen0dp">
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:id="@+id/assigneeAvatar"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:contentDescription="@string/generalImgContentText"/>
|
|
||||||
|
|
||||||
</com.google.android.material.card.MaterialCardView>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/issueTitle"
|
|
||||||
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"
|
|
||||||
android:textSize="@dimen/dimen16sp"/>
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/msdueFrame"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_below="@+id/issueTitle"
|
android:foreground="?android:attr/selectableItemBackground"
|
||||||
android:layout_marginTop="@dimen/dimen10dp"
|
android:background="?attr/materialCardBackgroundColor"
|
||||||
android:layout_toEndOf="@+id/assigneeAvatarFrame"
|
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<LinearLayout
|
<RelativeLayout
|
||||||
android:id="@+id/dueDateFrame"
|
android:id="@+id/mainIssueLayout"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:gravity="end|center_vertical"
|
android:orientation="vertical"
|
||||||
android:orientation="horizontal"
|
android:padding="@dimen/dimen16dp">
|
||||||
android:visibility="gone"
|
|
||||||
tools:ignore="UseCompoundDrawables">
|
|
||||||
|
|
||||||
<ImageView
|
<com.google.android.material.card.MaterialCardView
|
||||||
android:layout_width="@dimen/dimen20dp"
|
android:id="@+id/assigneeAvatarFrame"
|
||||||
android:layout_height="wrap_content"
|
android:layout_width="@dimen/dimen24dp"
|
||||||
android:contentDescription="@string/generalImgContentText"
|
android:layout_height="@dimen/dimen24dp"
|
||||||
app:srcCompat="@drawable/ic_calendar"/>
|
style="?attr/materialCardViewFilledStyle"
|
||||||
|
app:cardElevation="@dimen/dimen0dp"
|
||||||
|
android:layout_marginEnd="@dimen/dimen12dp"
|
||||||
|
app:cardCornerRadius="@dimen/dimen12dp">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/assigneeAvatar"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:contentDescription="@string/generalImgContentText"/>
|
||||||
|
|
||||||
|
</com.google.android.material.card.MaterialCardView>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/issueDueDate"
|
android:id="@+id/issueTitle"
|
||||||
android:layout_width="wrap_content"
|
android:layout_toEndOf="@+id/assigneeAvatarFrame"
|
||||||
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="@dimen/dimen8dp"
|
android:gravity="start"
|
||||||
android:singleLine="true"
|
|
||||||
android:textColor="?attr/primaryTextColor"
|
android:textColor="?attr/primaryTextColor"
|
||||||
|
android:textIsSelectable="true"
|
||||||
|
android:textSize="@dimen/dimen16sp"/>
|
||||||
|
|
||||||
|
<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_marginTop="@dimen/dimen10dp"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/dueDateFrame"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="end|center_vertical"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:visibility="gone"
|
||||||
|
tools:ignore="UseCompoundDrawables">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="@dimen/dimen20dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:srcCompat="@drawable/ic_calendar"
|
||||||
|
android:contentDescription="@string/generalImgContentText"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/issueDueDate"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="@dimen/dimen8dp"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:textColor="?attr/primaryTextColor"
|
||||||
|
android:textSize="@dimen/dimen14sp"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/milestoneFrame"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="end|center_vertical"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:visibility="gone"
|
||||||
|
tools:ignore="UseCompoundDrawables">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="@dimen/dimen20dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:srcCompat="@drawable/ic_milestone"
|
||||||
|
android:contentDescription="@string/generalImgContentText"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/issueMilestone"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="@dimen/dimen8dp"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:textColor="?attr/primaryTextColor"
|
||||||
|
android:textSize="@dimen/dimen14sp"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<HorizontalScrollView
|
||||||
|
android:layout_below="@+id/msdueFrame"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:id="@+id/assigneesScrollView"
|
||||||
|
android:layout_alignParentEnd="false"
|
||||||
|
android:foregroundGravity="right"
|
||||||
|
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:gravity="end"
|
||||||
|
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:gravity="start"
|
||||||
|
android:textColor="?attr/primaryTextColor"
|
||||||
|
android:autoLink="web"
|
||||||
|
android:textColorLink="@color/lightBlue"
|
||||||
|
android:textIsSelectable="true"
|
||||||
android:textSize="@dimen/dimen14sp"/>
|
android:textSize="@dimen/dimen14sp"/>
|
||||||
|
|
||||||
</LinearLayout>
|
<HorizontalScrollView
|
||||||
|
android:layout_below="@+id/issueDescription"
|
||||||
<LinearLayout
|
android:layout_width="match_parent"
|
||||||
android:id="@+id/milestoneFrame"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:gravity="end|center_vertical"
|
|
||||||
android:orientation="horizontal"
|
|
||||||
android:visibility="gone"
|
|
||||||
tools:ignore="UseCompoundDrawables">
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:layout_width="@dimen/dimen20dp"
|
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:contentDescription="@string/generalImgContentText"
|
android:id="@+id/labelsScrollView"
|
||||||
app:srcCompat="@drawable/ic_milestone"/>
|
android:layout_alignParentEnd="false"
|
||||||
|
android:foregroundGravity="right"
|
||||||
|
android:scrollbarThumbHorizontal="@android:color/transparent"
|
||||||
|
android:fillViewport="true">
|
||||||
|
|
||||||
<TextView
|
<LinearLayout
|
||||||
android:id="@+id/issueMilestone"
|
android:id="@+id/frameLabels"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:layout_marginTop="@dimen/dimen10dp">
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
</HorizontalScrollView>
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="@dimen/dimen8dp"
|
android:id="@+id/issueTimeFrame"
|
||||||
android:singleLine="true"
|
android:layout_below="@+id/labelsScrollView"
|
||||||
android:textColor="?attr/primaryTextColor"
|
android:orientation="horizontal"
|
||||||
android:textSize="@dimen/dimen14sp"/>
|
android:layout_marginTop="@dimen/dimen10dp">
|
||||||
|
|
||||||
</LinearLayout>
|
<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"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/issueModified"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textColor="?attr/hintColor"
|
||||||
|
android:layout_toEndOf="@+id/issueCreatedTime"
|
||||||
|
android:textSize="@dimen/dimen12sp"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:text="@string/modifiedText"/>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/commentReactionBadges"
|
||||||
|
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"/>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<HorizontalScrollView
|
</com.google.android.material.card.MaterialCardView>
|
||||||
android:id="@+id/assigneesScrollView"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_below="@+id/msdueFrame"
|
|
||||||
android:layout_alignParentEnd="false"
|
|
||||||
android:fillViewport="true"
|
|
||||||
android:foregroundGravity="right"
|
|
||||||
android:scrollbarThumbHorizontal="@android:color/transparent">
|
|
||||||
|
|
||||||
<LinearLayout
|
<FrameLayout
|
||||||
android:id="@+id/frameAssignees"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity="end"
|
|
||||||
android:layout_marginTop="@dimen/dimen10dp"
|
|
||||||
android:gravity="end"
|
|
||||||
android:orientation="horizontal">
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
</HorizontalScrollView>
|
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
|
||||||
android:id="@+id/issueDescription"
|
|
||||||
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:textColorLink="@color/lightBlue"
|
|
||||||
android:textIsSelectable="true"
|
|
||||||
android:textSize="@dimen/dimen14sp"/>
|
|
||||||
|
|
||||||
<HorizontalScrollView
|
|
||||||
android:id="@+id/labelsScrollView"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_below="@+id/issueDescription"
|
|
||||||
android:layout_alignParentEnd="false"
|
|
||||||
android:fillViewport="true"
|
|
||||||
android:foregroundGravity="right"
|
|
||||||
android:scrollbarThumbHorizontal="@android:color/transparent">
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/frameLabels"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginTop="@dimen/dimen10dp"
|
|
||||||
android:orientation="horizontal">
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
</HorizontalScrollView>
|
|
||||||
|
|
||||||
<RelativeLayout
|
|
||||||
android:id="@+id/issueTimeFrame"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_below="@+id/labelsScrollView"
|
|
||||||
android:layout_marginTop="@dimen/dimen10dp"
|
|
||||||
android:orientation="horizontal">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/issueCreatedTime"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:gravity="start"
|
|
||||||
android:textColor="?attr/hintColor"
|
|
||||||
android:textSize="@dimen/dimen12sp"
|
|
||||||
android:visibility="gone"/>
|
|
||||||
|
|
||||||
<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:textSize="@dimen/dimen12sp"
|
|
||||||
android:visibility="gone"/>
|
|
||||||
|
|
||||||
</RelativeLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/commentReactionBadges"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_below="@+id/issueTimeFrame"
|
|
||||||
android:layout_marginTop="@dimen/dimen10dp"
|
|
||||||
android:orientation="horizontal"
|
|
||||||
android:visibility="gone"/>
|
|
||||||
|
|
||||||
</RelativeLayout>
|
|
||||||
|
|
||||||
<View
|
|
||||||
android:id="@+id/divider"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="@dimen/dimen1dp"
|
android:layout_height="match_parent"
|
||||||
android:layout_below="@id/mainIssueLayout"
|
android:background="?attr/primaryBackgroundColor"
|
||||||
android:background="?attr/dividerColor"
|
android:layout_below="@+id/mainThreadCard">
|
||||||
android:visibility="gone"/>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_below="@+id/divider">
|
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
android:id="@+id/recyclerView"
|
android:id="@+id/recyclerView"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="?attr/primaryBackgroundColor"
|
android:paddingBottom="@dimen/dimen72dp"
|
||||||
android:clipToPadding="false"
|
android:clipToPadding="false"/>
|
||||||
android:paddingBottom="@dimen/dimen64dp"
|
|
||||||
android:scrollbars="vertical"/>
|
|
||||||
|
|
||||||
</LinearLayout>
|
</FrameLayout>
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
|
|
|
@ -3,10 +3,10 @@
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:id="@+id/drawer_layout"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
tools:context=".activities.MainActivity"
|
tools:context=".activities.MainActivity"
|
||||||
|
android:id="@+id/drawer_layout"
|
||||||
tools:openDrawer="start">
|
tools:openDrawer="start">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
@ -15,22 +15,22 @@
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<com.google.android.material.appbar.MaterialToolbar
|
<com.google.android.material.appbar.MaterialToolbar
|
||||||
android:id="@+id/toolbar"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="?attr/actionBarSize"
|
android:layout_height="?attr/actionBarSize"
|
||||||
android:background="?attr/primaryBackgroundColor"
|
android:background="?attr/primaryBackgroundColor"
|
||||||
android:elevation="@dimen/dimen0dp"
|
android:id="@+id/toolbar"
|
||||||
|
app:titleTextColor="?attr/primaryTextColor"
|
||||||
android:theme="@style/Widget.AppCompat.SearchView"
|
android:theme="@style/Widget.AppCompat.SearchView"
|
||||||
app:titleTextColor="?attr/primaryTextColor">
|
android:elevation="@dimen/dimen0dp">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/toolbar_title"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
|
android:textSize="@dimen/dimen20sp"
|
||||||
android:textColor="?attr/primaryTextColor"
|
android:textColor="?attr/primaryTextColor"
|
||||||
android:textSize="@dimen/dimen20sp"/>
|
android:id="@+id/toolbar_title"/>
|
||||||
|
|
||||||
</com.google.android.material.appbar.MaterialToolbar>
|
</com.google.android.material.appbar.MaterialToolbar>
|
||||||
|
|
||||||
|
@ -42,11 +42,12 @@
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<com.google.android.material.navigation.NavigationView
|
<com.google.android.material.navigation.NavigationView
|
||||||
android:id="@+id/nav_view"
|
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_gravity="start"
|
android:layout_gravity="start"
|
||||||
|
android:id="@+id/nav_view"
|
||||||
app:headerLayout="@layout/nav_header"
|
app:headerLayout="@layout/nav_header"
|
||||||
|
android:background="?attr/primaryBackgroundColor"
|
||||||
app:menu="@menu/drawer_menu"/>
|
app:menu="@menu/drawer_menu"/>
|
||||||
|
|
||||||
</androidx.drawerlayout.widget.DrawerLayout>
|
</androidx.drawerlayout.widget.DrawerLayout>
|
||||||
|
|
|
@ -55,12 +55,18 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="@dimen/dimen56dp">
|
android:layout_marginTop="@dimen/dimen56dp">
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
<FrameLayout
|
||||||
android:id="@+id/recyclerView"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="?attr/primaryBackgroundColor"
|
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>
|
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:background="?attr/primaryBackgroundColor"
|
android:background="?attr/primaryBackgroundColor"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
@ -11,8 +11,8 @@
|
||||||
android:id="@+id/appbar"
|
android:id="@+id/appbar"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
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
|
<com.google.android.material.appbar.MaterialToolbar
|
||||||
android:id="@+id/toolbar"
|
android:id="@+id/toolbar"
|
||||||
|
@ -24,13 +24,13 @@
|
||||||
android:id="@+id/close"
|
android:id="@+id/close"
|
||||||
android:layout_width="@dimen/dimen26dp"
|
android:layout_width="@dimen/dimen26dp"
|
||||||
android:layout_height="@dimen/dimen26dp"
|
android:layout_height="@dimen/dimen26dp"
|
||||||
android:layout_marginStart="@dimen/dimen16dp"
|
|
||||||
android:layout_marginEnd="@dimen/dimen16dp"
|
android:layout_marginEnd="@dimen/dimen16dp"
|
||||||
android:background="?android:attr/selectableItemBackgroundBorderless"
|
android:layout_marginStart="@dimen/dimen16dp"
|
||||||
android:clickable="true"
|
|
||||||
android:contentDescription="@string/close"
|
|
||||||
android:focusable="true"
|
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
|
android:contentDescription="@string/close"
|
||||||
|
android:background="?android:attr/selectableItemBackgroundBorderless"
|
||||||
|
android:focusable="true"
|
||||||
|
android:clickable="true"
|
||||||
android:src="@drawable/ic_close"/>
|
android:src="@drawable/ic_close"/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
@ -38,8 +38,8 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
android:maxLines="1"
|
|
||||||
android:textColor="?attr/primaryTextColor"
|
android:textColor="?attr/primaryTextColor"
|
||||||
|
android:maxLines="1"
|
||||||
android:textSize="@dimen/dimen20sp"/>
|
android:textSize="@dimen/dimen20sp"/>
|
||||||
|
|
||||||
</com.google.android.material.appbar.MaterialToolbar>
|
</com.google.android.material.appbar.MaterialToolbar>
|
||||||
|
@ -48,21 +48,20 @@
|
||||||
|
|
||||||
<GridView
|
<GridView
|
||||||
android:id="@+id/gridView"
|
android:id="@+id/gridView"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="?attr/primaryBackgroundColor"
|
android:scrollbars="none"
|
||||||
android:columnWidth="@dimen/dimen80dp"
|
android:numColumns="2"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:horizontalSpacing="@dimen/dimen10dp"
|
android:background="?attr/primaryBackgroundColor"
|
||||||
android:numColumns="4"
|
android:padding="@dimen/dimen4dp"/>
|
||||||
android:stretchMode="columnWidth"/>
|
|
||||||
|
|
||||||
<com.google.android.material.progressindicator.LinearProgressIndicator
|
<com.google.android.material.progressindicator.LinearProgressIndicator
|
||||||
android:id="@+id/progress_bar"
|
android:id="@+id/progress_bar"
|
||||||
style="@style/Widget.MaterialComponents.LinearProgressIndicator"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:indeterminate="true"
|
android:indeterminate="true"
|
||||||
|
style="@style/Widget.MaterialComponents.LinearProgressIndicator"
|
||||||
app:indicatorColor="?attr/progressIndicatorColor"/>
|
app:indicatorColor="?attr/progressIndicatorColor"/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:background="?attr/primaryBackgroundColor"
|
android:background="?attr/primaryBackgroundColor"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
@ -11,8 +11,8 @@
|
||||||
android:id="@+id/appbar"
|
android:id="@+id/appbar"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
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
|
<com.google.android.material.appbar.MaterialToolbar
|
||||||
android:id="@+id/toolbar"
|
android:id="@+id/toolbar"
|
||||||
|
@ -24,13 +24,13 @@
|
||||||
android:id="@+id/close"
|
android:id="@+id/close"
|
||||||
android:layout_width="@dimen/dimen26dp"
|
android:layout_width="@dimen/dimen26dp"
|
||||||
android:layout_height="@dimen/dimen26dp"
|
android:layout_height="@dimen/dimen26dp"
|
||||||
android:layout_marginStart="@dimen/dimen16dp"
|
|
||||||
android:layout_marginEnd="@dimen/dimen16dp"
|
android:layout_marginEnd="@dimen/dimen16dp"
|
||||||
android:background="?android:attr/selectableItemBackgroundBorderless"
|
android:layout_marginStart="@dimen/dimen16dp"
|
||||||
android:clickable="true"
|
|
||||||
android:contentDescription="@string/close"
|
|
||||||
android:focusable="true"
|
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
|
android:contentDescription="@string/close"
|
||||||
|
android:background="?android:attr/selectableItemBackgroundBorderless"
|
||||||
|
android:focusable="true"
|
||||||
|
android:clickable="true"
|
||||||
android:src="@drawable/ic_close"/>
|
android:src="@drawable/ic_close"/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
@ -38,8 +38,8 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
android:maxLines="1"
|
|
||||||
android:textColor="?attr/primaryTextColor"
|
android:textColor="?attr/primaryTextColor"
|
||||||
|
android:maxLines="1"
|
||||||
android:textSize="@dimen/dimen20sp"/>
|
android:textSize="@dimen/dimen20sp"/>
|
||||||
|
|
||||||
</com.google.android.material.appbar.MaterialToolbar>
|
</com.google.android.material.appbar.MaterialToolbar>
|
||||||
|
@ -48,21 +48,20 @@
|
||||||
|
|
||||||
<GridView
|
<GridView
|
||||||
android:id="@+id/gridView"
|
android:id="@+id/gridView"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="?attr/primaryBackgroundColor"
|
android:background="?attr/primaryBackgroundColor"
|
||||||
android:columnWidth="@dimen/dimen80dp"
|
android:padding="@dimen/dimen4dp"
|
||||||
android:gravity="center"
|
android:scrollbars="none"
|
||||||
android:horizontalSpacing="@dimen/dimen10dp"
|
android:numColumns="2"
|
||||||
android:numColumns="4"
|
android:gravity="center"/>
|
||||||
android:stretchMode="columnWidth"/>
|
|
||||||
|
|
||||||
<com.google.android.material.progressindicator.LinearProgressIndicator
|
<com.google.android.material.progressindicator.LinearProgressIndicator
|
||||||
android:id="@+id/progress_bar"
|
android:id="@+id/progress_bar"
|
||||||
style="@style/Widget.MaterialComponents.LinearProgressIndicator"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:indeterminate="true"
|
android:indeterminate="true"
|
||||||
|
style="@style/Widget.MaterialComponents.LinearProgressIndicator"
|
||||||
app:indicatorColor="?attr/progressIndicatorColor"/>
|
app:indicatorColor="?attr/progressIndicatorColor"/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
|
|
@ -255,37 +255,51 @@
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:padding="@dimen/dimen16dp">
|
android:padding="@dimen/dimen16dp">
|
||||||
|
|
||||||
<TextView
|
<LinearLayout
|
||||||
android:id="@+id/tvLabelsInListHeader"
|
android:id="@+id/label_title_frame"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="@dimen/dimen24dp"
|
android:weightSum="100"
|
||||||
android:layout_marginEnd="@dimen/dimen48dp"
|
android:orientation="horizontal">
|
||||||
android:text="@string/settingsLabelsInListHeader"
|
|
||||||
android:textColor="?attr/primaryTextColor"
|
|
||||||
android:textSize="@dimen/dimen18sp"/>
|
|
||||||
|
|
||||||
<com.google.android.material.switchmaterial.SwitchMaterial
|
<TextView
|
||||||
android:id="@+id/switchLabelsInListBadge"
|
android:id="@+id/tvLabelsInListHeader"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="@dimen/dimen32dp"
|
android:layout_height="wrap_content"
|
||||||
android:layout_alignParentEnd="true"
|
android:layout_weight="90"
|
||||||
android:layout_gravity="end"
|
android:layout_marginStart="@dimen/dimen24dp"
|
||||||
android:layout_toEndOf="@+id/tvLabelsInListHeader"
|
android:text="@string/settingsLabelsInListHeader"
|
||||||
android:gravity="end"
|
android:textColor="?attr/primaryTextColor"
|
||||||
android:paddingStart="@dimen/dimen0dp"
|
android:textSize="@dimen/dimen18sp" />
|
||||||
android:paddingEnd="@dimen/dimen24dp"
|
|
||||||
android:switchMinWidth="@dimen/dimen56dp"/>
|
<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:paddingStart="@dimen/dimen24dp"
|
||||||
|
android:paddingEnd="@dimen/dimen24dp"
|
||||||
|
android:switchMinWidth="@dimen/dimen56dp" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="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_marginStart="@dimen/dimen24dp"
|
||||||
android:layout_marginEnd="@dimen/dimen72dp"
|
android:layout_marginEnd="@dimen/dimen72dp"
|
||||||
android:text="@string/settingsLabelsInListHint"
|
android:text="@string/settingsLabelsInListHint"
|
||||||
android:textColor="?attr/hintColor"
|
android:textColor="?attr/hintColor"
|
||||||
android:textSize="@dimen/dimen12sp"/>
|
android:textSize="@dimen/dimen12sp" />
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
|
|
|
@ -57,34 +57,47 @@
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:padding="@dimen/dimen16dp">
|
android:padding="@dimen/dimen16dp">
|
||||||
|
|
||||||
<TextView
|
<LinearLayout
|
||||||
android:id="@+id/enableCommentsDeletionHeader"
|
android:id="@+id/enableCommentsDeletionHeader"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="@dimen/dimen24dp"
|
android:weightSum="100"
|
||||||
android:layout_marginEnd="@dimen/dimen72dp"
|
android:orientation="horizontal">
|
||||||
android:text="@string/settingsEnableCommentsDeletionText"
|
|
||||||
android:textColor="?attr/primaryTextColor"
|
|
||||||
android:textSize="@dimen/dimen18sp"/>
|
|
||||||
|
|
||||||
<com.google.android.material.switchmaterial.SwitchMaterial
|
<TextView
|
||||||
android:id="@+id/commentsDeletionSwitch"
|
android:layout_width="wrap_content"
|
||||||
android:layout_width="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_height="@dimen/dimen24dp"
|
android:layout_weight="90"
|
||||||
android:layout_alignParentEnd="true"
|
android:layout_marginStart="@dimen/dimen24dp"
|
||||||
android:layout_gravity="end"
|
android:text="@string/settingsEnableCommentsDeletionText"
|
||||||
android:layout_toEndOf="@+id/enableCommentsDeletionHeader"
|
android:textColor="?attr/primaryTextColor"
|
||||||
android:gravity="end"
|
android:textSize="@dimen/dimen18sp"/>
|
||||||
android:paddingStart="@dimen/dimen0dp"
|
|
||||||
android:paddingEnd="@dimen/dimen24dp"
|
<LinearLayout
|
||||||
android:switchMinWidth="@dimen/dimen56dp"/>
|
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/dimen32dp"
|
||||||
|
android:paddingStart="@dimen/dimen24dp"
|
||||||
|
android:paddingEnd="@dimen/dimen24dp"
|
||||||
|
android:switchMinWidth="@dimen/dimen56dp"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_below="@+id/enableCommentsDeletionHeader"
|
android:layout_below="@+id/enableCommentsDeletionHeader"
|
||||||
android:layout_marginStart="@dimen/dimen24dp"
|
android:layout_marginStart="@dimen/dimen24dp"
|
||||||
android:layout_marginEnd="@dimen/dimen48dp"
|
android:layout_marginEnd="@dimen/dimen72dp"
|
||||||
android:text="@string/settingsEnableCommentsDeletionHintText"
|
android:text="@string/settingsEnableCommentsDeletionHintText"
|
||||||
android:textColor="?attr/hintColor"
|
android:textColor="?attr/hintColor"
|
||||||
android:textSize="@dimen/dimen12sp"/>
|
android:textSize="@dimen/dimen12sp"/>
|
||||||
|
|
|
@ -50,38 +50,44 @@
|
||||||
|
|
||||||
</com.google.android.material.appbar.AppBarLayout>
|
</com.google.android.material.appbar.AppBarLayout>
|
||||||
|
|
||||||
<RelativeLayout
|
<LinearLayout
|
||||||
android:id="@+id/enableNotificationsFrame"
|
android:id="@+id/enableNotificationsFrame"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginBottom="@dimen/dimen6dp"
|
android:layout_marginBottom="@dimen/dimen6dp"
|
||||||
android:background="?android:attr/selectableItemBackground"
|
android:background="?android:attr/selectableItemBackground"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
|
android:weightSum="100"
|
||||||
android:padding="@dimen/dimen16dp">
|
android:padding="@dimen/dimen16dp">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/enableNotificationsHeader"
|
android:id="@+id/enableNotificationsHeader"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="90"
|
||||||
android:layout_marginStart="@dimen/dimen24dp"
|
android:layout_marginStart="@dimen/dimen24dp"
|
||||||
android:layout_marginEnd="@dimen/dimen72dp"
|
|
||||||
android:text="@string/enableNotificationsHeaderText"
|
android:text="@string/enableNotificationsHeaderText"
|
||||||
android:textColor="?attr/primaryTextColor"
|
android:textColor="?attr/primaryTextColor"
|
||||||
android:textSize="@dimen/dimen18sp"/>
|
android:textSize="@dimen/dimen18sp"/>
|
||||||
|
|
||||||
<com.google.android.material.switchmaterial.SwitchMaterial
|
<LinearLayout
|
||||||
android:id="@+id/enableNotificationsMode"
|
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="@dimen/dimen24dp"
|
android:layout_height="wrap_content"
|
||||||
android:layout_alignParentEnd="true"
|
android:layout_weight="10"
|
||||||
android:layout_gravity="end"
|
android:gravity="center_vertical|end"
|
||||||
android:layout_toEndOf="@+id/enableNotificationsHeader"
|
android:orientation="horizontal">
|
||||||
android:gravity="end"
|
|
||||||
android:paddingStart="0dp"
|
|
||||||
android:paddingEnd="@dimen/dimen24dp"
|
|
||||||
android:switchMinWidth="@dimen/dimen56dp"/>
|
|
||||||
|
|
||||||
</RelativeLayout>
|
<com.google.android.material.switchmaterial.SwitchMaterial
|
||||||
|
android:id="@+id/enableNotificationsMode"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="@dimen/dimen32dp"
|
||||||
|
android:paddingStart="@dimen/dimen24dp"
|
||||||
|
android:paddingEnd="@dimen/dimen24dp"
|
||||||
|
android:switchMinWidth="@dimen/dimen56dp"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/pollingDelayFrame"
|
android:id="@+id/pollingDelayFrame"
|
||||||
|
|
|
@ -47,37 +47,43 @@
|
||||||
|
|
||||||
</com.google.android.material.appbar.AppBarLayout>
|
</com.google.android.material.appbar.AppBarLayout>
|
||||||
|
|
||||||
<RelativeLayout
|
<LinearLayout
|
||||||
android:id="@+id/enableSendReports"
|
android:id="@+id/enableSendReports"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginBottom="@dimen/dimen6dp"
|
android:layout_marginBottom="@dimen/dimen6dp"
|
||||||
android:background="?android:attr/selectableItemBackground"
|
android:background="?android:attr/selectableItemBackground"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
|
android:weightSum="100"
|
||||||
android:padding="@dimen/dimen16dp">
|
android:padding="@dimen/dimen16dp">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/enableReportsHeader"
|
android:id="@+id/enableReportsHeader"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="90"
|
||||||
android:layout_marginStart="@dimen/dimen24dp"
|
android:layout_marginStart="@dimen/dimen24dp"
|
||||||
android:layout_marginEnd="@dimen/dimen72dp"
|
|
||||||
android:text="@string/settingsEnableReportsText"
|
android:text="@string/settingsEnableReportsText"
|
||||||
android:textColor="?attr/primaryTextColor"
|
android:textColor="?attr/primaryTextColor"
|
||||||
android:textSize="@dimen/dimen18sp"/>
|
android:textSize="@dimen/dimen18sp"/>
|
||||||
|
|
||||||
<com.google.android.material.switchmaterial.SwitchMaterial
|
<LinearLayout
|
||||||
android:id="@+id/crashReportsSwitch"
|
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="@dimen/dimen24dp"
|
android:layout_height="wrap_content"
|
||||||
android:layout_alignParentEnd="true"
|
android:layout_weight="10"
|
||||||
android:layout_gravity="end"
|
android:gravity="center_vertical|end"
|
||||||
android:layout_toEndOf="@+id/enableReportsHeader"
|
android:orientation="horizontal">
|
||||||
android:gravity="end"
|
|
||||||
android:paddingStart="@dimen/dimen0dp"
|
|
||||||
android:paddingEnd="@dimen/dimen24dp"
|
|
||||||
android:switchMinWidth="@dimen/dimen56dp"/>
|
|
||||||
|
|
||||||
</RelativeLayout>
|
<com.google.android.material.switchmaterial.SwitchMaterial
|
||||||
|
android:id="@+id/crashReportsSwitch"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="@dimen/dimen32dp"
|
||||||
|
android:paddingStart="@dimen/dimen24dp"
|
||||||
|
android:paddingEnd="@dimen/dimen24dp"
|
||||||
|
android:switchMinWidth="@dimen/dimen56dp"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
|
@ -1,17 +1,16 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout android:layout_width="match_parent"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="?attr/primaryBackgroundColor"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical"
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
|
||||||
<com.google.android.material.appbar.AppBarLayout
|
<com.google.android.material.appbar.AppBarLayout
|
||||||
android:id="@+id/appbar"
|
android:id="@+id/appbar"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
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
|
<com.google.android.material.appbar.MaterialToolbar
|
||||||
android:id="@+id/toolbar"
|
android:id="@+id/toolbar"
|
||||||
|
@ -23,13 +22,13 @@
|
||||||
android:id="@+id/close"
|
android:id="@+id/close"
|
||||||
android:layout_width="@dimen/dimen26dp"
|
android:layout_width="@dimen/dimen26dp"
|
||||||
android:layout_height="@dimen/dimen26dp"
|
android:layout_height="@dimen/dimen26dp"
|
||||||
android:layout_marginStart="@dimen/dimen16dp"
|
|
||||||
android:layout_marginEnd="@dimen/dimen16dp"
|
android:layout_marginEnd="@dimen/dimen16dp"
|
||||||
android:background="?android:attr/selectableItemBackgroundBorderless"
|
android:layout_marginStart="@dimen/dimen16dp"
|
||||||
android:clickable="true"
|
|
||||||
android:contentDescription="@string/close"
|
|
||||||
android:focusable="true"
|
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
|
android:contentDescription="@string/close"
|
||||||
|
android:background="?android:attr/selectableItemBackgroundBorderless"
|
||||||
|
android:focusable="true"
|
||||||
|
android:clickable="true"
|
||||||
android:src="@drawable/ic_close"/>
|
android:src="@drawable/ic_close"/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
@ -37,9 +36,9 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
android:maxLines="1"
|
|
||||||
android:text="@string/addButton"
|
android:text="@string/addButton"
|
||||||
android:textColor="?attr/primaryTextColor"
|
android:textColor="?attr/primaryTextColor"
|
||||||
|
android:maxLines="1"
|
||||||
android:textSize="@dimen/dimen20sp"/>
|
android:textSize="@dimen/dimen20sp"/>
|
||||||
|
|
||||||
</com.google.android.material.appbar.MaterialToolbar>
|
</com.google.android.material.appbar.MaterialToolbar>
|
||||||
|
@ -48,11 +47,11 @@
|
||||||
|
|
||||||
<com.google.android.material.progressindicator.LinearProgressIndicator
|
<com.google.android.material.progressindicator.LinearProgressIndicator
|
||||||
android:id="@+id/progressBar"
|
android:id="@+id/progressBar"
|
||||||
style="@style/Widget.MaterialComponents.LinearProgressIndicator"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:indeterminate="true"
|
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
|
android:indeterminate="true"
|
||||||
|
style="@style/Widget.MaterialComponents.LinearProgressIndicator"
|
||||||
app:indicatorColor="?attr/progressIndicatorColor"/>
|
app:indicatorColor="?attr/progressIndicatorColor"/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
@ -66,15 +65,23 @@
|
||||||
android:textSize="@dimen/dimen20sp"
|
android:textSize="@dimen/dimen20sp"
|
||||||
android:visibility="gone"/>
|
android:visibility="gone"/>
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
<FrameLayout
|
||||||
android:id="@+id/recyclerViewTeamRepos"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="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:background="?attr/primaryBackgroundColor"
|
||||||
android:scrollbars="vertical"/>
|
android:padding="@dimen/dimen8dp">
|
||||||
|
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/recyclerViewTeamRepos"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
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>
|
</LinearLayout>
|
||||||
|
|
|
@ -1,23 +1,23 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
android:layout_marginTop="@dimen/dimen48dp"
|
||||||
|
android:layout_marginBottom="@dimen/dimen48dp"
|
||||||
android:background="@drawable/shape_round_corners"
|
android:background="@drawable/shape_round_corners"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="0dp"
|
||||||
|
android:layout_weight="1"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:padding="16dp">
|
android:padding="@dimen/dimen16dp">
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
android:id="@+id/accountsList"
|
android:id="@+id/accountsList"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent" />
|
||||||
android:background="?attr/primaryBackgroundColor"
|
|
||||||
android:scrollbars="vertical"/>
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@
|
||||||
android:id="@+id/divider"
|
android:id="@+id/divider"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="1dp"
|
android:layout_height="1dp"
|
||||||
android:background="?attr/dividerColor"/>
|
android:background="?attr/dividerColor" />
|
||||||
|
|
||||||
<com.google.android.material.button.MaterialButton
|
<com.google.android.material.button.MaterialButton
|
||||||
android:id="@+id/newAccount"
|
android:id="@+id/newAccount"
|
||||||
|
@ -37,7 +37,6 @@
|
||||||
android:text="@string/addNewAccount"
|
android:text="@string/addNewAccount"
|
||||||
android:textColor="@color/colorWhite"
|
android:textColor="@color/colorWhite"
|
||||||
android:textSize="16sp"
|
android:textSize="16sp"
|
||||||
android:textStyle="bold"/>
|
android:textStyle="bold" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
|
@ -1,28 +1,27 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<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_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:background="?attr/primaryBackgroundColor"
|
android:background="?attr/primaryBackgroundColor"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<GridView
|
<GridView
|
||||||
android:id="@+id/gridView"
|
android:id="@+id/gridView"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="fill_parent"
|
android:layout_height="wrap_content"
|
||||||
android:columnWidth="80dp"
|
android:scrollbars="none"
|
||||||
|
android:numColumns="2"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:horizontalSpacing="10dp"
|
android:background="?attr/primaryBackgroundColor"
|
||||||
android:numColumns="4"
|
android:padding="@dimen/dimen4dp"/>
|
||||||
android:padding="10dp"
|
|
||||||
android:stretchMode="columnWidth"/>
|
|
||||||
|
|
||||||
<com.google.android.material.progressindicator.LinearProgressIndicator
|
<com.google.android.material.progressindicator.LinearProgressIndicator
|
||||||
android:id="@+id/progress_bar"
|
android:id="@+id/progress_bar"
|
||||||
style="@style/Widget.MaterialComponents.LinearProgressIndicator"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:indeterminate="true"
|
android:indeterminate="true"
|
||||||
|
style="@style/Widget.MaterialComponents.LinearProgressIndicator"
|
||||||
app:indicatorColor="?attr/progressIndicatorColor"/>
|
app:indicatorColor="?attr/progressIndicatorColor"/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:theme="@style/Widget.AppCompat.SearchView"
|
android:theme="@style/Widget.AppCompat.SearchView"
|
||||||
app:elevation="0dp"
|
app:elevation="@dimen/dimen0dp"
|
||||||
app:layout_constraintTop_toTopOf="parent">
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
<com.google.android.material.appbar.MaterialToolbar
|
<com.google.android.material.appbar.MaterialToolbar
|
||||||
|
@ -39,12 +39,12 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
android:layout_marginEnd="20dp"
|
android:layout_marginEnd="@dimen/dimen20dp"
|
||||||
android:ellipsize="none"
|
android:ellipsize="none"
|
||||||
android:scrollbars="horizontal"
|
android:scrollbars="horizontal"
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:textColor="?attr/primaryTextColor"
|
android:textColor="?attr/primaryTextColor"
|
||||||
android:textSize="18sp"/>
|
android:textSize="@dimen/dimen18sp"/>
|
||||||
|
|
||||||
</com.google.android.material.appbar.MaterialToolbar>
|
</com.google.android.material.appbar.MaterialToolbar>
|
||||||
|
|
||||||
|
@ -52,10 +52,10 @@
|
||||||
|
|
||||||
<com.google.android.material.progressindicator.LinearProgressIndicator
|
<com.google.android.material.progressindicator.LinearProgressIndicator
|
||||||
android:id="@+id/progress_bar"
|
android:id="@+id/progress_bar"
|
||||||
style="@style/Widget.MaterialComponents.LinearProgressIndicator"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:indeterminate="true"
|
android:indeterminate="true"
|
||||||
|
style="@style/Widget.MaterialComponents.LinearProgressIndicator"
|
||||||
app:indicatorColor="?attr/progressIndicatorColor"/>
|
app:indicatorColor="?attr/progressIndicatorColor"/>
|
||||||
|
|
||||||
<androidx.core.widget.NestedScrollView
|
<androidx.core.widget.NestedScrollView
|
||||||
|
@ -65,108 +65,109 @@
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="?attr/primaryBackgroundColor"
|
android:padding="@dimen/dimen8dp"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<LinearLayout
|
<com.google.android.material.card.MaterialCardView
|
||||||
android:id="@+id/linearLayoutFrame"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="?attr/primaryBackgroundColor"
|
style="?attr/materialCardViewFilledStyle"
|
||||||
android:orientation="vertical"
|
android:layout_marginBottom="@dimen/dimen4dp"
|
||||||
android:padding="16dp">
|
app:cardElevation="@dimen/dimen0dp">
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/commitSubject"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginBottom="8dp"
|
|
||||||
android:textColor="?attr/primaryTextColor"
|
|
||||||
android:textSize="18sp"
|
|
||||||
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:alpha=".8"
|
|
||||||
android:textColor="?attr/primaryTextColor"
|
|
||||||
android:textSize="14sp"
|
|
||||||
tools:text="This is a test commit message"/>
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="5dp"
|
android:foreground="?android:attr/selectableItemBackground"
|
||||||
android:gravity="center_vertical"
|
android:background="?attr/materialCardBackgroundColor"
|
||||||
android:orientation="horizontal">
|
android:padding="@dimen/dimen12dp"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
<LinearLayout
|
<TextView
|
||||||
|
android:id="@+id/commitSubject"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_marginBottom="@dimen/dimen8dp"
|
||||||
|
android:textColor="?attr/primaryTextColor"
|
||||||
|
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="@dimen/dimen8dp"
|
||||||
|
android:alpha=".8"
|
||||||
|
android:textColor="?attr/primaryTextColor"
|
||||||
|
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="@dimen/dimen6dp"
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal">
|
||||||
tools:ignore="UseCompoundDrawables">
|
|
||||||
|
|
||||||
<ImageView
|
<LinearLayout
|
||||||
android:id="@+id/commitAuthorAvatar"
|
|
||||||
android:layout_width="@dimen/dimen24dp"
|
|
||||||
android:layout_height="@dimen/dimen24dp"
|
|
||||||
android:layout_marginEnd="5dp"
|
|
||||||
android:contentDescription="@string/generalImgContentText"
|
|
||||||
tools:srcCompat="@tools:sample/avatars"/>
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:id="@+id/commitCommitterAvatar"
|
|
||||||
android:layout_width="@dimen/dimen24dp"
|
|
||||||
android:layout_height="@dimen/dimen24dp"
|
|
||||||
android:layout_marginEnd="5dp"
|
|
||||||
android:contentDescription="@string/generalImgContentText"
|
|
||||||
tools:srcCompat="@tools:sample/avatars"/>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/commitAuthorAndCommitter"
|
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginEnd="10dp"
|
android:layout_weight="1"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
tools:ignore="UseCompoundDrawables">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/commitAuthorAvatar"
|
||||||
|
android:layout_width="@dimen/dimen24dp"
|
||||||
|
android:layout_height="@dimen/dimen24dp"
|
||||||
|
android:layout_marginEnd="5dp"
|
||||||
|
android:contentDescription="@string/generalImgContentText"
|
||||||
|
tools:srcCompat="@tools:sample/avatars"/>
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/commitCommitterAvatar"
|
||||||
|
android:layout_width="@dimen/dimen24dp"
|
||||||
|
android:layout_height="@dimen/dimen24dp"
|
||||||
|
android:layout_marginEnd="5dp"
|
||||||
|
android:contentDescription="@string/generalImgContentText"
|
||||||
|
tools:srcCompat="@tools:sample/avatars"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/commitAuthorAndCommitter"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginEnd="@dimen/dimen10dp"
|
||||||
|
android:textSize="@dimen/dimen12sp"
|
||||||
|
android:textColor="?attr/primaryTextColor"
|
||||||
|
tools:text="opyale authored and opyale committed"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/commitSha"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="0"
|
||||||
|
android:alpha=".8"
|
||||||
|
android:drawablePadding="@dimen/dimen10dp"
|
||||||
|
android:textSize="@dimen/dimen12sp"
|
||||||
|
android:layout_marginStart="@dimen/dimen10dp"
|
||||||
|
android:gravity="center_vertical"
|
||||||
android:textColor="?attr/primaryTextColor"
|
android:textColor="?attr/primaryTextColor"
|
||||||
android:textSize="12sp"
|
app:drawableLeftCompat="@drawable/ic_commit"
|
||||||
tools:text="opyale authored and opyale committed"/>
|
tools:text="357f3qd5s"/>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<TextView
|
|
||||||
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:gravity="center_vertical"
|
|
||||||
android:textColor="?attr/primaryTextColor"
|
|
||||||
android:textSize="12sp"
|
|
||||||
app:drawableLeftCompat="@drawable/ic_commit"
|
|
||||||
tools:text="357f3qd5s"/>
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<View
|
</com.google.android.material.card.MaterialCardView>
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="1dp"
|
|
||||||
android:background="?attr/dividerColor"/>
|
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
android:id="@+id/diff_files"
|
android:id="@+id/diff_files"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
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"/>
|
tools:listitem="@layout/list_diff_files"/>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:orientation="vertical"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent">
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<com.google.android.material.progressindicator.LinearProgressIndicator
|
<com.google.android.material.progressindicator.LinearProgressIndicator
|
||||||
android:id="@+id/progress_bar"
|
android:id="@+id/progress_bar"
|
||||||
|
@ -18,22 +18,28 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
android:layout_marginStart="20dp"
|
android:text="@string/fileDiffViewHeader"
|
||||||
android:layout_marginTop="8dp"
|
android:textColor="?attr/primaryTextColor"
|
||||||
android:layout_marginBottom="8dp"
|
|
||||||
android:ellipsize="none"
|
android:ellipsize="none"
|
||||||
android:scrollbars="horizontal"
|
android:scrollbars="horizontal"
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:text="@string/fileDiffViewHeader"
|
android:layout_marginStart="@dimen/dimen20dp"
|
||||||
android:textColor="?attr/primaryTextColor"
|
android:layout_marginTop="@dimen/dimen8dp"
|
||||||
android:textSize="15sp"
|
android:layout_marginBottom="@dimen/dimen8dp"
|
||||||
|
android:textSize="@dimen/dimen16sp"
|
||||||
android:visibility="gone"/>
|
android:visibility="gone"/>
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
<FrameLayout
|
||||||
android:id="@+id/diff_files"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="?attr/primaryBackgroundColor"
|
android:background="?attr/primaryBackgroundColor"
|
||||||
android:scrollbars="vertical"/>
|
android:padding="@dimen/dimen8dp">
|
||||||
|
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/diff_files"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"/>
|
||||||
|
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
|
@ -1,33 +1,39 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:id="@+id/draftsFrame"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:id="@+id/draftsFrame"
|
||||||
android:background="?attr/primaryBackgroundColor">
|
android:background="?attr/primaryBackgroundColor">
|
||||||
|
|
||||||
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
<FrameLayout
|
||||||
android:id="@+id/pullToRefresh"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="match_parent"
|
||||||
|
android:background="?attr/primaryBackgroundColor"
|
||||||
|
android:padding="@dimen/dimen8dp">
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
||||||
android:id="@+id/recyclerView"
|
android:id="@+id/pullToRefresh"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="wrap_content">
|
||||||
android:background="?attr/primaryBackgroundColor"
|
|
||||||
android:scrollbars="vertical"/>
|
|
||||||
|
|
||||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/recyclerView"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"/>
|
||||||
|
|
||||||
|
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||||
|
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/noData"
|
android:id="@+id/noData"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_margin="16dp"
|
android:layout_margin="16dp"
|
||||||
android:gravity="center"
|
|
||||||
android:text="@string/noDataFound"
|
android:text="@string/noDataFound"
|
||||||
android:textColor="?attr/primaryTextColor"
|
android:textColor="?attr/primaryTextColor"
|
||||||
|
android:gravity="center"
|
||||||
android:textSize="20sp"
|
android:textSize="20sp"
|
||||||
android:visibility="visible"/>
|
android:visibility="visible"/>
|
||||||
|
|
||||||
|
|
|
@ -1,17 +1,17 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:background="?attr/primaryBackgroundColor"
|
android:background="?attr/primaryBackgroundColor"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<com.google.android.material.progressindicator.LinearProgressIndicator
|
<com.google.android.material.progressindicator.LinearProgressIndicator
|
||||||
android:id="@+id/progressBar"
|
android:id="@+id/progressBar"
|
||||||
style="@style/Widget.MaterialComponents.LinearProgressIndicator"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:indeterminate="true"
|
android:indeterminate="true"
|
||||||
|
style="@style/Widget.MaterialComponents.LinearProgressIndicator"
|
||||||
app:indicatorColor="?attr/progressIndicatorColor"/>
|
app:indicatorColor="?attr/progressIndicatorColor"/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
@ -25,18 +25,24 @@
|
||||||
android:textSize="20sp"
|
android:textSize="20sp"
|
||||||
android:visibility="gone"/>
|
android:visibility="gone"/>
|
||||||
|
|
||||||
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
<FrameLayout
|
||||||
android:id="@+id/pullToRefresh"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent"
|
||||||
|
android:background="?attr/primaryBackgroundColor"
|
||||||
|
android:padding="@dimen/dimen8dp">
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
||||||
android:id="@+id/recyclerViewReposSearch"
|
android:id="@+id/pullToRefresh"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent">
|
||||||
android:background="?attr/primaryBackgroundColor"
|
|
||||||
android:scrollbars="vertical"/>
|
|
||||||
|
|
||||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/recyclerViewReposSearch"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"/>
|
||||||
|
|
||||||
|
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||||
|
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
|
@ -1,17 +1,17 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:background="?attr/primaryBackgroundColor"
|
android:background="?attr/primaryBackgroundColor"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<com.google.android.material.progressindicator.LinearProgressIndicator
|
<com.google.android.material.progressindicator.LinearProgressIndicator
|
||||||
android:id="@+id/progressBar"
|
android:id="@+id/progressBar"
|
||||||
style="@style/Widget.MaterialComponents.LinearProgressIndicator"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:indeterminate="true"
|
android:indeterminate="true"
|
||||||
|
style="@style/Widget.MaterialComponents.LinearProgressIndicator"
|
||||||
app:indicatorColor="?attr/progressIndicatorColor"/>
|
app:indicatorColor="?attr/progressIndicatorColor"/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
@ -25,18 +25,24 @@
|
||||||
android:textSize="20sp"
|
android:textSize="20sp"
|
||||||
android:visibility="gone"/>
|
android:visibility="gone"/>
|
||||||
|
|
||||||
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
<FrameLayout
|
||||||
android:id="@+id/pullToRefresh"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent"
|
||||||
|
android:background="?attr/primaryBackgroundColor"
|
||||||
|
android:padding="@dimen/dimen8dp">
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
||||||
android:id="@+id/recyclerViewExploreUsers"
|
android:id="@+id/pullToRefresh"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent">
|
||||||
android:background="?attr/primaryBackgroundColor"
|
|
||||||
android:scrollbars="vertical"/>
|
|
||||||
|
|
||||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/recyclerViewExploreUsers"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"/>
|
||||||
|
|
||||||
|
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||||
|
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
|
@ -15,29 +15,53 @@
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
tools:visibility="visible">
|
tools:visibility="visible">
|
||||||
|
|
||||||
<moe.feng.common.view.breadcrumbs.BreadcrumbsView
|
<com.google.android.material.card.MaterialCardView
|
||||||
android:id="@+id/breadcrumbs_view"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:saveEnabled="false"
|
style="?attr/materialCardViewFilledStyle"
|
||||||
android:text="@string/filesBreadcrumbRoot"
|
android:layout_margin="@dimen/dimen8dp"
|
||||||
app:CustomTextSize="16sp"
|
app:cardElevation="@dimen/dimen0dp">
|
||||||
app:SelectedTextColor="?attr/primaryTextColor"
|
|
||||||
app:UnSelectedTextColor="@color/lightGray"/>
|
|
||||||
|
|
||||||
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
<LinearLayout
|
||||||
android:id="@+id/pullToRefresh"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content">
|
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
|
||||||
android:id="@+id/recyclerView"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="wrap_content"
|
||||||
android:background="?attr/primaryBackgroundColor"
|
android:foreground="?android:attr/selectableItemBackground"
|
||||||
android:scrollbars="vertical"/>
|
android:background="?attr/materialCardBackgroundColor"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
<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="@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"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/recyclerView"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"/>
|
||||||
|
|
||||||
|
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||||
|
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
|
@ -1,31 +1,37 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<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"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
tools:context=".activities.RepoDetailActivity">
|
tools:context=".activities.RepoDetailActivity">
|
||||||
|
|
||||||
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
<FrameLayout
|
||||||
android:id="@+id/pullToRefresh"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="match_parent"
|
||||||
|
android:background="?attr/primaryBackgroundColor"
|
||||||
|
android:padding="@dimen/dimen8dp">
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
||||||
android:id="@+id/recyclerView"
|
android:id="@+id/pullToRefresh"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="wrap_content">
|
||||||
android:background="?attr/primaryBackgroundColor"
|
|
||||||
android:scrollbars="vertical"/>
|
|
||||||
|
|
||||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/recyclerView"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"/>
|
||||||
|
|
||||||
|
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||||
|
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
<com.google.android.material.progressindicator.LinearProgressIndicator
|
<com.google.android.material.progressindicator.LinearProgressIndicator
|
||||||
android:id="@+id/progressBar"
|
android:id="@+id/progressBar"
|
||||||
style="@style/Widget.MaterialComponents.LinearProgressIndicator"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:indeterminate="true"
|
android:indeterminate="true"
|
||||||
|
style="@style/Widget.MaterialComponents.LinearProgressIndicator"
|
||||||
app:indicatorColor="?attr/progressIndicatorColor"/>
|
app:indicatorColor="?attr/progressIndicatorColor"/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
@ -33,9 +39,9 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_margin="15dp"
|
android:layout_margin="15dp"
|
||||||
android:gravity="center"
|
|
||||||
android:text="@string/noDataFound"
|
android:text="@string/noDataFound"
|
||||||
android:textColor="?attr/primaryTextColor"
|
android:textColor="?attr/primaryTextColor"
|
||||||
|
android:gravity="center"
|
||||||
android:textSize="18sp"
|
android:textSize="18sp"
|
||||||
android:visibility="gone"/>
|
android:visibility="gone"/>
|
||||||
|
|
||||||
|
|
|
@ -1,31 +1,37 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<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"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
tools:context=".activities.RepoDetailActivity">
|
tools:context=".activities.RepoDetailActivity">
|
||||||
|
|
||||||
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
<FrameLayout
|
||||||
android:id="@+id/pullToRefresh"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="match_parent"
|
||||||
|
android:background="?attr/primaryBackgroundColor"
|
||||||
|
android:padding="@dimen/dimen8dp">
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
||||||
android:id="@+id/recyclerView"
|
android:id="@+id/pullToRefresh"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="wrap_content">
|
||||||
android:background="?attr/primaryBackgroundColor"
|
|
||||||
android:scrollbars="vertical"/>
|
|
||||||
|
|
||||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/recyclerView"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"/>
|
||||||
|
|
||||||
|
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||||
|
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
<com.google.android.material.progressindicator.LinearProgressIndicator
|
<com.google.android.material.progressindicator.LinearProgressIndicator
|
||||||
android:id="@+id/progressBar"
|
android:id="@+id/progressBar"
|
||||||
style="@style/Widget.MaterialComponents.LinearProgressIndicator"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:indeterminate="true"
|
android:indeterminate="true"
|
||||||
|
style="@style/Widget.MaterialComponents.LinearProgressIndicator"
|
||||||
app:indicatorColor="?attr/progressIndicatorColor"/>
|
app:indicatorColor="?attr/progressIndicatorColor"/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
|
|
@ -1,40 +1,46 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<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"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
tools:context=".activities.RepoDetailActivity">
|
tools:context=".activities.RepoDetailActivity">
|
||||||
|
|
||||||
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
<FrameLayout
|
||||||
android:id="@+id/pullToRefresh"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="match_parent"
|
||||||
|
android:background="?attr/primaryBackgroundColor"
|
||||||
|
android:padding="@dimen/dimen8dp">
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
||||||
android:id="@+id/recyclerView"
|
android:id="@+id/pullToRefresh"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="wrap_content">
|
||||||
android:background="?attr/primaryBackgroundColor"
|
|
||||||
android:scrollbars="vertical"/>
|
|
||||||
|
|
||||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/recyclerView"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"/>
|
||||||
|
|
||||||
|
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||||
|
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
<com.google.android.material.progressindicator.LinearProgressIndicator
|
<com.google.android.material.progressindicator.LinearProgressIndicator
|
||||||
android:id="@+id/progress_bar"
|
android:id="@+id/progress_bar"
|
||||||
style="@style/Widget.MaterialComponents.LinearProgressIndicator"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:indeterminate="true"
|
android:indeterminate="true"
|
||||||
|
style="@style/Widget.MaterialComponents.LinearProgressIndicator"
|
||||||
app:indicatorColor="?attr/progressIndicatorColor"/>
|
app:indicatorColor="?attr/progressIndicatorColor"/>
|
||||||
|
|
||||||
<com.google.android.material.progressindicator.LinearProgressIndicator
|
<com.google.android.material.progressindicator.LinearProgressIndicator
|
||||||
android:id="@+id/progressLoadMore"
|
android:id="@+id/progressLoadMore"
|
||||||
style="@style/Widget.MaterialComponents.LinearProgressIndicator"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:indeterminate="true"
|
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
|
android:indeterminate="true"
|
||||||
|
style="@style/Widget.MaterialComponents.LinearProgressIndicator"
|
||||||
app:indicatorColor="?attr/progressIndicatorColor"/>
|
app:indicatorColor="?attr/progressIndicatorColor"/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue