video cache

This commit is contained in:
Thomas 2020-05-16 11:32:09 +02:00
parent d5ef4f05a1
commit dd26a6aeb5
78 changed files with 733 additions and 539 deletions

View File

@ -1258,7 +1258,7 @@ public abstract class BaseMainActivity extends BaseActivity
int lastReleaseNoteRead = sharedpreferences.getInt(Helper.SET_POPUP_RELEASE_NOTES, 0);
int versionCode = BuildConfig.VERSION_CODE;
if (lastReleaseNoteRead != versionCode ) { //Need to push release notes
if (lastReleaseNoteRead != versionCode) { //Need to push release notes
if (social == UpdateAccountInfoAsyncTask.SOCIAL.MASTODON || social == UpdateAccountInfoAsyncTask.SOCIAL.PLEROMA) {
new RetrieveRemoteDataAsyncTask(BaseMainActivity.this, BaseMainActivity.this).execute();
}
@ -1279,12 +1279,12 @@ public abstract class BaseMainActivity extends BaseActivity
Button liberapay_support = dialogReleaseNoteView.findViewById(R.id.liberapay_support);
release_title.setText(getString(R.string.release_note_title, BuildConfig.VERSION_NAME));
release_notes.setText(finalContent);
if( BuildConfig.DONATIONS) {
if (BuildConfig.DONATIONS) {
liberapay_support.setVisibility(View.VISIBLE);
}else{
} else {
liberapay_support.setVisibility(View.GONE);
}
liberapay_support.setOnClickListener(v->{
liberapay_support.setOnClickListener(v -> {
Intent intentLiberapay = new Intent(Intent.ACTION_VIEW);
intentLiberapay.setData(Uri.parse("https://liberapay.com/tom79"));
try {
@ -1693,7 +1693,7 @@ public abstract class BaseMainActivity extends BaseActivity
}
});
}
if( trackingDomains != null){
if (trackingDomains != null) {
trackingDomains = null;
}
if (hidde_menu != null)

View File

@ -60,10 +60,10 @@ import androidx.recyclerview.widget.RecyclerView;
import com.google.android.exoplayer2.ExoPlayerFactory;
import com.google.android.exoplayer2.SimpleExoPlayer;
import com.google.android.exoplayer2.source.ExtractorMediaSource;
import com.google.android.exoplayer2.source.ProgressiveMediaSource;
import com.google.android.exoplayer2.ui.AspectRatioFrameLayout;
import com.google.android.exoplayer2.ui.PlaybackControlView;
import com.google.android.exoplayer2.ui.SimpleExoPlayerView;
import com.google.android.exoplayer2.ui.PlayerControlView;
import com.google.android.exoplayer2.ui.PlayerView;
import com.google.android.exoplayer2.upstream.DataSource;
import com.google.android.exoplayer2.upstream.DefaultDataSourceFactory;
import com.google.android.exoplayer2.util.Util;
@ -96,6 +96,7 @@ import app.fedilab.android.client.Entities.Status;
import app.fedilab.android.client.Entities.StatusDrawerParams;
import app.fedilab.android.client.TLSSocketFactory;
import app.fedilab.android.drawers.StatusListAdapter;
import app.fedilab.android.helper.CacheDataSourceFactory;
import app.fedilab.android.helper.CrossActions;
import app.fedilab.android.helper.FullScreenMediaController;
import app.fedilab.android.helper.Helper;
@ -130,7 +131,7 @@ public class PeertubeActivity extends BaseActivity implements OnRetrievePeertube
private ScrollView peertube_information_container;
private Peertube peertube;
private TextView toolbar_title;
private SimpleExoPlayerView playerView;
private PlayerView playerView;
private SimpleExoPlayer player;
private boolean fullScreenMode;
private Dialog fullScreenDialog;
@ -278,7 +279,7 @@ public class PeertubeActivity extends BaseActivity implements OnRetrievePeertube
peertube_information_container.setVisibility(View.VISIBLE);
}
});
String user_agent = sharedpreferences.getString(Helper.SET_CUSTOM_USER_AGENT, null);
String user_agent = sharedpreferences.getString(Helper.SET_CUSTOM_USER_AGENT, Helper.USER_AGENT);
if (user_agent != null) {
webview_video.getSettings().setUserAgentString(user_agent);
}
@ -369,40 +370,7 @@ public class PeertubeActivity extends BaseActivity implements OnRetrievePeertube
case R.id.action_comment:
if (MainActivity.social == UpdateAccountInfoAsyncTask.SOCIAL.MASTODON || MainActivity.social == UpdateAccountInfoAsyncTask.SOCIAL.PLEROMA) {
Toasty.info(PeertubeActivity.this, getString(R.string.retrieve_remote_status), Toast.LENGTH_LONG).show();
new AsyncTask<Void, Void, Void>() {
private List<app.fedilab.android.client.Entities.Status> remoteStatuses;
private WeakReference<Context> contextReference = new WeakReference<>(PeertubeActivity.this);
@Override
protected Void doInBackground(Void... voids) {
if (peertube != null) {
APIResponse search = new API(contextReference.get()).search("https://" + peertube.getAccount().getHost() + "/videos/watch/" + peertube.getUuid());
if (search != null && search.getResults() != null) {
remoteStatuses = search.getResults().getStatuses();
}
}
return null;
}
@Override
protected void onPostExecute(Void result) {
Intent intent = new Intent(contextReference.get(), TootActivity.class);
Bundle b = new Bundle();
if (remoteStatuses == null || remoteStatuses.size() == 0) {
Toasty.error(contextReference.get(), getString(R.string.toast_error), Toast.LENGTH_SHORT).show();
return;
}
if (remoteStatuses.get(0).getReblog() != null) {
b.putParcelable("tootReply", remoteStatuses.get(0).getReblog());
} else {
b.putParcelable("tootReply", remoteStatuses.get(0));
}
intent.putExtras(b); //Put your id to your next Intent
contextReference.get().startActivity(intent);
}
}.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new commentTask(new WeakReference<>(PeertubeActivity.this), peertube).execute();
} else if (MainActivity.social == UpdateAccountInfoAsyncTask.SOCIAL.PEERTUBE) {
if (!peertube.isCommentsEnabled()) {
Toasty.info(PeertubeActivity.this, getString(R.string.comment_no_allowed_peertube), Toast.LENGTH_LONG).show();
@ -443,6 +411,52 @@ public class PeertubeActivity extends BaseActivity implements OnRetrievePeertube
}
}
private static class commentTask extends AsyncTask<Void, Void, app.fedilab.android.client.Entities.Status>{
private WeakReference<Context> contextReference;
private Peertube peertube;
commentTask(WeakReference<Context> contextReference, Peertube peertube){
this.peertube = peertube;
this.contextReference = contextReference;
}
@Override
protected app.fedilab.android.client.Entities.Status doInBackground(Void... voids) {
List<app.fedilab.android.client.Entities.Status> remoteStatuses = null;
if (peertube != null) {
APIResponse search = new API(contextReference.get()).search("https://" + peertube.getAccount().getHost() + "/videos/watch/" + peertube.getUuid());
if (search != null && search.getResults() != null) {
remoteStatuses = search.getResults().getStatuses();
}
}
if( remoteStatuses != null && remoteStatuses.size() > 0) {
return remoteStatuses.get(0);
}else {
return null;
}
}
@Override
protected void onPostExecute(app.fedilab.android.client.Entities.Status remoteStatuses) {
Intent intent = new Intent(contextReference.get(), TootActivity.class);
Bundle b = new Bundle();
if (remoteStatuses == null) {
Toasty.error(contextReference.get(), contextReference.get().getString(R.string.toast_error), Toast.LENGTH_SHORT).show();
return;
}
if (remoteStatuses.getReblog() != null) {
b.putParcelable("tootReply", remoteStatuses.getReblog());
} else {
b.putParcelable("tootReply", remoteStatuses);
}
intent.putExtras(b); //Put your id to your next Intent
contextReference.get().startActivity(intent);
}
}
public FullScreenMediaController.fullscreen getFullscreen() {
return fullscreen;
}
@ -583,16 +597,24 @@ public class PeertubeActivity extends BaseActivity implements OnRetrievePeertube
if (mode == Helper.VIDEO_MODE_DIRECT) {
DataSource.Factory dataSourceFactory = new DefaultDataSourceFactory(PeertubeActivity.this,
Util.getUserAgent(PeertubeActivity.this, "Mastalab"), null);
ExtractorMediaSource videoSource = new ExtractorMediaSource.Factory(dataSourceFactory)
.createMediaSource(Uri.parse(apiResponse.getPeertubes().get(0).getFileUrl(null, apiResponse.getPeertubes().get(0).isStreamService())));
String userAgent = sharedpreferences.getString(Helper.SET_CUSTOM_USER_AGENT, Helper.USER_AGENT);
int video_cache = sharedpreferences.getInt(Helper.SET_VIDEO_CACHE, Helper.DEFAULT_VIDEO_CACHE_MB);
ProgressiveMediaSource videoSource;
if( video_cache == 0) {
DataSource.Factory dataSourceFactory = new DefaultDataSourceFactory(PeertubeActivity.this,
Util.getUserAgent(PeertubeActivity.this, userAgent), null);
videoSource = new ProgressiveMediaSource.Factory(dataSourceFactory)
.createMediaSource(Uri.parse(apiResponse.getPeertubes().get(0).getFileUrl(null, apiResponse.getPeertubes().get(0).isStreamService())));
}else{
CacheDataSourceFactory cacheDataSourceFactory = new CacheDataSourceFactory(PeertubeActivity.this, video_cache * 1024 * 1024, 5 * 1024 * 1024);
videoSource = new ProgressiveMediaSource.Factory(cacheDataSourceFactory)
.createMediaSource(Uri.parse(apiResponse.getPeertubes().get(0).getFileUrl(null, apiResponse.getPeertubes().get(0).isStreamService())));
}
player = ExoPlayerFactory.newSimpleInstance(PeertubeActivity.this);
playerView.setPlayer(player);
loader.setVisibility(View.GONE);
player.prepare(videoSource);
player.setPlayWhenReady(true);
}
@ -777,7 +799,7 @@ public class PeertubeActivity extends BaseActivity implements OnRetrievePeertube
if (playerView != null) {
loader.setVisibility(View.VISIBLE);
long position = player.getCurrentPosition();
PlaybackControlView controlView = playerView.findViewById(R.id.exo_controller);
PlayerControlView controlView = playerView.findViewById(R.id.exo_controller);
resolution = controlView.findViewById(R.id.resolution);
resolution.setText(String.format("%sp", res));
if (mode == Helper.VIDEO_MODE_DIRECT) {
@ -786,11 +808,19 @@ public class PeertubeActivity extends BaseActivity implements OnRetrievePeertube
player = ExoPlayerFactory.newSimpleInstance(PeertubeActivity.this);
playerView.setPlayer(player);
loader.setVisibility(View.GONE);
DataSource.Factory dataSourceFactory = new DefaultDataSourceFactory(PeertubeActivity.this,
Util.getUserAgent(PeertubeActivity.this, "Mastalab"), null);
ExtractorMediaSource videoSource = new ExtractorMediaSource.Factory(dataSourceFactory)
.createMediaSource(Uri.parse(peertube.getFileUrl(res, peertube.isStreamService())));
String userAgent = sharedpreferences.getString(Helper.SET_CUSTOM_USER_AGENT, Helper.USER_AGENT);
int video_cache = sharedpreferences.getInt(Helper.SET_VIDEO_CACHE, Helper.DEFAULT_VIDEO_CACHE_MB);
ProgressiveMediaSource videoSource;
if( video_cache == 0) {
DataSource.Factory dataSourceFactory = new DefaultDataSourceFactory(PeertubeActivity.this,
Util.getUserAgent(PeertubeActivity.this, userAgent), null);
videoSource = new ProgressiveMediaSource.Factory(dataSourceFactory)
.createMediaSource(Uri.parse(peertube.getFileUrl(res, peertube.isStreamService())));
}else{
CacheDataSourceFactory cacheDataSourceFactory = new CacheDataSourceFactory(PeertubeActivity.this, video_cache * 1024 * 1024, 5 * 1024 * 1024);
videoSource = new ProgressiveMediaSource.Factory(cacheDataSourceFactory)
.createMediaSource(Uri.parse(peertube.getFileUrl(res, peertube.isStreamService())));
}
player.prepare(videoSource);
player.seekTo(0, position);
player.setPlayWhenReady(true);
@ -842,7 +872,7 @@ public class PeertubeActivity extends BaseActivity implements OnRetrievePeertube
private void initFullscreenButton() {
PlaybackControlView controlView = playerView.findViewById(R.id.exo_controller);
PlayerControlView controlView = playerView.findViewById(R.id.exo_controller);
fullScreenIcon = controlView.findViewById(R.id.exo_fullscreen_icon);
View fullScreenButton = controlView.findViewById(R.id.exo_fullscreen_button);
fullScreenButton.setOnClickListener(v -> {
@ -854,7 +884,7 @@ public class PeertubeActivity extends BaseActivity implements OnRetrievePeertube
}
private void initResolution() {
PlaybackControlView controlView = playerView.findViewById(R.id.exo_controller);
PlayerControlView controlView = playerView.findViewById(R.id.exo_controller);
resolution = controlView.findViewById(R.id.resolution);
resolution.setText(String.format("%sp", peertube.getResolution().get(0)));
resolution.setOnClickListener(v -> displayResolution());

View File

@ -154,7 +154,7 @@ public class SettingsActivity extends BaseActivity {
}
@Override
public void onDestroy(){
public void onDestroy() {
super.onDestroy();
}

View File

@ -125,7 +125,7 @@ public class WebviewConnectActivity extends BaseActivity {
webView = findViewById(R.id.webviewConnect);
clearCookies(WebviewConnectActivity.this);
webView.getSettings().setJavaScriptEnabled(true);
String user_agent = sharedpreferences.getString(Helper.SET_CUSTOM_USER_AGENT, null);
String user_agent = sharedpreferences.getString(Helper.SET_CUSTOM_USER_AGENT, Helper.USER_AGENT);
if (user_agent != null) {
webView.getSettings().setUserAgentString(user_agent);
}

View File

@ -33,7 +33,6 @@ import java.util.List;
import javax.net.ssl.HttpsURLConnection;
import app.fedilab.android.R;
import app.fedilab.android.helper.Helper;
import app.fedilab.android.sqlite.DomainBlockDAO;
import app.fedilab.android.sqlite.Sqlite;
import es.dmoral.toasty.Toasty;

View File

@ -2205,7 +2205,7 @@ public class API {
JSONObject resobj = new JSONObject(response);
JSONObject jsonObject = resobj.getJSONObject("software");
String name = jsonObject.getString("name").toUpperCase();
if( name.compareTo("CORGIDON") == 0 ){
if (name.compareTo("CORGIDON") == 0) {
name = "MASTODON";
}
instanceNodeInfo.setName(name);
@ -3699,14 +3699,16 @@ public class API {
if (apiResponse.getStatuses() != null && apiResponse.getStatuses().size() > 0) {
for (Status status : apiResponse.getStatuses()) {
if (status.getMedia_attachments() != null) {
String statusSerialized = Helper.statusToStringStorage(status);
for (Attachment attachment : status.getMedia_attachments()) {
Status newStatus = Helper.restoreStatusFromString(statusSerialized);
if (newStatus == null)
break;
newStatus.setArt_attachment(attachment);
apiResponseReply.getStatuses().add(newStatus);
}
try {
String statusSerialized = Helper.statusToStringStorage(status);
for (Attachment attachment : status.getMedia_attachments()) {
Status newStatus = Helper.restoreStatusFromString(statusSerialized);
if (newStatus == null)
break;
newStatus.setArt_attachment(attachment);
apiResponseReply.getStatuses().add(newStatus);
}
}catch (Exception ignored){}
}
}
}

View File

@ -500,10 +500,11 @@ public class ManageTimelines {
if (mPageReferenceMap != null) {
FragmentTransaction fragTransaction = ((MainActivity) context).getSupportFragmentManager().beginTransaction();
DisplayStatusFragment displayStatusFragment = (DisplayStatusFragment) mPageReferenceMap.get(tl.getPosition());
assert displayStatusFragment != null;
fragTransaction.detach(displayStatusFragment);
fragTransaction.attach(displayStatusFragment);
fragTransaction.commit();
if (displayStatusFragment != null) {
fragTransaction.detach(displayStatusFragment);
fragTransaction.attach(displayStatusFragment);
fragTransaction.commit();
}
}
}
});

View File

@ -310,31 +310,42 @@ public class Status implements Parcelable {
}
}
matcher = Helper.bibliogramPattern.matcher(content);
boolean bibliogram = sharedpreferences.getBoolean(Helper.SET_BIBLIOGRAM, false);
if (bibliogram) {
while (matcher.find()) {
final String bibliogram_directory = matcher.group(2);
String bibliogramHost = sharedpreferences.getString(Helper.SET_BIBLIOGRAM_HOST, Helper.DEFAULT_BIBLIOGRAM_HOST).toLowerCase();
content = content.replaceAll("https://" + Pattern.quote(matcher.group()), Matcher.quoteReplacement("https://" + bibliogramHost + bibliogram_directory));
content = content.replaceAll(">" + Pattern.quote(matcher.group()), Matcher.quoteReplacement(">" + bibliogramHost + bibliogram_directory));
}
}
matcher = Helper.ouichesPattern.matcher(content);
while (matcher.find()) {
Attachment attachment = new Attachment();
attachment.setType("audio");
String tag = matcher.group(1);
attachment.setId(tag);
if( tag == null){
continue;
}
attachment.setRemote_url("http://ouich.es/mp3/"+tag+".mp3");
attachment.setUrl("http://ouich.es/mp3/"+tag+".mp3");
if( status.getMedia_attachments() == null) {
status.setMedia_attachments(new ArrayList<>());
}
boolean alreadyAdded = false;
for(Attachment at: status.getMedia_attachments()){
if( tag.compareTo(at.getId()) == 0 ){
alreadyAdded = true;
break;
}
}
if( !alreadyAdded) {
status.getMedia_attachments().add(attachment);
}
Attachment attachment = new Attachment();
attachment.setType("audio");
String tag = matcher.group(1);
attachment.setId(tag);
if (tag == null) {
continue;
}
attachment.setRemote_url("http://ouich.es/mp3/" + tag + ".mp3");
attachment.setUrl("http://ouich.es/mp3/" + tag + ".mp3");
if (status.getMedia_attachments() == null) {
status.setMedia_attachments(new ArrayList<>());
}
boolean alreadyAdded = false;
for (Attachment at : status.getMedia_attachments()) {
if (tag.compareTo(at.getId()) == 0) {
alreadyAdded = true;
break;
}
}
if (!alreadyAdded) {
status.getMedia_attachments().add(attachment);
}
}
Pattern aLink = Pattern.compile("<a((?!href).)*href=\"([^\"]*)\"[^>]*(((?!</a).)*)</a>");

View File

@ -2289,6 +2289,15 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
url = url.replaceAll("https://" + Pattern.quote(matcher.group()), Matcher.quoteReplacement("https://" + nitterHost + nitter_directory));
}
}
boolean bibliogram = sharedpreferences.getBoolean(Helper.SET_BIBLIOGRAM, false);
if (bibliogram) {
Matcher matcher = Helper.bibliogramPattern.matcher(url);
while (matcher.find()) {
final String bibliogram_directory = matcher.group(2);
String bibliogramHost = sharedpreferences.getString(Helper.SET_BIBLIOGRAM_HOST, Helper.DEFAULT_BIBLIOGRAM_HOST).toLowerCase();
url = url.replaceAll("https://" + Pattern.quote(matcher.group()), Matcher.quoteReplacement("https://" + bibliogramHost + bibliogram_directory));
}
}
Helper.openBrowser(context, url);
});
} else if (card.getType().toLowerCase().equals("video") && (display_video_preview || (type == RetrieveFeedsAsyncTask.Type.CONTEXT && viewHolder.getAdapterPosition() == conversationPosition))) {
@ -2298,7 +2307,7 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
.into(holder.webview_preview_card);
holder.status_cardview.setVisibility(View.GONE);
holder.status_cardview_video.setVisibility(View.VISIBLE);
String user_agent = sharedpreferences.getString(Helper.SET_CUSTOM_USER_AGENT, null);
String user_agent = sharedpreferences.getString(Helper.SET_CUSTOM_USER_AGENT, Helper.USER_AGENT);
if (user_agent != null) {
holder.status_cardview_webview.getSettings().setUserAgentString(user_agent);
}

View File

@ -275,7 +275,7 @@ public class ColorSettingsFragment extends PreferenceFragmentCompat implements S
entryValues[2] = String.valueOf(Helper.THEME_BLACK);
pref_theme_picker.setEntries(entries);
int default_theme_value;
switch (theme){
switch (theme) {
case Helper.THEME_LIGHT:
default_theme_value = 1;
break;

View File

@ -15,6 +15,7 @@ package app.fedilab.android.fragments;
* see <http://www.gnu.org/licenses>. */
import android.annotation.SuppressLint;
import android.annotation.TargetApi;
import android.app.TimePickerDialog;
import android.content.ComponentName;
@ -54,7 +55,6 @@ import android.widget.TextView;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.widget.SwitchCompat;
import androidx.fragment.app.Fragment;
@ -345,6 +345,7 @@ public class ContentSettingsFragment extends Fragment implements OnRetrieveRemot
}
context = getActivity();
assert context != null;
SharedPreferences sharedpreferences = context.getSharedPreferences(Helper.APP_PREFS, MODE_PRIVATE);
int theme = sharedpreferences.getInt(Helper.SET_THEME, Helper.THEME_DARK);
@ -468,9 +469,9 @@ public class ContentSettingsFragment extends Fragment implements OnRetrieveRemot
Button update_tracking_domains = rootView.findViewById(R.id.update_tracking_domains);
update_tracking_domains.setOnClickListener(v -> {
new DownloadTrackingDomainsAsyncTask(Objects.requireNonNull(getActivity()), update_tracking_domains).execute();
});
update_tracking_domains.setOnClickListener(v ->
new DownloadTrackingDomainsAsyncTask(Objects.requireNonNull(getActivity()), update_tracking_domains).execute()
);
Spinner set_attachment_group = rootView.findViewById(R.id.set_attachment_group);
@ -837,7 +838,7 @@ public class ContentSettingsFragment extends Fragment implements OnRetrieveRemot
TextView set_user_agent = rootView.findViewById(R.id.set_user_agent);
String user_agent = sharedpreferences.getString(Helper.SET_CUSTOM_USER_AGENT, null);
String user_agent = sharedpreferences.getString(Helper.SET_CUSTOM_USER_AGENT, Helper.USER_AGENT);
if (user_agent != null) {
set_user_agent.setText(user_agent);
@ -922,6 +923,55 @@ public class ContentSettingsFragment extends Fragment implements OnRetrieveRemot
}
});
TextView set_bibliogram_host = rootView.findViewById(R.id.set_bibliogram_host);
boolean bibliogram = sharedpreferences.getBoolean(Helper.SET_BIBLIOGRAM, false);
final SwitchCompat set_bibliogram = rootView.findViewById(R.id.set_bibliogram);
set_bibliogram.setChecked(bibliogram);
set_bibliogram.setOnClickListener(v -> {
SharedPreferences.Editor editor = sharedpreferences.edit();
editor.putBoolean(Helper.SET_BIBLIOGRAM, set_bibliogram.isChecked());
editor.apply();
if (set_bibliogram.isChecked()) {
set_bibliogram_host.setVisibility(View.VISIBLE);
} else {
set_bibliogram_host.setVisibility(View.GONE);
}
});
if (bibliogram) {
set_bibliogram_host.setVisibility(View.VISIBLE);
} else {
set_bibliogram_host.setVisibility(View.GONE);
}
String bibliogramHost = sharedpreferences.getString(Helper.SET_BIBLIOGRAM_HOST, null);
if (bibliogramHost != null) {
set_bibliogram_host.setText(bibliogramHost);
}
set_bibliogram_host.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
}
@Override
public void afterTextChanged(Editable s) {
SharedPreferences.Editor editor = sharedpreferences.edit();
if (s.toString().trim().length() > 0) {
editor.putString(Helper.SET_BIBLIOGRAM_HOST, s.toString().toLowerCase().trim());
} else {
editor.putString(Helper.SET_BIBLIOGRAM_HOST, null);
}
editor.apply();
}
});
boolean long_press_media = sharedpreferences.getBoolean(Helper.SET_LONG_PRESS_MEDIA, true);
final SwitchCompat set_long_press_media = rootView.findViewById(R.id.set_long_press_media);
set_long_press_media.setChecked(long_press_media);
@ -976,6 +1026,32 @@ public class ContentSettingsFragment extends Fragment implements OnRetrieveRemot
getActivity().recreate();
});
int video_cache_size = sharedpreferences.getInt(Helper.SET_VIDEO_CACHE, Helper.DEFAULT_VIDEO_CACHE_MB);
SeekBar set_video_cache_size = rootView.findViewById(R.id.set_video_cache_size);
set_video_cache_size.setMax(5*Helper.DEFAULT_VIDEO_CACHE_MB);
set_video_cache_size.setProgress(video_cache_size);
TextView set_video_cache = rootView.findViewById(R.id.set_video_cache);
set_video_cache.setText(String.valueOf(video_cache_size));
set_video_cache_size.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
@Override
public void onStopTrackingTouch(SeekBar seekBar) {
}
@Override
public void onStartTrackingTouch(SeekBar seekBar) {
}
@Override
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
set_video_cache.setText(String.valueOf(progress));
SharedPreferences.Editor editor = sharedpreferences.edit();
editor.putInt(Helper.SET_VIDEO_CACHE, progress);
editor.apply();
}
});
int truncate_toots_size = sharedpreferences.getInt(Helper.SET_TRUNCATE_TOOTS_SIZE, 0);
SeekBar set_truncate_size = rootView.findViewById(R.id.set_truncate_size);
set_truncate_size.setMax(20);
@ -1543,40 +1619,37 @@ public class ContentSettingsFragment extends Fragment implements OnRetrieveRemot
final ArrayAdapter<String> arrayAdapter = new ArrayAdapter<>(context, android.R.layout.simple_list_item_1, stringArray);
dialog.setNegativeButton(R.string.cancel, (dialog1, position) -> dialog1.dismiss());
dialog.setAdapter(arrayAdapter, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int position) {
String visibility = "public";
dialog.setAdapter(arrayAdapter, (dialog12, position) -> {
String visibility = "public";
switch (position) {
case 0:
visibility = "public";
set_toot_visibility.setImageResource(R.drawable.ic_public);
break;
case 1:
visibility = "unlisted";
set_toot_visibility.setImageResource(R.drawable.ic_lock_open);
break;
case 2:
visibility = "private";
set_toot_visibility.setImageResource(R.drawable.ic_lock_outline);
break;
case 3:
visibility = "direct";
set_toot_visibility.setImageResource(R.drawable.ic_mail_outline);
break;
}
if (account != null) {
SharedPreferences.Editor editor = sharedpreferences12.edit();
editor.putString(Helper.SET_TOOT_VISIBILITY + "@" + account.getAcct() + "@" + account.getInstance(), visibility);
editor.apply();
Toasty.info(context, context.getString(R.string.toast_visibility_changed, "@" + account.getAcct() + "@" + account.getInstance()), Toast.LENGTH_SHORT).show();
} else {
Toasty.error(context, context.getString(R.string.toast_error), Toast.LENGTH_LONG).show();
}
dialog.dismiss();
switch (position) {
case 0:
visibility = "public";
set_toot_visibility.setImageResource(R.drawable.ic_public);
break;
case 1:
visibility = "unlisted";
set_toot_visibility.setImageResource(R.drawable.ic_lock_open);
break;
case 2:
visibility = "private";
set_toot_visibility.setImageResource(R.drawable.ic_lock_outline);
break;
case 3:
visibility = "direct";
set_toot_visibility.setImageResource(R.drawable.ic_mail_outline);
break;
}
if (account != null) {
SharedPreferences.Editor editor = sharedpreferences12.edit();
editor.putString(Helper.SET_TOOT_VISIBILITY + "@" + account.getAcct() + "@" + account.getInstance(), visibility);
editor.apply();
Toasty.info(context, context.getString(R.string.toast_visibility_changed, "@" + account.getAcct() + "@" + account.getInstance()), Toast.LENGTH_SHORT).show();
} else {
Toasty.error(context, context.getString(R.string.toast_error), Toast.LENGTH_LONG).show();
}
dialog12.dismiss();
});
dialog.show();
});
@ -2175,6 +2248,7 @@ public class ContentSettingsFragment extends Fragment implements OnRetrieveRemot
set_change_locale.setSelection(positionSpinnerLanguage);
countLanguage = 0;
set_change_locale.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@SuppressLint("ApplySharedPref")
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
if (countLanguage > 0) {

View File

@ -51,8 +51,9 @@ import com.github.chrisbanes.photoview.PhotoView;
import com.google.android.exoplayer2.ExoPlayerFactory;
import com.google.android.exoplayer2.Player;
import com.google.android.exoplayer2.SimpleExoPlayer;
import com.google.android.exoplayer2.source.ExtractorMediaSource;
import com.google.android.exoplayer2.ui.SimpleExoPlayerView;
import com.google.android.exoplayer2.source.ProgressiveMediaSource;
import com.google.android.exoplayer2.ui.PlayerView;
import com.google.android.exoplayer2.upstream.DataSource;
import com.google.android.exoplayer2.upstream.DefaultDataSourceFactory;
import com.google.android.exoplayer2.util.Util;
@ -70,6 +71,7 @@ import app.fedilab.android.R;
import app.fedilab.android.activities.SlideMediaActivity;
import app.fedilab.android.client.Entities.Attachment;
import app.fedilab.android.client.TLSSocketFactory;
import app.fedilab.android.helper.CacheDataSourceFactory;
import app.fedilab.android.helper.Helper;
import app.fedilab.android.webview.CustomWebview;
import app.fedilab.android.webview.MastalabWebChromeClient;
@ -132,7 +134,7 @@ public class MediaSliderFragment extends Fragment implements MediaPlayer.OnCompl
ImageView next = rootView.findViewById(R.id.media_next);
imageView = rootView.findViewById(R.id.media_picture);
SimpleExoPlayerView videoView = rootView.findViewById(R.id.media_video);
PlayerView videoView = rootView.findViewById(R.id.media_video);
if (theme == Helper.THEME_BLACK) {
changeDrawableColor(context, prev, R.color.dark_icon);
changeDrawableColor(context, next, R.color.dark_icon);
@ -236,10 +238,20 @@ public class MediaSliderFragment extends Fragment implements MediaPlayer.OnCompl
}
videoView.setVisibility(View.VISIBLE);
Uri uri = Uri.parse(url);
DataSource.Factory dataSourceFactory = new DefaultDataSourceFactory(context,
Util.getUserAgent(context, "Fedilab"), null);
ExtractorMediaSource videoSource = new ExtractorMediaSource.Factory(dataSourceFactory)
.createMediaSource(uri);
String userAgent = sharedpreferences.getString(Helper.SET_CUSTOM_USER_AGENT, Helper.USER_AGENT);
int video_cache = sharedpreferences.getInt(Helper.SET_VIDEO_CACHE, Helper.DEFAULT_VIDEO_CACHE_MB);
ProgressiveMediaSource videoSource;
if( video_cache == 0) {
DataSource.Factory dataSourceFactory = new DefaultDataSourceFactory(context,
Util.getUserAgent(context, userAgent), null);
videoSource = new ProgressiveMediaSource.Factory(dataSourceFactory)
.createMediaSource(uri);
}else{
CacheDataSourceFactory cacheDataSourceFactory = new CacheDataSourceFactory(context, video_cache * 1024 * 1024, 5 * 1024 * 1024);
videoSource = new ProgressiveMediaSource.Factory(cacheDataSourceFactory)
.createMediaSource(uri);
}
player = ExoPlayerFactory.newSimpleInstance(context);
if (type.toLowerCase().equals("gifv"))
player.setRepeatMode(Player.REPEAT_MODE_ONE);
@ -278,7 +290,7 @@ public class MediaSliderFragment extends Fragment implements MediaPlayer.OnCompl
webview_video.setWebChromeClient(mastalabWebChromeClient);
webview_video.getSettings().setDomStorageEnabled(true);
webview_video.getSettings().setAppCacheEnabled(true);
String user_agent = sharedpreferences.getString(Helper.SET_CUSTOM_USER_AGENT, null);
String user_agent = sharedpreferences.getString(Helper.SET_CUSTOM_USER_AGENT, Helper.USER_AGENT);
if (user_agent != null) {
webview_video.getSettings().setUserAgentString(user_agent);
}
@ -453,6 +465,10 @@ public class MediaSliderFragment extends Fragment implements MediaPlayer.OnCompl
}
} catch (Exception ignored) {
}
if (timer != null) {
timer.cancel();
timer = null;
}
super.onDestroy();
}

View File

@ -1,4 +1,48 @@
package app.fedilab.android.helper;
public class CacheDataSourceFactory {
}
import android.content.Context;
import android.content.SharedPreferences;
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;
import com.google.android.exoplayer2.upstream.cache.LeastRecentlyUsedCacheEvictor;
import com.google.android.exoplayer2.upstream.cache.SimpleCache;
import java.io.File;
public class CacheDataSourceFactory implements DataSource.Factory {
private final Context context;
private final DefaultDataSourceFactory defaultDatasourceFactory;
private final long maxFileSize, maxCacheSize;
public CacheDataSourceFactory(Context context, long maxCacheSize, long maxFileSize) {
super();
this.context = context;
this.maxCacheSize = maxCacheSize;
this.maxFileSize = maxFileSize;
SharedPreferences sharedpreferences = context.getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
String userAgent = sharedpreferences.getString(Helper.SET_CUSTOM_USER_AGENT, Helper.USER_AGENT);
DefaultBandwidthMeter.Builder bandwidthMeterBuilder = new DefaultBandwidthMeter.Builder(context);
DefaultBandwidthMeter bandwidthMeter = bandwidthMeterBuilder.build();
defaultDatasourceFactory = new DefaultDataSourceFactory(this.context,
bandwidthMeter,
new DefaultHttpDataSourceFactory(userAgent, bandwidthMeter));
}
@Override
public DataSource createDataSource() {
LeastRecentlyUsedCacheEvictor evictor = new LeastRecentlyUsedCacheEvictor(maxCacheSize);
ExoDatabaseProvider exoDatabaseProvider = new ExoDatabaseProvider(context);
SimpleCache simpleCache = new SimpleCache(new File(context.getCacheDir(), "media"), evictor, exoDatabaseProvider);
return new CacheDataSource(simpleCache, defaultDatasourceFactory.createDataSource(),
new FileDataSource(), new CacheDataSink(simpleCache, maxFileSize),
CacheDataSource.FLAG_BLOCK_ON_CACHE | CacheDataSource.FLAG_IGNORE_CACHE_ON_ERROR, null);
}
}

View File

@ -320,6 +320,7 @@ public class Helper {
public static final int TOOTS_PER_PAGE = 40;
public static final int ACCOUNTS_PER_PAGE = 40;
public static final int NOTIFICATIONS_PER_PAGE = 30;
public static final int DEFAULT_VIDEO_CACHE_MB = 100;
public static final String SET_ATTACHMENT_ACTION = "set_attachment_action";
public static final String SET_TOOT_PER_PAGE = "set_toot_per_page";
public static final String SET_THEME = "set_theme";
@ -435,6 +436,10 @@ public class Helper {
public static final String SET_NITTER_HOST = "set_nitter_host";
public static final String DEFAULT_NITTER_HOST = "nitter.net";
public static final String SET_BIBLIOGRAM = "set_bibliogram";
public static final String SET_BIBLIOGRAM_HOST = "set_bibliogram_host";
public static final String DEFAULT_BIBLIOGRAM_HOST = "bibliogram.art";
public static final String SET_NOTIF_VALIDATION = "set_share_validation";
public static final String SET_NOTIF_VALIDATION_FAV = "set_share_validation_fav";
public static final String SET_WIFI_ONLY = "set_wifi_only";
@ -462,10 +467,13 @@ public class Helper {
public static final String SET_SECURITY_PROVIDER = "set_security_provider";
public static final String SET_ALLOW_STREAM = "set_allow_stream";
public static final String SET_CUSTOM_USER_AGENT = "set_custom_user_agent";
public static final String SET_VIDEO_CACHE = "set_video_cache";
//End points
public static final String EP_AUTHORIZE = "/oauth/authorize";
//Proxy
public static final String SET_PROXY_ENABLED = "set_proxy_enabled";
public static final String SET_PROXY_TYPE = "set_proxy_type";
@ -512,6 +520,7 @@ public class Helper {
public static final Pattern twitterPattern = Pattern.compile("((@[\\w]+)@twitter\\.com)");
public static final Pattern youtubePattern = Pattern.compile("(www\\.|m\\.)?(youtube\\.com|youtu\\.be|youtube-nocookie\\.com)/(((?!([\"'<])).)*)");
public static final Pattern nitterPattern = Pattern.compile("(mobile\\.|www\\.)?twitter.com([\\w-/]+)");
public static final Pattern bibliogramPattern = Pattern.compile("(m\\.|www\\.)?instagram.com(/p/[\\w-/]+)");
public static final Pattern ouichesPattern = Pattern.compile("https://ouich\\.es/tag/(\\w+)");
public static final Pattern xmppPattern = Pattern.compile("xmpp:[-a-zA-Z0-9+$&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]");
//Default values
@ -1322,9 +1331,9 @@ public class Helper {
if (url.startsWith("/")) {
url = "https://" + account.getInstance() + account.getAvatar();
}
if( isValidContextForGlide(activity)) {
if (isValidContextForGlide(activity)) {
if (!url.equals("null")) {
if( url.contains(".gif")) {
if (url.contains(".gif")) {
Glide.with(navigationView.getContext())
.asGif()
.load(url)
@ -1340,7 +1349,7 @@ public class Helper {
}
});
}else{
} else {
Glide.with(navigationView.getContext())
.asDrawable()
.load(url)
@ -1750,14 +1759,14 @@ public class Helper {
String avatarUrl = !disableGif ? accountChoice.getAvatar() : accountChoice.getAvatar_static();
if( avatarUrl.contains(".gif")) {
if (avatarUrl.contains(".gif")) {
Glide.with(finalIcon.getContext())
.asGif()
.load(avatarUrl)
.thumbnail(0.1f)
.apply(new RequestOptions().transform(new CenterCrop(), new RoundedCorners(270)))
.into(finalIcon);
}else{
} else {
Glide.with(activity)
.asDrawable()
.apply(new RequestOptions().transform(new CenterCrop(), new RoundedCorners(270)))
@ -1820,17 +1829,17 @@ public class Helper {
if (!accountChoice.getAvatar().startsWith("http"))
accountChoice.setAvatar("https://" + accountChoice.getInstance() + accountChoice.getAvatar());
ImageView itemIconAcc = new ImageView(activity);
if (isValidContextForGlide(activity) ) {
if (isValidContextForGlide(activity)) {
try {
String avatarUrl = !disableGif ? accountChoice.getAvatar() : accountChoice.getAvatar_static();
if( avatarUrl.contains(".gif")) {
if (avatarUrl.contains(".gif")) {
Glide.with(itemIconAcc.getContext())
.asGif()
.load(avatarUrl)
.thumbnail(0.1f)
.apply(new RequestOptions().transform(new CenterCrop(), new RoundedCorners(270)))
.into(itemIconAcc);
}else{
} else {
Glide.with(activity)
.asDrawable()
.apply(new RequestOptions().transform(new CenterCrop(), new RoundedCorners(270)))
@ -2263,10 +2272,8 @@ public class Helper {
webView.getSettings().setLoadsImagesAutomatically(true);
webView.getSettings().setSupportMultipleWindows(false);
webView.getSettings().setMediaPlaybackRequiresUserGesture(true);
String user_agent = sharedpreferences.getString(Helper.SET_CUSTOM_USER_AGENT, null);
if (user_agent != null) {
webView.getSettings().setUserAgentString(user_agent);
}
String user_agent = sharedpreferences.getString(Helper.SET_CUSTOM_USER_AGENT, Helper.USER_AGENT);
webView.getSettings().setUserAgentString(user_agent);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
boolean cookies = sharedpreferences.getBoolean(Helper.SET_COOKIES, false);
CookieManager cookieManager = CookieManager.getInstance();

View File

@ -1,21 +1,26 @@
package app.fedilab.android.helper;
/* Copyright 2019 Thomas Schneider
*
* This file is a part of Fedilab
*
* 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.
*
* Fedilab 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 Fedilab; if not,
* see <http://www.gnu.org/licenses>. */
import android.content.Context;
import android.content.SharedPreferences;
import android.content.res.Resources;
import android.util.TypedValue;
import static android.content.Context.MODE_PRIVATE;
public class ThemeHelper {
public static void changeTheme(Context context, int theme) {
final SharedPreferences sharedpreferences = context.getSharedPreferences(Helper.APP_PREFS, MODE_PRIVATE);
}
public static int getAttColor(Context context, int attColor) {
TypedValue typedValue = new TypedValue();
Resources.Theme theme = context.getTheme();

View File

@ -15,6 +15,8 @@ import androidx.annotation.NonNull;
import androidx.core.content.ContextCompat;
import androidx.recyclerview.widget.RecyclerView;
import org.jetbrains.annotations.NotNull;
import java.util.ArrayList;
import java.util.List;
@ -31,7 +33,7 @@ public class ColorPickerAdapter extends RecyclerView.Adapter<ColorPickerAdapter.
private List<Integer> colorPickerColors;
private OnColorPickerClickListener onColorPickerClickListener;
ColorPickerAdapter(@NonNull Context context, @NonNull List<Integer> colorPickerColors) {
private ColorPickerAdapter(@NonNull Context context, @NonNull List<Integer> colorPickerColors) {
this.context = context;
this.inflater = LayoutInflater.from(context);
this.colorPickerColors = colorPickerColors;
@ -43,7 +45,7 @@ public class ColorPickerAdapter extends RecyclerView.Adapter<ColorPickerAdapter.
this.inflater = LayoutInflater.from(context);
}
public static List<Integer> getDefaultColors(Context context) {
private static List<Integer> getDefaultColors(Context context) {
ArrayList<Integer> colorPickerColors = new ArrayList<>();
colorPickerColors.add(ContextCompat.getColor(context, R.color.blue_color_picker));
colorPickerColors.add(ContextCompat.getColor(context, R.color.brown_color_picker));
@ -60,8 +62,9 @@ public class ColorPickerAdapter extends RecyclerView.Adapter<ColorPickerAdapter.
return colorPickerColors;
}
@NotNull
@Override
public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
public ViewHolder onCreateViewHolder(@NotNull ViewGroup parent, int viewType) {
View view = inflater.inflate(R.layout.color_picker_item_list, parent, false);
return new ViewHolder(view);
}
@ -98,7 +101,7 @@ public class ColorPickerAdapter extends RecyclerView.Adapter<ColorPickerAdapter.
view.setBackgroundDrawable(layerDrawable);
}
public void setOnColorPickerClickListener(OnColorPickerClickListener onColorPickerClickListener) {
void setOnColorPickerClickListener(OnColorPickerClickListener onColorPickerClickListener) {
this.onColorPickerClickListener = onColorPickerClickListener;
}
@ -109,15 +112,12 @@ public class ColorPickerAdapter extends RecyclerView.Adapter<ColorPickerAdapter.
class ViewHolder extends RecyclerView.ViewHolder {
View colorPickerView;
public ViewHolder(View itemView) {
ViewHolder(View itemView) {
super(itemView);
colorPickerView = itemView.findViewById(R.id.color_picker_view);
itemView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (onColorPickerClickListener != null)
onColorPickerClickListener.onColorPickerClickListener(colorPickerColors.get(getAdapterPosition()));
}
itemView.setOnClickListener(v -> {
if (onColorPickerClickListener != null)
onColorPickerClickListener.onColorPickerClickListener(colorPickerColors.get(getAdapterPosition()));
});
}
}

View File

@ -18,6 +18,7 @@ import com.google.android.material.bottomsheet.BottomSheetDialogFragment;
import org.jetbrains.annotations.NotNull;
import java.util.ArrayList;
import java.util.Objects;
import app.fedilab.android.R;
import ja.burhanrashid52.photoeditor.PhotoEditor;
@ -46,7 +47,7 @@ public class EmojiBSFragment extends BottomSheetDialogFragment {
@SuppressLint("RestrictedApi")
@Override
public void setupDialog(Dialog dialog, int style) {
public void setupDialog(@NotNull Dialog dialog, int style) {
super.setupDialog(dialog, style);
View contentView = View.inflate(getContext(), R.layout.fragment_bottom_sticker_emoji_dialog, null);
dialog.setContentView(contentView);
@ -75,7 +76,7 @@ public class EmojiBSFragment extends BottomSheetDialogFragment {
public class EmojiAdapter extends RecyclerView.Adapter<EmojiAdapter.ViewHolder> {
ArrayList<String> emojisList = PhotoEditor.getEmojis(getActivity());
ArrayList<String> emojisList = PhotoEditor.getEmojis(Objects.requireNonNull(getActivity()));
@NotNull
@Override
@ -101,14 +102,11 @@ public class EmojiBSFragment extends BottomSheetDialogFragment {
super(itemView);
txtEmoji = itemView.findViewById(R.id.txtEmoji);
itemView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (mEmojiListener != null) {
mEmojiListener.onEmojiClick(emojisList.get(getLayoutPosition()));
}
dismiss();
itemView.setOnClickListener(v -> {
if (mEmojiListener != null) {
mEmojiListener.onEmojiClick(emojisList.get(getLayoutPosition()));
}
dismiss();
});
}
}

View File

@ -51,13 +51,10 @@ public class PropertiesBSFragment extends BottomSheetDialogFragment implements S
rvColor.setLayoutManager(layoutManager);
rvColor.setHasFixedSize(true);
ColorPickerAdapter colorPickerAdapter = new ColorPickerAdapter(Objects.requireNonNull(getActivity()));
colorPickerAdapter.setOnColorPickerClickListener(new ColorPickerAdapter.OnColorPickerClickListener() {
@Override
public void onColorPickerClickListener(int colorCode) {
if (mProperties != null) {
dismiss();
mProperties.onColorChanged(colorCode);
}
colorPickerAdapter.setOnColorPickerClickListener(colorCode -> {
if (mProperties != null) {
dismiss();
mProperties.onColorChanged(colorCode);
}
});
rvColor.setAdapter(colorPickerAdapter);

View File

@ -51,7 +51,7 @@ public class StickerBSFragment extends BottomSheetDialogFragment {
@SuppressLint("RestrictedApi")
@Override
public void setupDialog(Dialog dialog, int style) {
public void setupDialog(@NotNull Dialog dialog, int style) {
super.setupDialog(dialog, style);
View contentView = View.inflate(getContext(), R.layout.fragment_bottom_sticker_emoji_dialog, null);
dialog.setContentView(contentView);
@ -76,6 +76,7 @@ public class StickerBSFragment extends BottomSheetDialogFragment {
}
@SuppressWarnings("unused")
private String convertEmoji(String emoji) {
String returnedEmoji = "";
try {
@ -137,16 +138,13 @@ public class StickerBSFragment extends BottomSheetDialogFragment {
super(itemView);
imgSticker = itemView.findViewById(R.id.imgSticker);
itemView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (mStickerListener != null) {
mStickerListener.onStickerClick(
BitmapFactory.decodeResource(getResources(),
stickerList[getLayoutPosition()]));
}
dismiss();
itemView.setOnClickListener(v -> {
if (mStickerListener != null) {
mStickerListener.onStickerClick(
BitmapFactory.decodeResource(getResources(),
stickerList[getLayoutPosition()]));
}
dismiss();
});
}
}

View File

@ -32,10 +32,9 @@ import app.fedilab.android.R;
public class TextEditorDialogFragment extends DialogFragment {
public static final String TAG = TextEditorDialogFragment.class.getSimpleName();
public static final String EXTRA_INPUT_TEXT = "extra_input_text";
public static final String EXTRA_COLOR_CODE = "extra_color_code";
private static final String EXTRA_INPUT_TEXT = "extra_input_text";
private static final String EXTRA_COLOR_CODE = "extra_color_code";
private EditText mAddTextEditText;
private TextView mAddTextDoneTextView;
private InputMethodManager mInputMethodManager;
private int mColorCode;
private TextEditor mTextEditor;
@ -64,7 +63,7 @@ public class TextEditorDialogFragment extends DialogFragment {
super.onStart();
Dialog dialog = getDialog();
//Make dialog full screen with transparent background
if (dialog != null) {
if (dialog != null && dialog.getWindow() != null) {
int width = ViewGroup.LayoutParams.MATCH_PARENT;
int height = ViewGroup.LayoutParams.MATCH_PARENT;
dialog.getWindow().setLayout(width, height);
@ -82,41 +81,39 @@ public class TextEditorDialogFragment extends DialogFragment {
public void onViewCreated(@NotNull View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
mAddTextEditText = view.findViewById(R.id.add_text_edit_text);
mInputMethodManager = (InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE);
mAddTextDoneTextView = view.findViewById(R.id.add_text_done_tv);
if( getActivity() != null) {
mInputMethodManager = (InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE);
TextView mAddTextDoneTextView = view.findViewById(R.id.add_text_done_tv);
//Setup the color picker for text color
RecyclerView addTextColorPickerRecyclerView = view.findViewById(R.id.add_text_color_picker_recycler_view);
LinearLayoutManager layoutManager = new LinearLayoutManager(getActivity(), LinearLayoutManager.HORIZONTAL, false);
addTextColorPickerRecyclerView.setLayoutManager(layoutManager);
addTextColorPickerRecyclerView.setHasFixedSize(true);
ColorPickerAdapter colorPickerAdapter = new ColorPickerAdapter(getActivity());
//This listener will change the text color when clicked on any color from picker
colorPickerAdapter.setOnColorPickerClickListener(new ColorPickerAdapter.OnColorPickerClickListener() {
@Override
public void onColorPickerClickListener(int colorCode) {
//Setup the color picker for text color
RecyclerView addTextColorPickerRecyclerView = view.findViewById(R.id.add_text_color_picker_recycler_view);
LinearLayoutManager layoutManager = new LinearLayoutManager(getActivity(), LinearLayoutManager.HORIZONTAL, false);
addTextColorPickerRecyclerView.setLayoutManager(layoutManager);
addTextColorPickerRecyclerView.setHasFixedSize(true);
ColorPickerAdapter colorPickerAdapter = new ColorPickerAdapter(getActivity());
//This listener will change the text color when clicked on any color from picker
colorPickerAdapter.setOnColorPickerClickListener(colorCode -> {
mColorCode = colorCode;
mAddTextEditText.setTextColor(colorCode);
}
});
addTextColorPickerRecyclerView.setAdapter(colorPickerAdapter);
mAddTextEditText.setText(getArguments().getString(EXTRA_INPUT_TEXT));
mColorCode = getArguments().getInt(EXTRA_COLOR_CODE);
mAddTextEditText.setTextColor(mColorCode);
mInputMethodManager.toggleSoftInput(InputMethodManager.SHOW_FORCED, 0);
});
addTextColorPickerRecyclerView.setAdapter(colorPickerAdapter);
assert getArguments() != null;
mAddTextEditText.setText(getArguments().getString(EXTRA_INPUT_TEXT));
mColorCode = getArguments().getInt(EXTRA_COLOR_CODE);
mAddTextEditText.setTextColor(mColorCode);
mInputMethodManager.toggleSoftInput(InputMethodManager.SHOW_FORCED, 0);
//Make a callback on activity when user is done with text editing
mAddTextDoneTextView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
mInputMethodManager.hideSoftInputFromWindow(view.getWindowToken(), 0);
//Make a callback on activity when user is done with text editing
mAddTextDoneTextView.setOnClickListener(view1 -> {
mInputMethodManager.hideSoftInputFromWindow(view1.getWindowToken(), 0);
dismiss();
String inputText = mAddTextEditText.getText().toString();
if (!TextUtils.isEmpty(inputText) && mTextEditor != null) {
mTextEditor.onDone(inputText, mColorCode);
}
}
});
});
}
}

View File

@ -59,7 +59,7 @@ public class EditingToolsAdapter extends RecyclerView.Adapter<EditingToolsAdapte
void onToolSelected(ToolType toolType);
}
class ToolModel {
static class ToolModel {
private String mToolName;
private int mToolIcon;
private ToolType mToolType;
@ -80,12 +80,7 @@ public class EditingToolsAdapter extends RecyclerView.Adapter<EditingToolsAdapte
super(itemView);
imgToolIcon = itemView.findViewById(R.id.imgToolIcon);
txtTool = itemView.findViewById(R.id.txtTool);
itemView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mOnItemSelected.onToolSelected(mToolList.get(getLayoutPosition()).mToolType);
}
});
itemView.setOnClickListener(v -> mOnItemSelected.onToolSelected(mToolList.get(getLayoutPosition()).mToolType));
}
}
}

View File

@ -93,21 +93,15 @@ public class BackupNotificationInDataBaseService extends IntentService {
}
boolean finalToastMessage = toastMessage;
if (instanceRunning == 0) {
new Handler(Looper.getMainLooper()).post(new Runnable() {
@Override
public void run() {
if (finalToastMessage) {
Toasty.info(BackupNotificationInDataBaseService.this, getString(R.string.data_export_start), Toast.LENGTH_LONG).show();
}
new Handler(Looper.getMainLooper()).post(() -> {
if (finalToastMessage) {
Toasty.info(BackupNotificationInDataBaseService.this, getString(R.string.data_export_start), Toast.LENGTH_LONG).show();
}
});
} else {
new Handler(Looper.getMainLooper()).post(new Runnable() {
@Override
public void run() {
if (finalToastMessage) {
Toasty.info(BackupNotificationInDataBaseService.this, getString(R.string.data_export_running), Toast.LENGTH_LONG).show();
}
new Handler(Looper.getMainLooper()).post(() -> {
if (finalToastMessage) {
Toasty.info(BackupNotificationInDataBaseService.this, getString(R.string.data_export_running), Toast.LENGTH_LONG).show();
}
});
return;
@ -161,12 +155,9 @@ public class BackupNotificationInDataBaseService extends IntentService {
e.printStackTrace();
message = getString(R.string.data_export_error, account.getAcct());
final String finalMessage = message;
new Handler(Looper.getMainLooper()).post(new Runnable() {
@Override
public void run() {
if (finalToastMessage) {
Toasty.error(BackupNotificationInDataBaseService.this, finalMessage, Toast.LENGTH_LONG).show();
}
new Handler(Looper.getMainLooper()).post(() -> {
if (finalToastMessage) {
Toasty.error(BackupNotificationInDataBaseService.this, finalMessage, Toast.LENGTH_LONG).show();
}
});
}

View File

@ -94,21 +94,15 @@ public class BackupStatusInDataBaseService extends IntentService {
}
boolean finalToastMessage = toastMessage;
if (instanceRunning == 0) {
new Handler(Looper.getMainLooper()).post(new Runnable() {
@Override
public void run() {
if (finalToastMessage) {
Toasty.info(BackupStatusInDataBaseService.this, getString(R.string.data_export_start), Toast.LENGTH_LONG).show();
}
new Handler(Looper.getMainLooper()).post(() -> {
if (finalToastMessage) {
Toasty.info(BackupStatusInDataBaseService.this, getString(R.string.data_export_start), Toast.LENGTH_LONG).show();
}
});
} else {
new Handler(Looper.getMainLooper()).post(new Runnable() {
@Override
public void run() {
if (finalToastMessage) {
Toasty.info(BackupStatusInDataBaseService.this, getString(R.string.data_export_running), Toast.LENGTH_LONG).show();
}
new Handler(Looper.getMainLooper()).post(() -> {
if (finalToastMessage) {
Toasty.info(BackupStatusInDataBaseService.this, getString(R.string.data_export_running), Toast.LENGTH_LONG).show();
}
});
return;
@ -159,12 +153,9 @@ public class BackupStatusInDataBaseService extends IntentService {
e.printStackTrace();
message = getString(R.string.data_export_error, account.getAcct());
final String finalMessage = message;
new Handler(Looper.getMainLooper()).post(new Runnable() {
@Override
public void run() {
if (finalToastMessage) {
Toasty.error(BackupStatusInDataBaseService.this, finalMessage, Toast.LENGTH_LONG).show();
}
new Handler(Looper.getMainLooper()).post(() -> {
if (finalToastMessage) {
Toasty.error(BackupStatusInDataBaseService.this, finalMessage, Toast.LENGTH_LONG).show();
}
});
}

View File

@ -86,19 +86,9 @@ public class BackupStatusService extends IntentService {
@Override
protected void onHandleIntent(@Nullable Intent intent) {
if (instanceRunning == 0) {
new Handler(Looper.getMainLooper()).post(new Runnable() {
@Override
public void run() {
Toasty.info(BackupStatusService.this, getString(R.string.data_export_start), Toast.LENGTH_LONG).show();
}
});
new Handler(Looper.getMainLooper()).post(() -> Toasty.info(BackupStatusService.this, getString(R.string.data_export_start), Toast.LENGTH_LONG).show());
} else {
new Handler(Looper.getMainLooper()).post(new Runnable() {
@Override
public void run() {
Toasty.info(BackupStatusService.this, getString(R.string.data_export_running), Toast.LENGTH_LONG).show();
}
});
new Handler(Looper.getMainLooper()).post(() -> Toasty.info(BackupStatusService.this, getString(R.string.data_export_running), Toast.LENGTH_LONG).show());
return;
}
instanceRunning++;
@ -164,7 +154,6 @@ public class BackupStatusService extends IntentService {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
content = Html.fromHtml(status.getContent(), Html.FROM_HTML_MODE_LEGACY).toString();
else
//noinspection deprecation
content = Html.fromHtml(status.getContent()).toString();
builder.append("\"").append(content.replace("\"", "'").replace("\n", " ")).append("\"").append(',');
builder.append("\"").append(Helper.shortDateTime(BackupStatusService.this, status.getCreated_at())).append("\"").append(',');
@ -198,12 +187,7 @@ public class BackupStatusService extends IntentService {
e.printStackTrace();
message = getString(R.string.data_export_error, account.getAcct());
final String finalMessage = message;
new Handler(Looper.getMainLooper()).post(new Runnable() {
@Override
public void run() {
Toasty.error(BackupStatusService.this, finalMessage, Toast.LENGTH_LONG).show();
}
});
new Handler(Looper.getMainLooper()).post(() -> Toasty.error(BackupStatusService.this, finalMessage, Toast.LENGTH_LONG).show());
}
instanceRunning--;

View File

@ -210,6 +210,7 @@ public class LiveNotificationDelayedService extends Service {
private void startThread(Account accountStream, String key) {
Thread thread = new Thread() {
@SuppressWarnings("ConstantConditions")
@Override
public void run() {
while (fetch) {
@ -236,6 +237,7 @@ public class LiveNotificationDelayedService extends Service {
}
@SuppressWarnings("ConstantConditions")
private void taks(Account account) {
String key = account.getUsername() + "@" + account.getInstance();
APIResponse apiResponse;
@ -433,39 +435,36 @@ public class LiveNotificationDelayedService extends Service {
final String finalMessage = message;
Handler mainHandler = new Handler(Looper.getMainLooper());
Helper.NotifType finalNotifType = notifType;
Runnable myRunnable = new Runnable() {
@Override
public void run() {
if (finalMessage != null) {
Glide.with(LiveNotificationDelayedService.this)
.asBitmap()
.load(notification.getAccount().getAvatar())
.listener(new RequestListener<Bitmap>() {
@Override
public boolean onResourceReady(Bitmap resource, Object model, Target<Bitmap> target, DataSource dataSource, boolean isFirstResource) {
return false;
}
Runnable myRunnable = () -> {
if (finalMessage != null) {
Glide.with(LiveNotificationDelayedService.this)
.asBitmap()
.load(notification.getAccount().getAvatar())
.listener(new RequestListener<Bitmap>() {
@Override
public boolean onResourceReady(Bitmap resource, Object model, Target<Bitmap> target, DataSource dataSource, boolean isFirstResource) {
return false;
}
@Override
public boolean onLoadFailed(@Nullable GlideException e, Object model, Target target, boolean isFirstResource) {
Helper.notify_user(LiveNotificationDelayedService.this, account, intent, BitmapFactory.decodeResource(getResources(),
getMainLogo(LiveNotificationDelayedService.this)), finalNotifType, "@" + notification.getAccount().getAcct(), finalMessage);
return false;
}
})
.into(new CustomTarget<Bitmap>() {
@Override
public void onResourceReady(@NonNull Bitmap resource, Transition<? super Bitmap> transition) {
@Override
public boolean onLoadFailed(@Nullable GlideException e, Object model, Target target, boolean isFirstResource) {
Helper.notify_user(LiveNotificationDelayedService.this, account, intent, BitmapFactory.decodeResource(getResources(),
getMainLogo(LiveNotificationDelayedService.this)), finalNotifType, "@" + notification.getAccount().getAcct(), finalMessage);
return false;
}
})
.into(new CustomTarget<Bitmap>() {
@Override
public void onResourceReady(@NonNull Bitmap resource, Transition<? super Bitmap> transition) {
Helper.notify_user(LiveNotificationDelayedService.this, account, intent, resource, finalNotifType, "@" + notification.getAccount().getAcct(), finalMessage);
}
Helper.notify_user(LiveNotificationDelayedService.this, account, intent, resource, finalNotifType, "@" + notification.getAccount().getAcct(), finalMessage);
}
@Override
public void onLoadCleared(@Nullable Drawable placeholder) {
@Override
public void onLoadCleared(@Nullable Drawable placeholder) {
}
});
}
}
});
}
};
mainHandler.post(myRunnable);

View File

@ -197,7 +197,6 @@ public class LiveNotificationService extends Service implements NetworkStateRece
for (Thread t : Thread.getAllStackTraces().keySet()) {
if (t.getName().startsWith("notif_live_")) {
t.interrupt();
t = null;
}
}
Thread.currentThread().interrupt();

View File

@ -29,7 +29,6 @@ import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import com.koushikdutta.async.http.AsyncHttpClient;
import com.koushikdutta.async.http.AsyncHttpRequest;
import com.koushikdutta.async.http.Headers;
import com.koushikdutta.async.http.WebSocket;
import org.json.JSONException;
import org.json.JSONObject;
@ -37,8 +36,6 @@ import org.json.JSONObject;
import java.security.KeyManagementException;
import java.security.NoSuchAlgorithmException;
import javax.net.ssl.HttpsURLConnection;
import app.fedilab.android.client.API;
import app.fedilab.android.client.Entities.Account;
import app.fedilab.android.client.Entities.Status;
@ -55,7 +52,6 @@ import app.fedilab.android.sqlite.Sqlite;
public class StreamingFederatedTimelineService extends IntentService {
private static HttpsURLConnection httpsURLConnection;
static {
Helper.installProvider();
@ -116,34 +112,27 @@ public class StreamingFederatedTimelineService extends IntentService {
try {
AsyncHttpClient.getDefaultInstance().getSSLSocketMiddleware().setSSLContext(new TLSSocketFactory(accountStream.getInstance()).getSSLContext());
AsyncHttpClient.getDefaultInstance().getSSLSocketMiddleware().setConnectAllAddresses(true);
} catch (KeyManagementException e) {
e.printStackTrace();
} catch (NoSuchAlgorithmException e) {
} catch (KeyManagementException | NoSuchAlgorithmException e) {
e.printStackTrace();
}
}
AsyncHttpClient.getDefaultInstance().websocket("wss://" + accountStream.getInstance() + "/api/v1/streaming/?stream=public&access_token=" + accountStream.getToken(), "wss", new AsyncHttpClient.WebSocketConnectCallback() {
@Override
public void onCompleted(Exception ex, WebSocket webSocket) {
if (ex != null) {
ex.printStackTrace();
AsyncHttpClient.getDefaultInstance().websocket("wss://" + accountStream.getInstance() + "/api/v1/streaming/?stream=public&access_token=" + accountStream.getToken(), "wss", (ex, webSocket) -> {
if (ex != null) {
ex.printStackTrace();
return;
}
webSocket.setStringCallback(s -> {
if (!sharedpreferences.getBoolean(Helper.SHOULD_CONTINUE_STREAMING_FEDERATED + finalAccountStream.getId() + finalAccountStream.getInstance(), true)) {
stopSelf();
return;
}
webSocket.setStringCallback(new WebSocket.StringCallback() {
public void onStringAvailable(String s) {
if (!sharedpreferences.getBoolean(Helper.SHOULD_CONTINUE_STREAMING_FEDERATED + finalAccountStream.getId() + finalAccountStream.getInstance(), true)) {
stopSelf();
return;
}
try {
JSONObject eventJson = new JSONObject(s);
try {
JSONObject eventJson = new JSONObject(s);
onRetrieveStreaming(finalAccountStream, eventJson);
} catch (JSONException ignored) {
}
}
});
}
onRetrieveStreaming(finalAccountStream, eventJson);
} catch (JSONException ignored) {
}
});
});
}
}

View File

@ -29,7 +29,6 @@ import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import com.koushikdutta.async.http.AsyncHttpClient;
import com.koushikdutta.async.http.AsyncHttpRequest;
import com.koushikdutta.async.http.Headers;
import com.koushikdutta.async.http.WebSocket;
import org.json.JSONException;
import org.json.JSONObject;
@ -37,8 +36,6 @@ import org.json.JSONObject;
import java.security.KeyManagementException;
import java.security.NoSuchAlgorithmException;
import javax.net.ssl.HttpsURLConnection;
import app.fedilab.android.client.API;
import app.fedilab.android.client.Entities.Account;
import app.fedilab.android.client.Entities.Status;
@ -55,7 +52,6 @@ import app.fedilab.android.sqlite.Sqlite;
public class StreamingHomeTimelineService extends IntentService {
private static HttpsURLConnection httpsURLConnection;
static {
Helper.installProvider();
@ -116,34 +112,27 @@ public class StreamingHomeTimelineService extends IntentService {
try {
AsyncHttpClient.getDefaultInstance().getSSLSocketMiddleware().setSSLContext(new TLSSocketFactory(accountStream.getInstance()).getSSLContext());
AsyncHttpClient.getDefaultInstance().getSSLSocketMiddleware().setConnectAllAddresses(true);
} catch (KeyManagementException e) {
e.printStackTrace();
} catch (NoSuchAlgorithmException e) {
} catch (KeyManagementException | NoSuchAlgorithmException e) {
e.printStackTrace();
}
}
AsyncHttpClient.getDefaultInstance().websocket("wss://" + accountStream.getInstance() + "/api/v1/streaming/?stream=user&access_token=" + accountStream.getToken(), "wss", new AsyncHttpClient.WebSocketConnectCallback() {
@Override
public void onCompleted(Exception ex, WebSocket webSocket) {
if (ex != null) {
ex.printStackTrace();
AsyncHttpClient.getDefaultInstance().websocket("wss://" + accountStream.getInstance() + "/api/v1/streaming/?stream=user&access_token=" + accountStream.getToken(), "wss", (ex, webSocket) -> {
if (ex != null) {
ex.printStackTrace();
return;
}
webSocket.setStringCallback(s -> {
if (!sharedpreferences.getBoolean(Helper.SHOULD_CONTINUE_STREAMING_HOME + finalAccountStream.getId() + finalAccountStream.getInstance(), true)) {
stopSelf();
return;
}
webSocket.setStringCallback(new WebSocket.StringCallback() {
public void onStringAvailable(String s) {
if (!sharedpreferences.getBoolean(Helper.SHOULD_CONTINUE_STREAMING_HOME + finalAccountStream.getId() + finalAccountStream.getInstance(), true)) {
stopSelf();
return;
}
try {
JSONObject eventJson = new JSONObject(s);
try {
JSONObject eventJson = new JSONObject(s);
onRetrieveStreaming(finalAccountStream, eventJson);
} catch (JSONException ignored) {
}
}
});
}
onRetrieveStreaming(finalAccountStream, eventJson);
} catch (JSONException ignored) {
}
});
});
}
}

View File

@ -29,7 +29,6 @@ import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import com.koushikdutta.async.http.AsyncHttpClient;
import com.koushikdutta.async.http.AsyncHttpRequest;
import com.koushikdutta.async.http.Headers;
import com.koushikdutta.async.http.WebSocket;
import org.json.JSONException;
import org.json.JSONObject;
@ -37,8 +36,6 @@ import org.json.JSONObject;
import java.security.KeyManagementException;
import java.security.NoSuchAlgorithmException;
import javax.net.ssl.HttpsURLConnection;
import app.fedilab.android.client.API;
import app.fedilab.android.client.Entities.Account;
import app.fedilab.android.client.Entities.Status;
@ -55,7 +52,6 @@ import app.fedilab.android.sqlite.Sqlite;
public class StreamingLocalTimelineService extends IntentService {
private static HttpsURLConnection httpsURLConnection;
static {
Helper.installProvider();
@ -117,33 +113,26 @@ public class StreamingLocalTimelineService extends IntentService {
try {
AsyncHttpClient.getDefaultInstance().getSSLSocketMiddleware().setSSLContext(new TLSSocketFactory(accountStream.getInstance()).getSSLContext());
AsyncHttpClient.getDefaultInstance().getSSLSocketMiddleware().setConnectAllAddresses(true);
} catch (KeyManagementException e) {
e.printStackTrace();
} catch (NoSuchAlgorithmException e) {
} catch (KeyManagementException | NoSuchAlgorithmException e) {
e.printStackTrace();
}
}
AsyncHttpClient.getDefaultInstance().websocket("wss://" + accountStream.getInstance() + "/api/v1/streaming/?stream=public:local&access_token=" + accountStream.getToken(), "wss", new AsyncHttpClient.WebSocketConnectCallback() {
@Override
public void onCompleted(Exception ex, WebSocket webSocket) {
if (ex != null) {
ex.printStackTrace();
AsyncHttpClient.getDefaultInstance().websocket("wss://" + accountStream.getInstance() + "/api/v1/streaming/?stream=public:local&access_token=" + accountStream.getToken(), "wss", (ex, webSocket) -> {
if (ex != null) {
ex.printStackTrace();
return;
}
webSocket.setStringCallback(s -> {
if (!sharedpreferences.getBoolean(Helper.SHOULD_CONTINUE_STREAMING_LOCAL + finalAccountStream.getId() + finalAccountStream.getInstance(), true)) {
stopSelf();
return;
}
webSocket.setStringCallback(new WebSocket.StringCallback() {
public void onStringAvailable(String s) {
if (!sharedpreferences.getBoolean(Helper.SHOULD_CONTINUE_STREAMING_LOCAL + finalAccountStream.getId() + finalAccountStream.getInstance(), true)) {
stopSelf();
return;
}
try {
JSONObject eventJson = new JSONObject(s);
onRetrieveStreaming(finalAccountStream, eventJson);
} catch (JSONException ignored) {
}
}
});
}
try {
JSONObject eventJson = new JSONObject(s);
onRetrieveStreaming(finalAccountStream, eventJson);
} catch (JSONException ignored) {
}
});
});
}
}

View File

@ -51,7 +51,8 @@ public class DomainBlockDAO {
values.put(Sqlite.COL_DOMAIN, domain);
try {
db.insert(Sqlite.TABLE_TRACKING_BLOCK, null, values);
} catch (Exception ignored) {}
} catch (Exception ignored) {
}
}
/**

View File

@ -172,7 +172,7 @@
android:id="@+id/account_dn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="1"
android:singleLine="true"
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
android:textColor="?colorAccent"
android:textSize="16sp" />
@ -181,7 +181,7 @@
android:id="@+id/account_un"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="1"
android:singleLine="true"
android:textSize="14sp" />
<TextView
@ -268,7 +268,7 @@
android:layout_marginStart="3dp"
android:layout_marginEnd="3dp"
android:background="@drawable/blue_border"
android:maxLines="1"
android:singleLine="true"
android:textColor="@color/mastodonC4"
android:visibility="gone" />
@ -279,7 +279,7 @@
android:layout_marginStart="3dp"
android:layout_marginEnd="3dp"
android:background="@drawable/blue_border"
android:maxLines="1"
android:singleLine="true"
android:visibility="gone"
android:textColor="@color/mastodonC4" />
@ -290,7 +290,7 @@
android:layout_marginStart="3dp"
android:layout_marginEnd="3dp"
android:background="@drawable/green_border"
android:maxLines="1"
android:singleLine="true"
android:text="@string/followed_by"
android:textColor="@color/verified_text"
android:visibility="gone" />
@ -302,7 +302,7 @@
android:layout_marginStart="3dp"
android:layout_marginEnd="3dp"
android:background="@drawable/blue_border"
android:maxLines="1"
android:singleLine="true"
android:text="@string/request_sent"
android:textColor="@color/mastodonC4"
android:visibility="gone" />
@ -521,7 +521,7 @@
android:layout_marginStart="5dp"
android:layout_marginLeft="5dp"
android:layout_weight="1"
android:maxLines="1"
android:singleLine="true"
android:textSize="14sp" />
<ImageButton

View File

@ -49,7 +49,7 @@
android:id="@+id/account_dn"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:maxLines="1"
android:singleLine="true"
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
android:textSize="18sp" />
@ -57,7 +57,7 @@
android:id="@+id/account_un"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="1"
android:singleLine="true"
android:textSize="14sp" />
</LinearLayout>
@ -66,7 +66,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:maxLines="1"
android:singleLine="true"
android:textSize="16sp"
android:visibility="gone" />
@ -93,7 +93,7 @@
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:maxLines="1"
android:singleLine="true"
android:text="@string/toots" />
<TextView
@ -111,7 +111,7 @@
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:maxLines="1"
android:singleLine="true"
android:text="@string/following" />
<TextView
@ -129,7 +129,7 @@
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:maxLines="1"
android:singleLine="true"
android:text="@string/followers" />
<TextView
@ -154,7 +154,7 @@
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:maxLines="1"
android:singleLine="true"
android:text="@string/request_sent"
android:textColor="?colorAccent"
android:visibility="gone" />

View File

@ -56,7 +56,7 @@
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:inputType="textPersonName"
android:maxLines="1" />
android:singleLine="true" />
<Button
android:id="@+id/set_change_profile_picture"

View File

@ -60,7 +60,7 @@
android:hint="@string/instance_example"
android:imeOptions="actionNext"
android:inputType="textWebEmailAddress"
android:maxLines="1" />
android:singleLine="true" />
</com.google.android.material.textfield.TextInputLayout>
@ -91,7 +91,7 @@
android:drawableStart="@drawable/ic_check_circle"
android:drawablePadding="10dp"
android:gravity="center"
android:maxLines="1"
android:singleLine="true"
android:paddingStart="15dp"
android:paddingTop="12dp"
android:paddingEnd="20dp"
@ -169,7 +169,7 @@
android:layout_height="wrap_content"
android:hint="@string/username"
android:inputType="textEmailAddress"
android:maxLines="1" />
android:singleLine="true" />
</com.google.android.material.textfield.TextInputLayout>
@ -189,7 +189,7 @@
android:layout_height="wrap_content"
android:hint="@string/password"
android:inputType="textPassword"
android:maxLines="1" />
android:singleLine="true" />
</com.google.android.material.textfield.TextInputLayout>
@ -213,7 +213,7 @@
android:drawableStart="@drawable/mastodon_icon"
android:drawablePadding="10dp"
android:gravity="center"
android:maxLines="1"
android:singleLine="true"
android:paddingStart="15dp"
android:paddingTop="12dp"
android:paddingEnd="20dp"

View File

@ -26,7 +26,7 @@
android:drawableEnd="@drawable/ic_search"
android:drawableRight="@drawable/ic_search"
android:inputType="text"
android:maxLines="1" />
android:singleLine="true" />
<RelativeLayout
android:id="@+id/loader"

View File

@ -45,7 +45,7 @@
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent">
<com.google.android.exoplayer2.ui.SimpleExoPlayerView
<com.google.android.exoplayer2.ui.PlayerView
android:id="@+id/media_video"
android:layout_width="match_parent"
android:layout_height="match_parent"

View File

@ -104,7 +104,7 @@
android:layout_marginTop="20dp"
android:hint="@string/title_video_peertube"
android:inputType="text"
android:maxLines="1" />
android:singleLine="true" />
<!-- Videos upload submit -->
<Button

View File

@ -179,7 +179,7 @@
android:id="@+id/account_dn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="1"
android:singleLine="true"
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
android:textColor="?colorAccent"
android:textSize="18sp" />
@ -188,7 +188,7 @@
android:id="@+id/account_un"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="1"
android:singleLine="true"
android:textSize="16sp" />
<TextView
@ -277,7 +277,7 @@
android:layout_marginStart="3dp"
android:layout_marginEnd="3dp"
android:background="@drawable/blue_border"
android:maxLines="1"
android:singleLine="true"
android:textColor="@color/mastodonC4"
android:visibility="gone" />
@ -288,7 +288,7 @@
android:layout_marginStart="3dp"
android:layout_marginEnd="3dp"
android:background="@drawable/blue_border"
android:maxLines="1"
android:singleLine="true"
android:visibility="gone"
android:textColor="@color/mastodonC4" />
@ -299,7 +299,7 @@
android:layout_marginStart="3dp"
android:layout_marginEnd="3dp"
android:background="@drawable/green_border"
android:maxLines="1"
android:singleLine="true"
android:text="@string/followed_by"
android:textColor="@color/verified_text"
android:visibility="gone" />
@ -311,7 +311,7 @@
android:layout_marginStart="3dp"
android:layout_marginEnd="3dp"
android:background="@drawable/blue_border"
android:maxLines="1"
android:singleLine="true"
android:text="@string/request_sent"
android:textColor="@color/mastodonC4"
android:visibility="gone" />
@ -528,7 +528,7 @@
android:layout_gravity="center_vertical"
android:layout_marginStart="5dp"
android:layout_weight="1"
android:maxLines="1"
android:singleLine="true"
android:textSize="14sp" />
<ImageView

View File

@ -26,5 +26,5 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textWebEmailAddress"
android:maxLines="1" />
android:singleLine="true" />
</LinearLayout>

View File

@ -41,7 +41,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="text"
android:maxLines="1" />
android:singleLine="true" />
<TextView
android:layout_width="match_parent"

View File

@ -10,5 +10,5 @@
android:layout_height="wrap_content"
android:hint="@string/action_lists_title_placeholder"
android:inputType="text"
android:maxLines="1" />
android:singleLine="true" />
</LinearLayout>

View File

@ -19,7 +19,7 @@
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:inputType="text"
android:maxLines="1" />
android:singleLine="true" />
<TextView
android:layout_width="match_parent"

View File

@ -16,7 +16,7 @@
android:hint="@string/create_folder"
android:imeOptions="actionDone"
android:inputType="text"
android:maxLines="1" />
android:singleLine="true" />
</com.google.android.material.textfield.TextInputLayout>
</LinearLayout>

View File

@ -51,7 +51,7 @@
android:layout_centerHorizontal="true"
android:layout_marginTop="10dp"
android:gravity="center_horizontal|top"
android:maxLines="1"
android:singleLine="true"
android:textSize="18sp"
android:textStyle="bold" />
<!-- Description -->

View File

@ -2,7 +2,7 @@
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:maxLines="1"
android:singleLine="true"
android:paddingStart="5dp"
android:paddingLeft="5dp"
android:paddingEnd="5dp"

View File

@ -47,7 +47,7 @@
android:id="@+id/account_dn"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:maxLines="1"
android:singleLine="true"
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
android:textSize="18sp" />
@ -55,7 +55,7 @@
android:id="@+id/account_un"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="1"
android:singleLine="true"
android:textSize="14sp" />
</LinearLayout>
@ -64,7 +64,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:maxLines="1"
android:singleLine="true"
android:textSize="16sp"
android:visibility="gone" />
@ -91,7 +91,7 @@
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:maxLines="1"
android:singleLine="true"
android:text="@string/toots" />
<TextView
@ -109,7 +109,7 @@
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:maxLines="1"
android:singleLine="true"
android:text="@string/following" />
<TextView
@ -127,7 +127,7 @@
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:maxLines="1"
android:singleLine="true"
android:text="@string/followers" />
<TextView
@ -153,7 +153,7 @@
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:maxLines="1"
android:singleLine="true"
android:text="@string/request_sent"
android:textColor="?colorAccent"
android:visibility="gone" />

View File

@ -46,7 +46,7 @@
android:id="@+id/account_dn"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:maxLines="1"
android:singleLine="true"
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
android:textSize="18sp" />
@ -54,7 +54,7 @@
android:id="@+id/account_un"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="1"
android:singleLine="true"
android:textSize="14sp" />
</LinearLayout>
@ -63,7 +63,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:maxLines="1"
android:singleLine="true"
android:textSize="16sp"
android:visibility="gone" />
@ -73,7 +73,7 @@
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:maxLines="1"
android:singleLine="true"
android:text="@string/request_sent"
android:textColor="?colorAccent"
android:visibility="gone" />

View File

@ -37,7 +37,7 @@
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:maxLines="1"
android:singleLine="true"
android:textSize="16sp"
app:layout_constraintBottom_toTopOf="@id/account_un"
app:layout_constraintLeft_toRightOf="@id/account_pp"
@ -49,7 +49,7 @@
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:maxLines="1"
android:singleLine="true"
android:textSize="15sp"
app:layout_constraintBottom_toTopOf="@id/btn_top_barrier"
app:layout_constraintLeft_toRightOf="@id/account_pp"

View File

@ -44,7 +44,7 @@
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginStart="10dp"
android:maxLines="1"
android:singleLine="true"
android:textSize="14sp"
android:textStyle="bold" />
@ -54,7 +54,7 @@
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginStart="10dp"
android:maxLines="1"
android:singleLine="true"
android:textSize="14sp" />
</LinearLayout>
<!-- Content description set programmatically -->

View File

@ -73,7 +73,7 @@
android:id="@+id/account_dn"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:maxLines="1"
android:singleLine="true"
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
android:textSize="18sp" />
@ -81,7 +81,7 @@
android:id="@+id/account_un"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="1"
android:singleLine="true"
android:textSize="14sp" />
</LinearLayout>
@ -90,7 +90,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:maxLines="1"
android:singleLine="true"
android:textSize="16sp"
android:visibility="gone" />
@ -110,7 +110,7 @@
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:maxLines="1"
android:singleLine="true"
android:text="@string/toots" />
<TextView
@ -128,7 +128,7 @@
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:maxLines="1"
android:singleLine="true"
android:text="@string/following" />
<TextView
@ -146,7 +146,7 @@
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:maxLines="1"
android:singleLine="true"
android:text="@string/followers" />
<TextView

View File

@ -44,6 +44,6 @@
android:layout_gravity="center_vertical"
android:layout_marginStart="10dp"
android:layout_marginLeft="10dp"
android:maxLines="1" />
android:singleLine="true" />
</LinearLayout>

View File

@ -36,7 +36,7 @@
android:layout_gravity="center_vertical"
android:layout_marginStart="10dp"
android:layout_marginLeft="10dp"
android:maxLines="1" />
android:singleLine="true" />
<TextView
android:id="@+id/account_dn"
@ -45,5 +45,5 @@
android:layout_gravity="center_vertical"
android:layout_marginStart="10dp"
android:layout_marginLeft="10dp"
android:maxLines="1" />
android:singleLine="true" />
</LinearLayout>

View File

@ -37,6 +37,5 @@
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginStart="10dp"
android:layout_marginLeft="10dp"
android:maxLines="1" />
android:singleLine="true" />
</LinearLayout>

View File

@ -129,7 +129,7 @@
android:drawableStart="@drawable/ic_remove_red_eye"
android:drawablePadding="5dp"
android:gravity="center"
android:maxLines="1"
android:singleLine="true"
android:paddingStart="10dp"
android:paddingLeft="10dp"
android:paddingTop="5dp"
@ -278,7 +278,7 @@
android:drawableStart="@drawable/ic_photo"
android:drawablePadding="5dp"
android:gravity="center"
android:maxLines="1"
android:singleLine="true"
android:paddingStart="10dp"
android:paddingLeft="10dp"
android:paddingTop="5dp"

View File

@ -47,7 +47,7 @@
android:id="@+id/account_dn"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:maxLines="1"
android:singleLine="true"
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
android:textSize="18sp" />
@ -56,7 +56,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:maxLines="1"
android:singleLine="true"
android:textSize="16sp" />
</LinearLayout>
</LinearLayout>
@ -78,7 +78,7 @@
android:layout_width="80dp"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:maxLines="1"
android:singleLine="true"
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
android:textSize="18sp" />

View File

@ -96,7 +96,7 @@
android:layout_marginStart="5dp"
android:layout_marginEnd="5dp"
android:ellipsize="end"
android:maxLines="1"
android:singleLine="true"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="@id/status_account_profile_boost_by"
app:layout_constraintEnd_toStartOf="@id/status_boosted_date"
@ -273,7 +273,7 @@
android:layout_marginStart="5dp"
android:drawablePadding="2dp"
android:ellipsize="end"
android:maxLines="1"
android:singleLine="true"
android:textAlignment="viewStart"
android:textStyle="bold"
app:layout_constraintBottom_toTopOf="@id/status_account_username"
@ -302,7 +302,7 @@
android:layout_height="wrap_content"
android:layout_marginStart="5dp"
android:ellipsize="end"
android:maxLines="1"
android:singleLine="true"
android:textAlignment="viewStart"
android:textSize="12sp"
app:layout_constraintBottom_toBottomOf="@id/barrier_account_info_bottom"
@ -315,7 +315,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="5dp"
android:maxLines="1"
android:singleLine="true"
android:textSize="12sp"
app:layout_constraintBottom_toBottomOf="@id/status_account_username"
app:layout_constraintEnd_toEndOf="parent"
@ -360,7 +360,7 @@
android:drawableStart="@drawable/ic_remove_red_eye"
android:drawablePadding="5dp"
android:gravity="center_vertical"
android:maxLines="1"
android:singleLine="true"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:text="@string/load_attachment_spoiler"
@ -387,7 +387,7 @@
android:drawableStart="@drawable/ic_more_toot_content"
android:drawablePadding="5dp"
android:gravity="center_vertical"
android:maxLines="1"
android:singleLine="true"
android:paddingTop="2dp"
android:paddingBottom="2dp"
android:text="@string/display_toot_truncate"
@ -403,7 +403,7 @@
android:layout_marginEnd="10dp"
android:layout_marginBottom="10dp"
android:gravity="end"
android:maxLines="1"
android:singleLine="true"
android:textStyle="italic"
android:visibility="gone" />
@ -503,7 +503,6 @@
android:id="@+id/status_cardview_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:maxLines="1"
android:singleLine="true"
android:textSize="14sp"
android:textStyle="bold" />
@ -521,7 +520,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:maxLines="1"
android:singleLine="true"
android:textSize="12sp" />
</LinearLayout>
</LinearLayout>
@ -1100,7 +1099,7 @@
android:layout_gravity="center_vertical"
android:layout_marginTop="10dp"
android:gravity="center"
android:maxLines="1"
android:singleLine="true"
android:text="@string/fetch_more_toots"
android:textAllCaps="false"
android:textSize="16sp"

View File

@ -215,7 +215,7 @@
android:layout_marginEnd="5dp"
android:drawablePadding="2dp"
android:ellipsize="end"
android:maxLines="1"
android:singleLine="true"
android:textAlignment="viewStart"
android:textStyle="bold"
app:layout_constraintBottom_toTopOf="@id/status_account_username"
@ -232,7 +232,7 @@
android:layout_marginStart="5dp"
android:layout_marginEnd="5dp"
android:ellipsize="end"
android:maxLines="1"
android:singleLine="true"
android:textAlignment="viewStart"
android:textSize="12sp"
app:layout_constraintBottom_toTopOf="@id/barrier_status_account_info"
@ -258,7 +258,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="5dp"
android:maxLines="1"
android:singleLine="true"
android:textSize="12sp"
app:layout_constraintBottom_toBottomOf="@id/status_account_username"
app:layout_constraintEnd_toEndOf="parent"
@ -301,7 +301,7 @@
android:drawableStart="@drawable/ic_remove_red_eye"
android:drawablePadding="5dp"
android:gravity="center_vertical"
android:maxLines="1"
android:singleLine="true"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:text="@string/load_attachment_spoiler"
@ -328,7 +328,7 @@
android:drawableStart="@drawable/ic_more_toot_content"
android:drawablePadding="5dp"
android:gravity="center_vertical"
android:maxLines="1"
android:singleLine="true"
android:paddingTop="2dp"
android:paddingBottom="2dp"
android:text="@string/display_toot_truncate"
@ -430,7 +430,7 @@
android:id="@+id/status_cardview_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:maxLines="1"
android:singleLine="true"
android:textSize="14sp"
android:textStyle="bold" />
@ -447,7 +447,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:maxLines="1"
android:singleLine="true"
android:textSize="12sp" />
</LinearLayout>
</LinearLayout>
@ -837,7 +837,7 @@
android:layout_marginEnd="20dp"
android:layout_marginBottom="5dp"
android:gravity="end"
android:maxLines="1"
android:singleLine="true"
android:textColor="?colorAccent"
android:textSize="16sp"
android:textStyle="italic"
@ -1073,7 +1073,7 @@
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:maxLines="1"
android:singleLine="true"
android:text="@string/fetch_more_toots"
android:textAllCaps="false"
android:textSize="16sp"

View File

@ -174,7 +174,7 @@
android:layout_marginLeft="-2dp"
android:layout_marginTop="-2dp"
android:drawablePadding="2dp"
android:maxLines="1"
android:singleLine="true"
android:textStyle="bold" />
<TextView
@ -182,7 +182,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawablePadding="2dp"
android:maxLines="1"
android:singleLine="true"
android:textStyle="bold" />
<ImageView
@ -205,7 +205,7 @@
android:layout_height="wrap_content"
android:layout_weight="1"
android:ellipsize="end"
android:maxLines="1"
android:singleLine="true"
android:textSize="12sp" />
<TextView
@ -217,7 +217,7 @@
android:layout_marginLeft="2dp"
android:layout_weight="0"
android:gravity="end"
android:maxLines="1"
android:singleLine="true"
android:textSize="12sp" />
</LinearLayout>
@ -246,7 +246,7 @@
android:drawableLeft="@drawable/ic_remove_red_eye"
android:drawablePadding="5dp"
android:gravity="center_vertical"
android:maxLines="1"
android:singleLine="true"
android:paddingStart="10dp"
android:paddingLeft="10dp"
android:paddingTop="5dp"
@ -278,7 +278,7 @@
android:drawableLeft="@drawable/ic_more_toot_content"
android:drawablePadding="5dp"
android:gravity="center_vertical"
android:maxLines="1"
android:singleLine="true"
android:paddingTop="2dp"
android:paddingBottom="2dp"
android:text="@string/display_toot_truncate"
@ -381,7 +381,7 @@
android:id="@+id/status_cardview_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:maxLines="1"
android:singleLine="true"
android:textSize="14sp"
android:textStyle="bold" />
@ -398,7 +398,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:maxLines="1"
android:singleLine="true"
android:textSize="12sp" />
</LinearLayout>
</LinearLayout>
@ -759,7 +759,7 @@
android:layout_marginEnd="20dp"
android:layout_marginBottom="5dp"
android:gravity="end"
android:maxLines="1"
android:singleLine="true"
android:textColor="?colorAccent"
android:textSize="16sp"
android:textStyle="italic"
@ -974,7 +974,7 @@
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:maxLines="1"
android:singleLine="true"
android:text="@string/fetch_more_toots"
android:textAllCaps="false"
android:textSize="16sp"

View File

@ -174,7 +174,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawablePadding="2dp"
android:maxLines="1"
android:singleLine="true"
android:textAlignment="viewStart"
android:textStyle="bold" />
@ -197,7 +197,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawablePadding="2dp"
android:maxLines="1"
android:singleLine="true"
android:textAlignment="viewStart"
android:textStyle="bold" />
</LinearLayout>
@ -207,7 +207,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
android:maxLines="1"
android:singleLine="true"
android:textSize="12sp" />
</LinearLayout>
</LinearLayout>
@ -234,7 +234,7 @@
android:drawableLeft="@drawable/ic_remove_red_eye"
android:drawablePadding="5dp"
android:gravity="center_vertical"
android:maxLines="1"
android:singleLine="true"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:text="@string/load_attachment_spoiler"
@ -260,7 +260,7 @@
android:drawableStart="@drawable/ic_more_toot_content"
android:drawablePadding="5dp"
android:gravity="center_vertical"
android:maxLines="1"
android:singleLine="true"
android:paddingTop="2dp"
android:paddingBottom="2dp"
android:text="@string/display_toot_truncate"
@ -362,7 +362,7 @@
android:id="@+id/status_cardview_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:maxLines="1"
android:singleLine="true"
android:textSize="14sp"
android:textStyle="bold" />
@ -379,7 +379,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:maxLines="1"
android:singleLine="true"
android:textSize="12sp" />
</LinearLayout>
</LinearLayout>
@ -757,7 +757,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:maxLines="1"
android:singleLine="true"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
@ -766,7 +766,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:maxLines="1"
android:singleLine="true"
android:textColor="?colorAccent"
android:textSize="16sp"
android:textStyle="italic"
@ -963,7 +963,7 @@
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:gravity="center_vertical"
android:maxLines="1"
android:singleLine="true"
android:text="@string/fetch_more_toots"
android:textAllCaps="false"
android:textSize="16sp"

View File

@ -66,7 +66,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawablePadding="2dp"
android:maxLines="1"
android:singleLine="true"
android:textSize="16sp"
android:textStyle="bold" />
@ -75,7 +75,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="5dp"
android:maxLines="1"
android:singleLine="true"
android:textSize="14sp"
android:textStyle="bold" />
</LinearLayout>
@ -85,7 +85,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="5dp"
android:maxLines="1"
android:singleLine="true"
android:textSize="14sp"
android:visibility="gone" />

View File

@ -37,5 +37,5 @@
android:layout_gravity="center_vertical"
android:layout_marginStart="10dp"
android:layout_weight="1"
android:maxLines="1" />
android:singleLine="true" />
</LinearLayout>

View File

@ -10,5 +10,5 @@
android:layout_height="wrap_content"
android:hint="@string/filter_regex"
android:inputType="text"
android:maxLines="1" />
android:singleLine="true" />
</LinearLayout>

View File

@ -844,7 +844,7 @@
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:maxLines="1"
android:singleLine="true"
android:text="@string/channel_notif_mention"
android:tint="@android:color/white" />
@ -855,7 +855,7 @@
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:maxLines="1"
android:singleLine="true"
android:text="@string/channel_notif_follow"
android:tint="@android:color/white" />
</LinearLayout>
@ -872,7 +872,7 @@
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:maxLines="1"
android:singleLine="true"
android:text="@string/channel_notif_boost"
android:tint="@android:color/white" />
@ -883,7 +883,7 @@
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:maxLines="1"
android:singleLine="true"
android:text="@string/channel_notif_fav"
android:tint="@android:color/white" />
@ -901,7 +901,7 @@
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:maxLines="1"
android:singleLine="true"
android:text="@string/channel_notif_poll"
android:tint="@android:color/white" />
@ -912,7 +912,7 @@
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:maxLines="1"
android:singleLine="true"
android:text="@string/channel_notif_media"
android:tint="@android:color/white" />
</LinearLayout>
@ -929,7 +929,7 @@
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:maxLines="1"
android:singleLine="true"
android:text="@string/channel_notif_backup"
android:tint="@android:color/white" />
@ -1738,6 +1738,37 @@
android:text="@string/set_video_mode_indication"
android:textColor="@color/mastodonC2" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:gravity="center_vertical"
android:text="@string/set_video_cache"
android:textSize="16sp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:id="@+id/set_video_cache"
android:layout_width="30dp"
android:layout_height="wrap_content"
android:layout_marginEnd="10dp"
android:textSize="16sp"
tools:ignore="RtlHardcoded" />
<SeekBar
android:id="@+id/set_video_cache_size"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical" />
</LinearLayout>
<!-- Featured tags -->
<LinearLayout
android:layout_marginTop="@dimen/settings_option_margin"
@ -1862,7 +1893,7 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="1"
android:singleLine="true"
android:text="@string/set_folder_title"
android:textSize="16sp" />
@ -2544,7 +2575,6 @@
</LinearLayout>
<EditText
android:id="@+id/set_nitter_host"
android:layout_width="match_parent"
@ -2553,6 +2583,52 @@
android:hint="@string/set_nitter_host"
android:inputType="textWebEditText" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/settings_option_margin"
android:layout_marginBottom="@dimen/settings_option_margin"
android:gravity="center_vertical"
android:orientation="horizontal">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="10dp"
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/set_bibliogram"
android:textSize="16sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/set_bibliogram_indication"
android:textColor="@color/mastodonC2"
android:textSize="12sp" />
</LinearLayout>
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/set_bibliogram"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
<EditText
android:id="@+id/set_bibliogram_host"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="end"
android:hint="@string/set_bibliogram_host"
android:inputType="textWebEditText" />
<!-- utm parameters -->
<LinearLayout
android:layout_width="match_parent"

View File

@ -118,7 +118,7 @@
</RelativeLayout>
<com.google.android.exoplayer2.ui.SimpleExoPlayerView
<com.google.android.exoplayer2.ui.PlayerView
android:id="@+id/media_video"
android:layout_width="match_parent"
android:layout_height="match_parent"

View File

@ -108,7 +108,7 @@
android:id="@+id/username"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="1"
android:singleLine="true"
android:textSize="12sp" />
<ImageView

View File

@ -9,9 +9,8 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawableEnd="@drawable/ic_search"
android:drawableRight="@drawable/ic_search"
android:inputType="text"
android:maxLines="1" />
android:singleLine="true"/>
<RelativeLayout
android:id="@+id/loader"

View File

@ -10,7 +10,7 @@
android:layout_height="wrap_content"
android:hint="@string/instance"
android:inputType="textWebEmailAddress"
android:maxLines="1" />
android:singleLine="true" />
<RadioGroup
android:id="@+id/set_attachment_group"

View File

@ -10,5 +10,5 @@
android:layout_height="wrap_content"
android:hint="@string/action_search"
android:inputType="text"
android:maxLines="1" />
android:singleLine="true" />
</LinearLayout>

View File

@ -47,7 +47,7 @@
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:ellipsize="end"
android:maxLines="1"
android:singleLine="true"
android:scrollHorizontally="true"
android:textSize="16sp" />

View File

@ -53,7 +53,7 @@
android:layout_gravity="center_vertical"
android:layout_weight="1"
android:ellipsize="end"
android:maxLines="1"
android:singleLine="true"
android:scrollHorizontally="true"
android:textSize="16sp" />

View File

@ -52,7 +52,7 @@
android:layout_gravity="center_vertical"
android:layout_weight="1"
android:ellipsize="end"
android:maxLines="1"
android:singleLine="true"
android:scrollHorizontally="true"
android:textSize="16sp" />

View File

@ -51,7 +51,7 @@
android:layout_gravity="center_vertical"
android:layout_height="wrap_content"
android:ellipsize="end"
android:maxLines="1"
android:singleLine="true"
android:scrollHorizontally="true"
android:textSize="16sp" />
<androidx.appcompat.widget.SearchView

View File

@ -10,5 +10,5 @@
android:layout_height="wrap_content"
android:hint="@string/some_words_all"
android:inputType="text"
android:maxLines="1" />
android:singleLine="true" />
</LinearLayout>

View File

@ -10,5 +10,5 @@
android:layout_height="wrap_content"
android:hint="@string/some_words_any"
android:inputType="text"
android:maxLines="1" />
android:singleLine="true" />
</LinearLayout>

View File

@ -10,5 +10,5 @@
android:layout_height="wrap_content"
android:hint="@string/some_tags"
android:inputType="text"
android:maxLines="1" />
android:singleLine="true" />
</LinearLayout>

View File

@ -10,5 +10,5 @@
android:layout_height="wrap_content"
android:hint="@string/change_tag_column"
android:inputType="text"
android:maxLines="1" />
android:singleLine="true" />
</LinearLayout>

View File

@ -36,6 +36,6 @@
android:layout_marginStart="5dp"
android:layout_marginLeft="5dp"
android:layout_weight="1"
android:maxLines="1"
android:singleLine="true"
android:textSize="12sp" />
</LinearLayout>

View File

@ -1105,6 +1105,11 @@
<string name="set_nitter_indication">Nitter is an open source alternative Twitter front-end focused on privacy.</string>
<string name="set_nitter_host">Enter your custom host or leave blank for using nitter.net</string>
<string name="set_bibliogram">Replace Instagram with Bibliogram</string>
<string name="set_bibliogram_indication">Bibliogram is an open source alternative Instagram front-end focused on privacy.</string>
<string name="set_bibliogram_host">Enter your custom host or leave blank for using bibliogram.art</string>
<string name="set_hide_status_bar">Hide Fedilab notification bar</string>
<string name="set_hide_status_bar_indication">For hiding the remaining notification in the status bar, tap on the eye icon button then uncheck: \"Display in status bar\"</string>
<string name="set_live_type_indication">Notifications will be delayed every 30 seconds. That will allow to drain less battery.</string>
@ -1226,4 +1231,5 @@
<string name="no_announcements">No announcements!</string>
<string name="add_reaction">Add a reaction</string>
<string name="set_custom_tabs_indication">Use your favourite browser inside the app. Uncheck this feature to open links externally.</string>
<string name="set_video_cache">Video cache in MB, zero means no cache.</string>
</resources>