Public organizations (#906)
Closes #903 Co-authored-by: M M Arif <mmarif@swatian.com> Co-authored-by: opyale <opyale@noreply.codeberg.org> Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/906 Reviewed-by: opyale <opyale@noreply.codeberg.org> Co-authored-by: M M Arif <mmarif@noreply.codeberg.org> Co-committed-by: M M Arif <mmarif@noreply.codeberg.org>
This commit is contained in:
parent
a9f1010add
commit
3b3b0ada2f
@ -9,7 +9,7 @@ GitNex is a free/paid, open-source Android client for Git repository management
|
|||||||
GitNex is licensed under GPLv3 License. See the LICENSE file for the full license text. **No trackers are used** and source code is available here for anyone to audit.
|
GitNex is licensed under GPLv3 License. See the LICENSE file for the full license text. **No trackers are used** and source code is available here for anyone to audit.
|
||||||
|
|
||||||
## Downloads
|
## Downloads
|
||||||
[<img alt='Get it on F-droid' src='https://gitlab.com/fdroid/artwork/raw/main/badge/get-it-on.png' height="80"/>](https://f-droid.org/en/packages/org.mian.gitnex/)
|
[<img alt='Get it on F-droid' src='https://gitlab.com/fdroid/artwork/raw/master/badge/get-it-on.png' height="80"/>](https://f-droid.org/en/packages/org.mian.gitnex/)
|
||||||
[<img alt='Get it on Google Play' src='https://play.google.com/intl/en_us/badges/images/generic/en_badge_web_generic.png' height="80"/>](https://play.google.com/store/apps/details?id=org.mian.gitnex.pro)
|
[<img alt='Get it on Google Play' src='https://play.google.com/intl/en_us/badges/images/generic/en_badge_web_generic.png' height="80"/>](https://play.google.com/store/apps/details?id=org.mian.gitnex.pro)
|
||||||
[<img alt='Download builds and releases' src='https://codeberg.org/gitnex/GitNex/raw/branch/main/assets/apk-badge.png' height="82"/>](https://cloud.swatian.com/s/DN7E5xxtaw4fRbE)
|
[<img alt='Download builds and releases' src='https://codeberg.org/gitnex/GitNex/raw/branch/main/assets/apk-badge.png' height="82"/>](https://cloud.swatian.com/s/DN7E5xxtaw4fRbE)
|
||||||
|
|
||||||
|
@ -56,7 +56,7 @@ configurations {
|
|||||||
dependencies {
|
dependencies {
|
||||||
def lifecycle_version = '2.3.1'
|
def lifecycle_version = '2.3.1'
|
||||||
def markwon_version = '4.6.2'
|
def markwon_version = '4.6.2'
|
||||||
def work_version = "2.5.0"
|
def work_version = "2.7.0-alpha03"
|
||||||
def acra = "5.7.0"
|
def acra = "5.7.0"
|
||||||
|
|
||||||
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
||||||
@ -103,12 +103,12 @@ dependencies {
|
|||||||
implementation "ch.acra:acra-mail:$acra"
|
implementation "ch.acra:acra-mail:$acra"
|
||||||
implementation "ch.acra:acra-limiter:$acra"
|
implementation "ch.acra:acra-limiter:$acra"
|
||||||
implementation "ch.acra:acra-notification:$acra"
|
implementation "ch.acra:acra-notification:$acra"
|
||||||
implementation 'androidx.room:room-runtime:2.2.6'
|
implementation 'androidx.room:room-runtime:2.3.0'
|
||||||
annotationProcessor 'androidx.room:room-compiler:2.2.6'
|
annotationProcessor 'androidx.room:room-compiler:2.3.0'
|
||||||
implementation "androidx.work:work-runtime:$work_version"
|
implementation "androidx.work:work-runtime:$work_version"
|
||||||
implementation "io.mikael:urlbuilder:2.0.9"
|
implementation "io.mikael:urlbuilder:2.0.9"
|
||||||
implementation "org.codeberg.gitnex-garage:emoji-java:v5.1.2"
|
implementation "org.codeberg.gitnex-garage:emoji-java:v5.1.2"
|
||||||
implementation "org.codeberg.gitnex:tea4j:1.0.5"
|
implementation "org.codeberg.gitnex:tea4j:1.0.10"
|
||||||
coreLibraryDesugaring "com.android.tools:desugar_jdk_libs:1.1.5"
|
coreLibraryDesugaring "com.android.tools:desugar_jdk_libs:1.1.5"
|
||||||
implementation 'androidx.biometric:biometric:1.1.0'
|
implementation 'androidx.biometric:biometric:1.1.0'
|
||||||
implementation 'com.github.chrisvest:stormpot:2.4.1'
|
implementation 'com.github.chrisvest:stormpot:2.4.1'
|
||||||
|
@ -0,0 +1,148 @@
|
|||||||
|
package org.mian.gitnex.adapters;
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.ImageView;
|
||||||
|
import android.widget.TextView;
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
import org.gitnex.tea4j.models.Organization;
|
||||||
|
import org.mian.gitnex.R;
|
||||||
|
import org.mian.gitnex.activities.OrganizationDetailActivity;
|
||||||
|
import org.mian.gitnex.clients.PicassoService;
|
||||||
|
import org.mian.gitnex.helpers.AppUtil;
|
||||||
|
import org.mian.gitnex.helpers.RoundedTransformation;
|
||||||
|
import org.mian.gitnex.helpers.TinyDB;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Author M M Arif
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class PublicOrganizationsAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
|
||||||
|
|
||||||
|
private final Context context;
|
||||||
|
private final int TYPE_LOAD = 0;
|
||||||
|
private List<Organization> organizationsList;
|
||||||
|
private OnLoadMoreListener loadMoreListener;
|
||||||
|
private boolean isLoading = false, isMoreDataAvailable = true;
|
||||||
|
|
||||||
|
public PublicOrganizationsAdapter(Context ctx, List<Organization> organizationsListMain) {
|
||||||
|
this.context = ctx;
|
||||||
|
this.organizationsList = organizationsListMain;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
|
@Override
|
||||||
|
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||||
|
LayoutInflater inflater = LayoutInflater.from(context);
|
||||||
|
if(viewType == TYPE_LOAD) {
|
||||||
|
return new PublicOrganizationsAdapter.OrganizationsHolder(inflater.inflate(R.layout.list_organizations, parent, false));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return new PublicOrganizationsAdapter.LoadHolder(inflater.inflate(R.layout.row_load, parent, false));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||||
|
if(position >= getItemCount() - 1 && isMoreDataAvailable && !isLoading && loadMoreListener != null) {
|
||||||
|
isLoading = true;
|
||||||
|
loadMoreListener.onLoadMore();
|
||||||
|
}
|
||||||
|
|
||||||
|
if(getItemViewType(position) == TYPE_LOAD) {
|
||||||
|
((PublicOrganizationsAdapter.OrganizationsHolder) holder).bindData(organizationsList.get(position));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getItemViewType(int position) {
|
||||||
|
if(organizationsList.get(position).getFull_name() != null) {
|
||||||
|
return TYPE_LOAD;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getItemCount() {
|
||||||
|
return organizationsList.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
class OrganizationsHolder extends RecyclerView.ViewHolder {
|
||||||
|
private Organization organization;
|
||||||
|
private final ImageView image;
|
||||||
|
private final TextView orgName;
|
||||||
|
private final TextView orgDescription;
|
||||||
|
|
||||||
|
OrganizationsHolder(View itemView) {
|
||||||
|
super(itemView);
|
||||||
|
image = itemView.findViewById(R.id.imageAvatar);
|
||||||
|
orgName = itemView.findViewById(R.id.orgName);
|
||||||
|
orgDescription = itemView.findViewById(R.id.orgDescription);
|
||||||
|
|
||||||
|
itemView.setOnClickListener(v -> {
|
||||||
|
Context context = v.getContext();
|
||||||
|
Intent intent = new Intent(context, OrganizationDetailActivity.class);
|
||||||
|
intent.putExtra("orgName", organization.getUsername());
|
||||||
|
|
||||||
|
TinyDB tinyDb = TinyDB.getInstance(context);
|
||||||
|
tinyDb.putString("orgName", organization.getUsername());
|
||||||
|
tinyDb.putString("organizationId", String.valueOf(organization.getId()));
|
||||||
|
tinyDb.putBoolean("organizationAction", true);
|
||||||
|
context.startActivity(intent);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressLint("SetTextI18n")
|
||||||
|
void bindData(Organization organization) {
|
||||||
|
this.organization = organization;
|
||||||
|
int imgRadius = AppUtil.getPixelsFromDensity(context, 3);
|
||||||
|
orgName.setText(organization.getUsername());
|
||||||
|
PicassoService.getInstance(context).get()
|
||||||
|
.load(organization.getAvatar_url())
|
||||||
|
.placeholder(R.drawable.loader_animated)
|
||||||
|
.transform(new RoundedTransformation(imgRadius, 0))
|
||||||
|
.resize(120, 120)
|
||||||
|
.centerCrop()
|
||||||
|
.into(image);
|
||||||
|
if (!organization.getDescription().equals("")) {
|
||||||
|
orgDescription.setText(organization.getDescription());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static class LoadHolder extends RecyclerView.ViewHolder {
|
||||||
|
LoadHolder(View itemView) {
|
||||||
|
super(itemView);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMoreDataAvailable(boolean moreDataAvailable) {
|
||||||
|
isMoreDataAvailable = moreDataAvailable;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void notifyDataChanged() {
|
||||||
|
notifyDataSetChanged();
|
||||||
|
isLoading = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface OnLoadMoreListener {
|
||||||
|
void onLoadMore();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLoadMoreListener(OnLoadMoreListener loadMoreListener) {
|
||||||
|
this.loadMoreListener = loadMoreListener;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void updateList(List<Organization> list) {
|
||||||
|
organizationsList = list;
|
||||||
|
notifyDataSetChanged();
|
||||||
|
}
|
||||||
|
}
|
@ -24,9 +24,6 @@ import org.mian.gitnex.helpers.TinyDB;
|
|||||||
|
|
||||||
public class ExploreFragment extends Fragment {
|
public class ExploreFragment extends Fragment {
|
||||||
|
|
||||||
private Context ctx;
|
|
||||||
private TinyDB tinyDB;
|
|
||||||
|
|
||||||
private int tabsCount;
|
private int tabsCount;
|
||||||
public ViewPager mViewPager;
|
public ViewPager mViewPager;
|
||||||
|
|
||||||
@ -36,8 +33,8 @@ public class ExploreFragment extends Fragment {
|
|||||||
|
|
||||||
View view = inflater.inflate(R.layout.fragment_explore, container, false);
|
View view = inflater.inflate(R.layout.fragment_explore, container, false);
|
||||||
|
|
||||||
ctx = getContext();
|
Context ctx = getContext();
|
||||||
tinyDB = TinyDB.getInstance(ctx);
|
TinyDB tinyDB = TinyDB.getInstance(ctx);
|
||||||
|
|
||||||
((MainActivity) requireActivity()).setActionBarTitle(getResources().getString(R.string.navExplore));
|
((MainActivity) requireActivity()).setActionBarTitle(getResources().getString(R.string.navExplore));
|
||||||
|
|
||||||
@ -111,7 +108,11 @@ public class ExploreFragment extends Fragment {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 1: // Issues
|
case 1: // Issues
|
||||||
fragment = new SearchIssuesFragment();
|
fragment = new ExploreIssuesFragment();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 2: // Organizations
|
||||||
|
fragment = new ExplorePublicOrganizationsFragment();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,7 +19,6 @@ import org.mian.gitnex.databinding.FragmentSearchIssuesBinding;
|
|||||||
import org.mian.gitnex.helpers.AppUtil;
|
import org.mian.gitnex.helpers.AppUtil;
|
||||||
import org.mian.gitnex.helpers.Authorization;
|
import org.mian.gitnex.helpers.Authorization;
|
||||||
import org.mian.gitnex.helpers.InfiniteScrollListener;
|
import org.mian.gitnex.helpers.InfiniteScrollListener;
|
||||||
import org.mian.gitnex.helpers.TinyDB;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
@ -31,27 +30,22 @@ import retrofit2.Response;
|
|||||||
* Author M M Arif
|
* Author M M Arif
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class SearchIssuesFragment extends Fragment {
|
public class ExploreIssuesFragment extends Fragment {
|
||||||
|
|
||||||
private Context ctx;
|
|
||||||
private TinyDB tinyDb;
|
|
||||||
private FragmentSearchIssuesBinding viewBinding;
|
private FragmentSearchIssuesBinding viewBinding;
|
||||||
private SearchIssuesAdapter adapter;
|
private SearchIssuesAdapter adapter;
|
||||||
private List<Issues> dataList;
|
private List<Issues> dataList;
|
||||||
|
Context ctx;
|
||||||
|
|
||||||
private int apiCallCurrentValue = 10;
|
private int apiCallCurrentValue = 10;
|
||||||
private int pageCurrentIndex = 1;
|
private int pageCurrentIndex = 1;
|
||||||
private String type = "issues";
|
|
||||||
private String state = "open";
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||||
|
|
||||||
viewBinding = FragmentSearchIssuesBinding.inflate(inflater, container, false);
|
viewBinding = FragmentSearchIssuesBinding.inflate(inflater, container, false);
|
||||||
setHasOptionsMenu(true);
|
setHasOptionsMenu(true);
|
||||||
|
|
||||||
ctx = getContext();
|
ctx = getContext();
|
||||||
tinyDb = TinyDB.getInstance(getContext());
|
|
||||||
|
|
||||||
dataList = new ArrayList<>();
|
dataList = new ArrayList<>();
|
||||||
adapter = new SearchIssuesAdapter(dataList, ctx);
|
adapter = new SearchIssuesAdapter(dataList, ctx);
|
||||||
@ -65,11 +59,8 @@ public class SearchIssuesFragment extends Fragment {
|
|||||||
viewBinding.recyclerViewSearchIssues.setAdapter(adapter);
|
viewBinding.recyclerViewSearchIssues.setAdapter(adapter);
|
||||||
|
|
||||||
viewBinding.searchKeyword.setOnEditorActionListener((v1, actionId, event) -> {
|
viewBinding.searchKeyword.setOnEditorActionListener((v1, actionId, event) -> {
|
||||||
|
|
||||||
if(actionId == EditorInfo.IME_ACTION_SEND) {
|
if(actionId == EditorInfo.IME_ACTION_SEND) {
|
||||||
|
|
||||||
if(!Objects.requireNonNull(viewBinding.searchKeyword.getText()).toString().equals("")) {
|
if(!Objects.requireNonNull(viewBinding.searchKeyword.getText()).toString().equals("")) {
|
||||||
|
|
||||||
InputMethodManager imm = (InputMethodManager) requireActivity().getSystemService(Context.INPUT_METHOD_SERVICE);
|
InputMethodManager imm = (InputMethodManager) requireActivity().getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||||
imm.hideSoftInputFromWindow(viewBinding.searchKeyword.getWindowToken(), 0);
|
imm.hideSoftInputFromWindow(viewBinding.searchKeyword.getWindowToken(), 0);
|
||||||
|
|
||||||
@ -79,27 +70,21 @@ public class SearchIssuesFragment extends Fragment {
|
|||||||
loadData(false, viewBinding.searchKeyword.getText().toString());
|
loadData(false, viewBinding.searchKeyword.getText().toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
viewBinding.recyclerViewSearchIssues.addOnScrollListener(new InfiniteScrollListener(pageCurrentIndex, linearLayoutManager) {
|
viewBinding.recyclerViewSearchIssues.addOnScrollListener(new InfiniteScrollListener(pageCurrentIndex, linearLayoutManager) {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onScrolledToEnd(int firstVisibleItemPosition) {
|
public void onScrolledToEnd(int firstVisibleItemPosition) {
|
||||||
|
|
||||||
pageCurrentIndex++;
|
pageCurrentIndex++;
|
||||||
loadData(true, Objects.requireNonNull(viewBinding.searchKeyword.getText()).toString());
|
loadData(true, Objects.requireNonNull(viewBinding.searchKeyword.getText()).toString());
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
viewBinding.pullToRefresh.setOnRefreshListener(() -> {
|
viewBinding.pullToRefresh.setOnRefreshListener(() -> {
|
||||||
|
|
||||||
pageCurrentIndex = 1;
|
pageCurrentIndex = 1;
|
||||||
apiCallCurrentValue = 10;
|
apiCallCurrentValue = 10;
|
||||||
loadData(false, Objects.requireNonNull(viewBinding.searchKeyword.getText()).toString());
|
loadData(false, Objects.requireNonNull(viewBinding.searchKeyword.getText()).toString());
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
loadData(false, "");
|
loadData(false, "");
|
||||||
@ -117,69 +102,50 @@ public class SearchIssuesFragment extends Fragment {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(pageCurrentIndex == 1 || !append) {
|
if(pageCurrentIndex == 1 || !append) {
|
||||||
|
|
||||||
dataList.clear();
|
dataList.clear();
|
||||||
adapter.notifyDataSetChanged();
|
adapter.notifyDataSetChanged();
|
||||||
viewBinding.pullToRefresh.setRefreshing(false);
|
viewBinding.pullToRefresh.setRefreshing(false);
|
||||||
viewBinding.progressBar.setVisibility(View.VISIBLE);
|
viewBinding.progressBar.setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
||||||
viewBinding.loadingMoreView.setVisibility(View.VISIBLE);
|
viewBinding.loadingMoreView.setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
Call<List<Issues>> call = RetrofitClient.getApiInterface(getContext())
|
Call<List<Issues>> call = RetrofitClient.getApiInterface(getContext())
|
||||||
.queryIssues(Authorization.get(getContext()), searchKeyword, type, state, pageCurrentIndex);
|
.queryIssues(Authorization.get(getContext()), searchKeyword, "issues", "open", pageCurrentIndex);
|
||||||
|
|
||||||
call.enqueue(new Callback<List<Issues>>() {
|
call.enqueue(new Callback<List<Issues>>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(@NonNull Call<List<Issues>> call, @NonNull Response<List<Issues>> response) {
|
public void onResponse(@NonNull Call<List<Issues>> call, @NonNull Response<List<Issues>> response) {
|
||||||
|
|
||||||
if(response.code() == 200) {
|
if(response.code() == 200) {
|
||||||
|
|
||||||
assert response.body() != null;
|
assert response.body() != null;
|
||||||
apiCallCurrentValue = response.body().size();
|
apiCallCurrentValue = response.body().size();
|
||||||
|
|
||||||
if(!append) {
|
if(!append) {
|
||||||
|
|
||||||
dataList.clear();
|
dataList.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
dataList.addAll(response.body());
|
dataList.addAll(response.body());
|
||||||
adapter.notifyDataSetChanged();
|
adapter.notifyDataSetChanged();
|
||||||
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
||||||
dataList.clear();
|
dataList.clear();
|
||||||
adapter.notifyDataChanged();
|
adapter.notifyDataChanged();
|
||||||
viewBinding.noData.setVisibility(View.VISIBLE);
|
viewBinding.noData.setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
onCleanup();
|
onCleanup();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(@NonNull Call<List<Issues>> call, @NonNull Throwable t) {
|
public void onFailure(@NonNull Call<List<Issues>> call, @NonNull Throwable t) {
|
||||||
|
|
||||||
Log.e("onFailure", Objects.requireNonNull(t.getMessage()));
|
Log.e("onFailure", Objects.requireNonNull(t.getMessage()));
|
||||||
onCleanup();
|
onCleanup();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onCleanup() {
|
private void onCleanup() {
|
||||||
|
|
||||||
AppUtil.setMultiVisibility(View.GONE, viewBinding.loadingMoreView, viewBinding.progressBar);
|
AppUtil.setMultiVisibility(View.GONE, viewBinding.loadingMoreView, viewBinding.progressBar);
|
||||||
|
|
||||||
if(dataList.isEmpty()) {
|
if(dataList.isEmpty()) {
|
||||||
|
|
||||||
viewBinding.noData.setVisibility(View.VISIBLE);
|
viewBinding.noData.setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -0,0 +1,160 @@
|
|||||||
|
package org.mian.gitnex.fragments;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.os.Handler;
|
||||||
|
import android.os.Looper;
|
||||||
|
import android.util.Log;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
|
import androidx.fragment.app.Fragment;
|
||||||
|
import androidx.recyclerview.widget.DividerItemDecoration;
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
|
import org.gitnex.tea4j.models.Organization;
|
||||||
|
import org.mian.gitnex.R;
|
||||||
|
import org.mian.gitnex.adapters.PublicOrganizationsAdapter;
|
||||||
|
import org.mian.gitnex.clients.RetrofitClient;
|
||||||
|
import org.mian.gitnex.databinding.FragmentOrganizationsBinding;
|
||||||
|
import org.mian.gitnex.helpers.Authorization;
|
||||||
|
import org.mian.gitnex.helpers.Constants;
|
||||||
|
import org.mian.gitnex.helpers.SnackBar;
|
||||||
|
import org.mian.gitnex.helpers.TinyDB;
|
||||||
|
import org.mian.gitnex.helpers.Version;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import retrofit2.Call;
|
||||||
|
import retrofit2.Callback;
|
||||||
|
import retrofit2.Response;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Author M M Arif
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class ExplorePublicOrganizationsFragment extends Fragment {
|
||||||
|
|
||||||
|
private FragmentOrganizationsBinding fragmentPublicOrgBinding;
|
||||||
|
private List<Organization> organizationsList;
|
||||||
|
private PublicOrganizationsAdapter adapter;
|
||||||
|
private Context context;
|
||||||
|
private int pageSize;
|
||||||
|
private final String TAG = Constants.publicOrganizations;
|
||||||
|
private int resultLimit = Constants.resultLimitOldGiteaInstances;
|
||||||
|
|
||||||
|
@Nullable
|
||||||
|
@Override
|
||||||
|
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||||
|
|
||||||
|
fragmentPublicOrgBinding = FragmentOrganizationsBinding.inflate(inflater, container, false);
|
||||||
|
context = getContext();
|
||||||
|
|
||||||
|
TinyDB tinyDb = TinyDB.getInstance(getContext());
|
||||||
|
final String loginUid = tinyDb.getString("loginUid");
|
||||||
|
final String instanceToken = "token " + tinyDb.getString(loginUid + "-token");
|
||||||
|
|
||||||
|
// if gitea is 1.12 or higher use the new limit
|
||||||
|
if(new Version(tinyDb.getString("giteaVersion")).higherOrEqual("1.12.0")) {
|
||||||
|
resultLimit = Constants.resultLimitNewGiteaInstances;
|
||||||
|
}
|
||||||
|
|
||||||
|
fragmentPublicOrgBinding.addNewOrganization.setVisibility(View.GONE);
|
||||||
|
organizationsList = new ArrayList<>();
|
||||||
|
|
||||||
|
fragmentPublicOrgBinding.pullToRefresh.setOnRefreshListener(() -> new Handler(Looper.getMainLooper()).postDelayed(() -> {
|
||||||
|
fragmentPublicOrgBinding.pullToRefresh.setRefreshing(false);
|
||||||
|
loadInitial(instanceToken, resultLimit);
|
||||||
|
adapter.notifyDataChanged();
|
||||||
|
}, 200));
|
||||||
|
|
||||||
|
adapter = new PublicOrganizationsAdapter(getContext(), organizationsList);
|
||||||
|
adapter.setLoadMoreListener(() -> fragmentPublicOrgBinding.recyclerView.post(() -> {
|
||||||
|
if(organizationsList.size() == resultLimit || pageSize == resultLimit) {
|
||||||
|
int page = (organizationsList.size() + resultLimit) / resultLimit;
|
||||||
|
loadMore(Authorization.get(getContext()), page, resultLimit);
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
|
||||||
|
DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(fragmentPublicOrgBinding.recyclerView.getContext(), DividerItemDecoration.VERTICAL);
|
||||||
|
fragmentPublicOrgBinding.recyclerView.setHasFixedSize(true);
|
||||||
|
fragmentPublicOrgBinding.recyclerView.addItemDecoration(dividerItemDecoration);
|
||||||
|
fragmentPublicOrgBinding.recyclerView.setLayoutManager(new LinearLayoutManager(context));
|
||||||
|
fragmentPublicOrgBinding.recyclerView.setAdapter(adapter);
|
||||||
|
|
||||||
|
loadInitial(Authorization.get(getContext()), resultLimit);
|
||||||
|
|
||||||
|
return fragmentPublicOrgBinding.getRoot();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void loadInitial(String token, int resultLimit) {
|
||||||
|
|
||||||
|
Call<List<Organization>> call = RetrofitClient
|
||||||
|
.getApiInterface(context).getAllOrgs(token, Constants.publicOrganizationsPageInit, resultLimit);
|
||||||
|
call.enqueue(new Callback<List<Organization>>() {
|
||||||
|
@Override
|
||||||
|
public void onResponse(@NonNull Call<List<Organization>> call, @NonNull Response<List<Organization>> response) {
|
||||||
|
if(response.isSuccessful()) {
|
||||||
|
if(response.body() != null && response.body().size() > 0) {
|
||||||
|
organizationsList.clear();
|
||||||
|
organizationsList.addAll(response.body());
|
||||||
|
adapter.notifyDataChanged();
|
||||||
|
fragmentPublicOrgBinding.noDataOrg.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
organizationsList.clear();
|
||||||
|
adapter.notifyDataChanged();
|
||||||
|
fragmentPublicOrgBinding.noDataOrg.setVisibility(View.VISIBLE);
|
||||||
|
}
|
||||||
|
fragmentPublicOrgBinding.progressBar.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
else if(response.code() == 404) {
|
||||||
|
fragmentPublicOrgBinding.noDataOrg.setVisibility(View.VISIBLE);
|
||||||
|
fragmentPublicOrgBinding.progressBar.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
Log.e(TAG, String.valueOf(response.code()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(@NonNull Call<List<Organization>> call, @NonNull Throwable t) {
|
||||||
|
Log.e(TAG, t.toString());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private void loadMore(String token, int page, int resultLimit) {
|
||||||
|
|
||||||
|
fragmentPublicOrgBinding.progressLoadMore.setVisibility(View.VISIBLE);
|
||||||
|
Call<List<Organization>> call = RetrofitClient.getApiInterface(context).getAllOrgs(token, page, resultLimit);
|
||||||
|
call.enqueue(new Callback<List<Organization>>() {
|
||||||
|
@Override
|
||||||
|
public void onResponse(@NonNull Call<List<Organization>> call, @NonNull Response<List<Organization>> response) {
|
||||||
|
if(response.isSuccessful()) {
|
||||||
|
List<Organization> result = response.body();
|
||||||
|
if(result != null) {
|
||||||
|
if(result.size() > 0) {
|
||||||
|
pageSize = result.size();
|
||||||
|
organizationsList.addAll(result);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
SnackBar.info(context, fragmentPublicOrgBinding.getRoot(), getString(R.string.noMoreData));
|
||||||
|
adapter.setMoreDataAvailable(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
adapter.notifyDataChanged();
|
||||||
|
fragmentPublicOrgBinding.progressLoadMore.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
Log.e(TAG, String.valueOf(response.code()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(@NonNull Call<List<Organization>> call, @NonNull Throwable t) {
|
||||||
|
Log.e(TAG, t.toString());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
@ -29,8 +29,8 @@ import org.mian.gitnex.clients.RetrofitClient;
|
|||||||
import org.mian.gitnex.databinding.FragmentIssuesBinding;
|
import org.mian.gitnex.databinding.FragmentIssuesBinding;
|
||||||
import org.mian.gitnex.helpers.Authorization;
|
import org.mian.gitnex.helpers.Authorization;
|
||||||
import org.mian.gitnex.helpers.Constants;
|
import org.mian.gitnex.helpers.Constants;
|
||||||
|
import org.mian.gitnex.helpers.SnackBar;
|
||||||
import org.mian.gitnex.helpers.TinyDB;
|
import org.mian.gitnex.helpers.TinyDB;
|
||||||
import org.mian.gitnex.helpers.Toasty;
|
|
||||||
import org.mian.gitnex.helpers.Version;
|
import org.mian.gitnex.helpers.Version;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -44,6 +44,7 @@ import retrofit2.Response;
|
|||||||
|
|
||||||
public class IssuesFragment extends Fragment {
|
public class IssuesFragment extends Fragment {
|
||||||
|
|
||||||
|
private FragmentIssuesBinding fragmentIssuesBinding;
|
||||||
private Menu menu;
|
private Menu menu;
|
||||||
private RecyclerView recyclerView;
|
private RecyclerView recyclerView;
|
||||||
private List<Issues> issuesList;
|
private List<Issues> issuesList;
|
||||||
@ -51,18 +52,17 @@ public class IssuesFragment extends Fragment {
|
|||||||
private Context context;
|
private Context context;
|
||||||
private int pageSize = Constants.issuesPageInit;
|
private int pageSize = Constants.issuesPageInit;
|
||||||
private ProgressBar mProgressBar;
|
private ProgressBar mProgressBar;
|
||||||
private String TAG = Constants.tagIssuesList;
|
private final String TAG = Constants.tagIssuesList;
|
||||||
private TextView noDataIssues;
|
private TextView noDataIssues;
|
||||||
private int resultLimit = Constants.resultLimitOldGiteaInstances;
|
private int resultLimit = Constants.resultLimitOldGiteaInstances;
|
||||||
private String requestType = Constants.issuesRequestType;
|
private final String requestType = Constants.issuesRequestType;
|
||||||
private ProgressBar progressLoadMore;
|
private ProgressBar progressLoadMore;
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
@Override
|
@Override
|
||||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||||
|
|
||||||
FragmentIssuesBinding fragmentIssuesBinding = FragmentIssuesBinding.inflate(inflater, container, false);
|
fragmentIssuesBinding = FragmentIssuesBinding.inflate(inflater, container, false);
|
||||||
|
|
||||||
setHasOptionsMenu(true);
|
setHasOptionsMenu(true);
|
||||||
context = getContext();
|
context = getContext();
|
||||||
|
|
||||||
@ -89,23 +89,17 @@ public class IssuesFragment extends Fragment {
|
|||||||
noDataIssues = fragmentIssuesBinding.noDataIssues;
|
noDataIssues = fragmentIssuesBinding.noDataIssues;
|
||||||
|
|
||||||
swipeRefresh.setOnRefreshListener(() -> new Handler(Looper.getMainLooper()).postDelayed(() -> {
|
swipeRefresh.setOnRefreshListener(() -> new Handler(Looper.getMainLooper()).postDelayed(() -> {
|
||||||
|
|
||||||
swipeRefresh.setRefreshing(false);
|
swipeRefresh.setRefreshing(false);
|
||||||
loadInitial(instanceToken, repoOwner, repoName, resultLimit, requestType, tinyDb.getString("repoIssuesState"));
|
loadInitial(instanceToken, repoOwner, repoName, resultLimit, requestType, tinyDb.getString("repoIssuesState"));
|
||||||
adapter.notifyDataChanged();
|
adapter.notifyDataChanged();
|
||||||
|
|
||||||
}, 200));
|
}, 200));
|
||||||
|
|
||||||
adapter = new IssuesAdapter(getContext(), issuesList);
|
adapter = new IssuesAdapter(getContext(), issuesList);
|
||||||
adapter.setLoadMoreListener(() -> recyclerView.post(() -> {
|
adapter.setLoadMoreListener(() -> recyclerView.post(() -> {
|
||||||
|
|
||||||
if(issuesList.size() == resultLimit || pageSize == resultLimit) {
|
if(issuesList.size() == resultLimit || pageSize == resultLimit) {
|
||||||
|
|
||||||
int page = (issuesList.size() + resultLimit) / resultLimit;
|
int page = (issuesList.size() + resultLimit) / resultLimit;
|
||||||
loadMore(Authorization.get(getContext()), repoOwner, repoName, page, resultLimit, requestType, tinyDb.getString("repoIssuesState"));
|
loadMore(Authorization.get(getContext()), repoOwner, repoName, page, resultLimit, requestType, tinyDb.getString("repoIssuesState"));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}));
|
}));
|
||||||
|
|
||||||
DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(recyclerView.getContext(), DividerItemDecoration.VERTICAL);
|
DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(recyclerView.getContext(), DividerItemDecoration.VERTICAL);
|
||||||
@ -129,12 +123,9 @@ public class IssuesFragment extends Fragment {
|
|||||||
adapter.setLoadMoreListener(() -> recyclerView.post(() -> {
|
adapter.setLoadMoreListener(() -> recyclerView.post(() -> {
|
||||||
|
|
||||||
if(issuesList.size() == resultLimit || pageSize == resultLimit) {
|
if(issuesList.size() == resultLimit || pageSize == resultLimit) {
|
||||||
|
|
||||||
int page = (issuesList.size() + resultLimit) / resultLimit;
|
int page = (issuesList.size() + resultLimit) / resultLimit;
|
||||||
loadMore(Authorization.get(getContext()), repoOwner, repoName, page, resultLimit, requestType, tinyDb.getString("repoIssuesState"));
|
loadMore(Authorization.get(getContext()), repoOwner, repoName, page, resultLimit, requestType, tinyDb.getString("repoIssuesState"));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}));
|
}));
|
||||||
|
|
||||||
tinyDb.putString("repoIssuesState", issueState);
|
tinyDb.putString("repoIssuesState", issueState);
|
||||||
@ -144,13 +135,11 @@ public class IssuesFragment extends Fragment {
|
|||||||
|
|
||||||
loadInitial(Authorization.get(getContext()), repoOwner, repoName, resultLimit, requestType, issueState);
|
loadInitial(Authorization.get(getContext()), repoOwner, repoName, resultLimit, requestType, issueState);
|
||||||
recyclerView.setAdapter(adapter);
|
recyclerView.setAdapter(adapter);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
loadInitial(Authorization.get(getContext()), repoOwner, repoName, resultLimit, requestType, tinyDb.getString("repoIssuesState"));
|
loadInitial(Authorization.get(getContext()), repoOwner, repoName, resultLimit, requestType, tinyDb.getString("repoIssuesState"));
|
||||||
|
|
||||||
return fragmentIssuesBinding.getRoot();
|
return fragmentIssuesBinding.getRoot();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -165,11 +154,9 @@ public class IssuesFragment extends Fragment {
|
|||||||
final String repoName = parts[1];
|
final String repoName = parts[1];
|
||||||
|
|
||||||
if(tinyDb.getBoolean("resumeIssues")) {
|
if(tinyDb.getBoolean("resumeIssues")) {
|
||||||
|
|
||||||
loadInitial(Authorization.get(getContext()), repoOwner, repoName, resultLimit, requestType, tinyDb.getString("repoIssuesState"));
|
loadInitial(Authorization.get(getContext()), repoOwner, repoName, resultLimit, requestType, tinyDb.getString("repoIssuesState"));
|
||||||
tinyDb.putBoolean("resumeIssues", false);
|
tinyDb.putBoolean("resumeIssues", false);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void loadInitial(String token, String repoOwner, String repoName, int resultLimit, String requestType, String issueState) {
|
private void loadInitial(String token, String repoOwner, String repoName, int resultLimit, String requestType, String issueState) {
|
||||||
@ -177,49 +164,38 @@ public class IssuesFragment extends Fragment {
|
|||||||
Call<List<Issues>> call = RetrofitClient.getApiInterface(context).getIssues(token, repoOwner, repoName, 1, resultLimit, requestType, issueState);
|
Call<List<Issues>> call = RetrofitClient.getApiInterface(context).getIssues(token, repoOwner, repoName, 1, resultLimit, requestType, issueState);
|
||||||
|
|
||||||
call.enqueue(new Callback<List<Issues>>() {
|
call.enqueue(new Callback<List<Issues>>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(@NonNull Call<List<Issues>> call, @NonNull Response<List<Issues>> response) {
|
public void onResponse(@NonNull Call<List<Issues>> call, @NonNull Response<List<Issues>> response) {
|
||||||
|
|
||||||
if(response.code() == 200) {
|
if(response.code() == 200) {
|
||||||
|
|
||||||
assert response.body() != null;
|
assert response.body() != null;
|
||||||
if(response.body().size() > 0) {
|
if(response.body().size() > 0) {
|
||||||
|
|
||||||
issuesList.clear();
|
issuesList.clear();
|
||||||
issuesList.addAll(response.body());
|
issuesList.addAll(response.body());
|
||||||
adapter.notifyDataChanged();
|
adapter.notifyDataChanged();
|
||||||
noDataIssues.setVisibility(View.GONE);
|
noDataIssues.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
||||||
issuesList.clear();
|
issuesList.clear();
|
||||||
adapter.notifyDataChanged();
|
adapter.notifyDataChanged();
|
||||||
noDataIssues.setVisibility(View.VISIBLE);
|
noDataIssues.setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
mProgressBar.setVisibility(View.GONE);
|
mProgressBar.setVisibility(View.GONE);
|
||||||
|
|
||||||
}
|
}
|
||||||
else if(response.code() == 404) {
|
else if(response.code() == 404) {
|
||||||
|
|
||||||
noDataIssues.setVisibility(View.VISIBLE);
|
noDataIssues.setVisibility(View.VISIBLE);
|
||||||
mProgressBar.setVisibility(View.GONE);
|
mProgressBar.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Log.e(TAG, String.valueOf(response.code()));
|
Log.e(TAG, String.valueOf(response.code()));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(@NonNull Call<List<Issues>> call, @NonNull Throwable t) {
|
public void onFailure(@NonNull Call<List<Issues>> call, @NonNull Throwable t) {
|
||||||
|
|
||||||
Log.e(TAG, t.toString());
|
Log.e(TAG, t.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void loadMore(String token, String repoOwner, String repoName, int page, int resultLimit, String requestType, String issueState) {
|
private void loadMore(String token, String repoOwner, String repoName, int page, int resultLimit, String requestType, String issueState) {
|
||||||
@ -232,44 +208,29 @@ public class IssuesFragment extends Fragment {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(@NonNull Call<List<Issues>> call, @NonNull Response<List<Issues>> response) {
|
public void onResponse(@NonNull Call<List<Issues>> call, @NonNull Response<List<Issues>> response) {
|
||||||
|
|
||||||
if(response.code() == 200) {
|
if(response.code() == 200) {
|
||||||
|
|
||||||
List<Issues> result = response.body();
|
List<Issues> result = response.body();
|
||||||
|
|
||||||
assert result != null;
|
assert result != null;
|
||||||
if(result.size() > 0) {
|
if(result.size() > 0) {
|
||||||
|
|
||||||
pageSize = result.size();
|
pageSize = result.size();
|
||||||
issuesList.addAll(result);
|
issuesList.addAll(result);
|
||||||
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
SnackBar.info(context, fragmentIssuesBinding.getRoot(), getString(R.string.noMoreData));
|
||||||
Toasty.warning(context, getString(R.string.noMoreData));
|
|
||||||
adapter.setMoreDataAvailable(false);
|
adapter.setMoreDataAvailable(false);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
adapter.notifyDataChanged();
|
adapter.notifyDataChanged();
|
||||||
progressLoadMore.setVisibility(View.GONE);
|
progressLoadMore.setVisibility(View.GONE);
|
||||||
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
||||||
Log.e(TAG, String.valueOf(response.code()));
|
Log.e(TAG, String.valueOf(response.code()));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(@NonNull Call<List<Issues>> call, @NonNull Throwable t) {
|
public void onFailure(@NonNull Call<List<Issues>> call, @NonNull Throwable t) {
|
||||||
|
|
||||||
Log.e(TAG, t.toString());
|
Log.e(TAG, t.toString());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -298,19 +259,15 @@ public class IssuesFragment extends Fragment {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onQueryTextSubmit(String query) {
|
public boolean onQueryTextSubmit(String query) {
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onQueryTextChange(String newText) {
|
public boolean onQueryTextChange(String newText) {
|
||||||
|
|
||||||
filter(newText);
|
filter(newText);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void filter(String text) {
|
private void filter(String text) {
|
||||||
@ -328,5 +285,4 @@ public class IssuesFragment extends Fragment {
|
|||||||
|
|
||||||
adapter.updateList(arr);
|
adapter.updateList(arr);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -16,6 +16,7 @@ import android.widget.TextView;
|
|||||||
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 androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
|
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
|
||||||
@ -95,12 +96,15 @@ public class NotificationsFragment extends Fragment implements NotificationsAdap
|
|||||||
notificationsActions = new NotificationsActions(context);
|
notificationsActions = new NotificationsActions(context);
|
||||||
notificationsAdapter = new NotificationsAdapter(context, notificationThreads, this, this);
|
notificationsAdapter = new NotificationsAdapter(context, notificationThreads, this, this);
|
||||||
|
|
||||||
|
RecyclerView recyclerView = fragmentNotificationsBinding.notifications;
|
||||||
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(context);
|
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(context);
|
||||||
|
|
||||||
RecyclerView recyclerView = fragmentNotificationsBinding.notifications;
|
DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(recyclerView.getContext(), DividerItemDecoration.VERTICAL);
|
||||||
|
|
||||||
recyclerView.setHasFixedSize(true);
|
recyclerView.setHasFixedSize(true);
|
||||||
recyclerView.setLayoutManager(linearLayoutManager);
|
recyclerView.setLayoutManager(linearLayoutManager);
|
||||||
recyclerView.setAdapter(notificationsAdapter);
|
recyclerView.setAdapter(notificationsAdapter);
|
||||||
|
recyclerView.addItemDecoration(dividerItemDecoration);
|
||||||
recyclerView.addOnScrollListener(new InfiniteScrollListener(pageResultLimit, linearLayoutManager) {
|
recyclerView.addOnScrollListener(new InfiniteScrollListener(pageResultLimit, linearLayoutManager) {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -30,6 +30,7 @@ public class Constants {
|
|||||||
public static final String replyToIssueActivity = "ReplyToIssueActivity";
|
public static final String replyToIssueActivity = "ReplyToIssueActivity";
|
||||||
public static final String tagDraftsBottomSheet = "BottomSheetDraftsFragment";
|
public static final String tagDraftsBottomSheet = "BottomSheetDraftsFragment";
|
||||||
public static final String userAccountsApi = "UserAccountsApi";
|
public static final String userAccountsApi = "UserAccountsApi";
|
||||||
|
public static final String publicOrganizations = "PublicOrganizations";
|
||||||
|
|
||||||
// issues variables
|
// issues variables
|
||||||
public static final int issuesPageInit = 1;
|
public static final int issuesPageInit = 1;
|
||||||
@ -51,6 +52,9 @@ public class Constants {
|
|||||||
public static final int defaultPollingDelay = 15;
|
public static final int defaultPollingDelay = 15;
|
||||||
public static final int maximumPollingDelay = 720;
|
public static final int maximumPollingDelay = 720;
|
||||||
|
|
||||||
|
// public organizations
|
||||||
|
public static final int publicOrganizationsPageInit = 1;
|
||||||
|
|
||||||
public static final int maximumFileViewerSize = 3 * 1024 * 1024;
|
public static final int maximumFileViewerSize = 3 * 1024 * 1024;
|
||||||
|
|
||||||
public static final String mainNotificationChannelId = "main_channel";
|
public static final String mainNotificationChannelId = "main_channel";
|
||||||
|
46
app/src/main/java/org/mian/gitnex/helpers/SnackBar.java
Normal file
46
app/src/main/java/org/mian/gitnex/helpers/SnackBar.java
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
package org.mian.gitnex.helpers;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.TextView;
|
||||||
|
import com.google.android.material.snackbar.Snackbar;
|
||||||
|
import org.mian.gitnex.R;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Author M M Arif
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class SnackBar {
|
||||||
|
|
||||||
|
public static void info(Context context, View view, String message) {
|
||||||
|
Snackbar snackBar = Snackbar.make(view, message, Snackbar.LENGTH_LONG);
|
||||||
|
View sbView = snackBar.getView();
|
||||||
|
TextView textView = sbView.findViewById(R.id.snackbar_text);
|
||||||
|
textView.setTextColor(context.getResources().getColor(R.color.colorWhite));
|
||||||
|
snackBar.show();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void success(Context context, View view, String message) {
|
||||||
|
Snackbar snackBar = Snackbar.make(view, message, Snackbar.LENGTH_LONG);
|
||||||
|
View sbView = snackBar.getView();
|
||||||
|
TextView textView = sbView.findViewById(R.id.snackbar_text);
|
||||||
|
textView.setTextColor(context.getResources().getColor(R.color.colorLightGreen));
|
||||||
|
snackBar.show();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void warning(Context context, View view, String message) {
|
||||||
|
Snackbar snackBar = Snackbar.make(view, message, Snackbar.LENGTH_LONG);
|
||||||
|
View sbView = snackBar.getView();
|
||||||
|
TextView textView = sbView.findViewById(R.id.snackbar_text);
|
||||||
|
textView.setTextColor(context.getResources().getColor(R.color.lightYellow));
|
||||||
|
snackBar.show();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void error(Context context, View view, String message) {
|
||||||
|
Snackbar snackBar = Snackbar.make(view, message, Snackbar.LENGTH_LONG);
|
||||||
|
View sbView = snackBar.getView();
|
||||||
|
TextView textView = sbView.findViewById(R.id.snackbar_text);
|
||||||
|
textView.setTextColor(context.getResources().getColor(R.color.darkRed));
|
||||||
|
snackBar.show();
|
||||||
|
}
|
||||||
|
}
|
@ -10,6 +10,7 @@
|
|||||||
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"
|
||||||
|
app:elevation="0dp"
|
||||||
android:theme="@style/Widget.AppCompat.SearchView">
|
android:theme="@style/Widget.AppCompat.SearchView">
|
||||||
|
|
||||||
<com.google.android.material.appbar.MaterialToolbar
|
<com.google.android.material.appbar.MaterialToolbar
|
||||||
|
@ -13,6 +13,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:layout_constraintTop_toTopOf="parent">
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
<com.google.android.material.appbar.MaterialToolbar
|
<com.google.android.material.appbar.MaterialToolbar
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
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"
|
||||||
|
app:elevation="0dp"
|
||||||
android:theme="@style/Widget.AppCompat.SearchView">
|
android:theme="@style/Widget.AppCompat.SearchView">
|
||||||
|
|
||||||
<com.google.android.material.appbar.MaterialToolbar
|
<com.google.android.material.appbar.MaterialToolbar
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
<?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"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:background="?attr/primaryBackgroundColor"
|
android:background="?attr/primaryBackgroundColor"
|
||||||
android:fitsSystemWindows="true"
|
android:fitsSystemWindows="true"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
@ -11,6 +11,7 @@
|
|||||||
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"
|
||||||
|
app:elevation="0dp"
|
||||||
android:theme="@style/Widget.AppCompat.SearchView">
|
android:theme="@style/Widget.AppCompat.SearchView">
|
||||||
|
|
||||||
<com.google.android.material.appbar.MaterialToolbar
|
<com.google.android.material.appbar.MaterialToolbar
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
<?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"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:background="?attr/primaryBackgroundColor"
|
android:background="?attr/primaryBackgroundColor"
|
||||||
android:fitsSystemWindows="true"
|
android:fitsSystemWindows="true"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
@ -11,6 +11,7 @@
|
|||||||
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"
|
||||||
|
app:elevation="0dp"
|
||||||
android:theme="@style/Widget.AppCompat.SearchView">
|
android:theme="@style/Widget.AppCompat.SearchView">
|
||||||
|
|
||||||
<com.google.android.material.appbar.MaterialToolbar
|
<com.google.android.material.appbar.MaterialToolbar
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
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"
|
||||||
|
app:elevation="0dp"
|
||||||
android:theme="@style/Widget.AppCompat.SearchView">
|
android:theme="@style/Widget.AppCompat.SearchView">
|
||||||
|
|
||||||
<com.google.android.material.appbar.MaterialToolbar
|
<com.google.android.material.appbar.MaterialToolbar
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
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"
|
||||||
|
app:elevation="0dp"
|
||||||
android:theme="@style/Widget.AppCompat.SearchView">
|
android:theme="@style/Widget.AppCompat.SearchView">
|
||||||
|
|
||||||
<com.google.android.material.appbar.MaterialToolbar
|
<com.google.android.material.appbar.MaterialToolbar
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
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"
|
||||||
|
app:elevation="0dp"
|
||||||
android:theme="@style/Widget.AppCompat.SearchView">
|
android:theme="@style/Widget.AppCompat.SearchView">
|
||||||
|
|
||||||
<com.google.android.material.appbar.MaterialToolbar
|
<com.google.android.material.appbar.MaterialToolbar
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
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"
|
||||||
|
app:elevation="0dp"
|
||||||
android:theme="@style/Widget.AppCompat.SearchView">
|
android:theme="@style/Widget.AppCompat.SearchView">
|
||||||
|
|
||||||
<com.google.android.material.appbar.MaterialToolbar
|
<com.google.android.material.appbar.MaterialToolbar
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
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"
|
||||||
|
app:elevation="0dp"
|
||||||
android:theme="@style/Widget.AppCompat.SearchView">
|
android:theme="@style/Widget.AppCompat.SearchView">
|
||||||
|
|
||||||
<com.google.android.material.appbar.MaterialToolbar
|
<com.google.android.material.appbar.MaterialToolbar
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
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"
|
||||||
|
app:elevation="0dp"
|
||||||
android:theme="@style/Widget.AppCompat.SearchView">
|
android:theme="@style/Widget.AppCompat.SearchView">
|
||||||
|
|
||||||
<com.google.android.material.appbar.MaterialToolbar
|
<com.google.android.material.appbar.MaterialToolbar
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
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"
|
||||||
|
app:elevation="0dp"
|
||||||
android:theme="@style/Widget.AppCompat.SearchView">
|
android:theme="@style/Widget.AppCompat.SearchView">
|
||||||
|
|
||||||
<com.google.android.material.appbar.MaterialToolbar
|
<com.google.android.material.appbar.MaterialToolbar
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
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"
|
||||||
|
app:elevation="0dp"
|
||||||
android:theme="@style/Widget.AppCompat.SearchView">
|
android:theme="@style/Widget.AppCompat.SearchView">
|
||||||
|
|
||||||
<com.google.android.material.appbar.MaterialToolbar
|
<com.google.android.material.appbar.MaterialToolbar
|
||||||
@ -29,7 +30,7 @@
|
|||||||
android:background="?android:attr/selectableItemBackgroundBorderless"
|
android:background="?android:attr/selectableItemBackgroundBorderless"
|
||||||
android:focusable="true"
|
android:focusable="true"
|
||||||
android:clickable="true"
|
android:clickable="true"
|
||||||
android:src="@drawable/ic_arrow_back" />
|
android:src="@drawable/ic_close" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/toolbarTitle"
|
android:id="@+id/toolbarTitle"
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
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"
|
||||||
|
app:elevation="0dp"
|
||||||
android:theme="@style/Widget.AppCompat.SearchView">
|
android:theme="@style/Widget.AppCompat.SearchView">
|
||||||
|
|
||||||
<com.google.android.material.appbar.MaterialToolbar
|
<com.google.android.material.appbar.MaterialToolbar
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
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"
|
||||||
|
app:elevation="0dp"
|
||||||
android:theme="@style/Widget.AppCompat.SearchView">
|
android:theme="@style/Widget.AppCompat.SearchView">
|
||||||
|
|
||||||
<com.google.android.material.appbar.MaterialToolbar
|
<com.google.android.material.appbar.MaterialToolbar
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
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"
|
||||||
|
app:elevation="0dp"
|
||||||
android:theme="@style/Widget.AppCompat.SearchView">
|
android:theme="@style/Widget.AppCompat.SearchView">
|
||||||
|
|
||||||
<com.google.android.material.appbar.MaterialToolbar
|
<com.google.android.material.appbar.MaterialToolbar
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
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"
|
||||||
|
app:elevation="0dp"
|
||||||
android:theme="@style/Widget.AppCompat.SearchView">
|
android:theme="@style/Widget.AppCompat.SearchView">
|
||||||
|
|
||||||
<com.google.android.material.appbar.MaterialToolbar
|
<com.google.android.material.appbar.MaterialToolbar
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
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"
|
||||||
|
app:elevation="0dp"
|
||||||
android:theme="@style/Widget.AppCompat.SearchView">
|
android:theme="@style/Widget.AppCompat.SearchView">
|
||||||
|
|
||||||
<com.google.android.material.appbar.MaterialToolbar
|
<com.google.android.material.appbar.MaterialToolbar
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
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"
|
||||||
|
app:elevation="0dp"
|
||||||
android:theme="@style/Widget.AppCompat.SearchView">
|
android:theme="@style/Widget.AppCompat.SearchView">
|
||||||
|
|
||||||
<com.google.android.material.appbar.MaterialToolbar
|
<com.google.android.material.appbar.MaterialToolbar
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
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"
|
||||||
|
app:elevation="0dp"
|
||||||
android:theme="@style/Widget.AppCompat.SearchView">
|
android:theme="@style/Widget.AppCompat.SearchView">
|
||||||
|
|
||||||
<com.google.android.material.appbar.MaterialToolbar
|
<com.google.android.material.appbar.MaterialToolbar
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
android:id="@+id/toolbar"
|
android:id="@+id/toolbar"
|
||||||
app:titleTextColor="?attr/primaryTextColor"
|
app:titleTextColor="?attr/primaryTextColor"
|
||||||
android:theme="@style/Widget.AppCompat.SearchView"
|
android:theme="@style/Widget.AppCompat.SearchView"
|
||||||
android:elevation="4dp">
|
android:elevation="0dp">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
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"
|
||||||
|
app:elevation="0dp"
|
||||||
android:theme="@style/Widget.AppCompat.SearchView">
|
android:theme="@style/Widget.AppCompat.SearchView">
|
||||||
|
|
||||||
<com.google.android.material.appbar.MaterialToolbar
|
<com.google.android.material.appbar.MaterialToolbar
|
||||||
|
@ -13,6 +13,7 @@
|
|||||||
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"
|
||||||
|
app:elevation="0dp"
|
||||||
android:theme="@style/Widget.AppCompat.SearchView">
|
android:theme="@style/Widget.AppCompat.SearchView">
|
||||||
|
|
||||||
<com.google.android.material.appbar.MaterialToolbar
|
<com.google.android.material.appbar.MaterialToolbar
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
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"
|
||||||
|
app:elevation="0dp"
|
||||||
android:theme="@style/Widget.AppCompat.SearchView">
|
android:theme="@style/Widget.AppCompat.SearchView">
|
||||||
|
|
||||||
<com.google.android.material.appbar.MaterialToolbar
|
<com.google.android.material.appbar.MaterialToolbar
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
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"
|
||||||
|
app:elevation="0dp"
|
||||||
android:theme="@style/Widget.AppCompat.SearchView">
|
android:theme="@style/Widget.AppCompat.SearchView">
|
||||||
|
|
||||||
<com.google.android.material.appbar.MaterialToolbar
|
<com.google.android.material.appbar.MaterialToolbar
|
||||||
|
@ -14,6 +14,7 @@
|
|||||||
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"
|
||||||
|
app:elevation="0dp"
|
||||||
android:theme="@style/Widget.AppCompat.SearchView">
|
android:theme="@style/Widget.AppCompat.SearchView">
|
||||||
|
|
||||||
<com.google.android.material.appbar.MaterialToolbar
|
<com.google.android.material.appbar.MaterialToolbar
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
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"
|
||||||
|
app:elevation="0dp"
|
||||||
android:theme="@style/Widget.AppCompat.SearchView">
|
android:theme="@style/Widget.AppCompat.SearchView">
|
||||||
|
|
||||||
<com.google.android.material.appbar.MaterialToolbar
|
<com.google.android.material.appbar.MaterialToolbar
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
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"
|
||||||
|
app:elevation="0dp"
|
||||||
android:theme="@style/Widget.AppCompat.SearchView">
|
android:theme="@style/Widget.AppCompat.SearchView">
|
||||||
|
|
||||||
<com.google.android.material.appbar.MaterialToolbar
|
<com.google.android.material.appbar.MaterialToolbar
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
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"
|
||||||
|
app:elevation="0dp"
|
||||||
android:theme="@style/Widget.AppCompat.SearchView">
|
android:theme="@style/Widget.AppCompat.SearchView">
|
||||||
|
|
||||||
<com.google.android.material.appbar.MaterialToolbar
|
<com.google.android.material.appbar.MaterialToolbar
|
||||||
|
@ -12,6 +12,7 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginBottom="10dp"
|
android:layout_marginBottom="10dp"
|
||||||
|
app:elevation="0dp"
|
||||||
android:theme="@style/Widget.AppCompat.SearchView">
|
android:theme="@style/Widget.AppCompat.SearchView">
|
||||||
|
|
||||||
<com.google.android.material.appbar.MaterialToolbar
|
<com.google.android.material.appbar.MaterialToolbar
|
||||||
@ -31,7 +32,7 @@
|
|||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:focusable="true"
|
android:focusable="true"
|
||||||
android:clickable="true"
|
android:clickable="true"
|
||||||
android:src="@drawable/ic_arrow_back" />
|
android:src="@drawable/ic_close" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/toolbarTitle"
|
android:id="@+id/toolbarTitle"
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
<?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"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:background="?attr/primaryBackgroundColor">
|
android:background="?attr/primaryBackgroundColor">
|
||||||
|
|
||||||
@ -11,6 +11,7 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginBottom="10dp"
|
android:layout_marginBottom="10dp"
|
||||||
|
app:elevation="0dp"
|
||||||
android:theme="@style/Widget.AppCompat.SearchView">
|
android:theme="@style/Widget.AppCompat.SearchView">
|
||||||
|
|
||||||
<com.google.android.material.appbar.MaterialToolbar
|
<com.google.android.material.appbar.MaterialToolbar
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="match_parent"
|
android:layout_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">
|
||||||
|
|
||||||
@ -10,6 +11,7 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginBottom="10dp"
|
android:layout_marginBottom="10dp"
|
||||||
|
app:elevation="0dp"
|
||||||
android:theme="@style/Widget.AppCompat.SearchView">
|
android:theme="@style/Widget.AppCompat.SearchView">
|
||||||
|
|
||||||
<com.google.android.material.appbar.MaterialToolbar
|
<com.google.android.material.appbar.MaterialToolbar
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="match_parent"
|
android:layout_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">
|
||||||
|
|
||||||
@ -10,6 +11,7 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginBottom="10dp"
|
android:layout_marginBottom="10dp"
|
||||||
|
app:elevation="0dp"
|
||||||
android:theme="@style/Widget.AppCompat.SearchView">
|
android:theme="@style/Widget.AppCompat.SearchView">
|
||||||
|
|
||||||
<com.google.android.material.appbar.MaterialToolbar
|
<com.google.android.material.appbar.MaterialToolbar
|
||||||
|
@ -12,6 +12,7 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginBottom="10dp"
|
android:layout_marginBottom="10dp"
|
||||||
|
app:elevation="0dp"
|
||||||
android:theme="@style/Widget.AppCompat.SearchView">
|
android:theme="@style/Widget.AppCompat.SearchView">
|
||||||
|
|
||||||
<androidx.appcompat.widget.Toolbar
|
<androidx.appcompat.widget.Toolbar
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="match_parent"
|
android:layout_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">
|
||||||
|
|
||||||
@ -10,6 +11,7 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginBottom="10dp"
|
android:layout_marginBottom="10dp"
|
||||||
|
app:elevation="0dp"
|
||||||
android:theme="@style/Widget.AppCompat.SearchView">
|
android:theme="@style/Widget.AppCompat.SearchView">
|
||||||
|
|
||||||
<com.google.android.material.appbar.MaterialToolbar
|
<com.google.android.material.appbar.MaterialToolbar
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="match_parent"
|
android:layout_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">
|
||||||
|
|
||||||
@ -10,6 +11,7 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginBottom="10dp"
|
android:layout_marginBottom="10dp"
|
||||||
|
app:elevation="0dp"
|
||||||
android:theme="@style/Widget.AppCompat.SearchView">
|
android:theme="@style/Widget.AppCompat.SearchView">
|
||||||
|
|
||||||
<com.google.android.material.appbar.MaterialToolbar
|
<com.google.android.material.appbar.MaterialToolbar
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
<?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"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:background="?attr/primaryBackgroundColor">
|
android:background="?attr/primaryBackgroundColor">
|
||||||
|
|
||||||
@ -11,6 +11,7 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginBottom="10dp"
|
android:layout_marginBottom="10dp"
|
||||||
|
app:elevation="0dp"
|
||||||
android:theme="@style/Widget.AppCompat.SearchView">
|
android:theme="@style/Widget.AppCompat.SearchView">
|
||||||
|
|
||||||
<com.google.android.material.appbar.MaterialToolbar
|
<com.google.android.material.appbar.MaterialToolbar
|
||||||
|
@ -11,11 +11,12 @@
|
|||||||
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"
|
||||||
|
app:elevation="0dp"
|
||||||
android:theme="@style/Widget.AppCompat.SearchView">
|
android:theme="@style/Widget.AppCompat.SearchView">
|
||||||
|
|
||||||
<com.google.android.material.tabs.TabLayout
|
<com.google.android.material.tabs.TabLayout
|
||||||
android:id="@+id/tabsExplore"
|
android:id="@+id/tabsExplore"
|
||||||
app:tabMode="fixed"
|
app:tabMode="auto"
|
||||||
app:tabTextAppearance="@style/customTabLayout"
|
app:tabTextAppearance="@style/customTabLayout"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:background="?attr/primaryBackgroundColor"
|
android:background="?attr/primaryBackgroundColor"
|
||||||
@ -35,6 +36,12 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/pageTitleIssues" />
|
android:text="@string/pageTitleIssues" />
|
||||||
|
|
||||||
|
<com.google.android.material.tabs.TabItem
|
||||||
|
android:id="@+id/tabExplorePublicOrganizations"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/pageTitleOrganizations" />
|
||||||
|
|
||||||
</com.google.android.material.tabs.TabLayout>
|
</com.google.android.material.tabs.TabLayout>
|
||||||
|
|
||||||
</com.google.android.material.appbar.AppBarLayout>
|
</com.google.android.material.appbar.AppBarLayout>
|
||||||
|
@ -27,6 +27,15 @@
|
|||||||
style="@style/Widget.MaterialComponents.LinearProgressIndicator"
|
style="@style/Widget.MaterialComponents.LinearProgressIndicator"
|
||||||
app:indicatorColor="?attr/progressIndicatorColor" />
|
app:indicatorColor="?attr/progressIndicatorColor" />
|
||||||
|
|
||||||
|
<com.google.android.material.progressindicator.LinearProgressIndicator
|
||||||
|
android:id="@+id/progressLoadMore"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:indeterminate="true"
|
||||||
|
style="@style/Widget.MaterialComponents.LinearProgressIndicator"
|
||||||
|
app:indicatorColor="?attr/progressIndicatorColor" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/noDataOrg"
|
android:id="@+id/noDataOrg"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
<LinearLayout
|
<LinearLayout
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="?attr/primaryBackgroundColor"
|
android:background="?attr/primaryBackgroundColor"
|
||||||
@ -61,11 +62,11 @@
|
|||||||
android:layout_marginBottom="10dp"
|
android:layout_marginBottom="10dp"
|
||||||
android:background="@color/colorWhite" />
|
android:background="@color/colorWhite" />
|
||||||
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:gravity="center_vertical">
|
android:gravity="center_vertical"
|
||||||
|
tools:ignore="UseCompoundDrawables">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/userLanguageIcon"
|
android:id="@+id/userLanguageIcon"
|
||||||
@ -103,7 +104,7 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="?attr/primaryBackgroundColor"
|
android:background="?attr/primaryBackgroundColor"
|
||||||
app:tabIndicatorColor="?attr/pagerTabIndicatorColor"
|
app:tabIndicatorColor="?attr/pagerTabIndicatorColor"
|
||||||
app:tabMode="scrollable"
|
app:tabMode="auto"
|
||||||
app:tabTextAppearance="@style/customTabLayout"
|
app:tabTextAppearance="@style/customTabLayout"
|
||||||
app:tabTextColor="?attr/primaryTextColor">
|
app:tabTextColor="?attr/primaryTextColor">
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="?attr/primaryBackgroundColor"
|
android:background="?attr/primaryBackgroundColor"
|
||||||
android:padding="16dp"
|
android:padding="16dp"
|
||||||
android:orientation="vertical">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
@ -7,7 +7,7 @@ buildscript {
|
|||||||
jcenter()
|
jcenter()
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.android.tools.build:gradle:4.1.3'
|
classpath 'com.android.tools.build:gradle:4.2.1'
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user