mirror of
https://github.com/k0shk0sh/FastHub.git
synced 2026-01-25 14:47:05 +00:00
Clean up
This commit is contained in:
parent
05f54e35d5
commit
1ecb6443c2
@ -10,9 +10,8 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Created by adibk on 5/19/17.
|
||||
* Serves a model for the filter in Repositories fragment
|
||||
*/
|
||||
|
||||
public class FilterOptionsModel implements Parcelable {
|
||||
|
||||
private static final String TYPE = "type";
|
||||
@ -80,8 +79,10 @@ public class FilterOptionsModel implements Parcelable {
|
||||
queryMap.put(SORT, sort.toLowerCase());
|
||||
}
|
||||
if (sortDirection.equals(sortDirectionList.get(0))) {
|
||||
//Descending should be desc
|
||||
queryMap.put(DIRECTION, sortDirection.toLowerCase().substring(0, 4));
|
||||
} else {
|
||||
//Ascending should be asc
|
||||
queryMap.put(DIRECTION, sortDirection.toLowerCase().substring(0, 3));
|
||||
}
|
||||
|
||||
|
||||
@ -1,31 +0,0 @@
|
||||
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();
|
||||
}
|
||||
}
|
||||
@ -1,64 +0,0 @@
|
||||
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();
|
||||
}
|
||||
}
|
||||
@ -77,11 +77,6 @@ public class ProfileReposFilterBottomSheetDialog extends BaseBottomSheetDialog {
|
||||
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());
|
||||
|
||||
@ -72,7 +72,6 @@ public class ProfileReposFragment extends BaseFragment<ProfileReposMvp.View, Pro
|
||||
recycler.addKeyLineDivider();
|
||||
recycler.addOnScrollListener(getLoadMore());
|
||||
recycler.addDivider();
|
||||
getActivity().findViewById(R.id.fab);
|
||||
if (getPresenter().getRepos().isEmpty() && !getPresenter().isApiCalled()) {
|
||||
onRefresh();
|
||||
}
|
||||
|
||||
@ -128,7 +128,6 @@ public class UserPagerActivity extends BaseActivity<UserPagerMvp.View, UserPager
|
||||
pager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
|
||||
@Override
|
||||
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -142,7 +141,6 @@ public class UserPagerActivity extends BaseActivity<UserPagerMvp.View, UserPager
|
||||
|
||||
@Override
|
||||
public void onPageScrollStateChanged(int state) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@ org.gradle.jvmargs=-Xmx2536M
|
||||
android_store_password=PASSWORD
|
||||
android_key_password=PASSWORD
|
||||
android_key_alias=ALIAS
|
||||
github_client_id=3bd6cb4d390f356ba430
|
||||
github_secret=170444a220a0623493e86aebebee6a203862ef91
|
||||
github_client_id=GITHUB_CLIENT_ID
|
||||
github_secret=GITHUB_SECRET
|
||||
imgur_client_id=imgur_client_id
|
||||
imgur_secret=imgur_secret
|
||||
Loading…
x
Reference in New Issue
Block a user