1
0
mirror of https://framagit.org/tom79/fedilab-tube synced 2025-06-05 21:09:11 +02:00

some changes

This commit is contained in:
Thomas
2020-06-26 18:17:17 +02:00
parent 67417bd65c
commit 51860ff399
26 changed files with 182 additions and 112 deletions

View File

@ -0,0 +1,14 @@
package app.fedilab.fedilabtube;
import android.content.Context;
import androidx.multidex.MultiDex;
import androidx.multidex.MultiDexApplication;
public class FedilabTupe extends MultiDexApplication {
@Override
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
MultiDex.install(this);
}
}

View File

@ -67,7 +67,6 @@ import javax.net.ssl.HttpsURLConnection;
import app.fedilab.fedilabtube.asynctasks.ManagePlaylistsAsyncTask;
import app.fedilab.fedilabtube.asynctasks.PostActionAsyncTask;
import app.fedilab.fedilabtube.asynctasks.RetrieveFeedsAsyncTask;
import app.fedilab.fedilabtube.asynctasks.RetrievePeertubeSingleAsyncTask;
import app.fedilab.fedilabtube.asynctasks.RetrievePeertubeSingleCommentsAsyncTask;
import app.fedilab.fedilabtube.client.APIResponse;
@ -559,7 +558,6 @@ public class PeertubeActivity extends AppCompatActivity implements OnRetrievePee
SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, MODE_PRIVATE);
String userId = sharedpreferences.getString(Helper.PREF_KEY_ID, null);
StatusDrawerParams statusDrawerParams = new StatusDrawerParams();
statusDrawerParams.setType(RetrieveFeedsAsyncTask.Type.REMOTE_INSTANCE);
statusDrawerParams.setTargetedId(userId);
statusDrawerParams.setStatuses(statuses);
StatusListAdapter statusListAdapter = new StatusListAdapter(statusDrawerParams);

View File

@ -60,9 +60,6 @@ public class RetrieveFeedsAsyncTask extends AsyncTask<Void, Void, Void> {
if (action == null)
return null;
switch (action) {
case REMOTE_INSTANCE_FILTERED:
apiResponse = peertubeAPI.searchPeertube(this.remoteInstance, search);
break;
case USER:
apiResponse = peertubeAPI.getVideos(targetedID, max_id);
break;
@ -116,57 +113,21 @@ public class RetrieveFeedsAsyncTask extends AsyncTask<Void, Void, Void> {
}
public enum Type {
HOME,
LOCAL,
DIRECT,
CONVERSATION,
PUBLIC,
HASHTAG,
LIST,
USER,
FAVOURITES,
ONESTATUS,
CONTEXT,
TAG,
REMOTE_INSTANCE,
REMOTE_INSTANCE_FILTERED,
ART,
PEERTUBE,
NOTIFICATION,
SEARCH,
NEWS,
ANNOUNCEMENTS,
USER,
PPUBLIC,
PSUBSCRIPTIONS,
POVERVIEW,
PTRENDING,
PRECENTLYADDED,
PMOSTLIKED,
PLOCAL,
CHANNEL,
MYVIDEOS,
PEERTUBE_HISTORY,
PIXELFED,
PF_HOME,
PF_LOCAL,
PF_DISCOVER,
PF_NOTIFICATION,
PF_REPLIES,
GNU_HOME,
GNU_LOCAL,
GNU_WHOLE,
GNU_NOTIFICATION,
GNU_DM,
GNU_ART,
GNU_TAG,
GNU_GROUP_TIMELINE,
SCHEDULED_TOOTS,
CACHE_BOOKMARKS,
CACHE_BOOKMARKS_PEERTUBE,
CACHE_STATUS,
}
}

View File

@ -1677,13 +1677,11 @@ public class PeertubeAPI {
status.setUri(comment.get("url").toString());
status.setUrl(comment.get("url").toString());
status.setSensitive(false);
status.setSpoiler_text("");
status.setContent(context, comment.get("text").toString());
status.setContent(comment.get("text").toString());
status.setIn_reply_to_id(comment.get("inReplyToCommentId").toString());
status.setAccount(parseAccountResponsePeertube(instance, comment.getJSONObject("account")));
status.setCreated_at(Helper.mstStringToDate(comment.get("createdAt").toString()));
status.setVisibility("public");
status.setViewType(context);
SpannableString spannableString;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
spannableString = new SpannableString(Html.fromHtml(status.getContent(), Html.FROM_HTML_MODE_LEGACY));

View File

@ -82,6 +82,10 @@ public class Status implements Parcelable {
private String conversationId;
private String contentType;
public void setContent(String content) {
this.content = content;
}
public Status() {
}

View File

@ -70,12 +70,16 @@ public class DisplayStatusFragment extends Fragment implements OnPostActionInter
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
rootView = inflater.inflate(R.layout.fragment_video, container, false);
peertubes = new ArrayList<>();
context = getContext();
Bundle bundle = this.getArguments();
if (getArguments() != null) {
type = DisplayStatusFragmentArgs.fromBundle(getArguments()).getType();
}
if (bundle != null) {
type = (RetrieveFeedsAsyncTask.Type) bundle.get("type");
String targetedId = bundle.getString("targetedid", null);
String tag = bundle.getString("tag", null);
search_peertube = bundle.getString("search_peertube", null);