@ -99,6 +98,8 @@ public class DetailsFragment extends Fragment implements OnTrackersUpdatedListen
@@ -99,6 +98,8 @@ public class DetailsFragment extends Fragment implements OnTrackersUpdatedListen
// Views
@ViewById
protectedViewdetailsContainer;
@ViewById(R.id.details_menu)
protectedActionMenuViewdetailsMenu;
@ViewById
protectedSwipeRefreshLayoutswipeRefreshLayout;
@ViewById
@ -111,6 +112,9 @@ public class DetailsFragment extends Fragment implements OnTrackersUpdatedListen
@@ -111,6 +112,9 @@ public class DetailsFragment extends Fragment implements OnTrackersUpdatedListen
@AfterViews
protectedvoidinit(){
// Inject menu options in the actions toolbar
setHasOptionsMenu(true);
// On large screens where this fragment is shown next to the torrents list, we show a continues grey vertical
@ -121,13 +125,21 @@ public class DetailsFragment extends Fragment implements OnTrackersUpdatedListen
@@ -121,13 +125,21 @@ public class DetailsFragment extends Fragment implements OnTrackersUpdatedListen
}
}
createMenuOptions();
// Set up details adapter (itself containing the actual lists to show), which allows multi-select and fast
swipeRefreshLayout.setRefreshing(false);// Use our custom indicator
}
});
}
// Restore the fragment state (on orientation changes et al.)
@ -162,7 +174,7 @@ public class DetailsFragment extends Fragment implements OnTrackersUpdatedListen
@@ -162,7 +174,7 @@ public class DetailsFragment extends Fragment implements OnTrackersUpdatedListen
errorText.setVisibility(View.GONE);
loadingProgress.setVisibility(View.GONE);
// Also update the available actions in the action bar
getActivity().invalidateOptionsMenu();
updateMenuOptions();
// Refresh the detailed statistics (errors) and list of files
torrentDetails=null;
torrentFiles=null;
@ -252,7 +264,6 @@ public class DetailsFragment extends Fragment implements OnTrackersUpdatedListen
@@ -252,7 +264,6 @@ public class DetailsFragment extends Fragment implements OnTrackersUpdatedListen
@ -263,43 +274,89 @@ public class DetailsFragment extends Fragment implements OnTrackersUpdatedListen
@@ -263,43 +274,89 @@ public class DetailsFragment extends Fragment implements OnTrackersUpdatedListen
@ -121,7 +121,13 @@ public class TorrentsFragment extends Fragment implements OnLabelPickedListener
@@ -121,7 +121,13 @@ public class TorrentsFragment extends Fragment implements OnLabelPickedListener
}
// Allow pulls on the list view to refresh the torrents
@ -393,6 +399,7 @@ public class TorrentsFragment extends Fragment implements OnLabelPickedListener
@@ -393,6 +399,7 @@ public class TorrentsFragment extends Fragment implements OnLabelPickedListener
loadingProgress.setVisibility(View.GONE);
errorText.setVisibility(View.GONE);
nosettingsText.setVisibility(View.VISIBLE);
swipeRefreshLayout.setEnabled(false);
clear(true,true);// Indirectly also calls updateViewVisibility()
}else{
updateViewVisibility();
@ -405,7 +412,6 @@ public class TorrentsFragment extends Fragment implements OnLabelPickedListener
@@ -405,7 +412,6 @@ public class TorrentsFragment extends Fragment implements OnLabelPickedListener
*/
publicvoidupdateIsLoading(booleanisLoading){
this.isLoading=isLoading;
swipeRefreshLayout.setRefreshing(isLoading);
if(isLoading){
clear(true,false);// Indirectly also calls updateViewVisibility()
}else{
@ -438,6 +444,7 @@ public class TorrentsFragment extends Fragment implements OnLabelPickedListener
@@ -438,6 +444,7 @@ public class TorrentsFragment extends Fragment implements OnLabelPickedListener