Skip to content

Commit

Permalink
Display closed milestone in repo
Browse files Browse the repository at this point in the history
Remove redundant code
  • Loading branch information
phansier committed Dec 17, 2017
1 parent 3c2e2f3 commit 177aff9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,9 @@ public class MilestoneListAdapter extends SingleTypeAdapter<Milestone> {
*
* @param context
* @param elements
* @param avatars
*/
public MilestoneListAdapter(final Context context,
final Milestone[] elements, final AvatarLoader avatars) {
final Milestone[] elements) {
super(LayoutInflater.from(context), R.layout.milestone_item);
this.context = context.getApplicationContext();
setItems(elements);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
package com.github.mobile.ui.repo;

import static com.github.mobile.Intents.EXTRA_REPOSITORY;
import static org.eclipse.egit.github.core.service.IssueService.STATE_OPEN;

import android.content.Context;
import android.os.Bundle;
Expand All @@ -29,7 +28,6 @@
import com.github.mobile.R;
import com.github.mobile.ThrowableLoader;
import com.github.mobile.ui.ItemListFragment;
import com.github.mobile.util.AvatarLoader;
import com.google.inject.Inject;

import java.util.List;
Expand All @@ -42,12 +40,7 @@
* Fragment to display a list of milestones for a specific repository
*/
public class RepositoryMilestonesFragment extends ItemListFragment<Milestone> {

/**
* Avatar loader
*/
@Inject
protected AvatarLoader avatars;
public static final String MILESTONES_STATE_ALL="all";

/**
* Milestone service
Expand Down Expand Up @@ -77,17 +70,15 @@ public Loader<List<Milestone>> onCreateLoader(int id, Bundle args) {

@Override
public List<Milestone> loadData() throws Exception {
//todo which state? STATE_OPEN?
return service.getMilestones(repo, STATE_OPEN);
return service.getMilestones(repo, MILESTONES_STATE_ALL);
}
};
}

@Override
protected SingleTypeAdapter<Milestone> createAdapter(List<Milestone> items) {
//todo what to send to MilestoneListAdapter
return new MilestoneListAdapter(getActivity(),
items.toArray(new Milestone[items.size()]), avatars);
items.toArray(new Milestone[items.size()]));
}

@Override
Expand Down

0 comments on commit 177aff9

Please sign in to comment.