Skip to content

Commit 35e196b

Browse files
committed
Extend PagerActivity in IssuesViewActivity
1 parent cbd302c commit 35e196b

1 file changed

Lines changed: 10 additions & 13 deletions

File tree

app/src/main/java/com/github/mobile/ui/issue/IssuesViewActivity.java

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
import static com.github.mobile.Intents.EXTRA_REPOSITORY;
2222
import android.content.Intent;
2323
import android.os.Bundle;
24-
import android.support.v4.view.ViewPager.OnPageChangeListener;
2524

2625
import com.actionbarsherlock.app.ActionBar;
2726
import com.github.mobile.Intents.Builder;
@@ -31,7 +30,8 @@
3130
import com.github.mobile.core.issue.IssueStore;
3231
import com.github.mobile.core.issue.IssueUtils;
3332
import com.github.mobile.core.repo.RefreshRepositoryTask;
34-
import com.github.mobile.ui.DialogFragmentActivity;
33+
import com.github.mobile.ui.FragmentProvider;
34+
import com.github.mobile.ui.PagerActivity;
3535
import com.github.mobile.ui.UrlLauncher;
3636
import com.github.mobile.ui.ViewPager;
3737
import com.github.mobile.util.AvatarLoader;
@@ -54,8 +54,7 @@
5454
/**
5555
* Activity to display a collection of issues or pull requests in a pager
5656
*/
57-
public class IssuesViewActivity extends DialogFragmentActivity implements
58-
OnPageChangeListener {
57+
public class IssuesViewActivity extends PagerActivity {
5958

6059
private static final String EXTRA_PULL_REQUESTS = "pullRequests";
6160

@@ -219,11 +218,6 @@ protected void onSuccess(Repository fullRepository)
219218
}.execute();
220219
}
221220

222-
public void onPageScrolled(int position, float positionOffset,
223-
int positionOffsetPixels) {
224-
// Intentionally left blank
225-
}
226-
227221
private void updateTitle(final int position) {
228222
int number = issueNumbers[position];
229223
boolean pullRequest = pullRequests[position];
@@ -236,7 +230,10 @@ private void updateTitle(final int position) {
236230
getString(string.issue_title) + number);
237231
}
238232

233+
@Override
239234
public void onPageSelected(final int position) {
235+
super.onPageSelected(position);
236+
240237
if (repo != null) {
241238
updateTitle(position);
242239
return;
@@ -267,10 +264,6 @@ public void onPageSelected(final int position) {
267264
}
268265
}
269266

270-
public void onPageScrollStateChanged(int state) {
271-
// Intentionally left blank
272-
}
273-
274267
@Override
275268
public void onDialogResult(int requestCode, int resultCode, Bundle arguments) {
276269
adapter.onDialogResult(pager.getCurrentItem(), requestCode, resultCode,
@@ -285,4 +278,8 @@ public void startActivity(Intent intent) {
285278
else
286279
super.startActivity(intent);
287280
}
281+
282+
protected FragmentProvider getProvider() {
283+
return adapter;
284+
}
288285
}

0 commit comments

Comments
 (0)