Skip to content

Commit

Permalink
Changed imports to new
Browse files Browse the repository at this point in the history
  • Loading branch information
arepina committed Jan 1, 2018
1 parent 01ed3cc commit 59a4f43
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 50 deletions.
2 changes: 1 addition & 1 deletion app/src/main/java/com/github/mobile/Intents.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import static org.eclipse.egit.github.core.RepositoryId.createFromUrl;
import android.content.Intent;

import com.github.mobile.api.model.Milestone;
import com.github.mobile.api.model.Project;
import com.github.mobile.api.model.Team;

Expand All @@ -27,7 +28,6 @@
import org.eclipse.egit.github.core.Gist;
import org.eclipse.egit.github.core.GistFile;
import org.eclipse.egit.github.core.Issue;
import org.eclipse.egit.github.core.Milestone;
import org.eclipse.egit.github.core.Repository;
import org.eclipse.egit.github.core.RepositoryId;
import org.eclipse.egit.github.core.User;
Expand Down
11 changes: 6 additions & 5 deletions app/src/main/java/com/github/mobile/core/issue/IssueFilter.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
*/
package com.github.mobile.core.issue;

import com.github.mobile.api.model.Milestone;

import static java.lang.String.CASE_INSENSITIVE_ORDER;
import static org.eclipse.egit.github.core.service.IssueService.DIRECTION_DESCENDING;
import static org.eclipse.egit.github.core.service.IssueService.FIELD_DIRECTION;
Expand All @@ -39,7 +41,6 @@
import java.util.TreeSet;

import org.eclipse.egit.github.core.Label;
import org.eclipse.egit.github.core.Milestone;
import org.eclipse.egit.github.core.Repository;
import org.eclipse.egit.github.core.User;

Expand Down Expand Up @@ -185,7 +186,7 @@ public Map<String, String> toFilterMap() {

if (milestone != null)
filter.put(FILTER_MILESTONE,
Integer.toString(milestone.getNumber()));
Integer.toString(milestone.number));

if (labels != null && !labels.isEmpty()) {
StringBuilder labelsQuery = new StringBuilder();
Expand Down Expand Up @@ -217,7 +218,7 @@ public CharSequence toDisplay() {
segments.add("Assignee: " + assignee.getLogin());

if (milestone != null)
segments.add("Milestone: " + milestone.getTitle());
segments.add("Milestone: " + milestone.title);

if (labels != null && !labels.isEmpty()) {
StringBuilder builder = new StringBuilder("Labels: ");
Expand All @@ -243,7 +244,7 @@ public CharSequence toDisplay() {
public int hashCode() {
return Arrays.hashCode(new Object[] { open,
assignee != null ? assignee.getId() : null,
milestone != null ? milestone.getNumber() : null,
milestone != null ? milestone.number : null,
assignee != null ? assignee.getId() : null,
repository != null ? repository.getId() : null, labels });
}
Expand All @@ -257,7 +258,7 @@ private boolean isEqual(Object a, Object b) {
private boolean isEqual(Milestone a, Milestone b) {
if (a == null && b == null)
return true;
return a != null && b != null && a.getNumber() == b.getNumber();
return a != null && b != null && a.number == b.number;
}

private boolean isEqual(User a, User b) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@

import com.github.mobile.accounts.AccountUtils;
import com.github.mobile.accounts.AuthenticatedUserTask;
import com.github.mobile.api.model.Milestone;
import com.github.mobile.core.milestone.EditMilestoneTask;
import com.github.mobile.ui.DialogFragmentActivity;
import com.github.mobile.ui.TextWatcherAdapter;
import com.github.mobile.ui.issue.MilestoneDialog;
import com.google.inject.Inject;

import org.eclipse.egit.github.core.Milestone;
import org.eclipse.egit.github.core.Repository;
import org.eclipse.egit.github.core.RepositoryId;
import org.eclipse.egit.github.core.service.CollaboratorService;
Expand Down Expand Up @@ -183,8 +183,8 @@ public void onClick(View v) {

ActionBar actionBar = getSupportActionBar();
actionBar.setDisplayHomeAsUpEnabled(true);
if (milestone.getNumber() > 0)
actionBar.setTitle(milestone.getTitle());
if (milestone.number > 0)
actionBar.setTitle(milestone.title);
else
actionBar.setTitle(R.string.new_milestone);
actionBar.setSubtitle(repository.generateId());
Expand All @@ -198,8 +198,8 @@ public void afterTextChanged(Editable s) {
});

updateSaveMenu();
titleText.setText(milestone.getTitle());
descriptionText.setText(milestone.getDescription());
titleText.setText(milestone.title);
descriptionText.setText(milestone.description);
}

@Override
Expand All @@ -222,9 +222,9 @@ private void showCollaboratorOptions() {

private void updateMilestone() {
if (milestone != null) {
titleText.setText(milestone.getTitle());
descriptionText.setText(milestone.getDescription());
Date dueOn = milestone.getDueOn();
titleText.setText(milestone.title);
descriptionText.setText(milestone.description);
Date dueOn = milestone.due_on;
if (dueOn != null) {
SimpleDateFormat sd = new SimpleDateFormat("dd-MM-yyyy");
try {
Expand Down Expand Up @@ -277,30 +277,30 @@ public boolean onOptionsItemSelected(MenuItem item) {
finish();
return true;
case R.id.m_apply:
milestone.setTitle(titleText.getText().toString());
milestone.setDescription(descriptionText.getText().toString());
milestone.title = titleText.getText().toString();
milestone.description = descriptionText.getText().toString();
SimpleDateFormat sd = new SimpleDateFormat("dd-MM-yyyy");
try {
Date date = sd.parse(dateText.getText().toString());
milestone.setDueOn(date);
milestone.due_on = date;
}
catch (ParseException e){
e.printStackTrace();
}

// new EditMilestoneTask(this, repository.getOwner(), repository, milestone) {
//
// @Override
// protected void onSuccess(Milestone editedMilestone)
// throws Exception {
// super.onSuccess(editedMilestone);
//
// Intent intent = new Intent();
// intent.putExtra(EXTRA_MILESTONE, editedMilestone);
// setResult(RESULT_OK, intent);
// finish();
// }
// }.edit();
new EditMilestoneTask(this, repository.getOwner(), repository.getName(), milestone) {

@Override
protected void onSuccess(Milestone editedMilestone)
throws Exception {
super.onSuccess(editedMilestone);

Intent intent = new Intent();
intent.putExtra(EXTRA_MILESTONE, editedMilestone);
setResult(RESULT_OK, intent);
finish();
}
}.create();

return true;
default:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@

import com.github.mobile.Intents;
import com.github.mobile.R;
import com.github.mobile.api.model.Milestone;
import com.github.mobile.core.issue.IssueFilter;
import com.github.mobile.ui.DialogFragmentActivity;
import com.github.mobile.ui.issue.IssuesFragment;

import org.eclipse.egit.github.core.Milestone;
import org.eclipse.egit.github.core.Repository;
import org.eclipse.egit.github.core.User;

Expand Down Expand Up @@ -52,7 +52,7 @@ protected void onCreate(Bundle savedInstanceState) {
milestone = getSerializableExtra(EXTRA_MILESTONE);

ActionBar actionBar = getSupportActionBar();
actionBar.setTitle(milestone.getTitle());
actionBar.setTitle(milestone.title);
actionBar.setSubtitle(R.string.milestone);
actionBar.setDisplayHomeAsUpEnabled(true);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@

import com.github.kevinsawicki.wishlist.SingleTypeAdapter;
import com.github.mobile.R;
import com.github.mobile.util.AvatarLoader;
import com.github.mobile.api.model.Milestone;

import org.eclipse.egit.github.core.Milestone;

import java.text.SimpleDateFormat;
/**
Expand Down Expand Up @@ -56,9 +55,9 @@ protected int[] getChildViewIds() {
protected void update(int position, Milestone milestone) {
SimpleDateFormat sdf = new SimpleDateFormat("dd MMM yyyy");

setText(0, milestone.getTitle());
setText(1, context.getString(R.string.ms_due_by) + sdf.format(milestone.getDueOn()));
setText(2, context.getString(R.string.ms_opened_issues) + String.valueOf(milestone.getOpenIssues()));
setText(3, context.getString(R.string.ms_closed_issues) + String.valueOf(milestone.getClosedIssues()));
setText(0, milestone.title);
setText(1, context.getString(R.string.ms_due_by) + sdf.format(milestone.due_on));
setText(2, context.getString(R.string.ms_opened_issues) + String.valueOf(milestone.open_issues));
setText(3, context.getString(R.string.ms_closed_issues) + String.valueOf(milestone.closed_issues));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,12 @@
import android.support.v7.app.ActionBar;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.Toast;

import com.github.mobile.Intents;
import com.github.mobile.R;
import com.github.mobile.api.model.Milestone;
import com.github.mobile.ui.DialogFragmentActivity;
import com.github.mobile.ui.milestone.EditMilestoneActivity;

import org.eclipse.egit.github.core.Issue;
import org.eclipse.egit.github.core.Repository;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,34 +15,26 @@
*/
package com.github.mobile.ui.repo;

import static com.github.mobile.Intents.EXTRA_MILESTONE;
import static com.github.mobile.Intents.EXTRA_REPOSITORY;
import static com.github.mobile.Intents.EXTRA_REPOSITORY_NAME;
import static com.github.mobile.Intents.EXTRA_REPOSITORY_OWNER;
import static com.github.mobile.Intents.EXTRA_USER;
import static com.github.mobile.RequestCodes.MILESTONE_VIEW;

import android.content.Context;
import android.os.Bundle;
import android.support.v4.content.Loader;
import android.view.View;
import android.widget.ListView;
import android.widget.Toast;

import com.github.kevinsawicki.wishlist.SingleTypeAdapter;
import com.github.mobile.R;
import com.github.mobile.ThrowableLoader;
import com.github.mobile.api.model.Milestone;
import com.github.mobile.ui.ItemListFragment;
import com.github.mobile.ui.milestone.MilestoneViewActivity;
import com.google.inject.Inject;

import java.util.List;

import org.eclipse.egit.github.core.Milestone;
import org.eclipse.egit.github.core.Repository;
import org.eclipse.egit.github.core.RepositoryId;
import org.eclipse.egit.github.core.RepositoryIssue;
import org.eclipse.egit.github.core.User;
import org.eclipse.egit.github.core.service.MilestoneService;

/**
Expand Down

0 comments on commit 59a4f43

Please sign in to comment.