Merge branch 'develop'

This commit is contained in:
Thomas 2022-11-25 18:21:33 +01:00
commit 27f1d594bb
115 changed files with 4091 additions and 728 deletions

View file

@ -13,8 +13,8 @@ android {
defaultConfig {
minSdk 21
targetSdk 31
versionCode 431
versionName "3.7.4"
versionCode 433
versionName "3.8.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
flavorDimensions "default"

View file

@ -201,7 +201,7 @@
android:configChanges="keyboardHidden|orientation|screenSize"
android:label="@string/account" />
<activity
android:name=".activities.AdminAccountActivity"
android:name=".activities.admin.AdminAccountActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:label="@string/account" />
<activity
@ -210,7 +210,7 @@
android:label="@string/account"
android:theme="@style/AppThemeBar" />
<activity
android:name=".activities.AdminReportActivity"
android:name=".activities.admin.AdminReportActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:label="@string/report"
android:theme="@style/AppThemeBar" />
@ -243,7 +243,16 @@
android:configChanges="keyboardHidden|orientation|screenSize"
android:label="@string/action_about"
android:theme="@style/AppThemeBar" />
<activity
android:name=".activities.admin.AdminDomainBlockActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:label="@string/blocked_domains"
android:theme="@style/AppThemeBar" />
<activity
android:name=".activities.SuggestionActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:label="@string/Suggestions"
android:theme="@style/AppThemeBar" />
<activity
android:name=".activities.PartnerShipActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
@ -255,7 +264,7 @@
android:label="@string/interactions"
android:theme="@style/AppThemeBar" />
<activity
android:name=".activities.AdminActionActivity"
android:name=".activities.admin.AdminActionActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:label="@string/administration"
android:theme="@style/AppThemeBar" />

View file

@ -1,4 +1,14 @@
[
{
"version": "3.8.0",
"code": "433",
"note": "Added:\n- List of blocked domains (allow to unblock)\n- Support gemini links\n- Suggested followers\n- Mod/Adm: Manage instance blocked domains\n- Open messages with another account\n- Allow to disable notifications for admins\n- Sort lists\n\nChanged:\n- Allow search term to be edited\n\nFixed:\n- Drafts deleted with no warning\n- Remove lists from \"Manage timelines\"\n- App crashes when proxy is set\n- Filter not synced after being edited\n- Some crashes / improvements"
},
{
"version": "3.7.5",
"code": "432",
"note": "Added:\n- List of blocked domains (allow to unblock)\n- Support gemini links\n- Suggested followers\n\nChanged:\n- Allow search term to be edited\n\nFixed:\n- Drafts deleted with no warning\n- App crashes when proxy is set\n- Filter not synced after being edited\n- Some crashes"
},
{
"version": "3.7.4",
"code": "431",

View file

@ -95,7 +95,6 @@ import java.util.regex.Pattern;
import app.fedilab.android.activities.AboutActivity;
import app.fedilab.android.activities.ActionActivity;
import app.fedilab.android.activities.AdminActionActivity;
import app.fedilab.android.activities.AnnouncementActivity;
import app.fedilab.android.activities.BaseActivity;
import app.fedilab.android.activities.CacheActivity;
@ -117,7 +116,9 @@ import app.fedilab.android.activities.ReorderTimelinesActivity;
import app.fedilab.android.activities.ScheduledActivity;
import app.fedilab.android.activities.SearchResultTabActivity;
import app.fedilab.android.activities.SettingsActivity;
import app.fedilab.android.activities.SuggestionActivity;
import app.fedilab.android.activities.TrendsActivity;
import app.fedilab.android.activities.admin.AdminActionActivity;
import app.fedilab.android.broadcastreceiver.NetworkStateReceiver;
import app.fedilab.android.client.entities.api.Emoji;
import app.fedilab.android.client.entities.api.EmojiInstance;
@ -391,6 +392,9 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt
} else if (id == R.id.nav_trends) {
Intent intent = new Intent(this, TrendsActivity.class);
startActivity(intent);
} else if (id == R.id.nav_suggestions) {
Intent intent = new Intent(this, SuggestionActivity.class);
startActivity(intent);
} else if (id == R.id.nav_cache) {
Intent intent = new Intent(BaseMainActivity.this, CacheActivity.class);
startActivity(intent);
@ -582,7 +586,7 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt
}
Handler mainHandler = new Handler(Looper.getMainLooper());
Runnable myRunnable = () -> {
if (currentAccount == null) {
if (currentAccount == null || currentAccount.mastodon_account == null) {
//It is not, the user is redirected to the login page
Intent myIntent = new Intent(BaseMainActivity.this, LoginActivity.class);
startActivity(myIntent);
@ -650,13 +654,13 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt
regex_public = sharedpreferences.getString(getString(R.string.SET_FILTER_REGEX_PUBLIC) + currentUserID + currentInstance, null);
show_art_nsfw = sharedpreferences.getBoolean(getString(R.string.SET_ART_WITH_NSFW) + currentUserID + currentInstance, false);
binding.profilePicture.setOnClickListener(v -> binding.drawerLayout.openDrawer(GravityCompat.START));
Helper.loadPP(binding.profilePicture, currentAccount);
Helper.loadPP(BaseMainActivity.this, binding.profilePicture, currentAccount);
headerMainBinding.accountAcc.setText(String.format("%s@%s", currentAccount.mastodon_account.username, currentAccount.instance));
if (currentAccount.mastodon_account.display_name == null || currentAccount.mastodon_account.display_name.isEmpty()) {
currentAccount.mastodon_account.display_name = currentAccount.mastodon_account.acct;
}
headerMainBinding.accountName.setText(currentAccount.mastodon_account.display_name);
Helper.loadPP(headerMainBinding.accountProfilePicture, currentAccount, false);
Helper.loadPP(BaseMainActivity.this, headerMainBinding.accountProfilePicture, currentAccount, false);
MastodonHelper.loadProfileMediaMastodon(headerMainBinding.backgroundImage, currentAccount.mastodon_account, MastodonHelper.MediaAccountType.HEADER);
/*
* Some general data are loaded when the app starts such;
@ -697,16 +701,18 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt
new ViewModelProvider(BaseMainActivity.this).get(AccountsVM.class).getConnectedAccount(currentInstance, currentToken)
.observe(BaseMainActivity.this, mastodonAccount -> {
//Initialize static var
currentAccount.mastodon_account = mastodonAccount;
displayReleaseNotesIfNeeded(BaseMainActivity.this, false);
new Thread(() -> {
try {
//Update account in db
new Account(BaseMainActivity.this).insertOrUpdate(currentAccount);
} catch (DBException e) {
e.printStackTrace();
}
}).start();
if (mastodonAccount != null) {
currentAccount.mastodon_account = mastodonAccount;
displayReleaseNotesIfNeeded(BaseMainActivity.this, false);
new Thread(() -> {
try {
//Update account in db
new Account(BaseMainActivity.this).insertOrUpdate(currentAccount);
} catch (DBException e) {
e.printStackTrace();
}
}).start();
}
});
};
@ -805,10 +811,11 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt
String action = intent.getAction();
String type = intent.getType();
Bundle extras = intent.getExtras();
String userIdIntent, instanceIntent;
String userIdIntent, instanceIntent, urlOfMessage;
if (extras != null && extras.containsKey(Helper.INTENT_ACTION)) {
userIdIntent = extras.getString(Helper.PREF_KEY_ID); //Id of the account in the intent
instanceIntent = extras.getString(Helper.PREF_INSTANCE);
urlOfMessage = extras.getString(Helper.PREF_MESSAGE_URL);
if (extras.getInt(Helper.INTENT_ACTION) == Helper.NOTIFICATION_INTENT) {
if (userIdIntent != null && instanceIntent != null && userIdIntent.equals(currentUserID) && instanceIntent.equals(currentInstance)) {
openNotifications(intent);
@ -834,6 +841,23 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt
}
} else if (extras.getInt(Helper.INTENT_ACTION) == Helper.OPEN_NOTIFICATION) {
openNotifications(intent);
} else if (extras.getInt(Helper.INTENT_ACTION) == Helper.OPEN_WITH_ANOTHER_ACCOUNT) {
CrossActionHelper.fetchRemoteStatus(BaseMainActivity.this, MainActivity.currentAccount, urlOfMessage, new CrossActionHelper.Callback() {
@Override
public void federatedStatus(Status status) {
if (status != null) {
Intent intent = new Intent(BaseMainActivity.this, ContextActivity.class);
intent.putExtra(Helper.ARG_STATUS, status);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
}
}
@Override
public void federatedAccount(app.fedilab.android.client.entities.api.Account account) {
}
});
}
} else if (Intent.ACTION_SEND.equals(action) && type != null) {
if ("text/plain".equals(type)) {
@ -949,7 +973,9 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt
runOnUiThread(() -> {
Bundle b = new Bundle();
b.putString(Helper.ARG_SHARE_URL, url[0]);
b.putString(Helper.ARG_SHARE_URL_MEDIA, finalImage);
if (fetchSharedMedia) {
b.putString(Helper.ARG_SHARE_URL_MEDIA, finalImage);
}
b.putString(Helper.ARG_SHARE_TITLE, finalTitle);
b.putString(Helper.ARG_SHARE_DESCRIPTION, finalDescription);
b.putString(Helper.ARG_SHARE_SUBJECT, sharedSubject);
@ -1029,6 +1055,17 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt
Matcher matcherLink = null;
matcherLink = link.matcher(url);
if (matcherLink.find()) {
if (currentAccount == null) {
SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(BaseMainActivity.this);
if (currentToken == null || currentToken.trim().isEmpty()) {
currentToken = sharedpreferences.getString(Helper.PREF_USER_TOKEN, null);
}
try {
currentAccount = new Account(BaseMainActivity.this).getConnectedAccount();
} catch (DBException e) {
e.printStackTrace();
}
}
if (matcherLink.group(3) != null && Objects.requireNonNull(matcherLink.group(3)).length() > 0) { //It's a toot
CrossActionHelper.fetchRemoteStatus(BaseMainActivity.this, currentAccount, url, new CrossActionHelper.Callback() {
@Override

View file

@ -31,9 +31,9 @@ import androidx.recyclerview.widget.LinearLayoutManager;
import java.util.ArrayList;
import app.fedilab.android.R;
import app.fedilab.android.client.entities.api.AdminAccount;
import app.fedilab.android.client.entities.api.AdminReport;
import app.fedilab.android.client.entities.api.Status;
import app.fedilab.android.client.entities.api.admin.AdminAccount;
import app.fedilab.android.client.entities.api.admin.AdminReport;
import app.fedilab.android.databinding.ActivityAdminReportBinding;
import app.fedilab.android.helper.Helper;
import app.fedilab.android.helper.ThemeHelper;
@ -221,7 +221,7 @@ public class AccountReportActivity extends BaseActivity {
binding.email.setVisibility(View.GONE);
binding.emailLabel.setVisibility(View.GONE);
}
if (accountAdmin.ip == null || accountAdmin.ip.ip.trim().equals("")) {
if (accountAdmin.ip == null || accountAdmin.ip.trim().equals("")) {
binding.recentIp.setVisibility(View.GONE);
binding.recentIpLabel.setVisibility(View.GONE);
}
@ -243,7 +243,7 @@ public class AccountReportActivity extends BaseActivity {
binding.emailUser.setVisibility(View.VISIBLE);
binding.commentLabel.setVisibility(View.VISIBLE);
binding.comment.setVisibility(View.VISIBLE);
binding.recentIp.setText(accountAdmin.ip != null ? accountAdmin.ip.ip : "");
binding.recentIp.setText(accountAdmin.ip != null ? accountAdmin.ip : "");
binding.disable.setVisibility(View.VISIBLE);
binding.suspend.setVisibility(View.VISIBLE);
} else {
@ -260,18 +260,9 @@ public class AccountReportActivity extends BaseActivity {
}
if (accountAdmin.role != null) {
switch (accountAdmin.role) {
case "user":
binding.permissions.setText(getString(R.string.user));
break;
case "moderator":
binding.permissions.setText(getString(R.string.moderator));
break;
case "admin":
binding.permissions.setText(getString(R.string.administrator));
break;
}
if (accountAdmin.role.equals("admin") || accountAdmin.role.equals("moderator")) {
binding.permissions.setText(AdminAccount.permissions.get(accountAdmin.role.permissions));
binding.permissions.setText(getString(R.string.user));
if (accountAdmin.role.permissions == 1 || accountAdmin.role.permissions == 400) {
binding.warn.setVisibility(View.GONE);
binding.suspend.setVisibility(View.GONE);
binding.silence.setVisibility(View.GONE);

View file

@ -29,6 +29,7 @@ import app.fedilab.android.databinding.ActivityActionsBinding;
import app.fedilab.android.helper.Helper;
import app.fedilab.android.helper.ThemeHelper;
import app.fedilab.android.ui.fragment.timeline.FragmentMastodonAccount;
import app.fedilab.android.ui.fragment.timeline.FragmentMastodonDomainBlock;
import app.fedilab.android.ui.fragment.timeline.FragmentMastodonTimeline;
public class ActionActivity extends BaseActivity {
@ -37,6 +38,7 @@ public class ActionActivity extends BaseActivity {
private boolean canGoBack;
private FragmentMastodonTimeline fragmentMastodonTimeline;
private FragmentMastodonAccount fragmentMastodonAccount;
private FragmentMastodonDomainBlock fragmentMastodonDomainBlock;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
@ -54,6 +56,7 @@ public class ActionActivity extends BaseActivity {
binding.bookmarks.setOnClickListener(v -> displayTimeline(Timeline.TimeLineEnum.BOOKMARK_TIMELINE));
binding.muted.setOnClickListener(v -> displayTimeline(Timeline.TimeLineEnum.MUTED_TIMELINE));
binding.blocked.setOnClickListener(v -> displayTimeline(Timeline.TimeLineEnum.BLOCKED_TIMELINE));
binding.domainBlock.setOnClickListener(v -> displayTimeline(Timeline.TimeLineEnum.BLOCKED_DOMAIN_TIMELINE));
}
private void displayTimeline(Timeline.TimeLineEnum type) {
@ -73,6 +76,15 @@ public class ActionActivity extends BaseActivity {
fragmentTransaction.commit();
});
} else if (type == Timeline.TimeLineEnum.BLOCKED_DOMAIN_TIMELINE) {
ThemeHelper.slideViewsToLeft(binding.buttonContainer, binding.fragmentContainer, () -> {
fragmentMastodonDomainBlock = new FragmentMastodonDomainBlock();
FragmentManager fragmentManager = getSupportFragmentManager();
FragmentTransaction fragmentTransaction =
fragmentManager.beginTransaction();
fragmentTransaction.replace(R.id.fragment_container, fragmentMastodonDomainBlock);
fragmentTransaction.commit();
});
} else {
ThemeHelper.slideViewsToLeft(binding.buttonContainer, binding.fragmentContainer, () -> {
@ -102,6 +114,9 @@ public class ActionActivity extends BaseActivity {
case BOOKMARK_TIMELINE:
setTitle(R.string.bookmarks);
break;
case BLOCKED_DOMAIN_TIMELINE:
setTitle(R.string.blocked_domains);
break;
}
}
@ -116,6 +131,9 @@ public class ActionActivity extends BaseActivity {
if (fragmentMastodonAccount != null) {
fragmentMastodonAccount.onDestroyView();
}
if (fragmentMastodonDomainBlock != null) {
fragmentMastodonDomainBlock.onDestroyView();
}
});
setTitle(R.string.interactions);
} else {

View file

@ -143,7 +143,11 @@ public class CacheActivity extends BaseActivity {
dialogRestart.dismiss();
Helper.restart(CacheActivity.this);
});
restartBuilder.create().show();
AlertDialog alertDialog = restartBuilder.create();
if (!isFinishing()) {
alertDialog.show();
}
}));
dialog.dismiss();
});

View file

@ -110,6 +110,7 @@ public class ComposeActivity extends BaseActivity implements ComposeAdapter.Mana
private StatusDraft statusDraft;
private ComposeAdapter composeAdapter;
private boolean promptSaveDraft;
private boolean restoredDraft;
private final BroadcastReceiver imageReceiver = new BroadcastReceiver() {
@ -235,12 +236,14 @@ public class ComposeActivity extends BaseActivity implements ComposeAdapter.Mana
AlertDialog alert = alt_bld.create();
alert.show();
} else {
try {
new StatusDraft(ComposeActivity.this).removeDraft(statusDraft);
finish();
} catch (DBException e) {
e.printStackTrace();
if (!restoredDraft) {
try {
new StatusDraft(ComposeActivity.this).removeDraft(statusDraft);
} catch (DBException e) {
e.printStackTrace();
}
}
finish();
}
} else {
finish();
@ -446,6 +449,7 @@ public class ComposeActivity extends BaseActivity implements ComposeAdapter.Mana
setContentView(binding.getRoot());
setSupportActionBar(binding.toolbar);
promptSaveDraft = false;
restoredDraft = false;
ActionBar actionBar = getSupportActionBar();
//Remove title
if (actionBar != null) {
@ -576,6 +580,7 @@ public class ComposeActivity extends BaseActivity implements ComposeAdapter.Mana
}
});
} else if (statusDraft != null) {//Restore a draft with all messages
restoredDraft = true;
if (statusDraft.statusReplyList != null) {
statusList.addAll(statusDraft.statusReplyList);
binding.recyclerView.addItemDecoration(new DividerDecorationSimple(ComposeActivity.this, statusList));

View file

@ -106,7 +106,6 @@ public class FilterActivity extends BaseActivity implements FilterAdapter.Delete
});
if (filter != null) {
filterParams.filter_action = filter.filter_action;
@ -166,7 +165,9 @@ public class FilterActivity extends BaseActivity implements FilterAdapter.Delete
popupAddFilterBinding.lvKeywords.setLayoutManager(new LinearLayoutManager(context));
popupAddFilterBinding.addKeyword.setOnClickListener(v -> {
filterParams.keywords.add(new Filter.KeywordsParams());
Filter.KeywordsParams keywordsParams = new Filter.KeywordsParams();
keywordsParams.whole_word = true;
filterParams.keywords.add(keywordsParams);
keywordAdapter.notifyItemInserted(filterParams.keywords.size() - 1);
});
@ -276,7 +277,11 @@ public class FilterActivity extends BaseActivity implements FilterAdapter.Delete
binding.addFilter.setOnClickListener(v -> addEditFilter(FilterActivity.this, null, filter -> {
if (filter != null) {
if (MainActivity.mainFilters == null) {
MainActivity.mainFilters = new ArrayList<>();
}
filterList.add(0, filter);
MainActivity.mainFilters.add(filter);
if (filterAdapter != null) {
filterAdapter.notifyItemInserted(0);
} else {

View file

@ -22,12 +22,17 @@ import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.text.Html;
import android.text.SpannableString;
import android.text.Spanned;
import android.text.style.ForegroundColorSpan;
import android.text.style.UnderlineSpan;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.core.content.ContextCompat;
import androidx.lifecycle.ViewModelProvider;
import androidx.preference.PreferenceManager;
@ -39,6 +44,7 @@ import app.fedilab.android.BaseMainActivity;
import app.fedilab.android.R;
import app.fedilab.android.client.entities.api.Instance;
import app.fedilab.android.databinding.ActivityInstanceBinding;
import app.fedilab.android.helper.Helper;
import app.fedilab.android.helper.ThemeHelper;
import app.fedilab.android.viewmodel.mastodon.InstancesVM;
@ -61,6 +67,22 @@ public class InstanceActivity extends BaseActivity {
if (getSupportActionBar() != null)
getSupportActionBar().hide();
SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(InstanceActivity.this);
final SpannableString contentAbout = new SpannableString(getString(R.string.action_about_instance));
contentAbout.setSpan(new UnderlineSpan(), 0, contentAbout.length(), 0);
contentAbout.setSpan(new ForegroundColorSpan(ContextCompat.getColor(InstanceActivity.this, R.color.cyanea_accent_reference)), 0, contentAbout.length(),
Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
binding.tos.setText(contentAbout);
final SpannableString contentPrivacy = new SpannableString(getString(R.string.action_privacy_policy));
contentPrivacy.setSpan(new UnderlineSpan(), 0, contentPrivacy.length(), 0);
contentPrivacy.setSpan(new ForegroundColorSpan(ContextCompat.getColor(InstanceActivity.this, R.color.cyanea_accent_reference)), 0, contentPrivacy.length(),
Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
binding.privacy.setText(contentPrivacy);
binding.tos.setOnClickListener(v -> Helper.openBrowser(InstanceActivity.this, "https://" + MainActivity.currentInstance + "/about"));
binding.privacy.setOnClickListener(v -> Helper.openBrowser(InstanceActivity.this, "https://" + MainActivity.currentInstance + "/privacy-policy"));
binding.close.setOnClickListener(
view -> {

View file

@ -15,8 +15,6 @@ package app.fedilab.android.activities;
* see <http://www.gnu.org/licenses>. */
import static app.fedilab.android.helper.PinnedTimelineHelper.sortListPositionAsc;
import android.content.Intent;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;
@ -39,6 +37,7 @@ import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import app.fedilab.android.BaseMainActivity;
@ -78,6 +77,7 @@ public class MastodonListActivity extends BaseActivity implements MastodonListAd
private boolean flagLoading;
private String max_id;
private FragmentMastodonTimeline fragmentMastodonTimeline;
private boolean orderASC;
@Override
protected void onCreate(Bundle savedInstanceState) {
@ -92,6 +92,7 @@ public class MastodonListActivity extends BaseActivity implements MastodonListAd
getSupportActionBar().setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(this, R.color.cyanea_primary)));
}
flagLoading = false;
orderASC = true;
max_id = null;
accountsVM = new ViewModelProvider(MastodonListActivity.this).get(AccountsVM.class);
timelinesVM = new ViewModelProvider(MastodonListActivity.this).get(TimelinesVM.class);
@ -114,7 +115,7 @@ public class MastodonListActivity extends BaseActivity implements MastodonListAd
}
}
}
sortListPositionAsc(mastodonListList);
sortAsc(mastodonListList);
mastodonListAdapter = new MastodonListAdapter(mastodonListList);
mastodonListAdapter.actionOnList = this;
binding.notContent.setVisibility(View.GONE);
@ -127,6 +128,19 @@ public class MastodonListActivity extends BaseActivity implements MastodonListAd
});
}
private void sortAsc(List<MastodonList> mastodonLists) {
Collections.sort(mastodonLists, (obj1, obj2) -> obj1.title.compareToIgnoreCase(obj2.title));
orderASC = true;
invalidateOptionsMenu();
}
private void sortDesc(List<MastodonList> mastodonLists) {
Collections.sort(mastodonLists, (obj1, obj2) -> obj2.title.compareToIgnoreCase(obj1.title));
orderASC = false;
invalidateOptionsMenu();
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
if (item.getItemId() == android.R.id.home) {
@ -279,8 +293,15 @@ public class MastodonListActivity extends BaseActivity implements MastodonListAd
if (mastodonListList == null) {
mastodonListList = new ArrayList<>();
}
if (newMastodonList != null && mastodonListAdapter != null) {
if (newMastodonList != null) {
mastodonListList.add(0, newMastodonList);
if (mastodonListAdapter == null) {
mastodonListAdapter = new MastodonListAdapter(mastodonListList);
mastodonListAdapter.actionOnList = MastodonListActivity.this;
binding.notContent.setVisibility(View.GONE);
binding.recyclerView.setAdapter(mastodonListAdapter);
binding.recyclerView.setLayoutManager(new LinearLayoutManager(MastodonListActivity.this));
}
mastodonListAdapter.notifyItemInserted(0);
} else {
Toasty.error(MastodonListActivity.this, getString(R.string.toast_error), Toasty.LENGTH_LONG).show();
@ -367,6 +388,16 @@ public class MastodonListActivity extends BaseActivity implements MastodonListAd
});
dialogBuilder.setNegativeButton(R.string.cancel, (dialog, id) -> dialog.dismiss());
dialogBuilder.create().show();
} else if (item.getItemId() == R.id.action_order) {
if (mastodonListList != null && mastodonListList.size() > 0 && mastodonListAdapter != null) {
if (orderASC) {
sortDesc(mastodonListList);
} else {
sortAsc(mastodonListList);
}
invalidateOptionsMenu();
mastodonListAdapter.notifyItemRangeChanged(0, mastodonListList.size());
}
}
return super.onOptionsItemSelected(item);
}
@ -396,6 +427,14 @@ public class MastodonListActivity extends BaseActivity implements MastodonListAd
public boolean onCreateOptionsMenu(@NonNull Menu menu) {
if (!canGoBack) {
getMenuInflater().inflate(R.menu.menu_main_list, menu);
MenuItem order = menu.findItem(R.id.action_order);
if (order != null) {
if (orderASC) {
order.setIcon(R.drawable.ic_baseline_filter_asc_24);
} else {
order.setIcon(R.drawable.ic_baseline_filter_desc_24);
}
}
} else {
getMenuInflater().inflate(R.menu.menu_list, menu);
}

View file

@ -364,7 +364,7 @@ public class ProfileActivity extends BaseActivity {
//Fields for profile
List<Field> fields = account.fields;
if (fields != null && fields.size() > 0) {
FieldAdapter fieldAdapter = new FieldAdapter(fields);
FieldAdapter fieldAdapter = new FieldAdapter(fields, account);
binding.fieldsContainer.setAdapter(fieldAdapter);
binding.fieldsContainer.setLayoutManager(new LinearLayoutManager(ProfileActivity.this));
}
@ -695,7 +695,6 @@ public class ProfileActivity extends BaseActivity {
splitAcct = account.acct.split("@");
}
SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(ProfileActivity.this);
AlertDialog.Builder builderInner = null;
final boolean isOwner = account != null && account.id != null && BaseMainActivity.currentUserID != null && account.id.compareToIgnoreCase(BaseMainActivity.currentUserID) == 0;
final String[] stringArrayConf;
if (isOwner) {
@ -870,7 +869,7 @@ public class ProfileActivity extends BaseActivity {
i++;
}
builderSingle.setMultiChoiceItems(listsArray, presentArray, (dialog, which, isChecked) -> {
if (!relationship.following) {
if (relationship == null || !relationship.following) {
accountsVM.follow(BaseMainActivity.currentInstance, BaseMainActivity.currentToken, account.id, true, false)
.observe(ProfileActivity.this, newRelationShip -> {
relationship = newRelationShip;
@ -920,21 +919,43 @@ public class ProfileActivity extends BaseActivity {
startActivity(intent);
return true;
} else if (itemId == R.id.action_mute) {
AlertDialog.Builder builderInner;
if (relationship != null) {
if (relationship.muting) {
builderInner = new AlertDialog.Builder(ProfileActivity.this, Helper.dialogStyle());
builderInner.setTitle(stringArrayConf[4]);
doActionAccount = action.UNMUTE;
String target;
if (item.getItemId() == R.id.action_block_instance) {
target = account.acct.split("@")[1];
} else {
builderInner = new AlertDialog.Builder(ProfileActivity.this, Helper.dialogStyle());
builderInner.setTitle(stringArrayConf[0]);
doActionAccount = action.MUTE;
target = account.id;
}
} else {
doActionAccount = action.NOTHING;
}
if (relationship.muting) {
accountsVM.unmute(BaseMainActivity.currentInstance, BaseMainActivity.currentToken, target)
.observe(ProfileActivity.this, relationShip -> {
this.relationship = relationShip;
updateAccount();
});
return true;
}
builderInner = new AlertDialog.Builder(ProfileActivity.this, Helper.dialogStyle());
builderInner.setTitle(stringArrayConf[0]);
builderInner.setNeutralButton(R.string.cancel, (dialog, which) -> dialog.dismiss());
builderInner.setNegativeButton(R.string.keep_notifications, (dialog, which) -> {
accountsVM.mute(BaseMainActivity.currentInstance, BaseMainActivity.currentToken, target, false, 0)
.observe(ProfileActivity.this, relationShip -> {
this.relationship = relationShip;
updateAccount();
});
});
builderInner.setPositiveButton(R.string.action_mute, (dialog, which) -> {
accountsVM.mute(BaseMainActivity.currentInstance, BaseMainActivity.currentToken, target, true, 0)
.observe(ProfileActivity.this, relationShip -> {
this.relationship = relationShip;
updateAccount();
});
dialog.dismiss();
});
builderInner.show();
}
} else if (itemId == R.id.action_timed_mute) {
MastodonHelper.scheduleBoost(ProfileActivity.this, MastodonHelper.ScheduleType.TIMED_MUTED, null, account, rs -> {
this.relationship = rs;
@ -942,7 +963,7 @@ public class ProfileActivity extends BaseActivity {
});
return true;
} else if (itemId == R.id.action_report) {
builderInner = new AlertDialog.Builder(ProfileActivity.this, Helper.dialogStyle());
AlertDialog.Builder builderInner = new AlertDialog.Builder(ProfileActivity.this, Helper.dialogStyle());
builderInner.setTitle(R.string.report_account);
//Text for report
EditText input = new EditText(ProfileActivity.this);
@ -962,7 +983,7 @@ public class ProfileActivity extends BaseActivity {
builderInner.show();
return true;
} else if (itemId == R.id.action_block) {
builderInner = new AlertDialog.Builder(ProfileActivity.this, Helper.dialogStyle());
AlertDialog.Builder builderInner = new AlertDialog.Builder(ProfileActivity.this, Helper.dialogStyle());
if (relationship != null) {
if (relationship.blocking) {
builderInner.setTitle(stringArrayConf[5]);
@ -974,15 +995,6 @@ public class ProfileActivity extends BaseActivity {
} else {
doActionAccount = action.NOTHING;
}
} else if (itemId == R.id.action_block_instance) {
builderInner = new AlertDialog.Builder(ProfileActivity.this, Helper.dialogStyle());
doActionAccount = action.BLOCK_DOMAIN;
String domain = account.acct.split("@")[1];
builderInner.setMessage(getString(R.string.block_domain_confirm_message, domain));
} else {
return true;
}
if (doAction != action.NOTHING && builderInner != null) {
builderInner.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss());
builderInner.setPositiveButton(R.string.yes, (dialog, which) -> {
String target;
@ -992,20 +1004,6 @@ public class ProfileActivity extends BaseActivity {
target = account.id;
}
switch (doActionAccount) {
case MUTE:
accountsVM.mute(BaseMainActivity.currentInstance, BaseMainActivity.currentToken, target, true, 0)
.observe(ProfileActivity.this, relationShip -> {
this.relationship = relationShip;
updateAccount();
});
break;
case UNMUTE:
accountsVM.unmute(BaseMainActivity.currentInstance, BaseMainActivity.currentToken, target)
.observe(ProfileActivity.this, relationShip -> {
this.relationship = relationShip;
updateAccount();
});
break;
case BLOCK:
accountsVM.block(BaseMainActivity.currentInstance, BaseMainActivity.currentToken, target)
.observe(ProfileActivity.this, relationShip -> {
@ -1020,13 +1018,28 @@ public class ProfileActivity extends BaseActivity {
updateAccount();
});
break;
case BLOCK_DOMAIN:
accountsVM.addDomainBlocks(BaseMainActivity.currentInstance, BaseMainActivity.currentToken, target);
break;
}
dialog.dismiss();
});
builderInner.show();
} else if (itemId == R.id.action_block_instance) {
AlertDialog.Builder builderInner = new AlertDialog.Builder(ProfileActivity.this, Helper.dialogStyle());
String domain = account.acct.split("@")[1];
builderInner.setMessage(getString(R.string.block_domain_confirm_message, domain));
builderInner.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss());
builderInner.setPositiveButton(R.string.yes, (dialog, which) -> {
String target;
if (item.getItemId() == R.id.action_block_instance) {
target = account.acct.split("@")[1];
} else {
target = account.id;
}
accountsVM.addDomainBlocks(BaseMainActivity.currentInstance, BaseMainActivity.currentToken, target);
dialog.dismiss();
});
builderInner.show();
} else {
return true;
}
return true;
}

View file

@ -22,7 +22,6 @@ import android.content.Intent;
import android.content.SharedPreferences;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;
import android.os.Handler;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.Menu;
@ -43,8 +42,6 @@ import androidx.recyclerview.widget.ItemTouchHelper;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.google.android.material.snackbar.Snackbar;
import java.io.IOException;
import java.util.ArrayList;
import java.util.concurrent.TimeUnit;
@ -62,7 +59,6 @@ import app.fedilab.android.exception.DBException;
import app.fedilab.android.helper.Helper;
import app.fedilab.android.helper.ThemeHelper;
import app.fedilab.android.helper.itemtouchhelper.OnStartDragListener;
import app.fedilab.android.helper.itemtouchhelper.OnUndoListener;
import app.fedilab.android.helper.itemtouchhelper.SimpleItemTouchHelperCallback;
import app.fedilab.android.ui.drawer.ReorderBottomMenuAdapter;
import app.fedilab.android.ui.drawer.ReorderTabAdapter;
@ -78,7 +74,7 @@ import okhttp3.RequestBody;
import okhttp3.Response;
public class ReorderTimelinesActivity extends BaseActivity implements OnStartDragListener, OnUndoListener {
public class ReorderTimelinesActivity extends BaseActivity implements OnStartDragListener {
private ItemTouchHelper touchHelper;
@ -132,7 +128,7 @@ public class ReorderTimelinesActivity extends BaseActivity implements OnStartDra
update = false;
}
sortPositionAsc(this.pinned.pinnedTimelines);
reorderTabAdapter = new ReorderTabAdapter(this.pinned, ReorderTimelinesActivity.this, ReorderTimelinesActivity.this);
reorderTabAdapter = new ReorderTabAdapter(this.pinned, ReorderTimelinesActivity.this);
ItemTouchHelper.Callback callback =
new SimpleItemTouchHelperCallback(reorderTabAdapter);
touchHelper = new ItemTouchHelper(callback);
@ -393,51 +389,6 @@ public class ReorderTimelinesActivity extends BaseActivity implements OnStartDra
}
@Override
public void onUndo(PinnedTimeline pinnedTimeline, int position) {
String text = "";
switch (pinnedTimeline.type) {
case TAG:
text = getString(R.string.reorder_tag_removed);
break;
case REMOTE:
text = getString(R.string.reorder_instance_removed);
break;
case LIST:
text = getString(R.string.reorder_list_deleted);
break;
}
Runnable runnable = () -> {
//change position of pinned that are after the removed item
for (int i = pinnedTimeline.position + 1; i < pinned.pinnedTimelines.size(); i++) {
pinned.pinnedTimelines.get(i).position -= 1;
}
pinned.pinnedTimelines.remove(pinnedTimeline);
reorderTabAdapter.notifyItemRemoved(position);
try {
new Pinned(ReorderTimelinesActivity.this).updatePinned(pinned);
changes = true;
} catch (DBException e) {
e.printStackTrace();
}
};
Handler handler = new Handler();
handler.postDelayed(runnable, 4000);
Snackbar.make(binding.getRoot(), text, 4000)
.setAction(getString(R.string.undo), view -> {
pinned.pinnedTimelines.add(position, pinnedTimeline);
reorderTabAdapter.notifyItemInserted(position);
handler.removeCallbacks(runnable);
})
.setTextColor(ThemeHelper.getAttColor(ReorderTimelinesActivity.this, R.attr.mTextColor))
.setActionTextColor(ContextCompat.getColor(ReorderTimelinesActivity.this, R.color.cyanea_accent_reference))
.setBackgroundTint(ContextCompat.getColor(ReorderTimelinesActivity.this, R.color.cyanea_primary_dark_reference))
.show();
}
@Override
public void onStop() {
super.onStop();

View file

@ -122,6 +122,9 @@ public class SearchResultTabActivity extends BaseActivity {
inflater.inflate(R.menu.menu_search, menu);
SearchManager searchManager = (SearchManager) getSystemService(Context.SEARCH_SERVICE);
SearchView searchView = (SearchView) menu.findItem(R.id.action_search).getActionView();
if (search != null) {
searchView.setQuery(search, false);
}
searchView.setSearchableInfo(searchManager.getSearchableInfo(getComponentName()));
searchView.setIconifiedByDefault(false);
searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {

View file

@ -0,0 +1,61 @@
package app.fedilab.android.activities;
/* Copyright 2022 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.graphics.drawable.ColorDrawable;
import android.os.Bundle;
import android.view.MenuItem;
import androidx.core.content.ContextCompat;
import org.jetbrains.annotations.NotNull;
import app.fedilab.android.R;
import app.fedilab.android.databinding.ActivitySuggestionsBinding;
import app.fedilab.android.helper.Helper;
import app.fedilab.android.helper.ThemeHelper;
import app.fedilab.android.ui.fragment.timeline.FragmentMastodonSuggestion;
public class SuggestionActivity extends BaseActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
ThemeHelper.applyThemeBar(this);
ActivitySuggestionsBinding binding = ActivitySuggestionsBinding.inflate(getLayoutInflater());
setContentView(binding.getRoot());
if (getSupportActionBar() != null) {
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(this, R.color.cyanea_primary)));
}
Helper.addFragment(getSupportFragmentManager(), R.id.nav_host_fragment_suggestions, new FragmentMastodonSuggestion(), null, null, null);
}
@Override
public boolean onOptionsItemSelected(@NotNull MenuItem item) {
if (item.getItemId() == android.R.id.home) {
finish();
return true;
}
return super.onOptionsItemSelected(item);
}
}

View file

@ -1,4 +1,4 @@
package app.fedilab.android.activities;
package app.fedilab.android.activities.admin;
/* Copyright 2022 Thomas Schneider
*
* This file is a part of Fedilab
@ -54,8 +54,13 @@ import java.util.concurrent.TimeUnit;
import app.fedilab.android.BaseMainActivity;
import app.fedilab.android.R;
import app.fedilab.android.client.entities.api.AdminAccount;
import app.fedilab.android.activities.BaseActivity;
import app.fedilab.android.activities.InstanceProfileActivity;
import app.fedilab.android.activities.MainActivity;
import app.fedilab.android.activities.MediaActivity;
import app.fedilab.android.client.entities.api.Attachment;
import app.fedilab.android.client.entities.api.admin.AdminAccount;
import app.fedilab.android.client.entities.api.admin.AdminIp;
import app.fedilab.android.databinding.ActivityAdminAccountBinding;
import app.fedilab.android.helper.Helper;
import app.fedilab.android.helper.MastodonHelper;
@ -204,7 +209,7 @@ public class AdminAccountActivity extends BaseActivity {
StringBuilder lastActive = new StringBuilder();
if (adminAccount.ips != null) {
int count = 0;
for (AdminAccount.IP ip : adminAccount.ips) {
for (AdminIp ip : adminAccount.ips) {
lastActive.append(Helper.shortDateToString(ip.used_at)).append(" - ").append(ip.ip).append("\r\n");
count++;
if (count > 4) {

View file

@ -1,4 +1,4 @@
package app.fedilab.android.activities;
package app.fedilab.android.activities.admin;
/* Copyright 2022 Thomas Schneider
*
* This file is a part of Fedilab
@ -14,8 +14,14 @@ package app.fedilab.android.activities;
* You should have received a copy of the GNU General Public License along with Fedilab; if not,
* see <http://www.gnu.org/licenses>. */
import static app.fedilab.android.activities.AdminActionActivity.AdminEnum.REPORT;
import static app.fedilab.android.activities.admin.AdminActionActivity.AdminEnum.ACCOUNT;
import static app.fedilab.android.activities.admin.AdminActionActivity.AdminEnum.DOMAIN;
import static app.fedilab.android.activities.admin.AdminActionActivity.AdminEnum.REPORT;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;
import android.view.Menu;
@ -27,16 +33,20 @@ import androidx.appcompat.app.AlertDialog;
import androidx.core.content.ContextCompat;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentTransaction;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import com.google.gson.annotations.SerializedName;
import app.fedilab.android.R;
import app.fedilab.android.activities.BaseActivity;
import app.fedilab.android.client.entities.api.admin.AdminDomainBlock;
import app.fedilab.android.databinding.ActivityAdminActionsBinding;
import app.fedilab.android.databinding.PopupAdminFilterAccountsBinding;
import app.fedilab.android.databinding.PopupAdminFilterReportsBinding;
import app.fedilab.android.helper.Helper;
import app.fedilab.android.helper.ThemeHelper;
import app.fedilab.android.ui.fragment.admin.FragmentAdminAccount;
import app.fedilab.android.ui.fragment.admin.FragmentAdminDomain;
import app.fedilab.android.ui.fragment.admin.FragmentAdminReport;
public class AdminActionActivity extends BaseActivity {
@ -47,6 +57,26 @@ public class AdminActionActivity extends BaseActivity {
private boolean canGoBack;
private FragmentAdminReport fragmentAdminReport;
private FragmentAdminAccount fragmentAdminAccount;
private FragmentAdminDomain fragmentAdminDomain;
private final BroadcastReceiver mReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
Bundle b = intent.getExtras();
if (b != null) {
AdminDomainBlock adminDomainBlock = (AdminDomainBlock) b.getSerializable(Helper.ARG_ADMIN_DOMAINBLOCK);
AdminDomainBlock adminDomainBlockDelete = (AdminDomainBlock) b.getSerializable(Helper.ARG_ADMIN_DOMAINBLOCK_DELETE);
if (adminDomainBlock != null && adminDomainBlock.domain != null && fragmentAdminDomain != null) {
fragmentAdminDomain.update(adminDomainBlock);
}
if (adminDomainBlockDelete != null && fragmentAdminDomain != null) {
fragmentAdminDomain.delete(adminDomainBlockDelete);
}
}
}
};
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
@ -54,20 +84,21 @@ public class AdminActionActivity extends BaseActivity {
ThemeHelper.applyThemeBar(this);
binding = ActivityAdminActionsBinding.inflate(getLayoutInflater());
setContentView(binding.getRoot());
LocalBroadcastManager.getInstance(this).registerReceiver(mReceiver, new IntentFilter(Helper.BROADCAST_DATA));
if (getSupportActionBar() != null) {
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(this, R.color.cyanea_primary)));
}
canGoBack = false;
binding.reports.setOnClickListener(v -> displayTimeline(REPORT));
binding.accounts.setOnClickListener(v -> displayTimeline(AdminEnum.ACCOUNT));
binding.accounts.setOnClickListener(v -> displayTimeline(ACCOUNT));
binding.domains.setOnClickListener(v -> displayTimeline(DOMAIN));
}
private void displayTimeline(AdminEnum type) {
canGoBack = true;
if (type == REPORT) {
ThemeHelper.slideViewsToLeft(binding.buttonContainer, binding.fragmentContainer, () -> {
fragmentAdminReport = new FragmentAdminReport();
Bundle bundle = new Bundle();
@ -80,9 +111,7 @@ public class AdminActionActivity extends BaseActivity {
fragmentTransaction.replace(R.id.fragment_container, fragmentAdminReport);
fragmentTransaction.commit();
});
} else {
} else if (type == ACCOUNT) {
ThemeHelper.slideViewsToLeft(binding.buttonContainer, binding.fragmentContainer, () -> {
fragmentAdminAccount = new FragmentAdminAccount();
Bundle bundle = new Bundle();
@ -95,7 +124,19 @@ public class AdminActionActivity extends BaseActivity {
fragmentTransaction.replace(R.id.fragment_container, fragmentAdminAccount);
fragmentTransaction.commit();
});
} else if (type == DOMAIN) {
ThemeHelper.slideViewsToLeft(binding.buttonContainer, binding.fragmentContainer, () -> {
fragmentAdminDomain = new FragmentAdminDomain();
Bundle bundle = new Bundle();
bundle.putSerializable(Helper.ARG_TIMELINE_TYPE, type);
bundle.putString(Helper.ARG_VIEW_MODEL_KEY, "FEDILAB_" + type.getValue());
fragmentAdminDomain.setArguments(bundle);
FragmentManager fragmentManager = getSupportFragmentManager();
FragmentTransaction fragmentTransaction =
fragmentManager.beginTransaction();
fragmentTransaction.replace(R.id.fragment_container, fragmentAdminDomain);
fragmentTransaction.commit();
});
}
switch (type) {
case REPORT:
@ -104,13 +145,16 @@ public class AdminActionActivity extends BaseActivity {
case ACCOUNT:
setTitle(R.string.accounts);
break;
case DOMAIN:
setTitle(R.string.domains);
break;
}
invalidateOptionsMenu();
}
@Override
public boolean onCreateOptionsMenu(@NonNull Menu menu) {
if (canGoBack) {
if (canGoBack && fragmentAdminAccount != null) {
getMenuInflater().inflate(R.menu.menu_admin_account, menu);
}
return super.onCreateOptionsMenu(menu);
@ -272,6 +316,14 @@ public class AdminActionActivity extends BaseActivity {
return super.onOptionsItemSelected(item);
}
@Override
protected void onDestroy() {
super.onDestroy();
if (mReceiver != null) {
LocalBroadcastManager.getInstance(this).unregisterReceiver(mReceiver);
}
}
@Override
public void onBackPressed() {
if (canGoBack) {
@ -279,9 +331,15 @@ public class AdminActionActivity extends BaseActivity {
ThemeHelper.slideViewsToRight(binding.fragmentContainer, binding.buttonContainer, () -> {
if (fragmentAdminReport != null) {
fragmentAdminReport.onDestroyView();
fragmentAdminReport = null;
}
if (fragmentAdminAccount != null) {
fragmentAdminAccount.onDestroyView();
fragmentAdminAccount = null;
}
if (fragmentAdminDomain != null) {
fragmentAdminDomain.onDestroyView();
fragmentAdminDomain = null;
}
setTitle(R.string.administration);
invalidateOptionsMenu();
@ -296,8 +354,9 @@ public class AdminActionActivity extends BaseActivity {
@SerializedName("REPORT")
REPORT("REPORT"),
@SerializedName("ACCOUNT")
ACCOUNT("ACCOUNT");
ACCOUNT("ACCOUNT"),
@SerializedName("DOMAIN")
DOMAIN("DOMAIN");
private final String value;
AdminEnum(String value) {

View file

@ -0,0 +1,159 @@
package app.fedilab.android.activities.admin;
/* Copyright 2022 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 static app.fedilab.android.helper.Helper.BROADCAST_DATA;
import android.content.Intent;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AlertDialog;
import androidx.core.content.ContextCompat;
import androidx.lifecycle.ViewModelProvider;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import app.fedilab.android.R;
import app.fedilab.android.activities.BaseActivity;
import app.fedilab.android.activities.MainActivity;
import app.fedilab.android.client.entities.api.admin.AdminDomainBlock;
import app.fedilab.android.databinding.ActivityAdminDomainblockBinding;
import app.fedilab.android.helper.Helper;
import app.fedilab.android.helper.ThemeHelper;
import app.fedilab.android.viewmodel.mastodon.AdminVM;
import es.dmoral.toasty.Toasty;
public class AdminDomainBlockActivity extends BaseActivity {
private final String[] severityChoices = {"silence", "suspend", "noop"};
private AdminVM adminVM;
private AdminDomainBlock adminDomainBlock;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
ThemeHelper.applyThemeBar(this);
ActivityAdminDomainblockBinding binding = ActivityAdminDomainblockBinding.inflate(getLayoutInflater());
setContentView(binding.getRoot());
if (getSupportActionBar() != null) {
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(this, R.color.cyanea_primary)));
}
Bundle b = getIntent().getExtras();
if (b != null) {
adminDomainBlock = (AdminDomainBlock) b.getSerializable(Helper.ARG_ADMIN_DOMAINBLOCK);
}
ArrayAdapter<CharSequence> adapterResize = ArrayAdapter.createFromResource(this,
R.array.admin_block_severity, android.R.layout.simple_spinner_dropdown_item);
binding.severity.setAdapter(adapterResize);
if (adminDomainBlock != null) {
binding.domain.setText(adminDomainBlock.domain);
binding.domain.setEnabled(false);
for (int i = 0; i < severityChoices.length; i++) {
if (adminDomainBlock.severity.equalsIgnoreCase(severityChoices[i])) {
binding.severity.setSelection(i, false);
break;
}
}
binding.obfuscate.setChecked(adminDomainBlock.obfuscate);
binding.rejectMedia.setChecked(adminDomainBlock.reject_media);
binding.rejectReports.setChecked(adminDomainBlock.reject_reports);
binding.privateComment.setText(adminDomainBlock.private_comment);
binding.publicComment.setText(adminDomainBlock.public_comment);
} else {
adminDomainBlock = new AdminDomainBlock();
}
binding.severity.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> adapterView, View view, int position, long l) {
adminDomainBlock.severity = severityChoices[position];
}
@Override
public void onNothingSelected(AdapterView<?> adapterView) {
}
});
binding.obfuscate.setOnCheckedChangeListener((compoundButton, checked) -> adminDomainBlock.obfuscate = checked);
binding.rejectMedia.setOnCheckedChangeListener((compoundButton, checked) -> adminDomainBlock.reject_media = checked);
binding.rejectReports.setOnCheckedChangeListener((compoundButton, checked) -> adminDomainBlock.reject_reports = checked);
adminVM = new ViewModelProvider(AdminDomainBlockActivity.this).get(AdminVM.class);
binding.saveChanges.setOnClickListener(v -> {
adminDomainBlock.domain = binding.domain.getText().toString().trim();
adminDomainBlock.public_comment = binding.publicComment.getText().toString().trim();
adminDomainBlock.private_comment = binding.privateComment.getText().toString().trim();
adminVM.createOrUpdateDomainBlock(MainActivity.currentInstance, MainActivity.currentToken, adminDomainBlock)
.observe(AdminDomainBlockActivity.this, adminDomainBlockResult -> {
if (adminDomainBlockResult != null) {
Toasty.success(AdminDomainBlockActivity.this, getString(R.string.saved_changes), Toasty.LENGTH_SHORT).show();
} else {
Toasty.error(AdminDomainBlockActivity.this, getString(R.string.toast_error), Toasty.LENGTH_SHORT).show();
}
Intent intent = new Intent(BROADCAST_DATA).putExtra(Helper.ARG_ADMIN_DOMAINBLOCK, adminDomainBlockResult);
LocalBroadcastManager.getInstance(AdminDomainBlockActivity.this).sendBroadcast(intent);
finish();
}
);
});
}
@Override
public boolean onCreateOptionsMenu(@NonNull Menu menu) {
getMenuInflater().inflate(R.menu.menu_admin_domain, menu);
return super.onCreateOptionsMenu(menu);
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
int itemId = item.getItemId();
if (itemId == android.R.id.home) {
finish();
return true;
} else if (itemId == R.id.action_delete) {
if (adminDomainBlock.id != null) {
AlertDialog.Builder builder = new AlertDialog.Builder(AdminDomainBlockActivity.this, Helper.dialogStyle());
builder.setMessage(getString(R.string.unblock_domain_confirm, adminDomainBlock.domain));
builder
.setPositiveButton(R.string.unblock_domain, (dialog, which) -> {
adminVM.deleteDomain(MainActivity.currentInstance, MainActivity.currentToken, adminDomainBlock.id)
.observe(AdminDomainBlockActivity.this, adminDomainBlockResult -> {
Intent intent = new Intent(BROADCAST_DATA).putExtra(Helper.ARG_ADMIN_DOMAINBLOCK_DELETE, adminDomainBlock);
LocalBroadcastManager.getInstance(AdminDomainBlockActivity.this).sendBroadcast(intent);
finish();
}
);
dialog.dismiss();
})
.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss())
.show();
} else {
finish();
}
}
return true;
}
}

View file

@ -1,4 +1,4 @@
package app.fedilab.android.activities;
package app.fedilab.android.activities.admin;
/* Copyright 2022 Thomas Schneider
*
* This file is a part of Fedilab
@ -55,9 +55,13 @@ import java.util.concurrent.TimeUnit;
import app.fedilab.android.BaseMainActivity;
import app.fedilab.android.R;
import app.fedilab.android.activities.BaseActivity;
import app.fedilab.android.activities.InstanceProfileActivity;
import app.fedilab.android.activities.MediaActivity;
import app.fedilab.android.client.entities.api.Account;
import app.fedilab.android.client.entities.api.AdminAccount;
import app.fedilab.android.client.entities.api.Attachment;
import app.fedilab.android.client.entities.api.admin.AdminAccount;
import app.fedilab.android.client.entities.api.admin.AdminIp;
import app.fedilab.android.databinding.ActivityAdminAccountBinding;
import app.fedilab.android.helper.Helper;
import app.fedilab.android.helper.MastodonHelper;
@ -141,7 +145,7 @@ public class AdminReportActivity extends BaseActivity {
binding.email.setText(adminAccount.email);
StringBuilder lastActive = new StringBuilder();
if (adminAccount.ips != null) {
for (AdminAccount.IP ip : adminAccount.ips) {
for (AdminIp ip : adminAccount.ips) {
lastActive.append(Helper.shortDateToString(ip.used_at)).append(" - ").append(ip.ip).append("\r\n");
}
}

View file

@ -25,6 +25,7 @@ import app.fedilab.android.client.entities.api.Preferences;
import app.fedilab.android.client.entities.api.RelationShip;
import app.fedilab.android.client.entities.api.Report;
import app.fedilab.android.client.entities.api.Status;
import app.fedilab.android.client.entities.api.Suggestion;
import app.fedilab.android.client.entities.api.Tag;
import app.fedilab.android.client.entities.api.Token;
import okhttp3.MultipartBody;
@ -315,7 +316,7 @@ public interface MastodonAccountsService {
@DELETE("domain_blocks")
Call<Void> removeDomainBlocks(
@Header("Authorization") String token,
@Field("domain") String domain
@Query("domain") String domain
);
@ -391,7 +392,7 @@ public interface MastodonAccountsService {
//Get user suggestions
@GET("suggestions")
Call<List<Account>> getSuggestions(
Call<List<Suggestion>> getSuggestions(
@Header("Authorization") String token,
@Query("limit") String limit
);

View file

@ -17,14 +17,17 @@ package app.fedilab.android.client.endpoints;
import java.util.List;
import app.fedilab.android.client.entities.api.AdminAccount;
import app.fedilab.android.client.entities.api.AdminReport;
import app.fedilab.android.client.entities.api.admin.AdminAccount;
import app.fedilab.android.client.entities.api.admin.AdminDomainBlock;
import app.fedilab.android.client.entities.api.admin.AdminReport;
import retrofit2.Call;
import retrofit2.http.DELETE;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.Header;
import retrofit2.http.POST;
import retrofit2.http.PUT;
import retrofit2.http.Path;
import retrofit2.http.Query;
@ -115,6 +118,7 @@ public interface MastodonAdminService {
@Query("limit") int limit
);
//***************** ADMIN REPORTS **************
@GET("admin/reports/{id}")
Call<AdminReport> getReport(
@ -149,4 +153,80 @@ public interface MastodonAdminService {
@Header("Authorization") String app_token,
@Path("id") String id
);
//*************** ADMIN DOMAINS ****************
@GET("admin/domain_blocks")
Call<List<AdminDomainBlock>> getDomainBlocks(
@Header("Authorization") String token,
@Query("max_id") String max_id,
@Query("limit") int limit
);
@GET("admin/domain_allows")
Call<List<AdminDomainBlock>> getDomainAllows(
@Header("Authorization") String token,
@Query("max_id") String max_id,
@Query("limit") int limit
);
@GET("admin/domain_blocks/{id}")
Call<AdminDomainBlock> getDomainBlock(
@Header("Authorization") String token,
@Path("id") String id
);
@GET("admin/domain_allows/{id}")
Call<AdminDomainBlock> getDomainAllow(
@Header("Authorization") String token,
@Path("id") String id
);
@FormUrlEncoded
@POST("admin/domain_blocks")
Call<AdminDomainBlock> blockDomain(
@Header("Authorization") String app_token,
@Field("domain") String domain,
@Field("severity") String severity,
@Field("reject_media") Boolean reject_media,
@Field("reject_reports") Boolean reject_reports,
@Field("private_comment") String private_comment,
@Field("public_comment") String public_comment,
@Field("obfuscate") Boolean obfuscate
);
@FormUrlEncoded
@POST("admin/domain_allows")
Call<AdminDomainBlock> allowDomain(
@Header("Authorization") String app_token,
@Path("domain") String domain
);
@FormUrlEncoded
@PUT("admin/domain_blocks/{id}")
Call<AdminDomainBlock> updateBlockDomain(
@Header("Authorization") String app_token,
@Path("id") String id,
@Field("severity") String severity,
@Field("reject_media") Boolean reject_media,
@Field("reject_reports") Boolean reject_reports,
@Field("private_comment") String private_comment,
@Field("public_comment") String public_comment,
@Field("obfuscate") Boolean obfuscate
);
@DELETE("admin/domain_blocks/{id}")
Call<Void> deleteBlockDomain(
@Header("Authorization") String app_token,
@Path("id") String id
);
@DELETE("admin/domain_allows/{id}")
Call<Void> deleteAllowDomain(
@Header("Authorization") String app_token,
@Path("id") String id
);
}

View file

@ -0,0 +1,22 @@
package app.fedilab.android.client.entities.api;
/* Copyright 2022 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 java.util.List;
public class Domains {
public Pagination pagination = new Pagination();
public List<String> domains;
}

View file

@ -127,11 +127,7 @@ public class Status implements Serializable, Cloneable {
public synchronized Spannable getSpanContent(Context context, WeakReference<View> viewWeakReference) {
return SpannableHelper.convert(context, content, this, null, null, true, viewWeakReference);
}
//Some extra spannable element - They will be filled automatically when fetching the status
public Spannable getSpanContentNitter() {
return SpannableHelper.convertNitter(content);
}
public synchronized Spannable getSpanSpoiler(Context context, WeakReference<View> viewWeakReference) {
return SpannableHelper.convert(context, spoiler_text, this, null, null, true, viewWeakReference);

View file

@ -0,0 +1,27 @@
package app.fedilab.android.client.entities.api;
import com.google.gson.annotations.SerializedName;
import java.io.Serializable;
/* Copyright 2022 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>. */
public class Suggestion implements Serializable {
@SerializedName("account")
public Account account;
@SerializedName("source")
public String source;
}

View file

@ -0,0 +1,22 @@
package app.fedilab.android.client.entities.api;
/* Copyright 2022 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 java.util.List;
public class Suggestions {
public Pagination pagination = new Pagination();
public List<Suggestion> suggestions;
}

View file

@ -1,4 +1,4 @@
package app.fedilab.android.client.entities.api;
package app.fedilab.android.client.entities.api.admin;
/* Copyright 2021 Thomas Schneider
*
* This file is a part of Fedilab
@ -18,8 +18,11 @@ import com.google.gson.annotations.SerializedName;
import java.io.Serializable;
import java.util.Date;
import java.util.LinkedHashMap;
import java.util.List;
import app.fedilab.android.client.entities.api.Account;
public class AdminAccount implements Serializable {
@SerializedName("id")
@ -32,26 +35,48 @@ public class AdminAccount implements Serializable {
public Date created_at;
@SerializedName("email")
public String email;
public static LinkedHashMap<Integer, String> permissions;
static {
permissions = new LinkedHashMap<>();
permissions.put(1, "Administrator");
permissions.put(2, "Devops");
permissions.put(4, "View Audit Log");
permissions.put(8, "View Dashboard");
permissions.put(10, "Manage Reports");
permissions.put(20, "Manage Federation");
permissions.put(40, "Manage Settings");
permissions.put(80, "Manage Blocks");
permissions.put(100, "Manage Taxonomies");
permissions.put(200, "Manage Appeals");
permissions.put(400, "Manage Users");
permissions.put(800, "Manage Invites");
permissions.put(1000, "Manage Rules");
permissions.put(2000, "Manage Announcements");
permissions.put(4000, "Manage Custom Emojis");
permissions.put(8000, "Manage Webhooks");
permissions.put(10000, "Invite Users");
permissions.put(20000, "Manage Roles");
permissions.put(40000, "Manage User Access");
permissions.put(80000, "Delete User Data");
}
@SerializedName("ip")
public IP ip;
@SerializedName("ips")
public List<IP> ips;
@SerializedName("locale")
public String locale;
@SerializedName("invite_request")
public String invite_request;
public String ip;
@SerializedName("role")
public String role;
public Role role;
@SerializedName("confirmed")
public boolean confirmed;
@SerializedName("approved")
public boolean approved;
@SerializedName("disabled")
public boolean disabled;
@SerializedName("silenced")
public boolean silenced;
@SerializedName("suspended")
public boolean suspended;
@SerializedName("silenced")
public boolean silenced;
@SerializedName("disabled")
public boolean disabled;
@SerializedName("approved")
public boolean approved;
@SerializedName("ips")
public List<AdminIp> ips;
@SerializedName("account")
public Account account;
@SerializedName("created_by_application_id")
@ -60,12 +85,28 @@ public class AdminAccount implements Serializable {
public String invited_by_account_id;
public static class IP implements Serializable {
@SerializedName("locale")
public String locale;
@SerializedName("invite_request")
public String invite_request;
public static class Role implements Serializable {
@SerializedName("ip")
public String ip;
@SerializedName("used_at")
public Date used_at;
@SerializedName("user_id")
public String user_id;
@SerializedName("name")
public String name;
@SerializedName("color")
public String color;
@SerializedName("position")
public long position;
@SerializedName("permissions")
public int permissions;
@SerializedName("highlighted")
public boolean highlighted;
@SerializedName("created_at")
public Date created_at;
@SerializedName("updated_at")
public Date updated_at;
}
}

View file

@ -1,4 +1,4 @@
package app.fedilab.android.client.entities.api;
package app.fedilab.android.client.entities.api.admin;
/* Copyright 2021 Thomas Schneider
*
* This file is a part of Fedilab
@ -17,6 +17,8 @@ package app.fedilab.android.client.entities.api;
import java.util.List;
import app.fedilab.android.client.entities.api.Pagination;
public class AdminAccounts {
public Pagination pagination = new Pagination();

View file

@ -0,0 +1,43 @@
package app.fedilab.android.client.entities.api.admin;
/* Copyright 2022 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 com.google.gson.annotations.SerializedName;
import java.io.Serializable;
import java.util.Date;
public class AdminDomainBlock implements Serializable {
@SerializedName("id")
public String id;
@SerializedName("domain")
public String domain;
@SerializedName("created_at")
public Date created_at;
@SerializedName("severity")
public String severity;
@SerializedName("reject_media")
public boolean reject_media;
@SerializedName("reject_reports")
public boolean reject_reports;
@SerializedName("private_comment")
public String private_comment;
@SerializedName("public_comment")
public String public_comment;
@SerializedName("obfuscate")
public boolean obfuscate;
}

View file

@ -0,0 +1,26 @@
package app.fedilab.android.client.entities.api.admin;
/* Copyright 2022 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 java.util.List;
import app.fedilab.android.client.entities.api.Pagination;
public class AdminDomainBlocks {
public Pagination pagination = new Pagination();
public List<AdminDomainBlock> adminDomainBlocks;
}

View file

@ -0,0 +1,36 @@
package app.fedilab.android.client.entities.api.admin;
/* Copyright 2022 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 com.google.gson.annotations.SerializedName;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import app.fedilab.android.client.entities.api.History;
public class AdminEmailDomainBlock implements Serializable {
@SerializedName("id")
public String id;
@SerializedName("domain")
public String domain;
@SerializedName("created_at")
public Date created_at;
@SerializedName("history")
public List<History> history;
}

View file

@ -0,0 +1,29 @@
package app.fedilab.android.client.entities.api.admin;
/* Copyright 2022 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 com.google.gson.annotations.SerializedName;
import java.io.Serializable;
import java.util.Date;
public class AdminIp implements Serializable {
@SerializedName("ip")
public String ip;
@SerializedName("used_at")
public Date used_at;
}

View file

@ -0,0 +1,37 @@
package app.fedilab.android.client.entities.api.admin;
/* Copyright 2022 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 com.google.gson.annotations.SerializedName;
import java.io.Serializable;
import java.util.Date;
public class AdminIpBlock implements Serializable {
@SerializedName("id")
public String id;
@SerializedName("ip")
public String ip;
@SerializedName("severity")
public String severity;
@SerializedName("comment")
public String comment;
@SerializedName("created_at")
public Date created_at;
@SerializedName("expires_at")
public Date expires_at;
}

View file

@ -0,0 +1,45 @@
package app.fedilab.android.client.entities.api.admin;
/* Copyright 2022 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 com.google.gson.annotations.SerializedName;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
public class AdminMeasure implements Serializable {
@SerializedName("key")
public String key;
@SerializedName("unit")
public String unit;
@SerializedName("total")
public int total;
@SerializedName("human_value")
public int human_value;
@SerializedName("previous_total")
public int previous_total;
@SerializedName("data")
public List<Data> data;
public static class Data implements Serializable {
@SerializedName("date")
public Date date;
@SerializedName("value")
public int value;
}
}

View file

@ -1,4 +1,4 @@
package app.fedilab.android.client.entities.api;
package app.fedilab.android.client.entities.api.admin;
/* Copyright 2021 Thomas Schneider
*
* This file is a part of Fedilab
@ -20,30 +20,37 @@ import java.io.Serializable;
import java.util.Date;
import java.util.List;
import app.fedilab.android.client.entities.api.Instance;
import app.fedilab.android.client.entities.api.Status;
public class AdminReport implements Serializable {
@SerializedName("id")
public String id;
@SerializedName("account")
public AdminAccount account;
@SerializedName("action_taken")
public Boolean action_taken;
@SerializedName("action_taken_by_account")
public AdminAccount action_taken_by_account;
@SerializedName("assigned_account")
public AdminAccount assigned_account;
@SerializedName("action_taken_at")
public Date action_taken_at;
@SerializedName("category")
public String category;
@SerializedName("comment")
public String comment;
@SerializedName("forwarded")
public boolean forwarded;
@SerializedName("created_at")
public Date created_at;
@SerializedName("updated_at")
public Date updated_at;
@SerializedName("account")
public AdminAccount account;
@SerializedName("target_account")
public AdminAccount target_account;
@SerializedName("assigned_account")
public AdminAccount assigned_account;
@SerializedName("action_taken_by_account")
public AdminAccount action_taken_by_account;
@SerializedName("statuses")
public List<Status> statuses;
@SerializedName("rules")
public List<Instance.Rule> rules;
@SerializedName("updated_at")
public Date updated_at;
}

View file

@ -1,4 +1,4 @@
package app.fedilab.android.client.entities.api;
package app.fedilab.android.client.entities.api.admin;
/* Copyright 2021 Thomas Schneider
*
* This file is a part of Fedilab
@ -17,6 +17,8 @@ package app.fedilab.android.client.entities.api;
import java.util.List;
import app.fedilab.android.client.entities.api.Pagination;
public class AdminReports {
public Pagination pagination = new Pagination();

View file

@ -24,18 +24,13 @@ import com.google.gson.annotations.SerializedName;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collections;
import java.util.Date;
import java.util.List;
import app.fedilab.android.activities.MainActivity;
import app.fedilab.android.client.entities.api.Conversation;
import app.fedilab.android.client.entities.api.Conversations;
import app.fedilab.android.client.entities.api.Notification;
import app.fedilab.android.client.entities.api.Notifications;
import app.fedilab.android.client.entities.api.Pagination;
import app.fedilab.android.client.entities.api.Status;
import app.fedilab.android.client.entities.api.Statuses;
import app.fedilab.android.exception.DBException;
import app.fedilab.android.helper.Helper;
import app.fedilab.android.helper.MastodonHelper;
@ -247,7 +242,6 @@ public class StatusCache {
}
Cursor mCount = db.rawQuery("select count(*) from " + Sqlite.TABLE_STATUS_CACHE
+ " where " + Sqlite.COL_TYPE + " != '" + Timeline.TimeLineEnum.HOME.getValue() + "'"
+ " AND " + Sqlite.COL_INSTANCE + " = '" + baseAccount.instance + "'"
+ " AND " + Sqlite.COL_USER_ID + "= '" + baseAccount.user_id + "'", null);
mCount.moveToFirst();
int count = mCount.getInt(0);
@ -266,36 +260,21 @@ public class StatusCache {
if (db == null) {
throw new DBException("db is null. Wrong initialization.");
}
Cursor mCount = db.rawQuery("select count(*) from " + Sqlite.TABLE_STATUS_CACHE
String query = "select count(*) from " + Sqlite.TABLE_STATUS_CACHE
+ " where " + Sqlite.COL_STATUS_ID + " = '" + statusCache.status_id + "'"
+ " AND " + Sqlite.COL_INSTANCE + " = '" + statusCache.instance + "'"
+ " AND " + Sqlite.COL_USER_ID + "= '" + statusCache.user_id + "'", null);
+ " AND " + Sqlite.COL_USER_ID + "= '" + statusCache.user_id + "'";
if (statusCache.type != null) {
query += " AND " + Sqlite.COL_TYPE + " = '" + statusCache.type.getValue() + "'";
}
Cursor mCount = db.rawQuery(query, null);
mCount.moveToFirst();
int count = mCount.getInt(0);
mCount.close();
return (count > 0);
}
/**
* Check if a status exists in db
*
* @param status Status {@link Status}
* @return boolean - StatusCache exists
* @throws DBException Exception
*/
public boolean statusExist(Status status) throws DBException {
if (db == null) {
throw new DBException("db is null. Wrong initialization.");
}
Cursor mCount = db.rawQuery("select count(*) from " + Sqlite.TABLE_STATUS_CACHE
+ " where " + Sqlite.COL_STATUS_ID + " = '" + status.id + "'"
+ " AND " + Sqlite.COL_INSTANCE + " = '" + MainActivity.currentInstance + "'"
+ " AND " + Sqlite.COL_USER_ID + "= '" + MainActivity.currentUserID + "'", null);
mCount.moveToFirst();
int count = mCount.getInt(0);
mCount.close();
return (count > 0);
}
/**
* Insert a status in db
@ -313,7 +292,9 @@ public class StatusCache {
values.put(Sqlite.COL_INSTANCE, statusCache.instance);
values.put(Sqlite.COL_SLUG, slug);
values.put(Sqlite.COL_STATUS_ID, statusCache.status_id);
values.put(Sqlite.COL_TYPE, statusCache.type.getValue());
if (statusCache.type != null) {
values.put(Sqlite.COL_TYPE, statusCache.type.getValue());
}
if (statusCache.status != null) {
values.put(Sqlite.COL_STATUS, mastodonStatusToStringStorage(statusCache.status));
}
@ -345,8 +326,6 @@ public class StatusCache {
throw new DBException("db is null. Wrong initialization.");
}
ContentValues values = new ContentValues();
values.put(Sqlite.COL_USER_ID, statusCache.user_id);
values.put(Sqlite.COL_STATUS_ID, statusCache.status_id);
if (statusCache.status != null) {
values.put(Sqlite.COL_STATUS, mastodonStatusToStringStorage(statusCache.status));
}
@ -360,8 +339,8 @@ public class StatusCache {
//Inserts token
try {
return db.update(Sqlite.TABLE_STATUS_CACHE,
values, Sqlite.COL_STATUS_ID + " = ? AND " + Sqlite.COL_INSTANCE + " =?",
new String[]{statusCache.status_id, statusCache.instance});
values, Sqlite.COL_STATUS_ID + " = ? AND " + Sqlite.COL_INSTANCE + " =? AND " + Sqlite.COL_TYPE + " =? AND " + Sqlite.COL_USER_ID + " =?",
new String[]{statusCache.status_id, statusCache.instance, statusCache.type != null ? statusCache.type.getValue() : "", statusCache.user_id});
} catch (Exception e) {
e.printStackTrace();
return -1;
@ -485,8 +464,8 @@ public class StatusCache {
}
try {
return db.delete(Sqlite.TABLE_STATUS_CACHE,
Sqlite.COL_TYPE + " != ? AND " + Sqlite.COL_USER_ID + " = ? AND " + Sqlite.COL_INSTANCE + " =?",
new String[]{Timeline.TimeLineEnum.HOME.getValue(), account.user_id, account.instance});
Sqlite.COL_TYPE + " != ? AND " + Sqlite.COL_USER_ID + " = ?",
new String[]{Timeline.TimeLineEnum.HOME.getValue(), account.user_id});
} catch (Exception e) {
e.printStackTrace();
return -1;
@ -543,10 +522,10 @@ public class StatusCache {
* @param user_id String - us
* @param max_id String - status having max id
* @param min_id String - status having min id
* @return Statuses
* @return List<Notification>
* @throws DBException - throws a db exception
*/
public Notifications getNotifications(List<String> exclude_type, String instance, String user_id, String max_id, String min_id, String since_id) throws DBException {
public List<Notification> getNotifications(List<String> exclude_type, String instance, String user_id, String max_id, String min_id, String since_id) throws DBException {
if (db == null) {
throw new DBException("db is null. Wrong initialization.");
}
@ -572,8 +551,8 @@ public class StatusCache {
selection += "AND " + Sqlite.COL_SLUG + " NOT IN (" + exclude + ") ";
}
try {
Cursor c = db.query(Sqlite.TABLE_STATUS_CACHE, null, selection, null, Sqlite.COL_STATUS_ID, null, Sqlite.COL_STATUS_ID + order, limit);
return createNotificationReply(cursorToListOfNotifications(c));
Cursor c = db.query(Sqlite.TABLE_STATUS_CACHE, null, selection, null, Sqlite.COL_STATUS_ID, null, Sqlite.COL_STATUS_ID + " + 0 " + order, limit);
return cursorToListOfNotifications(c);
} catch (Exception e) {
e.printStackTrace();
return null;
@ -588,10 +567,10 @@ public class StatusCache {
* @param user_id String - us
* @param max_id String - status having max id
* @param min_id String - status having min id
* @return Statuses
* @return List<Conversation>
* @throws DBException - throws a db exception
*/
public Conversations getConversations(String instance, String user_id, String max_id, String min_id, String since_id) throws DBException {
public List<Conversation> getConversations(String instance, String user_id, String max_id, String min_id, String since_id) throws DBException {
if (db == null) {
throw new DBException("db is null. Wrong initialization.");
}
@ -607,10 +586,9 @@ public class StatusCache {
selection += "AND " + Sqlite.COL_STATUS_ID + " > '" + since_id + "' ";
limit = null;
}
try {
Cursor c = db.query(Sqlite.TABLE_STATUS_CACHE, null, selection, null, Sqlite.COL_STATUS_ID, null, Sqlite.COL_STATUS_ID + order, limit);
return createConversationReply(cursorToListOfConversations(c));
Cursor c = db.query(Sqlite.TABLE_STATUS_CACHE, null, selection, null, Sqlite.COL_STATUS_ID, null, Sqlite.COL_STATUS_ID + " + 0 " + order, limit);
return cursorToListOfConversations(c);
} catch (Exception e) {
e.printStackTrace();
return null;
@ -625,10 +603,10 @@ public class StatusCache {
* @param user_id String - us
* @param max_id String - status having max id
* @param min_id String - status having min id
* @return Statuses
* @return List<Status>
* @throws DBException - throws a db exception
*/
public Statuses geStatuses(String slug, String instance, String user_id, String max_id, String min_id, String since_id) throws DBException {
public List<Status> geStatuses(String slug, String instance, String user_id, String max_id, String min_id, String since_id) throws DBException {
if (db == null) {
throw new DBException("db is null. Wrong initialization.");
}
@ -645,8 +623,8 @@ public class StatusCache {
limit = null;
}
try {
Cursor c = db.query(Sqlite.TABLE_STATUS_CACHE, null, selection, null, Sqlite.COL_STATUS_ID, null, Sqlite.COL_STATUS_ID + order, limit);
return createStatusReply(cursorToListOfStatuses(c));
Cursor c = db.query(Sqlite.TABLE_STATUS_CACHE, null, selection, null, Sqlite.COL_STATUS_ID, null, Sqlite.COL_STATUS_ID + " + 0 " + order, limit);
return cursorToListOfStatuses(c);
} catch (Exception e) {
e.printStackTrace();
return null;
@ -769,75 +747,6 @@ public class StatusCache {
return conversationList;
}
/**
* Create a reply from db in the same way than API call
*
* @param notificationList List<Notification>
* @return Notifications (with pagination)
*/
private Notifications createNotificationReply(List<Notification> notificationList) {
Notifications notifications = new Notifications();
notifications.notifications = notificationList;
Pagination pagination = new Pagination();
if (notificationList != null && notificationList.size() > 0) {
//Status list is inverted, it happens for min_id due to ASC ordering
if (Helper.compareTo(notificationList.get(0).id, notificationList.get(notificationList.size() - 1).id) < 0) {
Collections.reverse(notificationList);
notifications.notifications = notificationList;
}
pagination.max_id = notificationList.get(0).id;
pagination.min_id = notificationList.get(notificationList.size() - 1).id;
}
notifications.pagination = pagination;
return notifications;
}
/**
* Create a reply from db in the same way than API call
*
* @param conversationList List<Conversation>
* @return Conversations (with pagination)
*/
private Conversations createConversationReply(List<Conversation> conversationList) {
Conversations conversations = new Conversations();
conversations.conversations = conversationList;
Pagination pagination = new Pagination();
if (conversationList != null && conversationList.size() > 0) {
//Status list is inverted, it happens for min_id due to ASC ordering
if (Helper.compareTo(conversationList.get(0).id, conversationList.get(conversationList.size() - 1).id) < 0) {
Collections.reverse(conversationList);
conversations.conversations = conversationList;
}
pagination.max_id = conversationList.get(0).id;
pagination.min_id = conversationList.get(conversationList.size() - 1).id;
}
conversations.pagination = pagination;
return conversations;
}
/**
* Create a reply from db in the same way than API call
*
* @param statusList List<Status>
* @return Statuses (with pagination)
*/
private Statuses createStatusReply(List<Status> statusList) {
Statuses statuses = new Statuses();
statuses.statuses = statusList;
Pagination pagination = new Pagination();
if (statusList != null && statusList.size() > 0) {
//Status list is inverted, it happens for min_id due to ASC ordering
if (Helper.compareTo(statusList.get(0).id, statusList.get(statusList.size() - 1).id) < 0) {
Collections.reverse(statusList);
statuses.statuses = statusList;
}
pagination.max_id = statusList.get(0).id;
pagination.min_id = statusList.get(statusList.size() - 1).id;
}
statuses.pagination = pagination;
return statuses;
}
/**
* Read cursor and hydrate without closing it

View file

@ -378,6 +378,8 @@ public class Timeline {
TREND_TAG("TREND_TAG"),
@SerializedName("TREND_MESSAGE")
TREND_MESSAGE("TREND_MESSAGE"),
@SerializedName("ACCOUNT_SUGGESTION")
ACCOUNT_SUGGESTION("ACCOUNT_SUGGESTION"),
@SerializedName("PUBLIC_TREND_MESSAGE")
TREND_MESSAGE_PUBLIC("TREND_MESSAGE_PUBLIC"),
@SerializedName("STATUS_HISTORY")
@ -388,6 +390,8 @@ public class Timeline {
MUTED_TIMELINE("MUTED_TIMELINE"),
@SerializedName("BOOKMARK_TIMELINE")
BOOKMARK_TIMELINE("BOOKMARK_TIMELINE"),
@SerializedName("BLOCKED_DOMAIN_TIMELINE")
BLOCKED_DOMAIN_TIMELINE("BLOCKED_DOMAIN_TIMELINE"),
@SerializedName("BLOCKED_TIMELINE")
BLOCKED_TIMELINE("BLOCKED_TIMELINE"),
@SerializedName("FAVOURITE_TIMELINE")

View file

@ -52,12 +52,11 @@ public class CustomEmoji extends ReplacementSpan {
if (imageDrawable != null) {
canvas.save();
int emojiSize = (int) (paint.getTextSize() * scale);
Drawable drawable = imageDrawable;
drawable.setBounds(0, 0, emojiSize, emojiSize);
int transY = bottom - drawable.getBounds().bottom;
imageDrawable.setBounds(0, 0, emojiSize, emojiSize);
int transY = bottom - imageDrawable.getBounds().bottom;
transY -= paint.getFontMetrics().descent / 2;
canvas.translate(x, (float) transY);
drawable.draw(canvas);
imageDrawable.draw(canvas);
canvas.restore();
}
}

View file

@ -238,6 +238,9 @@ public class Helper {
public static final String ARG_STATUS_REPLY_ID = "ARG_STATUS_REPLY_ID";
public static final String ARG_ACCOUNT = "ARG_ACCOUNT";
public static final String ARG_ACCOUNT_ID = "ARG_ACCOUNT_ID";
public static final String ARG_ADMIN_DOMAINBLOCK = "ARG_ADMIN_DOMAINBLOCK";
public static final String ARG_ADMIN_DOMAINBLOCK_DELETE = "ARG_ADMIN_DOMAINBLOCK_DELETE";
public static final String ARG_REPORT = "ARG_REPORT";
public static final String ARG_ACCOUNT_MENTION = "ARG_ACCOUNT_MENTION";
public static final String ARG_MINIFIED = "ARG_MINIFIED";
@ -302,12 +305,14 @@ public class Helper {
public static final String PREF_IS_MODERATOR = "PREF_IS_MODERATOR";
public static final String PREF_IS_ADMINISTRATOR = "PREF_IS_ADMINISTRATOR";
public static final String PREF_KEY_ID = "PREF_KEY_ID";
public static final String PREF_MESSAGE_URL = "PREF_MESSAGE_URL";
public static final String PREF_INSTANCE = "PREF_INSTANCE";
public static final String SET_SECURITY_PROVIDER = "SET_SECURITY_PROVIDER";
public static final int NOTIFICATION_INTENT = 1;
public static final int OPEN_NOTIFICATION = 2;
public static final int OPEN_WITH_ANOTHER_ACCOUNT = 3;
public static final String INTENT_TARGETED_ACCOUNT = "INTENT_TARGETED_ACCOUNT";
public static final String INTENT_SEND_MODIFIED_IMAGE = "INTENT_SEND_MODIFIED_IMAGE";
public static final String INTENT_COMPOSE_ERROR_MESSAGE = "INTENT_COMPOSE_ERROR_MESSAGE";
@ -334,6 +339,8 @@ public class Helper {
public static final Pattern bibliogramPattern = Pattern.compile("(m\\.|www\\.)?instagram.com(/p/[\\w-/]+)");
public static final Pattern libredditPattern = Pattern.compile("(www\\.|m\\.)?(reddit\\.com|preview\\.redd\\.it|i\\.redd\\.it|redd\\.it)/(((?!([\"'<])).)*)");
public static final Pattern ouichesPattern = Pattern.compile("https?://ouich\\.es/tag/(\\w+)");
public static final Pattern geminiPattern = Pattern.compile("(gemini://.*)\\b");
public static final Pattern xmppPattern = Pattern.compile("xmpp:[-a-zA-Z0-9+$&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]");
public static final Pattern peertubePattern = Pattern.compile("(https?://([\\da-z.-]+\\.[a-z.]{2,10}))/videos/watch/(\\w{8}-\\w{4}-\\w{4}-\\w{4}-\\w{12})$");
public static final Pattern mediumPattern = Pattern.compile("([\\w@-]*)?\\.?medium.com/@?([/\\w-]+)");
@ -745,39 +752,56 @@ public class Helper {
*/
public static String transformURL(Context context, String url) {
SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(context);
Matcher matcher = Helper.nitterPattern.matcher(url);
Matcher matcher;
boolean nitter = Helper.getSharedValue(context, context.getString(R.string.SET_NITTER));
if (nitter) {
matcher = Helper.nitterPattern.matcher(url);
if (matcher.find()) {
final String nitter_directory = matcher.group(2);
String nitterHost = sharedpreferences.getString(context.getString(R.string.SET_NITTER_HOST), context.getString(R.string.DEFAULT_NITTER_HOST)).toLowerCase();
if (nitterHost.trim().isEmpty()) {
nitterHost = context.getString(R.string.DEFAULT_NITTER_HOST);
}
return "https://" + nitterHost + nitter_directory;
}
}
matcher = Helper.bibliogramPattern.matcher(url);
boolean bibliogram = Helper.getSharedValue(context, context.getString(R.string.SET_BIBLIOGRAM));
if (bibliogram) {
matcher = Helper.bibliogramPattern.matcher(url);
if (matcher.find()) {
final String bibliogram_directory = matcher.group(2);
String bibliogramHost = sharedpreferences.getString(context.getString(R.string.SET_BIBLIOGRAM_HOST), context.getString(R.string.DEFAULT_BIBLIOGRAM_HOST)).toLowerCase();
if (bibliogramHost.trim().isEmpty()) {
bibliogramHost = context.getString(R.string.DEFAULT_BIBLIOGRAM_HOST);
}
return "https://" + bibliogramHost + bibliogram_directory;
}
}
matcher = Helper.libredditPattern.matcher(url);
boolean libreddit = Helper.getSharedValue(context, context.getString(R.string.SET_LIBREDDIT));
if (libreddit) {
matcher = Helper.libredditPattern.matcher(url);
if (matcher.find()) {
final String libreddit_directory = matcher.group(3);
String libreddit_host = sharedpreferences.getString(context.getString(R.string.SET_LIBREDDIT_HOST), context.getString(R.string.DEFAULT_LIBREDDIT_HOST)).toLowerCase();
if (libreddit_host.trim().isEmpty()) {
libreddit_host = context.getString(R.string.DEFAULT_LIBREDDIT_HOST);
}
return "https://" + libreddit_host + "/" + libreddit_directory;
}
}
matcher = Helper.youtubePattern.matcher(url);
boolean invidious = Helper.getSharedValue(context, context.getString(R.string.SET_INVIDIOUS));
if (invidious) {
matcher = Helper.youtubePattern.matcher(url);
if (matcher.find()) {
final String youtubeId = matcher.group(3);
String invidiousHost = sharedpreferences.getString(context.getString(R.string.SET_INVIDIOUS_HOST), context.getString(R.string.DEFAULT_INVIDIOUS_HOST)).toLowerCase();
if (invidiousHost.trim().isEmpty()) {
invidiousHost = context.getString(R.string.DEFAULT_INVIDIOUS_HOST);
}
if (matcher.group(2) != null && Objects.equals(matcher.group(2), "youtu.be")) {
return "https://" + invidiousHost + "/watch?v=" + youtubeId + "&local=true";
} else {
@ -785,9 +809,10 @@ public class Helper {
}
}
}
matcher = Helper.mediumPattern.matcher(url);
boolean medium = Helper.getSharedValue(context, context.getString(R.string.REPLACE_MEDIUM));
if (medium) {
matcher = Helper.mediumPattern.matcher(url);
if (matcher.find()) {
String path = matcher.group(2);
String user = matcher.group(1);
@ -795,12 +820,16 @@ public class Helper {
path = user + "/" + path;
}
String mediumReplaceHost = sharedpreferences.getString(context.getString(R.string.REPLACE_MEDIUM_HOST), context.getString(R.string.DEFAULT_REPLACE_MEDIUM_HOST)).toLowerCase();
if (mediumReplaceHost.trim().isEmpty()) {
mediumReplaceHost = context.getString(R.string.DEFAULT_REPLACE_MEDIUM_HOST);
}
return "https://" + mediumReplaceHost + "/" + path;
}
}
matcher = Helper.wikipediaPattern.matcher(url);
boolean wikipedia = Helper.getSharedValue(context, context.getString(R.string.REPLACE_WIKIPEDIA));
if (wikipedia) {
matcher = Helper.wikipediaPattern.matcher(url);
if (matcher.find()) {
String subdomain = matcher.group(1);
String path = matcher.group(2);
@ -810,6 +839,9 @@ public class Helper {
lang = (path.contains("?")) ? TextUtils.htmlEncode("&") : "?";
lang = lang + "lang=" + subdomain;
}
if (wikipediaReplaceHost.trim().isEmpty()) {
wikipediaReplaceHost = context.getString(R.string.DEFAULT_REPLACE_WIKIPEDIA_HOST);
}
return "https://" + wikipediaReplaceHost + "/" + path + lang;
}
}
@ -1105,8 +1137,8 @@ public class Helper {
* @param view ImageView - the view where the image will be loaded
* @param account - {@link Account}
*/
public static void loadPP(ImageView view, BaseAccount account) {
loadPP(view, account, false);
public static void loadPP(Activity activity, ImageView view, BaseAccount account) {
loadPP(activity, view, account, false);
}
/**
@ -1115,15 +1147,14 @@ public class Helper {
* @param view ImageView - the view where the image will be loaded
* @param account - {@link Account}
*/
public static void loadPP(ImageView view, BaseAccount account, boolean crop) {
Context context = view.getContext();
SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(context);
boolean disableGif = sharedpreferences.getBoolean(context.getString(R.string.SET_DISABLE_GIF), false);
public static void loadPP(Activity activity, ImageView view, BaseAccount account, boolean crop) {
SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(activity);
boolean disableGif = sharedpreferences.getBoolean(activity.getString(R.string.SET_DISABLE_GIF), false);
String targetedUrl = disableGif ? account.mastodon_account.avatar_static : account.mastodon_account.avatar;
if (targetedUrl != null && Helper.isValidContextForGlide(context)) {
if (targetedUrl != null && Helper.isValidContextForGlide(activity)) {
if (disableGif || (!targetedUrl.endsWith(".gif"))) {
try {
RequestBuilder<Drawable> requestBuilder = Glide.with(context)
RequestBuilder<Drawable> requestBuilder = Glide.with(activity)
.asDrawable()
.load(targetedUrl)
.thumbnail(0.1f);
@ -1134,7 +1165,7 @@ public class Helper {
} catch (Exception ignored) {
}
} else {
RequestBuilder<GifDrawable> requestBuilder = Glide.with(context)
RequestBuilder<GifDrawable> requestBuilder = Glide.with(activity)
.asGif()
.load(targetedUrl)
.thumbnail(0.1f);
@ -1143,8 +1174,8 @@ public class Helper {
}
requestBuilder.apply(new RequestOptions().transform(new CenterCrop(), new RoundedCorners(10))).into(view);
}
} else if (Helper.isValidContextForGlide(context)) {
Glide.with(context)
} else if (Helper.isValidContextForGlide(activity)) {
Glide.with(activity)
.asDrawable()
.load(R.drawable.ic_person)
.thumbnail(0.1f)
@ -1165,7 +1196,7 @@ public class Helper {
return null;
}
Proxy proxy = new Proxy(type == 0 ? Proxy.Type.HTTP : Proxy.Type.SOCKS,
new InetSocketAddress(hostVal, portVal));
InetSocketAddress.createUnresolved(hostVal, portVal));
Authenticator.setDefault(new Authenticator() {
@Override
protected PasswordAuthentication getPasswordAuthentication() {
@ -1502,6 +1533,18 @@ public class Helper {
channelId = "channel_status";
channelTitle = context.getString(R.string.channel_notif_status);
break;
case UPDATE:
channelId = "channel_update";
channelTitle = context.getString(R.string.channel_notif_update);
break;
case SIGN_UP:
channelId = "channel_signup";
channelTitle = context.getString(R.string.channel_notif_signup);
break;
case REPORT:
channelId = "channel_report";
channelTitle = context.getString(R.string.channel_notif_report);
break;
default:
channelId = "channel_boost";
channelTitle = context.getString(R.string.channel_notif_boost);
@ -1584,8 +1627,11 @@ public class Helper {
.setGroup(account.mastodon_account != null ? account.mastodon_account.username + "@" + account.instance : "" + "@" + account.instance)
.setGroupSummary(true)
.build();
notificationManager.notify(notificationId++, notificationBuilder.build());
notificationManager.notify(0, summaryNotification);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N_MR1) {
notificationManager.notify(0, summaryNotification);
}
}
public static void transfertIfExist(Context context) {
@ -1960,6 +2006,9 @@ public class Helper {
BOOST,
FAV,
POLL,
UPDATE,
SIGN_UP,
REPORT,
STATUS,
BACKUP,
STORE,

View file

@ -158,6 +158,9 @@ public class NotificationsHelper {
boolean notif_poll = prefs.getBoolean(context.getString(R.string.SET_NOTIF_POLL), true);
boolean notif_fav = prefs.getBoolean(context.getString(R.string.SET_NOTIF_FAVOURITE), true);
boolean notif_status = prefs.getBoolean(context.getString(R.string.SET_NOTIF_STATUS), true);
boolean notif_update = prefs.getBoolean(context.getString(R.string.SET_NOTIF_UPDATE), true);
boolean notif_signup = prefs.getBoolean(context.getString(R.string.SET_NOTIF_ADMIN_SIGNUP), true);
boolean notif_report = prefs.getBoolean(context.getString(R.string.SET_NOTIF_ADMIN_REPORT), true);
final String max_id = prefs.getString(context.getString(R.string.LAST_NOTIFICATION_ID) + key, null);
@ -232,18 +235,18 @@ public class NotificationsHelper {
title = String.format("%s %s", notification.account.display_name, context.getString(R.string.notif_reblog));
else
title = String.format("@%s %s", notification.account.acct, context.getString(R.string.notif_reblog));
}
if (notification.status != null) {
if (notification.status.spoiler_text != null && notification.status.spoiler_text.length() > 0) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
message = new SpannableString(Html.fromHtml(notification.status.spoiler_text, FROM_HTML_MODE_LEGACY)).toString();
else
message = new SpannableString(Html.fromHtml(notification.status.spoiler_text)).toString();
} else {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
message = new SpannableString(Html.fromHtml(notification.status.content, FROM_HTML_MODE_LEGACY)).toString();
else
message = new SpannableString(Html.fromHtml(notification.status.content)).toString();
if (notification.status != null) {
if (notification.status.spoiler_text != null && notification.status.spoiler_text.length() > 0) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
message = new SpannableString(Html.fromHtml(notification.status.spoiler_text, FROM_HTML_MODE_LEGACY)).toString();
else
message = new SpannableString(Html.fromHtml(notification.status.spoiler_text)).toString();
} else {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
message = new SpannableString(Html.fromHtml(notification.status.content, FROM_HTML_MODE_LEGACY)).toString();
else
message = new SpannableString(Html.fromHtml(notification.status.content)).toString();
}
}
}
break;
@ -254,18 +257,18 @@ public class NotificationsHelper {
title = String.format("%s %s", notification.account.display_name, context.getString(R.string.notif_favourite));
else
title = String.format("@%s %s", notification.account.acct, context.getString(R.string.notif_favourite));
}
if (notification.status != null) {
if (notification.status.spoiler_text != null && notification.status.spoiler_text.length() > 0) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
message = new SpannableString(Html.fromHtml(notification.status.spoiler_text, FROM_HTML_MODE_LEGACY)).toString();
else
message = new SpannableString(Html.fromHtml(notification.status.spoiler_text)).toString();
} else {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
message = new SpannableString(Html.fromHtml(notification.status.content, FROM_HTML_MODE_LEGACY)).toString();
else
message = new SpannableString(Html.fromHtml(notification.status.content)).toString();
if (notification.status != null) {
if (notification.status.spoiler_text != null && notification.status.spoiler_text.length() > 0) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
message = new SpannableString(Html.fromHtml(notification.status.spoiler_text, FROM_HTML_MODE_LEGACY)).toString();
else
message = new SpannableString(Html.fromHtml(notification.status.spoiler_text)).toString();
} else {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
message = new SpannableString(Html.fromHtml(notification.status.content, FROM_HTML_MODE_LEGACY)).toString();
else
message = new SpannableString(Html.fromHtml(notification.status.content)).toString();
}
}
}
break;
@ -298,21 +301,62 @@ public class NotificationsHelper {
title = context.getString(R.string.notif_poll_self);
else
title = context.getString(R.string.notif_poll);
}
if (notification.status != null) {
if (notification.status.spoiler_text != null && notification.status.spoiler_text.length() > 0) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
message = new SpannableString(Html.fromHtml(notification.status.spoiler_text, FROM_HTML_MODE_LEGACY)).toString();
else
message = new SpannableString(Html.fromHtml(notification.status.spoiler_text)).toString();
} else {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
message = new SpannableString(Html.fromHtml(notification.status.content, FROM_HTML_MODE_LEGACY)).toString();
else
message = new SpannableString(Html.fromHtml(notification.status.content)).toString();
if (notification.status != null) {
if (notification.status.spoiler_text != null && notification.status.spoiler_text.length() > 0) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
message = new SpannableString(Html.fromHtml(notification.status.spoiler_text, FROM_HTML_MODE_LEGACY)).toString();
else
message = new SpannableString(Html.fromHtml(notification.status.spoiler_text)).toString();
} else {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
message = new SpannableString(Html.fromHtml(notification.status.content, FROM_HTML_MODE_LEGACY)).toString();
else
message = new SpannableString(Html.fromHtml(notification.status.content)).toString();
}
}
}
break;
case "update":
notifType = Helper.NotifType.UPDATE;
if (notif_update) {
title = context.getString(R.string.notif_update_push);
if (notification.status != null) {
if (notification.status.spoiler_text != null && notification.status.spoiler_text.length() > 0) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
message = new SpannableString(Html.fromHtml(notification.status.spoiler_text, FROM_HTML_MODE_LEGACY)).toString();
else
message = new SpannableString(Html.fromHtml(notification.status.spoiler_text)).toString();
} else {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
message = new SpannableString(Html.fromHtml(notification.status.content, FROM_HTML_MODE_LEGACY)).toString();
else
message = new SpannableString(Html.fromHtml(notification.status.content)).toString();
}
}
}
break;
case "admin.sign_up":
notifType = Helper.NotifType.SIGN_UP;
if (notif_signup) {
title = context.getString(R.string.notif_sign_up);
if (notification.account.display_name != null && notification.account.display_name.length() > 0)
message = String.format("%s %s", notification.account.display_name, context.getString(R.string.notif_signed_up));
else
message = String.format("@%s %s", notification.account.acct, context.getString(R.string.notif_signed_up));
targeted_account = notification.account.id;
}
break;
case "admin.report":
notifType = Helper.NotifType.REPORT;
if (notif_report) {
title = context.getString(R.string.notif_report);
if (notification.account.display_name != null && notification.account.display_name.length() > 0)
message = String.format("%s %s", notification.account.display_name, context.getString(R.string.notif_reported));
else
message = String.format("@%s %s", notification.account.acct, context.getString(R.string.notif_reported));
targeted_account = notification.account.id;
}
break;
default:
}
if (message != null) {
@ -321,7 +365,7 @@ public class NotificationsHelper {
intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);
intent.putExtra(Helper.INTENT_ACTION, Helper.NOTIFICATION_INTENT);
intent.putExtra(Helper.PREF_KEY_ID, account.user_id);
if (targeted_account != null && notifType == Helper.NotifType.FOLLLOW)
if (targeted_account != null)
intent.putExtra(Helper.INTENT_TARGETED_ACCOUNT, targeted_account);
intent.putExtra(Helper.PREF_INSTANCE, account.instance);
notificationUrl = notification.account.avatar;

View file

@ -147,6 +147,7 @@ public class SpannableHelper {
linkify(context, content, urlDetails);
linkifyURL(context, content, urlDetails);
emails(context, content);
gemini(context, content);
replaceQuoteSpans(context, content);
} else {
content = new SpannableStringBuilder(text);
@ -249,11 +250,17 @@ public class SpannableHelper {
dialogBuilder.setView(popupLinksBinding.getRoot());
AlertDialog alertDialog = dialogBuilder.create();
alertDialog.show();
String finalURl = url;
String uniqueUrl = url.endsWith("") ? url : url + "";
String finalURl = newURL;
String uniqueUrl = newURL.endsWith("") ? newURL : newURL + "";
if (urlDetails.containsValue(uniqueUrl)) {
finalURl = Helper.getKeyByValue(urlDetails, uniqueUrl);
}
if (finalURl == null) {
return;
}
if (finalURl.startsWith("http://")) {
finalURl = finalURl.replace("http://", "https://");
}
String finalURl1 = finalURl;
popupLinksBinding.displayFullLink.setOnClickListener(v -> {
AlertDialog.Builder builder = new AlertDialog.Builder(mContext, Helper.dialogStyle());
@ -668,6 +675,38 @@ public class SpannableHelper {
}
}
private static void gemini(Context context, Spannable content) {
// --- For all patterns defined in Helper class ---
Pattern pattern = Helper.geminiPattern;
Matcher matcher = pattern.matcher(content);
while (matcher.find()) {
int matchStart = matcher.start();
int matchEnd = matcher.end();
String geminiLink = content.toString().substring(matchStart, matchEnd);
if (matchStart >= 0 && matchEnd <= content.toString().length() && matchEnd >= matchStart) {
ClickableSpan[] clickableSpans = content.getSpans(matchStart, matchEnd, ClickableSpan.class);
if (clickableSpans != null) {
for (ClickableSpan clickableSpan : clickableSpans) {
content.removeSpan(clickableSpan);
}
}
content.removeSpan(clickableSpans);
content.setSpan(new ClickableSpan() {
@Override
public void onClick(@NonNull View textView) {
Helper.openBrowser(context, geminiLink);
}
@Override
public void updateDrawState(@NonNull TextPaint ds) {
super.updateDrawState(ds);
ds.setUnderlineText(false);
ds.setColor(linkColor);
}
}, matchStart, matchEnd, Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
}
}
}
private static void emails(Context context, Spannable content) {
// --- For all patterns defined in Helper class ---
@ -872,24 +911,6 @@ public class SpannableHelper {
}
}
/**
* Convert HTML content to text. Also, it handles click on link
* This needs to be run asynchronously
*
* @param text String - text to convert, it can be content, spoiler, poll items, etc.
* @return Spannable string
*/
public static Spannable convertNitter(String text) {
SpannableString initialContent;
if (text == null) {
return null;
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
initialContent = new SpannableString(Html.fromHtml(text, Html.FROM_HTML_MODE_LEGACY));
else
initialContent = new SpannableString(Html.fromHtml(text));
return initialContent;
}
/**

View file

@ -177,7 +177,6 @@ public class TimelineHelper {
public static List<Notification> filterNotification(Context context, List<Notification> notifications) {
//A security to make sure filters have been fetched before displaying messages
List<Notification> notificationToRemove = new ArrayList<>();
if (!BaseMainActivity.filterFetched) {
try {
FiltersVM filtersVM = new ViewModelProvider((ViewModelStoreOwner) context).get(FiltersVM.class);

View file

@ -64,7 +64,7 @@ public class SimpleItemTouchHelperCallback extends ItemTouchHelper.Callback {
return makeMovementFlags(dragFlags, swipeFlags);
} else {
final int dragFlags = ItemTouchHelper.UP | ItemTouchHelper.DOWN;
final int swipeFlags = ItemTouchHelper.START | ItemTouchHelper.END;
final int swipeFlags = 0;
return makeMovementFlags(dragFlags, swipeFlags);
}
}

View file

@ -143,6 +143,7 @@ public class ComposeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder
private AlertDialog alertDialogEmoji;
private List<Emoji> emojisList = new ArrayList<>();
public promptDraftListener promptDraftListener;
private boolean unlisted_changed = false;
public ComposeAdapter(List<Status> statusList, int statusCount, BaseAccount account, app.fedilab.android.client.entities.api.Account mentionedAccount, String visibility, String editMessageId) {
this.statusList = statusList;
@ -619,7 +620,7 @@ public class ComposeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder
matcherEmoji = emojiPattern.matcher(searchIn);
if (matcherMention.matches()) {
String searchGroup = matcherMention.group();
accountsVM.searchAccounts(BaseMainActivity.currentInstance, BaseMainActivity.currentToken, searchGroup, 10, true, false).observe((LifecycleOwner) context, accounts -> {
accountsVM.searchAccounts(BaseMainActivity.currentInstance, BaseMainActivity.currentToken, searchGroup, 5, false, false).observe((LifecycleOwner) context, accounts -> {
if (accounts == null) {
return;
}
@ -1244,10 +1245,10 @@ public class ComposeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder
} else {
statusDraft.visibility = "public";
}
if (position == 0 && unlistedReplies && statusDraft.visibility.equalsIgnoreCase("public") && statusList.size() > 1) {
if (!unlisted_changed && position == 0 && unlistedReplies && statusDraft.visibility.equalsIgnoreCase("public") && statusList.size() > 1) {
statusDraft.visibility = "unlisted";
}
} else if (position == statusCount && unlistedReplies && statusDraft.visibility.equalsIgnoreCase("public") && statusList.size() > 1) {
} else if (!unlisted_changed && position == statusCount && unlistedReplies && statusDraft.visibility.equalsIgnoreCase("public") && statusList.size() > 1) {
statusDraft.visibility = "unlisted";
}
@ -1277,6 +1278,7 @@ public class ComposeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder
holder.binding.visibilityPanel.setVisibility(View.GONE);
holder.binding.buttonVisibility.setImageResource(R.drawable.ic_compose_visibility_direct);
statusDraft.visibility = MastodonHelper.visibility.DIRECT.name();
});
holder.binding.buttonVisibilityPrivate.setOnClickListener(v -> {
holder.binding.visibilityPanel.setVisibility(View.GONE);
@ -1292,6 +1294,7 @@ public class ComposeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder
holder.binding.visibilityPanel.setVisibility(View.GONE);
holder.binding.buttonVisibility.setImageResource(R.drawable.ic_compose_visibility_public);
statusDraft.visibility = MastodonHelper.visibility.PUBLIC.name();
unlisted_changed = true;
});
if (statusDraft.spoilerChecked) {
holder.binding.contentSpoiler.setVisibility(View.VISIBLE);

View file

@ -0,0 +1,95 @@
package app.fedilab.android.ui.drawer;
/* Copyright 2022 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.view.LayoutInflater;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AlertDialog;
import androidx.lifecycle.ViewModelProvider;
import androidx.lifecycle.ViewModelStoreOwner;
import androidx.recyclerview.widget.RecyclerView;
import java.util.List;
import app.fedilab.android.R;
import app.fedilab.android.activities.MainActivity;
import app.fedilab.android.databinding.DrawerDomainBlockBinding;
import app.fedilab.android.helper.Helper;
import app.fedilab.android.viewmodel.mastodon.AccountsVM;
public class DomainBlockAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
private final List<String> domainList;
private Context context;
public DomainBlockAdapter(List<String> domainList) {
this.domainList = domainList;
}
public int getCount() {
return domainList.size();
}
public String getItem(int position) {
return domainList.get(position);
}
@NonNull
@Override
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
context = parent.getContext();
DrawerDomainBlockBinding itemBinding = DrawerDomainBlockBinding.inflate(LayoutInflater.from(parent.getContext()), parent, false);
return new DomainBlockViewHolder(itemBinding);
}
@Override
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder viewHolder, int position) {
String domain = domainList.get(position);
DomainBlockViewHolder holder = (DomainBlockViewHolder) viewHolder;
holder.binding.domainName.setText(domain);
AccountsVM accountsVM = new ViewModelProvider((ViewModelStoreOwner) context).get(AccountsVM.class);
holder.binding.unblockDomain.setOnClickListener(v -> {
AlertDialog.Builder alt_bld = new AlertDialog.Builder(context, Helper.dialogStyle());
alt_bld.setMessage(context.getString(R.string.unblock_domain_confirm, domain));
alt_bld.setPositiveButton(R.string.yes, (dialog, id) -> {
accountsVM.removeDomainBlocks(MainActivity.currentInstance, MainActivity.currentToken, domain);
domainList.remove(position);
notifyItemRemoved(position);
dialog.dismiss();
});
alt_bld.setNegativeButton(R.string.cancel, (dialog, id) -> dialog.dismiss());
AlertDialog alert = alt_bld.create();
alert.show();
});
}
@Override
public int getItemCount() {
return domainList.size();
}
public static class DomainBlockViewHolder extends RecyclerView.ViewHolder {
DrawerDomainBlockBinding binding;
DomainBlockViewHolder(DrawerDomainBlockBinding itemView) {
super(itemView.getRoot());
binding = itemView;
}
}
}

View file

@ -38,10 +38,11 @@ public class FieldAdapter extends RecyclerView.Adapter<FieldAdapter.FieldViewHol
private final List<Field> fields;
private Context context;
private Account account;
private final Account account;
public FieldAdapter(List<Field> fields) {
public FieldAdapter(List<Field> fields, Account account) {
this.fields = fields;
this.account = account;
}
@Override
@ -68,12 +69,18 @@ public class FieldAdapter extends RecyclerView.Adapter<FieldAdapter.FieldViewHol
if (field.verified_at != null) {
holder.binding.value.setCompoundDrawablesWithIntrinsicBounds(null, null, ContextCompat.getDrawable(context, R.drawable.ic_baseline_verified_24), null);
}
holder.binding.value.setText(
field.getValueSpan(context, account,
new WeakReference<>(holder.binding.value)),
TextView.BufferType.SPANNABLE);
holder.binding.value.setMovementMethod(LinkMovementMethod.getInstance());
holder.binding.label.setText(field.name);
holder.binding.label.setText(
field.getValueSpan(context, account,
new WeakReference<>(holder.binding.label)),
TextView.BufferType.SPANNABLE);
holder.binding.label.setMovementMethod(LinkMovementMethod.getInstance());
}

View file

@ -78,11 +78,14 @@ public class FilterAdapter extends RecyclerView.Adapter<FilterAdapter.FilterView
contextString.append(ct).append(" ");
holder.binding.filterContext.setText(contextString.toString());
holder.binding.editFilter.setOnClickListener(v -> FilterActivity.addEditFilter(context, filter, filter1 -> {
if (filter1 != null) {
if (filter1 != null && BaseMainActivity.mainFilters.size() > position) {
BaseMainActivity.mainFilters.get(position).context = filter1.context;
BaseMainActivity.mainFilters.get(position).expires_at = filter1.expires_at;
BaseMainActivity.mainFilters.get(position).filter_action = filter1.filter_action;
BaseMainActivity.mainFilters.get(position).keywords = filter1.keywords;
BaseMainActivity.mainFilters.get(position).title = filter1.title;
filterAdapter.notifyItemChanged(position);
}
filterAdapter.notifyItemChanged(position);
}));
holder.binding.deleteFilter.setOnClickListener(v -> {
AlertDialog.Builder builder = new AlertDialog.Builder(context, Helper.dialogStyle());

View file

@ -20,7 +20,6 @@ import android.content.Context;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.ViewGroup;
import android.widget.Toast;
import androidx.recyclerview.widget.RecyclerView;
@ -36,7 +35,6 @@ import app.fedilab.android.exception.DBException;
import app.fedilab.android.helper.itemtouchhelper.ItemTouchHelperAdapter;
import app.fedilab.android.helper.itemtouchhelper.ItemTouchHelperViewHolder;
import app.fedilab.android.helper.itemtouchhelper.OnStartDragListener;
import es.dmoral.toasty.Toasty;
/**
@ -130,8 +128,6 @@ public class ReorderBottomMenuAdapter extends RecyclerView.Adapter<RecyclerView.
@Override
public void onItemDismiss(int position) {
notifyItemChanged(position);
Toasty.info(context, context.getString(R.string.warning_main_timeline), Toast.LENGTH_SHORT).show();
}
@Override

View file

@ -21,14 +21,17 @@ import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Toast;
import androidx.appcompat.app.AlertDialog;
import androidx.lifecycle.ViewModelProvider;
import androidx.lifecycle.ViewModelStoreOwner;
import androidx.recyclerview.widget.RecyclerView;
import org.jetbrains.annotations.NotNull;
import java.util.Collections;
import app.fedilab.android.BaseMainActivity;
import app.fedilab.android.R;
import app.fedilab.android.activities.ReorderTimelinesActivity;
import app.fedilab.android.client.entities.app.Pinned;
@ -36,11 +39,11 @@ import app.fedilab.android.client.entities.app.PinnedTimeline;
import app.fedilab.android.client.entities.app.Timeline;
import app.fedilab.android.databinding.DrawerReorderBinding;
import app.fedilab.android.exception.DBException;
import app.fedilab.android.helper.Helper;
import app.fedilab.android.helper.itemtouchhelper.ItemTouchHelperAdapter;
import app.fedilab.android.helper.itemtouchhelper.ItemTouchHelperViewHolder;
import app.fedilab.android.helper.itemtouchhelper.OnStartDragListener;
import app.fedilab.android.helper.itemtouchhelper.OnUndoListener;
import es.dmoral.toasty.Toasty;
import app.fedilab.android.viewmodel.mastodon.TimelinesVM;
/**
@ -52,13 +55,11 @@ import es.dmoral.toasty.Toasty;
public class ReorderTabAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> implements ItemTouchHelperAdapter {
private final OnStartDragListener mDragStartListener;
private final OnUndoListener mUndoListener;
private final Pinned pinned;
private Context context;
public ReorderTabAdapter(Pinned pinned, OnStartDragListener dragStartListener, OnUndoListener undoListener) {
public ReorderTabAdapter(Pinned pinned, OnStartDragListener dragStartListener) {
this.mDragStartListener = dragStartListener;
this.mUndoListener = undoListener;
this.pinned = pinned;
}
@ -169,24 +170,61 @@ public class ReorderTabAdapter extends RecyclerView.Adapter<RecyclerView.ViewHol
}
holder.binding.delete.setOnClickListener(v -> {
if (item.type == Timeline.TimeLineEnum.TAG || item.type == Timeline.TimeLineEnum.REMOTE || item.type == Timeline.TimeLineEnum.LIST) {
mUndoListener.onUndo(item, position);
pinned.pinnedTimelines.remove(position);
notifyItemRemoved(position);
AlertDialog.Builder alt_bld = new AlertDialog.Builder(context, Helper.dialogStyle());
String title = "";
String message = "";
alt_bld.setTitle(R.string.action_lists_delete);
alt_bld.setMessage(R.string.action_lists_confirm_delete);
switch (item.type) {
case TAG:
case REMOTE:
title = context.getString(R.string.action_pinned_delete);
message = context.getString(R.string.unpin_timeline_description);
break;
case LIST:
title = context.getString(R.string.action_lists_delete);
message = context.getString(R.string.action_lists_confirm_delete);
break;
}
alt_bld.setTitle(title);
alt_bld.setMessage(message);
alt_bld.setPositiveButton(R.string.delete, (dialog, id) -> {
//change position of pinned that are after the removed item
if (position < pinned.pinnedTimelines.size()) {
for (int i = item.position + 1; i < pinned.pinnedTimelines.size(); i++) {
pinned.pinnedTimelines.get(i).position -= 1;
}
pinned.pinnedTimelines.remove(position);
notifyItemRemoved(position);
notifyItemChanged(position, pinned.pinnedTimelines.size() - position);
try {
new Pinned(context).updatePinned(pinned);
} catch (DBException e) {
e.printStackTrace();
}
}
if (item.type == Timeline.TimeLineEnum.LIST) {
TimelinesVM timelinesVM = new ViewModelProvider((ViewModelStoreOwner) context).get(TimelinesVM.class);
timelinesVM.deleteList(BaseMainActivity.currentInstance, BaseMainActivity.currentToken, item.mastodonList.id);
}
((ReorderTimelinesActivity) context).setChanges(true);
dialog.dismiss();
});
alt_bld.setNegativeButton(R.string.cancel, (dialog, id) -> dialog.dismiss());
AlertDialog alert = alt_bld.create();
alert.show();
}
});
}
@Override
public void onItemDismiss(int position) {
PinnedTimeline item = pinned.pinnedTimelines.get(position);
if (item.type == Timeline.TimeLineEnum.TAG || item.type == Timeline.TimeLineEnum.REMOTE || item.type == Timeline.TimeLineEnum.LIST) {
mUndoListener.onUndo(item, position);
pinned.pinnedTimelines.remove(position);
notifyItemRemoved(position);
} else {
notifyItemChanged(position);
Toasty.info(context, context.getString(R.string.warning_main_timeline), Toast.LENGTH_SHORT).show();
}
}
@Override

View file

@ -24,6 +24,7 @@ import static app.fedilab.android.BaseMainActivity.regex_public;
import static app.fedilab.android.BaseMainActivity.show_boosts;
import static app.fedilab.android.BaseMainActivity.show_replies;
import static app.fedilab.android.activities.ContextActivity.expand;
import static app.fedilab.android.helper.Helper.PREF_USER_TOKEN;
import android.annotation.SuppressLint;
import android.app.Activity;
@ -38,6 +39,8 @@ import android.graphics.drawable.Drawable;
import android.os.Build;
import android.os.Bundle;
import android.os.CountDownTimer;
import android.os.Handler;
import android.os.Looper;
import android.text.Html;
import android.text.SpannableString;
import android.text.Spanned;
@ -100,20 +103,22 @@ import java.util.regex.Pattern;
import app.fedilab.android.BaseMainActivity;
import app.fedilab.android.R;
import app.fedilab.android.activities.AdminAccountActivity;
import app.fedilab.android.activities.ComposeActivity;
import app.fedilab.android.activities.ContextActivity;
import app.fedilab.android.activities.CustomSharingActivity;
import app.fedilab.android.activities.MainActivity;
import app.fedilab.android.activities.MediaActivity;
import app.fedilab.android.activities.ProfileActivity;
import app.fedilab.android.activities.ReportActivity;
import app.fedilab.android.activities.StatusHistoryActivity;
import app.fedilab.android.activities.StatusInfoActivity;
import app.fedilab.android.activities.admin.AdminAccountActivity;
import app.fedilab.android.client.entities.api.Attachment;
import app.fedilab.android.client.entities.api.Poll;
import app.fedilab.android.client.entities.api.Reaction;
import app.fedilab.android.client.entities.api.Status;
import app.fedilab.android.client.entities.app.Account;
import app.fedilab.android.client.entities.app.BaseAccount;
import app.fedilab.android.client.entities.app.StatusCache;
import app.fedilab.android.client.entities.app.StatusDraft;
import app.fedilab.android.client.entities.app.Timeline;
@ -1240,8 +1245,10 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
layoutMediaBinding.media.setOnClickListener(v -> {
if (statusToDeal.isMediaObfuscated && mediaObfuscated(statusToDeal) && !expand_media) {
statusToDeal.isMediaObfuscated = false;
adapter.notifyItemChanged(holder.getBindingAdapterPosition());
int position = holder.getBindingAdapterPosition();
adapter.notifyItemChanged(position);
final int timeout = sharedpreferences.getInt(context.getString(R.string.SET_NSFW_TIMEOUT), 5);
if (timeout > 0) {
new CountDownTimer((timeout * 1000L), 1000) {
public void onTick(long millisUntilFinished) {
@ -1249,7 +1256,7 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
public void onFinish() {
status.isMediaObfuscated = true;
adapter.notifyItemChanged(holder.getBindingAdapterPosition());
adapter.notifyItemChanged(position);
}
}.start();
}
@ -1609,7 +1616,11 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
.observe((LifecycleOwner) context, poll -> {
int i = 0;
for (Poll.PollItem item : statusToDeal.poll.options) {
poll.options.get(i).span_title = item.span_title;
if (item.span_title != null) {
poll.options.get(i).span_title = item.span_title;
} else {
poll.options.get(i).span_title = new SpannableString(item.title);
}
i++;
}
statusToDeal.poll = poll;
@ -1625,7 +1636,11 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
if (poll != null) {
int i = 0;
for (Poll.PollItem item : statusToDeal.poll.options) {
poll.options.get(i).span_title = item.span_title;
if (item.span_title != null) {
poll.options.get(i).span_title = item.span_title;
} else {
poll.options.get(i).span_title = new SpannableString(item.title);
}
i++;
}
statusToDeal.poll = poll;
@ -1640,7 +1655,11 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
//Store span elements
int i = 0;
for (Poll.PollItem item : statusToDeal.poll.options) {
poll.options.get(i).span_title = item.span_title;
if (item.span_title != null) {
poll.options.get(i).span_title = item.span_title;
} else {
poll.options.get(i).span_title = new SpannableString(item.title);
}
i++;
}
statusToDeal.poll = poll;
@ -1849,14 +1868,18 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
AlertDialog.Builder builderInner = new AlertDialog.Builder(context, Helper.dialogStyle());
builderInner.setTitle(stringArrayConf[0]);
builderInner.setMessage(statusToDeal.account.acct);
builderInner.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss());
builderInner.setPositiveButton(R.string.yes, (dialog, which) -> accountsVM.mute(BaseMainActivity.currentInstance, BaseMainActivity.currentToken, statusToDeal.account.id, null, null)
builderInner.setNeutralButton(R.string.cancel, (dialog, which) -> dialog.dismiss());
builderInner.setNegativeButton(R.string.keep_notifications, (dialog, which) -> accountsVM.mute(BaseMainActivity.currentInstance, BaseMainActivity.currentToken, statusToDeal.account.id, false, null)
.observe((LifecycleOwner) context, relationShip -> {
sendAction(context, Helper.ARG_STATUS_ACCOUNT_ID_DELETED, null, statusToDeal.account.id);
Toasty.info(context, context.getString(R.string.toast_mute), Toasty.LENGTH_LONG).show();
}));
builderInner.setPositiveButton(R.string.action_mute, (dialog, which) -> accountsVM.mute(BaseMainActivity.currentInstance, BaseMainActivity.currentToken, statusToDeal.account.id, null, null)
.observe((LifecycleOwner) context, relationShip -> {
sendAction(context, Helper.ARG_STATUS_ACCOUNT_ID_DELETED, null, statusToDeal.account.id);
Toasty.info(context, context.getString(R.string.toast_mute), Toasty.LENGTH_LONG).show();
}));
builderInner.show();
} else if (itemId == R.id.action_mute_conversation) {
if (statusToDeal.muted) {
statusesVM.unMute(BaseMainActivity.currentInstance, BaseMainActivity.currentToken, statusToDeal.id).observe((LifecycleOwner) context, status1 -> Toasty.info(context, context.getString(R.string.toast_unmute_conversation)).show());
@ -1993,6 +2016,54 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
b.putSerializable(Helper.ARG_STATUS_MENTION, statusToDeal);
intent.putExtras(b);
context.startActivity(intent);
} else if (itemId == R.id.action_open_with) {
new Thread(() -> {
try {
List<BaseAccount> accounts = new Account(context).getCrossAccounts();
if (accounts.size() > 1) {
List<app.fedilab.android.client.entities.api.Account> accountList = new ArrayList<>();
for (BaseAccount account : accounts) {
accountList.add(account.mastodon_account);
}
Handler mainHandler = new Handler(Looper.getMainLooper());
Runnable myRunnable = () -> {
AlertDialog.Builder builderSingle = new AlertDialog.Builder(context, Helper.dialogStyle());
builderSingle.setTitle(context.getString(R.string.choose_accounts));
final AccountsSearchAdapter accountsSearchAdapter = new AccountsSearchAdapter(context, accountList);
final BaseAccount[] accountArray = new BaseAccount[accounts.size()];
int i = 0;
for (BaseAccount account : accounts) {
accountArray[i] = account;
i++;
}
builderSingle.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss());
builderSingle.setAdapter(accountsSearchAdapter, (dialog, which) -> {
BaseAccount account = accountArray[which];
Toasty.info(context, context.getString(R.string.toast_account_changed, "@" + account.mastodon_account.acct + "@" + account.instance), Toasty.LENGTH_LONG).show();
BaseMainActivity.currentToken = account.token;
BaseMainActivity.currentUserID = account.user_id;
BaseMainActivity.currentInstance = account.instance;
MainActivity.currentAccount = account;
SharedPreferences.Editor editor = sharedpreferences.edit();
editor.putString(PREF_USER_TOKEN, account.token);
editor.commit();
Intent mainActivity = new Intent(context, MainActivity.class);
mainActivity.putExtra(Helper.INTENT_ACTION, Helper.OPEN_WITH_ANOTHER_ACCOUNT);
mainActivity.putExtra(Helper.PREF_MESSAGE_URL, statusToDeal.url);
context.startActivity(mainActivity);
((Activity) context).finish();
dialog.dismiss();
});
builderSingle.show();
};
mainHandler.post(myRunnable);
}
} catch (DBException e) {
e.printStackTrace();
}
}).start();
}
return true;
});

View file

@ -0,0 +1,143 @@
package app.fedilab.android.ui.drawer;
/* Copyright 2022 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.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.res.ColorStateList;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.core.app.ActivityOptionsCompat;
import androidx.core.content.ContextCompat;
import androidx.lifecycle.ViewModelProvider;
import androidx.lifecycle.ViewModelStoreOwner;
import androidx.recyclerview.widget.RecyclerView;
import java.lang.ref.WeakReference;
import java.util.List;
import app.fedilab.android.BaseMainActivity;
import app.fedilab.android.R;
import app.fedilab.android.activities.ProfileActivity;
import app.fedilab.android.client.entities.api.Account;
import app.fedilab.android.client.entities.api.Suggestion;
import app.fedilab.android.databinding.DrawerSuggestionBinding;
import app.fedilab.android.helper.Helper;
import app.fedilab.android.helper.MastodonHelper;
import app.fedilab.android.viewmodel.mastodon.AccountsVM;
public class SuggestionAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
private final List<Suggestion> suggestionList;
private Context context;
public SuggestionAdapter(List<Suggestion> suggestionList) {
this.suggestionList = suggestionList;
}
public int getCount() {
return suggestionList.size();
}
public Suggestion getItem(int position) {
return suggestionList.get(position);
}
@NonNull
@Override
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
this.context = parent.getContext();
DrawerSuggestionBinding itemBinding = DrawerSuggestionBinding.inflate(LayoutInflater.from(parent.getContext()), parent, false);
return new SuggestionViewHolder(itemBinding);
}
@Override
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder viewHolder, int position) {
Account account = suggestionList.get(position).account;
SuggestionViewHolder holder = (SuggestionViewHolder) viewHolder;
MastodonHelper.loadPPMastodon(holder.binding.avatar, account);
AccountsVM accountsVM = new ViewModelProvider((ViewModelStoreOwner) context).get(AccountsVM.class);
holder.binding.avatar.setOnClickListener(v -> {
Intent intent = new Intent(context, ProfileActivity.class);
Bundle b = new Bundle();
b.putSerializable(Helper.ARG_ACCOUNT, account);
intent.putExtras(b);
ActivityOptionsCompat options = ActivityOptionsCompat
.makeSceneTransitionAnimation((Activity) context, holder.binding.avatar, context.getString(R.string.activity_porfile_pp));
// start the new activity
context.startActivity(intent, options.toBundle());
});
holder.binding.followAction.setIconResource(R.drawable.ic_baseline_person_add_24);
holder.binding.followAction.setBackgroundTintList(ColorStateList.valueOf(ContextCompat.getColor(context, R.color.cyanea_accent_dark_reference)));
if (account == null) {
return;
}
holder.binding.displayName.setText(
account.getSpanDisplayName(context,
new WeakReference<>(holder.binding.displayName)),
TextView.BufferType.SPANNABLE);
holder.binding.username.setText(String.format("@%s", account.acct));
holder.binding.bio.setText(
account.getSpanNote(context,
new WeakReference<>(holder.binding.bio)),
TextView.BufferType.SPANNABLE);
holder.binding.followAction.setEnabled(false);
holder.binding.followAction.setOnClickListener(v -> {
suggestionList.remove(position);
notifyItemRemoved(position);
accountsVM.follow(BaseMainActivity.currentInstance, BaseMainActivity.currentToken, account.id, true, false);
});
holder.binding.notInterested.setOnClickListener(view -> {
suggestionList.remove(position);
notifyItemRemoved(position);
accountsVM.removeSuggestion(BaseMainActivity.currentInstance, BaseMainActivity.currentToken, account.id);
});
//TODO, remove when supported
holder.binding.notInterested.setVisibility(View.GONE);
}
public long getItemId(int position) {
return position;
}
@Override
public int getItemCount() {
return suggestionList.size();
}
public static class SuggestionViewHolder extends RecyclerView.ViewHolder {
DrawerSuggestionBinding binding;
SuggestionViewHolder(DrawerSuggestionBinding itemView) {
super(itemView.getRoot());
binding = itemView;
}
}
}

View file

@ -1,4 +1,4 @@
package app.fedilab.android.ui.drawer;
package app.fedilab.android.ui.drawer.admin;
/* Copyright 2022 Thomas Schneider
*
* This file is a part of Fedilab
@ -27,8 +27,8 @@ import androidx.recyclerview.widget.RecyclerView;
import java.util.List;
import java.util.Locale;
import app.fedilab.android.activities.AdminAccountActivity;
import app.fedilab.android.client.entities.api.AdminAccount;
import app.fedilab.android.activities.admin.AdminAccountActivity;
import app.fedilab.android.client.entities.api.admin.AdminAccount;
import app.fedilab.android.databinding.DrawerAdminAccountBinding;
import app.fedilab.android.helper.Helper;
import app.fedilab.android.helper.MastodonHelper;
@ -78,8 +78,7 @@ public class AdminAccountAdapter extends RecyclerView.Adapter<RecyclerView.ViewH
holder.binding.followersCount.setText(String.valueOf(adminAccount.account.followers_count));
holder.binding.email.setText(adminAccount.email);
if (adminAccount.ip != null) {
holder.binding.lastActive.setText(Helper.shortDateToString(adminAccount.ip.used_at));
holder.binding.ip.setText(adminAccount.ip.ip);
holder.binding.ip.setText(adminAccount.ip);
} else if (adminAccount.ips != null && adminAccount.ips.size() > 0) {
holder.binding.lastActive.setText(Helper.shortDateToString(adminAccount.ips.get(0).used_at));
holder.binding.ip.setText(adminAccount.ips.get(0).ip);

View file

@ -0,0 +1,101 @@
package app.fedilab.android.ui.drawer.admin;
/* Copyright 2022 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.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import org.jetbrains.annotations.NotNull;
import java.util.List;
import app.fedilab.android.R;
import app.fedilab.android.activities.admin.AdminDomainBlockActivity;
import app.fedilab.android.client.entities.api.admin.AdminDomainBlock;
import app.fedilab.android.databinding.DrawerAdminDomainBinding;
import app.fedilab.android.helper.Helper;
public class AdminDomainAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
private final List<AdminDomainBlock> adminDomainBlockList;
private Context context;
public AdminDomainAdapter(List<AdminDomainBlock> adminDomainBlocks) {
this.adminDomainBlockList = adminDomainBlocks;
}
@NotNull
@Override
public RecyclerView.ViewHolder onCreateViewHolder(@NotNull ViewGroup parent, int viewType) {
context = parent.getContext();
DrawerAdminDomainBinding itemBinding = DrawerAdminDomainBinding.inflate(LayoutInflater.from(parent.getContext()), parent, false);
return new DomainViewHolder(itemBinding);
}
@Override
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder viewHolder, int position) {
DomainViewHolder holder = (DomainViewHolder) viewHolder;
AdminDomainBlock adminDomainBlock = adminDomainBlockList.get(position);
holder.binding.date.setText(Helper.shortDateToString(adminDomainBlock.created_at));
holder.binding.title.setText(adminDomainBlock.domain);
String text = adminDomainBlock.severity;
if (adminDomainBlock.reject_media) {
text += " - " + context.getString(R.string.reject_media);
}
if (adminDomainBlock.reject_reports) {
text += " - " + context.getString(R.string.reject_reports);
}
holder.binding.severity.setText(text);
holder.binding.mainContainer.setOnClickListener(view -> {
Intent intent = new Intent(context, AdminDomainBlockActivity.class);
Bundle b = new Bundle();
b.putSerializable(Helper.ARG_ADMIN_DOMAINBLOCK, adminDomainBlock);
intent.putExtras(b);
context.startActivity(intent);
});
}
@Override
public long getItemId(int position) {
return position;
}
@Override
public int getItemCount() {
return adminDomainBlockList.size();
}
public static class DomainViewHolder extends RecyclerView.ViewHolder {
DrawerAdminDomainBinding binding;
DomainViewHolder(DrawerAdminDomainBinding itemView) {
super(itemView.getRoot());
binding = itemView;
}
}
}

View file

@ -1,4 +1,4 @@
package app.fedilab.android.ui.drawer;
package app.fedilab.android.ui.drawer.admin;
/* Copyright 2022 Thomas Schneider
*
* This file is a part of Fedilab
@ -31,7 +31,7 @@ import java.util.List;
import app.fedilab.android.activities.AccountReportActivity;
import app.fedilab.android.client.entities.api.Account;
import app.fedilab.android.client.entities.api.AdminReport;
import app.fedilab.android.client.entities.api.admin.AdminReport;
import app.fedilab.android.databinding.DrawerReportBinding;
import app.fedilab.android.helper.Helper;
import app.fedilab.android.helper.MastodonHelper;

View file

@ -33,14 +33,14 @@ import java.util.List;
import app.fedilab.android.BaseMainActivity;
import app.fedilab.android.R;
import app.fedilab.android.activities.AdminActionActivity;
import app.fedilab.android.client.entities.api.AdminAccount;
import app.fedilab.android.client.entities.api.AdminAccounts;
import app.fedilab.android.activities.admin.AdminActionActivity;
import app.fedilab.android.client.entities.api.admin.AdminAccount;
import app.fedilab.android.client.entities.api.admin.AdminAccounts;
import app.fedilab.android.databinding.FragmentPaginationBinding;
import app.fedilab.android.helper.Helper;
import app.fedilab.android.helper.MastodonHelper;
import app.fedilab.android.helper.ThemeHelper;
import app.fedilab.android.ui.drawer.AdminAccountAdapter;
import app.fedilab.android.ui.drawer.admin.AdminAccountAdapter;
import app.fedilab.android.viewmodel.mastodon.AdminVM;

View file

@ -0,0 +1,256 @@
package app.fedilab.android.ui.fragment.admin;
/* Copyright 2022 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.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.lifecycle.ViewModelProvider;
import androidx.recyclerview.widget.DividerItemDecoration;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import java.util.ArrayList;
import java.util.List;
import app.fedilab.android.BaseMainActivity;
import app.fedilab.android.R;
import app.fedilab.android.activities.admin.AdminDomainBlockActivity;
import app.fedilab.android.client.entities.api.admin.AdminDomainBlock;
import app.fedilab.android.client.entities.api.admin.AdminDomainBlocks;
import app.fedilab.android.databinding.FragmentPaginationBinding;
import app.fedilab.android.helper.Helper;
import app.fedilab.android.helper.ThemeHelper;
import app.fedilab.android.ui.drawer.admin.AdminDomainAdapter;
import app.fedilab.android.viewmodel.mastodon.AdminVM;
public class FragmentAdminDomain extends Fragment {
private FragmentPaginationBinding binding;
private AdminVM adminVM;
private boolean flagLoading;
private List<AdminDomainBlock> adminDomainBlocks;
private String max_id, min_id;
private AdminDomainAdapter adminDomainAdapter;
private LinearLayoutManager mLayoutManager;
private String viewModelKey;
public void scrollToTop() {
if (binding != null) {
binding.recyclerView.scrollToPosition(0);
}
}
public void delete(AdminDomainBlock adminDomainBlock) {
int position = 0;
for (AdminDomainBlock adminDomainBlockPresent : adminDomainBlocks) {
if (adminDomainBlockPresent.id.equals(adminDomainBlock.id)) {
adminDomainBlocks.remove(position);
adminDomainAdapter.notifyItemRemoved(position);
break;
}
position++;
}
}
public void update(AdminDomainBlock adminDomainBlock) {
if (adminDomainBlocks == null) {
AdminDomainBlocks adminDomainBlocks = new AdminDomainBlocks();
adminDomainBlocks.adminDomainBlocks = new ArrayList<>();
adminDomainBlocks.adminDomainBlocks.add(adminDomainBlock);
initializeStatusesCommonView(adminDomainBlocks);
}
int position = 0;
boolean find = false;
for (AdminDomainBlock adminDomainBlockPresent : adminDomainBlocks) {
if (adminDomainBlockPresent.id.equals(adminDomainBlock.id)) {
adminDomainBlocks.get(position).private_comment = adminDomainBlock.private_comment;
adminDomainBlocks.get(position).public_comment = adminDomainBlock.public_comment;
adminDomainBlocks.get(position).severity = adminDomainBlock.severity;
adminDomainBlocks.get(position).reject_reports = adminDomainBlock.reject_reports;
adminDomainBlocks.get(position).reject_media = adminDomainBlock.reject_media;
adminDomainBlocks.get(position).obfuscate = adminDomainBlock.obfuscate;
adminDomainAdapter.notifyItemChanged(position);
find = true;
break;
}
position++;
}
if (!find) {
adminDomainBlocks.add(0, adminDomainBlock);
adminDomainAdapter.notifyItemInserted(0);
}
}
public View onCreateView(@NonNull LayoutInflater inflater,
ViewGroup container, Bundle savedInstanceState) {
if (getArguments() != null) {
viewModelKey = getArguments().getString(Helper.ARG_VIEW_MODEL_KEY, "");
}
binding = FragmentPaginationBinding.inflate(inflater, container, false);
binding.getRoot().setBackgroundColor(ThemeHelper.getBackgroundColor(requireActivity()));
int c1 = getResources().getColor(R.color.cyanea_accent_reference);
binding.swipeContainer.setProgressBackgroundColorSchemeColor(getResources().getColor(R.color.cyanea_primary_reference));
binding.swipeContainer.setColorSchemeColors(
c1, c1, c1
);
adminVM = new ViewModelProvider(FragmentAdminDomain.this).get(viewModelKey, AdminVM.class);
binding.noActionText.setText(R.string.no_blocked_domains);
binding.loader.setVisibility(View.VISIBLE);
binding.recyclerView.setVisibility(View.GONE);
flagLoading = false;
adminVM.getDomainBlocks(
BaseMainActivity.currentInstance, BaseMainActivity.currentToken, null)
.observe(getViewLifecycleOwner(), this::initializeStatusesCommonView);
binding.addAction.setVisibility(View.VISIBLE);
binding.addAction.setOnClickListener(v -> {
Intent intent = new Intent(requireActivity(), AdminDomainBlockActivity.class);
Bundle b = new Bundle();
intent.putExtras(b);
startActivity(intent);
});
return binding.getRoot();
}
@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
}
/**
* Intialize the common view for domain block on different timelines
*
* @param adminDomainBlocks {@link AdminDomainBlocks}
*/
private void initializeStatusesCommonView(final AdminDomainBlocks adminDomainBlocks) {
if (binding == null || !isAdded() || getActivity() == null) {
return;
}
binding.loader.setVisibility(View.GONE);
binding.noAction.setVisibility(View.GONE);
binding.swipeContainer.setRefreshing(false);
binding.swipeContainer.setOnRefreshListener(() -> {
binding.swipeContainer.setRefreshing(true);
max_id = null;
flagLoading = false;
adminVM.getDomainBlocks(
BaseMainActivity.currentInstance, BaseMainActivity.currentToken, null)
.observe(getViewLifecycleOwner(), this::initializeStatusesCommonView);
});
if (adminDomainBlocks == null || adminDomainBlocks.adminDomainBlocks == null || adminDomainBlocks.adminDomainBlocks.size() == 0) {
binding.noAction.setVisibility(View.VISIBLE);
return;
}
flagLoading = adminDomainBlocks.pagination.max_id == null;
binding.recyclerView.setVisibility(View.VISIBLE);
if (adminDomainAdapter != null && this.adminDomainBlocks != null) {
int size = this.adminDomainBlocks.size();
this.adminDomainBlocks.clear();
this.adminDomainBlocks = new ArrayList<>();
adminDomainAdapter.notifyItemRangeRemoved(0, size);
}
if (this.adminDomainBlocks == null) {
this.adminDomainBlocks = new ArrayList<>();
}
this.adminDomainBlocks.addAll(adminDomainBlocks.adminDomainBlocks);
if (max_id == null || (adminDomainBlocks.pagination.max_id != null && Helper.compareTo(adminDomainBlocks.pagination.max_id, max_id) < 0)) {
max_id = adminDomainBlocks.pagination.max_id;
}
if (min_id == null || (adminDomainBlocks.pagination.max_id != null && Helper.compareTo(adminDomainBlocks.pagination.min_id, min_id) > 0)) {
min_id = adminDomainBlocks.pagination.min_id;
}
adminDomainAdapter = new AdminDomainAdapter(adminDomainBlocks.adminDomainBlocks);
mLayoutManager = new LinearLayoutManager(requireActivity());
binding.recyclerView.setLayoutManager(mLayoutManager);
binding.recyclerView.setAdapter(adminDomainAdapter);
DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(binding.recyclerView.getContext(),
mLayoutManager.getOrientation());
binding.recyclerView.addItemDecoration(dividerItemDecoration);
binding.recyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() {
@Override
public void onScrolled(@NonNull RecyclerView recyclerView, int dx, int dy) {
if (requireActivity() instanceof BaseMainActivity) {
if (dy < 0 && !((BaseMainActivity) requireActivity()).getFloatingVisibility())
((BaseMainActivity) requireActivity()).manageFloatingButton(true);
if (dy > 0 && ((BaseMainActivity) requireActivity()).getFloatingVisibility())
((BaseMainActivity) requireActivity()).manageFloatingButton(false);
}
int firstVisibleItem = mLayoutManager.findFirstVisibleItemPosition();
if (dy > 0) {
int visibleItemCount = mLayoutManager.getChildCount();
int totalItemCount = mLayoutManager.getItemCount();
if (firstVisibleItem + visibleItemCount == totalItemCount) {
if (!flagLoading) {
flagLoading = true;
binding.loadingNextElements.setVisibility(View.VISIBLE);
adminVM.getDomainAllows(
BaseMainActivity.currentInstance, BaseMainActivity.currentToken, max_id)
.observe(getViewLifecycleOwner(), adminDomainBlocks1 -> dealWithPagination(adminDomainBlocks1));
}
} else {
binding.loadingNextElements.setVisibility(View.GONE);
}
}
}
});
}
/**
* Update view and pagination when scrolling down
*
* @param admDomainBlocks AdminDomainBlocks
*/
private void dealWithPagination(AdminDomainBlocks admDomainBlocks) {
if (binding == null || !isAdded() || getActivity() == null) {
return;
}
binding.loadingNextElements.setVisibility(View.GONE);
if (this.adminDomainBlocks != null && admDomainBlocks != null && admDomainBlocks.adminDomainBlocks != null && admDomainBlocks.adminDomainBlocks.size() > 0) {
flagLoading = admDomainBlocks.pagination.max_id == null;
//There are some adminDomainBlocks present in the timeline
int startId = this.adminDomainBlocks.size();
this.adminDomainBlocks.addAll(admDomainBlocks.adminDomainBlocks);
adminDomainAdapter.notifyItemRangeInserted(startId, admDomainBlocks.adminDomainBlocks.size());
if (max_id == null || (admDomainBlocks.pagination.max_id != null && Helper.compareTo(admDomainBlocks.pagination.max_id, max_id) < 0)) {
max_id = admDomainBlocks.pagination.max_id;
}
if (min_id == null || (admDomainBlocks.pagination.min_id != null && Helper.compareTo(admDomainBlocks.pagination.min_id, min_id) > 0)) {
min_id = admDomainBlocks.pagination.min_id;
}
}
}
}

View file

@ -33,13 +33,13 @@ import java.util.List;
import app.fedilab.android.BaseMainActivity;
import app.fedilab.android.R;
import app.fedilab.android.activities.AdminActionActivity;
import app.fedilab.android.client.entities.api.AdminReport;
import app.fedilab.android.client.entities.api.AdminReports;
import app.fedilab.android.activities.admin.AdminActionActivity;
import app.fedilab.android.client.entities.api.admin.AdminReport;
import app.fedilab.android.client.entities.api.admin.AdminReports;
import app.fedilab.android.databinding.FragmentPaginationBinding;
import app.fedilab.android.helper.Helper;
import app.fedilab.android.helper.ThemeHelper;
import app.fedilab.android.ui.drawer.ReportAdapter;
import app.fedilab.android.ui.drawer.admin.ReportAdapter;
import app.fedilab.android.viewmodel.mastodon.AdminVM;

View file

@ -75,7 +75,7 @@ public class FragmentLoginMain extends Fragment {
binding = FragmentLoginMainBinding.inflate(inflater, container, false);
View root = binding.getRoot();
InstanceSocialVM instanceSocialVM = new ViewModelProvider(FragmentLoginMain.this).get(InstanceSocialVM.class);
binding.menuIcon.setOnClickListener(this::showMenu);
binding.loginInstance.setOnItemClickListener((parent, view, position, id) -> oldSearch = parent.getItemAtPosition(position).toString().trim());
binding.loginInstance.addTextChangedListener(new TextWatcher() {
@ -101,7 +101,7 @@ public class FragmentLoginMain extends Fragment {
}
if (oldSearch == null || !oldSearch.equals(s.toString().trim())) {
searchInstanceRunning = true;
InstanceSocialVM instanceSocialVM = new ViewModelProvider(FragmentLoginMain.this).get(InstanceSocialVM.class);
instanceSocialVM.getInstances(query).observe(requireActivity(), instanceSocialList -> {
binding.loginInstance.setAdapter(null);
if (instanceSocialList.instances.isEmpty()) {

View file

@ -0,0 +1,214 @@
package app.fedilab.android.ui.fragment.timeline;
/* Copyright 2022 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.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.lifecycle.ViewModelProvider;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import java.util.ArrayList;
import java.util.List;
import app.fedilab.android.R;
import app.fedilab.android.activities.MainActivity;
import app.fedilab.android.client.entities.api.Domains;
import app.fedilab.android.databinding.FragmentPaginationBinding;
import app.fedilab.android.helper.ThemeHelper;
import app.fedilab.android.ui.drawer.DomainBlockAdapter;
import app.fedilab.android.viewmodel.mastodon.AccountsVM;
public class FragmentMastodonDomainBlock extends Fragment {
private FragmentPaginationBinding binding;
private DomainBlockAdapter domainBlockAdapter;
private AccountsVM accountsVM;
private List<String> domainList;
private boolean flagLoading;
private String max_id;
public View onCreateView(@NonNull LayoutInflater inflater,
ViewGroup container, Bundle savedInstanceState) {
binding = FragmentPaginationBinding.inflate(inflater, container, false);
binding.getRoot().setBackgroundColor(ThemeHelper.getBackgroundColor(requireActivity()));
return binding.getRoot();
}
@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
int c1 = getResources().getColor(R.color.cyanea_accent_reference);
binding.swipeContainer.setProgressBackgroundColorSchemeColor(getResources().getColor(R.color.cyanea_primary_reference));
binding.swipeContainer.setColorSchemeColors(
c1, c1, c1
);
binding.loader.setVisibility(View.VISIBLE);
binding.recyclerView.setVisibility(View.GONE);
accountsVM = new ViewModelProvider(FragmentMastodonDomainBlock.this).get(AccountsVM.class);
flagLoading = false;
max_id = null;
domainList = new ArrayList<>();
binding.swipeContainer.setOnRefreshListener(() -> {
binding.swipeContainer.setRefreshing(true);
flagLoading = false;
max_id = null;
int size = domainList.size();
domainList.clear();
domainList = new ArrayList<>();
domainBlockAdapter.notifyItemRangeRemoved(0, size);
router();
});
domainBlockAdapter = new DomainBlockAdapter(domainList);
LinearLayoutManager mLayoutManager = new LinearLayoutManager(requireActivity());
binding.recyclerView.setLayoutManager(mLayoutManager);
binding.recyclerView.setAdapter(domainBlockAdapter);
binding.recyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() {
@Override
public void onScrolled(@NonNull RecyclerView recyclerView, int dx, int dy) {
int firstVisibleItem = mLayoutManager.findFirstVisibleItemPosition();
if (dy > 0) {
int visibleItemCount = mLayoutManager.getChildCount();
int totalItemCount = mLayoutManager.getItemCount();
if (firstVisibleItem + visibleItemCount == totalItemCount) {
if (!flagLoading) {
flagLoading = true;
binding.loadingNextElements.setVisibility(View.VISIBLE);
router();
}
} else {
binding.loadingNextElements.setVisibility(View.GONE);
}
}
}
});
router();
}
/**
* Router for timelines
*/
private void router() {
if (max_id == null) {
accountsVM.getDomainBlocks(MainActivity.currentInstance, MainActivity.currentToken, null, null, null)
.observe(getViewLifecycleOwner(), this::initializeTagCommonView);
} else {
accountsVM.getDomainBlocks(MainActivity.currentInstance, MainActivity.currentToken, null, max_id, null)
.observe(getViewLifecycleOwner(), this::dealWithPagination);
}
}
public void scrollToTop() {
binding.recyclerView.setAdapter(domainBlockAdapter);
}
/**
* Intialize the view for domains
*
* @param domains List of {@link String}
*/
private void initializeTagCommonView(final Domains domains) {
flagLoading = false;
if (binding == null || !isAdded() || getActivity() == null) {
return;
}
binding.loader.setVisibility(View.GONE);
binding.noAction.setVisibility(View.GONE);
binding.swipeContainer.setRefreshing(false);
binding.swipeContainer.setOnRefreshListener(() -> {
binding.swipeContainer.setRefreshing(true);
flagLoading = false;
max_id = null;
router();
});
if (domains == null || domains.domains == null || domains.domains.size() == 0) {
binding.noAction.setVisibility(View.VISIBLE);
binding.noActionText.setText(R.string.no_accounts);
return;
}
binding.recyclerView.setVisibility(View.VISIBLE);
if (domainBlockAdapter != null && this.domainList != null) {
int size = this.domainList.size();
this.domainList.clear();
this.domainList = new ArrayList<>();
domainBlockAdapter.notifyItemRangeRemoved(0, size);
}
this.domainList = domains.domains;
domainBlockAdapter = new DomainBlockAdapter(this.domainList);
flagLoading = domains.pagination.max_id == null;
LinearLayoutManager mLayoutManager = new LinearLayoutManager(requireActivity());
binding.recyclerView.setLayoutManager(mLayoutManager);
binding.recyclerView.setAdapter(domainBlockAdapter);
max_id = domains.pagination.max_id;
binding.recyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() {
@Override
public void onScrolled(@NonNull RecyclerView recyclerView, int dx, int dy) {
int firstVisibleItem = mLayoutManager.findFirstVisibleItemPosition();
if (dy > 0) {
int visibleItemCount = mLayoutManager.getChildCount();
int totalItemCount = mLayoutManager.getItemCount();
if (firstVisibleItem + visibleItemCount == totalItemCount) {
if (!flagLoading) {
flagLoading = true;
binding.loadingNextElements.setVisibility(View.VISIBLE);
router();
}
} else {
binding.loadingNextElements.setVisibility(View.GONE);
}
}
}
});
}
private void dealWithPagination(Domains fetched_domains) {
flagLoading = false;
if (binding == null || !isAdded() || getActivity() == null) {
return;
}
binding.loadingNextElements.setVisibility(View.GONE);
if (domainList != null && fetched_domains != null && fetched_domains.domains != null) {
flagLoading = fetched_domains.pagination.max_id == null;
int startId = 0;
//There are some domains present in the timeline
if (domainList.size() > 0) {
startId = domainList.size();
}
int position = domainList.size();
domainList.addAll(fetched_domains.domains);
max_id = fetched_domains.pagination.max_id;
domainBlockAdapter.notifyItemRangeInserted(startId, fetched_domains.domains.size());
} else {
flagLoading = true;
}
}
}

View file

@ -622,8 +622,7 @@ public class FragmentMastodonNotification extends Fragment implements Notificati
for (Notification notificationsAlreadyPresent : notificationList) {
//We compare the date of each status and we only add status having a date greater than the another, it is inserted at this position
//Pinned messages are ignored because their date can be older
//if (Helper.compareTo(notificationReceived.id, notificationsAlreadyPresent.id) > 0) {
if (notificationReceived.created_at.after(notificationsAlreadyPresent.created_at)) {
if (Helper.compareTo(notificationReceived.id, notificationsAlreadyPresent.id) > 0) {
if (!notificationList.contains(notificationReceived)) {
notificationList.add(position, notificationReceived);
notificationAdapter.notifyItemInserted(position);

View file

@ -0,0 +1,161 @@
package app.fedilab.android.ui.fragment.timeline;
/* Copyright 2022 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.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.lifecycle.ViewModelProvider;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import java.util.List;
import app.fedilab.android.BaseMainActivity;
import app.fedilab.android.R;
import app.fedilab.android.client.entities.api.Suggestion;
import app.fedilab.android.client.entities.api.Suggestions;
import app.fedilab.android.databinding.FragmentPaginationBinding;
import app.fedilab.android.helper.ThemeHelper;
import app.fedilab.android.ui.drawer.SuggestionAdapter;
import app.fedilab.android.viewmodel.mastodon.AccountsVM;
public class FragmentMastodonSuggestion extends Fragment {
private FragmentPaginationBinding binding;
private AccountsVM accountsVM;
private boolean flagLoading;
private List<Suggestion> suggestions;
private String max_id;
private SuggestionAdapter suggestionAdapter;
public View onCreateView(@NonNull LayoutInflater inflater,
ViewGroup container, Bundle savedInstanceState) {
flagLoading = false;
binding = FragmentPaginationBinding.inflate(inflater, container, false);
binding.getRoot().setBackgroundColor(ThemeHelper.getBackgroundColor(requireActivity()));
return binding.getRoot();
}
@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
int c1 = getResources().getColor(R.color.cyanea_accent_reference);
binding.swipeContainer.setProgressBackgroundColorSchemeColor(getResources().getColor(R.color.cyanea_primary_reference));
binding.swipeContainer.setColorSchemeColors(
c1, c1, c1
);
binding.loader.setVisibility(View.VISIBLE);
binding.recyclerView.setVisibility(View.GONE);
accountsVM = new ViewModelProvider(FragmentMastodonSuggestion.this).get(AccountsVM.class);
max_id = null;
accountsVM.getSuggestions(BaseMainActivity.currentInstance, BaseMainActivity.currentToken, null)
.observe(getViewLifecycleOwner(), this::initializeAccountCommonView);
}
public void scrollToTop() {
binding.recyclerView.setAdapter(suggestionAdapter);
}
/**
* Intialize the view for Suggestions
*
* @param suggestions {@link Suggestions}
*/
private void initializeAccountCommonView(final Suggestions suggestions) {
flagLoading = false;
if (binding == null || !isAdded() || getActivity() == null) {
return;
}
binding.loader.setVisibility(View.GONE);
binding.noAction.setVisibility(View.GONE);
binding.swipeContainer.setRefreshing(false);
binding.swipeContainer.setOnRefreshListener(() -> {
binding.swipeContainer.setRefreshing(true);
flagLoading = false;
max_id = null;
accountsVM.getSuggestions(BaseMainActivity.currentInstance, BaseMainActivity.currentToken, null)
.observe(getViewLifecycleOwner(), this::initializeAccountCommonView);
});
if (suggestions == null || suggestions.suggestions == null || suggestions.suggestions.size() == 0) {
binding.noAction.setVisibility(View.VISIBLE);
binding.noActionText.setText(R.string.no_accounts);
return;
}
binding.recyclerView.setVisibility(View.VISIBLE);
this.suggestions = suggestions.suggestions;
suggestionAdapter = new SuggestionAdapter(this.suggestions);
flagLoading = suggestions.pagination.max_id == null;
LinearLayoutManager mLayoutManager = new LinearLayoutManager(requireActivity());
binding.recyclerView.setLayoutManager(mLayoutManager);
binding.recyclerView.setAdapter(suggestionAdapter);
max_id = suggestions.pagination.max_id;
binding.recyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() {
@Override
public void onScrolled(@NonNull RecyclerView recyclerView, int dx, int dy) {
int firstVisibleItem = mLayoutManager.findFirstVisibleItemPosition();
if (dy > 0) {
int visibleItemCount = mLayoutManager.getChildCount();
int totalItemCount = mLayoutManager.getItemCount();
if (firstVisibleItem + visibleItemCount == totalItemCount) {
if (!flagLoading) {
flagLoading = true;
binding.loadingNextElements.setVisibility(View.VISIBLE);
accountsVM.getSuggestions(BaseMainActivity.currentInstance, BaseMainActivity.currentToken, max_id)
.observe(getViewLifecycleOwner(), suggestionsPaginated -> {
dealWithPagination(suggestionsPaginated);
});
}
} else {
binding.loadingNextElements.setVisibility(View.GONE);
}
}
}
});
}
/**
* Update view and pagination when scrolling down
*
* @param suggestions_fetched Suggestions
*/
private void dealWithPagination(Suggestions suggestions_fetched) {
flagLoading = false;
if (binding == null || !isAdded() || getActivity() == null) {
return;
}
binding.loadingNextElements.setVisibility(View.GONE);
if (this.suggestions != null && suggestions_fetched != null && suggestions_fetched.suggestions != null) {
flagLoading = suggestions_fetched.pagination.max_id == null;
int startId = this.suggestions.size();
this.suggestions.addAll(suggestions_fetched.suggestions);
max_id = suggestions_fetched.pagination.max_id;
suggestionAdapter.notifyItemRangeInserted(startId, suggestions_fetched.suggestions.size());
} else {
flagLoading = true;
}
}
}

View file

@ -25,6 +25,7 @@ import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AlertDialog;
import androidx.core.content.ContextCompat;
import androidx.core.content.res.ResourcesCompat;
@ -56,10 +57,15 @@ public class FragmentNotificationContainer extends Fragment {
public static UpdateCounters update;
private FragmentNotificationContainerBinding binding;
public View onCreateView(@NonNull LayoutInflater inflater,
ViewGroup container, Bundle savedInstanceState) {
binding = FragmentNotificationContainerBinding.inflate(inflater, container, false);
return binding.getRoot();
}
@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(requireActivity());
boolean display_all_notification = sharedpreferences.getBoolean(getString(R.string.SET_DISPLAY_ALL_NOTIFICATIONS_TYPE) + BaseMainActivity.currentUserID + BaseMainActivity.currentInstance, false);
if (!display_all_notification) {
@ -77,6 +83,8 @@ public class FragmentNotificationContainer extends Fragment {
binding.tabLayout.addTab(binding.tabLayout.newTab().setIcon(R.drawable.ic_baseline_home_24));
binding.tabLayout.addTab(binding.tabLayout.newTab().setIcon(R.drawable.ic_baseline_person_add_alt_1_24));
binding.tabLayout.addTab(binding.tabLayout.newTab().setIcon(R.drawable.ic_baseline_edit_24));
binding.tabLayout.addTab(binding.tabLayout.newTab().setIcon(R.drawable.ic_baseline_person_add_alt_1_24));
binding.tabLayout.addTab(binding.tabLayout.newTab().setIcon(R.drawable.ic_baseline_report_24));
binding.viewpagerNotificationContainer.setAdapter(new FedilabNotificationPageAdapter(getChildFragmentManager(), true));
}
AtomicBoolean changes = new AtomicBoolean(false);
@ -92,6 +100,8 @@ public class FragmentNotificationContainer extends Fragment {
ThemeHelper.changeButtonColor(requireActivity(), dialogView.displayUpdatesFromPeople);
ThemeHelper.changeButtonColor(requireActivity(), dialogView.displayFollows);
ThemeHelper.changeButtonColor(requireActivity(), dialogView.displayUpdates);
ThemeHelper.changeButtonColor(requireActivity(), dialogView.displaySignups);
ThemeHelper.changeButtonColor(requireActivity(), dialogView.displayReports);
DrawableCompat.setTintList(DrawableCompat.wrap(dialogView.displayAllCategories.getThumbDrawable()), ThemeHelper.getSwitchCompatThumbDrawable(requireActivity()));
DrawableCompat.setTintList(DrawableCompat.wrap(dialogView.displayAllCategories.getTrackDrawable()), ThemeHelper.getSwitchCompatTrackDrawable(requireActivity()));
@ -128,6 +138,8 @@ public class FragmentNotificationContainer extends Fragment {
dialogView.displayUpdatesFromPeople.setChecked(true);
dialogView.displayFollows.setChecked(true);
dialogView.displayUpdates.setChecked(true);
dialogView.displaySignups.setChecked(true);
dialogView.displayReports.setChecked(true);
String excludedCategories = sharedpreferences.getString(getString(R.string.SET_EXCLUDED_NOTIFICATIONS_TYPE) + BaseMainActivity.currentUserID + BaseMainActivity.currentInstance, null);
List<String> excludedCategoriesList = new ArrayList<>();
if (excludedCategories != null) {
@ -162,6 +174,14 @@ public class FragmentNotificationContainer extends Fragment {
excludedCategoriesList.add("update");
dialogView.displayUpdates.setChecked(false);
break;
case "admin.sign_up":
excludedCategoriesList.add("admin.sign_up");
dialogView.displaySignups.setChecked(false);
break;
case "admin.report":
excludedCategoriesList.add("admin.report");
dialogView.displayReports.setChecked(false);
break;
}
}
}
@ -182,6 +202,10 @@ public class FragmentNotificationContainer extends Fragment {
notificationType = "follow";
} else if (checkedId == R.id.display_updates) {
notificationType = "update";
} else if (checkedId == R.id.display_signups) {
notificationType = "admin.sign_up";
} else if (checkedId == R.id.display_reports) {
notificationType = "admin.report";
}
if (isChecked) {
excludedCategoriesList.remove(notificationType);
@ -234,9 +258,9 @@ public class FragmentNotificationContainer extends Fragment {
}
}
});
return binding.getRoot();
}
private void doAction(boolean changed, List<String> excludedCategoriesList) {
SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(requireActivity());
if (changed) {

View file

@ -86,6 +86,12 @@ public class FedilabNotificationPageAdapter extends FragmentStatePagerAdapter {
case 7:
bundle.putSerializable(Helper.ARG_NOTIFICATION_TYPE, FragmentMastodonNotification.NotificationTypeEnum.UPDATES);
break;
case 8:
bundle.putSerializable(Helper.ARG_NOTIFICATION_TYPE, FragmentMastodonNotification.NotificationTypeEnum.ADMIN_SIGNUP);
break;
case 9:
bundle.putSerializable(Helper.ARG_NOTIFICATION_TYPE, FragmentMastodonNotification.NotificationTypeEnum.ADMIN_REPORT);
break;
}
}
fragmentMastodonNotification.setArguments(bundle);
@ -94,6 +100,6 @@ public class FedilabNotificationPageAdapter extends FragmentStatePagerAdapter {
@Override
public int getCount() {
return extended ? 8 : 2;
return extended ? 10 : 2;
}
}

View file

@ -26,9 +26,6 @@ import androidx.lifecycle.AndroidViewModel;
import androidx.lifecycle.LiveData;
import androidx.lifecycle.MutableLiveData;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.concurrent.TimeUnit;
@ -38,6 +35,7 @@ import app.fedilab.android.activities.MainActivity;
import app.fedilab.android.client.endpoints.MastodonAccountsService;
import app.fedilab.android.client.entities.api.Account;
import app.fedilab.android.client.entities.api.Accounts;
import app.fedilab.android.client.entities.api.Domains;
import app.fedilab.android.client.entities.api.FeaturedTag;
import app.fedilab.android.client.entities.api.Field;
import app.fedilab.android.client.entities.api.Filter;
@ -50,6 +48,8 @@ import app.fedilab.android.client.entities.api.Report;
import app.fedilab.android.client.entities.api.Source;
import app.fedilab.android.client.entities.api.Status;
import app.fedilab.android.client.entities.api.Statuses;
import app.fedilab.android.client.entities.api.Suggestion;
import app.fedilab.android.client.entities.api.Suggestions;
import app.fedilab.android.client.entities.api.Tag;
import app.fedilab.android.client.entities.api.Token;
import app.fedilab.android.client.entities.app.StatusCache;
@ -75,6 +75,7 @@ public class AccountsVM extends AndroidViewModel {
private MutableLiveData<Account> accountMutableLiveData;
private MutableLiveData<List<Account>> accountListMutableLiveData;
private MutableLiveData<Suggestions> suggestionsMutableLiveData;
private MutableLiveData<Statuses> statusesMutableLiveData;
private MutableLiveData<Accounts> accountsMutableLiveData;
private MutableLiveData<List<Status>> statusListMutableLiveData;
@ -89,7 +90,7 @@ public class AccountsVM extends AndroidViewModel {
private MutableLiveData<List<Tag>> tagListMutableLiveData;
private MutableLiveData<Preferences> preferencesMutableLiveData;
private MutableLiveData<Token> tokenMutableLiveData;
private MutableLiveData<List<String>> stringListMutableLiveData;
private MutableLiveData<Domains> domainsMutableLiveData;
private MutableLiveData<Report> reportMutableLiveData;
public AccountsVM(@NonNull Application application) {
@ -97,7 +98,6 @@ public class AccountsVM extends AndroidViewModel {
}
private MastodonAccountsService init(String instance) {
Gson gson = new GsonBuilder().setDateFormat("yyyy-MM-dd'T'HH:mm:ssZ").create();
Retrofit retrofit = new Retrofit.Builder()
.baseUrl("https://" + instance + "/api/v1/")
.addConverterFactory(GsonConverterFactory.create(Helper.getDateBuilder()))
@ -106,6 +106,15 @@ public class AccountsVM extends AndroidViewModel {
return retrofit.create(MastodonAccountsService.class);
}
private MastodonAccountsService initv2(String instance) {
Retrofit retrofit = new Retrofit.Builder()
.baseUrl("https://" + instance + "/api/v2/")
.addConverterFactory(GsonConverterFactory.create(Helper.getDateBuilder()))
.client(okHttpClient)
.build();
return retrofit.create(MastodonAccountsService.class);
}
/**
* Get connected account
*
@ -1021,11 +1030,12 @@ public class AccountsVM extends AndroidViewModel {
* View domains the user has blocked.
*
* @param limit Maximum number of results. Defaults to 40.
* @return {@link LiveData} containing a {@link List} of {@link String}s
* @return {@link LiveData} containing {@link Domains}
*/
public LiveData<List<String>> getDomainBlocks(@NonNull String instance, String token, String limit, String maxId, String sinceId) {
stringListMutableLiveData = new MutableLiveData<>();
public LiveData<Domains> getDomainBlocks(@NonNull String instance, String token, String limit, String maxId, String sinceId) {
domainsMutableLiveData = new MutableLiveData<>();
MastodonAccountsService mastodonAccountsService = init(instance);
Domains domains = new Domains();
new Thread(() -> {
List<String> stringList = null;
Call<List<String>> getDomainBlocksCall = mastodonAccountsService.getDomainBlocks(token, limit, maxId, sinceId);
@ -1033,18 +1043,18 @@ public class AccountsVM extends AndroidViewModel {
try {
Response<List<String>> getDomainBlocksResponse = getDomainBlocksCall.execute();
if (getDomainBlocksResponse.isSuccessful()) {
stringList = getDomainBlocksResponse.body();
domains.domains = getDomainBlocksResponse.body();
domains.pagination = MastodonHelper.getPagination(getDomainBlocksResponse.headers());
}
} catch (Exception e) {
e.printStackTrace();
}
}
Handler mainHandler = new Handler(Looper.getMainLooper());
List<String> finalStringList = stringList;
Runnable myRunnable = () -> stringListMutableLiveData.setValue(finalStringList);
Runnable myRunnable = () -> domainsMutableLiveData.setValue(domains);
mainHandler.post(myRunnable);
}).start();
return stringListMutableLiveData;
return domainsMutableLiveData;
}
/**
@ -1393,28 +1403,28 @@ public class AccountsVM extends AndroidViewModel {
* @param limit Maximum number of results to return. Defaults to 40.
* @return {@link LiveData} containing a {@link List} of {@link Account}s
*/
public LiveData<List<Account>> getSuggestions(@NonNull String instance, String token, String limit) {
accountListMutableLiveData = new MutableLiveData<>();
MastodonAccountsService mastodonAccountsService = init(instance);
public LiveData<Suggestions> getSuggestions(@NonNull String instance, String token, String limit) {
suggestionsMutableLiveData = new MutableLiveData<>();
MastodonAccountsService mastodonAccountsService = initv2(instance);
new Thread(() -> {
List<Account> accountList = null;
Call<List<Account>> suggestionsCall = mastodonAccountsService.getSuggestions(token, limit);
Call<List<Suggestion>> suggestionsCall = mastodonAccountsService.getSuggestions(token, limit);
Suggestions suggestions = new Suggestions();
if (suggestionsCall != null) {
try {
Response<List<Account>> suggestionsResponse = suggestionsCall.execute();
Response<List<Suggestion>> suggestionsResponse = suggestionsCall.execute();
if (suggestionsResponse.isSuccessful()) {
accountList = suggestionsResponse.body();
suggestions.pagination = MastodonHelper.getOffSetPagination(suggestionsResponse.headers());
suggestions.suggestions = suggestionsResponse.body();
}
} catch (Exception e) {
e.printStackTrace();
}
}
Handler mainHandler = new Handler(Looper.getMainLooper());
List<Account> finalAccountList = accountList;
Runnable myRunnable = () -> accountListMutableLiveData.setValue(finalAccountList);
Runnable myRunnable = () -> suggestionsMutableLiveData.setValue(suggestions);
mainHandler.post(myRunnable);
}).start();
return accountListMutableLiveData;
return suggestionsMutableLiveData;
}
/**

View file

@ -23,17 +23,16 @@ import androidx.lifecycle.AndroidViewModel;
import androidx.lifecycle.LiveData;
import androidx.lifecycle.MutableLiveData;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import java.util.List;
import java.util.concurrent.TimeUnit;
import app.fedilab.android.client.endpoints.MastodonAdminService;
import app.fedilab.android.client.entities.api.AdminAccount;
import app.fedilab.android.client.entities.api.AdminAccounts;
import app.fedilab.android.client.entities.api.AdminReport;
import app.fedilab.android.client.entities.api.AdminReports;
import app.fedilab.android.client.entities.api.admin.AdminAccount;
import app.fedilab.android.client.entities.api.admin.AdminAccounts;
import app.fedilab.android.client.entities.api.admin.AdminDomainBlock;
import app.fedilab.android.client.entities.api.admin.AdminDomainBlocks;
import app.fedilab.android.client.entities.api.admin.AdminReport;
import app.fedilab.android.client.entities.api.admin.AdminReports;
import app.fedilab.android.helper.Helper;
import app.fedilab.android.helper.MastodonHelper;
import okhttp3.OkHttpClient;
@ -54,13 +53,16 @@ public class AdminVM extends AndroidViewModel {
private MutableLiveData<AdminAccounts> adminAccountsListMutableLiveData;
private MutableLiveData<AdminReport> adminReportMutableLiveData;
private MutableLiveData<AdminReports> adminReporstListMutableLiveData;
private MutableLiveData<AdminDomainBlock> adminDomainBlockMutableLiveData;
private MutableLiveData<AdminDomainBlocks> adminDomainBlockListMutableLiveData;
private MutableLiveData<Boolean> booleanMutableLiveData;
public AdminVM(@NonNull Application application) {
super(application);
}
private MastodonAdminService init(@NonNull String instance) {
Gson gson = new GsonBuilder().setDateFormat("yyyy-MM-dd'T'HH:mm:ssZ").create();
Retrofit retrofit = new Retrofit.Builder()
.baseUrl("https://" + instance + "/api/v1/")
.addConverterFactory(GsonConverterFactory.create(Helper.getDateBuilder()))
@ -69,6 +71,15 @@ public class AdminVM extends AndroidViewModel {
return retrofit.create(MastodonAdminService.class);
}
private MastodonAdminService initv2(@NonNull String instance) {
Retrofit retrofit = new Retrofit.Builder()
.baseUrl("https://" + instance + "/api/v2/")
.addConverterFactory(GsonConverterFactory.create(Helper.getDateBuilder()))
.client(okHttpClient)
.build();
return retrofit.create(MastodonAdminService.class);
}
/**
* View accounts matching certain criteria for filtering, up to 100 at a time.
*
@ -107,7 +118,7 @@ public class AdminVM extends AndroidViewModel {
String maxId,
String sinceId,
Integer limit) {
MastodonAdminService mastodonAdminService = init(instance);
MastodonAdminService mastodonAdminService = initv2(instance);
adminAccountsListMutableLiveData = new MutableLiveData<>();
new Thread(() -> {
Call<List<AdminAccount>> getAccountsCall = mastodonAdminService.getAccounts(
@ -551,4 +562,203 @@ public class AdminVM extends AndroidViewModel {
}).start();
return adminReportMutableLiveData;
}
/**
* View all domains blocked.
*
* @param instance Instance domain of the active account
* @param token Access token of the active account
* @return {@link LiveData} containing a {@link List} of {@link AdminDomainBlocks}s
*/
public LiveData<AdminDomainBlocks> getDomainBlocks(@NonNull String instance,
String token,
String max_id) {
MastodonAdminService mastodonAdminService = init(instance);
adminDomainBlockListMutableLiveData = new MutableLiveData<>();
new Thread(() -> {
List<AdminDomainBlock> adminDomainBlockList;
Call<List<AdminDomainBlock>> getDomainBlocks = mastodonAdminService.getDomainBlocks(token, max_id, MastodonHelper.statusesPerCall(getApplication()));
AdminDomainBlocks adminDomainBlocks = new AdminDomainBlocks();
if (getDomainBlocks != null) {
try {
Response<List<AdminDomainBlock>> getDomainBlocksResponse = getDomainBlocks.execute();
if (getDomainBlocksResponse.isSuccessful()) {
adminDomainBlocks.adminDomainBlocks = getDomainBlocksResponse.body();
adminDomainBlocks.pagination = MastodonHelper.getPagination(getDomainBlocksResponse.headers());
}
} catch (Exception e) {
e.printStackTrace();
}
}
Handler mainHandler = new Handler(Looper.getMainLooper());
Runnable myRunnable = () -> adminDomainBlockListMutableLiveData.setValue(adminDomainBlocks);
mainHandler.post(myRunnable);
}).start();
return adminDomainBlockListMutableLiveData;
}
/**
* View a single blocked domain
*
* @param instance Instance domain of the active account
* @param token Access token of the active account
* @return {@link LiveData} containing a {@link List} of {@link AdminDomainBlocks}s
*/
public LiveData<AdminDomainBlock> getDomainBlock(@NonNull String instance,
String token,
String id) {
MastodonAdminService mastodonAdminService = init(instance);
adminDomainBlockMutableLiveData = new MutableLiveData<>();
new Thread(() -> {
AdminDomainBlock adminDomainBlock = null;
Call<AdminDomainBlock> getDomainBlock = mastodonAdminService.getDomainBlock(token, id);
if (getDomainBlock != null) {
try {
Response<AdminDomainBlock> getDomainBlocksResponse = getDomainBlock.execute();
if (getDomainBlocksResponse.isSuccessful()) {
adminDomainBlock = getDomainBlocksResponse.body();
}
} catch (Exception e) {
e.printStackTrace();
}
}
Handler mainHandler = new Handler(Looper.getMainLooper());
AdminDomainBlock finalAdminDomainBlock = adminDomainBlock;
Runnable myRunnable = () -> adminDomainBlockMutableLiveData.setValue(finalAdminDomainBlock);
mainHandler.post(myRunnable);
}).start();
return adminDomainBlockMutableLiveData;
}
/**
* View a single blocked domain
*
* @param instance Instance domain of the active account
* @param token Access token of the active account
* @return {@link LiveData} containing a {@link List} of {@link AdminDomainBlocks}s
*/
public LiveData<AdminDomainBlock> createOrUpdateDomainBlock(@NonNull String instance,
String token,
AdminDomainBlock adminDomainBlock) {
MastodonAdminService mastodonAdminService = init(instance);
adminDomainBlockMutableLiveData = new MutableLiveData<>();
new Thread(() -> {
AdminDomainBlock admDomainBlock = null;
Call<AdminDomainBlock> getDomainBlock;
if (adminDomainBlock.id == null) {
getDomainBlock = mastodonAdminService.blockDomain(token, adminDomainBlock.domain, adminDomainBlock.severity, adminDomainBlock.reject_media, adminDomainBlock.reject_reports, adminDomainBlock.private_comment, adminDomainBlock.public_comment, adminDomainBlock.obfuscate);
} else {
getDomainBlock = mastodonAdminService.updateBlockDomain(token, adminDomainBlock.id, adminDomainBlock.severity, adminDomainBlock.reject_media, adminDomainBlock.reject_reports, adminDomainBlock.private_comment, adminDomainBlock.public_comment, adminDomainBlock.obfuscate);
}
if (getDomainBlock != null) {
try {
Response<AdminDomainBlock> getDomainBlocksResponse = getDomainBlock.execute();
if (getDomainBlocksResponse.isSuccessful()) {
admDomainBlock = getDomainBlocksResponse.body();
}
} catch (Exception e) {
e.printStackTrace();
}
}
Handler mainHandler = new Handler(Looper.getMainLooper());
AdminDomainBlock finalAdminDomainBlock = admDomainBlock;
Runnable myRunnable = () -> adminDomainBlockMutableLiveData.setValue(finalAdminDomainBlock);
mainHandler.post(myRunnable);
}).start();
return adminDomainBlockMutableLiveData;
}
/**
* View all allowed domains.
*
* @param instance Instance domain of the active account
* @param token Access token of the active account
* @return {@link LiveData} containing a {@link List} of {@link AdminDomainBlocks}s
*/
public LiveData<AdminDomainBlocks> getDomainAllows(@NonNull String instance,
String token,
String max_id) {
MastodonAdminService mastodonAdminService = init(instance);
adminDomainBlockListMutableLiveData = new MutableLiveData<>();
new Thread(() -> {
List<AdminDomainBlock> adminDomainBlockList;
Call<List<AdminDomainBlock>> getDomainBlocks = mastodonAdminService.getDomainAllows(token, max_id, MastodonHelper.statusesPerCall(getApplication()));
AdminDomainBlocks adminDomainBlocks = new AdminDomainBlocks();
if (getDomainBlocks != null) {
try {
Response<List<AdminDomainBlock>> getDomainBlocksResponse = getDomainBlocks.execute();
if (getDomainBlocksResponse.isSuccessful()) {
adminDomainBlocks.adminDomainBlocks = getDomainBlocksResponse.body();
adminDomainBlocks.pagination = MastodonHelper.getPagination(getDomainBlocksResponse.headers());
}
} catch (Exception e) {
e.printStackTrace();
}
}
Handler mainHandler = new Handler(Looper.getMainLooper());
Runnable myRunnable = () -> adminDomainBlockListMutableLiveData.setValue(adminDomainBlocks);
mainHandler.post(myRunnable);
}).start();
return adminDomainBlockListMutableLiveData;
}
public LiveData<Boolean> deleteDomain(@NonNull String instance,
String token,
String id) {
MastodonAdminService mastodonAdminService = init(instance);
booleanMutableLiveData = new MutableLiveData<>();
final boolean[] successReply = {false};
new Thread(() -> {
Call<Void> getDomainBlock = mastodonAdminService.deleteBlockDomain(token, id);
if (getDomainBlock != null) {
try {
Response<Void> response = getDomainBlock.execute();
successReply[0] = response.isSuccessful();
} catch (Exception e) {
e.printStackTrace();
}
}
Handler mainHandler = new Handler(Looper.getMainLooper());
Runnable myRunnable = () -> booleanMutableLiveData.setValue(successReply[0]);
mainHandler.post(myRunnable);
}).start();
return booleanMutableLiveData;
}
/**
* View a single allowed domain
*
* @param instance Instance domain of the active account
* @param token Access token of the active account
* @return {@link LiveData} containing a {@link List} of {@link AdminDomainBlocks}s
*/
public LiveData<AdminDomainBlock> getDomainAllow(@NonNull String instance,
String token,
String id) {
MastodonAdminService mastodonAdminService = init(instance);
adminDomainBlockMutableLiveData = new MutableLiveData<>();
new Thread(() -> {
AdminDomainBlock adminDomainBlock = null;
Call<AdminDomainBlock> getDomainBlock = mastodonAdminService.getDomainAllow(token, id);
if (getDomainBlock != null) {
try {
Response<AdminDomainBlock> getDomainBlocksResponse = getDomainBlock.execute();
if (getDomainBlocksResponse.isSuccessful()) {
adminDomainBlock = getDomainBlocksResponse.body();
}
} catch (Exception e) {
e.printStackTrace();
}
}
Handler mainHandler = new Handler(Looper.getMainLooper());
AdminDomainBlock finalAdminDomainBlock = adminDomainBlock;
Runnable myRunnable = () -> adminDomainBlockMutableLiveData.setValue(finalAdminDomainBlock);
mainHandler.post(myRunnable);
}).start();
return adminDomainBlockMutableLiveData;
}
}

View file

@ -57,7 +57,7 @@ public class AppsVM extends AndroidViewModel {
super(application);
}
private MastodonAppsService init(String instance) {
private MastodonAppsService init(String instance) throws IllegalArgumentException {
Gson gson = new GsonBuilder().setDateFormat("yyyy-MM-dd'T'HH:mm:ssZ").create();
Retrofit retrofit = new Retrofit.Builder()
.baseUrl("https://" + instance + "/api/v1/")
@ -81,7 +81,13 @@ public class AppsVM extends AndroidViewModel {
String scopes,
String website) {
appMutableLiveData = new MutableLiveData<>();
MastodonAppsService mastodonAppsService = init(instance);
MastodonAppsService mastodonAppsService;
try {
mastodonAppsService = init(instance);
} catch (IllegalArgumentException e) {
appMutableLiveData.setValue(null);
return appMutableLiveData;
}
new Thread(() -> {
App app = null;
Call<App> appCall = mastodonAppsService.createApp(client_name, redirect_uris, scopes, website);

View file

@ -112,24 +112,24 @@ public class NotificationsVM extends AndroidViewModel {
if (notificationsResponse.isSuccessful()) {
List<Notification> notFiltered = notificationsResponse.body();
notifications.notifications = TimelineHelper.filterNotification(getApplication().getApplicationContext(), notFiltered);
addFetchMoreNotifications(notifications.notifications, notificationList, timelineParams);
notifications.pagination = MastodonHelper.getPagination(notificationsResponse.headers());
if (notifications.notifications != null && notifications.notifications.size() > 0) {
addFetchMoreNotifications(notifications.notifications, notificationList, timelineParams);
for (Notification notification : notifications.notifications) {
StatusCache statusCacheDAO = new StatusCache(getApplication().getApplicationContext());
StatusCache statusCache = new StatusCache();
statusCache.instance = timelineParams.instance;
statusCache.user_id = timelineParams.userId;
statusCache.notification = notification;
statusCache.slug = notification.type;
statusCache.type = Timeline.TimeLineEnum.NOTIFICATION;
statusCache.status_id = notification.id;
try {
statusCacheDAO.insertOrUpdate(statusCache, notification.type);
} catch (DBException e) {
e.printStackTrace();
if (notFiltered != null && notFiltered.size() > 0) {
for (Notification notification : notFiltered) {
StatusCache statusCacheDAO = new StatusCache(getApplication().getApplicationContext());
StatusCache statusCache = new StatusCache();
statusCache.instance = timelineParams.instance;
statusCache.user_id = timelineParams.userId;
statusCache.notification = notification;
statusCache.slug = notification.type;
statusCache.type = Timeline.TimeLineEnum.NOTIFICATION;
statusCache.status_id = notification.id;
try {
statusCacheDAO.insertOrUpdate(statusCache, notification.type);
} catch (DBException e) {
e.printStackTrace();
}
}
}
}
@ -146,41 +146,39 @@ public class NotificationsVM extends AndroidViewModel {
return notificationsMutableLiveData;
}
public LiveData<Notifications> getNotificationCache(List<Notification> notificationList, TimelinesVM.TimelineParams timelineParams) {
public LiveData<Notifications> getNotificationCache(List<Notification> timelineNotification, TimelinesVM.TimelineParams timelineParams) {
notificationsMutableLiveData = new MutableLiveData<>();
new Thread(() -> {
StatusCache statusCacheDAO = new StatusCache(getApplication().getApplicationContext());
Notifications notifications = null;
Notifications notifications = new Notifications();
List<Notification> notificationsDb;
try {
notifications = statusCacheDAO.getNotifications(timelineParams.excludeType, timelineParams.instance, timelineParams.userId, timelineParams.maxId, timelineParams.minId, timelineParams.sinceId);
if (notifications != null) {
if (notifications.notifications != null && notifications.notifications.size() > 0) {
if (notificationList != null) {
List<Notification> notPresentNotifications = new ArrayList<>();
for (Notification notification : notifications.notifications) {
if (!notificationList.contains(notification)) {
notification.cached = true;
notPresentNotifications.add(notification);
}
notificationsDb = statusCacheDAO.getNotifications(timelineParams.excludeType, timelineParams.instance, timelineParams.userId, timelineParams.maxId, timelineParams.minId, timelineParams.sinceId);
if (notificationsDb != null && notificationsDb.size() > 0) {
if (timelineNotification != null) {
List<Notification> notPresentNotifications = new ArrayList<>();
for (Notification notification : notificationsDb) {
if (!timelineNotification.contains(notification)) {
notification.cached = true;
notPresentNotifications.add(notification);
}
//Only not already present statuses are added
notifications.notifications = notPresentNotifications;
}
TimelineHelper.filterNotification(getApplication().getApplicationContext(), notifications.notifications);
if (notifications.notifications.size() > 0) {
addFetchMoreNotifications(notifications.notifications, notificationList, timelineParams);
notifications.pagination = new Pagination();
notifications.pagination.min_id = notifications.notifications.get(0).id;
notifications.pagination.max_id = notifications.notifications.get(notifications.notifications.size() - 1).id;
}
//Only not already present statuses are added
notificationsDb = notPresentNotifications;
}
notifications.notifications = TimelineHelper.filterNotification(getApplication().getApplicationContext(), notificationsDb);
if (notifications.notifications.size() > 0) {
addFetchMoreNotifications(notifications.notifications, timelineNotification, timelineParams);
notifications.pagination = new Pagination();
notifications.pagination.min_id = notifications.notifications.get(0).id;
notifications.pagination.max_id = notifications.notifications.get(notifications.notifications.size() - 1).id;
}
}
} catch (DBException e) {
e.printStackTrace();
}
Handler mainHandler = new Handler(Looper.getMainLooper());
Notifications finalNotifications = notifications;
Runnable myRunnable = () -> notificationsMutableLiveData.setValue(finalNotifications);
Runnable myRunnable = () -> notificationsMutableLiveData.setValue(notifications);
mainHandler.post(myRunnable);
}).start();
return notificationsMutableLiveData;

View file

@ -463,21 +463,21 @@ public class TimelinesVM extends AndroidViewModel {
StatusCache statusCacheDAO = new StatusCache(getApplication().getApplicationContext());
Statuses statuses = new Statuses();
try {
Statuses statusesDb = statusCacheDAO.geStatuses(timelineParams.slug, timelineParams.instance, timelineParams.userId, timelineParams.maxId, timelineParams.minId, timelineParams.sinceId);
if (statusesDb != null && statusesDb.statuses != null && statusesDb.statuses.size() > 0) {
List<Status> statusesDb = statusCacheDAO.geStatuses(timelineParams.slug, timelineParams.instance, timelineParams.userId, timelineParams.maxId, timelineParams.minId, timelineParams.sinceId);
if (statusesDb != null && statusesDb.size() > 0) {
if (timelineStatuses != null) {
List<Status> notPresentStatuses = new ArrayList<>();
for (Status status : statusesDb.statuses) {
for (Status status : statusesDb) {
if (!timelineStatuses.contains(status)) {
status.cached = true;
notPresentStatuses.add(status);
}
}
//Only not already present statuses are added
statusesDb.statuses = notPresentStatuses;
statusesDb = notPresentStatuses;
}
statuses.statuses = TimelineHelper.filterStatus(getApplication().getApplicationContext(), statusesDb.statuses, timelineParams.type);
if (statuses.statuses != null && statuses.statuses.size() > 0) {
statuses.statuses = TimelineHelper.filterStatus(getApplication().getApplicationContext(), statusesDb, timelineParams.type);
if (statuses.statuses.size() > 0) {
addFetchMore(statuses.statuses, timelineStatuses, timelineParams);
statuses.pagination = new Pagination();
statuses.pagination.min_id = statuses.statuses.get(0).id;
@ -528,21 +528,16 @@ public class TimelinesVM extends AndroidViewModel {
conversationListMutableLiveData = new MutableLiveData<>();
MastodonTimelinesService mastodonTimelinesService = init(timelineParams.instance);
new Thread(() -> {
Conversations conversations = null;
Conversations conversations = new Conversations();
Call<List<Conversation>> conversationsCall = mastodonTimelinesService.getConversations(timelineParams.token, timelineParams.maxId, timelineParams.sinceId, timelineParams.minId, timelineParams.limit);
if (conversationsCall != null) {
conversations = new Conversations();
try {
Response<List<Conversation>> conversationsResponse = conversationsCall.execute();
if (conversationsResponse.isSuccessful()) {
List<Conversation> conversationList = conversationsResponse.body();
conversations.conversations = conversationList;
conversations.conversations = conversationsResponse.body();
conversations.pagination = MastodonHelper.getPagination(conversationsResponse.headers());
if (conversationList != null && conversationList.size() > 0) {
addFetchMoreConversation(conversationList, conversationsTimeline, timelineParams);
if (conversations.conversations != null && conversations.conversations.size() > 0) {
addFetchMoreConversation(conversations.conversations, conversationsTimeline, timelineParams);
for (Conversation conversation : conversations.conversations) {
StatusCache statusCacheDAO = new StatusCache(getApplication().getApplicationContext());
StatusCache statusCache = new StatusCache();
@ -564,8 +559,7 @@ public class TimelinesVM extends AndroidViewModel {
}
}
Handler mainHandler = new Handler(Looper.getMainLooper());
Conversations finalConversations = conversations;
Runnable myRunnable = () -> conversationListMutableLiveData.setValue(finalConversations);
Runnable myRunnable = () -> conversationListMutableLiveData.setValue(conversations);
mainHandler.post(myRunnable);
}).start();
@ -577,36 +571,34 @@ public class TimelinesVM extends AndroidViewModel {
conversationListMutableLiveData = new MutableLiveData<>();
new Thread(() -> {
StatusCache statusCacheDAO = new StatusCache(getApplication().getApplicationContext());
Conversations conversations = null;
Conversations conversations = new Conversations();
try {
conversations = statusCacheDAO.getConversations(timelineParams.instance, timelineParams.userId, timelineParams.maxId, timelineParams.minId, timelineParams.sinceId);
if (conversations != null) {
if (conversations.conversations != null && conversations.conversations.size() > 0) {
if (timelineConversations != null) {
List<Conversation> notPresentConversations = new ArrayList<>();
for (Conversation conversation : conversations.conversations) {
if (!timelineConversations.contains(conversation)) {
conversation.cached = true;
timelineConversations.add(conversation);
}
List<Conversation> conversationsDb = statusCacheDAO.getConversations(timelineParams.instance, timelineParams.userId, timelineParams.maxId, timelineParams.minId, timelineParams.sinceId);
if (conversationsDb != null && conversationsDb.size() > 0) {
if (timelineConversations != null) {
List<Conversation> notPresentConversations = new ArrayList<>();
for (Conversation conversation : conversationsDb) {
if (!timelineConversations.contains(conversation)) {
conversation.cached = true;
timelineConversations.add(conversation);
}
//Only not already present statuses are added
conversations.conversations = notPresentConversations;
}
if (conversations.conversations.size() > 0) {
addFetchMoreConversation(conversations.conversations, timelineConversations, timelineParams);
conversations.pagination = new Pagination();
conversations.pagination.min_id = conversations.conversations.get(0).id;
conversations.pagination.max_id = conversations.conversations.get(conversations.conversations.size() - 1).id;
}
//Only not already present statuses are added
conversationsDb = notPresentConversations;
}
conversations.conversations = conversationsDb;
if (conversations.conversations.size() > 0) {
addFetchMoreConversation(conversations.conversations, timelineConversations, timelineParams);
conversations.pagination = new Pagination();
conversations.pagination.min_id = conversations.conversations.get(0).id;
conversations.pagination.max_id = conversations.conversations.get(conversations.conversations.size() - 1).id;
}
}
} catch (DBException e) {
e.printStackTrace();
}
Handler mainHandler = new Handler(Looper.getMainLooper());
Conversations finalConversations = conversations;
Runnable myRunnable = () -> conversationListMutableLiveData.setValue(finalConversations);
Runnable myRunnable = () -> conversationListMutableLiveData.setValue(conversations);
mainHandler.post(myRunnable);
}).start();
return conversationListMutableLiveData;
@ -669,22 +661,24 @@ public class TimelinesVM extends AndroidViewModel {
public LiveData<List<MastodonList>> getLists(@NonNull String instance, String token) {
mastodonListListMutableLiveData = new MutableLiveData<>();
MastodonTimelinesService mastodonTimelinesService = init(instance);
List<MastodonList> mastodonListList = new ArrayList<>();
new Thread(() -> {
List<MastodonList> mastodonListList = null;
Call<List<MastodonList>> getListsCall = mastodonTimelinesService.getLists(token);
if (getListsCall != null) {
try {
Response<List<MastodonList>> getListsResponse = getListsCall.execute();
if (getListsResponse.isSuccessful()) {
mastodonListList = getListsResponse.body();
List<MastodonList> mastodonLists = getListsResponse.body();
if (mastodonLists != null) {
mastodonListList.addAll(mastodonLists);
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
Handler mainHandler = new Handler(Looper.getMainLooper());
List<MastodonList> finalMastodonListList = mastodonListList;
Runnable myRunnable = () -> mastodonListListMutableLiveData.setValue(finalMastodonListList);
Runnable myRunnable = () -> mastodonListListMutableLiveData.setValue(mastodonListList);
mainHandler.post(myRunnable);
}).start();
return mastodonListListMutableLiveData;

View file

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

View file

@ -0,0 +1,15 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="#FFFFFF"
android:viewportWidth="24"
android:viewportHeight="24">
<group
android:rotation="0"
android:scaleY="-1"
android:translateY="24.0">
<path
android:fillColor="@android:color/white"
android:pathData="M10,18h4v-2h-4v2zM3,6v2h18L21,6L3,6zM6,13h12v-2L6,11v2z" />
</group>
</vector>

View file

@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="#FFFFFF"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="@android:color/white"
android:pathData="M10,18h4v-2h-4v2zM3,6v2h18L21,6L3,6zM6,13h12v-2L6,11v2z" />
</vector>

View file

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

View file

@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="#FFFFFF"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="@android:color/white"
android:pathData="M15.73,3L8.27,3L3,8.27v7.46L8.27,21h7.46L21,15.73L21,8.27L15.73,3zM12,17.3c-0.72,0 -1.3,-0.58 -1.3,-1.3 0,-0.72 0.58,-1.3 1.3,-1.3 0.72,0 1.3,0.58 1.3,1.3 0,0.72 -0.58,1.3 -1.3,1.3zM13,13h-2L11,7h2v6z" />
</vector>

View file

@ -71,6 +71,22 @@
app:iconTint="@color/cyanea_accent_dark_reference"
app:strokeColor="@color/cyanea_accent_dark_reference" />
<com.google.android.material.button.MaterialButton
android:id="@+id/domain_block"
style="@style/Widget.MaterialComponents.Button.OutlinedButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:paddingVertical="12dp"
android:text="@string/blocked_domains"
android:textAlignment="textStart"
android:textColor="@color/cyanea_accent_dark_reference"
app:icon="@drawable/ic_baseline_navigate_next_24"
app:iconGravity="end"
app:iconTint="@color/cyanea_accent_dark_reference"
app:strokeColor="@color/cyanea_accent_dark_reference" />
</androidx.appcompat.widget.LinearLayoutCompat>
<androidx.fragment.app.FragmentContainerView

View file

@ -41,6 +41,20 @@
app:iconTint="@color/cyanea_accent_dark_reference"
app:strokeColor="@color/cyanea_accent_dark_reference" />
<com.google.android.material.button.MaterialButton
android:id="@+id/domains"
style="@style/Widget.MaterialComponents.Button.OutlinedButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:paddingVertical="12dp"
android:text="@string/blocked_domains"
android:textAlignment="textStart"
android:textColor="@color/cyanea_accent_dark_reference"
app:icon="@drawable/ic_baseline_navigate_next_24"
app:iconGravity="end"
app:iconTint="@color/cyanea_accent_dark_reference"
app:strokeColor="@color/cyanea_accent_dark_reference" />
</androidx.appcompat.widget.LinearLayoutCompat>

View file

@ -0,0 +1,162 @@
<?xml version="1.0" encoding="utf-8"?><!--
Copyright 20222 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>.
-->
<androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="10dp">
<androidx.appcompat.widget.AppCompatEditText
android:id="@+id/domain"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/domain"
android:importantForAutofill="noExcludeDescendants"
android:inputType="text"
android:singleLine="true" />
<androidx.appcompat.widget.AppCompatTextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/admin_domainblock_domain"
android:textSize="12sp" />
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/severity" />
<androidx.appcompat.widget.AppCompatSpinner
android:id="@+id/severity"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="30dp" />
</androidx.appcompat.widget.LinearLayoutCompat>
<androidx.appcompat.widget.AppCompatTextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/admin_domainblock_severity"
android:textSize="12sp" />
<com.google.android.material.checkbox.MaterialCheckBox
android:id="@+id/reject_media"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:layout_weight="1"
android:text="@string/admin_reject_media"
app:buttonTint="@color/cyanea_accent_dark_reference" />
<androidx.appcompat.widget.AppCompatTextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/admin_domainblock_reject_media"
android:textSize="12sp" />
<com.google.android.material.checkbox.MaterialCheckBox
android:id="@+id/reject_reports"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:layout_weight="1"
android:text="@string/admin_reject_reports"
app:buttonTint="@color/cyanea_accent_dark_reference" />
<androidx.appcompat.widget.AppCompatTextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/admin_domainblock_reject_reports"
android:textSize="12sp" />
<com.google.android.material.checkbox.MaterialCheckBox
android:id="@+id/obfuscate"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:layout_weight="1"
android:text="@string/admin_reject_obfuscate"
app:buttonTint="@color/cyanea_accent_dark_reference" />
<androidx.appcompat.widget.AppCompatTextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/admin_domainblock_reject_obfuscate"
android:textSize="12sp" />
<androidx.appcompat.widget.AppCompatEditText
android:id="@+id/private_comment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:hint="@string/private_comment"
android:importantForAutofill="noExcludeDescendants"
android:inputType="text"
android:singleLine="true" />
<androidx.appcompat.widget.AppCompatTextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/admin_domainblock_private_comment"
android:textSize="12sp" />
<androidx.appcompat.widget.AppCompatEditText
android:id="@+id/public_comment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:hint="@string/public_comment"
android:importantForAutofill="noExcludeDescendants"
android:inputType="text"
android:singleLine="true" />
<androidx.appcompat.widget.AppCompatTextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/admin_domainblock_public_comment"
android:textSize="12sp" />
<com.google.android.material.button.MaterialButton
android:id="@+id/save_changes"
style="@style/Widget.MaterialComponents.Button.OutlinedButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="end"
android:layout_marginTop="10dp"
android:text="@string/save_changes"
android:textColor="@color/cyanea_accent_dark_reference"
app:icon="@drawable/ic_check_white_24dp"
app:iconTint="@color/cyanea_accent_dark_reference"
app:strokeColor="@color/cyanea_accent_dark_reference" />
</androidx.appcompat.widget.LinearLayoutCompat>
</androidx.core.widget.NestedScrollView>

View file

@ -87,8 +87,7 @@
android:gravity="center"
android:padding="10dp"
android:text="@string/no_draft"
android:textSize="20sp"
android:typeface="serif" />
android:textSize="20sp" />
</RelativeLayout>
<!-- Main Loader -->

View file

@ -26,8 +26,7 @@
android:gravity="center"
android:padding="10dp"
android:text="@string/action_filters_empty_content"
android:textSize="20sp"
android:typeface="serif" />
android:textSize="20sp" />
</RelativeLayout>
<!-- Main Loader -->
<RelativeLayout

View file

@ -22,7 +22,6 @@
android:text="@string/action_followed_tag_empty"
android:textSize="20sp"
android:textStyle="bold"
android:typeface="serif"
android:visibility="gone" />
<androidx.fragment.app.FragmentContainerView

View file

@ -23,7 +23,7 @@
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/main_container"
android:layout_width="match_parent"
android:layout_height="420dp"
android:layout_height="wrap_content"
android:padding="@dimen/fab_margin"
android:paddingLeft="@dimen/drawer_padding"
android:paddingRight="@dimen/drawer_padding">
@ -36,7 +36,7 @@
<androidx.appcompat.widget.LinearLayoutCompat
android:id="@+id/instance_container"
android:layout_width="match_parent"
android:layout_height="300dp"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:orientation="vertical"
app:layout_constraintTop_toTopOf="parent">
@ -118,7 +118,7 @@
<RelativeLayout
android:id="@+id/loader"
android:layout_width="match_parent"
android:layout_height="420dp"
android:layout_height="wrap_content"
android:gravity="center"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
@ -144,22 +144,47 @@
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/close"
style="@style/Widget.AppCompat.Button.Colored"
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/tos"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_gravity="center"
android:text="@string/close"
android:textAllCaps="false"
android:textColor="@color/white"
android:layout_marginTop="10dp"
android:text="@string/action_about_instance"
android:textSize="16sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/max_char_container" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/privacy"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:text="@string/action_privacy_policy"
android:textSize="16sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tos" />
<com.google.android.material.button.MaterialButton
android:id="@+id/close"
style="@style/Widget.MaterialComponents.Button.OutlinedButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:paddingVertical="12dp"
android:text="@string/close"
android:textAlignment="textStart"
android:textColor="@color/cyanea_accent_dark_reference"
app:layout_constraintTop_toBottomOf="@+id/privacy"
android:textAllCaps="false"
android:textSize="16sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:strokeColor="@color/cyanea_accent_dark_reference" />
</androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView>

View file

@ -22,7 +22,6 @@
android:text="@string/action_lists_empty"
android:textSize="20sp"
android:textStyle="bold"
android:typeface="serif"
android:visibility="gone" />
<androidx.fragment.app.FragmentContainerView

View file

@ -63,8 +63,7 @@
android:layout_gravity="center"
android:gravity="center"
android:padding="10dp"
android:textSize="20sp"
android:typeface="serif" />
android:textSize="20sp" />
</RelativeLayout>

View file

@ -0,0 +1,31 @@
<?xml version="1.0" encoding="utf-8"?><!--
Copyright 2022 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>.
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<androidx.fragment.app.FragmentContainerView
android:id="@+id/nav_host_fragment_suggestions"
android:name="androidx.navigation.fragment.NavHostFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:defaultNavHost="true"
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
</LinearLayout>

View file

@ -0,0 +1,57 @@
<?xml version="1.0" encoding="utf-8"?><!--
Copyright 2022 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>.
-->
<androidx.appcompat.widget.LinearLayoutCompat xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:id="@+id/main_container"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="10dp">
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/title"
style="@style/TextAppearance.AppCompat.Title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:text="example.net" />
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:orientation="horizontal">
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/severity"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textSize="16sp"
tools:text="stable" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/date"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="end"
android:textSize="16sp"
tools:text="@tools:sample/date/ddmmyy" />
</androidx.appcompat.widget.LinearLayoutCompat>
</androidx.appcompat.widget.LinearLayoutCompat>

View file

@ -0,0 +1,53 @@
<?xml version="1.0" encoding="utf-8"?><!--
Copyright 2022 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>.
-->
<com.google.android.material.card.MaterialCardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="12dp"
android:backgroundTint="@color/cyanea_primary_dark_reference"
app:cardElevation="0dp">
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingStart="@dimen/fab_margin"
android:paddingTop="5dp"
android:paddingEnd="@dimen/fab_margin">
<TextView
android:id="@+id/domain_name"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textSize="18sp" />
<com.google.android.material.button.MaterialButton
android:id="@+id/unblock_domain"
style="@style/Widget.App.Button.IconOnly.Outline"
android:layout_width="36dp"
android:layout_height="36dp"
android:layout_marginStart="5dp"
android:contentDescription="@string/unblock_domain"
android:padding="6dp"
app:icon="@drawable/ic_baseline_delete_24"
app:iconTint="@color/cyanea_accent_dark_reference"
app:strokeColor="@color/cyanea_accent_dark_reference" />
</androidx.appcompat.widget.LinearLayoutCompat>
</com.google.android.material.card.MaterialCardView>

View file

@ -148,7 +148,7 @@
android:layout_marginStart="6dp"
android:layout_weight="1"
android:ellipsize="end"
android:maxLines="1"
android:singleLine="true"
tools:text="@tools:sample/full_names" />
<androidx.appcompat.widget.AppCompatImageView

View file

@ -30,14 +30,14 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:padding="5dp">
android:padding="3dp">
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/filtered_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:textSize="18sp"
android:textSize="16sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/display_button"
app:layout_constraintStart_toStartOf="parent"

View file

@ -0,0 +1,109 @@
<?xml version="1.0" encoding="utf-8"?><!--
Copyright 2021 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>
-->
<com.google.android.material.card.MaterialCardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="6dp"
android:layout_marginTop="6dp"
android:backgroundTint="@color/cyanea_primary_dark_reference"
app:cardElevation="0dp">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="6dp">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/avatar"
android:layout_width="56dp"
android:layout_height="56dp"
android:scaleType="fitCenter"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:src="@drawable/ic_person" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/display_name"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="6dp"
android:textAppearance="@style/TextAppearance.MaterialComponents.Body1"
app:layout_constraintBottom_toTopOf="@id/username"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/avatar"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_chainStyle="packed"
tools:text="@tools:sample/full_names" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/username"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="6dp"
android:ellipsize="end"
android:singleLine="true"
app:layout_constraintBottom_toBottomOf="@id/avatar"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/avatar"
app:layout_constraintTop_toBottomOf="@id/display_name"
tools:text="\@username@instance.test" />
<com.google.android.material.textview.MaterialTextView
android:id="@+id/bio"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:ellipsize="end"
android:maxLines="2"
android:textAppearance="@style/TextAppearance.MaterialComponents.Caption"
app:layout_constraintTop_toBottomOf="@id/avatar"
tools:text="@tools:sample/lorem/random" />
<com.google.android.material.button.MaterialButton
android:id="@+id/not_interested"
style="@style/Widget.MaterialComponents.Button.OutlinedButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="6dp"
android:text="@string/not_interested"
android:textColor="@color/cyanea_accent_dark_reference"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/bio"
app:strokeColor="@color/cyanea_accent_dark_reference" />
<com.google.android.material.button.MaterialButton
android:id="@+id/follow_action"
style="@style/Widget.MaterialComponents.Button"
android:layout_width="36dp"
android:layout_height="36dp"
android:layout_marginStart="12dp"
android:layout_marginTop="6dp"
android:insetTop="0dp"
android:insetBottom="0dp"
android:padding="6dp"
app:icon="@drawable/ic_baseline_person_add_24"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/bio" />
</androidx.constraintlayout.widget.ConstraintLayout>
</com.google.android.material.card.MaterialCardView>

View file

@ -17,6 +17,7 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_height="match_parent">
<!-- Listview status -->
@ -55,8 +56,7 @@
android:gravity="center"
android:padding="10dp"
android:text="@string/no_status"
android:textSize="20sp"
android:typeface="serif" />
android:textSize="20sp" />
</RelativeLayout>
<!-- Main Loader -->
@ -93,4 +93,17 @@
</RelativeLayout>
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/add_action"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:layout_margin="@dimen/fab_margin"
android:contentDescription="@string/create_domain_block"
android:src="@drawable/ic_baseline_add_24"
android:visibility="gone"
app:backgroundTint="@color/cyanea_accent_dark_reference"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
</RelativeLayout>

View file

@ -46,8 +46,7 @@
android:gravity="center"
android:padding="10dp"
android:text="@string/no_scheduled_toots"
android:textSize="20sp"
android:typeface="serif" />
android:textSize="20sp" />
</RelativeLayout>
<!-- Main Loader -->

View file

@ -109,6 +109,22 @@
android:layout_height="wrap_content"
android:text="@string/notif_display_updates"
app:icon="@drawable/ic_baseline_edit_24" />
<com.google.android.material.button.MaterialButton
android:id="@+id/display_signups"
style="@style/Widget.App.Button.IconOnly"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/sign_ups"
app:icon="@drawable/ic_baseline_person_add_alt_1_24" />
<com.google.android.material.button.MaterialButton
android:id="@+id/display_reports"
style="@style/Widget.App.Button.IconOnly"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/reports"
app:icon="@drawable/ic_baseline_report_24" />
</com.google.android.material.button.MaterialButtonToggleGroup>

View file

@ -58,7 +58,11 @@
android:icon="@drawable/ic_baseline_trending_up_24"
android:title="@string/trending"
android:visible="true" />
<item
android:id="@+id/nav_suggestions"
android:icon="@drawable/ic_baseline_account_circle_24"
android:title="@string/Suggestions"
android:visible="true" />
<item
android:id="@+id/nav_about_instance"
android:icon="@drawable/ic_info_outline_white_24dp"

View file

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:id="@+id/action_delete"
android:icon="@drawable/ic_baseline_delete_24"
android:title="@string/delete"
app:showAsAction="ifRoom" />
</menu>

View file

@ -1,6 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:id="@+id/action_order"
android:icon="@drawable/ic_baseline_filter_desc_24"
android:title="@string/order_lists"
app:showAsAction="always" />
<item
android:id="@+id/action_add_list"
android:icon="@drawable/ic_baseline_playlist_add_24"

View file

@ -83,5 +83,8 @@
android:id="@+id/action_mention"
android:title="@string/more_action_7"
app:showAsAction="never" />
<item
android:id="@+id/action_open_with"
android:title="@string/open_with_account"
app:showAsAction="never" />
</menu>

View file

@ -17,19 +17,19 @@
<string name="password">Heslo</string>
<string name="email">Email</string>
<string name="accounts">Účty</string>
<string name="toots">Tooty</string>
<string name="toots">Zprávy</string>
<string name="tags">Štítky</string>
<string name="save">Uložit</string>
<string name="instance">Instance</string>
<string name="instance_example">Instance: mastodon.social</string>
<string name="toast_account_changed" formatted="false">Nyní používáte účet %1$s</string>
<string name="add_account">Přidat účet</string>
<string name="clipboard">Obsah tootu byl zkopírován do schránky</string>
<string name="clipboard_url">Adresa tootu byla zkopírována do schránky</string>
<string name="clipboard">Obsah zprávy byl zkopírován do schránky</string>
<string name="clipboard_url">Adresa zprávy byla zkopírována do schránky</string>
<string name="camera">Fotoaparát</string>
<string name="delete_all">Smazat všechno</string>
<string name="schedule">Naplánovat</string>
<string name="text_size">Velikost textu a ikony</string>
<string name="text_size">Velikost textu</string>
<string name="next">Další</string>
<string name="previous">Předchozí</string>
<string name="open_with">Otevřít čím</string>
@ -57,17 +57,17 @@
<string name="follow_request">Žádost o sledování</string>
<string name="settings">Nastavení</string>
<string name="send_email">Poslat e-mail</string>
<string name="scheduled_toots">Naplánované tooty</string>
<string name="scheduled_toots">Naplánované zprávy</string>
<string name="disclaimer_full">Níže uvedené informace mohou popisovat uživatelský profil neúplně.</string>
<string name="insert_emoji">Vložit smajlík</string>
<string name="no_emoji">Aplikace prozatím nenačetla uživatelské smajlíky.</string>
<string name="logout_account_confirmation">Are you sure you want to logout @%1$s@%2$s?</string>
<!-- Status -->
<string name="no_status">Žádné tooty k zobrazení</string>
<string name="favourite_add">Přidat tento toot k oblíbeným?</string>
<string name="favourite_remove">Odstranit tento toot z oblíbených?</string>
<string name="reblog_add">Boostnout tento toot?</string>
<string name="reblog_remove">Zrušit boost?</string>
<string name="no_status">Žádné zprávy k zobrazení</string>
<string name="favourite_add">Přidat tuto zprávu k oblíbeným\?</string>
<string name="favourite_remove">Odstranit tuto zprávu z oblíbených\?</string>
<string name="reblog_add">Boostnout tuto zprávu\?</string>
<string name="reblog_remove">Zrušit boost\?</string>
<string name="more_action_1">Ztlumit</string>
<string name="more_action_2">Blokovat</string>
<string name="more_action_3">Nahlásit</string>
@ -130,8 +130,8 @@
<!-- TOOT -->
<string name="toot_select_image_error">Nastala chyba při výběru média!</string>
<string name="toot_delete_media">Smazat médium?</string>
<string name="toot_error_no_content">Váš toot je prázdný!</string>
<string name="toot_sent">Toot byl odeslán!</string>
<string name="toot_error_no_content">Vaše zpráva je prázdná!</string>
<string name="toot_sent">Zpráva byla odeslána!</string>
<string name="toot_sensitive">Citlivý obsah?</string>
<string name="no_draft">Žádné koncepty!</string>
<string name="choose_accounts">Vyberte účet</string>
@ -151,14 +151,15 @@
<!-- Accounts -->
<string name="no_accounts">Žádný účet k zobrazení</string>
<string name="no_follow_request">Není požadavek ke sledování</string>
<string name="status_cnt">Tooty \n %1$s</string>
<string name="status_cnt">Zprávy
\n %1$s</string>
<string name="following_cnt">Sleduji \n %1$s</string>
<string name="followers_cnt">Sledující \n %1$s</string>
<string name="reject">Odmítnout</string>
<!-- Scheduled toots -->
<string name="no_scheduled_toots">Žádné naplánované tooty k zobrazení!</string>
<string name="remove_scheduled">Odstranit naplánovaný toot?</string>
<string name="toot_scheduled">Toot byl naplánován!</string>
<string name="no_scheduled_toots">Žádné naplánované zprávy k zobrazení!</string>
<string name="remove_scheduled">Odstranit naplánovanou zprávu\?</string>
<string name="toot_scheduled">Zpráva byla naplánována!</string>
<string name="toot_scheduled_date">Plánované datum musí být vyšší než aktuální hodina!</string>
<!-- timed mute -->
<string name="timed_mute_date_error">Časový interval pro ztlumení musí být vyšší než jedna minuta.</string>
@ -184,10 +185,10 @@
<string name="toast_unmute">Účet není nadále ztlumen!</string>
<string name="toast_follow">Účet je sledován!</string>
<string name="toast_unfollow">Účet není nadále sledován!</string>
<string name="toast_reblog">Toot byl boostnut!</string>
<string name="toast_unreblog">Toot již není boostnut!</string>
<string name="toast_favourite">Toot byl přidán k oblíbeným!</string>
<string name="toast_unfavourite">Toot byl odstraněn z oblíbených!</string>
<string name="toast_reblog">Zpráva byla boostnuta!</string>
<string name="toast_unreblog">Zpráva již není boostnuta!</string>
<string name="toast_favourite">Zpráva byla přidána k oblíbeným!</string>
<string name="toast_unfavourite">Zpráva byla odstraněna z oblíbených!</string>
<string name="toast_error">Oops! Došlo k chybě!</string>
<string name="toast_code_error">Došlo k chybě! Instance nevrátila autorizační kód!</string>
<string name="toast_error_instance">Tato doména není platná!</string>
@ -196,7 +197,7 @@
<string name="nothing_to_do">Nelze vykonat akci</string>
<string name="toast_error_translate">Při překladu došlo k chybě!</string>
<!-- Settings -->
<string name="set_toots_page">Počet tootů pro jedno nahrání</string>
<string name="set_toots_page">Počet zpráv pro jedno nahrání</string>
<string name="set_disable_gif">Zakázat GIF avatary</string>
<string name="set_notif_follow">Oznámení v případě sledování</string>
<string name="set_notif_follow_share">Oznámení v případě boostnutí vašeho tootu</string>
@ -275,7 +276,7 @@
<string name="poxy_port">Port</string>
<string name="poxy_login">Přihlašovací jméno</string>
<string name="poxy_password">Heslo</string>
<string name="set_share_details">Přidat podrobnosti tootu při sdílení</string>
<string name="set_share_details">Přidat podrobnosti zprávy při sdílení</string>
<string name="support_the_app_on_liberapay">Podpořit aplikaci na Liberapay</string>
<string name="alert_regex">Chyba v regulárním výrazu!</string>
<string name="toast_instance_unavailable">Časová osa nenalezena na této instanci!</string>
@ -296,7 +297,7 @@
<string name="context_conversation">Konverzace</string>
<string name="filter_keyword_explanations">Velikost písmen ani varování o obsahu nebudou brána v potaz</string>
<string name="context_drop">Zahodit místo skrytí</string>
<string name="context_drop_explanations">Filtrované tooty zmizí nezvratně i v případě, že je filtr později odstraněn</string>
<string name="context_drop_explanations">Filtrované zprávy zmizí nezvratně i v případě, že je filtr později odstraněn</string>
<string name="context_whole_word_explanations">V případě, že klíčové slovo nebo fráze je pouze alfanumerické, filtr se uplatní pouze pokud odpovídá celému slovu</string>
<string name="context_whole_word">Celé slovo</string>
<string name="filter_context">Kontext filtru</string>
@ -311,7 +312,7 @@
<string name="channel_notif_fav">Nové oblíbení</string>
<string name="channel_notif_mention">Nová zmínka</string>
<string name="channel_notif_poll">Anketa skončila</string>
<string name="channel_notif_backup">Záloha tootů</string>
<string name="channel_notif_backup">Záloha zpráv</string>
<string name="channel_notif_status">New posts</string>
<string name="channel_notif_media">Stahování médií</string>
<string name="select_sound">Vybrat tón</string>
@ -323,11 +324,11 @@
<string name="peertube_instance">Peertube instance</string>
<string name="set_display_emoji">Použít Emoji One</string>
<string name="information">Informace</string>
<string name="set_display_card">Zobrazit náhled ve všech tootech</string>
<string name="set_display_card">Zobrazit náhled ve všech zprávách</string>
<string name="account_id_clipbloard">Identifikátor účtu byl zkopírován do schránky!</string>
<string name="set_change_locale">Změna jazyka</string>
<string name="truncate_long_toots">Ořezat dlouhé tooty</string>
<string name="set_truncate_toot">Ořezat tooty delší než \'x\' řádků. 0 znamená vypnuto.</string>
<string name="truncate_long_toots">Ořezat dlouhé zprávy</string>
<string name="set_truncate_toot">Ořezat zprávy delší než \'x\' řádků. 0 znamená vypnuto.</string>
<string name="display_toot_truncate">Zobrazit více</string>
<string name="hide_toot_truncate">Zobrazit méně</string>
<string name="tags_already_stored">Štítek již existuje!</string>
@ -373,8 +374,8 @@
<string name="category">Kategorie</string>
<string name="description">Popis</string>
<string name="share">Sdílet</string>
<string name="toots_server">Tooty (Server)</string>
<string name="toots_client">Tooty (zařízení)</string>
<string name="toots_server">Zprávy (Server)</string>
<string name="toots_client">Zprávy (Zařízení)</string>
<string name="settings_category_label_timelines">Časové osi</string>
<string name="settings_category_label_interface">Rozhraní</string>
<string name="contact">Kontakty</string>
@ -400,7 +401,7 @@
<string name="settings_category_notif_categories">Kategorie</string>
<string name="move_timeline">Přesunout časovou osu</string>
<string name="hide_timeline">Skrýt časovou osu</string>
<string name="reorder_timelines">Změnit pořadí časových os</string>
<string name="reorder_timelines">Spravovat časové osy</string>
<string name="reorder_list_deleted">Seznam trvale smazán</string>
<string name="reorder_instance_removed">Sledovaná instance odstraněna</string>
<string name="reorder_tag_removed">Připnuté značky odstraněny</string>
@ -725,4 +726,14 @@
<string name="permission_missing">Oprávnění nebylo uděleno!</string>
<string name="delete_cache_message">Opravdu chcete vymazat cache\? Pokud máte koncepty s médii, budou přiložená média ztracena.</string>
<string name="set_timelines_in_a_list_title">Časové osy v seznamu</string>
<string name="post_message">Odesílání zprávy…</string>
<string name="post_message_text">Odesílání zprávy %d/%d</string>
<string name="is_up">Běží!</string>
<string name="is_down">Neběží!</string>
<string name="instance_health_indication">verze: %s
\n %s uživatelů - %s statusů</string>
<string name="remove_status">Odebrat status</string>
<string name="report_indication_title_status_more">Vybrat nejlepší shodu</string>
<string name="instance_health_checkedat">Zkontrolováno: %s</string>
<string name="add_status">Přidat status</string>
</resources>

View file

@ -393,7 +393,7 @@
<string name="settings_category_notif_categories">Kategorien</string>
<string name="move_timeline">Zeitleiste verschieben</string>
<string name="hide_timeline">Zeitleiste ausblenden</string>
<string name="reorder_timelines">Zeitleiste neu anordnen</string>
<string name="reorder_timelines">Verwaltung von Zeitleisten</string>
<string name="reorder_list_deleted">Liste endgültig gelöscht</string>
<string name="reorder_instance_removed">Gefolgte Instanz entfernt</string>
<string name="reorder_tag_removed">Angeheftetes Schlagwort entfernt</string>
@ -718,7 +718,7 @@
<string name="delete_cache_message">Sind Sie sich sicher, den Cache zu leeren\? Wenn Sie Entwürfe mit Bildern, etc haben, werden die angehängten Dateien gelöscht.</string>
<string name="msg_save_image">Verlassen, ohne das Bild zu speichern\?</string>
<string name="label_shape">Form</string>
<string name="domain">Domain</string>
<string name="domain">Domäne</string>
<string name="staff">Personal</string>
<string name="message_language">Nachrichtensprache</string>
<string name="my_instance">Meine Instanz</string>
@ -770,4 +770,104 @@
<string name="push_distributors">Push-Dienst</string>
<string name="toast_token">Die App konnte kein Token abrufen</string>
<string name="edit_message">Nachricht bearbeiten</string>
<string name="action_pinned_delete">Angepinnte Zeitleisten löschen\?</string>
<string name="notif_submitted_report">Bericht eingereicht</string>
<string name="action_privacy_policy">Datenschutz-Bestimmungen</string>
<string name="unpin_timeline">Die angepinnte Zeitleiste entfernen\?</string>
<string name="unpin_timeline_description">Bist Du sicher, dass diese Zeitleiste nicht mehr angepinnt sein soll\?</string>
<string name="blocked_domains">Geblockte Domänen</string>
<string name="full_date_edited">%1$s bearbeitet %2$s</string>
<string name="unblock_domain">Domäne freigeben</string>
<string name="no_blocked_domains">Du hast keine geblockten Domänen</string>
<string name="unblock_domain_confirm">Sicher, dass Du %1$s wieder freigeben willst\?</string>
<string name="Suggestions">Vorschläge</string>
<string name="not_interested">Nicht interessiert</string>
<string name="unassign">Zuweisung aufheben</string>
<string name="mark_unresolved">Als ungelöst markieren</string>
<string name="account_warned">Konto verwarnt</string>
<string name="account_unsuspended">Konto-Sperrung aufgehoben</string>
<string name="account_suspended">Konto gesperrt</string>
<string name="mark_resolved">Als gelöst markieren</string>
<string name="account_rejected">Konto abgelehnt</string>
<string name="account_approved">Konto genehmigt</string>
<string name="report">Meldung</string>
<string name="display_media_notification_summary">Medien in Benachrichtigungen für Reblogs und Favoriten werden angezeigt</string>
<string name="set_live_translate">Übersetzung in eine spezifische Sprache erzwingen. Wähle den ersten Wert um die Einstellungen zurückzusetzen</string>
<string name="status_history">Nachrichten-Verlauf</string>
<string name="edited_message_at">Bearbeitet am %1$s</string>
<string name="created_message_at">Erstellt am %1$s</string>
<string name="set_unlisted_replies">Nicht angezeigte Antworten</string>
<string name="notification_remove_from_cache">Benachrichtigungen wurden aus dem Zwischenspeicher entfernt.</string>
<string name="email_status">eMail-Status</string>
<string name="joined">Beigetreten</string>
<string name="recent_ip">Aktuelle IP</string>
<string name="allow">Erlauben</string>
<string name="warn">Warnen</string>
<string name="email_user">Benutzer per eMail benachrichtigen</string>
<string name="custom_warning">Benutzerdefinierte Warnung</string>
<string name="list_reported_statuses">Status von Meldungen</string>
<string name="silenced">Stummgeschaltet</string>
<string name="user">Benutzer</string>
<string name="moderator">Moderator</string>
<string name="administrator">Administrator</string>
<string name="confirmed">Bestätigt</string>
<string name="unconfirmed">Unbestätigt</string>
<string name="assign_to_me">Mir zuweisen</string>
<string name="account_disabled">Konto deaktiviert</string>
<string name="account_unsilenced">Konto nicht stummgeschaltet</string>
<string name="account_silenced">Konto stummgeschaltet</string>
<string name="restart_the_app">App neu starten\?</string>
<string name="restart">Neustart</string>
<string name="restart_the_app_theme">Du solltest die App neu starten um die Änderungen anzuwenden.</string>
<string name="action_followed_tag_empty">Du folgst bisher keinen Tags!</string>
<string name="action_unfollow_tag">Tag nicht mehr folgen</string>
<string name="action_unfollow_tag_confirm">Bist Du sicher dass Du diesem Tag nicht mehr folgen willst\?</string>
<string name="unfollow">Nicht mehr folgen</string>
<string name="action_tag_follow">Tag folgen</string>
<string name="write_the_tag_to_follow">Schreibe den Tag dem Du folgen willst</string>
<string name="followed_tags">Gefolgte Tags</string>
<string name="follow_tag">Tag folgen</string>
<string name="aggregate_notifications_summary">Falls aktiv wird die App alle zusammenhängenden Benachrichtigungen einklappen</string>
<string name="action_lists_edit">Liste bearbeiten</string>
<string name="profiles">Profile</string>
<string name="toast_feature_not_supported">Deine Instanz scheint diese Funktion nicht zu unterstützen!</string>
<string name="watch_trends_for_instance">Erkunde Trends dieser Instanz</string>
<string name="notif_update">Nachricht bearbeiten</string>
<string name="notif_display_updates">Aktualisierungen</string>
<string name="hide_with_warning">Mit Warnung verstecken</string>
<string name="hide_completely">Vollständig verstecken</string>
<string name="hide_completely_description">Den gefilterten Inhalt komplett verstecken und so verhalten als ob dieser nie existiert hätte</string>
<string name="context_home_list">Start und Listen</string>
<string name="title">Titel</string>
<string name="keyword_or_phrase">Schlagwort oder Satz</string>
<string name="delete_keyword">Schlagwort löschen</string>
<string name="add_keyword">Schlagwort hinzufügen</string>
<string name="filtered_by">Gefiltert: %1$s</string>
<string name="show_anyway">Trotzdem anzeigen</string>
<string name="delete_timeline">Zeitleiste löschen</string>
<string name="notif_signed_up">Angemeldet</string>
<string name="channel_notif_signup">Neue Registrierung</string>
<string name="notif_sign_up">Eine Benutzer hat sich registriert</string>
<string name="display_remote_profile">Remote-Profil anzeigen</string>
<string name="toast_fetch_error">Die App kann keine Remote-Daten finden!</string>
<string name="set_notif_update">Über Updates benachrichtigen</string>
<string name="domains">Domänen</string>
<string name="channel_notif_update">Neues Update</string>
<string name="notif_update_push">Eine Nachricht die Du geteilt hast wurde bearbeitet</string>
<string name="notif_report">Ein Benutzer hat eine Meldung gesendet</string>
<string name="sign_ups">Registrierungen</string>
<string name="channel_notif_report">Neue Meldung</string>
<string name="hide_with_warning_description">Verstecke den gefilterten Inhalt hinter einer Warnung die den Titel des Filters enthält</string>
<string name="filter_action">Aktion filtern</string>
<string name="filter_action_explanations">Wähle die Aktion aus die durchgeführt werden soll wenn ein Beitrag Deinem Filter entspricht</string>
<string name="toast_error_add_to_list">Hinzufügen des Kontos zur Liste fehlgeschlagen!</string>
<string name="keep_notifications">Benachrichtigungen behalten</string>
<string name="set_notif_admin_report">Neue Meldung (Moderatoren)</string>
<string name="set_notif_user_sign_up">Neue Registrierung (Moderatoren)</string>
<string name="aggregate_notifications">Benachrichtigungen zusammenfassen</string>
<string name="set_unlisted_replies_indication">Betrifft nur \"öffentliche\" Antworten. Falls aktiv, werden Deine Antworten automatisch \"nicht gelistet\" statt \"öffentlich\"</string>
<string name="login_status">Anmeldestatus</string>
<string name="set_language_picker_title">Sprachen in der Auswahl</string>
<string name="set_language_picker">Erlaube die Liste der Sprachen in der Auswahl beim Verfassen einer Nachricht zu reduzieren.</string>
<string name="not_valid_tag_name">Bezeichnung des Tags ist nicht zulässig!</string>
</resources>

View file

@ -399,7 +399,7 @@
<string name="settings_category_notif_categories">Catégories</string>
<string name="move_timeline">Déplacer le fil</string>
<string name="hide_timeline">Cacher le fil</string>
<string name="reorder_timelines">Réorganiser les fils</string>
<string name="reorder_timelines">Gérer les fils</string>
<string name="reorder_list_deleted">Liste supprimée définitivement</string>
<string name="reorder_instance_removed">Instance suivie supprimée</string>
<string name="reorder_tag_removed">Balise épinglée supprimée</string>
@ -420,9 +420,9 @@
<string name="image_saved">Image enregistrée avec succès !</string>
<string name="save_image_failed">Échec de l\'enregistrement de l\'image</string>
<string name="add_poll_item">Ajouter un élément de sondage</string>
<string name="mute_conversation">Mettre la conversation en sourdine</string>
<string name="mute_conversation">Masquer la conversation</string>
<string name="unmute_conversation">Enlever la sourdine de la discussion</string>
<string name="toast_unmute_conversation">La conversation n\'est plus mise en sourdine !</string>
<string name="toast_unmute_conversation">La conversation nest plus masquée !</string>
<string name="toast_mute_conversation">La conversation est mise en sourdine</string>
<string name="category_general">Général</string>
<string name="category_regional">Régional</string>
@ -857,4 +857,11 @@
<string name="login_status">Statut de la connexion</string>
<string name="display_remote_profile">Afficher le profil distant</string>
<string name="toast_fetch_error">L\'application ne trouve pas de données distantes !</string>
<string name="notif_report">Un⋅e utilisateur⋅ice a envoyé un signalement</string>
<string name="sign_ups">Inscriptions</string>
<string name="channel_notif_update">Nouvelle mise à jour</string>
<string name="channel_notif_signup">Nouvel abonnement</string>
<string name="channel_notif_report">Nouveau signalement</string>
<string name="notif_update_push">Un message que vous avez partagé a été édité</string>
<string name="notif_sign_up">Un⋅e utilisateur⋅ice s\'est abonné⋅e</string>
</resources>

View file

@ -4,7 +4,7 @@
<string name="action_about_instance">Acerca da instancia</string>
<string name="action_privacy">Intimidade</string>
<string name="action_cache">Caché</string>
<string name="action_logout">Desconectar</string>
<string name="action_logout">Pechar sesión</string>
<!-- common -->
<string name="close">Pechar</string>
<string name="yes">Si</string>
@ -17,19 +17,19 @@
<string name="password">Contrasinal</string>
<string name="email">Correo-e</string>
<string name="accounts">Contas</string>
<string name="toots">Toots</string>
<string name="toots">Mensaxes</string>
<string name="tags">Etiquetas</string>
<string name="save">Gardar</string>
<string name="instance">Instancia</string>
<string name="instance_example">Instancia: mastodon.social</string>
<string name="toast_account_changed" formatted="false">A funcionar coa conta %1$s</string>
<string name="add_account">Engadir unha conta</string>
<string name="clipboard">Copiouse ao portapapeis o contido do toot</string>
<string name="clipboard_url">Copiouse o URL do toot ao portapapéis</string>
<string name="clipboard">Copiose ao portapapeis o contido da mensaxe</string>
<string name="clipboard_url">Copiouse o URL da mensaxe ao portapapéis</string>
<string name="camera">Cámara</string>
<string name="delete_all">Elimnar todo</string>
<string name="schedule">Programar</string>
<string name="text_size">Tamaño do texto e iconas</string>
<string name="text_size">Tamaño do texto</string>
<string name="next">Seguinte</string>
<string name="previous">Anterior</string>
<string name="open_with">Abrir con</string>
@ -50,24 +50,24 @@
<string name="translate">Traducir</string>
<!--- Menu -->
<string name="home_menu">Inicio</string>
<string name="local_menu">Liña temporal local</string>
<string name="local_menu">Cronoloxía local</string>
<string name="muted_menu">Usuarias acaladas</string>
<string name="blocked_menu">Usuarias bloqueadas</string>
<string name="notifications">Notificacións</string>
<string name="follow_request">Solicitudes de seguimento</string>
<string name="settings">Axustes</string>
<string name="send_email">Enviar un correo-e</string>
<string name="scheduled_toots">Toots programados</string>
<string name="scheduled_toots">Mensaxes programadas</string>
<string name="disclaimer_full">A información inferior sobre a usuaria podería estar incompleta.</string>
<string name="insert_emoji">Incrustar emoji</string>
<string name="no_emoji">Polo momento a app non permite emojis personalizados.</string>
<string name="logout_account_confirmation">Tes a certeza de querer desconectar @%1$s@%2$s?</string>
<string name="logout_account_confirmation">Tes a certeza de querer pechar a sesión @%1$s@%2$s\?</string>
<!-- Status -->
<string name="no_status">Sen toot que mostrar</string>
<string name="favourite_add">Engadir este toot aos seus favoritos?</string>
<string name="favourite_remove">Eliminar este toot dos seus favoritos?</string>
<string name="reblog_add">Promover este toot?</string>
<string name="reblog_remove">Deixar de promover o toot?</string>
<string name="no_status">Non hai mensaxes a mostrar</string>
<string name="favourite_add">Engadir esta publicación a favoritos\?</string>
<string name="favourite_remove">Eliminar esta mensaxe dos favoritos\?</string>
<string name="reblog_add">Promover esta mensaxe\?</string>
<string name="reblog_remove">Retirar promoción da mensaxe\?</string>
<string name="more_action_1">Acalar</string>
<string name="more_action_2">Bloquear</string>
<string name="more_action_3">Informar</string>
@ -122,8 +122,8 @@
<!-- TOOT -->
<string name="toot_select_image_error">Algo fallou ao engadir os medios!</string>
<string name="toot_delete_media">Eliminar este elemento?</string>
<string name="toot_error_no_content">O seu toot está baldeiro!</string>
<string name="toot_sent">O toot foi enviado!</string>
<string name="toot_error_no_content">A mensaxe está baleira!</string>
<string name="toot_sent">Enviaches a mensaxe!</string>
<string name="toot_sensitive">Contido sensible?</string>
<string name="no_draft">Sen borradores!</string>
<string name="choose_accounts">Escolla unha conta</string>
@ -143,14 +143,15 @@
<!-- Accounts -->
<string name="no_accounts">Sen conta que mostrar</string>
<string name="no_follow_request">Sen petición de seguimento</string>
<string name="status_cnt">Toots \n %1$s</string>
<string name="status_cnt">Mensaxes
\n %1$s</string>
<string name="following_cnt">Seguindo \n %1$s</string>
<string name="followers_cnt">Seguidoras \n %1$s</string>
<string name="reject">Rexeitar</string>
<!-- Scheduled toots -->
<string name="no_scheduled_toots">Sen toots programados!</string>
<string name="remove_scheduled">Borrar o toot programado?</string>
<string name="toot_scheduled">O toot foi programado!</string>
<string name="no_scheduled_toots">Non hai mensaxes programadas!</string>
<string name="remove_scheduled">Eliminar a mensaxe programada\?</string>
<string name="toot_scheduled">A mensaxe foi programada!</string>
<string name="toot_scheduled_date">A data programada debe ser posterior a hora actual!</string>
<!-- timed mute -->
<string name="timed_mute_date_error">O tempo de silencio debe ser maior de un minuto.</string>
@ -176,10 +177,10 @@
<string name="toast_unmute">A conta xa non está acalada!</string>
<string name="toast_follow">A conta foi seguida!</string>
<string name="toast_unfollow">A conta xa non está seguida!</string>
<string name="toast_reblog">O toot foi promovido!</string>
<string name="toast_unreblog">O toot xa non está promovido!</string>
<string name="toast_favourite">Este toot foi engadido aos seus favoritos!</string>
<string name="toast_unfavourite">Este toot eliminouse dos favoritos!</string>
<string name="toast_reblog">A mensaxe foi promovida!</string>
<string name="toast_unreblog">Retirácheslle a promoción á mensaxe!</string>
<string name="toast_favourite">A mensaxe foi engadida ás favoritas!</string>
<string name="toast_unfavourite">A mensaxe foi eliminada das favoritas!</string>
<string name="toast_error">Vaia! Algo fallou!</string>
<string name="toast_code_error">Algo fallou! A instancia non devolveu o código de autorización!</string>
<string name="toast_error_instance">O dominio da instancia non semella ser válido!</string>
@ -188,7 +189,7 @@
<string name="nothing_to_do">Non se poden realizar accións</string>
<string name="toast_error_translate">Algo fallou ao traducir!</string>
<!-- Settings -->
<string name="set_toots_page">Número de toots por carga</string>
<string name="set_toots_page">Número de mensaxes por carga</string>
<string name="set_disable_gif">Desactivar avatares GIF</string>
<string name="set_notif_follow">Notificar cando alguén a segue</string>
<string name="set_notif_follow_share">Notificar cando alguén promove un dos seus toots</string>
@ -265,12 +266,12 @@
<string name="proxy_enable">Activar proxy?</string>
<string name="poxy_host">Host</string>
<string name="poxy_port">Porto</string>
<string name="poxy_login">Conectar</string>
<string name="poxy_login">Acceder</string>
<string name="poxy_password">Contrasinal</string>
<string name="set_share_details">Engadir detalles do toot ao compartir</string>
<string name="set_share_details">Engadir detalles da mensaxe ao compartir</string>
<string name="support_the_app_on_liberapay">Axude a app en Liberapay</string>
<string name="alert_regex">Hai un fallo na expresión regular!</string>
<string name="toast_instance_unavailable">Non se atoparon liñas temporais en esta instancia!</string>
<string name="toast_instance_unavailable">Non se atoparon cronoloxías nesta instancia!</string>
<string name="follow_instance">Seguir instancia</string>
<string name="toast_instance_already_added">Xa segue a esta instancia!</string>
<string name="action_partnership">Asociados</string>
@ -282,13 +283,13 @@
<string name="filters">Filtros</string>
<string name="action_filters_empty_content">Sen filtros que mostrar. Pode crear un pulsando no botón \"+\".</string>
<string name="filter_keyword">Palabra chave ou frase</string>
<string name="context_home">Liña temporal de inicio</string>
<string name="context_home">Cronoloxía de inicio</string>
<string name="context_public">Liñas de tempo públicas</string>
<string name="context_notification">Notificacións</string>
<string name="context_conversation">Conversas</string>
<string name="filter_keyword_explanations">Farase coincidir sen importar se é texto agochado ou con aviso de contido na mensaxe</string>
<string name="filter_keyword_explanations">Farase coincidir sen importar se é texto ten maiúsculas ou con aviso de contido na mensaxe</string>
<string name="context_drop">Desbotar en lugar de ocultar</string>
<string name="context_drop_explanations">Os toots filtrados desaparecerán irreversiblemente, incluso si despois elimina o filtro</string>
<string name="context_drop_explanations">As mensaxes filtradas desaparecerán irreversiblemente, incluso se despois eliminas o filtro</string>
<string name="context_whole_word_explanations">Cando a palabra chave é só alfanumérica, só se aplicará si coincide a palabra completa</string>
<string name="context_whole_word">Palabra completa</string>
<string name="filter_context">Filtrar contextos</string>
@ -303,23 +304,25 @@
<string name="channel_notif_fav">Novo favorito</string>
<string name="channel_notif_mention">Nova mención</string>
<string name="channel_notif_poll">Rematou a sondaxe</string>
<string name="channel_notif_backup">Respaldo de Toots</string>
<string name="channel_notif_backup">Copia de Apoio de mensaxes</string>
<string name="channel_notif_status">Novas publicacións</string>
<string name="channel_notif_media">Descarga de medios</string>
<string name="select_sound">Escoller Tono</string>
<string name="set_enable_time_slot">Activar tramo horario</string>
<string name="block_domain_confirm_message">Desexa bloquear a %s\?</string>
<string name="block_domain_confirm_message">Queres bloquear a %s\?
\n
\nNon verás ningún contido dese dominio en ningunha cronoloxía pública nin nas notificacións. As túas seguidoras nese dominio serán eliminadas.</string>
<string name="block_domain">Bloquear dominio</string>
<string name="toast_block_domain">O dominio foi bloqueado</string>
<string name="retrieve_remote_status">Obtendo estado remoto</string>
<string name="peertube_instance">Instancia Peertube</string>
<string name="set_display_emoji">Utilizar Emoji One</string>
<string name="information">Información</string>
<string name="set_display_card">Mostrar vista previa en todos os toots</string>
<string name="set_display_card">Mostrar vista previa en tódalas mensaxes</string>
<string name="account_id_clipbloard">Copiouse o id de conta ao portapapeis!</string>
<string name="set_change_locale">Cambiar o idioma</string>
<string name="truncate_long_toots">Cortar en varios os toots longos</string>
<string name="set_truncate_toot">Repartir os toots superiores a \'x\' liñas. Cero significa desactivado.</string>
<string name="truncate_long_toots">Recortar mensaxes longas</string>
<string name="set_truncate_toot">Cortar as mensaxes superiores a \'x\' liñas. Cero significa desactivado.</string>
<string name="display_toot_truncate">Mostrar máis</string>
<string name="hide_toot_truncate">Mostrar menos</string>
<string name="tags_already_stored">A etiqueta xa existe!</string>
@ -365,19 +368,19 @@
<string name="category">Categoría</string>
<string name="description">Descrición</string>
<string name="share">Compartir</string>
<string name="toots_server">Toots (Servidor)</string>
<string name="toots_client">Toots (Dispositivo)</string>
<string name="settings_category_label_timelines">Liñas temporais</string>
<string name="toots_server">Mensaxes (Servidor)</string>
<string name="toots_client">Mensaxes (Dispositivo)</string>
<string name="settings_category_label_timelines">Cronoloxías</string>
<string name="settings_category_label_interface">Interface</string>
<string name="contact">Contactos</string>
<string name="toot_select_file_error">Algo fallou ao seleccionar o ficheiro de respaldo!</string>
<string name="action_logout_account">Desconectar conta</string>
<string name="action_logout_account">Pechar sesión da conta</string>
<string name="all">Todo</string>
<string name="copy_link">Copiar ligazón</string>
<string name="calls_blocked">peticións http bloqueadas pola aplicación</string>
<string name="list_of_blocked_domains">Lista de peticións bloquedas</string>
<string name="submit">Enviar</string>
<string name="filter_timeline_with_a_tag">Filtrar liña temporal con etiquetas</string>
<string name="filter_timeline_with_a_tag">Filtrar cronoloxía con etiquetas</string>
<string name="no_tags">Sen etiquetas</string>
<string name="set_retrieve_metadata_share_from_extras">Obter metadatos se o URL os comparte desde outras apps</string>
<!-- end languages -->
@ -388,16 +391,16 @@
<string name="poll_finish_at">finaliza en %s</string>
<string name="vote">Votar</string>
<string name="notif_poll">Rematou a sondaxe na que participou</string>
<string name="notif_poll_self">Rematou unha sondaxe na que tooteou</string>
<string name="notif_poll_self">Rematou unha enquisa que publicaches</string>
<string name="settings_category_notif_categories">Categorías</string>
<string name="move_timeline">Mover liña temporal</string>
<string name="hide_timeline">Agochar liña temporal</string>
<string name="reorder_timelines">Ordear liñas temporais</string>
<string name="move_timeline">Mover cronoloxía</string>
<string name="hide_timeline">Agochar cronoloxía</string>
<string name="reorder_timelines">Xestionar cronoloxías</string>
<string name="reorder_list_deleted">Lista eliminada de xeito permanente</string>
<string name="reorder_instance_removed">Eliminouse o seguimento da instancia</string>
<string name="reorder_tag_removed">Eliminouse a etiqueta fixada</string>
<string name="undo">Desfacer</string>
<string name="warning_main_timeline">As liñas temporais principais só poden ocultarse!</string>
<string name="warning_main_timeline">As cronoloxías principais só poden ocultarse!</string>
<string name="set_sensitive_content">Marcar os medios sempre como sensibles</string>
<string name="gnu_instance">Instancia GNU</string>
<string name="set_forward_tags">Incluír etiquetas nas respostas</string>
@ -442,11 +445,13 @@
<string name="password_too_short">O contrasinal debe conter ao menos 8 caracteres</string>
<string name="username_error">O nome de usuaria debería ter só letras, números e guión baixo</string>
<string name="account_created">Conta creada!</string>
<string name="account_created_message"> Xa ten unha conta!\n\n
Lembre validar o correo-e nas seguintes48 horas.\n\n
Xa pode conectar coa súa conta escribindo <b>%1$s</b> no primeiro campo e pulsando <b>Conectar</b>.\n\n
<b>Importante</b>: se a súa instancia require validación, recibirá un correo unha vez sexa validada!
</string>
<string name="account_created_message"> Xa tes unha conta!
\n
\n Lembra validar o email nas seguintes 48 horas.
\n
\n Xa podes acceder coa túa conta escribindo <b>%1$s</b> no primeiro campo e premendo <b>Acceder</b>.
\n
\n <b>Importante</b>: se a túa instancia require validación, recibirás un correo unha vez sexa validada! </string>
<string name="save_draft">¿Gardar mensaxe en borradores?</string>
<string name="administration">Administración</string>
<string name="reports">Informes</string>
@ -467,7 +472,7 @@
<string name="audio">A aplicación precisa acceso a gravación de audio</string>
<string name="voice_message">Mensaxe de voz</string>
<string name="set_enable_time_slot_indication">Durante o tempo marcado, a app enviará notificacións. Pode revertir (silenciar) esta marxe coa roda da dereita.</string>
<string name="set_fit_preview_indication">Non se recortarán as vistas previas en liñas temporais</string>
<string name="set_fit_preview_indication">Non se recortarán as vistas previas nas cronoloxías</string>
<string name="set_capitalize_indication">Inserta automáticamente un salto de liña tras a mención para por en maiúscula a primeira letra</string>
<string name="settings_title_custom_sharing_indication">Permitir as creadoras de contido compartir estados desde as súas fontes RSS</string>
<string name="compose">Redactar</string>
@ -503,7 +508,7 @@
<string name="unfollow_confirm">Queres deixar de seguir esta conta?</string>
<string name="set_unfollow_validation">Mostrar cadro de confirmación antes de deixar de seguir</string>
<string name="replace_medium">Substituír ligazóns a Medium</string>
<string name="replace_medium_description">Substituír as ligazóns a medium.com cunha interface de código aberto alternativa centrada na privacidade.</string>
<string name="replace_medium_description">Usar unha interface alternativa para Medium</string>
<string name="replace_medium_host">Por defecto: scribe.rip</string>
<string name="set_push_notifications">Usar un sistema de notificacións push para ter notificacións en tempo real.</string>
<string name="action_add_notes">Engadir notas</string>
@ -518,12 +523,12 @@
<string name="username_title">Cambiar a cor do nome de usuaria enriba das mensaxes</string>
<string name="boost_header_color">Cambiar a cor da cabeceira das mensaxes repetidas</string>
<string name="background_status_title">Publicacións</string>
<string name="background_status">Cor de fondo das publicacións en liñas temporais</string>
<string name="background_status">Cor de fondo das publicacións nas cronoloxías</string>
<string name="reset_color">Restablecer cores</string>
<string name="clik_reset">Premendo aquí restableces os valores por omisión</string>
<string name="reset">Restablecer</string>
<string name="icons_color_title">Iconas</string>
<string name="icons_color">Cor das iconas inferiores nas liñas temporais</string>
<string name="icons_color">Cor das iconas inferiores nas cronoloxías</string>
<string name="logo_of_the_instance">Logo da instancia</string>
<string name="edit_profile">Editar perfil</string>
<string name="make_an_action">Tomar decisión</string>
@ -570,4 +575,292 @@
<string name="no_distributors_found">Non se atopan distribuidores!</string>
<string name="no_distributors_explanation">Precisas un distribuidor para recibir notificacións push.\nAtoparás máis detalles en %1$s.\n\nTamén podes desactivar as notificacións push nos axustes para ignorar esa mensaxe.</string>
<string name="select_distributors">Elixe un distribuidor</string>
<string name="replace_twitter">Twitter</string>
<string name="replace_twitter_description">Usar interface alternativa para Twitter</string>
<string name="replace_twitter_host">Dominio da interface para Twitter</string>
<string name="replace_instagram">Instagram</string>
<string name="replace_instagram_description">Usar unha interface alternativa para Instagram</string>
<string name="replace_instagram_host">Dominio da interface para Instagram</string>
<string name="replace_reddit">Reddit</string>
<string name="is_up">Funciona!</string>
<string name="report_val_more4">O problema non axeita a ningunha das categorías</string>
<string name="report_val4">Outra cousa</string>
<string name="report_1_mute_title">Acalar a %1$s</string>
<string name="report_1_block_title">Bloquear a %1$s</string>
<string name="toast_bookmark">Engadiuse a mensaxe aos marcadores!</string>
<string name="set_unfollow_validation_title">Confirma a retirada do seguimento</string>
<string name="pref_theme_base_summary">Elixe se a base do decorado debe ser clara ou escura</string>
<string name="top_menu">Menú barra superior</string>
<string name="other">Outro</string>
<string name="add_status">Engadir estado</string>
<string name="set_bot_content">Conta tipo bot</string>
<string name="pref_theme_base">Base do decorado</string>
<string name="pref_custom_theme_new_summary">Permitir crear o teu propio decorado</string>
<string name="pref_contributor">Decorados da comunidade</string>
<string name="poll_type">Tipo de enquisa:</string>
<string name="pref_contributor_summary">Elixe un decorado que foi creado por persoas da comunidade</string>
<string name="poll_duration">Duración da enquisa:</string>
<string name="icon_size">Tamaño das iconas</string>
<string name="toots_visibility_title">Visibilidade por defecto para as mensaxes:</string>
<string name="toast_unbookmark">Retirouse a mensaxe dos marcadores!</string>
<string name="post_message_text">Enviando mensaxe %d/%d</string>
<string name="report_val_more3">Cres que non segue determinada regra</string>
<string name="notif_display_mentions">Mencións</string>
<string name="notif_display_favourites">Favoritas</string>
<string name="delete_notification_all_warning">Tes a certeza de querer eliminar tódalas notificacións\? Non ten volta atrás.</string>
<string name="interactions">Interaccións</string>
<string name="locked">Bloqueado</string>
<string name="save_changes">Gardar cambios</string>
<string name="hide_content">Agochar contido &lt;</string>
<string name="stop_recording">Deter gravación</string>
<string name="report_title">Denuncia de %1$s</string>
<string name="report_indication_title_status">Cóntanos cal é o problema coa publicación</string>
<string name="report_indication_title_status_more">Elixe a mellor coincidencia</string>
<string name="report_val_more2">Ligazóns maliciosas, engano, ou respostas repetitivas</string>
<string name="report_val_more1">Non é algo que queira ver</string>
<string name="report_val2">É spam</string>
<string name="report_2_title">Hai algunha publicación que apoie esta denuncia\?</string>
<string name="report_3_title">Que regra se incumpriu\?</string>
<string name="notif_display_reblogs">Promocións</string>
<string name="notif_display_poll_results">Resultados da enquisa</string>
<string name="notif_display_updates_from_people">Actualizacións das persoas</string>
<string name="notif_display_follows">Segue</string>
<string name="add_filter">Engadir filtro</string>
<string name="add_field">Engadir Campo</string>
<string name="unlocked">Desbloqueado</string>
<string name="scheduled">Programado</string>
<string name="set_discoverable_content">Conta non descubrible</string>
<string name="delete_field">Eliminar campo</string>
<string name="select_a_theme">Elixe un decorado</string>
<string name="more_actions">Máis accións</string>
<string name="set_accounts_page">Número de contas por carga</string>
<string name="set_notifications_page">Número de notificacións por carga</string>
<string name="category_music">Música</string>
<string name="cannot_be_empty">O campo non pode estar baleiro!</string>
<string name="replace_youtube">YouTube</string>
<string name="replace_youtube_description">Usar interface alternativa para YouTube</string>
<string name="replace_youtube_host">Domino da interface para YouTube</string>
<string name="replace_reddit_description">Usar interface alternativa para Reddit</string>
<string name="replace_reddit_host">Dominio da interface para Reddit</string>
<string name="type_of_notifications">Tipo de notificacións</string>
<string name="type_of_notifications_title">Elixe o tipo de notificacións</string>
<string name="disable_notifications">Desactivar notificacións</string>
<string name="bottom_menu">Menú inferior</string>
<string name="last_active">Última actividade</string>
<string name="customize_timelines">Personalizar cronoloxías</string>
<string name="message_has_been_sent">Enviouse a mensaxe!</string>
<string name="types_of_notifications_to_display">Tipos de notificación a mostrar</string>
<string name="set_display_bookmark_indication">Mostar sempre o botón do marcador</string>
<string name="display">Mostrar</string>
<string name="data_import_settings_success">Importáronse correctamente os axustes</string>
<string name="data_export_settings">Exportáronse os axustes</string>
<string name="data_export_settings_success">Exportáronse correctamente os axustes</string>
<string name="instance_not_valid">Non semella ser unha instancia válida!</string>
<string name="boosted_by">Promovida por</string>
<string name="favourited_by">Favorecida por</string>
<string name="followers_only">Só para seguidoras</string>
<string name="eg_sensitive_content">Ex.: Contido sensible</string>
<string name="post_message">Publicando mensaxe…</string>
<string name="is_down">Non funciona!</string>
<string name="keepon">Continuar</string>
<string name="category_custom">Personalizar</string>
<string name="instance_health_uptime">Uptime: %,.2f %%</string>
<string name="show_content">Mostrar contido &gt;</string>
<string name="report_val1">Non me gusta</string>
<string name="report_val3">Viola as regras do servidor</string>
<string name="report_1_title">Non queres ver isto\?</string>
<string name="report_1_title_more">Aquí tes opcións para controlar o que ves en Mastodon:</string>
<string name="report_1_unfollow_title">Deixa de seguir a %1$s</string>
<string name="report_1_unfollow">Estás seguindo esta conta. Para non ver as súas publicacións na cronoloxía de inicio, deixa de seguila.</string>
<string name="report_1_mute">Non verás as súas publicacións. Poderá seguirte a ti e ver as túas publicacións e non saberá que a tes acalada.</string>
<string name="report_1_block">Non verás as súas publicacións. Non poderá ver as túas publicacións nin seguirte. Poderá comprobar que a tes bloqueada.</string>
<string name="report_all_more">Elixe todo o que aplique</string>
<string name="instance_health_indication">version: %s
\n %s usuarias - %s estados</string>
<string name="instance_health_checkedat">Comprobado o: %s</string>
<string name="report_more_remote">A conta está noutro servidor. Enviamos alí unha copia anónimizada da denuncia\?</string>
<string name="report_more_forward">Enviar a %1$s</string>
<string name="report_more">Hai algo máis que debamos saber\?</string>
<string name="report_more_additional">Comentarios adicionais</string>
<string name="join_the_fediverse">Únete ao fediverso</string>
<string name="report_sent">Enviouse a denuncia!</string>
<string name="dont_have_an_account">Non tes unha conta\?</string>
<string name="invite_join_the_fediverse">Ola! Convidámoste a unirte ao Fediverso.</string>
<string name="about_mastodon">\"Mastodon non é un sitio web único como Twitter ou Facebook, é unha rede de miles de comunidades xestionadas por diferentes organizacións e persoas que proporciona unha experiencia do internet social conxunta.\"</string>
<string name="clear_all_notif">Limpar tódalas notificacións</string>
<string name="mark_all_as_read">Marcar tódalas notificacións como lidas</string>
<string name="display_all_categories">Mostrar tódalas categorías</string>
<string name="not_valid_list_name">O nome da lista non é válido!</string>
<string name="no_account_in_list">Non hai contas nesta lista!</string>
<string name="delete_field_confirm">Tes a certeza de querer eliminar este campo\?</string>
<string name="profiled_updated">Actualizouse o perfil!</string>
<string name="admin_scope">Son moderadora</string>
<string name="location">Localización</string>
<string name="also_favourite_by">"Tamén a favoreceron: "</string>
<string name="also_boosted_by">Tamén a promocionaron:</string>
<string name="notifications_are">Durante este marco temporal</string>
<string name="notification_sounds">Son das notificacións</string>
<string name="remove_status">Eliminar estado</string>
<string name="set_timelines_in_a_list_title">Cronoloxías nunha lista</string>
<string name="set_timelines_in_a_list">Ao activalas, tódalas cronoloxías fixadas monstraranse nun menú despregable</string>
<string name="set_single_topbar">Ao activala, a app só terá unha única barra para as cronoloxías</string>
<string name="messages_in_cache_for_home">Mensaxes na caché para Inicio</string>
<string name="fetch_more_messages">Obter máis mensaxes…</string>
<string name="action_announcement_from_to">Anuncio - %1$s - %2$s</string>
<string name="clear_cache">Limpar caché</string>
<string name="view_the_original_message">Abrir mensaxe orixinal</string>
<string name="set_use_cache_indication">As conoloxías irán á caché para que a aplicación sexa máis rápida.</string>
<string name="reply">Responder</string>
<string name="display_options">Opcións de presentación</string>
<string name="toast_token">A app non puido obter un token</string>
<string name="domain">Dominio</string>
<string name="set_your_max_char_count">Establece o número máx. de caracteres</string>
<string name="release_notes">Notas da publicación</string>
<string name="media_cannot_be_uploaded">Non se puido subir o multimedia!</string>
<string name="set_push_notifications_delay">Establecer a demora entre obtencións</string>
<string name="set_display_counter">Mostra contadores nas mensaxes</string>
<string name="load_media_type_title">Cargar miniaturas multimedia</string>
<string name="display_media">Mostrar multimedia</string>
<string name="cached_messages">Mensaxe na caché</string>
<string name="fetch_notifications">Obter notificacións</string>
<string name="set_single_topbar_title">Barra única</string>
<string name="set_use_cache">Usar caché</string>
<string name="set_display_counters">Mostrar contadores</string>
<string name="open_draft">Abrir borrador</string>
<string name="type_of_notifications_delay_title">Tempo entre notificacións</string>
<string name="status">Estado</string>
<string name="resolved">Resolta</string>
<string name="label_oval">Oval</string>
<string name="my_instance">A miña instancia</string>
<string name="delete_cache">Baleirar caché</string>
<string name="messages_in_cache_for_other_timelines">Mensaxes na caché para outras cronoloxías</string>
<string name="messages_stored_in_drafts">Mensaxes gardadas en borradores</string>
<string name="my_app">A miña app</string>
<string name="msg_save_image">Tes a certeza de saír sen gardar a imaxe\?</string>
<string name="tap_here_to_refresh_poll">Toca aquí para actualizar a enquisa</string>
<string name="approved">Aprobado</string>
<string name="files_cache_size">Tamaño dos ficheiros da caché</string>
<string name="approve">Aprobar</string>
<string name="origin_report">Orixe da conta denunciada</string>
<string name="most_recent">Máis recente</string>
<string name="label_shape">Forma</string>
<string name="label_eraser_mode">Modo Borrar</string>
<string name="delete_cache_message">Tes a certeza de querer baleirar a caché\? Se tes borradores que inclúen multimedia, estes perderanse.</string>
<string name="my_account">A miña conta</string>
<string name="set_display_counters_description">Montrará icona con contador para as novas mensaxes nas cronoloxías da lapela</string>
<string name="load_settings">Cargar axustes exportados</string>
<string name="push_distributors">Xestor de notificacións</string>
<string name="import_settings">Importar axustes</string>
<string name="display_timelines">Mostrar cronoloxías</string>
<string name="permission_missing">Permiso non outorgado!</string>
<string name="aggregate_notifications">Agrupar notificacións</string>
<string name="aggregate_notifications_summary">Ao activarlo, a app xuntará tódalas notificacións relacionadas</string>
<string name="remember_position">Lembrar posición nas cronoloxías</string>
<string name="staff">Equipo</string>
<string name="filter">Filtro</string>
<string name="label_rectangle">Rectángulo</string>
<string name="default_system_language">Usar o idioma por defecto no sistema</string>
<string name="refresh_every">Obter notificacións cada:</string>
<string name="export_settings">Exportar axustes</string>
<string name="label_line">Liña</string>
<string name="message_language">Idioma das mensaxes</string>
<string name="restart_the_app_theme">Debes reiniciar a app para aplicar os cambios.</string>
<string name="unconfirmed">Sen confirmar</string>
<string name="mark_resolved">Marcar como resolta</string>
<string name="toast_fetch_error">A non pode atopar os datos remotos!</string>
<string name="notif_submitted_report">Enviou unha denuncia</string>
<string name="action_privacy_policy">Política de privacidade</string>
<string name="blocked_domains">Dominios bloqueados</string>
<string name="edited_message_at">Editada o %1$s</string>
<string name="unblock_domain">Desbloquear dominio</string>
<string name="no_blocked_domains">Non tes dominios bloqueados</string>
<string name="unblock_domain_confirm">Tes a certeza de desbloquear %1$s\?</string>
<string name="pickup_logo">Elixe un logo</string>
<string name="change_logo">Cambiar logo</string>
<string name="change_logo_description">Cambia o logo da app no teu dispositivo</string>
<string name="action_pin">Fixar mensaxe</string>
<string name="set_live_translate_title">Traducir mensaxes</string>
<string name="set_live_translate">Forzar a tradución a un idioma concreto. Elixe o primeiro valor para restablecer aos axustes do sistema</string>
<string name="created_message_at">Creada o %1$s</string>
<string name="max_indentation_thread">Indentación máx. nos fíos</string>
<string name="set_unlisted_replies">Respostas non listadas</string>
<string name="Suggestions">Suxestións</string>
<string name="not_interested">Non interesada</string>
<string name="set_unlisted_replies_indication">Só aplica a respostas \"públicas\". Ao activalo, as respostas terán automáticamente visibilidade \"non listada\" no lugar de \"pública\"</string>
<string name="toast_unpin">A mensaxe xa non está fixada!</string>
<string name="toast_pin">Fixouse a mensaxe</string>
<string name="notification_remove_from_cache">Eliminadas da caché as notificacións.</string>
<string name="email_status">Estado do email</string>
<string name="login_status">Estado da sesión</string>
<string name="assign_to_me">Asignarma</string>
<string name="unassign">Retirar asignación</string>
<string name="account_warned">Conta con avisos</string>
<string name="account_unsuspended">Retirada a suspensión da conta</string>
<string name="account_suspended">Conta suspendida</string>
<string name="account_silenced">Conta acalada</string>
<string name="report">Denunciar</string>
<string name="action_unpin">Desafixar mensaxe</string>
<string name="joined">Uniuse</string>
<string name="recent_ip">IP recente</string>
<string name="allow">Permitir</string>
<string name="warn">Avisar</string>
<string name="email_user">Notificar á usuaria por email</string>
<string name="custom_warning">Aviso personalizado</string>
<string name="list_reported_statuses">Estados denunciados</string>
<string name="silenced">Acalada</string>
<string name="user">Usuaria</string>
<string name="moderator">Moderadora</string>
<string name="administrator">Administradora</string>
<string name="confirmed">Confirmada</string>
<string name="mark_unresolved">Macar como non resolta</string>
<string name="account_rejected">Conta rexeitada</string>
<string name="account_approved">Conta aprobada</string>
<string name="account_undisabled">Conta reactivada</string>
<string name="account_disabled">Conta desactivada</string>
<string name="account_unsilenced">Conta restablecida</string>
<string name="state">Estado</string>
<string name="restart_the_app">Reiniciar a app\?</string>
<string name="restart">Reiniciar</string>
<string name="set_language_picker_title">Idiomas no selector</string>
<string name="set_language_picker">Permite reducir a lista de idiomas no selector ao escribir unha mensaxe.</string>
<string name="action_followed_tag_empty">Non segues ningún cancelo!</string>
<string name="action_unfollow_tag">Non seguir cancelo</string>
<string name="action_unfollow_tag_confirm">Queres deixar de seguir este cancelo\?</string>
<string name="unfollow">Non seguir</string>
<string name="action_tag_follow">Seguir un cancelo</string>
<string name="write_the_tag_to_follow">Escribe o cancelo a seguir</string>
<string name="not_valid_tag_name">O nome do cancelo non é válido!</string>
<string name="followed_tags">Cancelos seguidos</string>
<string name="follow_tag">Seguir cancelo</string>
<string name="display_media_notification">Mostrar multimedia nas notificacións</string>
<string name="display_media_notification_summary">Mostrarase o multimedia nas notificacións de RT e FAV</string>
<string name="action_lists_edit">Editar lista</string>
<string name="profiles">Perfís</string>
<string name="toast_feature_not_supported">A túa instancia non ten soporte para esta función!</string>
<string name="watch_trends_for_instance">Mira os temas en voga na instancia</string>
<string name="notif_update">Editou unha mensaxe</string>
<string name="notif_display_updates">Actualizacións</string>
<string name="edit_message">Editar mensaxe</string>
<string name="full_date_edited">%1$s editou %2$s</string>
<string name="status_history">Historial da mensaxe</string>
<string name="filter_action">Acción do filtro</string>
<string name="filter_action_explanations">Elixe que acción debe realizar o filtro ao atopar unha concordancia</string>
<string name="hide_with_warning">Agochar cun aviso</string>
<string name="hide_completely">Agochar completamente</string>
<string name="hide_with_warning_description">Agochar o contido filtrado detrás dun aviso que menciona o título do filtro</string>
<string name="hide_completely_description">Agochar completamente o contido filtrado, como se non tivese existido</string>
<string name="context_home_list">Inicio e listas</string>
<string name="title">Título</string>
<string name="keyword_or_phrase">Palabra ou frase a filtrar</string>
<string name="delete_keyword">Eliminar palabra</string>
<string name="add_keyword">Engadir palabra</string>
<string name="filtered_by">Filtrado %1$s</string>
<string name="show_anyway">Mostrar igualmente</string>
<string name="display_remote_profile">Mostrar perfil remoto</string>
<string name="toast_error_add_to_list">A app non puido engadir a conta á lista!</string>
<string name="delete_timeline">Eliminar cronoloxía</string>
<string name="notif_signed_up">Rexistrada</string>
<string name="action_pinned_delete">Eliminar as cronoloxías fixadas\?</string>
<string name="unpin_timeline">Eliminar a cronoloxía fixada\?</string>
<string name="unpin_timeline_description">Tes a certeza de desafixar a cronoloxía\?</string>
</resources>

View file

@ -389,7 +389,7 @@
<string name="settings_category_notif_categories">カテゴリ</string>
<string name="move_timeline">タイムラインの移動</string>
<string name="hide_timeline">タイムラインを非表示にする</string>
<string name="reorder_timelines">タイムラインの並び替え</string>
<string name="reorder_timelines">タイムラインの管理</string>
<string name="reorder_list_deleted">削除されたリスト</string>
<string name="reorder_instance_removed">フォローしたサーバーを削除</string>
<string name="reorder_tag_removed">ピン留めされたタグの削除</string>
@ -601,7 +601,7 @@
<string name="mark_all_as_read">全ての通知を既読にする</string>
<string name="display_all_categories">全てのカテゴリーを表示する</string>
<string name="delete_notification_all_warning">全ての通知を削除しますか?この操作は取り消せません。</string>
<string name="interactions">相互</string>
<string name="interactions">交流</string>
<string name="save_changes">変更を保存</string>
<string name="set_bot_content">ボットアカウント</string>
<string name="set_discoverable_content">アカウントを検索可能にする</string>
@ -698,7 +698,7 @@
<string name="action_announcement_from_to">アナウンス・%1$s - %2$s</string>
<string name="messages_in_cache_for_other_timelines">他のタイムラインの投稿のキャッシュ</string>
<string name="messages_stored_in_drafts">下書きのメッセージ</string>
<string name="files_cache_size">ファイルキャッシュのサイズ</string>
<string name="files_cache_size">キャッシュファイルのサイズ</string>
<string name="clear_cache">キャッシュを消去</string>
<string name="most_recent">直近</string>
<string name="filter">フィルター</string>
@ -846,4 +846,17 @@
<string name="notif_display_updates">更新</string>
<string name="show_anyway">強制的に表示する</string>
<string name="display_remote_profile">リモートのプロフィールを表示</string>
<string name="action_privacy_policy">プライバシーポリシー</string>
<string name="unpin_timeline">ピン留めしたタイムラインを削除しますか?</string>
<string name="action_pinned_delete">ピン留めされたタイムラインを削除しますか?</string>
<string name="unpin_timeline_description">このタイムラインのピン留めを解除しますか?</string>
<string name="blocked_domains">ブロックしたドメイン</string>
<string name="unblock_domain">ドメインのブロックを解除</string>
<string name="no_blocked_domains">ブロックしているドメインはありません</string>
<string name="unblock_domain_confirm">%1$sのブロックを解除しますか</string>
<string name="Suggestions">サジェスト</string>
<string name="not_interested">興味なし</string>
<string name="delete_timeline">タイムラインの削除</string>
<string name="notif_submitted_report">レポートを送信しました</string>
<string name="notif_signed_up">登録しました</string>
</resources>

Some files were not shown because too many files have changed in this diff Show more