mirror of
https://framagit.org/tom79/fedilab-tube
synced 2025-06-05 21:09:11 +02:00
Release 1.5.1
This commit is contained in:
@@ -11,8 +11,8 @@ android {
|
|||||||
|
|
||||||
minSdkVersion 21
|
minSdkVersion 21
|
||||||
targetSdkVersion 30
|
targetSdkVersion 30
|
||||||
versionCode 19
|
versionCode 20
|
||||||
versionName "1.5.0"
|
versionName "1.5.1"
|
||||||
multiDexEnabled true
|
multiDexEnabled true
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
}
|
}
|
||||||
|
@@ -39,6 +39,4 @@ public class FedilabTube extends MultiDexApplication {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
@@ -94,6 +94,11 @@ public class LoginActivity extends AppCompatActivity {
|
|||||||
login_passwd = findViewById(R.id.login_passwd);
|
login_passwd = findViewById(R.id.login_passwd);
|
||||||
|
|
||||||
if (Helper.isTablet(LoginActivity.this)) {
|
if (Helper.isTablet(LoginActivity.this)) {
|
||||||
|
|
||||||
|
ViewGroup.LayoutParams layoutParamsI = login_instance_container.getLayoutParams();
|
||||||
|
layoutParamsI.width = (int) Helper.convertDpToPixel(300, LoginActivity.this);
|
||||||
|
login_instance_container.setLayoutParams(layoutParamsI);
|
||||||
|
|
||||||
TextInputLayout login_uid_container = findViewById(R.id.login_uid_container);
|
TextInputLayout login_uid_container = findViewById(R.id.login_uid_container);
|
||||||
ViewGroup.LayoutParams layoutParamsU = login_uid_container.getLayoutParams();
|
ViewGroup.LayoutParams layoutParamsU = login_uid_container.getLayoutParams();
|
||||||
layoutParamsU.width = (int) Helper.convertDpToPixel(300, LoginActivity.this);
|
layoutParamsU.width = (int) Helper.convertDpToPixel(300, LoginActivity.this);
|
||||||
|
@@ -237,6 +237,7 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (Error error) {
|
} catch (Error error) {
|
||||||
|
runOnUiThread(() -> Helper.logoutCurrentUser(MainActivity.this, account));
|
||||||
error.printStackTrace();
|
error.printStackTrace();
|
||||||
}
|
}
|
||||||
}).start();
|
}).start();
|
||||||
|
@@ -158,6 +158,7 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd
|
|||||||
private ActivityPeertubeBinding binding;
|
private ActivityPeertubeBinding binding;
|
||||||
private List<Comment> commentsThread;
|
private List<Comment> commentsThread;
|
||||||
private BroadcastReceiver mPowerKeyReceiver = null;
|
private BroadcastReceiver mPowerKeyReceiver = null;
|
||||||
|
private boolean isPlayInMinimized;
|
||||||
|
|
||||||
public static void hideKeyboard(Activity activity) {
|
public static void hideKeyboard(Activity activity) {
|
||||||
if (activity != null && activity.getWindow() != null) {
|
if (activity != null && activity.getWindow() != null) {
|
||||||
@@ -167,7 +168,6 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd
|
|||||||
imm.hideSoftInputFromWindow(activity.getWindow().getDecorView().getWindowToken(), 0);
|
imm.hideSoftInputFromWindow(activity.getWindow().getDecorView().getWindowToken(), 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private boolean isPlayInMinimized;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
@@ -307,7 +307,6 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private void manageVIewVideos(APIResponse apiResponse) {
|
private void manageVIewVideos(APIResponse apiResponse) {
|
||||||
if (apiResponse == null || apiResponse.getPeertubes() == null || apiResponse.getPeertubes().size() == 0) {
|
if (apiResponse == null || apiResponse.getPeertubes() == null || apiResponse.getPeertubes().size() == 0) {
|
||||||
playVideo();
|
playVideo();
|
||||||
@@ -661,6 +660,9 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd
|
|||||||
if (captions == null) {
|
if (captions == null) {
|
||||||
popup.getMenu().findItem(R.id.action_captions).setEnabled(false);
|
popup.getMenu().findItem(R.id.action_captions).setEnabled(false);
|
||||||
}
|
}
|
||||||
|
if (!isMyVideo) {
|
||||||
|
popup.getMenu().findItem(R.id.action_edit).setVisible(false);
|
||||||
|
}
|
||||||
popup.setOnMenuItemClickListener(item -> {
|
popup.setOnMenuItemClickListener(item -> {
|
||||||
int itemId = item.getItemId();
|
int itemId = item.getItemId();
|
||||||
if (itemId == R.id.action_download) {
|
if (itemId == R.id.action_download) {
|
||||||
@@ -700,7 +702,17 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd
|
|||||||
}
|
}
|
||||||
sendIntent.putExtra(Intent.EXTRA_TEXT, extra_text);
|
sendIntent.putExtra(Intent.EXTRA_TEXT, extra_text);
|
||||||
sendIntent.setType("text/plain");
|
sendIntent.setType("text/plain");
|
||||||
|
try {
|
||||||
startActivity(Intent.createChooser(sendIntent, getString(R.string.share_with)));
|
startActivity(Intent.createChooser(sendIntent, getString(R.string.share_with)));
|
||||||
|
} catch (Exception e) {
|
||||||
|
Toasty.error(PeertubeActivity.this, getString(R.string.toast_error), Toasty.LENGTH_LONG).show();
|
||||||
|
}
|
||||||
|
} else if (itemId == R.id.action_edit) {
|
||||||
|
Intent intent = new Intent(PeertubeActivity.this, PeertubeEditUploadActivity.class);
|
||||||
|
Bundle b = new Bundle();
|
||||||
|
b.putString("video_id", peertube.getUuid());
|
||||||
|
intent.putExtras(b);
|
||||||
|
startActivity(intent);
|
||||||
} else if (itemId == R.id.action_captions) {
|
} else if (itemId == R.id.action_captions) {
|
||||||
AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(PeertubeActivity.this);
|
AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(PeertubeActivity.this);
|
||||||
if (captions == null) {
|
if (captions == null) {
|
||||||
@@ -876,12 +888,10 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd
|
|||||||
if (apiLevel >= 7) {
|
if (apiLevel >= 7) {
|
||||||
try {
|
try {
|
||||||
getApplicationContext().unregisterReceiver(mPowerKeyReceiver);
|
getApplicationContext().unregisterReceiver(mPowerKeyReceiver);
|
||||||
}
|
} catch (IllegalArgumentException e) {
|
||||||
catch (IllegalArgumentException e) {
|
|
||||||
mPowerKeyReceiver = null;
|
mPowerKeyReceiver = null;
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
getApplicationContext().unregisterReceiver(mPowerKeyReceiver);
|
getApplicationContext().unregisterReceiver(mPowerKeyReceiver);
|
||||||
mPowerKeyReceiver = null;
|
mPowerKeyReceiver = null;
|
||||||
}
|
}
|
||||||
@@ -1003,7 +1013,6 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private void initFullscreenDialog() {
|
private void initFullscreenDialog() {
|
||||||
|
|
||||||
fullScreenDialog = new Dialog(this, android.R.style.Theme_Black_NoTitleBar_Fullscreen) {
|
fullScreenDialog = new Dialog(this, android.R.style.Theme_Black_NoTitleBar_Fullscreen) {
|
||||||
@@ -1052,13 +1061,17 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd
|
|||||||
0);
|
0);
|
||||||
animate.setAnimationListener(new Animation.AnimationListener() {
|
animate.setAnimationListener(new Animation.AnimationListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onAnimationStart(Animation animation) {}
|
public void onAnimationStart(Animation animation) {
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onAnimationEnd(Animation animation) {
|
public void onAnimationEnd(Animation animation) {
|
||||||
binding.peertubeInformationContainer.setVisibility(View.GONE);
|
binding.peertubeInformationContainer.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onAnimationRepeat(Animation animation) {}
|
public void onAnimationRepeat(Animation animation) {
|
||||||
|
}
|
||||||
});
|
});
|
||||||
animate.setDuration(500);
|
animate.setDuration(500);
|
||||||
binding.addCommentWriteReply.setText(String.format("@%s ", comment.getAccount().getAcct()));
|
binding.addCommentWriteReply.setText(String.format("@%s ", comment.getAccount().getAcct()));
|
||||||
@@ -1092,13 +1105,17 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd
|
|||||||
0);
|
0);
|
||||||
animate.setAnimationListener(new Animation.AnimationListener() {
|
animate.setAnimationListener(new Animation.AnimationListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onAnimationStart(Animation animation) {}
|
public void onAnimationStart(Animation animation) {
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onAnimationEnd(Animation animation) {
|
public void onAnimationEnd(Animation animation) {
|
||||||
binding.replyThread.setVisibility(View.GONE);
|
binding.replyThread.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onAnimationRepeat(Animation animation) {}
|
public void onAnimationRepeat(Animation animation) {
|
||||||
|
}
|
||||||
});
|
});
|
||||||
animate.setDuration(500);
|
animate.setDuration(500);
|
||||||
binding.replyThread.startAnimation(animate);
|
binding.replyThread.startAnimation(animate);
|
||||||
@@ -1244,6 +1261,7 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd
|
|||||||
dialog.show();
|
dialog.show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void manageVIewPlaylist(APIResponse apiResponse) {
|
public void manageVIewPlaylist(APIResponse apiResponse) {
|
||||||
if (apiResponse.getError() != null || apiResponse.getVideoExistPlaylist() == null) {
|
if (apiResponse.getError() != null || apiResponse.getVideoExistPlaylist() == null) {
|
||||||
return;
|
return;
|
||||||
|
@@ -177,6 +177,9 @@ public class PeertubeRegisterActivity extends AppCompatActivity {
|
|||||||
String host = emailArray[1];
|
String host = emailArray[1];
|
||||||
instance = Helper.getPeertubeUrl(host);
|
instance = Helper.getPeertubeUrl(host);
|
||||||
}
|
}
|
||||||
|
if (instance != null) {
|
||||||
|
instance = instance.toLowerCase().trim();
|
||||||
|
}
|
||||||
|
|
||||||
AccountCreation accountCreation = new AccountCreation();
|
AccountCreation accountCreation = new AccountCreation();
|
||||||
accountCreation.setEmail(email.getText().toString().trim());
|
accountCreation.setEmail(email.getText().toString().trim());
|
||||||
|
@@ -140,7 +140,6 @@ public class SepiaSearchActivity extends AppCompatActivity {
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Spinner sort_by = findViewById(R.id.sort_by);
|
Spinner sort_by = findViewById(R.id.sort_by);
|
||||||
ArrayAdapter<String> adapterSortBy = new ArrayAdapter<>(SepiaSearchActivity.this,
|
ArrayAdapter<String> adapterSortBy = new ArrayAdapter<>(SepiaSearchActivity.this,
|
||||||
android.R.layout.simple_spinner_dropdown_item, getResources().getStringArray(R.array.sort_by_array));
|
android.R.layout.simple_spinner_dropdown_item, getResources().getStringArray(R.array.sort_by_array));
|
||||||
@@ -282,7 +281,6 @@ public class SepiaSearchActivity extends AppCompatActivity {
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
searchBar = findViewById(R.id.searchBar);
|
searchBar = findViewById(R.id.searchBar);
|
||||||
|
|
||||||
searchBar.setOnSearchActionListener(new MaterialSearchBar.OnSearchActionListener() {
|
searchBar.setOnSearchActionListener(new MaterialSearchBar.OnSearchActionListener() {
|
||||||
|
@@ -42,11 +42,9 @@ import com.google.android.material.tabs.TabLayout;
|
|||||||
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
|
|
||||||
import app.fedilab.fedilabtube.client.APIResponse;
|
import app.fedilab.fedilabtube.client.APIResponse;
|
||||||
import app.fedilab.fedilabtube.client.RetrofitPeertubeAPI;
|
import app.fedilab.fedilabtube.client.RetrofitPeertubeAPI;
|
||||||
import app.fedilab.fedilabtube.client.data.AccountData;
|
import app.fedilab.fedilabtube.client.data.AccountData;
|
||||||
import app.fedilab.fedilabtube.fragment.DisplayAccountsFragment;
|
|
||||||
import app.fedilab.fedilabtube.fragment.DisplayChannelsFragment;
|
import app.fedilab.fedilabtube.fragment.DisplayChannelsFragment;
|
||||||
import app.fedilab.fedilabtube.fragment.DisplayVideosFragment;
|
import app.fedilab.fedilabtube.fragment.DisplayVideosFragment;
|
||||||
import app.fedilab.fedilabtube.helper.Helper;
|
import app.fedilab.fedilabtube.helper.Helper;
|
||||||
|
@@ -17,7 +17,6 @@ package app.fedilab.fedilabtube.client;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
|
||||||
import app.fedilab.fedilabtube.client.data.AccountData;
|
import app.fedilab.fedilabtube.client.data.AccountData;
|
||||||
import app.fedilab.fedilabtube.client.data.BlockData;
|
import app.fedilab.fedilabtube.client.data.BlockData;
|
||||||
import app.fedilab.fedilabtube.client.data.CaptionData;
|
import app.fedilab.fedilabtube.client.data.CaptionData;
|
||||||
|
@@ -85,9 +85,9 @@ public class RetrofitPeertubeAPI {
|
|||||||
private final String finalUrl;
|
private final String finalUrl;
|
||||||
private final Context _context;
|
private final Context _context;
|
||||||
private final String instance;
|
private final String instance;
|
||||||
|
private final String count;
|
||||||
private String token;
|
private String token;
|
||||||
private Set<String> selection;
|
private Set<String> selection;
|
||||||
private final String count;
|
|
||||||
|
|
||||||
public RetrofitPeertubeAPI(Context context) {
|
public RetrofitPeertubeAPI(Context context) {
|
||||||
_context = context;
|
_context = context;
|
||||||
|
@@ -21,7 +21,6 @@ import java.util.Locale;
|
|||||||
|
|
||||||
import app.fedilab.fedilabtube.client.data.VideoData;
|
import app.fedilab.fedilabtube.client.data.VideoData;
|
||||||
import app.fedilab.fedilabtube.client.entities.SepiaSearch;
|
import app.fedilab.fedilabtube.client.entities.SepiaSearch;
|
||||||
import app.fedilab.fedilabtube.helper.Helper;
|
|
||||||
import retrofit2.Call;
|
import retrofit2.Call;
|
||||||
import retrofit2.Response;
|
import retrofit2.Response;
|
||||||
import retrofit2.Retrofit;
|
import retrofit2.Retrofit;
|
||||||
@@ -30,7 +29,7 @@ import retrofit2.converter.gson.GsonConverterFactory;
|
|||||||
public class RetrofitSepiaSearchAPI {
|
public class RetrofitSepiaSearchAPI {
|
||||||
|
|
||||||
|
|
||||||
private String finalUrl;
|
private final String finalUrl;
|
||||||
|
|
||||||
|
|
||||||
public RetrofitSepiaSearchAPI() {
|
public RetrofitSepiaSearchAPI() {
|
||||||
@@ -47,6 +46,7 @@ public class RetrofitSepiaSearchAPI {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Return videos for a sepia search
|
* Return videos for a sepia search
|
||||||
|
*
|
||||||
* @param sepiaSearch SepiaSearch
|
* @param sepiaSearch SepiaSearch
|
||||||
* @return VideoData
|
* @return VideoData
|
||||||
*/
|
*/
|
||||||
|
@@ -14,7 +14,6 @@ package app.fedilab.fedilabtube.client;
|
|||||||
* You should have received a copy of the GNU General Public License along with TubeLab; if not,
|
* You should have received a copy of the GNU General Public License along with TubeLab; if not,
|
||||||
* see <http://www.gnu.org/licenses>. */
|
* see <http://www.gnu.org/licenses>. */
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import app.fedilab.fedilabtube.client.data.ChannelData;
|
import app.fedilab.fedilabtube.client.data.ChannelData;
|
||||||
|
@@ -26,6 +26,17 @@ import java.util.List;
|
|||||||
@SuppressWarnings("unused")
|
@SuppressWarnings("unused")
|
||||||
public class SepiaSearch implements Parcelable {
|
public class SepiaSearch implements Parcelable {
|
||||||
|
|
||||||
|
public static final Creator<SepiaSearch> CREATOR = new Creator<SepiaSearch>() {
|
||||||
|
@Override
|
||||||
|
public SepiaSearch createFromParcel(Parcel source) {
|
||||||
|
return new SepiaSearch(source);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public SepiaSearch[] newArray(int size) {
|
||||||
|
return new SepiaSearch[size];
|
||||||
|
}
|
||||||
|
};
|
||||||
@SerializedName("start")
|
@SerializedName("start")
|
||||||
private String start;
|
private String start;
|
||||||
@SerializedName("count")
|
@SerializedName("count")
|
||||||
@@ -53,7 +64,27 @@ public class SepiaSearch implements Parcelable {
|
|||||||
@SerializedName("sort")
|
@SerializedName("sort")
|
||||||
private String sort;
|
private String sort;
|
||||||
|
|
||||||
|
public SepiaSearch() {
|
||||||
|
}
|
||||||
|
|
||||||
|
protected SepiaSearch(Parcel in) {
|
||||||
|
this.start = in.readString();
|
||||||
|
this.count = in.readString();
|
||||||
|
this.search = in.readString();
|
||||||
|
this.durationMax = in.readInt();
|
||||||
|
this.durationMin = in.readInt();
|
||||||
|
long tmpStartDate = in.readLong();
|
||||||
|
this.startDate = tmpStartDate == -1 ? null : new Date(tmpStartDate);
|
||||||
|
this.boostLanguages = in.createStringArrayList();
|
||||||
|
this.categoryOneOf = new ArrayList<>();
|
||||||
|
in.readList(this.categoryOneOf, Integer.class.getClassLoader());
|
||||||
|
this.licenceOneOf = new ArrayList<>();
|
||||||
|
in.readList(this.licenceOneOf, Integer.class.getClassLoader());
|
||||||
|
this.tagsOneOf = in.createStringArrayList();
|
||||||
|
this.tagsAllOf = in.createStringArrayList();
|
||||||
|
this.nsfw = in.readByte() != 0;
|
||||||
|
this.sort = in.readString();
|
||||||
|
}
|
||||||
|
|
||||||
public String getStart() {
|
public String getStart() {
|
||||||
return start;
|
return start;
|
||||||
@@ -180,38 +211,4 @@ public class SepiaSearch implements Parcelable {
|
|||||||
dest.writeByte(this.nsfw ? (byte) 1 : (byte) 0);
|
dest.writeByte(this.nsfw ? (byte) 1 : (byte) 0);
|
||||||
dest.writeString(this.sort);
|
dest.writeString(this.sort);
|
||||||
}
|
}
|
||||||
|
|
||||||
public SepiaSearch() {
|
|
||||||
}
|
|
||||||
|
|
||||||
protected SepiaSearch(Parcel in) {
|
|
||||||
this.start = in.readString();
|
|
||||||
this.count = in.readString();
|
|
||||||
this.search = in.readString();
|
|
||||||
this.durationMax = in.readInt();
|
|
||||||
this.durationMin = in.readInt();
|
|
||||||
long tmpStartDate = in.readLong();
|
|
||||||
this.startDate = tmpStartDate == -1 ? null : new Date(tmpStartDate);
|
|
||||||
this.boostLanguages = in.createStringArrayList();
|
|
||||||
this.categoryOneOf = new ArrayList<>();
|
|
||||||
in.readList(this.categoryOneOf, Integer.class.getClassLoader());
|
|
||||||
this.licenceOneOf = new ArrayList<>();
|
|
||||||
in.readList(this.licenceOneOf, Integer.class.getClassLoader());
|
|
||||||
this.tagsOneOf = in.createStringArrayList();
|
|
||||||
this.tagsAllOf = in.createStringArrayList();
|
|
||||||
this.nsfw = in.readByte() != 0;
|
|
||||||
this.sort = in.readString();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static final Creator<SepiaSearch> CREATOR = new Creator<SepiaSearch>() {
|
|
||||||
@Override
|
|
||||||
public SepiaSearch createFromParcel(Parcel source) {
|
|
||||||
return new SepiaSearch(source);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public SepiaSearch[] newArray(int size) {
|
|
||||||
return new SepiaSearch[size];
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
@@ -37,8 +37,8 @@ import app.fedilab.fedilabtube.helper.Helper;
|
|||||||
|
|
||||||
public class AccountsHorizontalListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
|
public class AccountsHorizontalListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
|
||||||
|
|
||||||
|
private final List<ChannelData.Channel> channels;
|
||||||
EventListener listener;
|
EventListener listener;
|
||||||
private List<ChannelData.Channel> channels;
|
|
||||||
private Context context;
|
private Context context;
|
||||||
|
|
||||||
public AccountsHorizontalListAdapter(List<ChannelData.Channel> channels, EventListener listener) {
|
public AccountsHorizontalListAdapter(List<ChannelData.Channel> channels, EventListener listener) {
|
||||||
@@ -109,11 +109,7 @@ public class AccountsHorizontalListAdapter extends RecyclerView.Adapter<Recycler
|
|||||||
ChannelData.Channel channel = channels.get(getAdapterPosition());
|
ChannelData.Channel channel = channels.get(getAdapterPosition());
|
||||||
listener.click(channel.getAcct());
|
listener.click(channel.getAcct());
|
||||||
for (ChannelData.Channel acc : channels) {
|
for (ChannelData.Channel acc : channels) {
|
||||||
if (acc.getId().compareTo(channel.getId()) == 0) {
|
acc.setSelected(acc.getId().compareTo(channel.getId()) == 0);
|
||||||
acc.setSelected(true);
|
|
||||||
} else {
|
|
||||||
acc.setSelected(false);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
notifyItemRangeChanged(0, channels.size());
|
notifyItemRangeChanged(0, channels.size());
|
||||||
}
|
}
|
||||||
|
@@ -47,11 +47,11 @@ import es.dmoral.toasty.Toasty;
|
|||||||
|
|
||||||
public class AccountsListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
|
public class AccountsListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
|
||||||
|
|
||||||
public AllAccountsRemoved allAccountsRemoved;
|
|
||||||
private final List<Account> accounts;
|
private final List<Account> accounts;
|
||||||
private Context context;
|
|
||||||
private final AccountsListAdapter accountsListAdapter;
|
private final AccountsListAdapter accountsListAdapter;
|
||||||
private final RetrofitPeertubeAPI.DataType type;
|
private final RetrofitPeertubeAPI.DataType type;
|
||||||
|
public AllAccountsRemoved allAccountsRemoved;
|
||||||
|
private Context context;
|
||||||
|
|
||||||
public AccountsListAdapter(RetrofitPeertubeAPI.DataType type, List<Account> accounts) {
|
public AccountsListAdapter(RetrofitPeertubeAPI.DataType type, List<Account> accounts) {
|
||||||
this.accounts = accounts;
|
this.accounts = accounts;
|
||||||
|
@@ -44,11 +44,11 @@ import app.fedilab.fedilabtube.helper.Helper;
|
|||||||
|
|
||||||
public class ChannelListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
|
public class ChannelListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
|
||||||
|
|
||||||
|
private final List<Channel> channels;
|
||||||
|
private final boolean myChannel;
|
||||||
public AllChannelRemoved allChannelRemoved;
|
public AllChannelRemoved allChannelRemoved;
|
||||||
public EditAlertDialog editAlertDialog;
|
public EditAlertDialog editAlertDialog;
|
||||||
private final List<Channel> channels;
|
|
||||||
private Context context;
|
private Context context;
|
||||||
private final boolean myChannel;
|
|
||||||
|
|
||||||
|
|
||||||
public ChannelListAdapter(List<Channel> channels, boolean myChannel) {
|
public ChannelListAdapter(List<Channel> channels, boolean myChannel) {
|
||||||
|
@@ -55,7 +55,6 @@ import java.util.regex.Pattern;
|
|||||||
import app.fedilab.fedilabtube.PeertubeActivity;
|
import app.fedilab.fedilabtube.PeertubeActivity;
|
||||||
import app.fedilab.fedilabtube.R;
|
import app.fedilab.fedilabtube.R;
|
||||||
import app.fedilab.fedilabtube.ShowAccountActivity;
|
import app.fedilab.fedilabtube.ShowAccountActivity;
|
||||||
import app.fedilab.fedilabtube.ShowChannelActivity;
|
|
||||||
import app.fedilab.fedilabtube.client.APIResponse;
|
import app.fedilab.fedilabtube.client.APIResponse;
|
||||||
import app.fedilab.fedilabtube.client.RetrofitPeertubeAPI;
|
import app.fedilab.fedilabtube.client.RetrofitPeertubeAPI;
|
||||||
import app.fedilab.fedilabtube.client.data.CommentData.Comment;
|
import app.fedilab.fedilabtube.client.data.CommentData.Comment;
|
||||||
@@ -74,11 +73,11 @@ import static app.fedilab.fedilabtube.helper.Helper.isLoggedIn;
|
|||||||
public class CommentListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
|
public class CommentListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
|
||||||
|
|
||||||
|
|
||||||
public AllCommentRemoved allCommentRemoved;
|
|
||||||
private Context context;
|
|
||||||
private final List<Comment> comments;
|
private final List<Comment> comments;
|
||||||
private final CommentListAdapter commentListAdapter;
|
private final CommentListAdapter commentListAdapter;
|
||||||
|
public AllCommentRemoved allCommentRemoved;
|
||||||
boolean isVideoOwner;
|
boolean isVideoOwner;
|
||||||
|
private Context context;
|
||||||
|
|
||||||
public CommentListAdapter(List<Comment> comments, boolean isVideoOwner) {
|
public CommentListAdapter(List<Comment> comments, boolean isVideoOwner) {
|
||||||
this.comments = comments;
|
this.comments = comments;
|
||||||
|
@@ -43,7 +43,7 @@ import static app.fedilab.fedilabtube.MainActivity.peertubeInformation;
|
|||||||
|
|
||||||
public class InstanceAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
|
public class InstanceAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
|
||||||
|
|
||||||
private List<Instance> instances;
|
private final List<Instance> instances;
|
||||||
|
|
||||||
private Context context;
|
private Context context;
|
||||||
|
|
||||||
|
@@ -34,8 +34,8 @@ import app.fedilab.fedilabtube.helper.Helper;
|
|||||||
|
|
||||||
public class OwnAccountsAdapter extends ArrayAdapter<Account> {
|
public class OwnAccountsAdapter extends ArrayAdapter<Account> {
|
||||||
|
|
||||||
private List<Account> accounts;
|
private final List<Account> accounts;
|
||||||
private LayoutInflater layoutInflater;
|
private final LayoutInflater layoutInflater;
|
||||||
|
|
||||||
public OwnAccountsAdapter(Context context, List<Account> accounts) {
|
public OwnAccountsAdapter(Context context, List<Account> accounts) {
|
||||||
super(context, android.R.layout.simple_list_item_1, accounts);
|
super(context, android.R.layout.simple_list_item_1, accounts);
|
||||||
|
@@ -63,9 +63,9 @@ import static app.fedilab.fedilabtube.viewmodel.TimelineVM.TimelineType.SEPIA_SE
|
|||||||
|
|
||||||
public class PeertubeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
|
public class PeertubeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
|
||||||
|
|
||||||
|
private final List<VideoData.Video> videos;
|
||||||
public RelationShipListener relationShipListener;
|
public RelationShipListener relationShipListener;
|
||||||
public PlaylistListener playlistListener;
|
public PlaylistListener playlistListener;
|
||||||
private List<VideoData.Video> videos;
|
|
||||||
private Context context;
|
private Context context;
|
||||||
private TimelineVM.TimelineType timelineType;
|
private TimelineVM.TimelineType timelineType;
|
||||||
private boolean sepiaSearch;
|
private boolean sepiaSearch;
|
||||||
@@ -78,7 +78,6 @@ public class PeertubeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolde
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public PeertubeAdapter(List<VideoData.Video> videos) {
|
public PeertubeAdapter(List<VideoData.Video> videos) {
|
||||||
this.videos = videos;
|
this.videos = videos;
|
||||||
}
|
}
|
||||||
@@ -180,15 +179,10 @@ public class PeertubeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolde
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (playlistListener == null || playlistListener.getPlaylist() == null || playlistListener.getPlaylist().size() == 0) {
|
popup.getMenu().findItem(R.id.action_playlist).setVisible(playlistListener != null && playlistListener.getPlaylist() != null && playlistListener.getPlaylist().size() != 0);
|
||||||
popup.getMenu().findItem(R.id.action_playlist).setVisible(false);
|
|
||||||
} else {
|
|
||||||
popup.getMenu().findItem(R.id.action_playlist).setVisible(true);
|
|
||||||
}
|
|
||||||
popup.setOnMenuItemClickListener(item -> {
|
popup.setOnMenuItemClickListener(item -> {
|
||||||
switch (item.getItemId()) {
|
int itemId = item.getItemId();
|
||||||
|
if (itemId == R.id.action_follow) {
|
||||||
case R.id.action_follow:
|
|
||||||
if (relationShipListener.getRelationShip().containsKey(video.getChannel().getAcct()) && relationShipListener.getRelationShip().get(video.getChannel().getAcct())) {
|
if (relationShipListener.getRelationShip().containsKey(video.getChannel().getAcct()) && relationShipListener.getRelationShip().get(video.getChannel().getAcct())) {
|
||||||
relationShipListener.getRelationShip().put(video.getChannel().getAcct(), false);
|
relationShipListener.getRelationShip().put(video.getChannel().getAcct(), false);
|
||||||
popup.getMenu().findItem(R.id.action_follow).setTitle(context.getString(R.string.action_follow));
|
popup.getMenu().findItem(R.id.action_follow).setTitle(context.getString(R.string.action_follow));
|
||||||
@@ -214,20 +208,17 @@ public class PeertubeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolde
|
|||||||
PostActionsVM viewModel = new ViewModelProvider((ViewModelStoreOwner) context).get(PostActionsVM.class);
|
PostActionsVM viewModel = new ViewModelProvider((ViewModelStoreOwner) context).get(PostActionsVM.class);
|
||||||
viewModel.post(FOLLOW, video.getChannel().getAcct(), null).observe((LifecycleOwner) context, apiResponse -> manageVIewPostActions(FOLLOW, apiResponse));
|
viewModel.post(FOLLOW, video.getChannel().getAcct(), null).observe((LifecycleOwner) context, apiResponse -> manageVIewPostActions(FOLLOW, apiResponse));
|
||||||
}
|
}
|
||||||
break;
|
} else if (itemId == R.id.action_playlist) {
|
||||||
case R.id.action_playlist:
|
|
||||||
PlaylistsVM viewModelOwnerPlaylist = new ViewModelProvider((ViewModelStoreOwner) context).get(PlaylistsVM.class);
|
PlaylistsVM viewModelOwnerPlaylist = new ViewModelProvider((ViewModelStoreOwner) context).get(PlaylistsVM.class);
|
||||||
viewModelOwnerPlaylist.manage(PlaylistsVM.action.GET_PLAYLISTS, null, null).observe((LifecycleOwner) context, apiResponse -> manageVIewPlaylists(video, apiResponse));
|
viewModelOwnerPlaylist.manage(PlaylistsVM.action.GET_PLAYLISTS, null, null).observe((LifecycleOwner) context, apiResponse -> manageVIewPlaylists(video, apiResponse));
|
||||||
break;
|
} else if (itemId == R.id.action_edit) {
|
||||||
case R.id.action_edit:
|
|
||||||
Intent intent = new Intent(context, PeertubeEditUploadActivity.class);
|
Intent intent = new Intent(context, PeertubeEditUploadActivity.class);
|
||||||
Bundle b = new Bundle();
|
Bundle b = new Bundle();
|
||||||
b.putString("video_id", video.getUuid());
|
b.putString("video_id", video.getUuid());
|
||||||
intent.putExtras(b);
|
intent.putExtras(b);
|
||||||
context.startActivity(intent);
|
context.startActivity(intent);
|
||||||
break;
|
} else if (itemId == R.id.action_report) {
|
||||||
case R.id.action_report:
|
AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(context);
|
||||||
androidx.appcompat.app.AlertDialog.Builder dialogBuilder = new androidx.appcompat.app.AlertDialog.Builder(context);
|
|
||||||
LayoutInflater inflater1 = ((Activity) context).getLayoutInflater();
|
LayoutInflater inflater1 = ((Activity) context).getLayoutInflater();
|
||||||
View dialogView = inflater1.inflate(R.layout.popup_report, new LinearLayout(context), false);
|
View dialogView = inflater1.inflate(R.layout.popup_report, new LinearLayout(context), false);
|
||||||
dialogBuilder.setView(dialogView);
|
dialogBuilder.setView(dialogView);
|
||||||
@@ -247,9 +238,8 @@ public class PeertubeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolde
|
|||||||
dialog2.dismiss();
|
dialog2.dismiss();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
androidx.appcompat.app.AlertDialog alertDialog2 = dialogBuilder.create();
|
AlertDialog alertDialog2 = dialogBuilder.create();
|
||||||
alertDialog2.show();
|
alertDialog2.show();
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
@@ -385,7 +375,6 @@ public class PeertubeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolde
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static class ViewHolder extends RecyclerView.ViewHolder {
|
static class ViewHolder extends RecyclerView.ViewHolder {
|
||||||
LinearLayout main_container, bottom_container;
|
LinearLayout main_container, bottom_container;
|
||||||
ImageView peertube_profile, peertube_video_image;
|
ImageView peertube_profile, peertube_video_image;
|
||||||
|
@@ -45,8 +45,8 @@ import app.fedilab.fedilabtube.helper.Helper;
|
|||||||
|
|
||||||
public class PeertubeNotificationsListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
|
public class PeertubeNotificationsListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
|
||||||
|
|
||||||
private Context context;
|
|
||||||
private final List<Notification> notifications;
|
private final List<Notification> notifications;
|
||||||
|
private Context context;
|
||||||
|
|
||||||
public PeertubeNotificationsListAdapter(List<Notification> notifications) {
|
public PeertubeNotificationsListAdapter(List<Notification> notifications) {
|
||||||
this.notifications = notifications;
|
this.notifications = notifications;
|
||||||
|
@@ -46,10 +46,10 @@ import app.fedilab.fedilabtube.viewmodel.PlaylistsVM;
|
|||||||
|
|
||||||
public class PlaylistAdapter extends BaseAdapter {
|
public class PlaylistAdapter extends BaseAdapter {
|
||||||
|
|
||||||
private List<Playlist> playlists;
|
private final List<Playlist> playlists;
|
||||||
private LayoutInflater layoutInflater;
|
private final LayoutInflater layoutInflater;
|
||||||
private Context context;
|
private final Context context;
|
||||||
private RelativeLayout textviewNoAction;
|
private final RelativeLayout textviewNoAction;
|
||||||
|
|
||||||
public PlaylistAdapter(Context context, List<Playlist> lists, RelativeLayout textviewNoAction) {
|
public PlaylistAdapter(Context context, List<Playlist> lists, RelativeLayout textviewNoAction) {
|
||||||
this.playlists = lists;
|
this.playlists = lists;
|
||||||
@@ -123,8 +123,8 @@ public class PlaylistAdapter extends BaseAdapter {
|
|||||||
popup.getMenuInflater()
|
popup.getMenuInflater()
|
||||||
.inflate(R.menu.playlist_menu, popup.getMenu());
|
.inflate(R.menu.playlist_menu, popup.getMenu());
|
||||||
popup.setOnMenuItemClickListener(item -> {
|
popup.setOnMenuItemClickListener(item -> {
|
||||||
switch (item.getItemId()) {
|
int itemId = item.getItemId();
|
||||||
case R.id.action_delete:
|
if (itemId == R.id.action_delete) {
|
||||||
AlertDialog.Builder builder = new AlertDialog.Builder(context);
|
AlertDialog.Builder builder = new AlertDialog.Builder(context);
|
||||||
builder.setTitle(context.getString(R.string.action_lists_delete) + ": " + playlist.getDisplayName());
|
builder.setTitle(context.getString(R.string.action_lists_delete) + ": " + playlist.getDisplayName());
|
||||||
builder.setMessage(context.getString(R.string.action_lists_confirm_delete));
|
builder.setMessage(context.getString(R.string.action_lists_confirm_delete));
|
||||||
@@ -141,12 +141,10 @@ public class PlaylistAdapter extends BaseAdapter {
|
|||||||
})
|
})
|
||||||
.setNegativeButton(R.string.no, (dialog, which) -> dialog.dismiss())
|
.setNegativeButton(R.string.no, (dialog, which) -> dialog.dismiss())
|
||||||
.show();
|
.show();
|
||||||
break;
|
} else if (itemId == R.id.action_edit) {
|
||||||
case R.id.action_edit:
|
|
||||||
if (context instanceof AllPlaylistsActivity) {
|
if (context instanceof AllPlaylistsActivity) {
|
||||||
((AllPlaylistsActivity) context).manageAlert(playlist);
|
((AllPlaylistsActivity) context).manageAlert(playlist);
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
|
@@ -38,7 +38,6 @@ 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;
|
||||||
|
|
||||||
|
@@ -370,11 +370,45 @@ public class DisplayOverviewFragment extends Fragment implements PeertubeAdapter
|
|||||||
viewModelFeeds.getOverviewVideos(String.valueOf(page)).observe(DisplayOverviewFragment.this.requireActivity(), this::manageVIewVideos);
|
viewModelFeeds.getOverviewVideos(String.valueOf(page)).observe(DisplayOverviewFragment.this.requireActivity(), this::manageVIewVideos);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void manageVIewPlaylist(APIResponse apiResponse) {
|
||||||
|
if (apiResponse.getError() != null || apiResponse.getVideoExistPlaylist() == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (playlists == null) {
|
||||||
|
playlists = new HashMap<>();
|
||||||
|
}
|
||||||
|
playlists.putAll(apiResponse.getVideoExistPlaylist());
|
||||||
|
for (VideoData.Video video : peertubes) {
|
||||||
|
video.setPlaylistExists(playlists.get(video.getId()));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void manageVIewRelationship(APIResponse apiResponse) {
|
||||||
|
if (apiResponse.getError() != null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (relationship == null) {
|
||||||
|
relationship = new HashMap<>();
|
||||||
|
}
|
||||||
|
relationship.putAll(apiResponse.getRelationships());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, Boolean> getRelationShip() {
|
||||||
|
return relationship;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, List<PlaylistExist>> getPlaylist() {
|
||||||
|
return playlists;
|
||||||
|
}
|
||||||
|
|
||||||
static class GridSpacingItemDecoration extends RecyclerView.ItemDecoration {
|
static class GridSpacingItemDecoration extends RecyclerView.ItemDecoration {
|
||||||
|
|
||||||
private int spanCount;
|
private final int spanCount;
|
||||||
private int spacing;
|
private final int spacing;
|
||||||
private boolean includeEdge;
|
private final boolean includeEdge;
|
||||||
|
|
||||||
public GridSpacingItemDecoration(int spanCount, int spacing, boolean includeEdge) {
|
public GridSpacingItemDecoration(int spanCount, int spacing, boolean includeEdge) {
|
||||||
this.spanCount = spanCount;
|
this.spanCount = spanCount;
|
||||||
@@ -405,40 +439,4 @@ public class DisplayOverviewFragment extends Fragment implements PeertubeAdapter
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void manageVIewPlaylist(APIResponse apiResponse) {
|
|
||||||
if (apiResponse.getError() != null || apiResponse.getVideoExistPlaylist() == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (playlists == null) {
|
|
||||||
playlists = new HashMap<>();
|
|
||||||
}
|
|
||||||
playlists.putAll(apiResponse.getVideoExistPlaylist());
|
|
||||||
for (VideoData.Video video : peertubes) {
|
|
||||||
video.setPlaylistExists(playlists.get(video.getId()));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public void manageVIewRelationship(APIResponse apiResponse) {
|
|
||||||
if (apiResponse.getError() != null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (relationship == null) {
|
|
||||||
relationship = new HashMap<>();
|
|
||||||
}
|
|
||||||
relationship.putAll(apiResponse.getRelationships());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Map<String, Boolean> getRelationShip() {
|
|
||||||
return relationship;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Map<String, List<PlaylistExist>> getPlaylist() {
|
|
||||||
return playlists;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -69,12 +69,11 @@ public class DisplaySepiaSearchFragment extends Fragment implements AccountsHori
|
|||||||
private View rootView;
|
private View rootView;
|
||||||
private RecyclerView lv_status;
|
private RecyclerView lv_status;
|
||||||
private SepiaSearchVM viewModelSearch;
|
private SepiaSearchVM viewModelSearch;
|
||||||
|
private SepiaSearch sepiaSearchVideo;
|
||||||
|
|
||||||
public DisplaySepiaSearchFragment() {
|
public DisplaySepiaSearchFragment() {
|
||||||
}
|
}
|
||||||
|
|
||||||
private SepiaSearch sepiaSearchVideo;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||||
rootView = inflater.inflate(R.layout.fragment_video, container, false);
|
rootView = inflater.inflate(R.layout.fragment_video, container, false);
|
||||||
@@ -119,7 +118,6 @@ public class DisplaySepiaSearchFragment extends Fragment implements AccountsHori
|
|||||||
swipeRefreshLayout.setOnRefreshListener(this::pullToRefresh);
|
swipeRefreshLayout.setOnRefreshListener(this::pullToRefresh);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
lv_status.addOnScrollListener(new RecyclerView.OnScrollListener() {
|
lv_status.addOnScrollListener(new RecyclerView.OnScrollListener() {
|
||||||
public void onScrolled(@NonNull RecyclerView recyclerView, int dx, int dy) {
|
public void onScrolled(@NonNull RecyclerView recyclerView, int dx, int dy) {
|
||||||
if (mLayoutManager != null) {
|
if (mLayoutManager != null) {
|
||||||
@@ -160,7 +158,6 @@ public class DisplaySepiaSearchFragment extends Fragment implements AccountsHori
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onPause() {
|
public void onPause() {
|
||||||
super.onPause();
|
super.onPause();
|
||||||
@@ -291,12 +288,11 @@ public class DisplaySepiaSearchFragment extends Fragment implements AccountsHori
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static class GridSpacingItemDecoration extends RecyclerView.ItemDecoration {
|
static class GridSpacingItemDecoration extends RecyclerView.ItemDecoration {
|
||||||
|
|
||||||
private int spanCount;
|
private final int spanCount;
|
||||||
private int spacing;
|
private final int spacing;
|
||||||
private boolean includeEdge;
|
private final boolean includeEdge;
|
||||||
|
|
||||||
public GridSpacingItemDecoration(int spanCount, int spacing, boolean includeEdge) {
|
public GridSpacingItemDecoration(int spanCount, int spacing, boolean includeEdge) {
|
||||||
this.spanCount = spanCount;
|
this.spanCount = spanCount;
|
||||||
|
@@ -99,6 +99,7 @@ public class DisplayVideosFragment extends Fragment implements AccountsHorizonta
|
|||||||
private String playlistId;
|
private String playlistId;
|
||||||
private String remoteInstance;
|
private String remoteInstance;
|
||||||
private boolean sepiaSearch;
|
private boolean sepiaSearch;
|
||||||
|
|
||||||
public DisplayVideosFragment() {
|
public DisplayVideosFragment() {
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -245,7 +246,6 @@ public class DisplayVideosFragment extends Fragment implements AccountsHorizonta
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onPause() {
|
public void onPause() {
|
||||||
super.onPause();
|
super.onPause();
|
||||||
|
@@ -13,7 +13,9 @@ package app.fedilab.fedilabtube.helper;
|
|||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License along with TubeLab; if not,
|
* You should have received a copy of the GNU General Public License along with TubeLab; if not,
|
||||||
* see <http://www.gnu.org/licenses>. */
|
* see <http://www.gnu.org/licenses>. */
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
|
||||||
import java.io.BufferedReader;
|
import java.io.BufferedReader;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStreamReader;
|
import java.io.InputStreamReader;
|
||||||
@@ -31,6 +33,7 @@ public class EmojiHelper {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Converts emojis in input to unicode
|
* Converts emojis in input to unicode
|
||||||
|
*
|
||||||
* @param input String
|
* @param input String
|
||||||
* @return String
|
* @return String
|
||||||
*/
|
*/
|
||||||
@@ -51,7 +54,6 @@ public class EmojiHelper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static void fillMapEmoji(Context context) {
|
public static void fillMapEmoji(Context context) {
|
||||||
try {
|
try {
|
||||||
BufferedReader br = new BufferedReader(new InputStreamReader(context.getAssets().open("emoji.csv")));
|
BufferedReader br = new BufferedReader(new InputStreamReader(context.getAssets().open("emoji.csv")));
|
||||||
@@ -71,7 +73,8 @@ public class EmojiHelper {
|
|||||||
emoji.put(str[0], unicode);
|
emoji.put(str[0], unicode);
|
||||||
}
|
}
|
||||||
br.close();
|
br.close();
|
||||||
} catch (IOException ignored) {ignored.printStackTrace();}
|
} catch (IOException ignored) {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -36,9 +36,9 @@ import app.fedilab.fedilabtube.client.data.VideoData.Video;
|
|||||||
*/
|
*/
|
||||||
public class FullScreenMediaController extends MediaController {
|
public class FullScreenMediaController extends MediaController {
|
||||||
|
|
||||||
|
private final Context context;
|
||||||
private ImageButton fullScreen;
|
private ImageButton fullScreen;
|
||||||
private Button resolution;
|
private Button resolution;
|
||||||
private final Context context;
|
|
||||||
private Video peertube;
|
private Video peertube;
|
||||||
private String resolutionVal;
|
private String resolutionVal;
|
||||||
|
|
||||||
|
@@ -256,6 +256,7 @@ public class Helper {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get a default instance host name depending of the device locale
|
* Get a default instance host name depending of the device locale
|
||||||
|
*
|
||||||
* @return peertube host String
|
* @return peertube host String
|
||||||
*/
|
*/
|
||||||
private static String getDefaultInstance() {
|
private static String getDefaultInstance() {
|
||||||
@@ -265,8 +266,7 @@ public class Helper {
|
|||||||
lang = lang.split("-")[0];
|
lang = lang.split("-")[0];
|
||||||
if (lang.split("-")[1].toLowerCase().contains("be")) {
|
if (lang.split("-")[1].toLowerCase().contains("be")) {
|
||||||
lang = "be";
|
lang = "be";
|
||||||
}
|
} else if (lang.split("-")[1].toLowerCase().contains("gb")) {
|
||||||
else if(lang.split("-")[1].toLowerCase().contains("gb")){
|
|
||||||
lang = "gb";
|
lang = "gb";
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -338,6 +338,7 @@ public class Helper {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Convert second to String formated date
|
* Convert second to String formated date
|
||||||
|
*
|
||||||
* @param pTime timestamp
|
* @param pTime timestamp
|
||||||
* @return String formatted value
|
* @return String formatted value
|
||||||
*/
|
*/
|
||||||
@@ -403,6 +404,7 @@ public class Helper {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Return rounded numbers depending of the value
|
* Return rounded numbers depending of the value
|
||||||
|
*
|
||||||
* @param count long
|
* @param count long
|
||||||
* @return String rounded value to be displayed
|
* @return String rounded value to be displayed
|
||||||
*/
|
*/
|
||||||
@@ -475,6 +477,7 @@ public class Helper {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize the webview
|
* Initialize the webview
|
||||||
|
*
|
||||||
* @param activity Current Activity
|
* @param activity Current Activity
|
||||||
* @param webviewId int id of the webview layout
|
* @param webviewId int id of the webview layout
|
||||||
* @param rootView View the root view
|
* @param rootView View the root view
|
||||||
|
@@ -33,8 +33,8 @@ import app.fedilab.fedilabtube.helper.Helper;
|
|||||||
@SuppressWarnings("UnusedReturnValue")
|
@SuppressWarnings("UnusedReturnValue")
|
||||||
public class AccountDAO {
|
public class AccountDAO {
|
||||||
|
|
||||||
public Context context;
|
|
||||||
private final SQLiteDatabase db;
|
private final SQLiteDatabase db;
|
||||||
|
public Context context;
|
||||||
|
|
||||||
|
|
||||||
public AccountDAO(Context context, SQLiteDatabase db) {
|
public AccountDAO(Context context, SQLiteDatabase db) {
|
||||||
|
@@ -22,6 +22,7 @@ import androidx.annotation.NonNull;
|
|||||||
import androidx.lifecycle.AndroidViewModel;
|
import androidx.lifecycle.AndroidViewModel;
|
||||||
import androidx.lifecycle.LiveData;
|
import androidx.lifecycle.LiveData;
|
||||||
import androidx.lifecycle.MutableLiveData;
|
import androidx.lifecycle.MutableLiveData;
|
||||||
|
|
||||||
import app.fedilab.fedilabtube.client.RetrofitSepiaSearchAPI;
|
import app.fedilab.fedilabtube.client.RetrofitSepiaSearchAPI;
|
||||||
import app.fedilab.fedilabtube.client.data.VideoData;
|
import app.fedilab.fedilabtube.client.data.VideoData;
|
||||||
import app.fedilab.fedilabtube.client.entities.SepiaSearch;
|
import app.fedilab.fedilabtube.client.entities.SepiaSearch;
|
||||||
|
@@ -69,13 +69,6 @@ public class TimelineVM extends AndroidViewModel {
|
|||||||
return apiResponseMutableLiveData;
|
return apiResponseMutableLiveData;
|
||||||
}
|
}
|
||||||
|
|
||||||
public LiveData<APIResponse> getVideosInChannel(String channelId, String max_id) {
|
|
||||||
apiResponseMutableLiveData = new MutableLiveData<>();
|
|
||||||
loadVideosForChannel(null, channelId, max_id);
|
|
||||||
return apiResponseMutableLiveData;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public LiveData<APIResponse> getVideosInChannel(String instance, String channelId, String max_id) {
|
public LiveData<APIResponse> getVideosInChannel(String instance, String channelId, String max_id) {
|
||||||
apiResponseMutableLiveData = new MutableLiveData<>();
|
apiResponseMutableLiveData = new MutableLiveData<>();
|
||||||
loadVideosForChannel(instance, channelId, max_id);
|
loadVideosForChannel(instance, channelId, max_id);
|
||||||
|
@@ -42,12 +42,12 @@ public class MastalabWebChromeClient extends WebChromeClient implements MediaPla
|
|||||||
|
|
||||||
private ToggledFullscreenCallback toggledFullscreenCallback;
|
private ToggledFullscreenCallback toggledFullscreenCallback;
|
||||||
|
|
||||||
private CustomWebview webView;
|
private final CustomWebview webView;
|
||||||
private View activityNonVideoView;
|
private final View activityNonVideoView;
|
||||||
private ViewGroup activityVideoView;
|
private final ViewGroup activityVideoView;
|
||||||
private ProgressBar pbar;
|
private final ProgressBar pbar;
|
||||||
private boolean isVideoFullscreen;
|
private boolean isVideoFullscreen;
|
||||||
private Activity activity;
|
private final Activity activity;
|
||||||
|
|
||||||
|
|
||||||
public MastalabWebChromeClient(Activity activity, CustomWebview webView, FrameLayout activityNonVideoView, ViewGroup activityVideoView) {
|
public MastalabWebChromeClient(Activity activity, CustomWebview webView, FrameLayout activityNonVideoView, ViewGroup activityVideoView) {
|
||||||
|
@@ -32,7 +32,7 @@ import app.fedilab.fedilabtube.R;
|
|||||||
|
|
||||||
public class MastalabWebViewClient extends WebViewClient {
|
public class MastalabWebViewClient extends WebViewClient {
|
||||||
|
|
||||||
private Activity activity;
|
private final Activity activity;
|
||||||
|
|
||||||
|
|
||||||
public MastalabWebViewClient(Activity activity) {
|
public MastalabWebViewClient(Activity activity) {
|
||||||
|
@@ -16,6 +16,11 @@
|
|||||||
android:icon="@drawable/ic_baseline_subtitles_24"
|
android:icon="@drawable/ic_baseline_subtitles_24"
|
||||||
android:title="@string/captions"
|
android:title="@string/captions"
|
||||||
app:showAsAction="ifRoom" />
|
app:showAsAction="ifRoom" />
|
||||||
|
<item
|
||||||
|
android:id="@+id/action_edit"
|
||||||
|
android:icon="@drawable/ic_baseline_edit_24"
|
||||||
|
android:title="@string/edit"
|
||||||
|
app:showAsAction="ifRoom" />
|
||||||
<item
|
<item
|
||||||
android:id="@+id/action_report"
|
android:id="@+id/action_report"
|
||||||
android:icon="@drawable/ic_baseline_report_24"
|
android:icon="@drawable/ic_baseline_report_24"
|
||||||
|
Reference in New Issue
Block a user