Some fixes

This commit is contained in:
Thomas 2020-11-20 08:58:28 +01:00
parent 50a9f8a1b0
commit dff76aada1
12 changed files with 15 additions and 14 deletions

View File

@ -59,7 +59,7 @@ import app.fedilab.fedilabtube.viewmodel.ChannelsVM;
import app.fedilab.fedilabtube.viewmodel.PlaylistsVM;
import es.dmoral.toasty.Toasty;
import static app.fedilab.fedilabtube.MainActivity.peertubeInformation;
import static app.fedilab.fedilabtube.helper.Helper.peertubeInformation;
public class AllPlaylistsActivity extends AppCompatActivity implements PlaylistAdapter.AllPlaylistRemoved {

View File

@ -48,7 +48,7 @@ import app.fedilab.fedilabtube.helper.RoundedBackgroundSpan;
import app.fedilab.fedilabtube.viewmodel.InstancesVM;
import es.dmoral.toasty.Toasty;
import static app.fedilab.fedilabtube.MainActivity.peertubeInformation;
import static app.fedilab.fedilabtube.helper.Helper.peertubeInformation;
public class InstancePickerActivity extends AppCompatActivity {

View File

@ -77,10 +77,10 @@ import es.dmoral.toasty.Toasty;
import static app.fedilab.fedilabtube.MainActivity.TypeOfConnection.NORMAL;
import static app.fedilab.fedilabtube.MainActivity.TypeOfConnection.SURFING;
import static app.fedilab.fedilabtube.helper.Helper.academies;
import static app.fedilab.fedilabtube.helper.Helper.peertubeInformation;
public class MainActivity extends AppCompatActivity {
public static PeertubeInformation peertubeInformation;
public static int PICK_INSTANCE = 5641;
public static int PICK_INSTANCE_SURF = 5642;

View File

@ -147,7 +147,6 @@ import app.fedilab.fedilabtube.webview.MastalabWebChromeClient;
import app.fedilab.fedilabtube.webview.MastalabWebViewClient;
import es.dmoral.toasty.Toasty;
import static app.fedilab.fedilabtube.MainActivity.peertubeInformation;
import static app.fedilab.fedilabtube.client.RetrofitPeertubeAPI.ActionType.ADD_COMMENT;
import static app.fedilab.fedilabtube.client.RetrofitPeertubeAPI.ActionType.RATEVIDEO;
import static app.fedilab.fedilabtube.client.RetrofitPeertubeAPI.ActionType.REPLY;
@ -157,6 +156,7 @@ import static app.fedilab.fedilabtube.helper.Helper.getAttColor;
import static app.fedilab.fedilabtube.helper.Helper.getLiveInstance;
import static app.fedilab.fedilabtube.helper.Helper.isLoggedIn;
import static app.fedilab.fedilabtube.helper.Helper.loadGiF;
import static app.fedilab.fedilabtube.helper.Helper.peertubeInformation;
import static com.google.android.exoplayer2.Player.MEDIA_ITEM_TRANSITION_REASON_AUTO;
@ -715,7 +715,7 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd
i++;
}
nextVideo = apiResponse.getPeertubes().get(i);
if (!playedVideos.contains(nextVideo.getId())) {
if (!playedVideos.contains(nextVideo.getId()) && player != null) {
MediaItem mediaItem = new MediaItem.Builder().setUri(Uri.parse(nextVideo.getFileUrl(null, PeertubeActivity.this))).build();
player.addMediaItem(mediaItem);
}
@ -935,7 +935,7 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd
});
if (mode == Helper.VIDEO_MODE_NORMAL) {
if (mode != Helper.VIDEO_MODE_WEBVIEW) {
player = new SimpleExoPlayer.Builder(PeertubeActivity.this).build();
player.addVideoListener(PeertubeActivity.this);

View File

@ -68,9 +68,9 @@ import app.fedilab.fedilabtube.viewmodel.PostActionsVM;
import app.fedilab.fedilabtube.viewmodel.TimelineVM;
import es.dmoral.toasty.Toasty;
import static app.fedilab.fedilabtube.MainActivity.peertubeInformation;
import static app.fedilab.fedilabtube.client.RetrofitPeertubeAPI.ActionType.PEERTUBEDELETEVIDEO;
import static app.fedilab.fedilabtube.client.RetrofitPeertubeAPI.DataType.MY_CHANNELS;
import static app.fedilab.fedilabtube.helper.Helper.peertubeInformation;
public class PeertubeEditUploadActivity extends AppCompatActivity {

View File

@ -59,8 +59,8 @@ import app.fedilab.fedilabtube.helper.Helper;
import app.fedilab.fedilabtube.viewmodel.ChannelsVM;
import es.dmoral.toasty.Toasty;
import static app.fedilab.fedilabtube.MainActivity.peertubeInformation;
import static app.fedilab.fedilabtube.client.RetrofitPeertubeAPI.DataType.MY_CHANNELS;
import static app.fedilab.fedilabtube.helper.Helper.peertubeInformation;
public class PeertubeUploadActivity extends AppCompatActivity {

View File

@ -46,8 +46,8 @@ import app.fedilab.fedilabtube.fragment.DisplaySepiaSearchFragment;
import app.fedilab.fedilabtube.helper.Helper;
import mabbas007.tagsedittext.TagsEditText;
import static app.fedilab.fedilabtube.MainActivity.peertubeInformation;
import static app.fedilab.fedilabtube.PeertubeActivity.hideKeyboard;
import static app.fedilab.fedilabtube.helper.Helper.peertubeInformation;
public class SepiaSearchActivity extends AppCompatActivity {

View File

@ -38,7 +38,7 @@ import app.fedilab.fedilabtube.client.data.InstanceData.Instance;
import app.fedilab.fedilabtube.helper.RoundedBackgroundSpan;
import static android.app.Activity.RESULT_OK;
import static app.fedilab.fedilabtube.MainActivity.peertubeInformation;
import static app.fedilab.fedilabtube.helper.Helper.peertubeInformation;
public class InstanceAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {

View File

@ -65,8 +65,8 @@ import app.fedilab.fedilabtube.viewmodel.ChannelsVM;
import app.fedilab.fedilabtube.viewmodel.PlaylistsVM;
import es.dmoral.toasty.Toasty;
import static app.fedilab.fedilabtube.MainActivity.peertubeInformation;
import static app.fedilab.fedilabtube.client.RetrofitPeertubeAPI.DataType.MY_CHANNELS;
import static app.fedilab.fedilabtube.helper.Helper.peertubeInformation;
public class DisplayPlaylistsFragment extends Fragment {

View File

@ -42,7 +42,6 @@ import app.fedilab.fedilabtube.helper.Helper;
import app.fedilab.fedilabtube.helper.ThemeHelper;
import es.dmoral.toasty.Toasty;
import static app.fedilab.fedilabtube.MainActivity.peertubeInformation;
import static app.fedilab.fedilabtube.MainActivity.userMe;
/* Copyright 2020 Thomas Schneider
@ -393,7 +392,7 @@ public class SettingsFragment extends PreferenceFragmentCompat implements Shared
set_video_in_list_choice.setChecked(videosInList);
//****** Language filter *********
LinkedHashMap<String, String> languages = new LinkedHashMap<>(peertubeInformation.getLanguages());
LinkedHashMap<String, String> languages = new LinkedHashMap<>(Helper.peertubeInformation.getLanguages());
List<CharSequence> entriesLanguages = new ArrayList<>();
List<CharSequence> valuesLanguages = new ArrayList<>();
Iterator<Map.Entry<String, String>> it = languages.entrySet().iterator();

View File

@ -68,6 +68,7 @@ import app.fedilab.fedilabtube.client.data.AccountData.Account;
import app.fedilab.fedilabtube.client.data.ChannelData;
import app.fedilab.fedilabtube.client.data.VideoData;
import app.fedilab.fedilabtube.client.entities.File;
import app.fedilab.fedilabtube.client.entities.PeertubeInformation;
import app.fedilab.fedilabtube.sqlite.AccountDAO;
import app.fedilab.fedilabtube.sqlite.Sqlite;
import app.fedilab.fedilabtube.webview.CustomWebview;
@ -79,6 +80,7 @@ import static android.content.Context.DOWNLOAD_SERVICE;
public class Helper {
public static PeertubeInformation peertubeInformation;
public static final int RELOAD_MYVIDEOS = 10;
public static final String SET_VIDEO_MODE = "set_video_mode";
public static final String SET_QUALITY_MODE = "set_quality_mode";

View File

@ -36,7 +36,7 @@ import app.fedilab.fedilabtube.client.entities.PeertubeInformation;
import app.fedilab.fedilabtube.helper.EmojiHelper;
import app.fedilab.fedilabtube.helper.NetworkStateReceiver;
import static app.fedilab.fedilabtube.MainActivity.peertubeInformation;
import static app.fedilab.fedilabtube.helper.Helper.peertubeInformation;
public class RetrieveInfoService extends Service implements NetworkStateReceiver.NetworkStateReceiverListener {