Rename viewer to reader
This commit is contained in:
parent
5142df103b
commit
915847c0ed
@ -38,7 +38,7 @@
|
|||||||
android:value="eu.kanade.mangafeed.ui.activity.MainActivity" />
|
android:value="eu.kanade.mangafeed.ui.activity.MainActivity" />
|
||||||
</activity>
|
</activity>
|
||||||
<activity
|
<activity
|
||||||
android:name=".ui.activity.ViewerActivity"
|
android:name=".ui.activity.ReaderActivity"
|
||||||
android:label="@string/title_activity_viewer"
|
android:label="@string/title_activity_viewer"
|
||||||
android:parentActivityName=".ui.activity.MangaDetailActivity"
|
android:parentActivityName=".ui.activity.MangaDetailActivity"
|
||||||
android:theme="@style/AppTheme" >
|
android:theme="@style/AppTheme" >
|
||||||
|
@ -13,7 +13,7 @@ import eu.kanade.mangafeed.presenter.MangaChaptersPresenter;
|
|||||||
import eu.kanade.mangafeed.presenter.MangaDetailPresenter;
|
import eu.kanade.mangafeed.presenter.MangaDetailPresenter;
|
||||||
import eu.kanade.mangafeed.presenter.MangaInfoPresenter;
|
import eu.kanade.mangafeed.presenter.MangaInfoPresenter;
|
||||||
import eu.kanade.mangafeed.presenter.SourcePresenter;
|
import eu.kanade.mangafeed.presenter.SourcePresenter;
|
||||||
import eu.kanade.mangafeed.presenter.ViewerPresenter;
|
import eu.kanade.mangafeed.presenter.ReaderPresenter;
|
||||||
|
|
||||||
@Singleton
|
@Singleton
|
||||||
@Component(
|
@Component(
|
||||||
@ -31,7 +31,7 @@ public interface AppComponent {
|
|||||||
void inject(CataloguePresenter cataloguePresenter);
|
void inject(CataloguePresenter cataloguePresenter);
|
||||||
void inject(MangaInfoPresenter mangaInfoPresenter);
|
void inject(MangaInfoPresenter mangaInfoPresenter);
|
||||||
void inject(MangaChaptersPresenter mangaChaptersPresenter);
|
void inject(MangaChaptersPresenter mangaChaptersPresenter);
|
||||||
void inject(ViewerPresenter viewerPresenter);
|
void inject(ReaderPresenter readerPresenter);
|
||||||
|
|
||||||
Application application();
|
Application application();
|
||||||
|
|
||||||
|
@ -11,14 +11,14 @@ import eu.kanade.mangafeed.data.caches.CacheManager;
|
|||||||
import eu.kanade.mangafeed.data.models.Chapter;
|
import eu.kanade.mangafeed.data.models.Chapter;
|
||||||
import eu.kanade.mangafeed.data.models.Page;
|
import eu.kanade.mangafeed.data.models.Page;
|
||||||
import eu.kanade.mangafeed.sources.Source;
|
import eu.kanade.mangafeed.sources.Source;
|
||||||
import eu.kanade.mangafeed.ui.activity.ViewerActivity;
|
import eu.kanade.mangafeed.ui.activity.ReaderActivity;
|
||||||
import eu.kanade.mangafeed.util.EventBusHook;
|
import eu.kanade.mangafeed.util.EventBusHook;
|
||||||
import eu.kanade.mangafeed.util.events.SourceChapterEvent;
|
import eu.kanade.mangafeed.util.events.SourceChapterEvent;
|
||||||
import rx.Observable;
|
import rx.Observable;
|
||||||
import rx.android.schedulers.AndroidSchedulers;
|
import rx.android.schedulers.AndroidSchedulers;
|
||||||
import rx.schedulers.Schedulers;
|
import rx.schedulers.Schedulers;
|
||||||
|
|
||||||
public class ViewerPresenter extends BasePresenter<ViewerActivity> {
|
public class ReaderPresenter extends BasePresenter<ReaderActivity> {
|
||||||
|
|
||||||
private static final int GET_PAGE_LIST = 1;
|
private static final int GET_PAGE_LIST = 1;
|
||||||
private Source source;
|
private Source source;
|
||||||
@ -38,7 +38,7 @@ public class ViewerPresenter extends BasePresenter<ViewerActivity> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onTakeView(ViewerActivity view) {
|
protected void onTakeView(ReaderActivity view) {
|
||||||
super.onTakeView(view);
|
super.onTakeView(view);
|
||||||
registerForStickyEvents();
|
registerForStickyEvents();
|
||||||
}
|
}
|
@ -8,19 +8,19 @@ import android.support.v4.view.ViewPager;
|
|||||||
import butterknife.Bind;
|
import butterknife.Bind;
|
||||||
import butterknife.ButterKnife;
|
import butterknife.ButterKnife;
|
||||||
import eu.kanade.mangafeed.R;
|
import eu.kanade.mangafeed.R;
|
||||||
import eu.kanade.mangafeed.presenter.ViewerPresenter;
|
import eu.kanade.mangafeed.presenter.ReaderPresenter;
|
||||||
import eu.kanade.mangafeed.ui.adapter.ViewerPageAdapter;
|
import eu.kanade.mangafeed.ui.adapter.ReaderPageAdapter;
|
||||||
import nucleus.factory.RequiresPresenter;
|
import nucleus.factory.RequiresPresenter;
|
||||||
|
|
||||||
@RequiresPresenter(ViewerPresenter.class)
|
@RequiresPresenter(ReaderPresenter.class)
|
||||||
public class ViewerActivity extends BaseActivity<ViewerPresenter> {
|
public class ReaderActivity extends BaseActivity<ReaderPresenter> {
|
||||||
|
|
||||||
@Bind(R.id.view_pager) ViewPager viewPager;
|
@Bind(R.id.view_pager) ViewPager viewPager;
|
||||||
|
|
||||||
private ViewerPageAdapter adapter;
|
private ReaderPageAdapter adapter;
|
||||||
|
|
||||||
public static Intent newInstance(Context context) {
|
public static Intent newInstance(Context context) {
|
||||||
return new Intent(context, ViewerActivity.class);
|
return new Intent(context, ReaderActivity.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -33,7 +33,7 @@ public class ViewerActivity extends BaseActivity<ViewerPresenter> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void createAdapter() {
|
private void createAdapter() {
|
||||||
adapter = new ViewerPageAdapter(getSupportFragmentManager());
|
adapter = new ReaderPageAdapter(getSupportFragmentManager());
|
||||||
viewPager.setAdapter(adapter);
|
viewPager.setAdapter(adapter);
|
||||||
}
|
}
|
||||||
|
|
@ -5,13 +5,13 @@ import android.support.v4.app.FragmentManager;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import eu.kanade.mangafeed.ui.fragment.ViewerPageFragment;
|
import eu.kanade.mangafeed.ui.fragment.ReaderPageFragment;
|
||||||
|
|
||||||
public class ViewerPageAdapter extends SmartFragmentStatePagerAdapter {
|
public class ReaderPageAdapter extends SmartFragmentStatePagerAdapter {
|
||||||
|
|
||||||
private List<String> imageUrls;
|
private List<String> imageUrls;
|
||||||
|
|
||||||
public ViewerPageAdapter(FragmentManager fragmentManager) {
|
public ReaderPageAdapter(FragmentManager fragmentManager) {
|
||||||
super(fragmentManager);
|
super(fragmentManager);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -25,7 +25,7 @@ public class ViewerPageAdapter extends SmartFragmentStatePagerAdapter {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Fragment getItem(int position) {
|
public Fragment getItem(int position) {
|
||||||
return ViewerPageFragment.newInstance(imageUrls.get(position), position);
|
return ReaderPageFragment.newInstance(imageUrls.get(position), position);
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<String> getImageUrls() {
|
public List<String> getImageUrls() {
|
@ -21,7 +21,7 @@ import eu.kanade.mangafeed.R;
|
|||||||
import eu.kanade.mangafeed.data.models.Chapter;
|
import eu.kanade.mangafeed.data.models.Chapter;
|
||||||
import eu.kanade.mangafeed.presenter.MangaChaptersPresenter;
|
import eu.kanade.mangafeed.presenter.MangaChaptersPresenter;
|
||||||
import eu.kanade.mangafeed.ui.activity.MangaDetailActivity;
|
import eu.kanade.mangafeed.ui.activity.MangaDetailActivity;
|
||||||
import eu.kanade.mangafeed.ui.activity.ViewerActivity;
|
import eu.kanade.mangafeed.ui.activity.ReaderActivity;
|
||||||
import eu.kanade.mangafeed.ui.adapter.ChapterListHolder;
|
import eu.kanade.mangafeed.ui.adapter.ChapterListHolder;
|
||||||
import nucleus.factory.RequiresPresenter;
|
import nucleus.factory.RequiresPresenter;
|
||||||
import uk.co.ribot.easyadapter.EasyRecyclerAdapter;
|
import uk.co.ribot.easyadapter.EasyRecyclerAdapter;
|
||||||
@ -77,7 +77,7 @@ public class MangaChaptersFragment extends BaseFragment<MangaChaptersPresenter>
|
|||||||
private void createAdapter() {
|
private void createAdapter() {
|
||||||
ChapterListHolder.ChapterListener listener = chapter -> {
|
ChapterListHolder.ChapterListener listener = chapter -> {
|
||||||
getPresenter().onChapterClicked(chapter);
|
getPresenter().onChapterClicked(chapter);
|
||||||
Intent intent = ViewerActivity.newInstance(getActivity());
|
Intent intent = ReaderActivity.newInstance(getActivity());
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -13,15 +13,15 @@ import com.davemorrissey.labs.subscaleview.SubsamplingScaleImageView;
|
|||||||
import eu.kanade.mangafeed.R;
|
import eu.kanade.mangafeed.R;
|
||||||
import eu.kanade.mangafeed.util.PageFileTarget;
|
import eu.kanade.mangafeed.util.PageFileTarget;
|
||||||
|
|
||||||
public class ViewerPageFragment extends Fragment {
|
public class ReaderPageFragment extends Fragment {
|
||||||
public static final String URL_ARGUMENT_KEY = "UrlArgumentKey";
|
public static final String URL_ARGUMENT_KEY = "UrlArgumentKey";
|
||||||
|
|
||||||
private SubsamplingScaleImageView mPageImageView;
|
private SubsamplingScaleImageView mPageImageView;
|
||||||
|
|
||||||
private String mUrl;
|
private String mUrl;
|
||||||
|
|
||||||
public static ViewerPageFragment newInstance(String url, int position) {
|
public static ReaderPageFragment newInstance(String url, int position) {
|
||||||
ViewerPageFragment newInstance = new ViewerPageFragment();
|
ReaderPageFragment newInstance = new ReaderPageFragment();
|
||||||
Bundle arguments = new Bundle();
|
Bundle arguments = new Bundle();
|
||||||
arguments.putString(URL_ARGUMENT_KEY, url);
|
arguments.putString(URL_ARGUMENT_KEY, url);
|
||||||
newInstance.setArguments(arguments);
|
newInstance.setArguments(arguments);
|
Loading…
Reference in New Issue
Block a user