Display account

This commit is contained in:
Thomas 2020-06-27 19:08:52 +02:00
parent fc654fe561
commit 9dca09b1d3
15 changed files with 127 additions and 334 deletions

View File

@ -59,6 +59,7 @@ dependencies {
implementation 'com.google.android.exoplayer:exoplayer:2.10.6' implementation 'com.google.android.exoplayer:exoplayer:2.10.6'
implementation "com.github.mabbas007:TagsEditText:1.0.5" implementation "com.github.mabbas007:TagsEditText:1.0.5"
implementation "com.github.bumptech.glide:glide:4.11.0" implementation "com.github.bumptech.glide:glide:4.11.0"
annotationProcessor "com.github.bumptech.glide:compiler:4.11.0"
implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.1.0" implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.1.0"
implementation 'org.apache.poi:poi:3.16' implementation 'org.apache.poi:poi:3.16'
implementation "net.gotev:uploadservice:3.5.2" implementation "net.gotev:uploadservice:3.5.2"

View File

@ -1,7 +1,6 @@
package app.fedilab.fedilabtube; package app.fedilab.fedilabtube;
import android.content.Context; import android.content.Context;
import android.content.DialogInterface;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.os.AsyncTask; import android.os.AsyncTask;
import android.os.Bundle; import android.os.Bundle;
@ -23,7 +22,6 @@ import app.fedilab.fedilabtube.asynctasks.RetrievePeertubeInformationAsyncTask;
import app.fedilab.fedilabtube.helper.Helper; import app.fedilab.fedilabtube.helper.Helper;
import static app.fedilab.fedilabtube.helper.Helper.academies; import static app.fedilab.fedilabtube.helper.Helper.academies;
import static app.fedilab.fedilabtube.helper.Helper.getLiveInstance;
public class MainActivity extends AppCompatActivity { public class MainActivity extends AppCompatActivity {

View File

@ -1,4 +1,3 @@
package app.fedilab.fedilabtube; package app.fedilab.fedilabtube;
@ -62,7 +61,6 @@ import java.util.Objects;
import javax.net.ssl.HttpsURLConnection; import javax.net.ssl.HttpsURLConnection;
import app.fedilab.fedilabtube.asynctasks.ManagePlaylistsAsyncTask; import app.fedilab.fedilabtube.asynctasks.ManagePlaylistsAsyncTask;
import app.fedilab.fedilabtube.asynctasks.PostActionAsyncTask; import app.fedilab.fedilabtube.asynctasks.PostActionAsyncTask;
import app.fedilab.fedilabtube.asynctasks.RetrievePeertubeSingleAsyncTask; import app.fedilab.fedilabtube.asynctasks.RetrievePeertubeSingleAsyncTask;
@ -162,7 +160,6 @@ public class PeertubeActivity extends AppCompatActivity implements OnRetrievePee
peertube_bookmark.setVisibility(View.GONE); peertube_bookmark.setVisibility(View.GONE);
SQLiteDatabase db = Sqlite.getInstance(getApplicationContext(), Sqlite.DB_NAME, null, Sqlite.DB_VERSION).open(); SQLiteDatabase db = Sqlite.getInstance(getApplicationContext(), Sqlite.DB_NAME, null, Sqlite.DB_VERSION).open();
String userId = sharedpreferences.getString(Helper.PREF_KEY_ID, null); String userId = sharedpreferences.getString(Helper.PREF_KEY_ID, null);
instance = sharedpreferences.getString(Helper.PREF_INSTANCE, Helper.getLiveInstance(PeertubeActivity.this)); instance = sharedpreferences.getString(Helper.PREF_INSTANCE, Helper.getLiveInstance(PeertubeActivity.this));
@ -178,8 +175,6 @@ public class PeertubeActivity extends AppCompatActivity implements OnRetrievePee
getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setDisplayHomeAsUpEnabled(true);
mode = sharedpreferences.getInt(Helper.SET_VIDEO_MODE, Helper.VIDEO_MODE_DIRECT); mode = sharedpreferences.getInt(Helper.SET_VIDEO_MODE, Helper.VIDEO_MODE_DIRECT);
if (mode != Helper.VIDEO_MODE_WEBVIEW && mode != Helper.VIDEO_MODE_DIRECT) if (mode != Helper.VIDEO_MODE_WEBVIEW && mode != Helper.VIDEO_MODE_DIRECT)
mode = Helper.VIDEO_MODE_DIRECT; mode = Helper.VIDEO_MODE_DIRECT;
@ -320,7 +315,6 @@ public class PeertubeActivity extends AppCompatActivity implements OnRetrievePee
new ManagePlaylistsAsyncTask(PeertubeActivity.this, GET_PLAYLIST_FOR_VIDEO, null, peertube.getId(), null, PeertubeActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR); new ManagePlaylistsAsyncTask(PeertubeActivity.this, GET_PLAYLIST_FOR_VIDEO, null, peertube.getId(), null, PeertubeActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
peertube_playlist.setOnClickListener(v -> { peertube_playlist.setOnClickListener(v -> {
if (isLoggedIn(PeertubeActivity.this)) { if (isLoggedIn(PeertubeActivity.this)) {
if (playlists != null && peertube.getId() != null) { if (playlists != null && peertube.getId() != null) {

View File

@ -3,7 +3,6 @@ package app.fedilab.fedilabtube;
import android.content.Intent; import android.content.Intent;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.content.res.ColorStateList; import android.content.res.ColorStateList;
import android.database.sqlite.SQLiteDatabase;
import android.os.AsyncTask; import android.os.AsyncTask;
import android.os.Build; import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
@ -42,7 +41,6 @@ import app.fedilab.fedilabtube.client.APIResponse;
import app.fedilab.fedilabtube.client.PeertubeAPI; import app.fedilab.fedilabtube.client.PeertubeAPI;
import app.fedilab.fedilabtube.client.entities.Account; import app.fedilab.fedilabtube.client.entities.Account;
import app.fedilab.fedilabtube.client.entities.Error; import app.fedilab.fedilabtube.client.entities.Error;
import app.fedilab.fedilabtube.client.entities.InstanceNodeInfo;
import app.fedilab.fedilabtube.client.entities.Relationship; import app.fedilab.fedilabtube.client.entities.Relationship;
import app.fedilab.fedilabtube.client.entities.Status; import app.fedilab.fedilabtube.client.entities.Status;
import app.fedilab.fedilabtube.client.entities.StatusDrawerParams; import app.fedilab.fedilabtube.client.entities.StatusDrawerParams;
@ -54,12 +52,11 @@ import app.fedilab.fedilabtube.interfaces.OnPostActionInterface;
import app.fedilab.fedilabtube.interfaces.OnRetrieveFeedsAccountInterface; import app.fedilab.fedilabtube.interfaces.OnRetrieveFeedsAccountInterface;
import app.fedilab.fedilabtube.interfaces.OnRetrieveFeedsInterface; import app.fedilab.fedilabtube.interfaces.OnRetrieveFeedsInterface;
import app.fedilab.fedilabtube.interfaces.OnRetrieveRelationshipInterface; import app.fedilab.fedilabtube.interfaces.OnRetrieveRelationshipInterface;
import app.fedilab.fedilabtube.sqlite.AccountDAO;
import app.fedilab.fedilabtube.sqlite.Sqlite;
import es.dmoral.toasty.Toasty; import es.dmoral.toasty.Toasty;
import static androidx.core.text.HtmlCompat.FROM_HTML_MODE_LEGACY; import static androidx.core.text.HtmlCompat.FROM_HTML_MODE_LEGACY;
import static app.fedilab.fedilabtube.helper.Helper.getLiveInstance; import static app.fedilab.fedilabtube.helper.Helper.getLiveInstance;
import static app.fedilab.fedilabtube.helper.Helper.isLoggedIn;
public class ShowAccountActivity extends AppCompatActivity implements OnPostActionInterface, OnRetrieveFeedsAccountInterface, OnRetrieveRelationshipInterface, OnRetrieveFeedsInterface { public class ShowAccountActivity extends AppCompatActivity implements OnPostActionInterface, OnRetrieveFeedsAccountInterface, OnRetrieveRelationshipInterface, OnRetrieveFeedsInterface {
@ -73,8 +70,6 @@ public class ShowAccountActivity extends AppCompatActivity implements OnPostActi
private TextView account_note; private TextView account_note;
private String userId; private String userId;
private Relationship relationship; private Relationship relationship;
private ImageButton header_edit_profile;
private List<Status> pins;
private int maxScrollSize; private int maxScrollSize;
private boolean avatarShown = true; private boolean avatarShown = true;
private ImageView account_pp; private ImageView account_pp;
@ -85,7 +80,6 @@ public class ShowAccountActivity extends AppCompatActivity implements OnPostActi
private boolean ischannel; private boolean ischannel;
private AsyncTask<Void, Void, Void> retrieveRelationship; private AsyncTask<Void, Void, Void> retrieveRelationship;
private action doAction; private action doAction;
private PeertubeAPI.StatusAction doActionAccount;
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
@ -93,10 +87,8 @@ public class ShowAccountActivity extends AppCompatActivity implements OnPostActi
SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, MODE_PRIVATE); SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, MODE_PRIVATE);
setContentView(R.layout.activity_show_account); setContentView(R.layout.activity_show_account);
setTitle(""); setTitle("");
pins = new ArrayList<>();
Bundle b = getIntent().getExtras(); Bundle b = getIntent().getExtras();
account_follow = findViewById(R.id.account_follow); account_follow = findViewById(R.id.account_follow);
header_edit_profile = findViewById(R.id.header_edit_profile);
account_follow.setEnabled(false); account_follow.setEnabled(false);
account_pp = findViewById(R.id.account_pp); account_pp = findViewById(R.id.account_pp);
account_dn = findViewById(R.id.account_dn); account_dn = findViewById(R.id.account_dn);
@ -143,7 +135,9 @@ public class ShowAccountActivity extends AppCompatActivity implements OnPostActi
SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, MODE_PRIVATE); SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, MODE_PRIVATE);
String accountIdRelation = account.getAcct(); String accountIdRelation = account.getAcct();
if (isLoggedIn(ShowAccountActivity.this)) {
retrieveRelationship = new RetrieveRelationshipAsyncTask(ShowAccountActivity.this, accountIdRelation, ShowAccountActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR); retrieveRelationship = new RetrieveRelationshipAsyncTask(ShowAccountActivity.this, accountIdRelation, ShowAccountActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
String urlHeader = account.getHeader(); String urlHeader = account.getHeader();
if (urlHeader != null && urlHeader.startsWith("/")) { if (urlHeader != null && urlHeader.startsWith("/")) {
@ -155,8 +149,6 @@ public class ShowAccountActivity extends AppCompatActivity implements OnPostActi
.load(urlHeader) .load(urlHeader)
.into(banner_pp); .into(banner_pp);
} }
//Peertube account watched by a Mastodon account
//Bot account
TextView actionbar_title = findViewById(R.id.show_account_title); TextView actionbar_title = findViewById(R.id.show_account_title);
if (account.getAcct() != null) if (account.getAcct() != null)
@ -170,12 +162,6 @@ public class ShowAccountActivity extends AppCompatActivity implements OnPostActi
maxScrollSize = appBar.getTotalScrollRange(); maxScrollSize = appBar.getTotalScrollRange();
//Timed muted account
String userId = sharedpreferences.getString(Helper.PREF_KEY_ID, null);
String instance = sharedpreferences.getString(Helper.PREF_INSTANCE, null);
final SQLiteDatabase db = Sqlite.getInstance(getApplicationContext(), Sqlite.DB_NAME, null, Sqlite.DB_VERSION).open();
final Account authenticatedAccount = new AccountDAO(ShowAccountActivity.this, db).getUniqAccount(userId, instance);
appBar.addOnOffsetChangedListener((appBarLayout, verticalOffset) -> { appBar.addOnOffsetChangedListener((appBarLayout, verticalOffset) -> {
LinearLayout toolbarContent = findViewById(R.id.toolbar_content); LinearLayout toolbarContent = findViewById(R.id.toolbar_content);
if (toolbarContent != null) { if (toolbarContent != null) {
@ -293,13 +279,12 @@ public class ShowAccountActivity extends AppCompatActivity implements OnPostActi
Helper.loadGiF(ShowAccountActivity.this, account, account_pp); Helper.loadGiF(ShowAccountActivity.this, account, account_pp);
//Follow button //Follow button
String target = account.getAcct(); String target = account.getAcct();
String finalTarget = target;
account_follow.setOnClickListener(v -> { account_follow.setOnClickListener(v -> {
if (doAction == action.NOTHING) { if (doAction == action.NOTHING) {
Toasty.info(ShowAccountActivity.this, getString(R.string.nothing_to_do), Toast.LENGTH_LONG).show(); Toasty.info(ShowAccountActivity.this, getString(R.string.nothing_to_do), Toast.LENGTH_LONG).show();
} else if (doAction == action.FOLLOW) { } else if (doAction == action.FOLLOW) {
account_follow.setEnabled(false); account_follow.setEnabled(false);
new PostActionAsyncTask(ShowAccountActivity.this, PeertubeAPI.StatusAction.FOLLOW, finalTarget, ShowAccountActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR); new PostActionAsyncTask(ShowAccountActivity.this, PeertubeAPI.StatusAction.FOLLOW, target, ShowAccountActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
} else if (doAction == action.UNFOLLOW) { } else if (doAction == action.UNFOLLOW) {
boolean confirm_unfollow = sharedpreferences.getBoolean(Helper.SET_UNFOLLOW_VALIDATION, true); boolean confirm_unfollow = sharedpreferences.getBoolean(Helper.SET_UNFOLLOW_VALIDATION, true);
if (confirm_unfollow) { if (confirm_unfollow) {
@ -309,13 +294,13 @@ public class ShowAccountActivity extends AppCompatActivity implements OnPostActi
unfollowConfirm.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss()); unfollowConfirm.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss());
unfollowConfirm.setPositiveButton(R.string.yes, (dialog, which) -> { unfollowConfirm.setPositiveButton(R.string.yes, (dialog, which) -> {
account_follow.setEnabled(false); account_follow.setEnabled(false);
new PostActionAsyncTask(ShowAccountActivity.this, PeertubeAPI.StatusAction.UNFOLLOW, finalTarget, ShowAccountActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR); new PostActionAsyncTask(ShowAccountActivity.this, PeertubeAPI.StatusAction.UNFOLLOW, target, ShowAccountActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
dialog.dismiss(); dialog.dismiss();
}); });
unfollowConfirm.show(); unfollowConfirm.show();
} else { } else {
account_follow.setEnabled(false); account_follow.setEnabled(false);
new PostActionAsyncTask(ShowAccountActivity.this, PeertubeAPI.StatusAction.UNFOLLOW, finalTarget, ShowAccountActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR); new PostActionAsyncTask(ShowAccountActivity.this, PeertubeAPI.StatusAction.UNFOLLOW, target, ShowAccountActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
} }
} }
@ -339,7 +324,6 @@ public class ShowAccountActivity extends AppCompatActivity implements OnPostActi
public void onRetrieveFeeds(APIResponse apiResponse) { public void onRetrieveFeeds(APIResponse apiResponse) {
if (apiResponse.getError() != null) { if (apiResponse.getError() != null) {
Toasty.error(ShowAccountActivity.this, apiResponse.getError().getError(), Toast.LENGTH_LONG).show(); Toasty.error(ShowAccountActivity.this, apiResponse.getError().getError(), Toast.LENGTH_LONG).show();
return;
} }
} }
@ -405,7 +389,6 @@ public class ShowAccountActivity extends AppCompatActivity implements OnPostActi
} }
@Override @Override
public void onDestroy() { public void onDestroy() {
super.onDestroy(); super.onDestroy();
@ -438,7 +421,6 @@ public class ShowAccountActivity extends AppCompatActivity implements OnPostActi
} }
public enum action { public enum action {
FOLLOW, FOLLOW,
UNFOLLOW, UNFOLLOW,
@ -463,7 +445,6 @@ public class ShowAccountActivity extends AppCompatActivity implements OnPostActi
bundle = new Bundle(); bundle = new Bundle();
bundle.putSerializable("type", RetrieveFeedsAsyncTask.Type.USER); bundle.putSerializable("type", RetrieveFeedsAsyncTask.Type.USER);
bundle.putString("targetedid", account.getAcct()); bundle.putString("targetedid", account.getAcct());
bundle.putBoolean("showReply", false);
bundle.putBoolean("ischannel", ischannel); bundle.putBoolean("ischannel", ischannel);
displayStatusFragment.setArguments(bundle); displayStatusFragment.setArguments(bundle);
return displayStatusFragment; return displayStatusFragment;

View File

@ -1,4 +1,3 @@
package app.fedilab.fedilabtube.asynctasks; package app.fedilab.fedilabtube.asynctasks;
import android.content.Context; import android.content.Context;

View File

@ -1,4 +1,3 @@
package app.fedilab.fedilabtube.asynctasks; package app.fedilab.fedilabtube.asynctasks;
import android.content.Context; import android.content.Context;

View File

@ -22,33 +22,24 @@ public class RetrieveFeedsAsyncTask extends AsyncTask<Void, Void, Void> {
private APIResponse apiResponse; private APIResponse apiResponse;
private String max_id; private String max_id;
private OnRetrieveFeedsInterface listener; private OnRetrieveFeedsInterface listener;
private String targetedID;
private String tag;
private boolean showMediaOnly = false;
private boolean showPinned = false;
private boolean showReply = false;
private WeakReference<Context> contextReference; private WeakReference<Context> contextReference;
private String instanceName, remoteInstance, name; private String target;
private int timelineId;
private String search;
private String social;
public RetrieveFeedsAsyncTask(Context context, Type action, String max_id, OnRetrieveFeedsInterface onRetrieveFeedsInterface) { public RetrieveFeedsAsyncTask(Context context, Type action, String max_id, OnRetrieveFeedsInterface onRetrieveFeedsInterface) {
this.contextReference = new WeakReference<>(context); this.contextReference = new WeakReference<>(context);
this.action = action; this.action = action;
this.max_id = max_id; this.max_id = max_id;
this.listener = onRetrieveFeedsInterface; this.listener = onRetrieveFeedsInterface;
this.search = null; this.target = null;
} }
public RetrieveFeedsAsyncTask(Context context, Type action, String max_id, String search, OnRetrieveFeedsInterface onRetrieveFeedsInterface) { public RetrieveFeedsAsyncTask(Context context, Type action, String max_id, String target, OnRetrieveFeedsInterface onRetrieveFeedsInterface) {
this.contextReference = new WeakReference<>(context); this.contextReference = new WeakReference<>(context);
this.action = action; this.action = action;
this.max_id = max_id; this.max_id = max_id;
this.listener = onRetrieveFeedsInterface; this.listener = onRetrieveFeedsInterface;
this.search = search; this.target = target;
} }
@ -60,7 +51,7 @@ public class RetrieveFeedsAsyncTask extends AsyncTask<Void, Void, Void> {
return null; return null;
switch (action) { switch (action) {
case USER: case USER:
apiResponse = peertubeAPI.getVideos(targetedID, max_id); apiResponse = peertubeAPI.getVideos(target, max_id);
break; break;
case MYVIDEOS: case MYVIDEOS:
peertubeAPI = new PeertubeAPI(this.contextReference.get()); peertubeAPI = new PeertubeAPI(this.contextReference.get());
@ -72,7 +63,7 @@ public class RetrieveFeedsAsyncTask extends AsyncTask<Void, Void, Void> {
break; break;
case CHANNEL: case CHANNEL:
peertubeAPI = new PeertubeAPI(this.contextReference.get()); peertubeAPI = new PeertubeAPI(this.contextReference.get());
apiResponse = peertubeAPI.getVideosChannel(targetedID, max_id); apiResponse = peertubeAPI.getVideosChannel(target, max_id);
break; break;
case CACHE_BOOKMARKS_PEERTUBE: case CACHE_BOOKMARKS_PEERTUBE:

View File

@ -1,4 +1,3 @@
package app.fedilab.fedilabtube.asynctasks; package app.fedilab.fedilabtube.asynctasks;
import android.content.Context; import android.content.Context;

View File

@ -32,7 +32,6 @@ import app.fedilab.fedilabtube.interfaces.OnPostActionInterface;
import es.dmoral.toasty.Toasty; import es.dmoral.toasty.Toasty;
public class AccountsListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> implements OnPostActionInterface { public class AccountsListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> implements OnPostActionInterface {
private List<Account> accounts; private List<Account> accounts;
@ -95,6 +94,8 @@ public class AccountsListAdapter extends RecyclerView.Adapter<RecyclerView.ViewH
holder.account_follow.setOnClickListener(v -> { holder.account_follow.setOnClickListener(v -> {
}); });
holder.account_pp.setOnClickListener(v -> {
Intent intent = new Intent(context, ShowAccountActivity.class); Intent intent = new Intent(context, ShowAccountActivity.class);
Bundle b = new Bundle(); Bundle b = new Bundle();
b.putBoolean("peertubeaccount", true); b.putBoolean("peertubeaccount", true);
@ -103,6 +104,8 @@ public class AccountsListAdapter extends RecyclerView.Adapter<RecyclerView.ViewH
b.putParcelable("account", account); b.putParcelable("account", account);
intent.putExtras(b); intent.putExtras(b);
context.startActivity(intent); context.startActivity(intent);
});
} }
@Override @Override

View File

@ -61,6 +61,7 @@ public class DisplayStatusFragment extends Fragment implements OnPostActionInter
private boolean ischannel; private boolean ischannel;
private View rootView; private View rootView;
private RecyclerView lv_status; private RecyclerView lv_status;
private String targetedId;
public DisplayStatusFragment() { public DisplayStatusFragment() {
} }
@ -81,6 +82,7 @@ public class DisplayStatusFragment extends Fragment implements OnPostActionInter
if (bundle != null) { if (bundle != null) {
search_peertube = bundle.getString("search_peertube", null); search_peertube = bundle.getString("search_peertube", null);
targetedId = bundle.getString("targetedid", null);
ischannel = bundle.getBoolean("ischannel", false); ischannel = bundle.getBoolean("ischannel", false);
} }
if (ischannel) { if (ischannel) {
@ -116,7 +118,7 @@ public class DisplayStatusFragment extends Fragment implements OnPostActionInter
if (context != null) { if (context != null) {
//Load data depending of the value //Load data depending of the value
if (search_peertube == null) { //Not a Peertube search if (search_peertube == null) { //Not a Peertube search
asyncTask = new RetrieveFeedsAsyncTask(context, type, "0", DisplayStatusFragment.this).execute(); asyncTask = new RetrieveFeedsAsyncTask(context, type, "0", targetedId, DisplayStatusFragment.this).execute();
} else { } else {
asyncTask = new RetrievePeertubeSearchAsyncTask(context, "0", search_peertube, DisplayStatusFragment.this).execute(); asyncTask = new RetrievePeertubeSearchAsyncTask(context, "0", search_peertube, DisplayStatusFragment.this).execute();
} }
@ -124,7 +126,7 @@ public class DisplayStatusFragment extends Fragment implements OnPostActionInter
new Handler(Looper.getMainLooper()).postDelayed(() -> { new Handler(Looper.getMainLooper()).postDelayed(() -> {
if (context != null) { if (context != null) {
if (search_peertube == null) { //Not a Peertube search if (search_peertube == null) { //Not a Peertube search
asyncTask = new RetrieveFeedsAsyncTask(context, type, "0", DisplayStatusFragment.this).execute(); asyncTask = new RetrieveFeedsAsyncTask(context, type, "0", targetedId, DisplayStatusFragment.this).execute();
} else { } else {
asyncTask = new RetrievePeertubeSearchAsyncTask(context, "0", search_peertube, DisplayStatusFragment.this).execute(); asyncTask = new RetrievePeertubeSearchAsyncTask(context, "0", search_peertube, DisplayStatusFragment.this).execute();
} }
@ -282,7 +284,7 @@ public class DisplayStatusFragment extends Fragment implements OnPostActionInter
max_id = "0"; max_id = "0";
peertubeAdapater.notifyItemRangeRemoved(0, size); peertubeAdapater.notifyItemRangeRemoved(0, size);
if (search_peertube == null) { //Not a Peertube search if (search_peertube == null) { //Not a Peertube search
asyncTask = new RetrieveFeedsAsyncTask(context, type, "0", DisplayStatusFragment.this).execute(); asyncTask = new RetrieveFeedsAsyncTask(context, type, "0", targetedId, DisplayStatusFragment.this).execute();
} else { } else {
asyncTask = new RetrievePeertubeSearchAsyncTask(context, "0", search_peertube, DisplayStatusFragment.this).execute(); asyncTask = new RetrievePeertubeSearchAsyncTask(context, "0", search_peertube, DisplayStatusFragment.this).execute();
} }

View File

@ -35,7 +35,6 @@ import com.bumptech.glide.load.resource.bitmap.CenterCrop;
import com.bumptech.glide.load.resource.bitmap.RoundedCorners; import com.bumptech.glide.load.resource.bitmap.RoundedCorners;
import com.bumptech.glide.request.RequestOptions; import com.bumptech.glide.request.RequestOptions;
import java.text.DateFormat; import java.text.DateFormat;
import java.text.ParseException; import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
@ -351,7 +350,7 @@ public class Helper {
public static void loadGiF(final Context context, Account account, final ImageView imageView) { public static void loadGiF(final Context context, Account account, final ImageView imageView) {
if (account == null) { if (account == null || account.getAvatar() == null || account.getAvatar().compareTo("null") == 0) {
Glide.with(imageView.getContext()) Glide.with(imageView.getContext())
.asDrawable() .asDrawable()
.load(R.drawable.missing_peertube) .load(R.drawable.missing_peertube)
@ -360,7 +359,7 @@ public class Helper {
return; return;
} }
String url = account.getAvatar(); String url = account.getAvatar();
if (url != null && url.startsWith("/")) { if (url.startsWith("/")) {
url = Helper.getLiveInstance(context) + url; url = Helper.getLiveInstance(context) + url;
} }

View File

@ -1,8 +1,8 @@
package app.fedilab.fedilabtube.interfaces; package app.fedilab.fedilabtube.interfaces;
import java.util.List; import java.util.List;
import app.fedilab.fedilabtube.client.entities.Status; import app.fedilab.fedilabtube.client.entities.Status;
public interface OnRetrieveFeedsAccountInterface { public interface OnRetrieveFeedsAccountInterface {

View File

@ -1,4 +1,3 @@
package app.fedilab.fedilabtube.interfaces; package app.fedilab.fedilabtube.interfaces;

View File

@ -14,7 +14,6 @@
android:fitsSystemWindows="true"> android:fitsSystemWindows="true">
<com.google.android.material.appbar.CollapsingToolbarLayout <com.google.android.material.appbar.CollapsingToolbarLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:fitsSystemWindows="true" android:fitsSystemWindows="true"
app:expandedTitleMarginEnd="64dp" app:expandedTitleMarginEnd="64dp"
@ -120,7 +119,6 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="5dp"> android:layout_marginTop="5dp">
<LinearLayout <LinearLayout
android:id="@+id/names_container" android:id="@+id/names_container"
android:layout_width="wrap_content" android:layout_width="wrap_content"
@ -139,15 +137,16 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:singleLine="true" android:singleLine="true"
android:textAppearance="@style/TextAppearance.AppCompat.Body1" android:textAppearance="@style/TextAppearance.AppCompat.Body1"
android:textColor="?colorAccent" android:textColor="@android:color/white"
android:textSize="18sp" /> android:textSize="16sp" />
<TextView <TextView
android:id="@+id/account_un" android:id="@+id/account_un"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:singleLine="true" android:singleLine="true"
android:textSize="16sp" /> android:textColor="@android:color/white"
android:textSize="14sp" />
</LinearLayout> </LinearLayout>
@ -161,6 +160,7 @@
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:gravity="center" android:gravity="center"
android:padding="10dp" android:padding="10dp"
android:textColor="@android:color/white"
android:textIsSelectable="true" /> android:textIsSelectable="true" />
<HorizontalScrollView <HorizontalScrollView
@ -199,182 +199,9 @@
android:textColor="?colorAccent" android:textColor="?colorAccent"
android:visibility="gone" /> android:visibility="gone" />
</LinearLayout> </LinearLayout>
</HorizontalScrollView> </HorizontalScrollView>
<!-- Fields container -->
<LinearLayout
android:id="@+id/fields_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:visibility="gone">
<!-- Fields 1 to 4 -->
<LinearLayout
android:id="@+id/field1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:visibility="gone">
<TextView
android:id="@+id/label1"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_weight="1"
android:gravity="center"
android:minHeight="20dp"
android:padding="5dp"
android:paddingTop="10dp"
android:paddingBottom="10dp"
android:textSize="16sp" />
<LinearLayout
android:id="@+id/value1BG"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="2"
android:orientation="vertical">
<TextView
android:id="@+id/value1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:gravity="center"
android:paddingTop="10dp"
android:paddingBottom="10dp"
android:textIsSelectable="true" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="@+id/field2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:visibility="gone">
<TextView
android:id="@+id/label2"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_weight="1"
android:gravity="center"
android:minHeight="20dp"
android:padding="10dp"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:textSize="16sp" />
<LinearLayout
android:id="@+id/value2BG"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="2"
android:orientation="vertical">
<TextView
android:id="@+id/value2"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:gravity="center"
android:paddingTop="10dp"
android:paddingBottom="10dp"
android:textIsSelectable="true" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="@+id/field3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:visibility="gone">
<TextView
android:id="@+id/label3"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_weight="1"
android:gravity="center"
android:minHeight="20dp"
android:padding="10dp"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:textSize="16sp" />
<LinearLayout
android:id="@+id/value3BG"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="2"
android:orientation="vertical">
<TextView
android:id="@+id/value3"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:gravity="center"
android:paddingTop="10dp"
android:paddingBottom="10dp"
android:textIsSelectable="true" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="@+id/field4"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:visibility="gone">
<TextView
android:id="@+id/label4"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_weight="1"
android:gravity="center"
android:minHeight="20dp"
android:padding="10dp"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:textSize="16sp" />
<LinearLayout
android:id="@+id/value4BG"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="2"
android:orientation="vertical">
<TextView
android:id="@+id/value4"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:gravity="center"
android:paddingTop="10dp"
android:paddingBottom="10dp"
android:textIsSelectable="true" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
<!-- End Fields container -->
</LinearLayout> </LinearLayout>
</RelativeLayout> </RelativeLayout>
@ -394,7 +221,8 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:animationCache="true" android:animationCache="true"
android:orientation="horizontal" android:orientation="horizontal"
android:visibility="gone"> android:visibility="gone"
tools:ignore="UseCompoundDrawables">
<ImageView <ImageView
android:id="@+id/pp_actionBar" android:id="@+id/pp_actionBar"