mirror of
https://github.com/k0shk0sh/FastHub.git
synced 2025-12-08 19:05:54 +00:00
- Add filter for user repositories fragment
- new layout and modifications to rest api - string resources
This commit is contained in:
parent
5e7ae8465c
commit
8e3a41b06f
@ -0,0 +1,127 @@
|
||||
package com.fastaccess.data.dao.model;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Created by adibk on 5/19/17.
|
||||
*/
|
||||
|
||||
public class FilterOptionsModel implements Parcelable {
|
||||
|
||||
private static final String TYPE = "type";
|
||||
private static final String SORT = "sort";
|
||||
private static final String DIRECTION = "direction";
|
||||
|
||||
private String type = "All";
|
||||
private String sort = "Pushed";
|
||||
private String sortDirection = "descending";
|
||||
private Map<String, String> queryMap;
|
||||
|
||||
private List<String> typesList = new ArrayList<>(Arrays.asList("All", "Owner", "Public", "Private", "Member"));
|
||||
private List<String> sortOptionsList = new ArrayList<>(Arrays.asList("Pushed", "Created", "Updated", "Full Name"));
|
||||
private List<String> sortDirectionList = new ArrayList<>(Arrays.asList("Descending", "Ascending"));
|
||||
|
||||
public FilterOptionsModel() {
|
||||
}
|
||||
|
||||
protected FilterOptionsModel(Parcel in) {
|
||||
type = in.readString();
|
||||
sort = in.readString();
|
||||
sortDirection = in.readString();
|
||||
typesList = in.createStringArrayList();
|
||||
sortOptionsList = in.createStringArrayList();
|
||||
sortDirectionList = in.createStringArrayList();
|
||||
}
|
||||
|
||||
public static final Creator<FilterOptionsModel> CREATOR = new Creator<FilterOptionsModel>() {
|
||||
@Override
|
||||
public FilterOptionsModel createFromParcel(Parcel in) {
|
||||
return new FilterOptionsModel(in);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FilterOptionsModel[] newArray(int size) {
|
||||
return new FilterOptionsModel[size];
|
||||
}
|
||||
};
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public void setSort(String sort) {
|
||||
this.sort = sort;
|
||||
}
|
||||
|
||||
public void setsortDirection(String sortDirection) {
|
||||
this.sortDirection = sortDirection;
|
||||
}
|
||||
|
||||
public Map<String, String> getQueryMap() {
|
||||
if (queryMap == null) {
|
||||
queryMap = new HashMap<>();
|
||||
} else {
|
||||
queryMap.clear();
|
||||
}
|
||||
queryMap.put(TYPE, type.toLowerCase());
|
||||
if (sort.contains(" ")) {
|
||||
//full name should be full_name
|
||||
queryMap.put(SORT, sort.replace(" ", "_").toLowerCase());
|
||||
} else {
|
||||
queryMap.put(SORT, sort.toLowerCase());
|
||||
}
|
||||
if (sortDirection.equals(sortDirectionList.get(0))) {
|
||||
queryMap.put(DIRECTION, sortDirection.toLowerCase().substring(0, 4));
|
||||
} else {
|
||||
queryMap.put(DIRECTION, sortDirection.toLowerCase().substring(0, 3));
|
||||
}
|
||||
|
||||
return queryMap;
|
||||
}
|
||||
|
||||
public int getSelectedTypeIndex() {
|
||||
return typesList.indexOf(type);
|
||||
}
|
||||
|
||||
public int getSelectedSortOptionIndex() {
|
||||
return sortOptionsList.indexOf(sort);
|
||||
}
|
||||
|
||||
public int getSelectedSortDirectionIndex() {
|
||||
return sortDirectionList.indexOf(sortDirection);
|
||||
}
|
||||
|
||||
public List<String> getTypesList() {
|
||||
return typesList;
|
||||
}
|
||||
|
||||
public List<String> getSortOptionList() {
|
||||
return sortOptionsList;
|
||||
}
|
||||
|
||||
public List<String> getSortDirectionList() {
|
||||
return sortDirectionList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
dest.writeString(type);
|
||||
dest.writeString(sort);
|
||||
dest.writeString(sortDirection);
|
||||
dest.writeStringList(typesList);
|
||||
dest.writeStringList(sortOptionsList);
|
||||
dest.writeStringList(sortDirectionList);
|
||||
}
|
||||
}
|
||||
@ -8,6 +8,8 @@ import com.fastaccess.data.dao.model.Login;
|
||||
import com.fastaccess.data.dao.model.Repo;
|
||||
import com.fastaccess.data.dao.model.User;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import retrofit2.Response;
|
||||
import retrofit2.http.DELETE;
|
||||
@ -15,6 +17,7 @@ import retrofit2.http.GET;
|
||||
import retrofit2.http.PUT;
|
||||
import retrofit2.http.Path;
|
||||
import retrofit2.http.Query;
|
||||
import retrofit2.http.QueryMap;
|
||||
import retrofit2.http.Url;
|
||||
|
||||
|
||||
@ -34,8 +37,8 @@ public interface UserRestService {
|
||||
@GET("users/{username}/repos?affiliation=owner,collaborator&sort=pushed&direction=desc")
|
||||
Observable<Pageable<Repo>> getRepos(@Path("username") @NonNull String username, @Query("page") int page);
|
||||
|
||||
@GET("/user/repos?affiliation=owner,collaborator&sort=pushed&direction=desc")
|
||||
Observable<Pageable<Repo>> getRepos(@Query("page") int page);
|
||||
@GET("/user/repos")
|
||||
Observable<Pageable<Repo>> getRepos(@QueryMap(encoded=true) Map<String, String> filterParams, @Query(value = "page", encoded = true) int page);
|
||||
|
||||
@GET("users/{username}/starred") Observable<Pageable<Repo>>
|
||||
getStarred(@Path("username") @NonNull String username, @Query("page") int page);
|
||||
|
||||
@ -0,0 +1,31 @@
|
||||
package com.fastaccess.ui.modules.profile.repos;
|
||||
|
||||
import com.fastaccess.ui.base.mvp.BaseMvp;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by adibk on 5/29/17.
|
||||
*/
|
||||
|
||||
public interface ProfileRepoFilterMvp {
|
||||
|
||||
interface View extends BaseMvp.FAView {
|
||||
|
||||
}
|
||||
|
||||
interface Presenter {
|
||||
|
||||
void onTypeSelected(String selectedType);
|
||||
void onSortOptionSelected(String selectedSortOption);
|
||||
void onSortDirectionSelected(String selectedSortDirection);
|
||||
|
||||
int getTypePosition();
|
||||
int getSortOptionPosition();
|
||||
int getSortDirectionPosition();
|
||||
|
||||
List<String> getTypesList();
|
||||
List<String> getSortOptionList();
|
||||
List<String> getSortDirectionList();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,64 @@
|
||||
package com.fastaccess.ui.modules.profile.repos;
|
||||
|
||||
import com.fastaccess.data.dao.model.FilterOptionsModel;
|
||||
import com.fastaccess.ui.base.mvp.presenter.BasePresenter;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by adibk on 5/29/17.
|
||||
*/
|
||||
|
||||
public class ProfileRepoFilterPresenter extends BasePresenter<ProfileRepoFilterMvp.View> implements ProfileRepoFilterMvp.Presenter {
|
||||
|
||||
private FilterOptionsModel filterOptions = new FilterOptionsModel();
|
||||
|
||||
@Override
|
||||
public void onTypeSelected(String selectedType) {
|
||||
filterOptions.setType(selectedType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSortOptionSelected(String selectedSortOption) {
|
||||
filterOptions.setSort(selectedSortOption);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSortDirectionSelected(String selectedSortDirection) {
|
||||
filterOptions.setsortDirection(selectedSortDirection);
|
||||
}
|
||||
|
||||
public FilterOptionsModel getFilterOptions() {
|
||||
return filterOptions;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTypePosition() {
|
||||
return filterOptions.getSelectedTypeIndex();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSortOptionPosition() {
|
||||
return filterOptions.getSelectedSortOptionIndex();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSortDirectionPosition() {
|
||||
return filterOptions.getSelectedSortDirectionIndex();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getTypesList() {
|
||||
return filterOptions.getTypesList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getSortOptionList() {
|
||||
return filterOptions.getSortOptionList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getSortDirectionList() {
|
||||
return filterOptions.getSortDirectionList();
|
||||
}
|
||||
}
|
||||
@ -1,14 +1,117 @@
|
||||
package com.fastaccess.ui.modules.profile.repos;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.Button;
|
||||
import android.widget.Spinner;
|
||||
|
||||
import com.fastaccess.R;
|
||||
import com.fastaccess.data.dao.model.FilterOptionsModel;
|
||||
import com.fastaccess.ui.base.BaseBottomSheetDialog;
|
||||
|
||||
/**
|
||||
* Created by adibk on 5/8/17.
|
||||
*/
|
||||
import butterknife.BindView;
|
||||
import butterknife.OnClick;
|
||||
|
||||
public class ProfileReposFilterBottomSheetDialog extends BaseBottomSheetDialog {
|
||||
|
||||
private static final String FILTER = "filter";
|
||||
|
||||
@BindView(R.id.type_selection) Spinner typeSelectionSpinner;
|
||||
@BindView(R.id.sort_selection) Spinner sortSelectionSpinner;
|
||||
@BindView(R.id.filter_sheet_apply_btn) Button applyBtn;
|
||||
@BindView(R.id.sort_direction_selection) Spinner sortDirectionSpinner;
|
||||
|
||||
private ProfileReposFilterChangeListener listener;
|
||||
private FilterOptionsModel currentFilterOptions;
|
||||
|
||||
@Override
|
||||
protected int layoutRes() {
|
||||
return 0;
|
||||
return R.layout.filter_bottom_sheet;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
ArrayAdapter<String> typesAdapter = new ArrayAdapter<>(getContext(), android.R.layout.simple_list_item_1, currentFilterOptions.getTypesList());
|
||||
ArrayAdapter<String> sortOptionsAdapter = new ArrayAdapter<>(getContext(), android.R.layout.simple_list_item_1, currentFilterOptions.getSortOptionList());
|
||||
ArrayAdapter<String> sortDirectionAdapter = new ArrayAdapter<>(getContext(), android.R.layout.simple_list_item_1, currentFilterOptions.getSortDirectionList());
|
||||
typeSelectionSpinner.setAdapter(typesAdapter);
|
||||
sortSelectionSpinner.setAdapter(sortOptionsAdapter);
|
||||
sortDirectionSpinner.setAdapter(sortDirectionAdapter);
|
||||
|
||||
typeSelectionSpinner.setSelection(currentFilterOptions.getSelectedTypeIndex());
|
||||
sortSelectionSpinner.setSelection(currentFilterOptions.getSelectedSortOptionIndex());
|
||||
sortDirectionSpinner.setSelection(currentFilterOptions.getSelectedSortDirectionIndex());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAttach(Context context) {
|
||||
super.onAttach(context);
|
||||
listener = ((ProfileReposFragment) getParentFragment());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDetach() {
|
||||
super.onDetach();
|
||||
listener = null;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
if (savedInstanceState != null) {
|
||||
setCurrentFilterOptions(((FilterOptionsModel) savedInstanceState.get(FILTER)));
|
||||
}
|
||||
return super.onCreateView(inflater, container, savedInstanceState);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSaveInstanceState(Bundle outState) {
|
||||
super.onSaveInstanceState(outState);
|
||||
outState.putParcelable(FILTER, currentFilterOptions);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
}
|
||||
|
||||
@OnClick(R.id.filter_sheet_apply_btn) public void onApply() {
|
||||
if (listener != null) {
|
||||
listener.onTypeSelected((String) typeSelectionSpinner.getSelectedItem());
|
||||
listener.onSortOptionSelected((String) sortSelectionSpinner.getSelectedItem());
|
||||
listener.onSortDirectionSelected((String) sortDirectionSpinner.getSelectedItem());
|
||||
listener.onFilterApply();
|
||||
dismiss();
|
||||
}
|
||||
}
|
||||
|
||||
@OnClick(R.id.filter_sheet_reset_btn) public void onReset() {
|
||||
typeSelectionSpinner.setSelection(0);
|
||||
sortDirectionSpinner.setSelection(0);
|
||||
sortSelectionSpinner.setSelection(0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dismiss() {
|
||||
currentFilterOptions = null;
|
||||
super.dismiss();
|
||||
}
|
||||
|
||||
public void setCurrentFilterOptions(FilterOptionsModel currentFilterOptions) {
|
||||
this.currentFilterOptions = currentFilterOptions;
|
||||
}
|
||||
|
||||
public interface ProfileReposFilterChangeListener {
|
||||
void onFilterApply();
|
||||
void onTypeSelected(String selectedType);
|
||||
void onSortOptionSelected(String selectedSortOption);
|
||||
void onSortDirectionSelected(String selectedSortDirection);
|
||||
}
|
||||
}
|
||||
|
||||
@ -25,13 +25,14 @@ import butterknife.BindView;
|
||||
* Created by Kosh on 03 Dec 2016, 3:56 PM
|
||||
*/
|
||||
|
||||
public class ProfileReposFragment extends BaseFragment<ProfileReposMvp.View, ProfileReposPresenter> implements ProfileReposMvp.View {
|
||||
public class ProfileReposFragment extends BaseFragment<ProfileReposMvp.View, ProfileReposPresenter> implements ProfileReposMvp.View, ProfileReposFilterBottomSheetDialog.ProfileReposFilterChangeListener {
|
||||
|
||||
@BindView(R.id.recycler) DynamicRecyclerView recycler;
|
||||
@BindView(R.id.refresh) SwipeRefreshLayout refresh;
|
||||
@BindView(R.id.stateLayout) StateLayout stateLayout;
|
||||
private OnLoadMore<String> onLoadMore;
|
||||
private ReposAdapter adapter;
|
||||
private ProfileReposFilterBottomSheetDialog dialog;
|
||||
|
||||
public static ProfileReposFragment newInstance(@NonNull String username) {
|
||||
ProfileReposFragment view = new ProfileReposFragment();
|
||||
@ -53,7 +54,7 @@ public class ProfileReposFragment extends BaseFragment<ProfileReposMvp.View, Pro
|
||||
}
|
||||
|
||||
@Override protected int fragmentLayout() {
|
||||
return R.layout.micro_grid_refresh_list;
|
||||
return R.layout.profile_repo_fragment;
|
||||
}
|
||||
|
||||
@Override protected void onFragmentCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
||||
@ -75,6 +76,7 @@ public class ProfileReposFragment extends BaseFragment<ProfileReposMvp.View, Pro
|
||||
if (getPresenter().getRepos().isEmpty() && !getPresenter().isApiCalled()) {
|
||||
onRefresh();
|
||||
}
|
||||
dialog = new ProfileReposFilterBottomSheetDialog();
|
||||
}
|
||||
|
||||
@NonNull @Override public ProfileReposPresenter providePresenter() {
|
||||
@ -112,7 +114,8 @@ public class ProfileReposFragment extends BaseFragment<ProfileReposMvp.View, Pro
|
||||
|
||||
@Override
|
||||
public void onRepoFilterClicked() {
|
||||
|
||||
dialog.setCurrentFilterOptions(getPresenter().getFilterOptions());
|
||||
dialog.show(getChildFragmentManager(), "ProfileReposFilterBottomSheetDialog");
|
||||
}
|
||||
|
||||
@Override public void onRefresh() {
|
||||
@ -132,4 +135,24 @@ public class ProfileReposFragment extends BaseFragment<ProfileReposMvp.View, Pro
|
||||
hideProgress();
|
||||
stateLayout.showReload(adapter.getItemCount());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFilterApply() {
|
||||
getPresenter().onFilterApply();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTypeSelected(String selectedType) {
|
||||
getPresenter().onTypeSelected(selectedType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSortOptionSelected(String selectedSortOption) {
|
||||
getPresenter().onSortOptionSelected(selectedSortOption);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSortDirectionSelected(String selectedSortDirection) {
|
||||
getPresenter().onSortDirectionSelected(selectedSortDirection);
|
||||
}
|
||||
}
|
||||
|
||||
@ -33,5 +33,9 @@ interface ProfileReposMvp {
|
||||
@NonNull ArrayList<Repo> getRepos();
|
||||
|
||||
void onWorkOffline(@NonNull String login);
|
||||
void onFilterApply();
|
||||
void onTypeSelected(String selectedType);
|
||||
void onSortOptionSelected(String selectedSortOption);
|
||||
void onSortDirectionSelected(String selectedSortDirection);
|
||||
}
|
||||
}
|
||||
|
||||
@ -6,6 +6,7 @@ import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
|
||||
import com.fastaccess.data.dao.NameParser;
|
||||
import com.fastaccess.data.dao.model.FilterOptionsModel;
|
||||
import com.fastaccess.data.dao.model.Login;
|
||||
import com.fastaccess.data.dao.model.Repo;
|
||||
import com.fastaccess.helper.RxHelper;
|
||||
@ -24,8 +25,10 @@ class ProfileReposPresenter extends BasePresenter<ProfileReposMvp.View> implemen
|
||||
private ArrayList<Repo> repos = new ArrayList<>();
|
||||
private int page;
|
||||
private int previousTotal;
|
||||
private String username;
|
||||
private int lastPage = Integer.MAX_VALUE;
|
||||
private String currentLoggedIn;
|
||||
private FilterOptionsModel filterOptions = new FilterOptionsModel();
|
||||
|
||||
@Override public int getCurrentPage() {
|
||||
return page;
|
||||
@ -59,6 +62,7 @@ class ProfileReposPresenter extends BasePresenter<ProfileReposMvp.View> implemen
|
||||
if (parameter == null) {
|
||||
throw new NullPointerException("Username is null");
|
||||
}
|
||||
username = parameter;
|
||||
if (page == 1) {
|
||||
lastPage = Integer.MAX_VALUE;
|
||||
sendToView(view -> view.getLoadMore().reset());
|
||||
@ -68,8 +72,8 @@ class ProfileReposPresenter extends BasePresenter<ProfileReposMvp.View> implemen
|
||||
sendToView(ProfileReposMvp.View::hideProgress);
|
||||
return;
|
||||
}
|
||||
makeRestCall(TextUtils.equals(currentLoggedIn, parameter)
|
||||
? RestProvider.getUserService().getRepos(page)
|
||||
makeRestCall(TextUtils.equals(currentLoggedIn, username)
|
||||
? RestProvider.getUserService().getRepos(filterOptions.getQueryMap(), page)
|
||||
: RestProvider.getUserService().getRepos(parameter, page),
|
||||
repoModelPageable -> {
|
||||
lastPage = repoModelPageable.getLast();
|
||||
@ -98,4 +102,28 @@ class ProfileReposPresenter extends BasePresenter<ProfileReposMvp.View> implemen
|
||||
}
|
||||
|
||||
@Override public void onItemLongClick(int position, View v, Repo item) {}
|
||||
|
||||
public FilterOptionsModel getFilterOptions() {
|
||||
return filterOptions;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFilterApply() {
|
||||
onCallApi(1, username);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTypeSelected(String selectedType) {
|
||||
filterOptions.setType(selectedType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSortOptionSelected(String selectedSortOption) {
|
||||
filterOptions.setSort(selectedSortOption);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSortDirectionSelected(String selectedSortDirection) {
|
||||
filterOptions.setsortDirection(selectedSortDirection);
|
||||
}
|
||||
}
|
||||
|
||||
@ -6,48 +6,136 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<RelativeLayout
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/material_blue_50"
|
||||
android:elevation="4dp"
|
||||
android:paddingLeft="16dp">
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/filter_sheet_header"
|
||||
android:layout_width="wrap_content"
|
||||
<RelativeLayout
|
||||
android:id="@+id/filter_header_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:text="Filter" />
|
||||
android:background="@color/material_blue_accent_400"
|
||||
android:elevation="4dp">
|
||||
|
||||
<Button
|
||||
android:id="@+id/filter_sheet_apply_btn"
|
||||
android:minWidth="0dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:background="@null"
|
||||
android:text="Apply"
|
||||
android:includeFontPadding="false"
|
||||
android:drawablePadding="0dp"
|
||||
android:paddingLeft="28dp"
|
||||
android:paddingRight="16dp"
|
||||
android:textColor="@color/white" />
|
||||
<TextView
|
||||
android:id="@+id/filter_sheet_header"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginLeft="16dp"
|
||||
android:text="@string/filter"
|
||||
android:textColor="@color/white" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/filter_sheet_reset_btn"
|
||||
android:minWidth="0dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_toLeftOf="@+id/filter_sheet_apply_btn"
|
||||
android:background="@null"
|
||||
android:text="Reset"
|
||||
android:includeFontPadding="false"
|
||||
android:drawablePadding="0dp"
|
||||
android:paddingRight="0dp"
|
||||
android:textColor="@color/white" />
|
||||
</RelativeLayout>
|
||||
<Button
|
||||
android:id="@+id/filter_sheet_apply_btn"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:background="@null"
|
||||
android:drawablePadding="0dp"
|
||||
android:includeFontPadding="false"
|
||||
android:minWidth="0dp"
|
||||
android:paddingLeft="28dp"
|
||||
android:paddingRight="16dp"
|
||||
android:text="@string/apply"
|
||||
android:textColor="@color/white" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/filter_sheet_reset_btn"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_toLeftOf="@+id/filter_sheet_apply_btn"
|
||||
android:background="@null"
|
||||
android:drawablePadding="0dp"
|
||||
android:includeFontPadding="false"
|
||||
android:minWidth="0dp"
|
||||
android:paddingRight="0dp"
|
||||
android:text="@string/reset"
|
||||
android:textColor="@color/white" />
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<android.support.v7.widget.CardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginRight="16dp"
|
||||
android:layout_marginLeft="16dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:text="@string/type" />
|
||||
|
||||
<Spinner
|
||||
android:id="@+id/type_selection"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_alignParentRight="true"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
</android.support.v7.widget.CardView>
|
||||
|
||||
<android.support.v7.widget.CardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="16dp"
|
||||
android:layout_marginRight="16dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:text="@string/sort"/>
|
||||
|
||||
<Spinner
|
||||
android:id="@+id/sort_selection"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true" />
|
||||
|
||||
</RelativeLayout>
|
||||
</android.support.v7.widget.CardView>
|
||||
|
||||
<android.support.v7.widget.CardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="16dp"
|
||||
android:layout_marginRight="16dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:text="@string/sort_direction"/>
|
||||
|
||||
<Spinner
|
||||
android:id="@+id/sort_direction_selection"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
</android.support.v7.widget.CardView>
|
||||
</LinearLayout>
|
||||
</FrameLayout>
|
||||
|
||||
@ -0,0 +1,141 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/filter_header_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/material_blue_accent_400"
|
||||
android:elevation="4dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/filter_sheet_header"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginLeft="16dp"
|
||||
android:text="@string/filter"
|
||||
android:textColor="@color/white" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/filter_sheet_apply_btn"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:background="@null"
|
||||
android:drawablePadding="0dp"
|
||||
android:includeFontPadding="false"
|
||||
android:minWidth="0dp"
|
||||
android:paddingLeft="28dp"
|
||||
android:paddingRight="16dp"
|
||||
android:text="@string/apply"
|
||||
android:textColor="@color/white" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/filter_sheet_reset_btn"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_toLeftOf="@+id/filter_sheet_apply_btn"
|
||||
android:background="@null"
|
||||
android:drawablePadding="0dp"
|
||||
android:includeFontPadding="false"
|
||||
android:minWidth="0dp"
|
||||
android:paddingRight="0dp"
|
||||
android:text="@string/reset"
|
||||
android:textColor="@color/white" />
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<android.support.v7.widget.CardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginRight="16dp"
|
||||
android:layout_marginLeft="16dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:text="@string/type" />
|
||||
|
||||
<Spinner
|
||||
android:id="@+id/type_selection"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_alignParentRight="true"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
</android.support.v7.widget.CardView>
|
||||
|
||||
<android.support.v7.widget.CardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="16dp"
|
||||
android:layout_marginRight="16dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:text="@string/sort"/>
|
||||
|
||||
<Spinner
|
||||
android:id="@+id/sort_selection"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true" />
|
||||
|
||||
</RelativeLayout>
|
||||
</android.support.v7.widget.CardView>
|
||||
|
||||
<android.support.v7.widget.CardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="16dp"
|
||||
android:layout_marginRight="16dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:text="@string/sort_direction"/>
|
||||
|
||||
<Spinner
|
||||
android:id="@+id/sort_direction_selection"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
</android.support.v7.widget.CardView>
|
||||
</LinearLayout>
|
||||
</FrameLayout>
|
||||
@ -469,5 +469,10 @@
|
||||
<string name="daily" translatable="false">Daily</string>
|
||||
<string name="weekly" translatable="false">Weekly</string>
|
||||
<string name="monthly" translatable="false">Monthly</string>
|
||||
<string name="reset">Reset</string>
|
||||
<string name="apply">Apply</string>
|
||||
<string name="filter">Filter</string>
|
||||
</resources>
|
||||
<string name="type">Type</string>
|
||||
<string name="Sort">Sort</string>
|
||||
<string name="sort_direction">Sort direction</string>
|
||||
</resources>
|
||||
|
||||
@ -2,7 +2,7 @@ org.gradle.jvmargs=-Xmx2536M
|
||||
android_store_password=PASSWORD
|
||||
android_key_password=PASSWORD
|
||||
android_key_alias=ALIAS
|
||||
github_client_id=GITHUB_CLIENT_ID
|
||||
github_secret=GITHUB_SECRET
|
||||
github_client_id=3bd6cb4d390f356ba430
|
||||
github_secret=170444a220a0623493e86aebebee6a203862ef91
|
||||
imgur_client_id=imgur_client_id
|
||||
imgur_secret=imgur_secret
|
||||
Loading…
x
Reference in New Issue
Block a user