Change readme + fix titles

This commit is contained in:
Thomas 2020-10-08 18:46:18 +02:00
parent fc051d8d1d
commit 641a616c96
5 changed files with 8 additions and 13 deletions

View File

@ -70,7 +70,7 @@ Si vous connectez votre compte, vous pourrez interagir avec les vidéos :
#### TubeLab (coming soon) #### TubeLab
[Fdroid](https://f-droid.org/packages/app.fedilab.tubelab/) [Fdroid](https://f-droid.org/packages/app.fedilab.tubelab/)

View File

@ -31,7 +31,6 @@ import android.os.Bundle;
import android.os.Handler; import android.os.Handler;
import android.support.v4.media.session.MediaSessionCompat; import android.support.v4.media.session.MediaSessionCompat;
import android.text.Html; import android.text.Html;
import android.util.Log;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.Menu; import android.view.Menu;
import android.view.MenuItem; import android.view.MenuItem;
@ -1034,11 +1033,9 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd
} }
public void manageVIewPlaylists(APIResponse apiResponse) { public void manageVIewPlaylists(APIResponse apiResponse) {
Log.v(Helper.TAG,"manageVIewPlaylists: " + apiResponse);
if (apiResponse.getError() != null) { if (apiResponse.getError() != null) {
return; return;
} }
Log.v(Helper.TAG,"apiResponse.getPlaylists(): " + apiResponse.getPlaylists());
if (apiResponse.getPlaylists() != null && apiResponse.getPlaylists().size() > 0) { if (apiResponse.getPlaylists() != null && apiResponse.getPlaylists().size() > 0) {
androidx.appcompat.app.AlertDialog.Builder builder = new androidx.appcompat.app.AlertDialog.Builder(PeertubeActivity.this); androidx.appcompat.app.AlertDialog.Builder builder = new androidx.appcompat.app.AlertDialog.Builder(PeertubeActivity.this);
builder.setTitle(R.string.modify_playlists); builder.setTitle(R.string.modify_playlists);

View File

@ -21,7 +21,6 @@ import android.content.SharedPreferences;
import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteDatabase;
import android.os.Handler; import android.os.Handler;
import android.os.Looper; import android.os.Looper;
import android.util.Log;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
@ -93,6 +92,8 @@ public class RetrofitPeertubeAPI {
_context = context; _context = context;
instance = Helper.getLiveInstance(context); instance = Helper.getLiveInstance(context);
finalUrl = "https://" + Helper.getLiveInstance(context) + "/api/v1/"; finalUrl = "https://" + Helper.getLiveInstance(context) + "/api/v1/";
SharedPreferences sharedpreferences = _context.getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
count = String.valueOf(sharedpreferences.getInt(Helper.SET_VIDEOS_PER_PAGE, Helper.VIDEOS_PER_PAGE));
} }
public RetrofitPeertubeAPI(Context context, String instance, String token) { public RetrofitPeertubeAPI(Context context, String instance, String token) {
@ -237,7 +238,7 @@ public class RetrofitPeertubeAPI {
APIResponse apiResponse = new APIResponse(); APIResponse apiResponse = new APIResponse();
PeertubeService peertubeService = init(); PeertubeService peertubeService = init();
Call<NotificationData> notificationsCall = peertubeService.getNotifications("Bearer " + token, max_id, count, since_id); Call<NotificationData> notificationsCall = peertubeService.getNotifications("Bearer " + token, max_id, "20", since_id);
try { try {
Response<NotificationData> response = notificationsCall.execute(); Response<NotificationData> response = notificationsCall.execute();
if (response.isSuccessful() && response.body() != null) { if (response.isSuccessful() && response.body() != null) {
@ -1113,8 +1114,6 @@ public class RetrofitPeertubeAPI {
setError(apiResponse, response.code(), response.errorBody()); setError(apiResponse, response.code(), response.errorBody());
} }
} else if (type == PlaylistsVM.action.GET_LIST_VIDEOS) { } else if (type == PlaylistsVM.action.GET_LIST_VIDEOS) {
Log.v(Helper.TAG,"playlistId: " + playlistId);
Log.v(Helper.TAG,"max_id2: " + max_id);
Call<VideoPlaylistData> videosPlayList = peertubeService.getVideosPlayList(getToken(), playlistId, max_id, count); Call<VideoPlaylistData> videosPlayList = peertubeService.getVideosPlayList(getToken(), playlistId, max_id, count);
Response<VideoPlaylistData> response = videosPlayList.execute(); Response<VideoPlaylistData> response = videosPlayList.execute();
if (response.isSuccessful() && response.body() != null) { if (response.isSuccessful() && response.body() != null) {

View File

@ -38,6 +38,7 @@ import app.fedilab.fedilabtube.R;
import app.fedilab.fedilabtube.client.APIResponse; import app.fedilab.fedilabtube.client.APIResponse;
import app.fedilab.fedilabtube.client.data.NotificationData.Notification; import app.fedilab.fedilabtube.client.data.NotificationData.Notification;
import app.fedilab.fedilabtube.drawer.PeertubeNotificationsListAdapter; import app.fedilab.fedilabtube.drawer.PeertubeNotificationsListAdapter;
import app.fedilab.fedilabtube.helper.Helper;
import app.fedilab.fedilabtube.viewmodel.NotificationsVM; import app.fedilab.fedilabtube.viewmodel.NotificationsVM;
import es.dmoral.toasty.Toasty; import es.dmoral.toasty.Toasty;
@ -70,7 +71,7 @@ public class DisplayNotificationsFragment extends Fragment {
context = getContext(); context = getContext();
notifications = new ArrayList<>(); notifications = new ArrayList<>();
max_id = null; max_id = "0";
firstLoad = true; firstLoad = true;
flag_loading = true; flag_loading = true;
swiped = false; swiped = false;
@ -159,7 +160,7 @@ public class DisplayNotificationsFragment extends Fragment {
public void pullToRefresh() { public void pullToRefresh() {
max_id = null; max_id = "0";
notifications = new ArrayList<>(); notifications = new ArrayList<>();
firstLoad = true; firstLoad = true;
flag_loading = true; flag_loading = true;
@ -182,7 +183,7 @@ public class DisplayNotificationsFragment extends Fragment {
} }
int previousPosition = notifications.size(); int previousPosition = notifications.size();
max_id = apiResponse.getMax_id(); max_id = String.valueOf(Integer.parseInt(max_id) + 20);
List<Notification> notifications = apiResponse.getPeertubeNotifications(); List<Notification> notifications = apiResponse.getPeertubeNotifications();
if (!swiped && firstLoad && (notifications == null || notifications.size() == 0)) if (!swiped && firstLoad && (notifications == null || notifications.size() == 0))
textviewNoAction.setVisibility(View.VISIBLE); textviewNoAction.setVisibility(View.VISIBLE);

View File

@ -19,7 +19,6 @@ import android.content.SharedPreferences;
import android.graphics.Rect; import android.graphics.Rect;
import android.os.Bundle; import android.os.Bundle;
import android.os.Handler; import android.os.Handler;
import android.util.Log;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
@ -202,7 +201,6 @@ public class DisplayVideosFragment extends Fragment implements AccountsHorizonta
if (firstVisibleItem + visibleItemCount == totalItemCount && context != null) { if (firstVisibleItem + visibleItemCount == totalItemCount && context != null) {
if (!flag_loading) { if (!flag_loading) {
flag_loading = true; flag_loading = true;
Log.v(Helper.TAG,"max_id: " + max_id);
loadTimeline(max_id); loadTimeline(max_id);
nextElementLoader.setVisibility(View.VISIBLE); nextElementLoader.setVisibility(View.VISIBLE);
} }