Some changes

This commit is contained in:
Thomas 2023-01-23 09:31:32 +01:00
parent 66161f4eb3
commit 74afdc0a7a
91 changed files with 838 additions and 608 deletions

View file

@ -1,15 +1,15 @@
package app.fedilab.android;
import static org.junit.Assert.assertEquals;
import android.content.Context;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.platform.app.InstrumentationRegistry;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*

View file

@ -0,0 +1,207 @@
package app.fedilab.android.activities;
/* Copyright 2021 Thomas Schneider
*
* This file is a part of TubeLab
*
* This program is free software; you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation; either version 3 of the
* License, or (at your option) any later version.
*
* TubeLab is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
* Public License for more details.
*
* You should have received a copy of the GNU General Public License along with TubeLab; if not,
* see <http://www.gnu.org/licenses>. */
import static app.fedilab.android.peertube.helper.Helper.CAST_ID;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.webkit.MimeTypeMap;
import androidx.appcompat.app.AlertDialog;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import com.google.android.exoplayer2.SimpleExoPlayer;
import org.jetbrains.annotations.NotNull;
import java.io.IOException;
import java.security.GeneralSecurityException;
import app.fedilab.android.R;
import app.fedilab.android.databinding.ActivityPeertubeBinding;
import app.fedilab.android.mastodon.activities.BaseBarActivity;
import app.fedilab.android.peertube.client.data.VideoData;
import app.fedilab.android.peertube.helper.Helper;
import su.litvak.chromecast.api.v2.ChromeCast;
import su.litvak.chromecast.api.v2.MediaStatus;
import su.litvak.chromecast.api.v2.Status;
public class BasePeertubeActivity extends BaseBarActivity {
protected ActivityPeertubeBinding binding;
protected VideoData.Video peertube;
protected SimpleExoPlayer player;
protected String videoURL;
protected String subtitlesStr;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
binding = ActivityPeertubeBinding.inflate(getLayoutInflater());
View view = binding.getRoot();
setContentView(view);
binding.minController.castPlay.setOnClickListener(v -> {
binding.minController.castLoader.setVisibility(View.VISIBLE);
if (PeertubeBaseMainActivity.chromeCast != null) {
new Thread(() -> {
try {
int icon = -1;
if (PeertubeBaseMainActivity.chromeCast.getMediaStatus().playerState == MediaStatus.PlayerState.PLAYING) {
PeertubeBaseMainActivity.chromeCast.pause();
icon = R.drawable.ic_baseline_play_arrow_32;
} else if (PeertubeBaseMainActivity.chromeCast.getMediaStatus().playerState == MediaStatus.PlayerState.PAUSED) {
PeertubeBaseMainActivity.chromeCast.play();
icon = R.drawable.ic_baseline_pause_32;
}
if (icon != -1) {
Handler mainHandler = new Handler(Looper.getMainLooper());
int finalIcon = icon;
Runnable myRunnable = () -> binding.minController.castPlay.setImageResource(finalIcon);
mainHandler.post(myRunnable);
}
Handler mainHandler = new Handler(Looper.getMainLooper());
Runnable myRunnable = () -> binding.minController.castLoader.setVisibility(View.GONE);
mainHandler.post(myRunnable);
} catch (IOException e) {
e.printStackTrace();
}
}).start();
}
});
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
if (item.getItemId() == R.id.action_cast) {
if (PeertubeBaseMainActivity.chromeCasts != null && PeertubeBaseMainActivity.chromeCasts.size() > 0) {
String[] chromecast_choice = new String[PeertubeBaseMainActivity.chromeCasts.size()];
AlertDialog.Builder alt_bld = new AlertDialog.Builder(this);
alt_bld.setTitle(R.string.chromecast_choice);
int i = 0;
for (ChromeCast cc : PeertubeBaseMainActivity.chromeCasts) {
chromecast_choice[i] = cc.getTitle();
i++;
}
i = 0;
for (ChromeCast cc : PeertubeBaseMainActivity.chromeCasts) {
if (PeertubeBaseMainActivity.chromecastActivated && cc.isConnected()) {
break;
}
i++;
}
alt_bld.setSingleChoiceItems(chromecast_choice, i, (dialog, position) -> {
PeertubeBaseMainActivity.chromeCast = PeertubeBaseMainActivity.chromeCasts.get(position);
new Thread(() -> {
if (PeertubeBaseMainActivity.chromeCast != null) {
Intent intentBC = new Intent(Helper.RECEIVE_CAST_SETTINGS);
Bundle b = new Bundle();
if (PeertubeBaseMainActivity.chromecastActivated) {
b.putInt("displayed", 0);
intentBC.putExtras(b);
LocalBroadcastManager.getInstance(BasePeertubeActivity.this).sendBroadcast(intentBC);
Handler mainHandler = new Handler(Looper.getMainLooper());
Runnable myRunnable = () -> {
binding.doubleTapPlayerView.setVisibility(View.VISIBLE);
binding.minController.castMiniController.setVisibility(View.GONE);
};
mainHandler.post(myRunnable);
} else {
b.putInt("displayed", 1);
b.putParcelable("castedTube", peertube);
intentBC.putExtras(b);
LocalBroadcastManager.getInstance(BasePeertubeActivity.this).sendBroadcast(intentBC);
try {
Handler mainHandler = new Handler(Looper.getMainLooper());
Runnable myRunnable = () -> {
invalidateOptionsMenu();
binding.minController.castLoader.setVisibility(View.VISIBLE);
player.setPlayWhenReady(false);
binding.doubleTapPlayerView.setVisibility(View.GONE);
binding.minController.castMiniController.setVisibility(View.VISIBLE);
dialog.dismiss();
if (videoURL != null) {
if (player != null && player.getCurrentPosition() > 0) {
videoURL += "?start=" + (player.getCurrentPosition() / 1000);
}
}
};
mainHandler.post(myRunnable);
if (!PeertubeBaseMainActivity.chromeCast.isConnected()) {
PeertubeBaseMainActivity.chromeCast.connect();
}
myRunnable = this::invalidateOptionsMenu;
mainHandler.post(myRunnable);
Status status = PeertubeBaseMainActivity.chromeCast.getStatus();
if (PeertubeBaseMainActivity.chromeCast.isAppAvailable(CAST_ID) && !status.isAppRunning(CAST_ID)) {
PeertubeBaseMainActivity.chromeCast.launchApp(CAST_ID);
}
if (videoURL != null) {
String mime = MimeTypeMap.getFileExtensionFromUrl(videoURL);
PeertubeBaseMainActivity.chromeCast.setRequestTimeout(60000);
PeertubeBaseMainActivity.chromeCast.load(peertube.getTitle(), null, videoURL, mime);
PeertubeBaseMainActivity.chromeCast.play();
binding.minController.castPlay.setImageResource(R.drawable.ic_baseline_pause_32);
}
myRunnable = () -> binding.minController.castLoader.setVisibility(View.GONE);
mainHandler.post(myRunnable);
} catch (IOException | GeneralSecurityException e) {
e.printStackTrace();
}
}
Handler mainHandler = new Handler(Looper.getMainLooper());
Runnable myRunnable = () -> {
invalidateOptionsMenu();
dialog.dismiss();
};
mainHandler.post(myRunnable);
}
}).start();
});
alt_bld.setPositiveButton(R.string.close, (dialog, id) -> dialog.dismiss());
AlertDialog alert = alt_bld.create();
alert.show();
}
}
return super.onOptionsItemSelected(item);
}
@Override
public boolean onCreateOptionsMenu(@NotNull Menu menu) {
getMenuInflater().inflate(R.menu.video_menu, menu);
MenuItem castItem = menu.findItem(R.id.action_cast);
if (PeertubeBaseMainActivity.chromeCasts != null && PeertubeBaseMainActivity.chromeCasts.size() > 0) {
castItem.setVisible(true);
if (PeertubeBaseMainActivity.chromeCast != null && PeertubeBaseMainActivity.chromeCast.isConnected()) {
castItem.setIcon(R.drawable.ic_baseline_cast_connected_24);
} else {
castItem.setIcon(R.drawable.ic_baseline_cast_24);
}
}
return true;
}
}

View file

@ -0,0 +1,262 @@
package app.fedilab.android.activities;
/* Copyright 2021 Thomas Schneider
*
* This file is a part of TubeLab
*
* This program is free software; you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation; either version 3 of the
* License, or (at your option) any later version.
*
* TubeLab is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
* Public License for more details.
*
* You should have received a copy of the GNU General Public License along with TubeLab; if not,
* see <http://www.gnu.org/licenses>. */
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.view.View;
import androidx.appcompat.app.AppCompatActivity;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import java.io.IOException;
import java.net.InetAddress;
import java.net.NetworkInterface;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Enumeration;
import java.util.List;
import app.fedilab.android.R;
import app.fedilab.android.databinding.ActivityMainPeertubeBinding;
import app.fedilab.android.peertube.client.data.VideoData;
import app.fedilab.android.peertube.helper.Helper;
import su.litvak.chromecast.api.v2.ChromeCast;
import su.litvak.chromecast.api.v2.ChromeCasts;
import su.litvak.chromecast.api.v2.ChromeCastsListener;
import su.litvak.chromecast.api.v2.MediaStatus;
public abstract class PeertubeBaseMainActivity extends AppCompatActivity implements ChromeCastsListener {
public static List<ChromeCast> chromeCasts;
public static ChromeCast chromeCast;
public static boolean chromecastActivated = false;
protected ActivityMainPeertubeBinding binding;
private BroadcastReceiver manage_chromecast;
private VideoData.Video castedTube;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
binding = ActivityMainPeertubeBinding.inflate(getLayoutInflater());
View view = binding.getRoot();
setContentView(view);
ChromeCastsListener chromeCastsListener = this;
ChromeCasts.registerListener(chromeCastsListener);
binding.castClose.setOnClickListener(v -> {
Intent intentBC = new Intent(Helper.RECEIVE_CAST_SETTINGS);
Bundle b = new Bundle();
b.putInt("displayed", 0);
intentBC.putExtras(b);
LocalBroadcastManager.getInstance(PeertubeBaseMainActivity.this).sendBroadcast(intentBC);
});
binding.castTogglePlay.setOnClickListener(v -> {
if (chromeCast != null) {
new Thread(() -> {
try {
Handler mainHandler = new Handler(Looper.getMainLooper());
Runnable myRunnable = () -> binding.castTogglePlay.setVisibility(View.GONE);
mainHandler.post(myRunnable);
int icon = -1;
if (chromeCast.getMediaStatus().playerState == MediaStatus.PlayerState.PLAYING) {
chromeCast.pause();
icon = R.drawable.ic_baseline_play_arrow_32;
} else if (chromeCast.getMediaStatus().playerState == MediaStatus.PlayerState.PAUSED) {
chromeCast.play();
icon = R.drawable.ic_baseline_pause_32;
}
if (icon != -1) {
int finalIcon = icon;
myRunnable = () -> binding.castTogglePlay.setImageResource(finalIcon);
mainHandler.post(myRunnable);
}
myRunnable = () -> binding.castTogglePlay.setVisibility(View.VISIBLE);
mainHandler.post(myRunnable);
} catch (IOException e) {
e.printStackTrace();
}
}).start();
}
});
manage_chromecast = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
Bundle b = intent.getExtras();
assert b != null;
int state = b.getInt("state_asked", -1);
int displayed = b.getInt("displayed", -1);
castedTube = b.getParcelable("castedTube");
if (state == 1) {
discoverCast();
} else if (state == 0) {
new Thread(() -> {
try {
if (chromeCast != null) {
chromeCast.stopApp();
chromeCast.disconnect();
}
} catch (IOException e) {
e.printStackTrace();
}
}).start();
}
if (displayed == 1) {
chromecastActivated = true;
if (castedTube != null) {
binding.castInfo.setVisibility(View.VISIBLE);
Helper.loadGiF(PeertubeBaseMainActivity.this, castedTube.getThumbnailPath(), binding.castView);
binding.castTitle.setText(castedTube.getTitle());
binding.castDescription.setText(castedTube.getDescription());
}
} else if (displayed == 0) {
chromecastActivated = false;
binding.castInfo.setVisibility(View.GONE);
new Thread(() -> {
try {
if (chromeCast != null) {
chromeCast.stopApp();
}
} catch (IOException e) {
e.printStackTrace();
}
}).start();
}
}
};
LocalBroadcastManager.getInstance(PeertubeBaseMainActivity.this).registerReceiver(manage_chromecast, new IntentFilter(Helper.RECEIVE_CAST_SETTINGS));
}
@Override
public void newChromeCastDiscovered(ChromeCast chromeCast) {
if (chromeCasts == null) {
chromeCasts = new ArrayList<>();
chromeCasts.add(chromeCast);
} else {
boolean canBeAdded = true;
for (ChromeCast cast : chromeCasts) {
if (cast.getName().compareTo(chromeCast.getName()) == 0) {
canBeAdded = false;
break;
}
}
if (canBeAdded) {
chromeCasts.add(chromeCast);
}
}
try {
if (chromeCast.isAppRunning(Helper.CAST_ID) && chromeCast.getMediaStatus() != null && chromeCast.getMediaStatus().playerState != null) {
if (binding.castInfo.getVisibility() == View.GONE) {
binding.castInfo.setVisibility(View.VISIBLE);
}
}
} catch (IOException e) {
e.printStackTrace();
}
}
@Override
public void chromeCastRemoved(ChromeCast chromeCast) {
}
@Override
public void onDestroy() {
super.onDestroy();
ChromeCasts.unregisterListener(this);
if (manage_chromecast != null) {
LocalBroadcastManager.getInstance(PeertubeBaseMainActivity.this).unregisterReceiver(manage_chromecast);
new Thread(() -> {
if (chromeCasts != null && chromeCasts.size() > 0) {
for (ChromeCast cast : chromeCasts) {
try {
cast.stopApp();
cast.disconnect();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}).start();
}
if (chromeCasts != null) {
chromeCasts = null;
}
if (chromeCast != null) {
chromeCast = null;
}
}
//Method for discovering cast devices
public void discoverCast() {
new Thread(() -> {
if (chromeCasts != null) {
for (ChromeCast cast : chromeCasts) {
try {
cast.disconnect();
} catch (IOException e) {
e.printStackTrace();
}
}
chromeCasts = null;
}
chromeCasts = new ArrayList<>();
try {
List<NetworkInterface> interfaces;
interfaces = Collections.list(NetworkInterface.getNetworkInterfaces());
for (NetworkInterface ni : interfaces) {
if ((!ni.isLoopback()) && ni.isUp() && (ni.getName().equals("wlan0"))) {
Enumeration<InetAddress> inetAddressEnumeration = ni.getInetAddresses();
while (inetAddressEnumeration.hasMoreElements()) {
InetAddress inetAddress = inetAddressEnumeration.nextElement();
ChromeCasts.restartDiscovery(inetAddress);
int tryFind = 0;
while (ChromeCasts.get().isEmpty() && tryFind < 5) {
try {
//noinspection BusyWait
Thread.sleep(1000);
tryFind++;
} catch (InterruptedException ignored) {
}
}
}
}
}
ChromeCasts.stopDiscovery();
Handler mainHandler = new Handler(Looper.getMainLooper());
Runnable myRunnable = this::invalidateOptionsMenu;
mainHandler.post(myRunnable);
} catch (IOException e) {
e.printStackTrace();
}
}).start();
}
}

View file

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:id="@+id/action_cast"
android:icon="@drawable/ic_baseline_cast_24"
android:title="@string/cast"
android:visible="false"
app:showAsAction="always" />
</menu>

View file

@ -28,9 +28,9 @@
android:icon="@mipmap/ic_launcher_bubbles"
android:label="@string/app_name"
android:largeHeap="true"
android:requestLegacyExternalStorage="true"
android:roundIcon="@mipmap/ic_launcher_bubbles_round"
android:supportsRtl="true"
android:requestLegacyExternalStorage="true"
android:theme="@style/AppTheme"
android:usesCleartextTraffic="true"
tools:replace="android:allowBackup">

View file

@ -23,6 +23,7 @@ import static app.fedilab.android.peertube.client.RetrofitPeertubeAPI.ActionType
import static app.fedilab.android.peertube.helper.Helper.canMakeAction;
import static app.fedilab.android.peertube.helper.Helper.getAttColor;
import static app.fedilab.android.peertube.helper.Helper.isLoggedIn;
import static app.fedilab.android.peertube.helper.Helper.loadAvatar;
import static app.fedilab.android.peertube.helper.Helper.peertubeInformation;
import android.Manifest;
@ -120,12 +121,9 @@ import java.util.Objects;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import app.fedilab.android.activities.MainActivity;
import app.fedilab.android.R;
import app.fedilab.android.activities.BasePeertubeActivity;
import app.fedilab.android.databinding.ActivityPeertubeBinding;
import app.fedilab.android.mastodon.activities.BaseBarActivity;
import app.fedilab.android.peertube.BuildConfig;
import app.fedilab.android.peertube.Matomo;
import app.fedilab.android.peertube.R;
import app.fedilab.android.peertube.client.APIResponse;
import app.fedilab.android.peertube.client.MenuItemVideo;
import app.fedilab.android.peertube.client.RetrofitPeertubeAPI;
@ -137,12 +135,12 @@ import app.fedilab.android.peertube.client.data.InstanceData;
import app.fedilab.android.peertube.client.data.PlaylistData;
import app.fedilab.android.peertube.client.data.PluginData;
import app.fedilab.android.peertube.client.data.VideoData;
import app.fedilab.android.peertube.client.entities.Error;
import app.fedilab.android.peertube.client.entities.File;
import app.fedilab.android.peertube.client.entities.MenuItemView;
import app.fedilab.android.peertube.client.entities.PlaylistExist;
import app.fedilab.android.peertube.client.entities.Report;
import app.fedilab.android.peertube.client.entities.UserSettings;
import app.fedilab.android.peertube.client.mastodon.RetrofitMastodonAPI;
import app.fedilab.android.peertube.drawer.CommentListAdapter;
import app.fedilab.android.peertube.drawer.MenuAdapter;
import app.fedilab.android.peertube.drawer.MenuItemAdapter;
@ -164,7 +162,7 @@ import app.fedilab.android.peertube.webview.MastalabWebViewClient;
import es.dmoral.toasty.Toasty;
public class PeertubeActivity extends BaseBarActivity implements CommentListAdapter.AllCommentRemoved, Player.EventListener, VideoListener, MenuAdapter.ItemClicked, MenuItemAdapter.ItemAction {
public class PeertubeActivity extends BasePeertubeActivity implements CommentListAdapter.AllCommentRemoved, Player.EventListener, VideoListener, MenuAdapter.ItemClicked, MenuItemAdapter.ItemAction {
public static String video_id;
public static List<String> playedVideos = new ArrayList<>();
@ -197,7 +195,6 @@ public class PeertubeActivity extends BaseBarActivity implements CommentListAdap
private String currentCaption;
private boolean isRemote;
private boolean willPlayFromIntent;
private app.fedilab.android.peertube.client.mastodon.Status status;
public static void hideKeyboard(Activity activity) {
if (activity != null && activity.getWindow() != null) {
@ -228,7 +225,7 @@ public class PeertubeActivity extends BaseBarActivity implements CommentListAdap
String token = sharedpreferences.getString(Helper.PREF_KEY_OAUTH_TOKEN, null);
if (Helper.canMakeAction(PeertubeActivity.this) && !sepiaSearch) {
Account account = new AccountDAO(PeertubeActivity.this, db).getAccountByToken(token);
Helper.loadAvatar(PeertubeActivity.this, account, binding.myPp);
loadAvatar(PeertubeActivity.this, account, binding.myPp);
}
isRemote = false;
@ -273,7 +270,7 @@ public class PeertubeActivity extends BaseBarActivity implements CommentListAdap
willPlayFromIntent = manageIntentUrl(intent);
if (BuildConfig.allow_remote_connections && Helper.isLoggedInType(PeertubeActivity.this) == MainActivity.TypeOfConnection.REMOTE_ACCOUNT) {
if (Helper.isLoggedInType(PeertubeActivity.this) == PeertubeMainActivity.TypeOfConnection.REMOTE_ACCOUNT) {
binding.peertubeLikeCount.setVisibility(View.GONE);
binding.peertubeDislikeCount.setVisibility(View.GONE);
binding.peertubePlaylist.setVisibility(View.GONE);
@ -329,7 +326,6 @@ public class PeertubeActivity extends BaseBarActivity implements CommentListAdap
binding.webviewVideo.getSettings().setAllowFileAccess(true);
binding.webviewVideo.setWebChromeClient(mastalabWebChromeClient);
binding.webviewVideo.getSettings().setDomStorageEnabled(true);
binding.webviewVideo.getSettings().setAppCacheEnabled(true);
binding.webviewVideo.getSettings().setMediaPlaybackRequiresUserGesture(false);
binding.webviewVideo.setWebViewClient(new MastalabWebViewClient(PeertubeActivity.this));
binding.webviewVideo.loadUrl("https://" + peertubeInstance + "/videos/embed/" + videoUuid);
@ -689,7 +685,7 @@ public class PeertubeActivity extends BaseBarActivity implements CommentListAdap
private void reportAlert(RetrofitPeertubeAPI.ActionType type, AlertDialog alertDialog) {
AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(PeertubeActivity.this);
LayoutInflater inflater1 = getLayoutInflater();
View dialogView = inflater1.inflate(R.layout.popup_report, new LinearLayout(PeertubeActivity.this), false);
View dialogView = inflater1.inflate(R.layout.popup_report_peertube, new LinearLayout(PeertubeActivity.this), false);
dialogBuilder.setView(dialogView);
dialogBuilder.setNeutralButton(R.string.cancel, (dialog, id) -> dialog.dismiss());
EditText report_content = dialogView.findViewById(R.id.report_content);
@ -991,35 +987,6 @@ public class PeertubeActivity extends BaseBarActivity implements CommentListAdap
changeColor();
initResolution();
binding.peertubeReblog.setOnClickListener(v -> {
if (status != null) {
MastodonPostActionsVM mastodonPostActionsVM = new ViewModelProvider(PeertubeActivity.this).get(MastodonPostActionsVM.class);
RetrofitMastodonAPI.actionType type = status.isReblogged() ? RetrofitMastodonAPI.actionType.UNBOOST : RetrofitMastodonAPI.actionType.BOOST;
mastodonPostActionsVM.post(type, status).observe(PeertubeActivity.this, this::manageVIewPostActionsMastodon);
} else {
Toasty.error(PeertubeActivity.this, getString(R.string.federation_issue), Toasty.LENGTH_LONG).show();
}
});
binding.peertubeFavorite.setOnClickListener(v -> {
if (status != null) {
MastodonPostActionsVM mastodonPostActionsVM = new ViewModelProvider(PeertubeActivity.this).get(MastodonPostActionsVM.class);
RetrofitMastodonAPI.actionType type = status.isFavourited() ? RetrofitMastodonAPI.actionType.UNFAVOURITE : RetrofitMastodonAPI.actionType.FAVOURITE;
mastodonPostActionsVM.post(type, status).observe(PeertubeActivity.this, this::manageVIewPostActionsMastodon);
} else {
Toasty.error(PeertubeActivity.this, getString(R.string.federation_issue), Toasty.LENGTH_LONG).show();
}
});
binding.peertubeBookmark.setOnClickListener(v -> {
if (status != null) {
MastodonPostActionsVM mastodonPostActionsVM = new ViewModelProvider(PeertubeActivity.this).get(MastodonPostActionsVM.class);
RetrofitMastodonAPI.actionType type = status.isBookmarked() ? RetrofitMastodonAPI.actionType.UNBOOKMARK : RetrofitMastodonAPI.actionType.BOOKMARK;
mastodonPostActionsVM.post(type, status).observe(PeertubeActivity.this, this::manageVIewPostActionsMastodon);
} else {
Toasty.error(PeertubeActivity.this, getString(R.string.federation_issue), Toasty.LENGTH_LONG).show();
}
});
binding.peertubeLikeCount.setOnClickListener(v -> {
if (isLoggedIn(PeertubeActivity.this) && !sepiaSearch) {
@ -1072,11 +1039,6 @@ public class PeertubeActivity extends BaseBarActivity implements CommentListAdap
}
});
if (BuildConfig.allow_remote_connections && Helper.isLoggedInType(PeertubeActivity.this) == MainActivity.TypeOfConnection.REMOTE_ACCOUNT) {
String url = "https://" + peertube.getChannel().getHost() + "/videos/watch/" + peertube.getUuid();
MastodonPostActionsVM postActionsVM = new ViewModelProvider(PeertubeActivity.this).get(MastodonPostActionsVM.class);
postActionsVM.searchRemoteStatus(url).observe(PeertubeActivity.this, this::retrieveRemoteStatus);
}
if (mode != Helper.VIDEO_MODE_WEBVIEW) {
@ -1101,7 +1063,7 @@ public class PeertubeActivity extends BaseBarActivity implements CommentListAdap
binding.moreActions.setOnClickListener(view -> {
PopupMenu popup = new PopupMenu(PeertubeActivity.this, binding.moreActions);
popup.getMenuInflater()
.inflate(R.menu.main_video, popup.getMenu());
.inflate(R.menu.main_video_peertube, popup.getMenu());
if (!isMyVideo) {
popup.getMenu().findItem(R.id.action_edit).setVisible(false);
@ -1883,7 +1845,7 @@ public class PeertubeActivity extends BaseBarActivity implements CommentListAdap
if (comment != null) {
binding.replyContent.setVisibility(View.VISIBLE);
Account account = comment.getAccount();
Helper.loadAvatar(PeertubeActivity.this, account, binding.commentAccountProfile);
loadAvatar(PeertubeActivity.this, account, binding.commentAccountProfile);
binding.commentAccountDisplayname.setText(account.getDisplayName());
binding.commentAccountUsername.setText(account.getAcct());
Spanned commentSpan;
@ -1967,16 +1929,6 @@ public class PeertubeActivity extends BaseBarActivity implements CommentListAdap
binding.postComment.startAnimation(animateComment);
}
public void manageVIewPostActionsMastodon(app.fedilab.android.peertube.client.mastodon.Status status) {
if (status != null) {
this.status = status;
changeColorMastodon();
binding.peertubeFavorite.setText(String.valueOf(status.getFavouriteCount()));
binding.peertubeReblog.setText(String.valueOf(status.getReblogsCount()));
} else {
Toasty.error(PeertubeActivity.this, getString(R.string.toast_error), Toasty.LENGTH_LONG).show();
}
}
public void manageVIewPostActionsMastodon(RetrofitPeertubeAPI.ActionType statusAction, int position, app.fedilab.android.peertube.client.mastodon.Status status) {
if (peertube.isCommentsEnabled() && statusAction == ADD_COMMENT) {
@ -2089,39 +2041,6 @@ public class PeertubeActivity extends BaseBarActivity implements CommentListAdap
Drawable favorite = ContextCompat.getDrawable(PeertubeActivity.this, R.drawable.ic_baseline_star_24);
Drawable bookmark = ContextCompat.getDrawable(PeertubeActivity.this, R.drawable.ic_baseline_bookmark_24);
int color = getAttColor(this, android.R.attr.colorControlNormal);
if (reblog != null) {
reblog.setColorFilter(color, PorterDuff.Mode.SRC_ATOP);
DrawableCompat.setTint(reblog, color);
}
if (favorite != null) {
favorite.setColorFilter(color, PorterDuff.Mode.SRC_ATOP);
DrawableCompat.setTint(favorite, color);
}
if (bookmark != null) {
bookmark.setColorFilter(color, PorterDuff.Mode.SRC_ATOP);
DrawableCompat.setTint(bookmark, color);
}
if (reblog != null && status.isReblogged()) {
reblog.setColorFilter(getResources().getColor(R.color.positive_thumbs), PorterDuff.Mode.SRC_ATOP);
DrawableCompat.setTint(reblog, getResources().getColor(R.color.positive_thumbs));
}
if (favorite != null && status.isFavourited()) {
favorite.setColorFilter(getResources().getColor(R.color.favorite), PorterDuff.Mode.SRC_ATOP);
DrawableCompat.setTint(favorite, getResources().getColor(R.color.favorite));
}
if (bookmark != null && status.isBookmarked()) {
bookmark.setColorFilter(getResources().getColor(R.color.bookmark), PorterDuff.Mode.SRC_ATOP);
DrawableCompat.setTint(bookmark, getResources().getColor(R.color.bookmark));
}
binding.peertubeReblog.setCompoundDrawablesWithIntrinsicBounds(null, reblog, null, null);
binding.peertubeFavorite.setCompoundDrawablesWithIntrinsicBounds(null, favorite, null, null);
binding.peertubeBookmark.setCompoundDrawablesWithIntrinsicBounds(null, bookmark, null, null);
}
private void changeColor() {

View file

@ -59,12 +59,13 @@ import java.util.regex.Pattern;
import app.fedilab.android.R;
import app.fedilab.android.activities.AboutActivity;
import app.fedilab.android.activities.PeertubeBaseMainActivity;
import app.fedilab.android.databinding.ActivityMainPeertubeBinding;
import app.fedilab.android.mastodon.activities.BaseActivity;
import app.fedilab.android.peertube.client.RetrofitPeertubeAPI;
import app.fedilab.android.peertube.client.data.AccountData.Account;
import app.fedilab.android.peertube.client.data.InstanceData;
import app.fedilab.android.peertube.client.entities.AcadInstances;
import app.fedilab.android.peertube.client.entities.Error;
import app.fedilab.android.peertube.client.entities.OauthParams;
import app.fedilab.android.peertube.client.entities.PeertubeInformation;
import app.fedilab.android.peertube.client.entities.Token;
@ -85,7 +86,7 @@ import app.fedilab.android.peertube.viewmodel.TimelineVM;
import es.dmoral.toasty.Toasty;
public abstract class PeertubeMainActivity extends BaseActivity {
public abstract class PeertubeMainActivity extends PeertubeBaseMainActivity {
public static int PICK_INSTANCE = 5641;
@ -205,6 +206,7 @@ public abstract class PeertubeMainActivity extends BaseActivity {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
binding = super.binding;
Toolbar toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
@ -313,7 +315,10 @@ public abstract class PeertubeMainActivity extends BaseActivity {
final SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
int search_cast = sharedpreferences.getInt(getString(R.string.set_cast_choice), 0);
if (search_cast == 1) {
super.discoverCast();
}
//Instance
if (HelperInstance.getLiveInstance(PeertubeMainActivity.this) == null) {

View file

@ -46,9 +46,8 @@ import java.util.Map;
import java.util.Set;
import java.util.concurrent.TimeUnit;
import app.fedilab.android.peertube.BuildConfig;
import app.fedilab.android.peertube.R;
import app.fedilab.android.peertube.activities.MainActivity;
import app.fedilab.android.R;
import app.fedilab.android.peertube.activities.PeertubeMainActivity;
import app.fedilab.android.peertube.client.data.AccountData;
import app.fedilab.android.peertube.client.data.BlockData;
import app.fedilab.android.peertube.client.data.CaptionData;
@ -62,6 +61,7 @@ import app.fedilab.android.peertube.client.data.VideoData;
import app.fedilab.android.peertube.client.data.VideoPlaylistData;
import app.fedilab.android.peertube.client.entities.AccountCreation;
import app.fedilab.android.peertube.client.entities.ChannelParams;
import app.fedilab.android.peertube.client.entities.Error;
import app.fedilab.android.peertube.client.entities.InstanceParams;
import app.fedilab.android.peertube.client.entities.Oauth;
import app.fedilab.android.peertube.client.entities.OauthParams;
@ -185,7 +185,7 @@ public class RetrofitPeertubeAPI {
}
Handler mainHandler = new Handler(Looper.getMainLooper());
Runnable myRunnable = () -> {
Intent mainActivity = new Intent(activity, MainActivity.class);
Intent mainActivity = new Intent(activity, PeertubeMainActivity.class);
mainActivity.putExtra(Helper.INTENT_ACTION, Helper.ADD_USER_INTENT);
activity.startActivity(mainActivity);
activity.finish();
@ -1518,11 +1518,7 @@ public class RetrofitPeertubeAPI {
PeertubeService peertubeService = init();
try {
Call<Oauth> oauth;
if (BuildConfig.full_instances) {
oauth = peertubeService.getOauth(client_name, redirect_uris, scopes, website);
} else {
oauth = peertubeService.getOauthAcad();
}
Response<Oauth> response = oauth.execute();
if (response.isSuccessful() && response.body() != null) {
return response.body();

View file

@ -27,9 +27,10 @@ import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.util.concurrent.TimeUnit;
import app.fedilab.android.peertube.R;
import app.fedilab.android.peertube.activities.MainActivity;
import app.fedilab.android.R;
import app.fedilab.android.peertube.activities.PeertubeMainActivity;
import app.fedilab.android.peertube.client.APIResponse;
import app.fedilab.android.peertube.client.entities.Error;
import app.fedilab.android.peertube.client.entities.Oauth;
import app.fedilab.android.peertube.client.entities.OauthParams;
import app.fedilab.android.peertube.client.entities.Token;
@ -138,7 +139,7 @@ public class RetrofitMastodonAPI {
}
Handler mainHandler = new Handler(Looper.getMainLooper());
Runnable myRunnable = () -> {
Intent mainActivity = new Intent(activity, MainActivity.class);
Intent mainActivity = new Intent(activity, PeertubeMainActivity.class);
mainActivity.putExtra(Helper.INTENT_ACTION, Helper.ADD_USER_INTENT);
activity.startActivity(mainActivity);
activity.finish();

View file

@ -40,9 +40,9 @@ import androidx.recyclerview.widget.RecyclerView;
import java.util.List;
import app.fedilab.android.peertube.R;
import app.fedilab.android.R;
import app.fedilab.android.databinding.DrawerAboutInstancePeertubeBinding;
import app.fedilab.android.peertube.client.data.InstanceData;
import app.fedilab.android.peertube.databinding.DrawerAboutInstanceBinding;
import app.fedilab.android.peertube.helper.Helper;
import app.fedilab.android.peertube.sqlite.Sqlite;
import app.fedilab.android.peertube.sqlite.StoredInstanceDAO;
@ -74,7 +74,7 @@ public class AboutInstanceAdapter extends RecyclerView.Adapter<RecyclerView.View
@Override
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
context = parent.getContext();
DrawerAboutInstanceBinding itemBinding = DrawerAboutInstanceBinding.inflate(LayoutInflater.from(parent.getContext()), parent, false);
DrawerAboutInstancePeertubeBinding itemBinding = DrawerAboutInstancePeertubeBinding.inflate(LayoutInflater.from(parent.getContext()), parent, false);
return new ViewHolder(itemBinding);
}
@ -135,7 +135,7 @@ public class AboutInstanceAdapter extends RecyclerView.Adapter<RecyclerView.View
holder.binding.instanceMore.setOnClickListener(v -> {
PopupMenu popup = new PopupMenu(context, holder.binding.instanceMore);
popup.getMenuInflater()
.inflate(R.menu.instance_menu, popup.getMenu());
.inflate(R.menu.instance_menu_peertube, popup.getMenu());
popup.setOnMenuItemClickListener(item -> {
int itemId = item.getItemId();
if (itemId == R.id.action_delete) {
@ -175,9 +175,9 @@ public class AboutInstanceAdapter extends RecyclerView.Adapter<RecyclerView.View
static class ViewHolder extends RecyclerView.ViewHolder {
DrawerAboutInstanceBinding binding;
DrawerAboutInstancePeertubeBinding binding;
ViewHolder(DrawerAboutInstanceBinding itemView) {
ViewHolder(DrawerAboutInstancePeertubeBinding itemView) {
super(itemView.getRoot());
binding = itemView;
}

View file

@ -26,8 +26,8 @@ import androidx.recyclerview.widget.RecyclerView;
import java.util.List;
import app.fedilab.android.databinding.DrawerHorizontalAccountPeertubeBinding;
import app.fedilab.android.peertube.client.data.ChannelData;
import app.fedilab.android.peertube.databinding.DrawerHorizontalAccountBinding;
import app.fedilab.android.peertube.helper.Helper;
@ -46,7 +46,7 @@ public class AccountsHorizontalListAdapter extends RecyclerView.Adapter<Recycler
@Override
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
context = parent.getContext();
DrawerHorizontalAccountBinding itemBinding = DrawerHorizontalAccountBinding.inflate(LayoutInflater.from(parent.getContext()), parent, false);
DrawerHorizontalAccountPeertubeBinding itemBinding = DrawerHorizontalAccountPeertubeBinding.inflate(LayoutInflater.from(parent.getContext()), parent, false);
return new ViewHolder(itemBinding);
}
@ -87,9 +87,9 @@ public class AccountsHorizontalListAdapter extends RecyclerView.Adapter<Recycler
private class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
DrawerHorizontalAccountBinding binding;
DrawerHorizontalAccountPeertubeBinding binding;
ViewHolder(DrawerHorizontalAccountBinding itemView) {
ViewHolder(DrawerHorizontalAccountPeertubeBinding itemView) {
super(itemView.getRoot());
binding = itemView;
itemView.getRoot().setOnClickListener(this);

View file

@ -35,7 +35,7 @@ import com.google.android.material.floatingactionbutton.FloatingActionButton;
import java.util.List;
import app.fedilab.android.peertube.R;
import app.fedilab.android.R;
import app.fedilab.android.peertube.activities.ShowAccountActivity;
import app.fedilab.android.peertube.client.APIResponse;
import app.fedilab.android.peertube.client.RetrofitPeertubeAPI;

View file

@ -35,7 +35,7 @@ import androidx.recyclerview.widget.RecyclerView;
import java.util.List;
import app.fedilab.android.peertube.R;
import app.fedilab.android.R;
import app.fedilab.android.peertube.activities.AccountActivity;
import app.fedilab.android.peertube.activities.ShowChannelActivity;
import app.fedilab.android.peertube.client.RetrofitPeertubeAPI;
@ -60,7 +60,7 @@ public class ChannelListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHo
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
context = parent.getContext();
LayoutInflater layoutInflater = LayoutInflater.from(context);
return new ViewHolder(layoutInflater.inflate(R.layout.drawer_channel, parent, false));
return new ViewHolder(layoutInflater.inflate(R.layout.drawer_channel_peertube, parent, false));
}
@Override
@ -82,7 +82,7 @@ public class ChannelListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHo
holder.more_actions.setOnClickListener(view -> {
PopupMenu popup = new PopupMenu(context, holder.more_actions);
popup.getMenuInflater()
.inflate(R.menu.playlist_menu, popup.getMenu());
.inflate(R.menu.playlist_menu_peertube, popup.getMenu());
if (channels.size() == 1) {
popup.getMenu().findItem(R.id.action_delete).setEnabled(false);
}

View file

@ -53,14 +53,14 @@ import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import app.fedilab.android.peertube.R;
import app.fedilab.android.R;
import app.fedilab.android.databinding.DrawerCommentPeertubeBinding;
import app.fedilab.android.peertube.activities.PeertubeActivity;
import app.fedilab.android.peertube.activities.ShowAccountActivity;
import app.fedilab.android.peertube.client.APIResponse;
import app.fedilab.android.peertube.client.RetrofitPeertubeAPI;
import app.fedilab.android.peertube.client.data.CommentData.Comment;
import app.fedilab.android.peertube.client.entities.Report;
import app.fedilab.android.peertube.databinding.DrawerCommentBinding;
import app.fedilab.android.peertube.helper.CommentDecorationHelper;
import app.fedilab.android.peertube.helper.EmojiHelper;
import app.fedilab.android.peertube.helper.Helper;
@ -105,7 +105,7 @@ public class CommentListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHo
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
context = parent.getContext();
DrawerCommentBinding itemBinding = DrawerCommentBinding.inflate(LayoutInflater.from(parent.getContext()), parent, false);
DrawerCommentPeertubeBinding itemBinding = DrawerCommentPeertubeBinding.inflate(LayoutInflater.from(parent.getContext()), parent, false);
return new ViewHolder(itemBinding);
}
@ -141,7 +141,7 @@ public class CommentListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHo
holder.binding.moreActions.setOnClickListener(view -> {
PopupMenu popup = new PopupMenu(context, holder.binding.moreActions);
popup.getMenuInflater()
.inflate(R.menu.comment_menu, popup.getMenu());
.inflate(R.menu.comment_menu_peertube, popup.getMenu());
if (!Helper.isOwner(context, comment.getAccount())) {
popup.getMenu().findItem(R.id.action_delete).setVisible(false);
} else {
@ -346,7 +346,7 @@ public class CommentListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHo
private void reportComment(Comment comment) {
androidx.appcompat.app.AlertDialog.Builder dialogBuilder = new androidx.appcompat.app.AlertDialog.Builder(context);
LayoutInflater inflater = ((Activity) context).getLayoutInflater();
View dialogView = inflater.inflate(R.layout.popup_report, new LinearLayout(context), false);
View dialogView = inflater.inflate(R.layout.popup_report_peertube, new LinearLayout(context), false);
dialogBuilder.setView(dialogView);
EditText report_content = dialogView.findViewById(R.id.report_content);
dialogBuilder.setNeutralButton(R.string.cancel, (dialog, id) -> dialog.dismiss());
@ -374,9 +374,9 @@ public class CommentListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHo
static class ViewHolder extends RecyclerView.ViewHolder {
DrawerCommentBinding binding;
DrawerCommentPeertubeBinding binding;
ViewHolder(DrawerCommentBinding itemView) {
ViewHolder(DrawerCommentPeertubeBinding itemView) {
super(itemView.getRoot());
binding = itemView;
}

View file

@ -40,9 +40,9 @@ import androidx.recyclerview.widget.RecyclerView;
import java.util.LinkedHashMap;
import java.util.List;
import app.fedilab.android.peertube.R;
import app.fedilab.android.R;
import app.fedilab.android.databinding.DrawerInstancePeertubeBinding;
import app.fedilab.android.peertube.client.data.InstanceData.Instance;
import app.fedilab.android.peertube.databinding.DrawerInstanceBinding;
import app.fedilab.android.peertube.helper.RoundedBackgroundSpan;
@ -61,7 +61,7 @@ public class InstanceAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolde
@Override
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
context = parent.getContext();
DrawerInstanceBinding itemBinding = DrawerInstanceBinding.inflate(LayoutInflater.from(parent.getContext()), parent, false);
DrawerInstancePeertubeBinding itemBinding = DrawerInstancePeertubeBinding.inflate(LayoutInflater.from(parent.getContext()), parent, false);
return new ViewHolder(itemBinding);
}
@ -166,9 +166,9 @@ public class InstanceAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolde
static class ViewHolder extends RecyclerView.ViewHolder {
DrawerInstanceBinding binding;
DrawerInstancePeertubeBinding binding;
ViewHolder(DrawerInstanceBinding itemView) {
ViewHolder(DrawerInstancePeertubeBinding itemView) {
super(itemView.getRoot());
binding = itemView;
}

View file

@ -23,8 +23,8 @@ import androidx.recyclerview.widget.RecyclerView;
import java.util.List;
import app.fedilab.android.databinding.DrawerMenuPeertubeBinding;
import app.fedilab.android.peertube.client.MenuItemVideo;
import app.fedilab.android.peertube.databinding.DrawerMenuBinding;
public class MenuAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
@ -52,7 +52,7 @@ public class MenuAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
@NonNull
@Override
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
DrawerMenuBinding itemBinding = DrawerMenuBinding.inflate(LayoutInflater.from(parent.getContext()), parent, false);
DrawerMenuPeertubeBinding itemBinding = DrawerMenuPeertubeBinding.inflate(LayoutInflater.from(parent.getContext()), parent, false);
return new ViewHolder(itemBinding);
}
@ -75,9 +75,9 @@ public class MenuAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
static class ViewHolder extends RecyclerView.ViewHolder {
DrawerMenuBinding binding;
DrawerMenuPeertubeBinding binding;
ViewHolder(DrawerMenuBinding itemView) {
ViewHolder(DrawerMenuPeertubeBinding itemView) {
super(itemView.getRoot());
binding = itemView;
}

View file

@ -23,9 +23,9 @@ import androidx.recyclerview.widget.RecyclerView;
import java.util.List;
import app.fedilab.android.databinding.DrawerMenuItemBinding;
import app.fedilab.android.peertube.client.MenuItemVideo;
import app.fedilab.android.peertube.client.entities.MenuItemView;
import app.fedilab.android.peertube.databinding.DrawerMenuItemBinding;
public class MenuItemAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {

View file

@ -27,7 +27,7 @@ import androidx.annotation.NonNull;
import java.util.List;
import app.fedilab.android.peertube.R;
import app.fedilab.android.R;
import app.fedilab.android.peertube.client.data.AccountData.Account;
import app.fedilab.android.peertube.helper.Helper;

View file

@ -54,7 +54,8 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import app.fedilab.android.peertube.R;
import app.fedilab.android.R;
import app.fedilab.android.databinding.DrawerPeertubeBinding;
import app.fedilab.android.peertube.activities.PeertubeActivity;
import app.fedilab.android.peertube.activities.PeertubeEditUploadActivity;
import app.fedilab.android.peertube.activities.ShowChannelActivity;
@ -66,7 +67,6 @@ import app.fedilab.android.peertube.client.data.PlaylistData;
import app.fedilab.android.peertube.client.data.VideoData;
import app.fedilab.android.peertube.client.entities.PlaylistExist;
import app.fedilab.android.peertube.client.entities.Report;
import app.fedilab.android.peertube.databinding.DrawerPeertubeBinding;
import app.fedilab.android.peertube.helper.Helper;
import app.fedilab.android.peertube.helper.HelperInstance;
import app.fedilab.android.peertube.viewmodel.PlaylistsVM;
@ -203,7 +203,7 @@ public class PeertubeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolde
holder.binding.moreActions.setOnClickListener(view -> {
PopupMenu popup = new PopupMenu(context, holder.binding.moreActions);
popup.getMenuInflater()
.inflate(R.menu.video_drawer_menu, popup.getMenu());
.inflate(R.menu.video_drawer_menu_peertube, popup.getMenu());
if (timelineType == MY_VIDEOS) {
popup.getMenu().findItem(R.id.action_report).setVisible(false);
popup.getMenu().findItem(R.id.action_follow).setVisible(false);
@ -261,7 +261,7 @@ public class PeertubeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolde
} else if (itemId == R.id.action_report) {
AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(context);
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_peertube, new LinearLayout(context), false);
dialogBuilder.setView(dialogView);
EditText report_content = dialogView.findViewById(R.id.report_content);
dialogBuilder.setNeutralButton(R.string.cancel, (dialog2, id) -> dialog2.dismiss());

View file

@ -14,7 +14,6 @@ package app.fedilab.android.peertube.drawer;
* You should have received a copy of the GNU General Public License along with TubeLab; if not,
* see <http://www.gnu.org/licenses>. */
import static app.fedilab.android.peertube.activities.MainActivity.badgeCount;
import android.content.Context;
import android.content.Intent;
@ -33,9 +32,10 @@ import androidx.recyclerview.widget.RecyclerView;
import java.util.List;
import app.fedilab.android.peertube.R;
import app.fedilab.android.R;
import app.fedilab.android.peertube.activities.AccountActivity;
import app.fedilab.android.peertube.activities.PeertubeActivity;
import app.fedilab.android.peertube.activities.PeertubeMainActivity;
import app.fedilab.android.peertube.activities.ShowAccountActivity;
import app.fedilab.android.peertube.activities.ShowChannelActivity;
import app.fedilab.android.peertube.client.RetrofitPeertubeAPI;
@ -213,7 +213,7 @@ public class PeertubeNotificationsListAdapter extends RecyclerView.Adapter<Recyc
private void markAsRead(Notification notification, int position) {
if (!notification.isRead()) {
notification.setRead(true);
badgeCount--;
PeertubeMainActivity.badgeCount--;
if (context instanceof AccountActivity) {
((AccountActivity) context).updateCounter();
}

View file

@ -14,65 +14,33 @@ package app.fedilab.android.peertube.drawer;
* You should have received a copy of the GNU General Public License along with TubeLab; if not,
* see <http://www.gnu.org/licenses>. */
import static app.fedilab.android.peertube.viewmodel.PlaylistsVM.action.GET_LIST_VIDEOS;
import android.Manifest;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.database.sqlite.SQLiteDatabase;
import android.graphics.Bitmap;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.Environment;
import android.os.Handler;
import android.os.Looper;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.appcompat.widget.PopupMenu;
import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat;
import androidx.core.content.FileProvider;
import androidx.lifecycle.LifecycleOwner;
import androidx.lifecycle.ViewModelProvider;
import androidx.lifecycle.ViewModelStoreOwner;
import androidx.recyclerview.widget.RecyclerView;
import com.bumptech.glide.Glide;
import com.bumptech.glide.request.FutureTarget;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.List;
import java.util.concurrent.ExecutionException;
import app.fedilab.android.peertube.BuildConfig;
import app.fedilab.android.peertube.R;
import app.fedilab.android.R;
import app.fedilab.android.databinding.DrawerPlaylistPeertubeBinding;
import app.fedilab.android.peertube.activities.AllPlaylistsActivity;
import app.fedilab.android.peertube.activities.LocalPlaylistsActivity;
import app.fedilab.android.peertube.activities.MainActivity;
import app.fedilab.android.peertube.activities.PlaylistsActivity;
import app.fedilab.android.peertube.client.APIResponse;
import app.fedilab.android.peertube.client.RetrofitPeertubeAPI;
import app.fedilab.android.peertube.client.data.PlaylistData.Playlist;
import app.fedilab.android.peertube.client.data.VideoPlaylistData;
import app.fedilab.android.peertube.databinding.DrawerPlaylistBinding;
import app.fedilab.android.peertube.helper.Helper;
import app.fedilab.android.peertube.helper.HelperInstance;
import app.fedilab.android.peertube.helper.NotificationHelper;
import app.fedilab.android.peertube.helper.PlaylistExportHelper;
import app.fedilab.android.peertube.sqlite.ManagePlaylistsDAO;
import app.fedilab.android.peertube.sqlite.Sqlite;
import app.fedilab.android.peertube.viewmodel.PlaylistsVM;
import es.dmoral.toasty.Toasty;
public class PlaylistAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
@ -91,7 +59,7 @@ public class PlaylistAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolde
@Override
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
context = parent.getContext();
DrawerPlaylistBinding itemBinding = DrawerPlaylistBinding.inflate(LayoutInflater.from(parent.getContext()), parent, false);
DrawerPlaylistPeertubeBinding itemBinding = DrawerPlaylistPeertubeBinding.inflate(LayoutInflater.from(parent.getContext()), parent, false);
return new ViewHolder(itemBinding);
}
@ -120,13 +88,6 @@ public class PlaylistAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolde
}
holder.binding.previewVisibility.setText(playlist.getPrivacy().getLabel());
holder.binding.playlistContainer.setOnClickListener(v -> {
Intent intent = new Intent(context, locale ? LocalPlaylistsActivity.class : PlaylistsActivity.class);
Bundle b = new Bundle();
b.putParcelable("playlist", playlist);
intent.putExtras(b);
context.startActivity(intent);
});
if (playlist.getDisplayName().compareTo("Watch later") == 0) {
holder.binding.playlistMore.setVisibility(View.GONE);
@ -137,12 +98,8 @@ public class PlaylistAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolde
holder.binding.playlistMore.setOnClickListener(v -> {
PopupMenu popup = new PopupMenu(context, holder.binding.playlistMore);
popup.getMenuInflater()
.inflate(R.menu.playlist_menu, popup.getMenu());
if (!BuildConfig.full_instances) {
popup.getMenu().findItem(R.id.action_export).setVisible(true);
}
.inflate(R.menu.playlist_menu_peertube, popup.getMenu());
if (locale) {
popup.getMenu().findItem(R.id.action_export).setVisible(false);
popup.getMenu().findItem(R.id.action_edit).setVisible(false);
}
popup.setOnMenuItemClickListener(item -> {
@ -175,16 +132,6 @@ public class PlaylistAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolde
if (context instanceof AllPlaylistsActivity) {
((AllPlaylistsActivity) context).manageAlert(playlist);
}
} else if (itemId == R.id.action_export) {
if (Build.VERSION.SDK_INT >= 23) {
if (ContextCompat.checkSelfPermission(context, Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED || ContextCompat.checkSelfPermission(context, Manifest.permission.READ_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {
ActivityCompat.requestPermissions((Activity) context, new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, Helper.EXTERNAL_STORAGE_REQUEST_CODE);
} else {
doExport(playlist);
}
} else {
doExport(playlist);
}
}
return true;
});
@ -203,69 +150,6 @@ public class PlaylistAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolde
return playlists.size();
}
private void doExport(Playlist playlist) {
new Thread(() -> {
File file;
RetrofitPeertubeAPI retrofitPeertubeAPI = new RetrofitPeertubeAPI(context);
APIResponse apiResponse = retrofitPeertubeAPI.playlistAction(GET_LIST_VIDEOS, playlist.getId(), null, null, null);
if (apiResponse != null) {
List<VideoPlaylistData.VideoPlaylist> videos = apiResponse.getVideoPlaylist();
VideoPlaylistData.VideoPlaylistExport videoPlaylistExport = new VideoPlaylistData.VideoPlaylistExport();
videoPlaylistExport.setPlaylist(playlist);
videoPlaylistExport.setUuid(playlist.getUuid());
videoPlaylistExport.setAcct(MainActivity.userMe.getAccount().getAcct());
videoPlaylistExport.setVideos(videos);
String data = PlaylistExportHelper.playlistToStringStorage(videoPlaylistExport);
File root = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS), "");
if (!root.exists()) {
//noinspection ResultOfMethodCallIgnored
root.mkdirs();
}
String fileName = "playlist_" + playlist.getUuid() + ".tubelab";
file = new File(root, fileName);
FileWriter writer;
try {
writer = new FileWriter(file);
writer.append(data);
writer.flush();
writer.close();
} catch (IOException e) {
e.printStackTrace();
Handler mainHandler = new Handler(Looper.getMainLooper());
Runnable myRunnable = () -> Toasty.error(context, context.getString(R.string.toast_error), Toasty.LENGTH_LONG).show();
mainHandler.post(myRunnable);
return;
}
String urlAvatar = playlist.getThumbnailPath() != null ? HelperInstance.getLiveInstance(context) + playlist.getThumbnailPath() : null;
FutureTarget<Bitmap> futureBitmapChannel = Glide.with(context.getApplicationContext())
.asBitmap()
.load(urlAvatar != null ? urlAvatar : R.drawable.missing_peertube).submit();
Bitmap icon = null;
try {
icon = futureBitmapChannel.get();
} catch (ExecutionException | InterruptedException e) {
e.printStackTrace();
}
Intent mailIntent = new Intent(Intent.ACTION_SEND);
mailIntent.setType("message/rfc822");
Uri contentUri = FileProvider.getUriForFile(context, BuildConfig.APPLICATION_ID + ".fileProvider", file);
mailIntent.putExtra(Intent.EXTRA_SUBJECT, context.getString(R.string.export_notification_subjet));
mailIntent.putExtra(Intent.EXTRA_TEXT, context.getString(R.string.export_notification_body));
mailIntent.putExtra(Intent.EXTRA_STREAM, contentUri);
mailIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
NotificationHelper.notify_user(context.getApplicationContext(),
playlist.getOwnerAccount(), mailIntent, icon,
context.getString(R.string.export_notification_title),
context.getString(R.string.export_notification_content));
}
}).start();
}
@SuppressWarnings({"unused", "RedundantSuppression"})
public void manageVIewPlaylists(PlaylistsVM.action actionType, APIResponse apiResponse) {
@ -277,9 +161,9 @@ public class PlaylistAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolde
}
static class ViewHolder extends RecyclerView.ViewHolder {
DrawerPlaylistBinding binding;
DrawerPlaylistPeertubeBinding binding;
ViewHolder(DrawerPlaylistBinding itemView) {
ViewHolder(DrawerPlaylistPeertubeBinding itemView) {
super(itemView.getRoot());
binding = itemView;
}

View file

@ -34,7 +34,7 @@ import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import java.util.ArrayList;
import java.util.List;
import app.fedilab.android.peertube.R;
import app.fedilab.android.R;
import app.fedilab.android.peertube.client.APIResponse;
import app.fedilab.android.peertube.client.RetrofitPeertubeAPI;
import app.fedilab.android.peertube.client.data.AccountData.Account;
@ -61,7 +61,7 @@ public class DisplayAccountsFragment extends Fragment implements AccountsListAda
@Override
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
rootView = inflater.inflate(R.layout.fragment_recyclerview, container, false);
rootView = inflater.inflate(R.layout.fragment_recyclerview_peertube, container, false);
context = getContext();
Bundle bundle = this.getArguments();

View file

@ -51,13 +51,13 @@ import com.google.android.material.floatingactionbutton.FloatingActionButton;
import java.util.ArrayList;
import java.util.List;
import app.fedilab.android.peertube.R;
import app.fedilab.android.R;
import app.fedilab.android.databinding.AddChannelPeertubeBinding;
import app.fedilab.android.databinding.FragmentRecyclerviewPeertubeBinding;
import app.fedilab.android.peertube.client.APIResponse;
import app.fedilab.android.peertube.client.RetrofitPeertubeAPI;
import app.fedilab.android.peertube.client.data.ChannelData;
import app.fedilab.android.peertube.client.entities.ChannelParams;
import app.fedilab.android.peertube.databinding.AddChannelBinding;
import app.fedilab.android.peertube.databinding.FragmentRecyclerviewBinding;
import app.fedilab.android.peertube.drawer.ChannelListAdapter;
import app.fedilab.android.peertube.helper.Helper;
import app.fedilab.android.peertube.helper.HelperInstance;
@ -75,8 +75,8 @@ public class DisplayChannelsFragment extends Fragment implements ChannelListAdap
private String name;
private View rootView;
private FloatingActionButton action_button;
private FragmentRecyclerviewBinding binding;
private AddChannelBinding bindingDialog;
private FragmentRecyclerviewPeertubeBinding binding;
private AddChannelPeertubeBinding bindingDialog;
private Uri inputData;
private String search_peertube;
private String max_id;
@ -85,7 +85,7 @@ public class DisplayChannelsFragment extends Fragment implements ChannelListAdap
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
binding = FragmentRecyclerviewBinding.inflate(LayoutInflater.from(context));
binding = FragmentRecyclerviewPeertubeBinding.inflate(LayoutInflater.from(context));
rootView = binding.getRoot();
context = getContext();
Bundle bundle = this.getArguments();
@ -235,7 +235,7 @@ public class DisplayChannelsFragment extends Fragment implements ChannelListAdap
AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(context);
bindingDialog = AddChannelBinding.inflate(LayoutInflater.from(context), null, false);
bindingDialog = AddChannelPeertubeBinding.inflate(LayoutInflater.from(context), null, false);
dialogBuilder.setView(bindingDialog.getRoot());
if (oldChannelValues != null) {

View file

@ -34,7 +34,7 @@ import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import java.util.ArrayList;
import java.util.List;
import app.fedilab.android.peertube.R;
import app.fedilab.android.R;
import app.fedilab.android.peertube.client.APIResponse;
import app.fedilab.android.peertube.client.data.NotificationData.Notification;
import app.fedilab.android.peertube.drawer.PeertubeNotificationsListAdapter;
@ -79,7 +79,7 @@ public class DisplayNotificationsFragment extends Fragment {
@Override
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
rootView = inflater.inflate(R.layout.fragment_recyclerview, container, false);
rootView = inflater.inflate(R.layout.fragment_recyclerview_peertube, container, false);
context = getContext();
notifications = new ArrayList<>();

View file

@ -44,7 +44,7 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import app.fedilab.android.peertube.R;
import app.fedilab.android.R;
import app.fedilab.android.peertube.client.APIResponse;
import app.fedilab.android.peertube.client.data.VideoData;
import app.fedilab.android.peertube.client.entities.OverviewVideo;
@ -84,7 +84,7 @@ public class DisplayOverviewFragment extends Fragment implements PeertubeAdapter
@Override
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
rootView = inflater.inflate(R.layout.fragment_overview, container, false);
rootView = inflater.inflate(R.layout.fragment_overview_peertube, container, false);
peertubes = new ArrayList<>();

View file

@ -54,7 +54,7 @@ import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import app.fedilab.android.peertube.R;
import app.fedilab.android.R;
import app.fedilab.android.peertube.activities.PlaylistsActivity;
import app.fedilab.android.peertube.client.APIResponse;
import app.fedilab.android.peertube.client.RetrofitPeertubeAPI;
@ -87,7 +87,7 @@ public class DisplayPlaylistsFragment extends Fragment {
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
//View for fragment is the same that fragment accounts
View rootView = inflater.inflate(R.layout.fragment_playlists, container, false);
View rootView = inflater.inflate(R.layout.fragment_playlists_peertube, container, false);
context = getContext();
playlists = new ArrayList<>();
@ -122,7 +122,7 @@ public class DisplayPlaylistsFragment extends Fragment {
add_new.setOnClickListener(view -> {
AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(context);
LayoutInflater inflater1 = ((Activity) context).getLayoutInflater();
View dialogView = inflater1.inflate(R.layout.add_playlist, new LinearLayout(context), false);
View dialogView = inflater1.inflate(R.layout.add_playlist_peertube, new LinearLayout(context), false);
dialogBuilder.setView(dialogView);
EditText display_name = dialogView.findViewById(R.id.display_name);
EditText description = dialogView.findViewById(R.id.description);

View file

@ -39,12 +39,12 @@ import org.jetbrains.annotations.NotNull;
import java.util.ArrayList;
import java.util.List;
import app.fedilab.android.peertube.BuildConfig;
import app.fedilab.android.peertube.R;
import app.fedilab.android.BuildConfig;
import app.fedilab.android.R;
import app.fedilab.android.databinding.FragmentVideoPeertubeBinding;
import app.fedilab.android.peertube.client.data.ChannelData;
import app.fedilab.android.peertube.client.data.VideoData;
import app.fedilab.android.peertube.client.entities.SepiaSearch;
import app.fedilab.android.peertube.databinding.FragmentVideoBinding;
import app.fedilab.android.peertube.drawer.AccountsHorizontalListAdapter;
import app.fedilab.android.peertube.drawer.PeertubeAdapter;
import app.fedilab.android.peertube.helper.Helper;
@ -65,7 +65,7 @@ public class DisplaySepiaSearchFragment extends Fragment implements AccountsHori
private SharedPreferences sharedpreferences;
private SepiaSearchVM viewModelSearch;
private SepiaSearch sepiaSearchVideo;
private FragmentVideoBinding binding;
private FragmentVideoPeertubeBinding binding;
public DisplaySepiaSearchFragment() {
}
@ -73,7 +73,7 @@ public class DisplaySepiaSearchFragment extends Fragment implements AccountsHori
@Override
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
binding = FragmentVideoBinding.inflate(inflater, container, false);
binding = FragmentVideoPeertubeBinding.inflate(inflater, container, false);
return binding.getRoot();
}
@ -209,7 +209,7 @@ public class DisplaySepiaSearchFragment extends Fragment implements AccountsHori
int videoPerPage = sharedpreferences.getInt(Helper.SET_VIDEOS_PER_PAGE, Helper.VIDEOS_PER_PAGE);
sepiaSearchVideo.setStart(String.valueOf(Integer.parseInt(sepiaSearchVideo.getStart()) + videoPerPage));
if (!BuildConfig.google_restriction) {
if (BuildConfig.FLAVOR.equalsIgnoreCase("fdroid")) {
this.peertubes.addAll(videoData.data);
} else {
for (VideoData.Video video : videoData.data) {

View file

@ -32,6 +32,7 @@ import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentTransaction;
import androidx.lifecycle.ViewModelProvider;
import androidx.multidex.BuildConfig;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
@ -43,9 +44,9 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import app.fedilab.android.peertube.BuildConfig;
import app.fedilab.android.peertube.R;
import app.fedilab.android.peertube.activities.MainActivity;
import app.fedilab.android.R;
import app.fedilab.android.databinding.FragmentVideoPeertubeBinding;
import app.fedilab.android.peertube.activities.PeertubeMainActivity;
import app.fedilab.android.peertube.client.APIResponse;
import app.fedilab.android.peertube.client.RetrofitPeertubeAPI;
import app.fedilab.android.peertube.client.data.AccountData;
@ -53,7 +54,6 @@ import app.fedilab.android.peertube.client.data.ChannelData;
import app.fedilab.android.peertube.client.data.VideoData;
import app.fedilab.android.peertube.client.data.VideoPlaylistData;
import app.fedilab.android.peertube.client.entities.PlaylistExist;
import app.fedilab.android.peertube.databinding.FragmentVideoBinding;
import app.fedilab.android.peertube.drawer.AccountsHorizontalListAdapter;
import app.fedilab.android.peertube.drawer.PeertubeAdapter;
import app.fedilab.android.peertube.helper.Helper;
@ -93,7 +93,7 @@ public class DisplayVideosFragment extends Fragment implements AccountsHorizonta
private String remoteInstance;
private boolean sepiaSearch;
private String startDate, endDate;
private FragmentVideoBinding binding;
private FragmentVideoPeertubeBinding binding;
private String channelId;
public DisplayVideosFragment() {
@ -102,7 +102,7 @@ public class DisplayVideosFragment extends Fragment implements AccountsHorizonta
@Override
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
binding = FragmentVideoBinding.inflate(inflater, container, false);
binding = FragmentVideoPeertubeBinding.inflate(inflater, container, false);
return binding.getRoot();
}
@ -351,7 +351,7 @@ public class DisplayVideosFragment extends Fragment implements AccountsHorizonta
apiResponse.getPeertubes().add(v.getVideo());
}
}
if (!BuildConfig.google_restriction) {
if (BuildConfig.FLAVOR.equalsIgnoreCase("fdroid")) {
this.peertubes.addAll(apiResponse.getPeertubes());
} else {
for (VideoData.Video video : apiResponse.getPeertubes()) {
@ -459,9 +459,9 @@ public class DisplayVideosFragment extends Fragment implements AccountsHorizonta
public void pullToRefresh(boolean reload) {
if (type == TimelineVM.TimelineType.SUBSCRIBTIONS && reload) {
DisplayVideosFragment subscriptionFragment = ((MainActivity) context).getSubscriptionFragment();
DisplayVideosFragment subscriptionFragment = ((PeertubeMainActivity) context).getSubscriptionFragment();
if (subscriptionFragment != null) {
FragmentTransaction ft = ((MainActivity) context).getSupportFragmentManager().beginTransaction();
FragmentTransaction ft = ((PeertubeMainActivity) context).getSupportFragmentManager().beginTransaction();
ft.detach(subscriptionFragment).attach(subscriptionFragment).commit();
}
} else {

View file

@ -1,6 +1,7 @@
package app.fedilab.android.peertube.fragment;
import static app.fedilab.android.peertube.activities.MainActivity.userMe;
import static app.fedilab.android.peertube.activities.PeertubeMainActivity.userMe;
import android.content.Context;
import android.content.Intent;
@ -38,11 +39,12 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
import app.fedilab.android.peertube.BuildConfig;
import app.fedilab.android.peertube.R;
import app.fedilab.android.peertube.activities.MainActivity;
import app.fedilab.android.BuildConfig;
import app.fedilab.android.R;
import app.fedilab.android.peertube.activities.MyAccountActivity;
import app.fedilab.android.peertube.activities.PeertubeMainActivity;
import app.fedilab.android.peertube.client.RetrofitPeertubeAPI;
import app.fedilab.android.peertube.client.entities.Error;
import app.fedilab.android.peertube.client.entities.UserSettings;
import app.fedilab.android.peertube.helper.Helper;
import app.fedilab.android.peertube.helper.HelperInstance;
@ -233,7 +235,7 @@ public class SettingsFragment extends PreferenceFragmentCompat implements Shared
SwitchPreference set_video_in_list_choice = findPreference(getString(R.string.set_video_in_list_choice));
assert set_video_in_list_choice != null;
editor.putBoolean(getString(R.string.set_video_in_list_choice), set_video_in_list_choice.isChecked());
Intent intent = new Intent(requireActivity(), MainActivity.class);
Intent intent = new Intent(requireActivity(), PeertubeMainActivity.class);
startActivity(intent);
}
if (key.compareTo(getString(R.string.set_cast_choice)) == 0) {

View file

@ -21,7 +21,6 @@ import com.google.android.exoplayer2.database.ExoDatabaseProvider;
import com.google.android.exoplayer2.upstream.DataSource;
import com.google.android.exoplayer2.upstream.DefaultBandwidthMeter;
import com.google.android.exoplayer2.upstream.DefaultDataSourceFactory;
import com.google.android.exoplayer2.upstream.DefaultHttpDataSourceFactory;
import com.google.android.exoplayer2.upstream.FileDataSource;
import com.google.android.exoplayer2.upstream.cache.CacheDataSink;
import com.google.android.exoplayer2.upstream.cache.CacheDataSource;

View file

@ -71,7 +71,7 @@ import java.util.Locale;
import java.util.regex.Pattern;
import app.fedilab.android.R;
import app.fedilab.android.peertube.activities.MainActivity;
import app.fedilab.android.peertube.activities.PeertubeMainActivity;
import app.fedilab.android.peertube.activities.WebviewActivity;
import app.fedilab.android.peertube.client.data.AccountData.Account;
import app.fedilab.android.peertube.client.data.ChannelData;
@ -553,7 +553,7 @@ public class Helper {
editor.putString(PREF_INSTANCE, null);
editor.putString(ID, null);
editor.apply();
Intent loginActivity = new Intent(activity, MainActivity.class);
Intent loginActivity = new Intent(activity, PeertubeMainActivity.class);
activity.startActivity(loginActivity);
activity.finish();
} else {
@ -561,7 +561,7 @@ public class Helper {
editor.putString(PREF_KEY_ID, newAccount.getId());
editor.putString(PREF_INSTANCE, newAccount.getHost().trim());
editor.commit();
Intent changeAccount = new Intent(activity, MainActivity.class);
Intent changeAccount = new Intent(activity, PeertubeMainActivity.class);
changeAccount.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
activity.startActivity(changeAccount);
}
@ -582,7 +582,7 @@ public class Helper {
editor.putString(PREF_KEY_ID, null);
editor.putString(ID, null);
editor.apply();
Intent loginActivity = new Intent(activity, MainActivity.class);
Intent loginActivity = new Intent(activity, PeertubeMainActivity.class);
activity.startActivity(loginActivity);
activity.finish();
}
@ -609,7 +609,7 @@ public class Helper {
* @return boolean
*/
public static boolean isLoggedIn(Context context) {
return isLoggedInType(context) == MainActivity.TypeOfConnection.NORMAL;
return isLoggedInType(context) == PeertubeMainActivity.TypeOfConnection.NORMAL;
}
/**
@ -619,30 +619,30 @@ public class Helper {
* @return boolean
*/
public static boolean canMakeAction(Context context) {
return (isLoggedInType(context) == MainActivity.TypeOfConnection.NORMAL || isLoggedInType(context) == MainActivity.TypeOfConnection.REMOTE_ACCOUNT);
return (isLoggedInType(context) == PeertubeMainActivity.TypeOfConnection.NORMAL || isLoggedInType(context) == PeertubeMainActivity.TypeOfConnection.REMOTE_ACCOUNT);
}
/**
* Returns boolean depending if the user is authenticated
*
* @param context Context
* @return MainActivity.TypeOfConnection
* @return PeertubeMainActivity.TypeOfConnection
*/
public static MainActivity.TypeOfConnection isLoggedInType(Context context) {
public static PeertubeMainActivity.TypeOfConnection isLoggedInType(Context context) {
SharedPreferences sharedpreferences = context.getSharedPreferences(Helper.APP_PREFS, MODE_PRIVATE);
String prefKeyOauthTokenT = sharedpreferences.getString(PREF_KEY_OAUTH_TOKEN, null);
String prefSoftware = sharedpreferences.getString(PREF_SOFTWARE, null);
if (prefKeyOauthTokenT != null && prefSoftware == null) {
return MainActivity.TypeOfConnection.NORMAL;
return PeertubeMainActivity.TypeOfConnection.NORMAL;
} else if (prefKeyOauthTokenT != null) {
return MainActivity.TypeOfConnection.REMOTE_ACCOUNT;
return PeertubeMainActivity.TypeOfConnection.REMOTE_ACCOUNT;
} else {
return MainActivity.TypeOfConnection.UNKNOWN;
return PeertubeMainActivity.TypeOfConnection.UNKNOWN;
}
}
public static String getToken(Context context) {
if (isLoggedInType(context) == MainActivity.TypeOfConnection.NORMAL) {
if (isLoggedInType(context) == PeertubeMainActivity.TypeOfConnection.NORMAL) {
SharedPreferences sharedpreferences = context.getSharedPreferences(Helper.APP_PREFS, MODE_PRIVATE);
return sharedpreferences.getString(Helper.PREF_KEY_OAUTH_TOKEN, null);
} else {

View file

@ -17,8 +17,6 @@ package app.fedilab.android.peertube.helper;
import android.content.Context;
import android.content.SharedPreferences;
import app.fedilab.android.peertube.BuildConfig;
public class HelperInstance {
@ -31,11 +29,7 @@ public class HelperInstance {
*/
public static String getLiveInstance(Context context) {
final SharedPreferences sharedpreferences = context.getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
if (BuildConfig.FLAVOR.compareTo("fdroid_full") == 0 || BuildConfig.FLAVOR.compareTo("google_full") == 0) {
return sharedpreferences.getString(Helper.PREF_INSTANCE, null);
} else {
return sharedpreferences.getString(Helper.PREF_INSTANCE, "tube-institutionnel.apps.education.fr");
}
}
}

View file

@ -31,7 +31,7 @@ import android.os.Build;
import androidx.core.app.NotificationCompat;
import androidx.core.app.NotificationManagerCompat;
import app.fedilab.android.peertube.R;
import app.fedilab.android.R;
import app.fedilab.android.peertube.client.data.AccountData;
public class NotificationHelper {
@ -60,7 +60,7 @@ public class NotificationHelper {
RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(context, FETCH_NOTIFICATION_CHANNEL_ID)
.setSmallIcon(R.drawable.ic_notification_tubelab).setTicker(message)
.setSmallIcon(R.drawable.ic_notification).setTicker(message)
.setWhen(System.currentTimeMillis());
notificationBuilder.setGroup(account.getAcct())
.setContentIntent(pIntent)

View file

@ -8,7 +8,7 @@ import android.text.style.ReplacementSpan;
import org.jetbrains.annotations.NotNull;
import app.fedilab.android.peertube.R;
import app.fedilab.android.R;
public class RoundedBackgroundSpan extends ReplacementSpan {
@ -17,8 +17,8 @@ public class RoundedBackgroundSpan extends ReplacementSpan {
public RoundedBackgroundSpan(Context context) {
super();
backgroundColor = context.getResources().getColor(R.color.colorAccent);
textColor = context.getResources().getColor(R.color.tag_color_text);
backgroundColor = Helper.getAttColor(context, R.attr.colorError);
textColor = Helper.getAttColor(context, R.attr.colorOnError);
}
@Override

View file

@ -25,9 +25,9 @@ import androidx.appcompat.app.AlertDialog;
import java.util.List;
import app.fedilab.android.peertube.R;
import app.fedilab.android.R;
import app.fedilab.android.peertube.activities.LoginActivity;
import app.fedilab.android.peertube.activities.MainActivity;
import app.fedilab.android.peertube.activities.PeertubeMainActivity;
import app.fedilab.android.peertube.client.data.AccountData;
import app.fedilab.android.peertube.drawer.OwnAccountsAdapter;
import app.fedilab.android.peertube.sqlite.AccountDAO;
@ -65,7 +65,7 @@ public class SwitchAccountHelper {
editor.putString(Helper.PREF_KEY_NAME, account.getUsername());
editor.apply();
dialog.dismiss();
Intent intent = new Intent(activity, MainActivity.class);
Intent intent = new Intent(activity, PeertubeMainActivity.class);
activity.startActivity(intent);
activity.finish();
});

View file

@ -32,7 +32,7 @@ import androidx.core.app.NotificationCompat;
import java.util.LinkedHashMap;
import java.util.Objects;
import app.fedilab.android.peertube.R;
import app.fedilab.android.R;
import app.fedilab.android.peertube.client.RetrofitPeertubeAPI;
import app.fedilab.android.peertube.client.entities.PeertubeInformation;
import app.fedilab.android.peertube.helper.EmojiHelper;
@ -64,7 +64,7 @@ public class RetrieveInfoService extends Service implements NetworkStateReceiver
((NotificationManager) Objects.requireNonNull(getSystemService(Context.NOTIFICATION_SERVICE))).createNotificationChannel(channel);
Notification notification = new NotificationCompat.Builder(this, NOTIFICATION_CHANNEL_ID)
.setSmallIcon(R.drawable.ic_notification_tubelab)
.setSmallIcon(R.drawable.ic_notification)
.setContentTitle(getString(R.string.app_name))
.setContentText(getString(R.string.notification_channel_name))
.setAutoCancel(true).build();

View file

@ -32,7 +32,7 @@ import android.widget.TextView;
import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.AppCompatActivity;
import app.fedilab.android.peertube.R;
import app.fedilab.android.R;
public class MastalabWebChromeClient extends WebChromeClient implements MediaPlayer.OnCompletionListener, MediaPlayer.OnErrorListener {

View file

@ -27,7 +27,7 @@ import android.widget.TextView;
import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.AppCompatActivity;
import app.fedilab.android.peertube.R;
import app.fedilab.android.R;
public class MastalabWebViewClient extends WebViewClient {

View file

@ -41,15 +41,16 @@ import com.bumptech.glide.request.FutureTarget;
import java.util.List;
import java.util.concurrent.ExecutionException;
import app.fedilab.android.peertube.R;
import app.fedilab.android.peertube.activities.MainActivity;
import app.fedilab.android.R;
import app.fedilab.android.peertube.activities.PeertubeActivity;
import app.fedilab.android.peertube.activities.PeertubeMainActivity;
import app.fedilab.android.peertube.activities.ShowAccountActivity;
import app.fedilab.android.peertube.client.APIResponse;
import app.fedilab.android.peertube.client.RetrofitPeertubeAPI;
import app.fedilab.android.peertube.client.data.AccountData;
import app.fedilab.android.peertube.client.data.NotificationData;
import app.fedilab.android.peertube.client.entities.Actor;
import app.fedilab.android.peertube.client.entities.Error;
import app.fedilab.android.peertube.client.entities.NotificationSettings;
import app.fedilab.android.peertube.client.entities.UserMe;
import app.fedilab.android.peertube.fragment.DisplayNotificationsFragment;
@ -306,7 +307,7 @@ public class NotificationsWorker extends Worker {
channel.setSound(null, null);
notificationManager.createNotificationChannel(channel);
}
Intent myIntent = new Intent(getApplicationContext(), MainActivity.class);
Intent myIntent = new Intent(getApplicationContext(), PeertubeMainActivity.class);
PendingIntent pendingIntent = PendingIntent.getActivity(
getApplicationContext(),
0,
@ -318,7 +319,7 @@ public class NotificationsWorker extends Worker {
.setProgress(100, 0, false)
.setOnlyAlertOnce(true)
.setContentIntent(pendingIntent)
.setSmallIcon(R.drawable.ic_notification_tubelab)
.setSmallIcon(R.drawable.ic_notification)
.setSound(null)
.setAutoCancel(true)
.setOngoing(true);

View file

@ -1,7 +1,7 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:tint="?attr/colorControlNormal"
android:width="24dp"
android:height="24dp"
android:tint="?attr/colorControlNormal"
android:viewportWidth="24"
android:viewportHeight="24">
<path

View file

@ -129,8 +129,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="@string/support_the_app_on_liberapay"
/>
android:text="@string/support_the_app_on_liberapay" />
<com.google.android.material.button.MaterialButton

View file

@ -31,8 +31,8 @@
style="@style/Widget.Material3.Button.OutlinedButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingVertical="12dp"
android:layout_marginTop="24dp"
android:paddingVertical="12dp"
android:text="@string/muted_menu"
android:textAlignment="textStart"
android:textColor="?attr/colorAccent"

View file

@ -50,11 +50,11 @@
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/title"
style="@style/TextAppearance.AppCompat.Title"
android:ellipsize="end"
android:maxLines="1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical" />
android:layout_gravity="center_vertical"
android:ellipsize="end"
android:maxLines="1" />
</androidx.appcompat.widget.Toolbar>
</com.google.android.material.appbar.AppBarLayout>

View file

@ -32,9 +32,9 @@
<app.fedilab.android.mastodon.helper.CirclesDrawingView
android:id="@+id/focus_circle"
android:elevation="5dp"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:elevation="5dp"
android:visibility="gone" />
</RelativeLayout>

View file

@ -203,8 +203,8 @@
android:layout_marginHorizontal="12dp"
android:layout_marginTop="6dp"
android:orientation="vertical"
app:selectionRequired="true"
app:layout_constraintTop_toBottomOf="@id/visibility_label"
app:selectionRequired="true"
app:singleSelection="true">
<com.google.android.material.button.MaterialButton
@ -219,9 +219,9 @@
<com.google.android.material.button.MaterialButton
android:id="@+id/visibility_unlisted"
style="@style/Widget.Material3.Button.OutlinedButton.Icon"
android:layout_marginTop="0dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="0dp"
android:text="@string/v_unlisted"
android:textAlignment="textStart"
app:icon="@drawable/ic_compose_visibility_unlisted" />

View file

@ -75,8 +75,8 @@
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginEnd="10dp"
android:gravity="end"
android:contentDescription="@string/display_timelines"
android:gravity="end"
android:src="@drawable/ic_baseline_more_horiz_24"
android:tint="?attr/colorControlNormal"
android:visibility="gone" />
@ -116,8 +116,8 @@
<com.google.android.material.bottomnavigation.BottomNavigationView
android:id="@+id/bottom_nav_view"
android:layout_width="match_parent"
app:labelVisibilityMode="unlabeled"
android:layout_height="?actionBarSize"
app:labelVisibilityMode="unlabeled"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />

View file

@ -108,8 +108,8 @@
android:layout_marginEnd="6dp"
android:contentDescription="@string/set_notify"
android:scaleType="fitCenter"
app:icon="@drawable/ic_baseline_notifications_off_24"
android:visibility="gone"
app:icon="@drawable/ic_baseline_notifications_off_24"
app:layout_constraintEnd_toStartOf="@id/avatar_container"
app:layout_constraintTop_toBottomOf="@id/banner_container"
tools:visibility="visible" />
@ -123,8 +123,8 @@
android:layout_marginTop="6dp"
android:contentDescription="@string/edit_profile"
android:scaleType="fitCenter"
app:icon="@drawable/ic_baseline_edit_24"
android:visibility="gone"
app:icon="@drawable/ic_baseline_edit_24"
app:layout_constraintStart_toEndOf="@id/avatar_container"
app:layout_constraintTop_toBottomOf="@id/banner_container"
tools:visibility="visible" />
@ -417,10 +417,10 @@
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_gravity="top"
android:layout_width="match_parent"
app:contentInsetStartWithNavigation="0dp"
android:layout_height="?attr/actionBarSize"
android:layout_gravity="top"
app:contentInsetStartWithNavigation="0dp"
app:layout_collapseMode="pin"
app:layout_scrollFlags="scroll|enterAlways">

View file

@ -100,10 +100,10 @@
android:layout_margin="10dp"
android:contentDescription="@string/validate"
android:padding="0dp"
android:visibility="gone"
app:icon="@drawable/ic_baseline_check_24"
app:iconGravity="textStart"
app:iconPadding="0dp"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_chainStyle="packed"

View file

@ -100,9 +100,9 @@
android:layout_width="48dp"
android:layout_height="48dp"
android:padding="0dp"
app:icon="@drawable/ic_baseline_volume_mute_24"
app:iconGravity="textStart"
app:iconPadding="0dp"
app:icon="@drawable/ic_baseline_volume_mute_24"
app:strokeWidth="1dp" />
<com.google.android.material.button.MaterialButton
@ -163,9 +163,9 @@
android:layout_marginStart="12dp"
android:layout_marginTop="6dp"
android:padding="0dp"
app:icon="@drawable/ic_baseline_person_add_24"
app:iconGravity="textStart"
app:iconPadding="0dp"
app:icon="@drawable/ic_baseline_person_add_24"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/bio" />

View file

@ -83,9 +83,9 @@
android:layout_marginStart="12dp"
android:layout_marginTop="6dp"
android:padding="0dp"
app:icon="@drawable/ic_baseline_person_add_alt_1_24"
app:iconGravity="textStart"
app:iconPadding="0dp"
app:icon="@drawable/ic_baseline_person_add_alt_1_24"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />

View file

@ -21,8 +21,8 @@
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="6dp"
android:orientation="vertical">
android:orientation="vertical"
android:padding="6dp">
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"

View file

@ -17,8 +17,8 @@
<androidx.appcompat.widget.LinearLayoutCompat xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:id="@+id/main_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="10dp">

View file

@ -20,10 +20,10 @@
android:id="@+id/cardview_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clipChildren="false"
android:clipToPadding="false"
android:layout_marginHorizontal="@dimen/card_margin"
android:layout_marginTop="@dimen/card_margin"
android:clipChildren="false"
android:clipToPadding="false"
app:cardElevation="0dp"
app:strokeWidth="0dp">

View file

@ -2,9 +2,9 @@
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_marginBottom="20dp"
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
android:layout_marginBottom="20dp">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/pp"

View file

@ -18,9 +18,9 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/cardview_container"
android:layout_marginHorizontal="@dimen/card_margin"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="@dimen/card_margin"
android:layout_marginTop="6dp"
android:clipChildren="false"
android:clipToPadding="false"

View file

@ -10,40 +10,40 @@
<com.google.android.material.button.MaterialButton
style="@style/Widget.Material3.Button.OutlinedButton.Icon"
android:id="@+id/fetch_more_max"
style="@style/Widget.Material3.Button.OutlinedButton.Icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/fetch_more_messages"
android:padding="0dp"
app:icon="@drawable/ic_baseline_keyboard_double_arrow_down_24"
app:iconGravity="textStart"
app:iconPadding="0dp"
app:strokeColor="?colorPrimary"
android:contentDescription="@string/fetch_more_messages"
app:icon="@drawable/ic_baseline_keyboard_double_arrow_down_24" />
app:strokeColor="?colorPrimary" />
<androidx.appcompat.widget.AppCompatTextView
android:layout_width="0dp"
android:layout_weight="1"
android:gravity="center"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:textColor="?colorPrimary"
android:layout_weight="1"
android:gravity="center"
android:text="@string/fetch_more_messages"
android:textAlignment="center"
android:textAppearance="@style/TextAppearance.Material3.BodyMedium"
android:textColor="?colorPrimary"
android:textSize="18sp"
app:textAllCaps="false" />
<com.google.android.material.button.MaterialButton
android:id="@+id/fetch_more_min"
style="@style/Widget.Material3.Button.OutlinedButton.Icon"
app:strokeColor="?colorPrimary"
android:padding="0dp"
app:iconGravity="textStart"
app:iconPadding="0dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/fetch_more_messages"
app:icon="@drawable/ic_baseline_keyboard_double_arrow_up_24" />
android:padding="0dp"
app:icon="@drawable/ic_baseline_keyboard_double_arrow_up_24"
app:iconGravity="textStart"
app:iconPadding="0dp"
app:strokeColor="?colorPrimary" />
</androidx.appcompat.widget.LinearLayoutCompat>

View file

@ -17,12 +17,12 @@
<com.google.android.material.card.MaterialCardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/cardview_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/cardview_container"
android:layout_marginHorizontal="@dimen/card_margin"
android:layout_marginTop="@dimen/card_margin"
android:clipChildren="false"
android:layout_marginHorizontal="@dimen/card_margin"
android:clipToPadding="false"
app:cardElevation="0dp"
app:strokeWidth="0dp">
@ -59,8 +59,8 @@
android:layout_height="20dp"
android:layout_gravity="center"
android:layout_marginStart="5dp"
android:tint="?colorPrimary"
android:src="@drawable/ic_baseline_supervised_user_circle_24" />
android:src="@drawable/ic_baseline_supervised_user_circle_24"
android:tint="?colorPrimary" />
</androidx.appcompat.widget.LinearLayoutCompat>

View file

@ -17,9 +17,9 @@
<com.google.android.material.card.MaterialCardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/cardview_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/cardview_container"
android:layout_marginHorizontal="@dimen/card_margin"
android:layout_marginTop="@dimen/card_margin"
android:clipChildren="false"

View file

@ -18,17 +18,16 @@
<androidx.appcompat.widget.AppCompatCheckBox
android:id="@+id/whole_word"
android:layout_width="48dp"
android:layout_height="48dp"
/>
android:layout_height="48dp" />
<com.google.android.material.button.MaterialButton
android:id="@+id/delete_keyword"
style="@style/Widget.Material3.Button.OutlinedButton.Icon"
app:icon="@drawable/ic_baseline_delete_24"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_marginStart="20dp"
android:contentDescription="@string/delete_keyword"
android:scaleType="fitCenter"
app:icon="@drawable/ic_baseline_delete_24"
app:strokeColor="?colorPrimary" />
</androidx.appcompat.widget.LinearLayoutCompat>

View file

@ -9,5 +9,4 @@
android:paddingVertical="12dp"
android:textAlignment="textStart"
app:icon="@drawable/ic_baseline_navigate_next_24"
app:iconGravity="end"
/>
app:iconGravity="end" />

View file

@ -3,9 +3,9 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?colorSurface"
android:clickable="true"
android:focusable="true"
android:background="?colorSurface"
android:foregroundTint="?android:colorBackground">
<androidx.appcompat.widget.LinearLayoutCompat
@ -19,9 +19,9 @@
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_gravity="center"
tools:src="@drawable/ic_baseline_home_24"
android:contentDescription="@string/instance_logo"
android:scaleType="center" />
android:scaleType="center"
tools:src="@drawable/ic_baseline_home_24" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/text"

View file

@ -27,6 +27,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/account_pp"
android:layout_width="60dp"

View file

@ -16,8 +16,8 @@
-->
<com.google.android.material.card.MaterialCardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
xmlns:sparkbutton="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/cardview_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@ -288,8 +288,8 @@
android:layout_marginTop="6dp"
android:layout_marginEnd="6dp"
android:orientation="vertical"
tools:visibility="visible"
android:visibility="gone">
android:visibility="gone"
tools:visibility="visible">
<View
android:id="@+id/translation_border_view"
@ -313,10 +313,10 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:paddingStart="2dp"
android:background="?colorSurface"
android:paddingEnd="2dp"
android:elevation="2dp"
android:paddingStart="2dp"
android:paddingEnd="2dp"
android:text="@string/translation"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
@ -345,8 +345,7 @@
android:visibility="gone"
app:cardCornerRadius="8dp"
app:cardElevation="0dp"
app:strokeWidth="1dp"
>
app:strokeWidth="1dp">
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
@ -357,12 +356,12 @@
android:id="@+id/card_image_horizontal"
android:layout_width="match_parent"
android:layout_height="150dp"
android:padding="1dp"
android:adjustViewBounds="true"
android:visibility="gone"
android:padding="1dp"
android:scaleType="centerCrop"
tools:visibility="visible"
tools:src="@tools:sample/backgrounds/scenic" />
android:visibility="gone"
tools:src="@tools:sample/backgrounds/scenic"
tools:visibility="visible" />
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
@ -371,10 +370,10 @@
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/card_image_vertical"
android:layout_width="0dp"
android:padding="1dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:adjustViewBounds="true"
android:padding="1dp"
android:scaleType="centerCrop"
android:visibility="gone"
tools:src="@tools:sample/backgrounds/scenic"
@ -389,9 +388,9 @@
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/card_title"
android:maxLines="2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:maxLines="2"
tools:text="Title" />
<androidx.appcompat.widget.AppCompatTextView
@ -598,13 +597,13 @@
<com.google.android.material.button.MaterialButton
android:id="@+id/action_share"
style="@style/Widget.Material3.Button.OutlinedButton"
app:iconGravity="textStart"
app:iconPadding="0dp"
app:strokeColor="?colorPrimary"
android:layout_width="28dp"
android:layout_height="28dp"
android:adjustViewBounds="true"
app:icon="@drawable/ic_baseline_share_24" />
app:icon="@drawable/ic_baseline_share_24"
app:iconGravity="textStart"
app:iconPadding="0dp"
app:strokeColor="?colorPrimary" />
</androidx.appcompat.widget.LinearLayoutCompat>
<include
@ -633,11 +632,11 @@
<androidx.appcompat.widget.AppCompatImageButton
android:id="@+id/action_button_reply"
android:background="@color/transparent"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_gravity="center"
android:adjustViewBounds="true"
android:background="@color/transparent"
android:clickable="true"
android:contentDescription="@string/reply"
android:focusable="true"
@ -649,19 +648,15 @@
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:text="+"
tools:visibility="visible"
android:textColor="?colorControlNormal"
android:textSize="12sp"
android:visibility="gone"
tools:ignore="HardcodedText" />
tools:ignore="HardcodedText"
tools:visibility="visible" />
</androidx.appcompat.widget.LinearLayoutCompat>
<com.varunest.sparkbutton.SparkButton
android:id="@+id/action_button_boost"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/action_button_quote"
app:layout_constraintStart_toEndOf="@+id/action_button_reply_container"
app:layout_constraintTop_toTopOf="parent"
android:layout_width="48dp"
android:layout_height="48dp"
android:adjustViewBounds="true"
@ -669,6 +664,10 @@
app:activeImage="@drawable/ic_round_repeat_active_24"
app:iconSize="28dp"
app:inactiveImage="@drawable/ic_round_repeat_24"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/action_button_quote"
app:layout_constraintStart_toEndOf="@+id/action_button_reply_container"
app:layout_constraintTop_toTopOf="parent"
app:primaryColor="@color/boost_icon"
app:secondaryColor="@color/boost_icon" />
@ -692,10 +691,6 @@
<com.varunest.sparkbutton.SparkButton
android:id="@+id/action_button_favorite"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/action_button_bookmark"
app:layout_constraintStart_toEndOf="@+id/action_button_quote"
app:layout_constraintTop_toTopOf="parent"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_gravity="center"
@ -704,16 +699,16 @@
app:activeImage="@drawable/ic_round_star_24"
app:animationSpeed="1.5"
app:inactiveImage="@drawable/ic_round_star_border_24"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/action_button_bookmark"
app:layout_constraintStart_toEndOf="@+id/action_button_quote"
app:layout_constraintTop_toTopOf="parent"
app:primaryColor="@color/marked_icon"
app:secondaryColor="@color/marked_icon"
sparkbutton:iconSize="28dp" />
<com.varunest.sparkbutton.SparkButton
android:id="@+id/action_button_bookmark"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/action_button_translate"
app:layout_constraintStart_toEndOf="@+id/action_button_favorite"
app:layout_constraintTop_toTopOf="parent"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_gravity="center"
@ -722,6 +717,10 @@
app:activeImage="@drawable/ic_round_bookmark_24"
app:animationSpeed="1.5"
app:inactiveImage="@drawable/ic_round_bookmark_border_24"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/action_button_translate"
app:layout_constraintStart_toEndOf="@+id/action_button_favorite"
app:layout_constraintTop_toTopOf="parent"
app:primaryColor="@color/marked_icon"
app:secondaryColor="@color/marked_icon"
sparkbutton:iconSize="28dp" />
@ -729,20 +728,20 @@
<androidx.appcompat.widget.AppCompatImageButton
android:id="@+id/action_button_translate"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_gravity="center"
android:adjustViewBounds="true"
android:background="@color/transparent"
android:clickable="true"
android:focusable="true"
android:layout_width="48dp"
android:layout_height="48dp"
android:contentDescription="@string/translate"
android:focusable="true"
android:src="@drawable/ic_baseline_translate_24"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/action_button_maths"
app:layout_constraintStart_toEndOf="@+id/action_button_bookmark"
app:layout_constraintTop_toTopOf="parent"
android:visibility="gone"
tools:visibility="visible" />
@ -766,53 +765,53 @@
<androidx.appcompat.widget.AppCompatImageButton
android:id="@+id/status_add_custom_emoji"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_gravity="center"
android:adjustViewBounds="true"
android:background="@color/transparent"
android:clickable="true"
android:contentDescription="@string/add_reaction"
android:focusable="true"
android:src="@drawable/ic_baseline_emoji_emotions_24"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/status_emoji"
app:layout_constraintStart_toEndOf="@+id/action_button_maths"
app:layout_constraintTop_toTopOf="parent"
android:layout_width="48dp"
android:layout_height="48dp"
android:contentDescription="@string/add_reaction"
android:src="@drawable/ic_baseline_emoji_emotions_24"
android:layout_gravity="center"
android:adjustViewBounds="true"
android:clickable="true"
android:focusable="true"
android:visibility="gone"
tools:visibility="visible" />
<androidx.appcompat.widget.AppCompatImageButton
android:id="@+id/status_emoji"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_gravity="center"
android:adjustViewBounds="true"
android:background="@color/transparent"
android:clickable="true"
android:contentDescription="@string/add_reaction"
android:focusable="true"
android:src="@drawable/ic_baseline_add_reaction_24"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/action_button_more"
app:layout_constraintStart_toEndOf="@+id/status_add_custom_emoji"
app:layout_constraintTop_toTopOf="parent"
android:layout_width="48dp"
android:layout_height="48dp"
android:contentDescription="@string/add_reaction"
android:layout_gravity="center"
android:adjustViewBounds="true"
android:clickable="true"
android:focusable="true"
android:src="@drawable/ic_baseline_add_reaction_24"
android:visibility="gone"
tools:visibility="visible" />
<androidx.appcompat.widget.AppCompatImageButton
android:id="@+id/action_button_more"
android:background="@color/transparent"
android:layout_gravity="center|end"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
android:contentDescription="@string/display_options"
android:layout_width="48dp"
android:layout_height="48dp"
app:layout_constraintTop_toTopOf="parent"
android:clickable="true"
android:layout_gravity="center|end"
android:adjustViewBounds="true"
android:background="@color/transparent"
android:clickable="true"
android:contentDescription="@string/display_options"
android:focusable="true"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/ic_round_more_horiz_24" />
</androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -15,10 +15,10 @@
see <http://www.gnu.org/licenses>.
-->
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/art_container"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<androidx.appcompat.widget.AppCompatImageView
@ -37,12 +37,12 @@
android:id="@+id/bottom_banner"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="@+id/art_media"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
android:background="#44000000"
android:orientation="horizontal"
android:padding="10dp">
android:padding="10dp"
app:layout_constraintBottom_toBottomOf="@+id/art_media"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/art_pp"

View file

@ -15,8 +15,8 @@
see <http://www.gnu.org/licenses>
-->
<com.google.android.material.card.MaterialCardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/cardview_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"

View file

@ -18,10 +18,10 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/art_container"
android:layout_marginHorizontal="@dimen/card_margin"
android:layout_marginTop="@dimen/card_margin"
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
android:layout_marginHorizontal="@dimen/card_margin"
android:layout_marginTop="@dimen/card_margin">
<com.smarteist.autoimageslider.SliderView
android:id="@+id/art_media"

View file

@ -15,8 +15,8 @@
see <http://www.gnu.org/licenses>
-->
<com.google.android.material.card.MaterialCardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/cardview_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"

View file

@ -107,9 +107,9 @@
android:insetTop="0dp"
android:insetBottom="0dp"
android:padding="0dp"
app:icon="@drawable/ic_baseline_person_add_24"
app:iconGravity="textStart"
app:iconPadding="0dp"
app:icon="@drawable/ic_baseline_person_add_24"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/bio" />

View file

@ -15,10 +15,10 @@
see <http://www.gnu.org/licenses>.
-->
<com.google.android.material.card.MaterialCardView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/cardview_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="@dimen/card_margin"
android:layout_marginTop="@dimen/card_margin"
android:clipChildren="false"

View file

@ -15,8 +15,8 @@
see <http://www.gnu.org/licenses>
-->
<androidx.appcompat.widget.LinearLayoutCompat xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:id="@+id/tag_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">

View file

@ -17,8 +17,8 @@
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:background="?android:windowBackground"
android:layout_height="match_parent">
android:layout_height="match_parent"
android:background="?android:windowBackground">
<androidx.appcompat.widget.AppCompatImageButton
android:id="@+id/menu_icon"

View file

@ -16,11 +16,11 @@
-->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="?android:windowBackground"
android:layout_height="match_parent">
android:layout_height="match_parent"
android:background="?android:windowBackground">
<!-- Listview status -->
<FrameLayout

View file

@ -1,70 +1,70 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/media_root"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<androidx.appcompat.widget.AppCompatImageView
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:id="@+id/media"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="ContentDescription" />
<androidx.appcompat.widget.AppCompatImageView
app:layout_constraintBottom_toBottomOf="@+id/media"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@id/media"
android:id="@+id/play_video"
android:layout_width="wrap_content"
tools:visibility="visible"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:src="@drawable/ic_baseline_play_circle_filled_24"
android:visibility="gone" />
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/play_music"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="@+id/media"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@id/media"
tools:visibility="visible" />
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/play_music"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:src="@drawable/ic_baseline_audiotrack_24"
android:visibility="gone" />
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="@+id/media"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@id/media" />
<ImageView
android:id="@+id/view_hide"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@id/media"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_margin="5dp"
android:contentDescription="@string/visibility"
android:src="@drawable/ic_baseline_visibility_24" />
android:src="@drawable/ic_baseline_visibility_24"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@id/media" />
<ImageView
android:id="@+id/view_description"
app:layout_constraintBottom_toBottomOf="@+id/media"
app:layout_constraintEnd_toEndOf="parent"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
tools:visibility="visible"
android:layout_margin="5dp"
android:contentDescription="@string/description"
android:src="@drawable/ic_outline_note_alt_24"
android:visibility="gone" />
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="@+id/media"
app:layout_constraintEnd_toEndOf="parent"
tools:visibility="visible" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/count"

View file

@ -88,14 +88,14 @@
android:orientation="horizontal">
<androidx.appcompat.widget.AppCompatTextView
style="@style/TextAppearance.Material3.TitleSmall"
android:id="@+id/account_name"
style="@style/TextAppearance.Material3.TitleSmall"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:singleLine="true"
android:ellipsize="end"
android:paddingTop="@dimen/nav_header_vertical_spacing"
android:singleLine="true"
tools:text="@tools:sample/full_names" />
<ImageView
@ -118,16 +118,16 @@
android:orientation="horizontal">
<androidx.appcompat.widget.AppCompatTextView
style="@style/TextAppearance.Material3.TitleSmall"
android:id="@+id/account_acc"
tools:text="@tools:sample/full_names"
style="@style/TextAppearance.Material3.TitleSmall"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ellipsize="end"
android:gravity="center_vertical"
android:singleLine="true"
android:textSize="16sp" />
android:textSize="16sp"
tools:text="@tools:sample/full_names" />
<ImageView
android:id="@+id/instance_info"

View file

@ -8,11 +8,11 @@
android:layout_height="wrap_content"
android:layout_gravity="top|center_horizontal"
android:layout_marginStart="10dp"
android:paddingStart="5dp"
android:paddingEnd="5dp"
android:background="@drawable/shape_counter"
android:gravity="center"
android:padding="3dp"
android:paddingStart="5dp"
android:paddingEnd="5dp"
android:textColor="?colorOnErrorContainer"
android:textSize="11sp"
tools:text="9+" />

View file

@ -28,9 +28,9 @@
<androidx.appcompat.widget.AppCompatEditText
android:id="@+id/add_title"
android:hint="@string/title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/title"
android:importantForAutofill="noExcludeDescendants"
android:inputType="text"
android:singleLine="true" />
@ -128,9 +128,9 @@
</androidx.appcompat.widget.LinearLayoutCompat>
<TextView
android:layout_marginTop="10dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:text="@string/filter_action"
android:textSize="12sp" />
@ -148,6 +148,7 @@
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:orientation="vertical">
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="wrap_content"
@ -164,8 +165,8 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="30dp"
android:textSize="12sp"
android:text="@string/hide_with_warning_description" />
android:text="@string/hide_with_warning_description"
android:textSize="12sp" />
</androidx.appcompat.widget.LinearLayoutCompat>
<androidx.appcompat.widget.LinearLayoutCompat
@ -177,23 +178,23 @@
android:id="@+id/action_remove"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/hide_completely"
android:checked="true" />
android:checked="true"
android:text="@string/hide_completely" />
<androidx.appcompat.widget.AppCompatTextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="30dp"
android:textSize="12sp"
android:text="@string/hide_completely_description" />
android:text="@string/hide_completely_description"
android:textSize="12sp" />
</androidx.appcompat.widget.LinearLayoutCompat>
</RadioGroup>
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_marginTop="10dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:orientation="vertical">
<androidx.appcompat.widget.LinearLayoutCompat
@ -215,9 +216,9 @@
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/lv_keywords"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
android:layout_height="wrap_content"
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
<com.google.android.material.button.MaterialButton
android:id="@+id/add_keyword"

View file

@ -2,8 +2,8 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="@dimen/fab_margin"
android:orientation="vertical">
android:orientation="vertical"
android:padding="@dimen/fab_margin">
<androidx.appcompat.widget.AppCompatTextView
android:layout_width="wrap_content"

View file

@ -128,7 +128,6 @@
</com.google.android.material.button.MaterialButtonToggleGroup>
<com.google.android.material.button.MaterialButton
android:id="@+id/more"
style="@style/Widget.Material3.Button.TextButton"

View file

@ -1,36 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:id="@+id/icon"
tools:src="@drawable/ic_baseline_home_24"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true" />
tools:src="@drawable/ic_baseline_home_24" />
<TextView
android:layout_alignStart="@+id/icon"
android:layout_marginStart="2dp"
android:gravity="top|end"
android:id="@+id/tab_counter"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintStart_toEndOf="@+id/icon"
app:layout_constraintTop_toTopOf="parent"
android:layout_alignStart="@+id/icon"
android:layout_marginStart="2dp"
android:background="@drawable/shape_counter"
android:gravity="top|end"
android:paddingLeft="2dp"
android:paddingRight="2dp"
android:textSize="12sp"
android:visibility="gone"
app:layout_constraintStart_toEndOf="@+id/icon"
app:layout_constraintTop_toTopOf="parent"
tools:text="35"
tools:visibility="visible" />
</androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -1,16 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.appcompat.widget.LinearLayoutCompat xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="horizontal">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/icon"
tools:src="@drawable/nitter"
android:layout_width="15dp"
android:layout_height="15dp"
android:layout_gravity="center" />
android:layout_gravity="center"
tools:src="@drawable/nitter" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/title"
@ -18,11 +18,11 @@
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginStart="4dp"
tools:text="fedilab_app"
android:ellipsize="end"
android:maxWidth="150dp"
android:singleLine="true"
android:textSize="16sp" />
android:textSize="16sp"
tools:text="fedilab_app" />
<TextView
android:id="@+id/tab_counter"

View file

@ -225,55 +225,6 @@
app:drawableTopCompat="@drawable/ic_baseline_thumb_down_alt_24"
tools:ignore="HardcodedText" />
<TextView
android:id="@+id/peertube_reblog"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginStart="10dp"
android:layout_marginLeft="10dp"
android:layout_marginEnd="10dp"
android:layout_marginRight="10dp"
android:drawablePadding="5dp"
android:gravity="center_horizontal"
android:text="0"
android:visibility="gone"
app:drawableTopCompat="@drawable/ic_baseline_repeat_24"
tools:ignore="HardcodedText" />
<TextView
android:id="@+id/peertube_favorite"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginStart="10dp"
android:layout_marginLeft="10dp"
android:layout_marginEnd="10dp"
android:layout_marginRight="10dp"
android:drawablePadding="5dp"
android:gravity="center_horizontal"
android:text="0"
android:visibility="gone"
app:drawableTopCompat="@drawable/ic_baseline_star_24"
tools:ignore="HardcodedText" />
<TextView
android:id="@+id/peertube_bookmark"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginStart="10dp"
android:layout_marginLeft="10dp"
android:layout_marginEnd="10dp"
android:layout_marginRight="10dp"
android:drawablePadding="5dp"
android:gravity="center_horizontal"
android:text=""
android:visibility="gone"
app:drawableTopCompat="@drawable/ic_baseline_bookmark_24"
tools:ignore="HardcodedText" />
<ImageView
android:id="@+id/peertube_playlist"
android:layout_width="wrap_content"

View file

@ -11,10 +11,4 @@
android:icon="@drawable/ic_baseline_edit_24"
android:title="@string/edit"
app:showAsAction="ifRoom" />
<item
android:id="@+id/action_export"
android:icon="@drawable/ic_baseline_import_export_24"
android:title="@string/export_list"
android:visible="false"
app:showAsAction="ifRoom" />
</menu>

View file

@ -125,8 +125,6 @@
<color name="errorColor">#EF5350</color>
<color name="dark_icon_theme">#f3f3f3</color>

View file

@ -84,8 +84,8 @@
<SwitchPreferenceCompat
app:defaultValue="true"
app:iconSpaceReserved="false"
app:singleLineTitle="false"
app:key="@string/SET_RETRIEVE_METADATA_IF_URL_FROM_EXTERAL"
app:singleLineTitle="false"
app:title="@string/set_retrieve_metadata_share_from_extras" />
@ -104,9 +104,9 @@
app:useSimpleSummaryProvider="true" />
<SwitchPreferenceCompat
app:singleLineTitle="false"
app:iconSpaceReserved="false"
app:key="@string/SET_FORWARD_TAGS_IN_REPLY"
app:singleLineTitle="false"
app:title="@string/set_forward_tags" />

View file

@ -97,10 +97,10 @@
<androidx.preference.SeekBarPreference
android:defaultValue="110"
android:max="180"
app:singleLineTitle="false"
app:iconSpaceReserved="false"
app:key="@string/SET_FONT_SCALE_INT"
app:showSeekBarValue="true"
app:singleLineTitle="false"
app:title="@string/text_size" />
@ -116,28 +116,28 @@
<androidx.preference.SeekBarPreference
android:defaultValue="100"
android:max="1000"
app:singleLineTitle="false"
app:iconSpaceReserved="false"
app:key="@string/SET_VIDEO_CACHE"
app:showSeekBarValue="true"
app:singleLineTitle="false"
app:title="@string/set_video_cache" />
<androidx.preference.SeekBarPreference
android:defaultValue="5"
android:max="30"
app:singleLineTitle="false"
app:iconSpaceReserved="false"
app:key="@string/SET_NSFW_TIMEOUT"
app:showSeekBarValue="true"
app:singleLineTitle="false"
app:title="@string/set_nsfw_timeout" />
<androidx.preference.SeekBarPreference
android:defaultValue="3"
android:max="30"
app:singleLineTitle="false"
app:iconSpaceReserved="false"
app:key="@string/SET_MED_DESC_TIMEOUT"
app:showSeekBarValue="true"
app:singleLineTitle="false"
app:title="@string/set_med_desc_timeout" />
<ListPreference

View file

@ -10,7 +10,8 @@ import org.unifiedpush.android.embedded_fcm_distributor.EmbeddedDistributorRecei
public class EmbeddedDistrib extends EmbeddedDistributorReceiver {
@Override
public @NotNull String getEndpoint(@Nullable Context context, @NotNull String token, @NotNull String instance) {
public @NotNull
String getEndpoint(@Nullable Context context, @NotNull String token, @NotNull String instance) {
return "https://gotify.fedilab.app/FCM?v2&token=" + token + "&instance=" + instance;
}
}

View file

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:id="@+id/media_route_button"
android:title="@string/cast"
app:actionProviderClass="androidx.mediarouter.app.MediaRouteActionProvider"
app:showAsAction="always" />
</menu>

View file

@ -1,8 +1,8 @@
package app.fedilab.android;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.*;
import org.junit.Test;
/**
* Example local unit test, which will execute on the development machine (host).