Last fixes
This commit is contained in:
parent
bf119a5808
commit
8dddfc5497
|
@ -72,6 +72,7 @@ import static app.fedilab.fedilabtube.client.RetrofitPeertubeAPI.ActionType.UNFO
|
||||||
import static app.fedilab.fedilabtube.client.RetrofitPeertubeAPI.DataType.CHANNEL;
|
import static app.fedilab.fedilabtube.client.RetrofitPeertubeAPI.DataType.CHANNEL;
|
||||||
import static app.fedilab.fedilabtube.helper.Helper.getLiveInstance;
|
import static app.fedilab.fedilabtube.helper.Helper.getLiveInstance;
|
||||||
import static app.fedilab.fedilabtube.helper.Helper.isLoggedIn;
|
import static app.fedilab.fedilabtube.helper.Helper.isLoggedIn;
|
||||||
|
import static app.fedilab.fedilabtube.viewmodel.TimelineVM.TimelineType.SEPIA_SEARCH;
|
||||||
|
|
||||||
|
|
||||||
public class ShowChannelActivity extends AppCompatActivity {
|
public class ShowChannelActivity extends AppCompatActivity {
|
||||||
|
@ -87,6 +88,8 @@ public class ShowChannelActivity extends AppCompatActivity {
|
||||||
private Channel channel;
|
private Channel channel;
|
||||||
private action doAction;
|
private action doAction;
|
||||||
private String channelAcct;
|
private String channelAcct;
|
||||||
|
private boolean sepiaSearch;
|
||||||
|
private String peertubeInstance;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
@ -103,6 +106,9 @@ public class ShowChannelActivity extends AppCompatActivity {
|
||||||
if (b != null) {
|
if (b != null) {
|
||||||
channel = b.getParcelable("channel");
|
channel = b.getParcelable("channel");
|
||||||
channelAcct = b.getString("channelId");
|
channelAcct = b.getString("channelId");
|
||||||
|
sepiaSearch = b.getBoolean("sepia_search", false);
|
||||||
|
peertubeInstance = b.getString("peertube_instance", null);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
Toasty.error(ShowChannelActivity.this, getString(R.string.toast_error_loading_account), Toast.LENGTH_LONG).show();
|
Toasty.error(ShowChannelActivity.this, getString(R.string.toast_error_loading_account), Toast.LENGTH_LONG).show();
|
||||||
}
|
}
|
||||||
|
@ -116,14 +122,14 @@ public class ShowChannelActivity extends AppCompatActivity {
|
||||||
|
|
||||||
|
|
||||||
ChannelsVM viewModel = new ViewModelProvider(ShowChannelActivity.this).get(ChannelsVM.class);
|
ChannelsVM viewModel = new ViewModelProvider(ShowChannelActivity.this).get(ChannelsVM.class);
|
||||||
viewModel.get(CHANNEL, channelAcct == null ? channel.getAcct() : channelAcct).observe(ShowChannelActivity.this, this::manageViewAccounts);
|
viewModel.get(sepiaSearch?peertubeInstance:null, CHANNEL, channelAcct == null ? channel.getAcct() : channelAcct).observe(ShowChannelActivity.this, this::manageViewAccounts);
|
||||||
manageChannel();
|
manageChannel();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onCreateOptionsMenu(@NotNull Menu menu) {
|
public boolean onCreateOptionsMenu(@NotNull Menu menu) {
|
||||||
getMenuInflater().inflate(R.menu.main_account, menu);
|
getMenuInflater().inflate(R.menu.main_account, menu);
|
||||||
if (!Helper.isLoggedIn(ShowChannelActivity.this)) {
|
if (!Helper.isLoggedIn(ShowChannelActivity.this) || sepiaSearch) {
|
||||||
menu.findItem(R.id.action_mute).setVisible(false);
|
menu.findItem(R.id.action_mute).setVisible(false);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
@ -163,7 +169,7 @@ public class ShowChannelActivity extends AppCompatActivity {
|
||||||
SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, MODE_PRIVATE);
|
SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, MODE_PRIVATE);
|
||||||
|
|
||||||
String accountIdRelation = channel.getAcct();
|
String accountIdRelation = channel.getAcct();
|
||||||
if (isLoggedIn(ShowChannelActivity.this)) {
|
if (isLoggedIn(ShowChannelActivity.this) && !sepiaSearch) {
|
||||||
RelationshipVM viewModel = new ViewModelProvider(ShowChannelActivity.this).get(RelationshipVM.class);
|
RelationshipVM viewModel = new ViewModelProvider(ShowChannelActivity.this).get(RelationshipVM.class);
|
||||||
List<String> uids = new ArrayList<>();
|
List<String> uids = new ArrayList<>();
|
||||||
uids.add(accountIdRelation);
|
uids.add(accountIdRelation);
|
||||||
|
@ -239,7 +245,7 @@ public class ShowChannelActivity extends AppCompatActivity {
|
||||||
|
|
||||||
|
|
||||||
manageNotes(channel);
|
manageNotes(channel);
|
||||||
Helper.loadGiF(ShowChannelActivity.this, channel.getAvatar() != null ? channel.getAvatar().getPath() : null, account_pp);
|
Helper.loadGiF(ShowChannelActivity.this, sepiaSearch?peertubeInstance:null, channel.getAvatar() != null ? channel.getAvatar().getPath() : null, account_pp);
|
||||||
//Follow button
|
//Follow button
|
||||||
String target = channel.getAcct();
|
String target = channel.getAcct();
|
||||||
|
|
||||||
|
@ -412,21 +418,14 @@ public class ShowChannelActivity extends AppCompatActivity {
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Fragment getItem(int position) {
|
public Fragment getItem(int position) {
|
||||||
|
DisplayVideosFragment displayVideosFragment = new DisplayVideosFragment();
|
||||||
Bundle bundle = new Bundle();
|
Bundle bundle = new Bundle();
|
||||||
if (position == 0) {
|
bundle.putSerializable(Helper.TIMELINE_TYPE, TimelineVM.TimelineType.USER_VIDEOS);
|
||||||
DisplayVideosFragment displayVideosFragment = new DisplayVideosFragment();
|
bundle.putString("channelId", channel.getAcct());
|
||||||
bundle = new Bundle();
|
bundle.putString("peertube_instance", channel.getHost());
|
||||||
bundle.putSerializable(Helper.TIMELINE_TYPE, TimelineVM.TimelineType.USER_VIDEOS);
|
bundle.putBoolean("sepia_search", sepiaSearch);
|
||||||
bundle.putString("channelId", channel.getAcct());
|
displayVideosFragment.setArguments(bundle);
|
||||||
displayVideosFragment.setArguments(bundle);
|
return displayVideosFragment;
|
||||||
return displayVideosFragment;
|
|
||||||
}
|
|
||||||
DisplayAccountsFragment displayAccountsFragment = new DisplayAccountsFragment();
|
|
||||||
bundle.putString("targetedid", channel.getId());
|
|
||||||
bundle.putString("instance", getLiveInstance(ShowChannelActivity.this));
|
|
||||||
bundle.putString("name", channel.getAcct());
|
|
||||||
displayAccountsFragment.setArguments(bundle);
|
|
||||||
return displayAccountsFragment;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1004,7 +1004,6 @@ public class RetrofitPeertubeAPI {
|
||||||
try {
|
try {
|
||||||
Response<ChannelData> response = channelDataCall.execute();
|
Response<ChannelData> response = channelDataCall.execute();
|
||||||
if (response.isSuccessful() && response.body() != null) {
|
if (response.isSuccessful() && response.body() != null) {
|
||||||
|
|
||||||
apiResponse.setChannels(response.body().data);
|
apiResponse.setChannels(response.body().data);
|
||||||
} else {
|
} else {
|
||||||
setError(apiResponse, response.code(), response.errorBody());
|
setError(apiResponse, response.code(), response.errorBody());
|
||||||
|
|
|
@ -68,13 +68,17 @@ public class PeertubeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolde
|
||||||
private List<VideoData.Video> videos;
|
private List<VideoData.Video> videos;
|
||||||
private Context context;
|
private Context context;
|
||||||
private TimelineVM.TimelineType timelineType;
|
private TimelineVM.TimelineType timelineType;
|
||||||
|
private boolean sepiaSearch;
|
||||||
|
|
||||||
public PeertubeAdapter(List<VideoData.Video> videos, TimelineVM.TimelineType timelineType) {
|
|
||||||
|
public PeertubeAdapter(List<VideoData.Video> videos, TimelineVM.TimelineType timelineType, boolean sepiaSearch) {
|
||||||
this.videos = videos;
|
this.videos = videos;
|
||||||
this.timelineType = timelineType;
|
this.timelineType = timelineType;
|
||||||
|
this.sepiaSearch = sepiaSearch || timelineType == SEPIA_SEARCH;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public PeertubeAdapter(List<VideoData.Video> videos) {
|
public PeertubeAdapter(List<VideoData.Video> videos) {
|
||||||
this.videos = videos;
|
this.videos = videos;
|
||||||
}
|
}
|
||||||
|
@ -111,7 +115,7 @@ public class PeertubeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolde
|
||||||
}
|
}
|
||||||
|
|
||||||
String instance = null;
|
String instance = null;
|
||||||
if( timelineType == SEPIA_SEARCH) {
|
if( sepiaSearch) {
|
||||||
instance = video.getAccount().getHost();
|
instance = video.getAccount().getHost();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -146,7 +150,10 @@ public class PeertubeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolde
|
||||||
Intent intent = new Intent(context, ShowChannelActivity.class);
|
Intent intent = new Intent(context, ShowChannelActivity.class);
|
||||||
Bundle b = new Bundle();
|
Bundle b = new Bundle();
|
||||||
b.putParcelable("channel", video.getChannel());
|
b.putParcelable("channel", video.getChannel());
|
||||||
b.putBoolean("sepia_search", timelineType == SEPIA_SEARCH);
|
b.putBoolean("sepia_search", sepiaSearch);
|
||||||
|
if( sepiaSearch) {
|
||||||
|
b.putString("peertube_instance", video.getAccount().getHost());
|
||||||
|
}
|
||||||
intent.putExtras(b);
|
intent.putExtras(b);
|
||||||
context.startActivity(intent);
|
context.startActivity(intent);
|
||||||
});
|
});
|
||||||
|
@ -254,8 +261,8 @@ public class PeertubeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolde
|
||||||
b.putString("video_id", video.getId());
|
b.putString("video_id", video.getId());
|
||||||
b.putString("video_uuid", video.getUuid());
|
b.putString("video_uuid", video.getUuid());
|
||||||
b.putBoolean("isMyVideo", ownVideos);
|
b.putBoolean("isMyVideo", ownVideos);
|
||||||
b.putBoolean("sepia_search", timelineType == SEPIA_SEARCH);
|
b.putBoolean("sepia_search", sepiaSearch);
|
||||||
if( timelineType == SEPIA_SEARCH) {
|
if( sepiaSearch) {
|
||||||
b.putString("peertube_instance", video.getAccount().getHost());
|
b.putString("peertube_instance", video.getAccount().getHost());
|
||||||
}
|
}
|
||||||
intent.putExtras(b);
|
intent.putExtras(b);
|
||||||
|
@ -267,8 +274,8 @@ public class PeertubeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolde
|
||||||
b.putString("video_id", video.getId());
|
b.putString("video_id", video.getId());
|
||||||
b.putString("video_uuid", video.getUuid());
|
b.putString("video_uuid", video.getUuid());
|
||||||
b.putBoolean("isMyVideo", ownVideos);
|
b.putBoolean("isMyVideo", ownVideos);
|
||||||
b.putBoolean("sepia_search", timelineType == SEPIA_SEARCH);
|
b.putBoolean("sepia_search", sepiaSearch);
|
||||||
if( timelineType == SEPIA_SEARCH) {
|
if( sepiaSearch) {
|
||||||
b.putString("peertube_instance", video.getAccount().getHost());
|
b.putString("peertube_instance", video.getAccount().getHost());
|
||||||
}
|
}
|
||||||
intent.putExtras(b);
|
intent.putExtras(b);
|
||||||
|
|
|
@ -100,7 +100,7 @@ public class DisplaySepiaSearchFragment extends Fragment implements AccountsHori
|
||||||
mainLoader.setVisibility(View.VISIBLE);
|
mainLoader.setVisibility(View.VISIBLE);
|
||||||
nextElementLoader.setVisibility(View.GONE);
|
nextElementLoader.setVisibility(View.GONE);
|
||||||
|
|
||||||
peertubeAdapater = new PeertubeAdapter(this.peertubes, SEPIA_SEARCH);
|
peertubeAdapater = new PeertubeAdapter(this.peertubes, SEPIA_SEARCH, true);
|
||||||
lv_status.setAdapter(peertubeAdapater);
|
lv_status.setAdapter(peertubeAdapater);
|
||||||
|
|
||||||
|
|
||||||
|
@ -218,7 +218,7 @@ public class DisplaySepiaSearchFragment extends Fragment implements AccountsHori
|
||||||
this.peertubes.addAll(videoData.data);
|
this.peertubes.addAll(videoData.data);
|
||||||
//If no item were inserted previously the adapter is created
|
//If no item were inserted previously the adapter is created
|
||||||
if (previousPosition == 0) {
|
if (previousPosition == 0) {
|
||||||
peertubeAdapater = new PeertubeAdapter(this.peertubes, SEPIA_SEARCH);
|
peertubeAdapater = new PeertubeAdapter(this.peertubes, SEPIA_SEARCH, true);
|
||||||
lv_status.setAdapter(peertubeAdapater);
|
lv_status.setAdapter(peertubeAdapater);
|
||||||
} else
|
} else
|
||||||
peertubeAdapater.notifyItemRangeInserted(previousPosition, videoData.data.size());
|
peertubeAdapater.notifyItemRangeInserted(previousPosition, videoData.data.size());
|
||||||
|
|
|
@ -96,7 +96,8 @@ public class DisplayVideosFragment extends Fragment implements AccountsHorizonta
|
||||||
private Map<String, Boolean> relationship;
|
private Map<String, Boolean> relationship;
|
||||||
private Map<String, List<PlaylistExist>> playlists;
|
private Map<String, List<PlaylistExist>> playlists;
|
||||||
private String playlistId;
|
private String playlistId;
|
||||||
|
private String remoteInstance;
|
||||||
|
private boolean sepiaSearch;
|
||||||
public DisplayVideosFragment() {
|
public DisplayVideosFragment() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -113,6 +114,8 @@ public class DisplayVideosFragment extends Fragment implements AccountsHorizonta
|
||||||
if (bundle != null) {
|
if (bundle != null) {
|
||||||
search_peertube = bundle.getString("search_peertube", null);
|
search_peertube = bundle.getString("search_peertube", null);
|
||||||
channelId = bundle.getString("channelId", null);
|
channelId = bundle.getString("channelId", null);
|
||||||
|
remoteInstance = bundle.getString("peertube_instance", null);
|
||||||
|
sepiaSearch = bundle.getBoolean("sepia_search", false);
|
||||||
type = (TimelineVM.TimelineType) bundle.get(Helper.TIMELINE_TYPE);
|
type = (TimelineVM.TimelineType) bundle.get(Helper.TIMELINE_TYPE);
|
||||||
playlistId = bundle.getString("playlistId", null);
|
playlistId = bundle.getString("playlistId", null);
|
||||||
}
|
}
|
||||||
|
@ -138,7 +141,7 @@ public class DisplayVideosFragment extends Fragment implements AccountsHorizonta
|
||||||
mainLoader.setVisibility(View.VISIBLE);
|
mainLoader.setVisibility(View.VISIBLE);
|
||||||
nextElementLoader.setVisibility(View.GONE);
|
nextElementLoader.setVisibility(View.GONE);
|
||||||
|
|
||||||
peertubeAdapater = new PeertubeAdapter(this.peertubes, type);
|
peertubeAdapater = new PeertubeAdapter(this.peertubes, type, sepiaSearch);
|
||||||
peertubeAdapater.playlistListener = this;
|
peertubeAdapater.playlistListener = this;
|
||||||
peertubeAdapater.relationShipListener = this;
|
peertubeAdapater.relationShipListener = this;
|
||||||
lv_status.setAdapter(peertubeAdapater);
|
lv_status.setAdapter(peertubeAdapater);
|
||||||
|
@ -334,7 +337,7 @@ public class DisplayVideosFragment extends Fragment implements AccountsHorizonta
|
||||||
this.peertubes.addAll(apiResponse.getPeertubes());
|
this.peertubes.addAll(apiResponse.getPeertubes());
|
||||||
//If no item were inserted previously the adapter is created
|
//If no item were inserted previously the adapter is created
|
||||||
if (previousPosition == 0) {
|
if (previousPosition == 0) {
|
||||||
peertubeAdapater = new PeertubeAdapter(this.peertubes, type);
|
peertubeAdapater = new PeertubeAdapter(this.peertubes, type, sepiaSearch);
|
||||||
peertubeAdapater.playlistListener = DisplayVideosFragment.this;
|
peertubeAdapater.playlistListener = DisplayVideosFragment.this;
|
||||||
peertubeAdapater.relationShipListener = DisplayVideosFragment.this;
|
peertubeAdapater.relationShipListener = DisplayVideosFragment.this;
|
||||||
lv_status.setAdapter(peertubeAdapater);
|
lv_status.setAdapter(peertubeAdapater);
|
||||||
|
@ -484,9 +487,8 @@ public class DisplayVideosFragment extends Fragment implements AccountsHorizonta
|
||||||
private void loadTimeline(String max_id) {
|
private void loadTimeline(String max_id) {
|
||||||
if (search_peertube == null) { //Not a Peertube search
|
if (search_peertube == null) { //Not a Peertube search
|
||||||
if (type == TimelineVM.TimelineType.USER_VIDEOS) {
|
if (type == TimelineVM.TimelineType.USER_VIDEOS) {
|
||||||
viewModelFeeds.getVideosInChannel(channelId, max_id).observe(this.requireActivity(), this::manageVIewVideos);
|
viewModelFeeds.getVideosInChannel(sepiaSearch?remoteInstance:null, channelId, max_id).observe(this.requireActivity(), this::manageVIewVideos);
|
||||||
} else if (type == TimelineVM.TimelineType.VIDEOS_IN_PLAYLIST) {
|
} else if (type == TimelineVM.TimelineType.VIDEOS_IN_PLAYLIST) {
|
||||||
|
|
||||||
viewModelFeeds.loadVideosInPlaylist(playlistId, max_id).observe(this.requireActivity(), this::manageVIewVideos);
|
viewModelFeeds.loadVideosInPlaylist(playlistId, max_id).observe(this.requireActivity(), this::manageVIewVideos);
|
||||||
} else {
|
} else {
|
||||||
viewModelFeeds.getVideos(type, max_id, forAccount).observe(this.requireActivity(), this::manageVIewVideos);
|
viewModelFeeds.getVideos(type, max_id, forAccount).observe(this.requireActivity(), this::manageVIewVideos);
|
||||||
|
|
|
@ -43,13 +43,19 @@ public class ChannelsVM extends AndroidViewModel {
|
||||||
super(application);
|
super(application);
|
||||||
}
|
}
|
||||||
|
|
||||||
public LiveData<APIResponse> get(RetrofitPeertubeAPI.DataType type, String element) {
|
public LiveData<APIResponse> get(String instance, RetrofitPeertubeAPI.DataType type, String element) {
|
||||||
apiResponseMutableLiveData = new MutableLiveData<>();
|
apiResponseMutableLiveData = new MutableLiveData<>();
|
||||||
getChannels(type, element);
|
getChannels(instance, type, element);
|
||||||
return apiResponseMutableLiveData;
|
return apiResponseMutableLiveData;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void getChannels(RetrofitPeertubeAPI.DataType type, String element) {
|
public LiveData<APIResponse> get(RetrofitPeertubeAPI.DataType type, String element) {
|
||||||
|
apiResponseMutableLiveData = new MutableLiveData<>();
|
||||||
|
getChannels(null, type, element);
|
||||||
|
return apiResponseMutableLiveData;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void getChannels(String instance, RetrofitPeertubeAPI.DataType type, String element) {
|
||||||
Context _mContext = getApplication().getApplicationContext();
|
Context _mContext = getApplication().getApplicationContext();
|
||||||
new Thread(() -> {
|
new Thread(() -> {
|
||||||
String finalElement = element;
|
String finalElement = element;
|
||||||
|
@ -61,7 +67,12 @@ public class ChannelsVM extends AndroidViewModel {
|
||||||
AccountData.Account account = new AccountDAO(_mContext, db).getAccountByToken(token);
|
AccountData.Account account = new AccountDAO(_mContext, db).getAccountByToken(token);
|
||||||
finalElement = account.getUsername() + "@" + account.getHost();
|
finalElement = account.getUsername() + "@" + account.getHost();
|
||||||
}
|
}
|
||||||
RetrofitPeertubeAPI retrofitPeertubeAPI = new RetrofitPeertubeAPI(_mContext);
|
RetrofitPeertubeAPI retrofitPeertubeAPI;
|
||||||
|
if( instance == null ) {
|
||||||
|
retrofitPeertubeAPI = new RetrofitPeertubeAPI(_mContext);
|
||||||
|
} else {
|
||||||
|
retrofitPeertubeAPI = new RetrofitPeertubeAPI(_mContext, instance, null);
|
||||||
|
}
|
||||||
APIResponse apiResponse = retrofitPeertubeAPI.getChannelData(type, finalElement);
|
APIResponse apiResponse = retrofitPeertubeAPI.getChannelData(type, finalElement);
|
||||||
Handler mainHandler = new Handler(Looper.getMainLooper());
|
Handler mainHandler = new Handler(Looper.getMainLooper());
|
||||||
Runnable myRunnable = () -> apiResponseMutableLiveData.setValue(apiResponse);
|
Runnable myRunnable = () -> apiResponseMutableLiveData.setValue(apiResponse);
|
||||||
|
|
|
@ -71,15 +71,27 @@ public class TimelineVM extends AndroidViewModel {
|
||||||
|
|
||||||
public LiveData<APIResponse> getVideosInChannel(String channelId, String max_id) {
|
public LiveData<APIResponse> getVideosInChannel(String channelId, String max_id) {
|
||||||
apiResponseMutableLiveData = new MutableLiveData<>();
|
apiResponseMutableLiveData = new MutableLiveData<>();
|
||||||
loadVideosForChannel(channelId, max_id);
|
loadVideosForChannel(null, channelId, max_id);
|
||||||
return apiResponseMutableLiveData;
|
return apiResponseMutableLiveData;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void loadVideosForChannel(String channelId, String max_id) {
|
|
||||||
|
public LiveData<APIResponse> getVideosInChannel(String instance, String channelId, String max_id) {
|
||||||
|
apiResponseMutableLiveData = new MutableLiveData<>();
|
||||||
|
loadVideosForChannel(instance, channelId, max_id);
|
||||||
|
return apiResponseMutableLiveData;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void loadVideosForChannel(String instance, String channelId, String max_id) {
|
||||||
Context _mContext = getApplication().getApplicationContext();
|
Context _mContext = getApplication().getApplicationContext();
|
||||||
new Thread(() -> {
|
new Thread(() -> {
|
||||||
try {
|
try {
|
||||||
RetrofitPeertubeAPI retrofitPeertubeAPI = new RetrofitPeertubeAPI(_mContext);
|
RetrofitPeertubeAPI retrofitPeertubeAPI;
|
||||||
|
if( instance == null) {
|
||||||
|
retrofitPeertubeAPI = new RetrofitPeertubeAPI(_mContext);
|
||||||
|
}else {
|
||||||
|
retrofitPeertubeAPI = new RetrofitPeertubeAPI(_mContext, instance, null);
|
||||||
|
}
|
||||||
APIResponse apiResponse = retrofitPeertubeAPI.getVideosForChannel(channelId, max_id);
|
APIResponse apiResponse = retrofitPeertubeAPI.getVideosForChannel(channelId, max_id);
|
||||||
Handler mainHandler = new Handler(Looper.getMainLooper());
|
Handler mainHandler = new Handler(Looper.getMainLooper());
|
||||||
Runnable myRunnable = () -> apiResponseMutableLiveData.setValue(apiResponse);
|
Runnable myRunnable = () -> apiResponseMutableLiveData.setValue(apiResponse);
|
||||||
|
|
Loading…
Reference in New Issue