| 
					
				 | 
			
			
				@@ -1,4 +1,4 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-package eu.kanade.mangafeed.presenter; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+package eu.kanade.mangafeed.ui.download; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import android.os.Bundle; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -11,7 +11,7 @@ import eu.kanade.mangafeed.data.helpers.DownloadManager; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import eu.kanade.mangafeed.data.models.Download; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import eu.kanade.mangafeed.data.models.DownloadQueue; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import eu.kanade.mangafeed.data.models.Page; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-import eu.kanade.mangafeed.ui.fragment.DownloadQueueFragment; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import eu.kanade.mangafeed.ui.base.presenter.BasePresenter; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import rx.Observable; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import rx.Subscription; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import rx.android.schedulers.AndroidSchedulers; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -19,7 +19,7 @@ import rx.schedulers.Schedulers; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import rx.subjects.PublishSubject; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import timber.log.Timber; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-public class DownloadQueuePresenter extends BasePresenter<DownloadQueueFragment> { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+public class DownloadPresenter extends BasePresenter<DownloadFragment> { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     @Inject DownloadManager downloadManager; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -40,7 +40,7 @@ public class DownloadQueuePresenter extends BasePresenter<DownloadQueueFragment> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         restartableLatestCache(GET_DOWNLOAD_QUEUE, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 () -> Observable.just(downloadQueue.get()), 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                DownloadQueueFragment::onNextDownloads, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                DownloadFragment::onNextDownloads, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 (view, error) -> Timber.e(error.getMessage())); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         if (savedState == null) 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -48,7 +48,7 @@ public class DownloadQueuePresenter extends BasePresenter<DownloadQueueFragment> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     @Override 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    protected void onTakeView(DownloadQueueFragment view) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    protected void onTakeView(DownloadFragment view) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         super.onTakeView(view); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         add(statusSubscription = downloadQueue.getStatusObservable() 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -65,7 +65,7 @@ public class DownloadQueuePresenter extends BasePresenter<DownloadQueueFragment> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         super.onDropView(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    private void processStatus(Download download, DownloadQueueFragment view) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    private void processStatus(Download download, DownloadFragment view) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         switch (download.getStatus()) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             case Download.DOWNLOADING: 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 observeProgress(download, view); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -84,7 +84,7 @@ public class DownloadQueuePresenter extends BasePresenter<DownloadQueueFragment> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    private void observeProgress(Download download, DownloadQueueFragment view) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    private void observeProgress(Download download, DownloadFragment view) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         Subscription subscription = Observable.interval(50, TimeUnit.MILLISECONDS, Schedulers.newThread()) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 .flatMap(tick -> Observable.from(download.pages) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         .map(Page::getProgress) 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -104,7 +104,7 @@ public class DownloadQueuePresenter extends BasePresenter<DownloadQueueFragment> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         progressSubscriptions.put(download, subscription); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    private void observePagesStatus(Download download, DownloadQueueFragment view) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    private void observePagesStatus(Download download, DownloadFragment view) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         PublishSubject<Integer> pageStatusSubject = PublishSubject.create(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         for (Page page : download.pages) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             if (page.getStatus() != Page.READY) 
			 |