From 60b48c594ab49f18a834a2d5363471e285c0bbe8 Mon Sep 17 00:00:00 2001 From: Thomas Date: Mon, 26 Sep 2022 17:08:00 +0200 Subject: [PATCH] cache --- app/src/main/AndroidManifest.xml | 18 +- .../app/fedilab/android/BaseMainActivity.java | 5 +- .../activities/AdminAccountActivity.java | 38 ++-- .../activities/AdminReportActivity.java | 38 ++-- .../android/activities/ComposeActivity.java | 59 +++-- .../activities/EditProfileActivity.java | 20 +- .../android/activities/ProfileActivity.java | 38 ++-- .../activities/ReorderTimelinesActivity.java | 1 + .../activities/SearchResultTabActivity.java | 1 + .../android/client/entities/api/Account.java | 5 +- .../android/client/entities/api/Instance.java | 38 ++-- .../android/client/entities/api/Status.java | 20 +- .../client/entities/app/StatusCache.java | 33 ++- .../entities/peertube/PeertubeVideo.java | 68 +++--- .../app/fedilab/android/helper/Helper.java | 63 +++--- .../android/helper/MastodonHelper.java | 31 ++- .../fedilab/android/helper/MediaHelper.java | 19 +- .../android/helper/PinnedTimelineHelper.java | 2 +- .../ui/drawer/AnnouncementAdapter.java | 60 +++--- .../android/ui/drawer/ComposeAdapter.java | 4 +- .../android/ui/drawer/StatusAdapter.java | 84 ++++---- .../fragment/admin/FragmentAdminAccount.java | 24 +-- .../fragment/admin/FragmentAdminReport.java | 6 +- .../ui/fragment/media/FragmentMedia.java | 132 ++++++------ .../ui/pageadapter/FedilabPageAdapter.java | 2 +- .../FedilabProfileTLPageAdapter.java | 1 + .../viewmodel/mastodon/TimelinesVM.java | 128 +++++------ .../drawable-anydpi-v24/ic_notification.xml | 2 +- .../main/res/drawable/ic_baseline_add_24.xml | 10 +- .../drawable/ic_baseline_arrow_drop_up_24.xml | 10 +- .../res/drawable/ic_baseline_block_24.xml | 10 +- .../ic_baseline_bookmark_border_24.xml | 6 +- .../res/drawable/ic_baseline_check_24.xml | 10 +- .../drawable/ic_baseline_check_circle_24.xml | 10 +- .../res/drawable/ic_baseline_close_24.xml | 10 +- .../res/drawable/ic_baseline_drafts_24.xml | 10 +- .../main/res/drawable/ic_baseline_home_24.xml | 10 +- .../ic_baseline_hourglass_full_24.xml | 2 +- .../main/res/drawable/ic_baseline_info_24.xml | 10 +- .../main/res/drawable/ic_baseline_lock_24.xml | 10 +- .../res/drawable/ic_baseline_lock_open_24.xml | 10 +- .../main/res/drawable/ic_baseline_mail_24.xml | 10 +- .../drawable/ic_baseline_notifications_24.xml | 10 +- .../res/drawable/ic_baseline_open_with_24.xml | 10 +- .../drawable/ic_baseline_people_alt_24.xml | 36 ++-- .../ic_baseline_person_add_alt_1_24.xml | 2 +- .../res/drawable/ic_baseline_public_24.xml | 10 +- .../ic_baseline_remove_red_eye_24.xml | 2 +- .../res/drawable/ic_baseline_search_24.xml | 2 +- .../res/drawable/ic_baseline_settings_24.xml | 2 +- .../main/res/drawable/ic_baseline_star_24.xml | 4 +- .../ic_baseline_supervised_user_circle_24.xml | 10 +- .../drawable/ic_baseline_visibility_24.xml | 2 +- .../ic_baseline_visibility_off_24.xml | 2 +- .../res/drawable/ic_baseline_warning_24.xml | 6 +- app/src/main/res/drawable/ic_display_less.xml | 6 +- app/src/main/res/drawable/ic_display_more.xml | 6 +- app/src/main/res/drawable/ic_repeat.xml | 12 +- app/src/main/res/drawable/ic_star_outline.xml | 12 +- app/src/main/res/layout/activity_about.xml | 14 +- app/src/main/res/layout/activity_actions.xml | 8 +- .../main/res/layout/activity_conversation.xml | 25 +-- app/src/main/res/layout/activity_drafts.xml | 25 ++- .../main/res/layout/activity_edit_image.xml | 4 +- .../main/res/layout/activity_edit_profile.xml | 24 +-- app/src/main/res/layout/activity_hashtag.xml | 4 +- app/src/main/res/layout/activity_instance.xml | 28 ++- app/src/main/res/layout/activity_main.xml | 19 +- .../main/res/layout/activity_media_pager.xml | 44 ++-- .../main/res/layout/activity_pagination.xml | 10 +- app/src/main/res/layout/activity_profile.xml | 10 +- .../main/res/layout/activity_reorder_tabs.xml | 4 +- app/src/main/res/layout/activity_report.xml | 26 +-- .../main/res/layout/activity_scheduled.xml | 2 +- .../layout/activity_search_result_tabs.xml | 2 +- .../main/res/layout/activity_status_info.xml | 17 +- app/src/main/res/layout/activity_webview.xml | 35 +-- .../res/layout/compose_attachment_item.xml | 4 +- app/src/main/res/layout/drawer_account.xml | 2 +- .../main/res/layout/drawer_account_reply.xml | 4 +- .../main/res/layout/drawer_account_search.xml | 6 +- .../main/res/layout/drawer_admin_account.xml | 2 +- .../main/res/layout/drawer_announcement.xml | 2 +- app/src/main/res/layout/drawer_checkbox.xml | 4 +- .../main/res/layout/drawer_conversation.xml | 2 +- .../main/res/layout/drawer_emoji_search.xml | 3 +- app/src/main/res/layout/drawer_filter.xml | 4 +- app/src/main/res/layout/drawer_follow.xml | 2 +- app/src/main/res/layout/drawer_reorder.xml | 2 +- app/src/main/res/layout/drawer_status.xml | 27 ++- .../main/res/layout/drawer_status_compose.xml | 12 +- .../main/res/layout/drawer_status_draft.xml | 4 +- .../res/layout/drawer_status_notification.xml | 22 +- .../main/res/layout/drawer_status_report.xml | 2 +- .../main/res/layout/drawer_status_simple.xml | 2 +- app/src/main/res/layout/drawer_tag.xml | 4 +- app/src/main/res/layout/drawer_tag_search.xml | 7 +- .../main/res/layout/drawer_top_menu_item.xml | 17 +- .../main/res/layout/fragment_login_join.xml | 3 +- .../main/res/layout/fragment_login_main.xml | 2 +- .../fragment_login_pick_instance_mastodon.xml | 2 +- .../fragment_login_register_mastodon.xml | 20 +- .../fragment_notification_container.xml | 4 +- .../main/res/layout/fragment_slide_media.xml | 204 +++++++++--------- app/src/main/res/layout/layout_reactions.xml | 6 +- app/src/main/res/layout/nav_header_main.xml | 2 +- .../layout/notifications_related_accounts.xml | 10 +- app/src/main/res/layout/popup_add_filter.xml | 28 +-- .../layout/popup_admin_filter_accounts.xml | 4 +- .../layout/popup_notification_settings.xml | 12 +- app/src/main/res/layout/simple_bar.xml | 3 +- app/src/main/res/menu/main.xml | 2 +- .../res/navigation/nav_graph_settings.xml | 3 +- app/src/main/res/values/strings.xml | 2 +- app/src/main/res/xml/pref_compose.xml | 12 +- app/src/main/res/xml/pref_interface.xml | 4 +- app/src/main/res/xml/pref_notifications.xml | 30 +-- app/src/main/res/xml/pref_timelines.xml | 60 +++--- 118 files changed, 1022 insertions(+), 1028 deletions(-) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 3a3c685e..d8995501 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -13,16 +13,15 @@ + android:usesCleartextTraffic="true" + tools:replace="android:allowBackup"> + @@ -112,8 +112,8 @@ + android:label="@string/search" + android:theme="@style/AppThemeBar" /> + android:theme="@style/AppThemeBarDark" + android:windowSoftInputMode="stateVisible" /> () { - @Override - public void onResourceReady(@NonNull final Drawable resource, Transition transition) { - binding.profilePicture.setImageDrawable(resource); - startPostponedEnterTransition(); - } - - @Override - public void onLoadFailed(@Nullable Drawable errorDrawable) { - binding.profilePicture.setImageResource(R.drawable.ic_person); - startPostponedEnterTransition(); - } - - @Override - public void onLoadCleared(@Nullable Drawable placeholder) { - - } - } - ); + new CustomTarget() { + @Override + public void onResourceReady(@NonNull final Drawable resource, Transition transition) { + binding.profilePicture.setImageDrawable(resource); + startPostponedEnterTransition(); + } + + @Override + public void onLoadFailed(@Nullable Drawable errorDrawable) { + binding.profilePicture.setImageResource(R.drawable.ic_person); + startPostponedEnterTransition(); + } + + @Override + public void onLoadCleared(@Nullable Drawable placeholder) { + + } + } + ); //Load header MastodonHelper.loadProfileMediaMastodon(binding.bannerPp, account, MastodonHelper.MediaAccountType.HEADER); //Redraws icon for locked accounts diff --git a/app/src/main/java/app/fedilab/android/activities/AdminReportActivity.java b/app/src/main/java/app/fedilab/android/activities/AdminReportActivity.java index e3c97445..caa43800 100644 --- a/app/src/main/java/app/fedilab/android/activities/AdminReportActivity.java +++ b/app/src/main/java/app/fedilab/android/activities/AdminReportActivity.java @@ -264,25 +264,25 @@ public class AdminReportActivity extends BaseActivity { .asDrawable() .dontTransform() .load(targetedUrl).into( - new CustomTarget() { - @Override - public void onResourceReady(@NonNull final Drawable resource, Transition transition) { - binding.profilePicture.setImageDrawable(resource); - startPostponedEnterTransition(); - } - - @Override - public void onLoadFailed(@Nullable Drawable errorDrawable) { - binding.profilePicture.setImageResource(R.drawable.ic_person); - startPostponedEnterTransition(); - } - - @Override - public void onLoadCleared(@Nullable Drawable placeholder) { - - } - } - ); + new CustomTarget() { + @Override + public void onResourceReady(@NonNull final Drawable resource, Transition transition) { + binding.profilePicture.setImageDrawable(resource); + startPostponedEnterTransition(); + } + + @Override + public void onLoadFailed(@Nullable Drawable errorDrawable) { + binding.profilePicture.setImageResource(R.drawable.ic_person); + startPostponedEnterTransition(); + } + + @Override + public void onLoadCleared(@Nullable Drawable placeholder) { + + } + } + ); //Load header MastodonHelper.loadProfileMediaMastodon(binding.bannerPp, account, MastodonHelper.MediaAccountType.HEADER); //Redraws icon for locked accounts diff --git a/app/src/main/java/app/fedilab/android/activities/ComposeActivity.java b/app/src/main/java/app/fedilab/android/activities/ComposeActivity.java index 2689deea..21703762 100644 --- a/app/src/main/java/app/fedilab/android/activities/ComposeActivity.java +++ b/app/src/main/java/app/fedilab/android/activities/ComposeActivity.java @@ -163,6 +163,33 @@ public class ComposeActivity extends BaseActivity implements ComposeAdapter.Mana return 3; } + private static String visibilityToString(int visibility) { + switch (visibility) { + case 3: + return "public"; + case 2: + return "unlisted"; + case 1: + return "private"; + case 0: + return "direct"; + } + return "public"; + } + + public static String getVisibility(String defaultVisibility) { + int tootVisibility = visibilityToNumber(defaultVisibility); + if (currentAccount != null && currentAccount.mastodon_account != null && currentAccount.mastodon_account.source != null) { + int userVisibility = visibilityToNumber(currentAccount.mastodon_account.source.privacy); + if (tootVisibility > userVisibility) { + return visibilityToString(userVisibility); + } else { + return visibilityToString(tootVisibility); + } + } + return defaultVisibility; + } + @Override protected void onDestroy() { super.onDestroy(); @@ -227,7 +254,6 @@ public class ComposeActivity extends BaseActivity implements ComposeAdapter.Mana binding.recyclerView.scrollToPosition(composeAdapter.getItemCount() - 1); } - /** * Intialize the common view for the context * @@ -253,7 +279,6 @@ public class ComposeActivity extends BaseActivity implements ComposeAdapter.Mana binding.recyclerView.scrollToPosition(composeAdapter.getItemCount() - 1); } - @Override public boolean onCreateOptionsMenu(@NonNull Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. @@ -261,7 +286,6 @@ public class ComposeActivity extends BaseActivity implements ComposeAdapter.Mana return true; } - @SuppressLint("ClickableViewAccessibility") @Override public boolean onOptionsItemSelected(MenuItem item) { @@ -398,7 +422,6 @@ public class ComposeActivity extends BaseActivity implements ComposeAdapter.Mana return true; } - private void onRetrieveContact(PopupContactBinding binding, List accounts) { binding.loader.setVisibility(View.GONE); if (accounts == null) { @@ -414,7 +437,6 @@ public class ComposeActivity extends BaseActivity implements ComposeAdapter.Mana binding.lvAccountsSearch.setLayoutManager(new LinearLayoutManager(ComposeActivity.this)); } - @Override public void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); @@ -437,33 +459,6 @@ public class ComposeActivity extends BaseActivity implements ComposeAdapter.Mana } } - private static String visibilityToString(int visibility) { - switch (visibility) { - case 3: - return "public"; - case 2: - return "unlisted"; - case 1: - return "private"; - case 0: - return "direct"; - } - return "public"; - } - - public static String getVisibility(String defaultVisibility) { - int tootVisibility = visibilityToNumber(defaultVisibility); - if (currentAccount != null && currentAccount.mastodon_account != null && currentAccount.mastodon_account.source != null) { - int userVisibility = visibilityToNumber(currentAccount.mastodon_account.source.privacy); - if (tootVisibility > userVisibility) { - return visibilityToString(userVisibility); - } else { - return visibilityToString(tootVisibility); - } - } - return defaultVisibility; - } - @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); diff --git a/app/src/main/java/app/fedilab/android/activities/EditProfileActivity.java b/app/src/main/java/app/fedilab/android/activities/EditProfileActivity.java index a71e61dc..052cc6c5 100644 --- a/app/src/main/java/app/fedilab/android/activities/EditProfileActivity.java +++ b/app/src/main/java/app/fedilab/android/activities/EditProfileActivity.java @@ -309,16 +309,16 @@ public class EditProfileActivity extends BaseActivity { return true; } else if (item.getItemId() == R.id.action_save) { accountsVM.updateCredentials(BaseMainActivity.currentInstance, BaseMainActivity.currentToken, - binding.discoverable.isChecked(), - binding.bot.isChecked(), - binding.displayName.getText().toString().trim(), - binding.bio.getText().toString(), - binding.locked.isChecked(), - getPrivacy(), - binding.sensitive.isChecked(), - null, - getFields() - ) + binding.discoverable.isChecked(), + binding.bot.isChecked(), + binding.displayName.getText().toString().trim(), + binding.bio.getText().toString(), + binding.locked.isChecked(), + getPrivacy(), + binding.sensitive.isChecked(), + null, + getFields() + ) .observe(EditProfileActivity.this, account -> { if (account != null) { currentAccount.mastodon_account = account; diff --git a/app/src/main/java/app/fedilab/android/activities/ProfileActivity.java b/app/src/main/java/app/fedilab/android/activities/ProfileActivity.java index 61c71a52..2de680bc 100644 --- a/app/src/main/java/app/fedilab/android/activities/ProfileActivity.java +++ b/app/src/main/java/app/fedilab/android/activities/ProfileActivity.java @@ -264,25 +264,25 @@ public class ProfileActivity extends BaseActivity { .asDrawable() .dontTransform() .load(targetedUrl).into( - new CustomTarget() { - @Override - public void onResourceReady(@NonNull final Drawable resource, Transition transition) { - binding.profilePicture.setImageDrawable(resource); - startPostponedEnterTransition(); - } - - @Override - public void onLoadFailed(@Nullable Drawable errorDrawable) { - binding.profilePicture.setImageResource(R.drawable.ic_person); - startPostponedEnterTransition(); - } - - @Override - public void onLoadCleared(@Nullable Drawable placeholder) { - - } - } - ); + new CustomTarget() { + @Override + public void onResourceReady(@NonNull final Drawable resource, Transition transition) { + binding.profilePicture.setImageDrawable(resource); + startPostponedEnterTransition(); + } + + @Override + public void onLoadFailed(@Nullable Drawable errorDrawable) { + binding.profilePicture.setImageResource(R.drawable.ic_person); + startPostponedEnterTransition(); + } + + @Override + public void onLoadCleared(@Nullable Drawable placeholder) { + + } + } + ); //Load header MastodonHelper.loadProfileMediaMastodon(binding.bannerPp, account, MastodonHelper.MediaAccountType.HEADER); //Redraws icon for locked accounts diff --git a/app/src/main/java/app/fedilab/android/activities/ReorderTimelinesActivity.java b/app/src/main/java/app/fedilab/android/activities/ReorderTimelinesActivity.java index 7a2dedbd..a37397fb 100644 --- a/app/src/main/java/app/fedilab/android/activities/ReorderTimelinesActivity.java +++ b/app/src/main/java/app/fedilab/android/activities/ReorderTimelinesActivity.java @@ -93,6 +93,7 @@ public class ReorderTimelinesActivity extends BaseActivity implements OnStartDra private boolean changes; private boolean bottomChanges; private boolean update; + public void setChanges(boolean changes) { this.changes = changes; } diff --git a/app/src/main/java/app/fedilab/android/activities/SearchResultTabActivity.java b/app/src/main/java/app/fedilab/android/activities/SearchResultTabActivity.java index 1cb92672..bb8c6771 100644 --- a/app/src/main/java/app/fedilab/android/activities/SearchResultTabActivity.java +++ b/app/src/main/java/app/fedilab/android/activities/SearchResultTabActivity.java @@ -94,6 +94,7 @@ public class SearchResultTabActivity extends BaseActivity { @Override public void onTabUnselected(TabLayout.Tab tab) { } + @Override public void onTabReselected(TabLayout.Tab tab) { Fragment fragment; diff --git a/app/src/main/java/app/fedilab/android/client/entities/api/Account.java b/app/src/main/java/app/fedilab/android/client/entities/api/Account.java index fd444d4d..36fb7a74 100644 --- a/app/src/main/java/app/fedilab/android/client/entities/api/Account.java +++ b/app/src/main/java/app/fedilab/android/client/entities/api/Account.java @@ -78,6 +78,7 @@ public class Account implements Serializable { public Date mute_expires_at; @SerializedName("moved") public Account moved; + public transient RelationShip relationShip; public synchronized Spannable getSpanDisplayName(Context context, WeakReference viewWeakReference) { if (display_name == null || display_name.isEmpty()) { @@ -90,14 +91,10 @@ public class Account implements Serializable { return SpannableHelper.convert(context, title, null, this, null, false, viewWeakReference); } - public synchronized Spannable getSpanNote(Context context, WeakReference viewWeakReference) { return SpannableHelper.convert(context, note, null, this, null, true, viewWeakReference); } - public transient RelationShip relationShip; - - public static class AccountParams implements Serializable { @SerializedName("discoverable") public boolean discoverable; diff --git a/app/src/main/java/app/fedilab/android/client/entities/api/Instance.java b/app/src/main/java/app/fedilab/android/client/entities/api/Instance.java index 1ea2c726..551b1031 100644 --- a/app/src/main/java/app/fedilab/android/client/entities/api/Instance.java +++ b/app/src/main/java/app/fedilab/android/client/entities/api/Instance.java @@ -61,6 +61,24 @@ public class Instance implements Serializable { @SerializedName("max_toot_chars") public String max_toot_chars; + public static String serialize(Instance instance) { + Gson gson = new Gson(); + try { + return gson.toJson(instance); + } catch (Exception e) { + return null; + } + } + + public static Instance restore(String serialized) { + Gson gson = new Gson(); + try { + return gson.fromJson(serialized, Instance.class); + } catch (Exception e) { + return null; + } + } + public List getMimeTypeAudio() { List mimeTypes = new ArrayList<>(); if (configuration == null || configuration.media_attachments == null || configuration.media_attachments.supported_mime_types == null) { @@ -87,7 +105,6 @@ public class Instance implements Serializable { return mimeTypes; } - public List getMimeTypeImage() { List mimeTypes = new ArrayList<>(); if (configuration == null || configuration.media_attachments == null || configuration.media_attachments.supported_mime_types == null) { @@ -114,25 +131,6 @@ public class Instance implements Serializable { return mimeTypes; } - - public static String serialize(Instance instance) { - Gson gson = new Gson(); - try { - return gson.toJson(instance); - } catch (Exception e) { - return null; - } - } - - public static Instance restore(String serialized) { - Gson gson = new Gson(); - try { - return gson.fromJson(serialized, Instance.class); - } catch (Exception e) { - return null; - } - } - public static class Configuration implements Serializable { @SerializedName("statuses") public StatusesConf statusesConf; diff --git a/app/src/main/java/app/fedilab/android/client/entities/api/Status.java b/app/src/main/java/app/fedilab/android/client/entities/api/Status.java index 3fc77d05..f0623ea2 100644 --- a/app/src/main/java/app/fedilab/android/client/entities/api/Status.java +++ b/app/src/main/java/app/fedilab/android/client/entities/api/Status.java @@ -94,18 +94,7 @@ public class Status implements Serializable, Cloneable { public Pleroma pleroma; @SerializedName("cached") public boolean cached = false; - - @Override - public boolean equals(@Nullable Object obj) { - boolean same = false; - if (obj instanceof Status) { - same = this.id.equals(((Status) obj).id); - } - return same; - } - public Attachment art_attachment; - public boolean isExpended = false; public boolean isTruncated = true; public boolean isFetchMore = false; @@ -119,6 +108,15 @@ public class Status implements Serializable, Cloneable { public transient boolean setCursorToEnd = false; public transient int cursorPosition = 0; public transient boolean submitted = false; + + @Override + public boolean equals(@Nullable Object obj) { + boolean same = false; + if (obj instanceof Status) { + same = this.id.equals(((Status) obj).id); + } + return same; + } //Some extra spannable element - They will be filled automatically when fetching the status public synchronized Spannable getSpanContent(Context context, WeakReference viewWeakReference) { diff --git a/app/src/main/java/app/fedilab/android/client/entities/app/StatusCache.java b/app/src/main/java/app/fedilab/android/client/entities/app/StatusCache.java index 42b432c9..9d2dfc27 100644 --- a/app/src/main/java/app/fedilab/android/client/entities/app/StatusCache.java +++ b/app/src/main/java/app/fedilab/android/client/entities/app/StatusCache.java @@ -471,23 +471,6 @@ public class StatusCache { return reply; } - public enum order { - @SerializedName("ASC") - ASC("ASC"), - @SerializedName("DESC") - DESC("DESC"); - private final String value; - - order(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - } - - public int count(BaseAccount account) throws DBException { if (db == null) { throw new DBException("db is null. Wrong initialization."); @@ -556,4 +539,20 @@ public class StatusCache { return restoreStatusFromString(serializedStatus); } + public enum order { + @SerializedName("ASC") + ASC("ASC"), + @SerializedName("DESC") + DESC("DESC"); + private final String value; + + order(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + } + } diff --git a/app/src/main/java/app/fedilab/android/client/entities/peertube/PeertubeVideo.java b/app/src/main/java/app/fedilab/android/client/entities/peertube/PeertubeVideo.java index c4751aff..8952b4d9 100644 --- a/app/src/main/java/app/fedilab/android/client/entities/peertube/PeertubeVideo.java +++ b/app/src/main/java/app/fedilab/android/client/entities/peertube/PeertubeVideo.java @@ -121,40 +121,6 @@ public class PeertubeVideo implements Serializable { public List streamingPlaylists; } - public class StreamingPlaylist implements Serializable { - @SerializedName("id") - public String id; - @SerializedName("type") - public int type; - @SerializedName("playlistUrl") - public String playlistUrl; - @SerializedName("segmentsSha256Url") - public String segmentsSha256Url; - @SerializedName("files") - public List files; - } - - public class File implements Serializable { - @SerializedName("fileDownloadUrl") - public String fileDownloadUrl; - @SerializedName("fileUrl") - public String fileUrl; - @SerializedName("fps") - public int fps; - @SerializedName("magnetUri") - public String magnetUri; - @SerializedName("metadataUrl") - public String metadataUrl; - @SerializedName("resolution") - public Item resolutions; - @SerializedName("size") - public long size; - @SerializedName("torrentDownloadUrl") - public String torrentDownloadUrl; - @SerializedName("torrentUrl") - public String torrentUrl; - } - public static class PeertubeAccount implements Serializable { @SerializedName("avatar") public Avatar avatar; @@ -223,4 +189,38 @@ public class PeertubeVideo implements Serializable { @SerializedName("updatedAt") public Date updatedAt; } + + public class StreamingPlaylist implements Serializable { + @SerializedName("id") + public String id; + @SerializedName("type") + public int type; + @SerializedName("playlistUrl") + public String playlistUrl; + @SerializedName("segmentsSha256Url") + public String segmentsSha256Url; + @SerializedName("files") + public List files; + } + + public class File implements Serializable { + @SerializedName("fileDownloadUrl") + public String fileDownloadUrl; + @SerializedName("fileUrl") + public String fileUrl; + @SerializedName("fps") + public int fps; + @SerializedName("magnetUri") + public String magnetUri; + @SerializedName("metadataUrl") + public String metadataUrl; + @SerializedName("resolution") + public Item resolutions; + @SerializedName("size") + public long size; + @SerializedName("torrentDownloadUrl") + public String torrentDownloadUrl; + @SerializedName("torrentUrl") + public String torrentUrl; + } } diff --git a/app/src/main/java/app/fedilab/android/helper/Helper.java b/app/src/main/java/app/fedilab/android/helper/Helper.java index f578af3b..50b917d5 100644 --- a/app/src/main/java/app/fedilab/android/helper/Helper.java +++ b/app/src/main/java/app/fedilab/android/helper/Helper.java @@ -368,6 +368,7 @@ public class Helper { }; public static int counter = 1; + private static int notificationId = 1; static { LinkedHashMap aMap = new LinkedHashMap<>(); @@ -888,7 +889,6 @@ public class Helper { return Cyanea.getInstance().isDark() ? R.style.PopupDark : R.style.Popup; } - /** * Load a media into a view * @@ -1068,7 +1068,6 @@ public class Helper { } - /** * Load a profile picture for the account * @@ -1120,7 +1119,6 @@ public class Helper { } } - public static Proxy getProxy(Context context) { SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(context); String hostVal = sharedpreferences.getString(context.getString(R.string.SET_PROXY_HOST), "127.0.0.1"); @@ -1182,7 +1180,6 @@ public class Helper { return MultipartBody.Part.createFormData(paramName, attachment.filename, requestFile); } - /** * Creates MultipartBody.Part from Uri * @@ -1235,7 +1232,6 @@ public class Helper { return MultipartBody.Part.createFormData(paramName, attachment.filename, requestFile); } - public static MultipartBody.Part getMultipartBody(Context context, @NonNull String paramName, @NonNull Uri uri) { byte[] imageBytes = uriToByteArray(context, uri); ContentResolver cR = context.getApplicationContext().getContentResolver(); @@ -1419,9 +1415,6 @@ public class Helper { imm.showSoftInput(view, InputMethodManager.SHOW_IMPLICIT); } - - private static int notificationId = 1; - /** * Sends notification with intent * @@ -1635,32 +1628,6 @@ public class Helper { return "@fedilab_fetch_more_" + uuid; } - - //Enum that described actions to replace inside a toot content - public enum PatternType { - MENTION, - MENTION_LONG, - TAG, - GROUP - } - - public enum NotifType { - FOLLLOW, - MENTION, - BOOST, - FAV, - POLL, - STATUS, - BACKUP, - STORE, - TOOT - } - - public interface OnAttachmentCopied { - void onAttachmentCopied(Attachment attachment); - } - - public static Gson getDateBuilder() { SimpleDateFormat[] formats = new SimpleDateFormat[]{ new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ", Locale.getDefault()), @@ -1693,7 +1660,6 @@ public class Helper { .create(); } - /*** * Download method which works for http and https connections * @param downloadUrl String download url @@ -1772,7 +1738,6 @@ public class Helper { return null; } - public static void displayReleaseNotesIfNeeded(Activity activity, boolean forced) { SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(activity); int lastReleaseNoteRead = sharedpreferences.getInt(activity.getString(R.string.SET_POPUP_RELEASE_NOTES), 0); @@ -1879,4 +1844,30 @@ public class Helper { editor.apply(); } } + + + //Enum that described actions to replace inside a toot content + public enum PatternType { + MENTION, + MENTION_LONG, + TAG, + GROUP + } + + public enum NotifType { + FOLLLOW, + MENTION, + BOOST, + FAV, + POLL, + STATUS, + BACKUP, + STORE, + TOOT + } + + + public interface OnAttachmentCopied { + void onAttachmentCopied(Attachment attachment); + } } diff --git a/app/src/main/java/app/fedilab/android/helper/MastodonHelper.java b/app/src/main/java/app/fedilab/android/helper/MastodonHelper.java index cc0e78e7..0eb3f854 100644 --- a/app/src/main/java/app/fedilab/android/helper/MastodonHelper.java +++ b/app/src/main/java/app/fedilab/android/helper/MastodonHelper.java @@ -466,6 +466,21 @@ public class MastodonHelper { adapter.notifyItemRangeInserted(i, statusesToInsert.size()); } + public static int getInstanceMaxChars(Context context) { + int max_car; + if (instanceInfo != null) { + max_car = instanceInfo.max_toot_chars != null ? Integer.parseInt(instanceInfo.max_toot_chars) : instanceInfo.configuration.statusesConf.max_characters; + } else { + SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(context); + int val = sharedpreferences.getInt(context.getString(R.string.SET_MAX_INSTANCE_CHAR) + MainActivity.currentInstance, -1); + if (val != -1) { + return val; + } else { + max_car = 500; + } + } + return max_car; + } public enum MediaAccountType { AVATAR, @@ -501,20 +516,4 @@ public class MastodonHelper { public interface TimedMuted { void onTimedMute(RelationShip relationShip); } - - public static int getInstanceMaxChars(Context context) { - int max_car; - if (instanceInfo != null) { - max_car = instanceInfo.max_toot_chars != null ? Integer.parseInt(instanceInfo.max_toot_chars) : instanceInfo.configuration.statusesConf.max_characters; - } else { - SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(context); - int val = sharedpreferences.getInt(context.getString(R.string.SET_MAX_INSTANCE_CHAR) + MainActivity.currentInstance, -1); - if (val != -1) { - return val; - } else { - max_car = 500; - } - } - return max_car; - } } diff --git a/app/src/main/java/app/fedilab/android/helper/MediaHelper.java b/app/src/main/java/app/fedilab/android/helper/MediaHelper.java index 932e6180..5265a9b3 100644 --- a/app/src/main/java/app/fedilab/android/helper/MediaHelper.java +++ b/app/src/main/java/app/fedilab/android/helper/MediaHelper.java @@ -389,16 +389,6 @@ public class MediaHelper { alertDialog.show(); } - - //Listener for recording media - public interface ActionRecord { - void onRecorded(String file); - } - - public interface OnSchedule { - void scheduledAt(String scheduledDate); - } - /** * Returns the max height of a list of media * @@ -416,4 +406,13 @@ public class MediaHelper { } return maxHeight; } + + //Listener for recording media + public interface ActionRecord { + void onRecorded(String file); + } + + public interface OnSchedule { + void scheduledAt(String scheduledDate); + } } diff --git a/app/src/main/java/app/fedilab/android/helper/PinnedTimelineHelper.java b/app/src/main/java/app/fedilab/android/helper/PinnedTimelineHelper.java index 748d2087..babf5e07 100644 --- a/app/src/main/java/app/fedilab/android/helper/PinnedTimelineHelper.java +++ b/app/src/main/java/app/fedilab/android/helper/PinnedTimelineHelper.java @@ -859,7 +859,7 @@ public class PinnedTimelineHelper { /** * Manage long clicks on followed instances * - * @param activity - BaseMainActivity activity + * @param activity - BaseMainActivity activity * @param pinned - {@link Pinned} * @param view - View * @param position - int position of the tab diff --git a/app/src/main/java/app/fedilab/android/ui/drawer/AnnouncementAdapter.java b/app/src/main/java/app/fedilab/android/ui/drawer/AnnouncementAdapter.java index 4fe486c9..43f7a897 100644 --- a/app/src/main/java/app/fedilab/android/ui/drawer/AnnouncementAdapter.java +++ b/app/src/main/java/app/fedilab/android/ui/drawer/AnnouncementAdapter.java @@ -112,37 +112,37 @@ public class AnnouncementAdapter extends RecyclerView.Adapter { EmojiManager.install(new EmojiOneProvider()); final EmojiPopup emojiPopup = EmojiPopup.Builder.fromRootView(holder.binding.statusEmoji).setOnEmojiPopupDismissListener(() -> { - InputMethodManager imm = (InputMethodManager) context.getSystemService(INPUT_METHOD_SERVICE); - imm.hideSoftInputFromWindow(holder.binding.statusEmoji.getWindowToken(), 0); - }).setOnEmojiClickListener((emoji, imageView) -> { - String emojiStr = imageView.getUnicode(); - boolean alreadyAdded = false; - for (Reaction reaction : announcement.reactions) { - if (reaction.name.compareTo(emojiStr) == 0) { - alreadyAdded = true; - reaction.count = (reaction.count - 1); - if (reaction.count == 0) { - announcement.reactions.remove(reaction); + InputMethodManager imm = (InputMethodManager) context.getSystemService(INPUT_METHOD_SERVICE); + imm.hideSoftInputFromWindow(holder.binding.statusEmoji.getWindowToken(), 0); + }).setOnEmojiClickListener((emoji, imageView) -> { + String emojiStr = imageView.getUnicode(); + boolean alreadyAdded = false; + for (Reaction reaction : announcement.reactions) { + if (reaction.name.compareTo(emojiStr) == 0) { + alreadyAdded = true; + reaction.count = (reaction.count - 1); + if (reaction.count == 0) { + announcement.reactions.remove(reaction); + } + notifyItemChanged(position); + break; + } } - notifyItemChanged(position); - break; - } - } - if (!alreadyAdded) { - Reaction reaction = new Reaction(); - reaction.me = true; - reaction.count = 1; - reaction.name = emojiStr; - announcement.reactions.add(0, reaction); - notifyItemChanged(position); - } - announcementsVM = new ViewModelProvider((ViewModelStoreOwner) context).get(AnnouncementsVM.class); - if (alreadyAdded) { - announcementsVM.removeReaction(BaseMainActivity.currentInstance, BaseMainActivity.currentToken, announcement.id, emojiStr); - } else { - announcementsVM.addReaction(BaseMainActivity.currentInstance, BaseMainActivity.currentToken, announcement.id, emojiStr); - } - }) + if (!alreadyAdded) { + Reaction reaction = new Reaction(); + reaction.me = true; + reaction.count = 1; + reaction.name = emojiStr; + announcement.reactions.add(0, reaction); + notifyItemChanged(position); + } + announcementsVM = new ViewModelProvider((ViewModelStoreOwner) context).get(AnnouncementsVM.class); + if (alreadyAdded) { + announcementsVM.removeReaction(BaseMainActivity.currentInstance, BaseMainActivity.currentToken, announcement.id, emojiStr); + } else { + announcementsVM.addReaction(BaseMainActivity.currentInstance, BaseMainActivity.currentToken, announcement.id, emojiStr); + } + }) .build(holder.binding.layoutReactions.fakeEdittext); emojiPopup.toggle(); }); diff --git a/app/src/main/java/app/fedilab/android/ui/drawer/ComposeAdapter.java b/app/src/main/java/app/fedilab/android/ui/drawer/ComposeAdapter.java index 3c0a081e..dc9ef7eb 100644 --- a/app/src/main/java/app/fedilab/android/ui/drawer/ComposeAdapter.java +++ b/app/src/main/java/app/fedilab/android/ui/drawer/ComposeAdapter.java @@ -138,6 +138,7 @@ public class ComposeAdapter extends RecyclerView.Adapter emojisList = new ArrayList<>(); public ComposeAdapter(List statusList, int statusCount, BaseAccount account, app.fedilab.android.client.entities.api.Account mentionedAccount, String visibility) { this.statusList = statusList; @@ -455,6 +456,7 @@ public class ComposeAdapter extends RecyclerView.Adapter //Used to write contact when composing public void updateContent(boolean checked, String acct) { @@ -466,7 +468,6 @@ public class ComposeAdapter extends RecyclerView.Adapter //Put cursor to the end after changing contacts public void putCursor() { @@ -691,7 +692,6 @@ public class ComposeAdapter extends RecyclerView.Adapter emojisList = new ArrayList<>(); /** * Initialize text watcher for content writing * It will allow to complete autocomplete edit text while starting words with @, #, : etc. diff --git a/app/src/main/java/app/fedilab/android/ui/drawer/StatusAdapter.java b/app/src/main/java/app/fedilab/android/ui/drawer/StatusAdapter.java index 9f94e9b6..b932c074 100644 --- a/app/src/main/java/app/fedilab/android/ui/drawer/StatusAdapter.java +++ b/app/src/main/java/app/fedilab/android/ui/drawer/StatusAdapter.java @@ -147,9 +147,9 @@ public class StatusAdapter extends RecyclerView.Adapter private final List statusList; private final boolean minified; private final Timeline.TimeLineEnum timelineType; + private final boolean canBeFederated; public FetchMoreCallBack fetchMoreCallBack; private Context context; - private final boolean canBeFederated; public StatusAdapter(List statuses, Timeline.TimeLineEnum timelineType, boolean minified, boolean canBeFederated) { this.statusList = statuses; @@ -304,14 +304,14 @@ public class StatusAdapter extends RecyclerView.Adapter /** * Manage status, this method is also reused in notifications timelines * - * @param context Context - * @param statusesVM StatusesVM - For handling actions in background to the correct activity - * @param searchVM SearchVM - For handling remote actions - * @param holder StatusViewHolder - * @param adapter RecyclerView.Adapter - General adapter that can be for {@link StatusAdapter} or {@link NotificationAdapter} - * @param statusList List - * @param timelineType Timeline.TimeLineEnum timelineTypeTimeline.TimeLineEnum - * @param status {@link Status} + * @param context Context + * @param statusesVM StatusesVM - For handling actions in background to the correct activity + * @param searchVM SearchVM - For handling remote actions + * @param holder StatusViewHolder + * @param adapter RecyclerView.Adapter - General adapter that can be for {@link StatusAdapter} or {@link NotificationAdapter} + * @param statusList List + * @param timelineType Timeline.TimeLineEnum timelineTypeTimeline.TimeLineEnum + * @param status {@link Status} */ @SuppressLint("ClickableViewAccessibility") public static void statusManagement(Context context, @@ -359,40 +359,40 @@ public class StatusAdapter extends RecyclerView.Adapter holder.binding.statusEmoji.setOnClickListener(v -> { EmojiManager.install(new EmojiOneProvider()); final EmojiPopup emojiPopup = EmojiPopup.Builder.fromRootView(holder.binding.statusEmoji).setOnEmojiPopupDismissListener(() -> { - InputMethodManager imm = (InputMethodManager) context.getSystemService(INPUT_METHOD_SERVICE); - imm.hideSoftInputFromWindow(holder.binding.statusEmoji.getWindowToken(), 0); - }).setOnEmojiClickListener((emoji, imageView) -> { - String emojiStr = imageView.getUnicode(); - boolean alreadyAdded = false; - if (status.pleroma == null || status.pleroma.emoji_reactions == null) { - return; - } - for (Reaction reaction : status.pleroma.emoji_reactions) { - if (reaction.name.compareTo(emojiStr) == 0) { - alreadyAdded = true; - reaction.count = (reaction.count - 1); - if (reaction.count == 0) { - status.pleroma.emoji_reactions.remove(reaction); + InputMethodManager imm = (InputMethodManager) context.getSystemService(INPUT_METHOD_SERVICE); + imm.hideSoftInputFromWindow(holder.binding.statusEmoji.getWindowToken(), 0); + }).setOnEmojiClickListener((emoji, imageView) -> { + String emojiStr = imageView.getUnicode(); + boolean alreadyAdded = false; + if (status.pleroma == null || status.pleroma.emoji_reactions == null) { + return; } - adapter.notifyItemChanged(holder.getBindingAdapterPosition()); - break; - } - } - if (!alreadyAdded) { - Reaction reaction = new Reaction(); - reaction.me = true; - reaction.count = 1; - reaction.name = emojiStr; - status.pleroma.emoji_reactions.add(0, reaction); - adapter.notifyItemChanged(holder.getBindingAdapterPosition()); - } - ActionsVM actionVM = new ViewModelProvider((ViewModelStoreOwner) context).get(ActionsVM.class); - if (alreadyAdded) { - actionVM.removeReaction(BaseMainActivity.currentInstance, BaseMainActivity.currentToken, statusToDeal.id, emojiStr); - } else { - actionVM.addReaction(BaseMainActivity.currentInstance, BaseMainActivity.currentToken, statusToDeal.id, emojiStr); - } - }) + for (Reaction reaction : status.pleroma.emoji_reactions) { + if (reaction.name.compareTo(emojiStr) == 0) { + alreadyAdded = true; + reaction.count = (reaction.count - 1); + if (reaction.count == 0) { + status.pleroma.emoji_reactions.remove(reaction); + } + adapter.notifyItemChanged(holder.getBindingAdapterPosition()); + break; + } + } + if (!alreadyAdded) { + Reaction reaction = new Reaction(); + reaction.me = true; + reaction.count = 1; + reaction.name = emojiStr; + status.pleroma.emoji_reactions.add(0, reaction); + adapter.notifyItemChanged(holder.getBindingAdapterPosition()); + } + ActionsVM actionVM = new ViewModelProvider((ViewModelStoreOwner) context).get(ActionsVM.class); + if (alreadyAdded) { + actionVM.removeReaction(BaseMainActivity.currentInstance, BaseMainActivity.currentToken, statusToDeal.id, emojiStr); + } else { + actionVM.addReaction(BaseMainActivity.currentInstance, BaseMainActivity.currentToken, statusToDeal.id, emojiStr); + } + }) .build(holder.binding.layoutReactions.fakeEdittext); emojiPopup.toggle(); }); diff --git a/app/src/main/java/app/fedilab/android/ui/fragment/admin/FragmentAdminAccount.java b/app/src/main/java/app/fedilab/android/ui/fragment/admin/FragmentAdminAccount.java index 756b1c12..8c8b6a37 100644 --- a/app/src/main/java/app/fedilab/android/ui/fragment/admin/FragmentAdminAccount.java +++ b/app/src/main/java/app/fedilab/android/ui/fragment/admin/FragmentAdminAccount.java @@ -68,18 +68,18 @@ public class FragmentAdminAccount extends Fragment { private void fetchAccount(Callback callback) { adminVM.getAccounts( - BaseMainActivity.currentInstance, BaseMainActivity.currentToken, - AdminActionActivity.local, - AdminActionActivity.remote, - byDomain, - AdminActionActivity.active, - AdminActionActivity.pending, - AdminActionActivity.disabled, - AdminActionActivity.silenced, - AdminActionActivity.suspended, - username, displayName, email, ip, - AdminActionActivity.staff, max_id, null, - MastodonHelper.statusesPerCall(requireActivity())) + BaseMainActivity.currentInstance, BaseMainActivity.currentToken, + AdminActionActivity.local, + AdminActionActivity.remote, + byDomain, + AdminActionActivity.active, + AdminActionActivity.pending, + AdminActionActivity.disabled, + AdminActionActivity.silenced, + AdminActionActivity.suspended, + username, displayName, email, ip, + AdminActionActivity.staff, max_id, null, + MastodonHelper.statusesPerCall(requireActivity())) .observe(requireActivity(), callback::accountFetched); } diff --git a/app/src/main/java/app/fedilab/android/ui/fragment/admin/FragmentAdminReport.java b/app/src/main/java/app/fedilab/android/ui/fragment/admin/FragmentAdminReport.java index 26e77f0d..cfbad282 100644 --- a/app/src/main/java/app/fedilab/android/ui/fragment/admin/FragmentAdminReport.java +++ b/app/src/main/java/app/fedilab/android/ui/fragment/admin/FragmentAdminReport.java @@ -82,7 +82,7 @@ public class FragmentAdminReport extends Fragment { binding.recyclerView.setVisibility(View.GONE); flagLoading = false; adminVM.getReports( - BaseMainActivity.currentInstance, BaseMainActivity.currentToken, AdminActionActivity.resolved, null, null, null) + BaseMainActivity.currentInstance, BaseMainActivity.currentToken, AdminActionActivity.resolved, null, null, null) .observe(getViewLifecycleOwner(), this::initializeStatusesCommonView); return binding.getRoot(); } @@ -109,7 +109,7 @@ public class FragmentAdminReport extends Fragment { max_id = null; flagLoading = false; adminVM.getReports( - BaseMainActivity.currentInstance, BaseMainActivity.currentToken, AdminActionActivity.resolved, null, null, null) + BaseMainActivity.currentInstance, BaseMainActivity.currentToken, AdminActionActivity.resolved, null, null, null) .observe(getViewLifecycleOwner(), this::initializeStatusesCommonView); }); @@ -162,7 +162,7 @@ public class FragmentAdminReport extends Fragment { flagLoading = true; binding.loadingNextElements.setVisibility(View.VISIBLE); adminVM.getReports( - BaseMainActivity.currentInstance, BaseMainActivity.currentToken, AdminActionActivity.resolved, null, null, max_id) + BaseMainActivity.currentInstance, BaseMainActivity.currentToken, AdminActionActivity.resolved, null, null, max_id) .observe(getViewLifecycleOwner(), adminReports1 -> dealWithPagination(adminReports1)); } } else { diff --git a/app/src/main/java/app/fedilab/android/ui/fragment/media/FragmentMedia.java b/app/src/main/java/app/fedilab/android/ui/fragment/media/FragmentMedia.java index 5632de8d..277d75cf 100644 --- a/app/src/main/java/app/fedilab/android/ui/fragment/media/FragmentMedia.java +++ b/app/src/main/java/app/fedilab/android/ui/fragment/media/FragmentMedia.java @@ -127,77 +127,77 @@ public class FragmentMedia extends Fragment { .asBitmap() .dontTransform() .load(preview_url).into( - new CustomTarget() { - @Override - public void onResourceReady(@NonNull final Bitmap resource, Transition transition) { - binding.mediaPicture.setImageBitmap(resource); - scheduleStartPostponedTransition(binding.mediaPicture); - if (attachment.type.equalsIgnoreCase("image") && !attachment.url.toLowerCase().endsWith(".gif")) { - final Handler handler = new Handler(); - handler.postDelayed(() -> { - if (binding == null) { - return; + new CustomTarget() { + @Override + public void onResourceReady(@NonNull final Bitmap resource, Transition transition) { + binding.mediaPicture.setImageBitmap(resource); + scheduleStartPostponedTransition(binding.mediaPicture); + if (attachment.type.equalsIgnoreCase("image") && !attachment.url.toLowerCase().endsWith(".gif")) { + final Handler handler = new Handler(); + handler.postDelayed(() -> { + if (binding == null) { + return; + } + binding.pbarInf.setScaleY(1f); + binding.mediaPicture.setVisibility(View.VISIBLE); + binding.pbarInf.setIndeterminate(true); + binding.loader.setVisibility(View.VISIBLE); + if (binding == null || !isAdded() || getActivity() == null) { + return; + } + if (Helper.isValidContextForGlide(requireActivity()) && isAdded()) { + Glide.with(requireActivity()) + .asBitmap() + .dontTransform() + .load(url).into( + new CustomTarget() { + @Override + public void onResourceReady(@NonNull final Bitmap resource, Transition transition) { + if (binding != null) { + binding.loader.setVisibility(View.GONE); + if (binding.mediaPicture.getScale() < 1.1) { + binding.mediaPicture.setImageBitmap(resource); + } else { + binding.messageReady.setVisibility(View.VISIBLE); + } + binding.messageReady.setOnClickListener(view -> { + binding.mediaPicture.setImageBitmap(resource); + binding.messageReady.setVisibility(View.GONE); + }); + } + } + + @Override + public void onLoadCleared(@Nullable Drawable placeholder) { + + } + } + ); + } + }, 1000); + + + } else if (attachment.type.equalsIgnoreCase("image") && attachment.url.toLowerCase().endsWith(".gif")) { + binding.loader.setVisibility(View.GONE); + if (Helper.isValidContextForGlide(requireActivity())) { + Glide.with(requireActivity()) + .load(url).into(binding.mediaPicture); + } + scheduleStartPostponedTransition(binding.mediaPicture); } - binding.pbarInf.setScaleY(1f); - binding.mediaPicture.setVisibility(View.VISIBLE); - binding.pbarInf.setIndeterminate(true); - binding.loader.setVisibility(View.VISIBLE); - if (binding == null || !isAdded() || getActivity() == null) { - return; - } - if (Helper.isValidContextForGlide(requireActivity()) && isAdded()) { - Glide.with(requireActivity()) - .asBitmap() - .dontTransform() - .load(url).into( - new CustomTarget() { - @Override - public void onResourceReady(@NonNull final Bitmap resource, Transition transition) { - if (binding != null) { - binding.loader.setVisibility(View.GONE); - if (binding.mediaPicture.getScale() < 1.1) { - binding.mediaPicture.setImageBitmap(resource); - } else { - binding.messageReady.setVisibility(View.VISIBLE); - } - binding.messageReady.setOnClickListener(view -> { - binding.mediaPicture.setImageBitmap(resource); - binding.messageReady.setVisibility(View.GONE); - }); - } - } - - @Override - public void onLoadCleared(@Nullable Drawable placeholder) { - - } - } - ); - } - }, 1000); - - - } else if (attachment.type.equalsIgnoreCase("image") && attachment.url.toLowerCase().endsWith(".gif")) { - binding.loader.setVisibility(View.GONE); - if (Helper.isValidContextForGlide(requireActivity())) { - Glide.with(requireActivity()) - .load(url).into(binding.mediaPicture); } - scheduleStartPostponedTransition(binding.mediaPicture); - } - } - @Override - public void onLoadFailed(@Nullable Drawable errorDrawable) { - scheduleStartPostponedTransition(binding.mediaPicture); - } + @Override + public void onLoadFailed(@Nullable Drawable errorDrawable) { + scheduleStartPostponedTransition(binding.mediaPicture); + } - @Override - public void onLoadCleared(@Nullable Drawable placeholder) { + @Override + public void onLoadCleared(@Nullable Drawable placeholder) { - } - } - ); + } + } + ); } switch (type.toLowerCase()) { case "video": diff --git a/app/src/main/java/app/fedilab/android/ui/pageadapter/FedilabPageAdapter.java b/app/src/main/java/app/fedilab/android/ui/pageadapter/FedilabPageAdapter.java index 76e296c2..65b2a4cf 100644 --- a/app/src/main/java/app/fedilab/android/ui/pageadapter/FedilabPageAdapter.java +++ b/app/src/main/java/app/fedilab/android/ui/pageadapter/FedilabPageAdapter.java @@ -44,8 +44,8 @@ public class FedilabPageAdapter extends FragmentStatePagerAdapter { private final Pinned pinned; private final BottomMenu bottomMenu; private final int toRemove; - private Fragment mCurrentFragment; private final boolean singleBar; + private Fragment mCurrentFragment; public FedilabPageAdapter(BaseMainActivity activity, FragmentManager fm, Pinned pinned, BottomMenu bottomMenu) { super(fm, BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT); diff --git a/app/src/main/java/app/fedilab/android/ui/pageadapter/FedilabProfileTLPageAdapter.java b/app/src/main/java/app/fedilab/android/ui/pageadapter/FedilabProfileTLPageAdapter.java index 30542d21..585a6b48 100644 --- a/app/src/main/java/app/fedilab/android/ui/pageadapter/FedilabProfileTLPageAdapter.java +++ b/app/src/main/java/app/fedilab/android/ui/pageadapter/FedilabProfileTLPageAdapter.java @@ -77,6 +77,7 @@ public class FedilabProfileTLPageAdapter extends FragmentStatePagerAdapter { public int getCount() { return 3; } + public enum follow_type { FOLLOWING, FOLLOWERS diff --git a/app/src/main/java/app/fedilab/android/viewmodel/mastodon/TimelinesVM.java b/app/src/main/java/app/fedilab/android/viewmodel/mastodon/TimelinesVM.java index 23b9aab3..9a072b4b 100644 --- a/app/src/main/java/app/fedilab/android/viewmodel/mastodon/TimelinesVM.java +++ b/app/src/main/java/app/fedilab/android/viewmodel/mastodon/TimelinesVM.java @@ -352,6 +352,7 @@ public class TimelinesVM extends AndroidViewModel { case HOME: timelineCall = mastodonTimelinesService.getHome(timelineParams.token, timelineParams.maxId, timelineParams.sinceId, timelineParams.minId, timelineParams.limit, timelineParams.local); break; + case REMOTE: case LOCAL: timelineCall = mastodonTimelinesService.getPublic(timelineParams.token, true, false, timelineParams.onlyMedia, timelineParams.maxId, timelineParams.sinceId, timelineParams.minId, timelineParams.limit); break; @@ -378,17 +379,26 @@ public class TimelinesVM extends AndroidViewModel { Status newestStatus = new StatusCache(getApplication().getApplicationContext()).getNewestStatus(timelineParams.slug, timelineParams.instance, timelineParams.userId); //When refreshing/scrolling to TOP, if last statuses fetched has a greater id from newest in cache, there is potential hole if (newestStatus != null && statusList.get(statusList.size() - 1).id.compareToIgnoreCase(newestStatus.id) > 0) { - statusList.get(statusList.size() - 1).isFetchMore = true; + Status statusFetchMore = new Status(); + statusFetchMore.isFetchMore = true; + statusFetchMore.id = Helper.generateString(); + statusList.add(statusFetchMore); } } else if (timelineParams.direction == FragmentMastodonTimeline.DIRECTION.TOP && timelineParams.fetchingMissing) { Status topStatus = new StatusCache(getApplication().getApplicationContext()).getTopFetchMore(timelineParams.slug, timelineParams.instance, timelineParams.slug, statusList.get(0).id); if (topStatus != null && statusList.get(0).id.compareToIgnoreCase(topStatus.id) < 0) { - statusList.get(0).isFetchMore = true; + Status statusFetchMore = new Status(); + statusFetchMore.isFetchMore = true; + statusFetchMore.id = Helper.generateString(); + statusList.add(0, statusFetchMore); } } else if (timelineParams.direction == FragmentMastodonTimeline.DIRECTION.BOTTOM && timelineParams.fetchingMissing) { Status bottomStatus = new StatusCache(getApplication().getApplicationContext()).getBottomFetchMore(timelineParams.slug, timelineParams.instance, timelineParams.slug, statusList.get(0).id); if (bottomStatus != null && statusList.get(statusList.size() - 1).id.compareToIgnoreCase(bottomStatus.id) > 0) { - statusList.get(statusList.size() - 1).isFetchMore = true; + Status statusFetchMore = new Status(); + statusFetchMore.isFetchMore = true; + statusFetchMore.id = Helper.generateString(); + statusList.add(statusFetchMore); } } for (Status status : statuses.statuses) { @@ -444,62 +454,6 @@ public class TimelinesVM extends AndroidViewModel { return statusesMutableLiveData; } - public static class TimelineParams { - - public FragmentMastodonTimeline.DIRECTION direction; - public String instance; - public String token; - public Timeline.TimeLineEnum type; - public String slug; - public String userId; - public Boolean remote; - public Boolean onlyMedia; - public String hashtagTrim; - public List all; - public List any; - public List none; - public String listId; - public Boolean fetchingMissing; - public String maxId; - public String sinceId; - public String minId; - public int limit = 40; - public Boolean local; - - public TimelineParams(@NonNull Timeline.TimeLineEnum timeLineEnum, @Nullable FragmentMastodonTimeline.DIRECTION timelineDirection, @Nullable String ident) { - if (type != Timeline.TimeLineEnum.REMOTE) { - instance = MainActivity.currentInstance; - token = MainActivity.currentToken; - userId = MainActivity.currentUserID; - } - type = timeLineEnum; - direction = timelineDirection; - String key = type.getValue(); - if (ident != null) { - key += "|" + ident; - } - slug = key; - } - - @NonNull - @Override - public String toString() { - return "direction: " + direction + "\n" + - "instance: " + instance + "\n" + - "token: " + token + "\n" + - "type: " + type + "\n" + - "slug: " + slug + "\n" + - "userId: " + userId + "\n" + - "remote: " + remote + "\n" + - "onlyMedia: " + onlyMedia + "\n" + - "local: " + local + "\n" + - "maxId: " + maxId + "\n" + - "sinceId: " + sinceId + "\n" + - "minId: " + minId + "\n"; - } - } - - /** * Get user drafts * @@ -523,7 +477,6 @@ public class TimelinesVM extends AndroidViewModel { return statusDraftListMutableLiveData; } - /** * Show conversations * @@ -871,4 +824,59 @@ public class TimelinesVM extends AndroidViewModel { } }).start(); } + + public static class TimelineParams { + + public FragmentMastodonTimeline.DIRECTION direction; + public String instance; + public String token; + public Timeline.TimeLineEnum type; + public String slug; + public String userId; + public Boolean remote; + public Boolean onlyMedia; + public String hashtagTrim; + public List all; + public List any; + public List none; + public String listId; + public Boolean fetchingMissing; + public String maxId; + public String sinceId; + public String minId; + public int limit = 40; + public Boolean local; + + public TimelineParams(@NonNull Timeline.TimeLineEnum timeLineEnum, @Nullable FragmentMastodonTimeline.DIRECTION timelineDirection, @Nullable String ident) { + if (type != Timeline.TimeLineEnum.REMOTE) { + instance = MainActivity.currentInstance; + token = MainActivity.currentToken; + userId = MainActivity.currentUserID; + } + type = timeLineEnum; + direction = timelineDirection; + String key = type.getValue(); + if (ident != null) { + key += "|" + ident; + } + slug = key; + } + + @NonNull + @Override + public String toString() { + return "direction: " + direction + "\n" + + "instance: " + instance + "\n" + + "token: " + token + "\n" + + "type: " + type + "\n" + + "slug: " + slug + "\n" + + "userId: " + userId + "\n" + + "remote: " + remote + "\n" + + "onlyMedia: " + onlyMedia + "\n" + + "local: " + local + "\n" + + "maxId: " + maxId + "\n" + + "sinceId: " + sinceId + "\n" + + "minId: " + minId + "\n"; + } + } } diff --git a/app/src/main/res/drawable-anydpi-v24/ic_notification.xml b/app/src/main/res/drawable-anydpi-v24/ic_notification.xml index 6c06f3ad..9578a11c 100644 --- a/app/src/main/res/drawable-anydpi-v24/ic_notification.xml +++ b/app/src/main/res/drawable-anydpi-v24/ic_notification.xml @@ -1,8 +1,8 @@ - + android:viewportHeight="24"> + diff --git a/app/src/main/res/drawable/ic_baseline_arrow_drop_up_24.xml b/app/src/main/res/drawable/ic_baseline_arrow_drop_up_24.xml index e88c221d..032059a9 100644 --- a/app/src/main/res/drawable/ic_baseline_arrow_drop_up_24.xml +++ b/app/src/main/res/drawable/ic_baseline_arrow_drop_up_24.xml @@ -1,10 +1,10 @@ - + android:viewportHeight="24"> + diff --git a/app/src/main/res/drawable/ic_baseline_block_24.xml b/app/src/main/res/drawable/ic_baseline_block_24.xml index 9fefeec6..63f329f3 100644 --- a/app/src/main/res/drawable/ic_baseline_block_24.xml +++ b/app/src/main/res/drawable/ic_baseline_block_24.xml @@ -1,10 +1,10 @@ - + android:viewportHeight="24"> + diff --git a/app/src/main/res/drawable/ic_baseline_bookmark_border_24.xml b/app/src/main/res/drawable/ic_baseline_bookmark_border_24.xml index f1ab7b22..45fef5ac 100644 --- a/app/src/main/res/drawable/ic_baseline_bookmark_border_24.xml +++ b/app/src/main/res/drawable/ic_baseline_bookmark_border_24.xml @@ -4,7 +4,7 @@ android:tint="?attr/colorControlNormal" android:viewportWidth="24" android:viewportHeight="24"> - + diff --git a/app/src/main/res/drawable/ic_baseline_check_24.xml b/app/src/main/res/drawable/ic_baseline_check_24.xml index 0432fa69..219e80e2 100644 --- a/app/src/main/res/drawable/ic_baseline_check_24.xml +++ b/app/src/main/res/drawable/ic_baseline_check_24.xml @@ -1,10 +1,10 @@ - + android:viewportHeight="24"> + diff --git a/app/src/main/res/drawable/ic_baseline_check_circle_24.xml b/app/src/main/res/drawable/ic_baseline_check_circle_24.xml index 2871939f..8c3b7cda 100644 --- a/app/src/main/res/drawable/ic_baseline_check_circle_24.xml +++ b/app/src/main/res/drawable/ic_baseline_check_circle_24.xml @@ -1,10 +1,10 @@ - + android:viewportHeight="24"> + diff --git a/app/src/main/res/drawable/ic_baseline_close_24.xml b/app/src/main/res/drawable/ic_baseline_close_24.xml index 16d6d37d..d5d2297a 100644 --- a/app/src/main/res/drawable/ic_baseline_close_24.xml +++ b/app/src/main/res/drawable/ic_baseline_close_24.xml @@ -1,10 +1,10 @@ - + android:viewportHeight="24"> + diff --git a/app/src/main/res/drawable/ic_baseline_drafts_24.xml b/app/src/main/res/drawable/ic_baseline_drafts_24.xml index b16a79b3..3674fdc5 100644 --- a/app/src/main/res/drawable/ic_baseline_drafts_24.xml +++ b/app/src/main/res/drawable/ic_baseline_drafts_24.xml @@ -1,10 +1,10 @@ - + android:viewportHeight="24"> + diff --git a/app/src/main/res/drawable/ic_baseline_home_24.xml b/app/src/main/res/drawable/ic_baseline_home_24.xml index 3a4c7dac..ba4d830e 100644 --- a/app/src/main/res/drawable/ic_baseline_home_24.xml +++ b/app/src/main/res/drawable/ic_baseline_home_24.xml @@ -1,10 +1,10 @@ - + android:viewportHeight="24"> + diff --git a/app/src/main/res/drawable/ic_baseline_hourglass_full_24.xml b/app/src/main/res/drawable/ic_baseline_hourglass_full_24.xml index 2ac5af84..2aa8b869 100644 --- a/app/src/main/res/drawable/ic_baseline_hourglass_full_24.xml +++ b/app/src/main/res/drawable/ic_baseline_hourglass_full_24.xml @@ -1,8 +1,8 @@ - + android:viewportHeight="24"> + diff --git a/app/src/main/res/drawable/ic_baseline_lock_24.xml b/app/src/main/res/drawable/ic_baseline_lock_24.xml index d6191026..8f13e378 100644 --- a/app/src/main/res/drawable/ic_baseline_lock_24.xml +++ b/app/src/main/res/drawable/ic_baseline_lock_24.xml @@ -1,10 +1,10 @@ - + android:viewportHeight="24"> + diff --git a/app/src/main/res/drawable/ic_baseline_lock_open_24.xml b/app/src/main/res/drawable/ic_baseline_lock_open_24.xml index a11b70e6..3d34c2a8 100644 --- a/app/src/main/res/drawable/ic_baseline_lock_open_24.xml +++ b/app/src/main/res/drawable/ic_baseline_lock_open_24.xml @@ -1,10 +1,10 @@ - + android:viewportHeight="24"> + diff --git a/app/src/main/res/drawable/ic_baseline_mail_24.xml b/app/src/main/res/drawable/ic_baseline_mail_24.xml index 6943b4ce..2c852177 100644 --- a/app/src/main/res/drawable/ic_baseline_mail_24.xml +++ b/app/src/main/res/drawable/ic_baseline_mail_24.xml @@ -1,10 +1,10 @@ - + android:viewportHeight="24"> + diff --git a/app/src/main/res/drawable/ic_baseline_notifications_24.xml b/app/src/main/res/drawable/ic_baseline_notifications_24.xml index 21cb88d1..726ba1ec 100644 --- a/app/src/main/res/drawable/ic_baseline_notifications_24.xml +++ b/app/src/main/res/drawable/ic_baseline_notifications_24.xml @@ -1,10 +1,10 @@ - + android:viewportHeight="24"> + diff --git a/app/src/main/res/drawable/ic_baseline_open_with_24.xml b/app/src/main/res/drawable/ic_baseline_open_with_24.xml index 6f602a3d..d69524e1 100644 --- a/app/src/main/res/drawable/ic_baseline_open_with_24.xml +++ b/app/src/main/res/drawable/ic_baseline_open_with_24.xml @@ -1,10 +1,10 @@ - + android:viewportHeight="24"> + diff --git a/app/src/main/res/drawable/ic_baseline_people_alt_24.xml b/app/src/main/res/drawable/ic_baseline_people_alt_24.xml index 58169a9a..1cc78012 100644 --- a/app/src/main/res/drawable/ic_baseline_people_alt_24.xml +++ b/app/src/main/res/drawable/ic_baseline_people_alt_24.xml @@ -1,23 +1,23 @@ - - - - + android:viewportHeight="24"> + + + + diff --git a/app/src/main/res/drawable/ic_baseline_person_add_alt_1_24.xml b/app/src/main/res/drawable/ic_baseline_person_add_alt_1_24.xml index 46998c45..11162198 100644 --- a/app/src/main/res/drawable/ic_baseline_person_add_alt_1_24.xml +++ b/app/src/main/res/drawable/ic_baseline_person_add_alt_1_24.xml @@ -1,8 +1,8 @@ - + android:viewportHeight="24"> + diff --git a/app/src/main/res/drawable/ic_baseline_remove_red_eye_24.xml b/app/src/main/res/drawable/ic_baseline_remove_red_eye_24.xml index 4fca5764..cc9f66f1 100644 --- a/app/src/main/res/drawable/ic_baseline_remove_red_eye_24.xml +++ b/app/src/main/res/drawable/ic_baseline_remove_red_eye_24.xml @@ -1,8 +1,8 @@ + android:viewportHeight="24"> diff --git a/app/src/main/res/drawable/ic_baseline_supervised_user_circle_24.xml b/app/src/main/res/drawable/ic_baseline_supervised_user_circle_24.xml index 61b9bbcd..b6dcdefd 100644 --- a/app/src/main/res/drawable/ic_baseline_supervised_user_circle_24.xml +++ b/app/src/main/res/drawable/ic_baseline_supervised_user_circle_24.xml @@ -1,10 +1,10 @@ - + android:viewportHeight="24"> + diff --git a/app/src/main/res/drawable/ic_baseline_visibility_24.xml b/app/src/main/res/drawable/ic_baseline_visibility_24.xml index 4fca5764..cc9f66f1 100644 --- a/app/src/main/res/drawable/ic_baseline_visibility_24.xml +++ b/app/src/main/res/drawable/ic_baseline_visibility_24.xml @@ -1,8 +1,8 @@ - + diff --git a/app/src/main/res/drawable/ic_display_less.xml b/app/src/main/res/drawable/ic_display_less.xml index 453333c9..e2df433d 100644 --- a/app/src/main/res/drawable/ic_display_less.xml +++ b/app/src/main/res/drawable/ic_display_less.xml @@ -4,7 +4,7 @@ android:tint="@color/cyanea_accent_reference" android:viewportWidth="24" android:viewportHeight="24"> - + diff --git a/app/src/main/res/drawable/ic_display_more.xml b/app/src/main/res/drawable/ic_display_more.xml index 71e1d3bc..851bbc07 100644 --- a/app/src/main/res/drawable/ic_display_more.xml +++ b/app/src/main/res/drawable/ic_display_more.xml @@ -4,7 +4,7 @@ android:tint="@color/cyanea_accent_reference" android:viewportWidth="24" android:viewportHeight="24"> - + diff --git a/app/src/main/res/drawable/ic_repeat.xml b/app/src/main/res/drawable/ic_repeat.xml index fce09b20..e99b64ad 100644 --- a/app/src/main/res/drawable/ic_repeat.xml +++ b/app/src/main/res/drawable/ic_repeat.xml @@ -1,11 +1,11 @@ + android:tint="?attr/iconColor" + android:viewportWidth="28" + android:viewportHeight="28"> diff --git a/app/src/main/res/drawable/ic_star_outline.xml b/app/src/main/res/drawable/ic_star_outline.xml index 40bb88cc..162182ba 100644 --- a/app/src/main/res/drawable/ic_star_outline.xml +++ b/app/src/main/res/drawable/ic_star_outline.xml @@ -1,10 +1,10 @@ + android:width="28dp" + android:height="28dp" + android:tint="?attr/iconColor" + android:viewportWidth="28" + android:viewportHeight="28"> diff --git a/app/src/main/res/layout/activity_about.xml b/app/src/main/res/layout/activity_about.xml index 643aa2c0..9914f29a 100644 --- a/app/src/main/res/layout/activity_about.xml +++ b/app/src/main/res/layout/activity_about.xml @@ -61,12 +61,12 @@ + android:visibility="gone" + tools:visibility="visible"> + android:orientation="vertical" + android:padding="10dp"> + + diff --git a/app/src/main/res/layout/activity_conversation.xml b/app/src/main/res/layout/activity_conversation.xml index 762d1a37..4497d09b 100644 --- a/app/src/main/res/layout/activity_conversation.xml +++ b/app/src/main/res/layout/activity_conversation.xml @@ -1,5 +1,4 @@ - - - + + android:layout_height="wrap_content" + android:background="@color/cyanea_primary_reference"> + android:fitsSystemWindows="true" + app:layout_scrollFlags="scroll|enterAlways"> + + android:layout_height="wrap_content" + android:layout_gravity="center_vertical" /> + + app:defaultNavHost="true" + app:layout_behavior="@string/appbar_scrolling_view_behavior" /> \ No newline at end of file diff --git a/app/src/main/res/layout/activity_drafts.xml b/app/src/main/res/layout/activity_drafts.xml index bc2bddcf..b4ba0551 100644 --- a/app/src/main/res/layout/activity_drafts.xml +++ b/app/src/main/res/layout/activity_drafts.xml @@ -15,8 +15,7 @@ see . --> - + + + android:background="@color/cyanea_primary_reference"> + + android:fitsSystemWindows="true" + app:layout_scrollFlags="scroll|enterAlways"> + + + android:layout_height="wrap_content" + android:layout_gravity="center_vertical" /> + + android:layout_height="match_parent" + app:layout_behavior="@string/appbar_scrolling_view_behavior"> + + - + app:layout_constraintTop_toBottomOf="@id/banner_pp_container" + app:strokeColor="@color/cyanea_accent_dark_reference" /> + app:layout_constraintStart_toEndOf="@id/account_pp_container" + app:strokeColor="@color/cyanea_accent_dark_reference" /> + android:textColor="@color/cyanea_accent_dark_reference" + app:icon="@drawable/ic_baseline_add_24" + app:iconTint="@color/cyanea_accent_dark_reference" + app:strokeColor="@color/cyanea_accent_dark_reference" /> diff --git a/app/src/main/res/layout/activity_hashtag.xml b/app/src/main/res/layout/activity_hashtag.xml index 91c93bbb..a8f10230 100644 --- a/app/src/main/res/layout/activity_hashtag.xml +++ b/app/src/main/res/layout/activity_hashtag.xml @@ -29,9 +29,9 @@ + android:layout_height="wrap_content" + android:background="@color/cyanea_primary_reference"> + android:orientation="vertical" + app:layout_constraintTop_toTopOf="parent"> - - + android:visibility="gone" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintTop_toTopOf="parent" + tools:visibility="visible"> + 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" /> \ No newline at end of file diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index b2eb174d..0e7149f2 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -30,9 +30,9 @@ + android:layout_height="wrap_content" + android:backgroundTint="?colorPrimaryDark"> @@ -119,9 +119,9 @@ android:id="@+id/bottom_nav_view" android:layout_width="match_parent" android:layout_height="?actionBarSize" + app:backgroundTint="@color/cyanea_primary_reference" app:itemIconTint="@color/cyanea_accent_dark_reference" app:itemTextColor="@color/cyanea_accent_dark_reference" - app:backgroundTint="@color/cyanea_primary_reference" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" /> @@ -136,14 +136,15 @@ android:layout_marginBottom="?actionBarSize" /> + diff --git a/app/src/main/res/layout/activity_media_pager.xml b/app/src/main/res/layout/activity_media_pager.xml index ea6c321c..11821418 100644 --- a/app/src/main/res/layout/activity_media_pager.xml +++ b/app/src/main/res/layout/activity_media_pager.xml @@ -18,10 +18,10 @@ xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/haulerView" - android:background="@color/transparent" - app:dragUpEnabled="true" android:layout_width="match_parent" - android:layout_height="match_parent"> + android:layout_height="match_parent" + android:background="@color/transparent" + app:dragUpEnabled="true"> - + + app:layout_constraintStart_toEndOf="@+id/media_description" + tools:visibility="visible" /> diff --git a/app/src/main/res/layout/activity_pagination.xml b/app/src/main/res/layout/activity_pagination.xml index 52477b01..df76b092 100644 --- a/app/src/main/res/layout/activity_pagination.xml +++ b/app/src/main/res/layout/activity_pagination.xml @@ -20,8 +20,8 @@ android:id="@+id/drawer_layout" android:layout_width="match_parent" android:layout_height="match_parent" - android:fitsSystemWindows="true" android:layout_marginBottom="300dp" + android:fitsSystemWindows="true" tools:openDrawer="start"> + android:layout_height="wrap_content" + android:background="@color/cyanea_primary_reference"> + android:scrollbars="none" + app:layout_behavior="@string/appbar_scrolling_view_behavior" /> \ No newline at end of file diff --git a/app/src/main/res/layout/activity_profile.xml b/app/src/main/res/layout/activity_profile.xml index 3906fad4..b3a8f5f3 100644 --- a/app/src/main/res/layout/activity_profile.xml +++ b/app/src/main/res/layout/activity_profile.xml @@ -24,25 +24,25 @@ @@ -345,8 +345,8 @@ android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" android:background="@color/cyanea_primary_dark_reference" - app:layout_scrollFlags="scroll|enterAlways" - app:layout_collapseMode="pin"> + app:layout_collapseMode="pin" + app:layout_scrollFlags="scroll|enterAlways"> + android:layout_marginEnd="@dimen/fab_margin"> + android:layout_margin="@dimen/fab_margin" + android:orientation="vertical"> @@ -147,9 +147,9 @@ @@ -270,13 +270,13 @@ + android:orientation="vertical" + android:visibility="gone"> @@ -335,9 +335,9 @@ @@ -360,17 +360,17 @@ diff --git a/app/src/main/res/layout/activity_scheduled.xml b/app/src/main/res/layout/activity_scheduled.xml index a3380667..7a743a81 100644 --- a/app/src/main/res/layout/activity_scheduled.xml +++ b/app/src/main/res/layout/activity_scheduled.xml @@ -24,9 +24,9 @@ diff --git a/app/src/main/res/layout/activity_status_info.xml b/app/src/main/res/layout/activity_status_info.xml index b7ccb65b..63382e98 100644 --- a/app/src/main/res/layout/activity_status_info.xml +++ b/app/src/main/res/layout/activity_status_info.xml @@ -14,14 +14,13 @@ You should have received a copy of the GNU General Public License along with Fedilab; if not, see --> - + android:layout_height="wrap_content" + android:background="@color/cyanea_primary_reference"> + android:layout_height="match_parent" + android:layout_marginTop="?actionBarSize"> + android:gravity="bottom|center_horizontal"> + - - + + + android:background="@color/cyanea_primary_reference"> + + app:layout_scrollFlags="scroll|enterAlways"> + + android:layout_height="32dp" + android:contentDescription="@string/favicon" /> + + android:textSize="14sp" /> + + android:layout_marginBottom="?attr/actionBarSize" + android:orientation="vertical" + app:layout_behavior="@string/appbar_scrolling_view_behavior"> + + app:layout_constraintTop_toBottomOf="@id/preview" + app:strokeColor="@color/no_description" /> + android:layout_height="wrap_content" + app:buttonTint="@color/cyanea_accent_dark_reference" /> - - + android:layout_height="wrap_content" + app:buttonTint="@color/cyanea_accent_dark_reference" /> diff --git a/app/src/main/res/layout/drawer_conversation.xml b/app/src/main/res/layout/drawer_conversation.xml index af96cc9b..1c903cd3 100644 --- a/app/src/main/res/layout/drawer_conversation.xml +++ b/app/src/main/res/layout/drawer_conversation.xml @@ -17,9 +17,9 @@ diff --git a/app/src/main/res/layout/drawer_emoji_search.xml b/app/src/main/res/layout/drawer_emoji_search.xml index 2c1dbf60..4ae3bb17 100644 --- a/app/src/main/res/layout/drawer_emoji_search.xml +++ b/app/src/main/res/layout/drawer_emoji_search.xml @@ -1,5 +1,4 @@ - - - + - + android:layout_height="?actionBarSize" + android:minWidth="60dp"> + app:layout_constraintTop_toTopOf="parent" /> + app:layout_constraintTop_toBottomOf="@+id/name" /> \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_login_join.xml b/app/src/main/res/layout/fragment_login_join.xml index 352349df..3c15c797 100644 --- a/app/src/main/res/layout/fragment_login_join.xml +++ b/app/src/main/res/layout/fragment_login_join.xml @@ -1,5 +1,4 @@ - - - + + + + + + - - - - - - - - - - + + + + + + diff --git a/app/src/main/res/layout/layout_reactions.xml b/app/src/main/res/layout/layout_reactions.xml index a57bcc64..2321afcd 100644 --- a/app/src/main/res/layout/layout_reactions.xml +++ b/app/src/main/res/layout/layout_reactions.xml @@ -4,11 +4,11 @@ android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_marginTop="10dp" android:layout_marginStart="48dp" + android:layout_marginTop="10dp" android:layout_marginEnd="6dp" - android:orientation="horizontal" - android:layout_marginBottom="5dp"> + android:layout_marginBottom="5dp" + android:orientation="horizontal"> diff --git a/app/src/main/res/layout/notifications_related_accounts.xml b/app/src/main/res/layout/notifications_related_accounts.xml index b1a9ea55..cf5b28ab 100644 --- a/app/src/main/res/layout/notifications_related_accounts.xml +++ b/app/src/main/res/layout/notifications_related_accounts.xml @@ -8,15 +8,15 @@ + android:layout_height="30dp" + android:padding="2dp" /> + android:layout_marginStart="5dp" + android:layout_weight="1" + android:padding="2dp" /> \ No newline at end of file diff --git a/app/src/main/res/layout/popup_add_filter.xml b/app/src/main/res/layout/popup_add_filter.xml index a6470973..7b8b8ed5 100644 --- a/app/src/main/res/layout/popup_add_filter.xml +++ b/app/src/main/res/layout/popup_add_filter.xml @@ -15,8 +15,8 @@ see . --> @@ -74,18 +74,18 @@ + android:text="@string/context_home" + app:buttonTint="@color/cyanea_accent_dark_reference" /> + android:text="@string/context_public" + app:buttonTint="@color/cyanea_accent_dark_reference" /> + android:text="@string/context_notification" + app:buttonTint="@color/cyanea_accent_dark_reference" /> + android:text="@string/context_conversation" + app:buttonTint="@color/cyanea_accent_dark_reference" /> + android:text="@string/context_drop" + app:buttonTint="@color/cyanea_accent_dark_reference" /> + android:text="@string/context_whole_word" + app:buttonTint="@color/cyanea_accent_dark_reference" /> - + + android:src="@drawable/ic_baseline_close_24" /> - diff --git a/app/src/main/res/navigation/nav_graph_settings.xml b/app/src/main/res/navigation/nav_graph_settings.xml index 3f94252f..56b5caf2 100644 --- a/app/src/main/res/navigation/nav_graph_settings.xml +++ b/app/src/main/res/navigation/nav_graph_settings.xml @@ -11,8 +11,7 @@ + app:destination="@id/EditProfileActivity" /> SET_DISPLAY_BOOKMARK SET_NOTIF_VALIDATION_FAV SET_DISPLAY_COUNTER_FAV_BOOST - SET_HOME_INNER_MARKER + SET_INNER_MARKER SET_NOTIF_SILENT SET_EXPAND_CW diff --git a/app/src/main/res/xml/pref_compose.xml b/app/src/main/res/xml/pref_compose.xml index 87adfd40..19fcdf4d 100644 --- a/app/src/main/res/xml/pref_compose.xml +++ b/app/src/main/res/xml/pref_compose.xml @@ -9,32 +9,32 @@ @@ -47,15 +47,15 @@ + app:title="@string/type_of_notifications"> + app:title="@string/notification_sounds"> - + \ No newline at end of file