diff options
219 files changed, 9558 insertions, 2665 deletions
diff --git a/app/build.gradle b/app/build.gradle index fab2da39..053f0f7f 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -6,8 +6,8 @@ android { applicationId "ml.docilealligator.infinityforreddit" minSdkVersion 21 targetSdkVersion 30 - versionCode 70 - versionName "4.3.4" + versionCode 80 + versionName "5.0.4" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" javaCompileOptions { annotationProcessorOptions { @@ -174,11 +174,10 @@ dependencies { implementation 'com.github.FunkyMuse:Crashy:1.1.0' //implementation "androidx.lifecycle:lifecycle-extensions:2.2.0" + //annotationProcessor "androidx.lifecycle:compiler:2.2.0" implementation 'androidx.palette:palette:1.0.0' - implementation 'com.tinder.scarlet:scarlet:0.1.12' - /**** Builds and flavors ****/ // debugImplementation because LeakCanary should only run in debug builds. diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 66c76e03..d610fb2f 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -18,7 +18,9 @@ android:maxSdkVersion="22" /> <uses-permission android:name="android.permission.FOREGROUND_SERVICE" /> - <uses-permission-sdk-23 android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> + <uses-permission-sdk-23 + android:name="android.permission.WRITE_EXTERNAL_STORAGE" + android:maxSdkVersion="28" /> <uses-permission android:name="android.permission.WAKE_LOCK" /> @@ -32,14 +34,28 @@ android:theme="@style/AppTheme" android:usesCleartextTraffic="true" tools:replace="android:label"> - <activity android:name=".activities.RPANActivity" + <activity android:name=".activities.WikiActivity" + android:label="@string/wiki_activity_label" + android:parentActivityName=".activities.MainActivity" + android:theme="@style/AppTheme.Slidable" /> + <activity + android:name=".activities.TrendingActivity" + android:label="@string/trending_activity_label" + android:parentActivityName=".activities.MainActivity" + android:theme="@style/AppTheme.Slidable" /> + <activity + android:name=".activities.PostGalleryActivity" + android:label="@string/post_gallery_activity_label" + android:parentActivityName=".activities.MainActivity" + android:theme="@style/AppTheme.NoActionBar" + android:windowSoftInputMode="adjustResize" /> + <activity + android:name=".activities.RPANActivity" android:configChanges="orientation|screenSize|layoutDirection" android:label="@string/rpan_activity_label" android:parentActivityName=".activities.MainActivity" - android:theme="@style/AppTheme.TranslucentStatusBar" /> - <activity - android:name=".activities.MotionTestActivity" - android:theme="@style/AppTheme.NoActionBar" /> + android:theme="@style/AppTheme.TranslucentStatusBar" + android:windowSoftInputMode="adjustPan" /> <activity android:name=".activities.LockScreenActivity" android:theme="@style/AppTheme.NoActionBar" /> @@ -405,7 +421,8 @@ <activity android:name=".activities.ViewPostDetailActivity" android:parentActivityName=".activities.MainActivity" - android:theme="@style/AppTheme.Slidable" /> + android:theme="@style/AppTheme.Slidable" + android:windowSoftInputMode="adjustPan" /> <activity android:name=".activities.ViewSubredditDetailActivity" android:parentActivityName=".activities.MainActivity" diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/AppComponent.java b/app/src/main/java/ml/docilealligator/infinityforreddit/AppComponent.java index fe68ecd4..2fc08bd9 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/AppComponent.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/AppComponent.java @@ -27,6 +27,7 @@ import ml.docilealligator.infinityforreddit.activities.MainActivity; import ml.docilealligator.infinityforreddit.activities.MultiredditSelectionActivity; import ml.docilealligator.infinityforreddit.activities.PostFilterPreferenceActivity; import ml.docilealligator.infinityforreddit.activities.PostFilterUsageListingActivity; +import ml.docilealligator.infinityforreddit.activities.PostGalleryActivity; import ml.docilealligator.infinityforreddit.activities.PostImageActivity; import ml.docilealligator.infinityforreddit.activities.PostLinkActivity; import ml.docilealligator.infinityforreddit.activities.PostTextActivity; @@ -47,6 +48,7 @@ import ml.docilealligator.infinityforreddit.activities.SubredditMultiselectionAc import ml.docilealligator.infinityforreddit.activities.SubredditSelectionActivity; import ml.docilealligator.infinityforreddit.activities.SubscribedThingListingActivity; import ml.docilealligator.infinityforreddit.activities.SuicidePreventionActivity; +import ml.docilealligator.infinityforreddit.activities.TrendingActivity; import ml.docilealligator.infinityforreddit.activities.ViewImageOrGifActivity; import ml.docilealligator.infinityforreddit.activities.ViewImgurMediaActivity; import ml.docilealligator.infinityforreddit.activities.ViewMultiRedditDetailActivity; @@ -57,6 +59,7 @@ import ml.docilealligator.infinityforreddit.activities.ViewSubredditDetailActivi import ml.docilealligator.infinityforreddit.activities.ViewUserDetailActivity; import ml.docilealligator.infinityforreddit.activities.ViewVideoActivity; import ml.docilealligator.infinityforreddit.activities.WebViewActivity; +import ml.docilealligator.infinityforreddit.activities.WikiActivity; import ml.docilealligator.infinityforreddit.bottomsheetfragments.FlairBottomSheetFragment; import ml.docilealligator.infinityforreddit.fragments.CommentsListingFragment; import ml.docilealligator.infinityforreddit.fragments.FollowedUsersListingFragment; @@ -275,4 +278,12 @@ public interface AppComponent { void inject(RPANActivity rpanActivity); void inject(ViewRPANBroadcastFragment viewRPANBroadcastFragment); + + void inject(PostGalleryActivity postGalleryActivity); + + void inject(TrendingActivity trendingActivity); + + void inject(WikiActivity wikiActivity); + + void inject(Infinity infinity); } diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/AppModule.java b/app/src/main/java/ml/docilealligator/infinityforreddit/AppModule.java index 435969a0..49120eca 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/AppModule.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/AppModule.java @@ -277,6 +277,12 @@ class AppModule { } @Provides + @Named("post_details") + SharedPreferences providePostDetailsSharedPreferences() { + return mApplication.getSharedPreferences(SharedPreferencesUtils.POST_DETAILS_SHARED_PREFERENCES_FILE, Context.MODE_PRIVATE); + } + + @Provides @Singleton CustomThemeWrapper provideCustomThemeWrapper(@Named("light_theme") SharedPreferences lightThemeSharedPreferences, @Named("dark_theme") SharedPreferences darkThemeSharedPreferences, diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Infinity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Infinity.java index 1ea45d67..1c7c7649 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/Infinity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Infinity.java @@ -1,10 +1,13 @@ package ml.docilealligator.infinityforreddit; +import android.app.Activity; import android.app.Application; import android.content.Intent; import android.content.IntentFilter; +import android.content.SharedPreferences; import android.net.ConnectivityManager; import android.os.Bundle; +import android.view.WindowManager; import androidx.annotation.NonNull; import androidx.annotation.Nullable; @@ -15,15 +18,26 @@ import com.livefront.bridge.Bridge; import com.livefront.bridge.SavedStateHandler; import org.greenrobot.eventbus.EventBus; +import org.greenrobot.eventbus.Subscribe; + +import javax.inject.Inject; +import javax.inject.Named; import ml.docilealligator.infinityforreddit.broadcastreceivers.NetworkWifiStatusReceiver; import ml.docilealligator.infinityforreddit.broadcastreceivers.WallpaperChangeReceiver; import ml.docilealligator.infinityforreddit.events.ChangeNetworkStatusEvent; +import ml.docilealligator.infinityforreddit.events.ToggleSecureModeEvent; +import ml.docilealligator.infinityforreddit.utils.SharedPreferencesUtils; import ml.docilealligator.infinityforreddit.utils.Utils; public class Infinity extends Application implements LifecycleObserver { private AppComponent mAppComponent; private NetworkWifiStatusReceiver mNetworkWifiStatusReceiver; + //private boolean lock = false; + private boolean isSecureMode; + @Inject + @Named("default") + SharedPreferences mSharedPreferences; @Override public void onCreate() { @@ -33,12 +47,16 @@ public class Infinity extends Application implements LifecycleObserver { .appModule(new AppModule(this)) .build(); - //ProcessLifecycleOwner.get().getLifecycle().addObserver(this); + mAppComponent.inject(this); - /*registerActivityLifecycleCallbacks(new ActivityLifecycleCallbacks() { + isSecureMode = mSharedPreferences.getBoolean(SharedPreferencesUtils.SECURE_MODE, false); + + registerActivityLifecycleCallbacks(new ActivityLifecycleCallbacks() { @Override public void onActivityCreated(@NonNull Activity activity, @Nullable Bundle bundle) { - activity.getWindow().setFlags(WindowManager.LayoutParams.FLAG_SECURE, WindowManager.LayoutParams.FLAG_SECURE); + if (isSecureMode) { + activity.getWindow().addFlags(WindowManager.LayoutParams.FLAG_SECURE); + } } @Override @@ -48,7 +66,11 @@ public class Infinity extends Application implements LifecycleObserver { @Override public void onActivityResumed(@NonNull Activity activity) { - + /*if (lock && !(activity instanceof LockScreenActivity)) { + lock = false; + Intent intent = new Intent(activity, LockScreenActivity.class); + activity.startActivity(intent); + }*/ } @Override @@ -70,7 +92,9 @@ public class Infinity extends Application implements LifecycleObserver { public void onActivityDestroyed(@NonNull Activity activity) { } - });*/ + }); + + //ProcessLifecycleOwner.get().getLifecycle().addObserver(this); Bridge.initialize(getApplicationContext(), new SavedStateHandler() { @Override @@ -86,6 +110,8 @@ public class Infinity extends Application implements LifecycleObserver { EventBus.builder().addIndex(new EventBusIndex()).installDefaultEventBus(); + EventBus.getDefault().register(this); + mNetworkWifiStatusReceiver = new NetworkWifiStatusReceiver(() -> EventBus.getDefault().post(new ChangeNetworkStatusEvent(Utils.getConnectedNetwork(getApplicationContext())))); registerReceiver(mNetworkWifiStatusReceiver, new IntentFilter(ConnectivityManager.CONNECTIVITY_ACTION)); @@ -93,17 +119,22 @@ public class Infinity extends Application implements LifecycleObserver { registerReceiver(new WallpaperChangeReceiver(), new IntentFilter(Intent.ACTION_WALLPAPER_CHANGED)); } -// @OnLifecycleEvent(Lifecycle.Event.ON_START) -// public void appInForeground(){ -// Toast.makeText(this, "Foreground", Toast.LENGTH_SHORT).show(); -// } -// -// @OnLifecycleEvent(Lifecycle.Event.ON_STOP) -// public void appInBackground(){ -// Toast.makeText(this, "Background", Toast.LENGTH_SHORT).show(); -// } + /*@OnLifecycleEvent(Lifecycle.Event.ON_START) + public void appInForeground() { + lock = true; + } + + @OnLifecycleEvent(Lifecycle.Event.ON_STOP) + public void appInBackground(){ + + }*/ public AppComponent getAppComponent() { return mAppComponent; } + + @Subscribe + public void onToggleSecureModeEvent(ToggleSecureModeEvent secureModeEvent) { + isSecureMode = secureModeEvent.isSecureMode; + } } diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/RPANBroadcast.java b/app/src/main/java/ml/docilealligator/infinityforreddit/RPANBroadcast.java index 43b8ef55..d7c936c2 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/RPANBroadcast.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/RPANBroadcast.java @@ -3,6 +3,8 @@ package ml.docilealligator.infinityforreddit; import android.os.Parcel; import android.os.Parcelable; +import ml.docilealligator.infinityforreddit.utils.APIUtils; + public class RPANBroadcast implements Parcelable { public int upvotes; @@ -76,7 +78,8 @@ public class RPANBroadcast implements Parcelable { parcel.writeParcelable(rpanStream, i); } - public static class RPANPost implements Parcelable{ + public static class RPANPost implements Parcelable { + public String fullname; public String title; public String subredditName; public String subredditIconUrl; @@ -85,6 +88,7 @@ public class RPANBroadcast implements Parcelable { public String voteState; public double upvoteRatio; public String postPermalink; + public String rpanUrl; public boolean isNsfw; public boolean isLocked; public boolean isArchived; @@ -92,10 +96,11 @@ public class RPANBroadcast implements Parcelable { public String suggestedCommentSort; public String liveCommentsWebsocketUrl; - public RPANPost(String title, String subredditName, String subredditIconUrl, String username, + public RPANPost(String fullname, String title, String subredditName, String subredditIconUrl, String username, int postScore, String voteState, double upvoteRatio, String postPermalink, String rpanUrl, boolean isNsfw, boolean isLocked, boolean isArchived, boolean isSpoiler, String suggestedCommentSort, String liveCommentsWebsocketUrl) { + this.fullname = fullname; this.title = title; this.subredditName = subredditName; this.subredditIconUrl = subredditIconUrl; @@ -103,7 +108,8 @@ public class RPANBroadcast implements Parcelable { this.postScore = postScore; this.voteState = voteState; this.upvoteRatio = upvoteRatio; - this.postPermalink = postPermalink; + this.postPermalink = APIUtils.API_BASE_URI + postPermalink; + this.rpanUrl = rpanUrl; this.isNsfw = isNsfw; this.isLocked = isLocked; this.isArchived = isArchived; @@ -113,6 +119,7 @@ public class RPANBroadcast implements Parcelable { } protected RPANPost(Parcel in) { + fullname = in.readString(); title = in.readString(); subredditName = in.readString(); subredditIconUrl = in.readString(); @@ -121,6 +128,7 @@ public class RPANBroadcast implements Parcelable { voteState = in.readString(); upvoteRatio = in.readDouble(); postPermalink = in.readString(); + rpanUrl = in.readString(); isNsfw = in.readByte() != 0; isLocked = in.readByte() != 0; isArchived = in.readByte() != 0; @@ -148,6 +156,7 @@ public class RPANBroadcast implements Parcelable { @Override public void writeToParcel(Parcel parcel, int i) { + parcel.writeString(fullname); parcel.writeString(title); parcel.writeString(subredditName); parcel.writeString(subredditIconUrl); @@ -156,6 +165,7 @@ public class RPANBroadcast implements Parcelable { parcel.writeString(voteState); parcel.writeDouble(upvoteRatio); parcel.writeString(postPermalink); + parcel.writeString(rpanUrl); parcel.writeByte((byte) (isNsfw ? 1 : 0)); parcel.writeByte((byte) (isLocked ? 1 : 0)); parcel.writeByte((byte) (isArchived ? 1 : 0)); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/RedditGalleryPayload.java b/app/src/main/java/ml/docilealligator/infinityforreddit/RedditGalleryPayload.java new file mode 100644 index 00000000..ef91d6d9 --- /dev/null +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/RedditGalleryPayload.java @@ -0,0 +1,96 @@ +package ml.docilealligator.infinityforreddit; + +import android.os.Parcel; +import android.os.Parcelable; + +import com.google.gson.annotations.SerializedName; + +import java.util.ArrayList; + +public class RedditGalleryPayload { + @SerializedName("sr") + public String subredditName; + @SerializedName("submit_type") + public String submitType; + @SerializedName("api_type") + public String apiType = "json"; + @SerializedName("show_error_list") + public boolean showErrorList = true; + public String title; + @SerializedName("spoiler") + public boolean isSpoiler; + @SerializedName("nsfw") + public boolean isNSFW; + public String kind = "self"; + @SerializedName("original_content") + public boolean originalContent = false; + @SerializedName("post_to_twitter") + public boolean postToTwitter = false; + public boolean sendReplies; + @SerializedName("validate_on_submit") + public boolean validateOnSubmit = true; + @SerializedName("flair_id") + public String flairId; + @SerializedName("flair_text") + public String flairText; + public ArrayList<Item> items; + + public RedditGalleryPayload(String subredditName, String submitType, String title, + boolean isSpoiler, boolean isNSFW, boolean sendReplies, Flair flair, ArrayList<Item> items) { + this.subredditName = subredditName; + this.submitType = submitType; + this.title = title; + this.isSpoiler = isSpoiler; + this.isNSFW = isNSFW; + this.sendReplies = sendReplies; + if (flair != null) { + flairId = flair.getId(); + flairText = flair.getText(); + } + this.items = items; + } + + public static class Item implements Parcelable { + public String caption; + @SerializedName("outbound_url") + public String outboundUrl; + @SerializedName("media_id") + public String mediaId; + + public Item(String caption, String outboundUrl, String mediaId) { + this.caption = caption; + this.outboundUrl = outboundUrl; + this.mediaId = mediaId; + } + + protected Item(Parcel in) { + caption = in.readString(); + outboundUrl = in.readString(); + mediaId = in.readString(); + } + + public static final Creator<Item> CREATOR = new Creator<Item>() { + @Override + public Item createFromParcel(Parcel in) { + return new Item(in); + } + + @Override + public Item[] newArray(int size) { + return new Item[size]; + } + }; + + @Override + public int describeContents() { + return 0; + } + + @Override + public void writeToParcel(Parcel parcel, int i) { + parcel.writeString(caption); + parcel.writeString(outboundUrl); + parcel.writeString(mediaId); + } + } +} diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/TrendingSearch.java b/app/src/main/java/ml/docilealligator/infinityforreddit/TrendingSearch.java new file mode 100644 index 00000000..f0afc541 --- /dev/null +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/TrendingSearch.java @@ -0,0 +1,54 @@ +package ml.docilealligator.infinityforreddit; + +import android.os.Parcel; +import android.os.Parcelable; + +import java.util.ArrayList; + +import ml.docilealligator.infinityforreddit.post.Post; + +public class TrendingSearch implements Parcelable { + public String queryString; + public String displayString; + public String title; + public ArrayList<Post.Preview> previews; + + public TrendingSearch(String queryString, String displayString, String title, ArrayList<Post.Preview> previews) { + this.queryString = queryString; + this.displayString = displayString; + this.title = title; + this.previews = previews; + } + + protected TrendingSearch(Parcel in) { + queryString = in.readString(); + displayString = in.readString(); + title = in.readString(); + previews = in.createTypedArrayList(Post.Preview.CREATOR); + } + + public static final Creator<TrendingSearch> CREATOR = new Creator<TrendingSearch>() { + @Override + public TrendingSearch createFromParcel(Parcel in) { + return new TrendingSearch(in); + } + + @Override + public TrendingSearch[] newArray(int size) { + return new TrendingSearch[size]; + } + }; + + @Override + public int describeContents() { + return 0; + } + + @Override + public void writeToParcel(Parcel parcel, int i) { + parcel.writeString(queryString); + parcel.writeString(displayString); + parcel.writeString(title); + parcel.writeTypedList(previews); + } +} diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/CommentActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/CommentActivity.java index a7e675b2..a244fafe 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/CommentActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/CommentActivity.java @@ -4,7 +4,6 @@ import android.content.ActivityNotFoundException; import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; -import android.graphics.Bitmap; import android.net.Uri; import android.os.Build; import android.os.Bundle; @@ -26,10 +25,8 @@ import androidx.annotation.Nullable; import androidx.appcompat.widget.Toolbar; import androidx.coordinatorlayout.widget.CoordinatorLayout; import androidx.core.content.FileProvider; -import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; -import com.bumptech.glide.Glide; import com.google.android.material.appbar.AppBarLayout; import com.google.android.material.dialog.MaterialAlertDialogBuilder; import com.google.android.material.snackbar.Snackbar; @@ -37,13 +34,10 @@ import com.google.android.material.snackbar.Snackbar; import org.commonmark.ext.gfm.tables.TableBlock; import org.greenrobot.eventbus.EventBus; import org.greenrobot.eventbus.Subscribe; -import org.json.JSONException; -import org.xmlpull.v1.XmlPullParserException; import java.io.File; import java.io.IOException; import java.util.ArrayList; -import java.util.concurrent.ExecutionException; import java.util.concurrent.Executor; import javax.inject.Inject; @@ -71,9 +65,9 @@ import ml.docilealligator.infinityforreddit.bottomsheetfragments.UploadedImagesB import ml.docilealligator.infinityforreddit.comment.Comment; import ml.docilealligator.infinityforreddit.comment.SendComment; import ml.docilealligator.infinityforreddit.customtheme.CustomThemeWrapper; +import ml.docilealligator.infinityforreddit.customviews.LinearLayoutManagerBugFixed; import ml.docilealligator.infinityforreddit.events.SwitchAccountEvent; import ml.docilealligator.infinityforreddit.utils.SharedPreferencesUtils; -import ml.docilealligator.infinityforreddit.utils.UploadImageUtils; import ml.docilealligator.infinityforreddit.utils.Utils; import retrofit2.Retrofit; @@ -91,6 +85,7 @@ public class CommentActivity extends BaseActivity implements UploadImageEnabledA public static final int WRITE_COMMENT_REQUEST_CODE = 1; private static final int PICK_IMAGE_REQUEST_CODE = 100; private static final int CAPTURE_IMAGE_REQUEST_CODE = 200; + private static final int MARKDOWN_PREVIEW_REQUEST_CODE = 300; private static final String UPLOADED_IMAGES_STATE = "UIS"; @BindView(R.id.coordinator_layout_comment_activity) @@ -134,6 +129,7 @@ public class CommentActivity extends BaseActivity implements UploadImageEnabledA private int markdownColor; private Uri capturedImageUri; private ArrayList<UploadedImage> uploadedImages = new ArrayList<>(); + private Menu mMenu; @Override protected void onCreate(Bundle savedInstanceState) { @@ -245,7 +241,7 @@ public class CommentActivity extends BaseActivity implements UploadImageEnabledA .tableLayout(R.layout.adapter_table_block, R.id.table_layout) .textLayoutIsRoot(R.layout.view_table_entry_cell))) .build(); - contentMarkdownRecyclerView.setLayoutManager(new LinearLayoutManager(this)); + contentMarkdownRecyclerView.setLayoutManager(new LinearLayoutManagerBugFixed(this)); contentMarkdownRecyclerView.setAdapter(markwonAdapter); markwonAdapter.setMarkdown(postBodyMarkwon, parentBodyMarkdown); markwonAdapter.notifyDataSetChanged(); @@ -284,8 +280,8 @@ public class CommentActivity extends BaseActivity implements UploadImageEnabledA } }); - markdownBottomBarRecyclerView.setLayoutManager(new LinearLayoutManager(this, - LinearLayoutManager.HORIZONTAL, false)); + markdownBottomBarRecyclerView.setLayoutManager(new LinearLayoutManagerBugFixed(this, + LinearLayoutManagerBugFixed.HORIZONTAL, false)); markdownBottomBarRecyclerView.setAdapter(adapter); commentEditText.requestFocus(); @@ -335,6 +331,7 @@ public class CommentActivity extends BaseActivity implements UploadImageEnabledA @Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.comment_activity, menu); + mMenu = menu; applyMenuItemTheme(menu); return true; } @@ -348,59 +345,70 @@ public class CommentActivity extends BaseActivity implements UploadImageEnabledA } else if (itemId == R.id.action_preview_comment_activity) { Intent intent = new Intent(this, FullMarkdownActivity.class); intent.putExtra(FullMarkdownActivity.EXTRA_COMMENT_MARKDOWN, commentEditText.getText().toString()); - startActivity(intent); + intent.putExtra(FullMarkdownActivity.EXTRA_SUBMIT_POST, true); + startActivityForResult(intent, MARKDOWN_PREVIEW_REQUEST_CODE); } else if (itemId == R.id.action_send_comment_activity) { - if (!isSubmitting) { - isSubmitting = true; - if (commentEditText.getText() == null || commentEditText.getText().toString().equals("")) { - isSubmitting = false; - Snackbar.make(coordinatorLayout, R.string.comment_content_required, Snackbar.LENGTH_SHORT).show(); - return true; - } + sendComment(item); + return true; + } + + return false; + } + + public void sendComment(@Nullable MenuItem item) { + if (!isSubmitting) { + isSubmitting = true; + if (commentEditText.getText() == null || commentEditText.getText().toString().equals("")) { + isSubmitting = false; + Snackbar.make(coordinatorLayout, R.string.comment_content_required, Snackbar.LENGTH_SHORT).show(); + return; + } + if (item != null) { item.setEnabled(false); item.getIcon().setAlpha(130); - Snackbar sendingSnackbar = Snackbar.make(coordinatorLayout, R.string.sending_comment, Snackbar.LENGTH_INDEFINITE); - sendingSnackbar.show(); - - SendComment.sendComment(mExecutor, new Handler(), commentEditText.getText().toString(), - parentFullname, parentDepth, mOauthRetrofit, mAccessToken, - new SendComment.SendCommentListener() { - @Override - public void sendCommentSuccess(Comment comment) { - isSubmitting = false; + } + Snackbar sendingSnackbar = Snackbar.make(coordinatorLayout, R.string.sending_comment, Snackbar.LENGTH_INDEFINITE); + sendingSnackbar.show(); + + SendComment.sendComment(mExecutor, new Handler(), commentEditText.getText().toString(), + parentFullname, parentDepth, mOauthRetrofit, mAccessToken, + new SendComment.SendCommentListener() { + @Override + public void sendCommentSuccess(Comment comment) { + isSubmitting = false; + if (item != null) { item.setEnabled(true); item.getIcon().setAlpha(255); - Toast.makeText(CommentActivity.this, R.string.send_comment_success, Toast.LENGTH_SHORT).show(); - Intent returnIntent = new Intent(); - returnIntent.putExtra(RETURN_EXTRA_COMMENT_DATA_KEY, comment); - returnIntent.putExtra(EXTRA_PARENT_FULLNAME_KEY, parentFullname); - if (isReplying) { - returnIntent.putExtra(EXTRA_PARENT_POSITION_KEY, parentPosition); - } - setResult(RESULT_OK, returnIntent); - finish(); } + Toast.makeText(CommentActivity.this, R.string.send_comment_success, Toast.LENGTH_SHORT).show(); + Intent returnIntent = new Intent(); + returnIntent.putExtra(RETURN_EXTRA_COMMENT_DATA_KEY, comment); + returnIntent.putExtra(EXTRA_PARENT_FULLNAME_KEY, parentFullname); + if (isReplying) { + returnIntent.putExtra(EXTRA_PARENT_POSITION_KEY, parentPosition); + } + setResult(RESULT_OK, returnIntent); + finish(); + } - @Override - public void sendCommentFailed(@Nullable String errorMessage) { - isSubmitting = false; - sendingSnackbar.dismiss(); + @Override + public void sendCommentFailed(@Nullable String errorMessage) { + isSubmitting = false; + sendingSnackbar.dismiss(); + if (item != null) { item.setEnabled(true); item.getIcon().setAlpha(255); + } - if (errorMessage == null || !errorMessage.equals("")) { - Snackbar.make(coordinatorLayout, R.string.send_comment_failed, Snackbar.LENGTH_SHORT).show(); - } else { - Snackbar.make(coordinatorLayout, errorMessage, Snackbar.LENGTH_SHORT).show(); - } + if (errorMessage == null || !errorMessage.equals("")) { + Snackbar.make(coordinatorLayout, R.string.send_comment_failed, Snackbar.LENGTH_SHORT).show(); + } else { + Snackbar.make(coordinatorLayout, errorMessage, Snackbar.LENGTH_SHORT).show(); } - }); - } - return true; + } + }); } - - return false; } private void promptAlertDialog(int titleResId, int messageResId) { @@ -427,45 +435,12 @@ public class CommentActivity extends BaseActivity implements UploadImageEnabledA } else if (requestCode == CAPTURE_IMAGE_REQUEST_CODE) { Utils.uploadImageToReddit(this, mExecutor, mOauthRetrofit, mUploadMediaRetrofit, mAccessToken, commentEditText, coordinatorLayout, capturedImageUri, uploadedImages); + } else if (requestCode == MARKDOWN_PREVIEW_REQUEST_CODE) { + sendComment(mMenu == null ? null : mMenu.findItem(R.id.action_send_comment_activity)); } } } - private void uploadImageToReddit(Uri imageUri) { - Toast.makeText(this, R.string.uploading_image, Toast.LENGTH_SHORT).show(); - Handler handler = new Handler(); - mExecutor.execute(() -> { - try { - Bitmap bitmap = Glide.with(CommentActivity.this).asBitmap().load(imageUri).submit().get(); - String imageUrlOrError = UploadImageUtils.uploadImage(mOauthRetrofit, mUploadMediaRetrofit, mAccessToken, bitmap); - handler.post(() -> { - if (imageUrlOrError != null && !imageUrlOrError.startsWith("Error: ")) { - String fileName = Utils.getFileName(this, imageUri); - if (fileName == null) { - fileName = imageUrlOrError; - } - uploadedImages.add(new UploadedImage(fileName, imageUrlOrError)); - - int start = Math.max(commentEditText.getSelectionStart(), 0); - int end = Math.max(commentEditText.getSelectionEnd(), 0); - commentEditText.getText().replace(Math.min(start, end), Math.max(start, end), - "[" + fileName + "](" + imageUrlOrError + ")", - 0, "[]()".length() + fileName.length() + imageUrlOrError.length()); - Snackbar.make(coordinatorLayout, R.string.upload_image_success, Snackbar.LENGTH_LONG).show(); - } else { - Toast.makeText(CommentActivity.this, R.string.upload_image_failed, Toast.LENGTH_LONG).show(); - } - }); - } catch (ExecutionException | InterruptedException e) { - e.printStackTrace(); - handler.post(() -> Toast.makeText(CommentActivity.this, R.string.get_image_bitmap_failed, Toast.LENGTH_LONG).show()); - } catch (XmlPullParserException | JSONException | IOException e) { - e.printStackTrace(); - handler.post(() -> Toast.makeText(CommentActivity.this, R.string.error_processing_image, Toast.LENGTH_LONG).show()); - } - }); - } - @Override public void onBackPressed() { if (isSubmitting) { diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/CustomThemeListingActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/CustomThemeListingActivity.java index 9f9207e5..144898bb 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/CustomThemeListingActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/CustomThemeListingActivity.java @@ -1,5 +1,7 @@ package ml.docilealligator.infinityforreddit.activities; +import static android.content.ClipDescription.MIMETYPE_TEXT_PLAIN; + import android.content.ClipData; import android.content.ClipboardManager; import android.content.Context; @@ -17,7 +19,6 @@ import androidx.appcompat.widget.Toolbar; import androidx.coordinatorlayout.widget.CoordinatorLayout; import androidx.core.app.ActivityCompat; import androidx.lifecycle.ViewModelProvider; -import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; import com.google.android.material.appbar.AppBarLayout; @@ -37,6 +38,9 @@ import javax.inject.Named; import butterknife.BindView; import butterknife.ButterKnife; +import ml.docilealligator.infinityforreddit.Infinity; +import ml.docilealligator.infinityforreddit.R; +import ml.docilealligator.infinityforreddit.RedditDataRoomDatabase; import ml.docilealligator.infinityforreddit.adapters.CustomThemeListingRecyclerViewAdapter; import ml.docilealligator.infinityforreddit.asynctasks.ChangeThemeName; import ml.docilealligator.infinityforreddit.asynctasks.DeleteTheme; @@ -48,13 +52,8 @@ import ml.docilealligator.infinityforreddit.customtheme.CustomTheme; import ml.docilealligator.infinityforreddit.customtheme.CustomThemeViewModel; import ml.docilealligator.infinityforreddit.customtheme.CustomThemeWrapper; import ml.docilealligator.infinityforreddit.events.RecreateActivityEvent; -import ml.docilealligator.infinityforreddit.Infinity; -import ml.docilealligator.infinityforreddit.R; -import ml.docilealligator.infinityforreddit.RedditDataRoomDatabase; import ml.docilealligator.infinityforreddit.utils.CustomThemeSharedPreferencesUtils; -import static android.content.ClipDescription.MIMETYPE_TEXT_PLAIN; - public class CustomThemeListingActivity extends BaseActivity implements CustomThemeOptionsBottomSheetFragment.CustomThemeOptionsBottomSheetFragmentListener, CreateThemeBottomSheetFragment.SelectBaseThemeBottomSheetFragmentListener { @@ -110,7 +109,6 @@ public class CustomThemeListingActivity extends BaseActivity implements CustomThemeListingRecyclerViewAdapter adapter = new CustomThemeListingRecyclerViewAdapter(this, CustomThemeWrapper.getPredefinedThemes(this)); recyclerView.setAdapter(adapter); - recyclerView.setLayoutManager(new LinearLayoutManager(this)); recyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() { @Override public void onScrolled(@NonNull RecyclerView recyclerView, int dx, int dy) { diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/CustomThemePreviewActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/CustomThemePreviewActivity.java index dbd40c31..e3d232e6 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/CustomThemePreviewActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/CustomThemePreviewActivity.java @@ -1,5 +1,10 @@ package ml.docilealligator.infinityforreddit.activities; +import static androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_AUTO_BATTERY; +import static androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM; +import static androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_NO; +import static androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_YES; + import android.content.SharedPreferences; import android.content.res.ColorStateList; import android.content.res.Configuration; @@ -43,22 +48,18 @@ import javax.inject.Named; import butterknife.BindView; import butterknife.ButterKnife; import ml.docilealligator.infinityforreddit.AppBarStateChangeListener; +import ml.docilealligator.infinityforreddit.Infinity; +import ml.docilealligator.infinityforreddit.R; import ml.docilealligator.infinityforreddit.customtheme.CustomTheme; import ml.docilealligator.infinityforreddit.customtheme.CustomThemeSettingsItem; +import ml.docilealligator.infinityforreddit.customviews.ViewPagerBugFixed; import ml.docilealligator.infinityforreddit.font.ContentFontStyle; import ml.docilealligator.infinityforreddit.font.FontStyle; import ml.docilealligator.infinityforreddit.font.TitleFontStyle; import ml.docilealligator.infinityforreddit.fragments.ThemePreviewCommentsFragment; import ml.docilealligator.infinityforreddit.fragments.ThemePreviewPostsFragment; -import ml.docilealligator.infinityforreddit.Infinity; -import ml.docilealligator.infinityforreddit.R; import ml.docilealligator.infinityforreddit.utils.SharedPreferencesUtils; -import static androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_AUTO_BATTERY; -import static androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM; -import static androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_NO; -import static androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_YES; - public class CustomThemePreviewActivity extends AppCompatActivity { public static final String EXTRA_CUSTOM_THEME_SETTINGS_ITEMS = "ECTSI"; @@ -66,7 +67,7 @@ public class CustomThemePreviewActivity extends AppCompatActivity { @BindView(R.id.coordinator_layout_theme_preview_activity) CoordinatorLayout coordinatorLayout; @BindView(R.id.view_pager_theme_preview_activity) - ViewPager viewPager; + ViewPagerBugFixed viewPager; @BindView(R.id.appbar_layout_theme_preview_activity) AppBarLayout appBarLayout; @BindView(R.id.collapsing_toolbar_layout_theme_preview_activity) diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/CustomizeThemeActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/CustomizeThemeActivity.java index fc238c34..989eb34f 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/CustomizeThemeActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/CustomizeThemeActivity.java @@ -12,7 +12,6 @@ import android.widget.Toast; import androidx.annotation.NonNull; import androidx.appcompat.widget.Toolbar; import androidx.coordinatorlayout.widget.CoordinatorLayout; -import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; import com.google.android.material.appbar.AppBarLayout; @@ -104,8 +103,6 @@ public class CustomizeThemeActivity extends BaseActivity { setTitle(R.string.customize_theme_activity_create_theme_label); } - recyclerView.setLayoutManager(new LinearLayoutManager(this)); - if (savedInstanceState != null) { customThemeSettingsItems = savedInstanceState.getParcelableArrayList(CUSTOM_THEME_SETTINGS_ITEMS_STATE); themeName = savedInstanceState.getString(THEME_NAME_STATE); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/EditCommentActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/EditCommentActivity.java index 8ebb0015..e46f581b 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/EditCommentActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/EditCommentActivity.java @@ -50,6 +50,7 @@ import ml.docilealligator.infinityforreddit.adapters.MarkdownBottomBarRecyclerVi import ml.docilealligator.infinityforreddit.apis.RedditAPI; import ml.docilealligator.infinityforreddit.bottomsheetfragments.UploadedImagesBottomSheetFragment; import ml.docilealligator.infinityforreddit.customtheme.CustomThemeWrapper; +import ml.docilealligator.infinityforreddit.customviews.LinearLayoutManagerBugFixed; import ml.docilealligator.infinityforreddit.events.SwitchAccountEvent; import ml.docilealligator.infinityforreddit.utils.APIUtils; import ml.docilealligator.infinityforreddit.utils.SharedPreferencesUtils; @@ -69,6 +70,7 @@ public class EditCommentActivity extends BaseActivity implements UploadImageEnab private static final int PICK_IMAGE_REQUEST_CODE = 100; private static final int CAPTURE_IMAGE_REQUEST_CODE = 200; + private static final int MARKDOWN_PREVIEW_REQUEST_CODE = 300; private static final String UPLOADED_IMAGES_STATE = "UIS"; @@ -157,7 +159,7 @@ public class EditCommentActivity extends BaseActivity implements UploadImageEnab } }); - markdownBottomBarRecyclerView.setLayoutManager(new LinearLayoutManager(this, + markdownBottomBarRecyclerView.setLayoutManager(new LinearLayoutManagerBugFixed(this, LinearLayoutManager.HORIZONTAL, false)); markdownBottomBarRecyclerView.setAdapter(adapter); @@ -206,47 +208,10 @@ public class EditCommentActivity extends BaseActivity implements UploadImageEnab if (item.getItemId() == R.id.action_preview_edit_comment_activity) { Intent intent = new Intent(this, FullMarkdownActivity.class); intent.putExtra(FullMarkdownActivity.EXTRA_COMMENT_MARKDOWN, contentEditText.getText().toString()); - startActivity(intent); + intent.putExtra(FullMarkdownActivity.EXTRA_SUBMIT_POST, true); + startActivityForResult(intent, MARKDOWN_PREVIEW_REQUEST_CODE); } else if (item.getItemId() == R.id.action_send_edit_comment_activity) { - if (!isSubmitting) { - isSubmitting = true; - - Snackbar.make(coordinatorLayout, R.string.posting, Snackbar.LENGTH_SHORT).show(); - - String content = contentEditText.getText().toString(); - - Map<String, String> params = new HashMap<>(); - params.put(APIUtils.THING_ID_KEY, mFullName); - params.put(APIUtils.TEXT_KEY, content); - - mOauthRetrofit.create(RedditAPI.class) - .editPostOrComment(APIUtils.getOAuthHeader(mAccessToken), params) - .enqueue(new Callback<String>() { - @Override - public void onResponse(@NonNull Call<String> call, @NonNull Response<String> response) { - isSubmitting = false; - if (response.isSuccessful()) { - Toast.makeText(EditCommentActivity.this, R.string.edit_success, Toast.LENGTH_SHORT).show(); - - Intent returnIntent = new Intent(); - returnIntent.putExtra(EXTRA_EDITED_COMMENT_CONTENT, Utils.modifyMarkdown(content)); - returnIntent.putExtra(EXTRA_EDITED_COMMENT_POSITION, getIntent().getExtras().getInt(EXTRA_POSITION)); - setResult(RESULT_OK, returnIntent); - - finish(); - } else { - Snackbar.make(coordinatorLayout, R.string.post_failed, Snackbar.LENGTH_SHORT).show(); - } - } - - @Override - public void onFailure(@NonNull Call<String> call, @NonNull Throwable t) { - isSubmitting = false; - Snackbar.make(coordinatorLayout, R.string.post_failed, Snackbar.LENGTH_SHORT).show(); - } - }); - - } + editComment(); return true; } else if (item.getItemId() == android.R.id.home) { onBackPressed(); @@ -255,11 +220,53 @@ public class EditCommentActivity extends BaseActivity implements UploadImageEnab return false; } + private void editComment() { + if (!isSubmitting) { + isSubmitting = true; + + Snackbar.make(coordinatorLayout, R.string.posting, Snackbar.LENGTH_SHORT).show(); + + String content = contentEditText.getText().toString(); + + Map<String, String> params = new HashMap<>(); + params.put(APIUtils.THING_ID_KEY, mFullName); + params.put(APIUtils.TEXT_KEY, content); + + mOauthRetrofit.create(RedditAPI.class) + .editPostOrComment(APIUtils.getOAuthHeader(mAccessToken), params) + .enqueue(new Callback<String>() { + @Override + public void onResponse(@NonNull Call<String> call, @NonNull Response<String> response) { + isSubmitting = false; + if (response.isSuccessful()) { + Toast.makeText(EditCommentActivity.this, R.string.edit_success, Toast.LENGTH_SHORT).show(); + + Intent returnIntent = new Intent(); + returnIntent.putExtra(EXTRA_EDITED_COMMENT_CONTENT, Utils.modifyMarkdown(content)); + returnIntent.putExtra(EXTRA_EDITED_COMMENT_POSITION, getIntent().getExtras().getInt(EXTRA_POSITION)); + setResult(RESULT_OK, returnIntent); + + finish(); + } else { + Snackbar.make(coordinatorLayout, R.string.post_failed, Snackbar.LENGTH_SHORT).show(); + } + } + + @Override + public void onFailure(@NonNull Call<String> call, @NonNull Throwable t) { + isSubmitting = false; + Snackbar.make(coordinatorLayout, R.string.post_failed, Snackbar.LENGTH_SHORT).show(); + } + }); + + } + } + private void promptAlertDialog(int titleResId, int messageResId) { new MaterialAlertDialogBuilder(this, R.style.MaterialAlertDialogTheme) .setTitle(titleResId) .setMessage(messageResId) - .setPositiveButton(R.string.yes, (dialogInterface, i) + .setPositiveButton(R.string.discard_dialog_button, (dialogInterface, i) -> finish()) .setNegativeButton(R.string.no, null) .show(); @@ -279,6 +286,8 @@ public class EditCommentActivity extends BaseActivity implements UploadImageEnab } else if (requestCode == CAPTURE_IMAGE_REQUEST_CODE) { Utils.uploadImageToReddit(this, mExecutor, mOauthRetrofit, mUploadMediaRetrofit, mAccessToken, contentEditText, coordinatorLayout, capturedImageUri, uploadedImages); + } else if (requestCode == MARKDOWN_PREVIEW_REQUEST_CODE) { + editComment(); } } } diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/EditPostActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/EditPostActivity.java index 50574e15..21e1418d 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/EditPostActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/EditPostActivity.java @@ -22,7 +22,6 @@ import androidx.annotation.Nullable; import androidx.appcompat.widget.Toolbar; import androidx.coordinatorlayout.widget.CoordinatorLayout; import androidx.core.content.FileProvider; -import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; import com.google.android.material.appbar.AppBarLayout; @@ -53,6 +52,7 @@ import ml.docilealligator.infinityforreddit.adapters.MarkdownBottomBarRecyclerVi import ml.docilealligator.infinityforreddit.apis.RedditAPI; import ml.docilealligator.infinityforreddit.bottomsheetfragments.UploadedImagesBottomSheetFragment; import ml.docilealligator.infinityforreddit.customtheme.CustomThemeWrapper; +import ml.docilealligator.infinityforreddit.customviews.LinearLayoutManagerBugFixed; import ml.docilealligator.infinityforreddit.events.SwitchAccountEvent; import ml.docilealligator.infinityforreddit.utils.APIUtils; import ml.docilealligator.infinityforreddit.utils.SharedPreferencesUtils; @@ -70,6 +70,7 @@ public class EditPostActivity extends BaseActivity implements UploadImageEnabled private static final int PICK_IMAGE_REQUEST_CODE = 100; private static final int CAPTURE_IMAGE_REQUEST_CODE = 200; + private static final int MARKDOWN_PREVIEW_REQUEST_CODE = 300; private static final String UPLOADED_IMAGES_STATE = "UIS"; @@ -167,8 +168,8 @@ public class EditPostActivity extends BaseActivity implements UploadImageEnabled } }); - markdownBottomBarRecyclerView.setLayoutManager(new LinearLayoutManager(this, - LinearLayoutManager.HORIZONTAL, false)); + markdownBottomBarRecyclerView.setLayoutManager(new LinearLayoutManagerBugFixed(this, + LinearLayoutManagerBugFixed.HORIZONTAL, false)); markdownBottomBarRecyclerView.setAdapter(adapter); contentEditText.requestFocus(); @@ -218,37 +219,10 @@ public class EditPostActivity extends BaseActivity implements UploadImageEnabled if (item.getItemId() == R.id.action_preview_edit_post_activity) { Intent intent = new Intent(this, FullMarkdownActivity.class); intent.putExtra(FullMarkdownActivity.EXTRA_COMMENT_MARKDOWN, contentEditText.getText().toString()); - startActivity(intent); + intent.putExtra(FullMarkdownActivity.EXTRA_SUBMIT_POST, true); + startActivityForResult(intent, MARKDOWN_PREVIEW_REQUEST_CODE); } else if (item.getItemId() == R.id.action_send_edit_post_activity) { - if (!isSubmitting) { - isSubmitting = true; - - Snackbar.make(coordinatorLayout, R.string.posting, Snackbar.LENGTH_SHORT).show(); - - Map<String, String> params = new HashMap<>(); - params.put(APIUtils.THING_ID_KEY, mFullName); - params.put(APIUtils.TEXT_KEY, contentEditText.getText().toString()); - - mOauthRetrofit.create(RedditAPI.class) - .editPostOrComment(APIUtils.getOAuthHeader(mAccessToken), params) - .enqueue(new Callback<String>() { - @Override - public void onResponse(@NonNull Call<String> call, @NonNull Response<String> response) { - isSubmitting = false; - Toast.makeText(EditPostActivity.this, R.string.edit_success, Toast.LENGTH_SHORT).show(); - Intent returnIntent = new Intent(); - setResult(RESULT_OK, returnIntent); - finish(); - } - - @Override - public void onFailure(@NonNull Call<String> call, @NonNull Throwable t) { - isSubmitting = false; - Snackbar.make(coordinatorLayout, R.string.post_failed, Snackbar.LENGTH_SHORT).show(); - } - }); - - } + editPost(); return true; } else if (item.getItemId() == android.R.id.home) { onBackPressed(); @@ -257,6 +231,38 @@ public class EditPostActivity extends BaseActivity implements UploadImageEnabled return false; } + private void editPost() { + if (!isSubmitting) { + isSubmitting = true; + + Snackbar.make(coordinatorLayout, R.string.posting, Snackbar.LENGTH_SHORT).show(); + + Map<String, String> params = new HashMap<>(); + params.put(APIUtils.THING_ID_KEY, mFullName); + params.put(APIUtils.TEXT_KEY, contentEditText.getText().toString()); + + mOauthRetrofit.create(RedditAPI.class) + .editPostOrComment(APIUtils.getOAuthHeader(mAccessToken), params) + .enqueue(new Callback<String>() { + @Override + public void onResponse(@NonNull Call<String> call, @NonNull Response<String> response) { + isSubmitting = false; + Toast.makeText(EditPostActivity.this, R.string.edit_success, Toast.LENGTH_SHORT).show(); + Intent returnIntent = new Intent(); + setResult(RESULT_OK, returnIntent); + finish(); + } + + @Override + public void onFailure(@NonNull Call<String> call, @NonNull Throwable t) { + isSubmitting = false; + Snackbar.make(coordinatorLayout, R.string.post_failed, Snackbar.LENGTH_SHORT).show(); + } + }); + + } + } + @Override protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) { super.onActivityResult(requestCode, resultCode, data); @@ -271,6 +277,8 @@ public class EditPostActivity extends BaseActivity implements UploadImageEnabled } else if (requestCode == CAPTURE_IMAGE_REQUEST_CODE) { Utils.uploadImageToReddit(this, mExecutor, mOauthRetrofit, mUploadMediaRetrofit, mAccessToken, contentEditText, coordinatorLayout, capturedImageUri, uploadedImages); + } else if (requestCode == MARKDOWN_PREVIEW_REQUEST_CODE) { + editPost(); } } } @@ -285,7 +293,7 @@ public class EditPostActivity extends BaseActivity implements UploadImageEnabled new MaterialAlertDialogBuilder(this, R.style.MaterialAlertDialogTheme) .setTitle(titleResId) .setMessage(messageResId) - .setPositiveButton(R.string.yes, (dialogInterface, i) + .setPositiveButton(R.string.discard_dialog_button, (dialogInterface, i) -> finish()) .setNegativeButton(R.string.no, null) .show(); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/FilteredPostsActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/FilteredPostsActivity.java index e14e8499..4d2ff01f 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/FilteredPostsActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/FilteredPostsActivity.java @@ -62,6 +62,7 @@ public class FilteredPostsActivity extends BaseActivity implements SortTypeSelec public static final String EXTRA_NAME = "ESN"; public static final String EXTRA_QUERY = "EQ"; + public static final String EXTRA_TRENDING_SOURCE = "ETS"; public static final String EXTRA_FILTER = "EF"; public static final String EXTRA_CONTAIN_FLAIR = "ECF"; public static final String EXTRA_POST_TYPE = "EPT"; @@ -312,6 +313,7 @@ public class FilteredPostsActivity extends BaseActivity implements SortTypeSelec } else if (postType == PostDataSource.TYPE_SEARCH) { bundle.putString(PostFragment.EXTRA_NAME, name); bundle.putString(PostFragment.EXTRA_QUERY, getIntent().getStringExtra(EXTRA_QUERY)); + bundle.putString(PostFragment.EXTRA_TRENDING_SOURCE, getIntent().getStringExtra(EXTRA_TRENDING_SOURCE)); } mFragment.setArguments(bundle); getSupportFragmentManager().beginTransaction().replace(R.id.frame_layout_filtered_posts_activity, mFragment).commit(); @@ -359,81 +361,81 @@ public class FilteredPostsActivity extends BaseActivity implements SortTypeSelec @Override public boolean onOptionsItemSelected(@NonNull MenuItem item) { - switch (item.getItemId()) { - case android.R.id.home: - finish(); - return true; - case R.id.action_sort_filtered_thing_activity: - switch (postType) { - case PostDataSource.TYPE_FRONT_PAGE: - SortTypeBottomSheetFragment bestSortTypeBottomSheetFragment = new SortTypeBottomSheetFragment(); - Bundle bestBundle = new Bundle(); - bestBundle.putBoolean(SortTypeBottomSheetFragment.EXTRA_NO_BEST_TYPE, false); - bestSortTypeBottomSheetFragment.setArguments(bestBundle); - bestSortTypeBottomSheetFragment.show(getSupportFragmentManager(), bestSortTypeBottomSheetFragment.getTag()); - break; - case PostDataSource.TYPE_SEARCH: - SearchPostSortTypeBottomSheetFragment searchPostSortTypeBottomSheetFragment = new SearchPostSortTypeBottomSheetFragment(); - Bundle searchBundle = new Bundle(); - searchPostSortTypeBottomSheetFragment.setArguments(searchBundle); - searchPostSortTypeBottomSheetFragment.show(getSupportFragmentManager(), searchPostSortTypeBottomSheetFragment.getTag()); - break; - case PostDataSource.TYPE_SUBREDDIT: - if (name.equals("popular") || name.equals("all")) { - SortTypeBottomSheetFragment popularAndAllSortTypeBottomSheetFragment = new SortTypeBottomSheetFragment(); - Bundle popularBundle = new Bundle(); - popularBundle.putBoolean(SortTypeBottomSheetFragment.EXTRA_NO_BEST_TYPE, true); - popularAndAllSortTypeBottomSheetFragment.setArguments(popularBundle); - popularAndAllSortTypeBottomSheetFragment.show(getSupportFragmentManager(), popularAndAllSortTypeBottomSheetFragment.getTag()); - } else { - SortTypeBottomSheetFragment subredditSortTypeBottomSheetFragment = new SortTypeBottomSheetFragment(); - Bundle subredditSheetBundle = new Bundle(); - subredditSheetBundle.putBoolean(SortTypeBottomSheetFragment.EXTRA_NO_BEST_TYPE, true); - subredditSortTypeBottomSheetFragment.setArguments(subredditSheetBundle); - subredditSortTypeBottomSheetFragment.show(getSupportFragmentManager(), subredditSortTypeBottomSheetFragment.getTag()); - } - break; - case PostDataSource.TYPE_MULTI_REDDIT: - SortTypeBottomSheetFragment multiRedditSortTypeBottomSheetFragment = new SortTypeBottomSheetFragment(); - Bundle multiRedditBundle = new Bundle(); - multiRedditBundle.putBoolean(SortTypeBottomSheetFragment.EXTRA_NO_BEST_TYPE, true); - multiRedditSortTypeBottomSheetFragment.setArguments(multiRedditBundle); - multiRedditSortTypeBottomSheetFragment.show(getSupportFragmentManager(), multiRedditSortTypeBottomSheetFragment.getTag()); - break; - case PostDataSource.TYPE_USER: - UserThingSortTypeBottomSheetFragment userThingSortTypeBottomSheetFragment = new UserThingSortTypeBottomSheetFragment(); - userThingSortTypeBottomSheetFragment.show(getSupportFragmentManager(), userThingSortTypeBottomSheetFragment.getTag()); - } - return true; - case R.id.action_refresh_filtered_thing_activity: - if (mMenu != null) { - mMenu.findItem(R.id.action_lazy_mode_filtered_thing_activity).setTitle(R.string.action_start_lazy_mode); - } - if (mFragment instanceof FragmentCommunicator) { - ((FragmentCommunicator) mFragment).refresh(); - } - return true; - case R.id.action_lazy_mode_filtered_thing_activity: - MenuItem lazyModeItem = mMenu.findItem(R.id.action_lazy_mode_filtered_thing_activity); - if (isInLazyMode) { - ((FragmentCommunicator) mFragment).stopLazyMode(); - isInLazyMode = false; - lazyModeItem.setTitle(R.string.action_start_lazy_mode); - params.setScrollFlags(AppBarLayout.LayoutParams.SCROLL_FLAG_SCROLL | AppBarLayout.LayoutParams.SCROLL_FLAG_ENTER_ALWAYS); - collapsingToolbarLayout.setLayoutParams(params); - } else { - if (((FragmentCommunicator) mFragment).startLazyMode()) { - isInLazyMode = true; - lazyModeItem.setTitle(R.string.action_stop_lazy_mode); - params.setScrollFlags(AppBarLayout.LayoutParams.SCROLL_FLAG_NO_SCROLL); - collapsingToolbarLayout.setLayoutParams(params); + int itemId = item.getItemId(); + if (itemId == android.R.id.home) { + finish(); + return true; + } else if (itemId == R.id.action_sort_filtered_thing_activity) { + switch (postType) { + case PostDataSource.TYPE_FRONT_PAGE: + SortTypeBottomSheetFragment bestSortTypeBottomSheetFragment = new SortTypeBottomSheetFragment(); + Bundle bestBundle = new Bundle(); + bestBundle.putBoolean(SortTypeBottomSheetFragment.EXTRA_NO_BEST_TYPE, false); + bestSortTypeBottomSheetFragment.setArguments(bestBundle); + bestSortTypeBottomSheetFragment.show(getSupportFragmentManager(), bestSortTypeBottomSheetFragment.getTag()); + break; + case PostDataSource.TYPE_SEARCH: + SearchPostSortTypeBottomSheetFragment searchPostSortTypeBottomSheetFragment = new SearchPostSortTypeBottomSheetFragment(); + Bundle searchBundle = new Bundle(); + searchPostSortTypeBottomSheetFragment.setArguments(searchBundle); + searchPostSortTypeBottomSheetFragment.show(getSupportFragmentManager(), searchPostSortTypeBottomSheetFragment.getTag()); + break; + case PostDataSource.TYPE_SUBREDDIT: + if (name.equals("popular") || name.equals("all")) { + SortTypeBottomSheetFragment popularAndAllSortTypeBottomSheetFragment = new SortTypeBottomSheetFragment(); + Bundle popularBundle = new Bundle(); + popularBundle.putBoolean(SortTypeBottomSheetFragment.EXTRA_NO_BEST_TYPE, true); + popularAndAllSortTypeBottomSheetFragment.setArguments(popularBundle); + popularAndAllSortTypeBottomSheetFragment.show(getSupportFragmentManager(), popularAndAllSortTypeBottomSheetFragment.getTag()); + } else { + SortTypeBottomSheetFragment subredditSortTypeBottomSheetFragment = new SortTypeBottomSheetFragment(); + Bundle subredditSheetBundle = new Bundle(); + subredditSheetBundle.putBoolean(SortTypeBottomSheetFragment.EXTRA_NO_BEST_TYPE, true); + subredditSortTypeBottomSheetFragment.setArguments(subredditSheetBundle); + subredditSortTypeBottomSheetFragment.show(getSupportFragmentManager(), subredditSortTypeBottomSheetFragment.getTag()); } + break; + case PostDataSource.TYPE_MULTI_REDDIT: + SortTypeBottomSheetFragment multiRedditSortTypeBottomSheetFragment = new SortTypeBottomSheetFragment(); + Bundle multiRedditBundle = new Bundle(); + multiRedditBundle.putBoolean(SortTypeBottomSheetFragment.EXTRA_NO_BEST_TYPE, true); + multiRedditSortTypeBottomSheetFragment.setArguments(multiRedditBundle); + multiRedditSortTypeBottomSheetFragment.show(getSupportFragmentManager(), multiRedditSortTypeBottomSheetFragment.getTag()); + break; + case PostDataSource.TYPE_USER: + UserThingSortTypeBottomSheetFragment userThingSortTypeBottomSheetFragment = new UserThingSortTypeBottomSheetFragment(); + userThingSortTypeBottomSheetFragment.show(getSupportFragmentManager(), userThingSortTypeBottomSheetFragment.getTag()); + } + return true; + } else if (itemId == R.id.action_refresh_filtered_thing_activity) { + if (mMenu != null) { + mMenu.findItem(R.id.action_lazy_mode_filtered_thing_activity).setTitle(R.string.action_start_lazy_mode); + } + if (mFragment != null) { + ((FragmentCommunicator) mFragment).refresh(); + } + return true; + } else if (itemId == R.id.action_lazy_mode_filtered_thing_activity) { + MenuItem lazyModeItem = mMenu.findItem(R.id.action_lazy_mode_filtered_thing_activity); + if (isInLazyMode) { + ((FragmentCommunicator) mFragment).stopLazyMode(); + isInLazyMode = false; + lazyModeItem.setTitle(R.string.action_start_lazy_mode); + params.setScrollFlags(AppBarLayout.LayoutParams.SCROLL_FLAG_SCROLL | AppBarLayout.LayoutParams.SCROLL_FLAG_ENTER_ALWAYS); + collapsingToolbarLayout.setLayoutParams(params); + } else { + if (((FragmentCommunicator) mFragment).startLazyMode()) { + isInLazyMode = true; + lazyModeItem.setTitle(R.string.action_stop_lazy_mode); + params.setScrollFlags(AppBarLayout.LayoutParams.SCROLL_FLAG_NO_SCROLL); + collapsingToolbarLayout.setLayoutParams(params); } - return true; - case R.id.action_change_post_layout_filtered_post_activity: - PostLayoutBottomSheetFragment postLayoutBottomSheetFragment = new PostLayoutBottomSheetFragment(); - postLayoutBottomSheetFragment.show(getSupportFragmentManager(), postLayoutBottomSheetFragment.getTag()); - return true; + } + return true; + } else if (itemId == R.id.action_change_post_layout_filtered_post_activity) { + PostLayoutBottomSheetFragment postLayoutBottomSheetFragment = new PostLayoutBottomSheetFragment(); + postLayoutBottomSheetFragment.show(getSupportFragmentManager(), postLayoutBottomSheetFragment.getTag()); + return true; } return false; } diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/FullMarkdownActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/FullMarkdownActivity.java index 312fe6cd..9eb9fb86 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/FullMarkdownActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/FullMarkdownActivity.java @@ -1,5 +1,6 @@ package ml.docilealligator.infinityforreddit.activities; +import android.app.Activity; import android.content.Intent; import android.content.SharedPreferences; import android.graphics.Color; @@ -11,6 +12,7 @@ import android.text.Spanned; import android.text.TextPaint; import android.text.style.ClickableSpan; import android.text.util.Linkify; +import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.view.Window; @@ -20,15 +22,15 @@ import android.widget.TextView; import androidx.annotation.NonNull; import androidx.appcompat.widget.Toolbar; import androidx.coordinatorlayout.widget.CoordinatorLayout; -import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; import com.google.android.material.appbar.AppBarLayout; -import com.google.android.material.appbar.CollapsingToolbarLayout; import com.r0adkll.slidr.Slidr; import com.r0adkll.slidr.model.SlidrInterface; import org.commonmark.ext.gfm.tables.TableBlock; +import org.greenrobot.eventbus.EventBus; +import org.greenrobot.eventbus.Subscribe; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -51,20 +53,21 @@ import io.noties.markwon.recycler.table.TableEntryPlugin; import ml.docilealligator.infinityforreddit.Infinity; import ml.docilealligator.infinityforreddit.R; import ml.docilealligator.infinityforreddit.customtheme.CustomThemeWrapper; +import ml.docilealligator.infinityforreddit.customviews.LinearLayoutManagerBugFixed; import ml.docilealligator.infinityforreddit.customviews.MarkwonLinearLayoutManager; +import ml.docilealligator.infinityforreddit.events.SwitchAccountEvent; import ml.docilealligator.infinityforreddit.utils.SharedPreferencesUtils; public class FullMarkdownActivity extends BaseActivity { public static final String EXTRA_COMMENT_MARKDOWN = "ECM"; public static final String EXTRA_IS_NSFW = "EIN"; + public static final String EXTRA_SUBMIT_POST = "ESP"; @BindView(R.id.coordinator_layout_comment_full_markdown_activity) CoordinatorLayout coordinatorLayout; @BindView(R.id.appbar_layout_comment_full_markdown_activity) AppBarLayout appBarLayout; - @BindView(R.id.collapsing_toolbar_layout_comment_full_markdown_activity) - CollapsingToolbarLayout collapsingToolbarLayout; @BindView(R.id.toolbar_comment_full_markdown_activity) Toolbar toolbar; @BindView(R.id.content_markdown_view_comment_full_markdown_activity) @@ -85,6 +88,8 @@ public class FullMarkdownActivity extends BaseActivity { ButterKnife.bind(this); + EventBus.getDefault().register(this); + applyCustomTheme(); setSupportActionBar(toolbar); @@ -112,7 +117,7 @@ public class FullMarkdownActivity extends BaseActivity { window.setFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS, WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS); } adjustToolbar(toolbar); - markdownRecyclerView.setPadding(0, 0, 0, getNavBarHeight()); + markdownRecyclerView.setPadding(markdownRecyclerView.getPaddingLeft(), 0, markdownRecyclerView.getPaddingRight(), getNavBarHeight()); } } @@ -212,7 +217,7 @@ public class FullMarkdownActivity extends BaseActivity { .tableLayout(R.layout.adapter_table_block, R.id.table_layout) .textLayoutIsRoot(R.layout.view_table_entry_cell))) .build(); - LinearLayoutManager linearLayoutManager = new MarkwonLinearLayoutManager(this, new MarkwonLinearLayoutManager.HorizontalScrollViewScrolledListener() { + LinearLayoutManagerBugFixed linearLayoutManager = new MarkwonLinearLayoutManager(this, new MarkwonLinearLayoutManager.HorizontalScrollViewScrolledListener() { @Override public void onScrolledLeft() { if (mSlidrInterface != null) { @@ -234,10 +239,26 @@ public class FullMarkdownActivity extends BaseActivity { } @Override + public boolean onCreateOptionsMenu(Menu menu) { + if (getIntent().getBooleanExtra(EXTRA_SUBMIT_POST, false)) { + getMenuInflater().inflate(R.menu.full_markdown_activity, menu); + applyMenuItemTheme(menu); + return true; + } + + return false; + } + + @Override public boolean onOptionsItemSelected(@NonNull MenuItem item) { if (item.getItemId() == android.R.id.home) { finish(); return true; + } else if (item.getItemId() == R.id.action_send_full_markdown_activity) { + Intent returnIntent = new Intent(); + setResult(Activity.RESULT_OK, returnIntent); + finish(); + return true; } return false; @@ -258,4 +279,17 @@ public class FullMarkdownActivity extends BaseActivity { coordinatorLayout.setBackgroundColor(mCustomThemeWrapper.getBackgroundColor()); applyAppBarLayoutAndToolbarTheme(appBarLayout, toolbar); } + + @Override + protected void onDestroy() { + super.onDestroy(); + EventBus.getDefault().unregister(this); + } + + @Subscribe + public void onAccountSwitchEvent(SwitchAccountEvent event) { + if (!getClass().getName().equals(event.excludeActivityClassName)) { + finish(); + } + } }
\ No newline at end of file diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/GiveAwardActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/GiveAwardActivity.java index a3cc4cdb..98e1b604 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/GiveAwardActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/GiveAwardActivity.java @@ -17,7 +17,6 @@ import android.widget.Toast; import androidx.annotation.NonNull; import androidx.appcompat.widget.Toolbar; import androidx.coordinatorlayout.widget.CoordinatorLayout; -import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; import com.bumptech.glide.Glide; @@ -39,6 +38,7 @@ import ml.docilealligator.infinityforreddit.RedditDataRoomDatabase; import ml.docilealligator.infinityforreddit.adapters.AwardRecyclerViewAdapter; import ml.docilealligator.infinityforreddit.award.GiveAward; import ml.docilealligator.infinityforreddit.customtheme.CustomThemeWrapper; +import ml.docilealligator.infinityforreddit.customviews.LinearLayoutManagerBugFixed; import ml.docilealligator.infinityforreddit.utils.SharedPreferencesUtils; import retrofit2.Retrofit; @@ -162,7 +162,7 @@ public class GiveAwardActivity extends BaseActivity { .setNegativeButton(R.string.no, null) .show(); }); - recyclerView.setLayoutManager(new LinearLayoutManager(this)); + recyclerView.setLayoutManager(new LinearLayoutManagerBugFixed(this)); recyclerView.setAdapter(adapter); } diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/InboxActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/InboxActivity.java index 52ff2e14..2437103f 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/InboxActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/InboxActivity.java @@ -9,7 +9,6 @@ import android.os.Handler; import android.view.Menu; import android.view.MenuItem; import android.view.View; -import android.view.ViewGroup; import android.view.Window; import android.view.WindowManager; import android.view.inputmethod.EditorInfo; @@ -21,15 +20,17 @@ import androidx.annotation.Nullable; import androidx.appcompat.widget.Toolbar; import androidx.coordinatorlayout.widget.CoordinatorLayout; import androidx.fragment.app.Fragment; +import androidx.fragment.app.FragmentActivity; import androidx.fragment.app.FragmentManager; -import androidx.fragment.app.FragmentPagerAdapter; -import androidx.viewpager.widget.ViewPager; +import androidx.viewpager2.adapter.FragmentStateAdapter; +import androidx.viewpager2.widget.ViewPager2; import com.google.android.material.appbar.AppBarLayout; import com.google.android.material.appbar.CollapsingToolbarLayout; import com.google.android.material.dialog.MaterialAlertDialogBuilder; import com.google.android.material.floatingactionbutton.FloatingActionButton; import com.google.android.material.tabs.TabLayout; +import com.google.android.material.tabs.TabLayoutMediator; import com.google.android.material.textfield.TextInputEditText; import com.r0adkll.slidr.Slidr; import com.r0adkll.slidr.model.SlidrInterface; @@ -81,7 +82,7 @@ public class InboxActivity extends BaseActivity implements ActivityToolbarInterf @BindView(R.id.tab_layout_inbox_activity) TabLayout tabLayout; @BindView(R.id.view_pager_inbox_activity) - ViewPager viewPager; + ViewPager2 viewPager2; @BindView(R.id.fab_inbox_activity) FloatingActionButton fab; @Inject @@ -101,6 +102,7 @@ public class InboxActivity extends BaseActivity implements ActivityToolbarInterf Executor mExecutor; private SlidrInterface mSlidrInterface; private SectionsPagerAdapter sectionsPagerAdapter; + private FragmentManager fragmentManager; private String mAccessToken; private String mAccountName; private String mNewAccountName; @@ -153,6 +155,8 @@ public class InboxActivity extends BaseActivity implements ActivityToolbarInterf setSupportActionBar(mToolbar); setToolbarGoToTop(mToolbar); + fragmentManager = getSupportFragmentManager(); + mAccessToken = mCurrentAccountSharedPreferences.getString(SharedPreferencesUtils.ACCESS_TOKEN, null); mAccountName = mCurrentAccountSharedPreferences.getString(SharedPreferencesUtils.ACCOUNT_NAME, null); @@ -163,7 +167,7 @@ public class InboxActivity extends BaseActivity implements ActivityToolbarInterf } getCurrentAccountAndFetchMessage(savedInstanceState); - viewPager.addOnPageChangeListener(new ViewPager.SimpleOnPageChangeListener(){ + viewPager2.registerOnPageChangeCallback(new ViewPager2.OnPageChangeCallback() { @Override public void onPageSelected(int position) { fab.show(); @@ -263,8 +267,8 @@ public class InboxActivity extends BaseActivity implements ActivityToolbarInterf } private void bindView(Bundle savedInstanceState) { - sectionsPagerAdapter = new SectionsPagerAdapter(getSupportFragmentManager()); - viewPager.addOnPageChangeListener(new ViewPager.SimpleOnPageChangeListener() { + sectionsPagerAdapter = new SectionsPagerAdapter(this); + viewPager2.registerOnPageChangeCallback(new ViewPager2.OnPageChangeCallback() { @Override public void onPageSelected(int position) { if (position == 0) { @@ -274,12 +278,23 @@ public class InboxActivity extends BaseActivity implements ActivityToolbarInterf } } }); - viewPager.setAdapter(sectionsPagerAdapter); - viewPager.setOffscreenPageLimit(2); - tabLayout.setupWithViewPager(viewPager); + viewPager2.setAdapter(sectionsPagerAdapter); + viewPager2.setOffscreenPageLimit(2); + new TabLayoutMediator(tabLayout, viewPager2, (tab, position) -> { + switch (position) { + case 0: + tab.setText(R.string.notifications); + break; + case 1: + tab.setText(R.string.messages); + break; + } + }).attach(); if (savedInstanceState == null && getIntent().getBooleanExtra(EXTRA_VIEW_MESSAGE, false)) { - viewPager.setCurrentItem(1); + viewPager2.setCurrentItem(1, false); } + + fixViewPager2Sensitivity(viewPager2); } @Override @@ -389,17 +404,44 @@ public class InboxActivity extends BaseActivity implements ActivityToolbarInterf fab.hide(); } - private class SectionsPagerAdapter extends FragmentPagerAdapter { - private InboxFragment tab1; - private InboxFragment tab2; + private class SectionsPagerAdapter extends FragmentStateAdapter { - public SectionsPagerAdapter(@NonNull FragmentManager fm) { - super(fm, FragmentPagerAdapter.BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT); + SectionsPagerAdapter(FragmentActivity fa) { + super(fa); + } + + @Nullable + private Fragment getCurrentFragment() { + if (viewPager2 == null || fragmentManager == null) { + return null; + } + return fragmentManager.findFragmentByTag("f" + viewPager2.getCurrentItem()); + } + + void refresh() { + InboxFragment fragment = (InboxFragment) getCurrentFragment(); + if (fragment != null) { + fragment.refresh(); + } + } + + void goBackToTop() { + InboxFragment fragment = (InboxFragment) getCurrentFragment(); + if (fragment != null) { + fragment.goBackToTop(); + } + } + + void readAllMessages() { + InboxFragment fragment = (InboxFragment) getCurrentFragment(); + if (fragment != null) { + fragment.markAllMessagesRead(); + } } @NonNull @Override - public Fragment getItem(int position) { + public Fragment createFragment(int position) { if (position == 0) { InboxFragment fragment = new InboxFragment(); Bundle bundle = new Bundle(); @@ -418,62 +460,8 @@ public class InboxActivity extends BaseActivity implements ActivityToolbarInterf } @Override - public int getCount() { + public int getItemCount() { return 2; } - - @Nullable - @Override - public CharSequence getPageTitle(int position) { - if (position == 0) { - return getString(R.string.notifications); - } - - return getString(R.string.messages); - } - - @NonNull - @Override - public Object instantiateItem(@NonNull ViewGroup container, int position) { - Fragment fragment = (Fragment) super.instantiateItem(container, position); - if (position == 0) { - tab1 = (InboxFragment) fragment; - } else if (position == 1) { - tab2 = (InboxFragment) fragment; - } - - return fragment; - } - - void refresh() { - if (viewPager.getCurrentItem() == 0) { - if (tab1 != null) { - tab1.refresh(); - } - } else if (viewPager.getCurrentItem() == 1 && tab2 != null) { - tab2.refresh(); - } - } - - void goBackToTop() { - if (viewPager.getCurrentItem() == 0) { - if (tab1 != null) { - tab1.goBackToTop(); - } - } else if (viewPager.getCurrentItem() == 1) { - if (tab2 != null) { - tab2.goBackToTop(); - } - } - } - - void readAllMessages() { - if (tab1 != null) { - tab1.markAllMessagesRead(); - } - if (tab2 != null) { - tab2.markAllMessagesRead(); - } - } } } diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/LinkResolverActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/LinkResolverActivity.java index 7f834f48..a6596edb 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/LinkResolverActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/LinkResolverActivity.java @@ -48,6 +48,8 @@ public class LinkResolverActivity extends AppCompatActivity { private static final String IMGUR_GALLERY_PATTERN = "/gallery/\\w+/?"; private static final String IMGUR_ALBUM_PATTERN = "/(album|a)/\\w+/?"; private static final String IMGUR_IMAGE_PATTERN = "/\\w+/?"; + private static final String RPAN_BROADCAST_PATTERN = "/rpan/r/[\\w-]+/\\w+/?\\w+/?"; + private static final String WIKI_PATTERN = "/[rR]/[\\w-]+/(wiki|w)/?\\w+"; @Inject @Named("default") @@ -117,7 +119,19 @@ public class LinkResolverActivity extends AppCompatActivity { List<String> segments = uri.getPathSegments(); if (authority != null) { - if (authority.equals("v.redd.it")) { + if (authority.equals("reddit-uploaded-media.s3-accelerate.amazonaws.com")) { + String unescapedUrl = uri.toString().replace("%2F", "/"); + int lastSlashIndex = unescapedUrl.lastIndexOf("/"); + if (lastSlashIndex < 0 || lastSlashIndex == unescapedUrl.length() - 1) { + deepLinkError(uri); + return; + } + String id = unescapedUrl.substring(lastSlashIndex + 1); + Intent intent = new Intent(this, ViewImageOrGifActivity.class); + intent.putExtra(ViewImageOrGifActivity.EXTRA_IMAGE_URL_KEY, uri.toString()); + intent.putExtra(ViewImageOrGifActivity.EXTRA_FILE_NAME_KEY, id + ".jpg"); + startActivity(intent); + } else if (authority.equals("v.redd.it")) { Intent intent = new Intent(this, ViewVideoActivity.class); intent.putExtra(ViewVideoActivity.EXTRA_VIDEO_TYPE, ViewVideoActivity.VIDEO_TYPE_V_REDD_IT); intent.putExtra(ViewVideoActivity.EXTRA_V_REDD_IT_URL, uri.toString()); @@ -158,6 +172,10 @@ public class LinkResolverActivity extends AppCompatActivity { } else { deepLinkError(uri); } + } else if (path.matches(WIKI_PATTERN)) { + Intent intent = new Intent(this, WikiActivity.class); + intent.putExtra(WikiActivity.EXTRA_SUBREDDIT_NAME, segments.get(1)); + startActivity(intent); } else if (path.matches(SUBREDDIT_PATTERN)) { Intent intent = new Intent(this, ViewSubredditDetailActivity.class); intent.putExtra(ViewSubredditDetailActivity.EXTRA_SUBREDDIT_NAME_KEY, path.substring(3)); @@ -186,6 +204,10 @@ public class LinkResolverActivity extends AppCompatActivity { intent.putExtra(ViewSubredditDetailActivity.EXTRA_MESSAGE_FULLNAME, messageFullname); intent.putExtra(ViewSubredditDetailActivity.EXTRA_NEW_ACCOUNT_NAME, newAccountName); startActivity(intent); + } else if (path.matches(RPAN_BROADCAST_PATTERN)) { + Intent intent = new Intent(this, RPANActivity.class); + intent.putExtra(RPANActivity.EXTRA_RPAN_BROADCAST_FULLNAME_OR_ID, path.substring(path.lastIndexOf('/') + 1)); + startActivity(intent); } else if (authority.equals("redd.it") && path.matches(REDD_IT_POST_PATTERN)) { Intent intent = new Intent(this, ViewPostDetailActivity.class); intent.putExtra(ViewPostDetailActivity.EXTRA_POST_ID, path.substring(1)); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/LockScreenActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/LockScreenActivity.java index 8dc39275..3ba73440 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/LockScreenActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/LockScreenActivity.java @@ -1,5 +1,8 @@ package ml.docilealligator.infinityforreddit.activities; +import static androidx.biometric.BiometricManager.Authenticators.BIOMETRIC_STRONG; +import static androidx.biometric.BiometricManager.Authenticators.DEVICE_CREDENTIAL; + import android.content.SharedPreferences; import android.os.Bundle; @@ -17,9 +20,6 @@ import ml.docilealligator.infinityforreddit.Infinity; import ml.docilealligator.infinityforreddit.R; import ml.docilealligator.infinityforreddit.customtheme.CustomThemeWrapper; -import static androidx.biometric.BiometricManager.Authenticators.BIOMETRIC_STRONG; -import static androidx.biometric.BiometricManager.Authenticators.DEVICE_CREDENTIAL; - public class LockScreenActivity extends BaseActivity { @Inject @@ -79,7 +79,5 @@ public class LockScreenActivity extends BaseActivity { } @Override - public void onBackPressed() { - moveTaskToBack(true); - } + public void onBackPressed() { } }
\ No newline at end of file diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/MainActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/MainActivity.java index 4a2c945a..55522aa9 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/MainActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/MainActivity.java @@ -1,5 +1,8 @@ package ml.docilealligator.infinityforreddit.activities; +import static androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_NO; +import static androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_YES; + import android.app.Activity; import android.content.Context; import android.content.Intent; @@ -9,6 +12,8 @@ import android.graphics.Color; import android.os.Build; import android.os.Bundle; import android.os.Handler; +import android.text.Editable; +import android.text.TextWatcher; import android.view.Gravity; import android.view.KeyEvent; import android.view.Menu; @@ -36,7 +41,6 @@ import androidx.fragment.app.FragmentActivity; import androidx.fragment.app.FragmentManager; import androidx.lifecycle.Observer; import androidx.lifecycle.ViewModelProvider; -import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; import androidx.viewpager2.adapter.FragmentStateAdapter; import androidx.viewpager2.widget.ViewPager2; @@ -81,6 +85,8 @@ import ml.docilealligator.infinityforreddit.SortType; import ml.docilealligator.infinityforreddit.SortTypeSelectionCallback; import ml.docilealligator.infinityforreddit.account.AccountViewModel; import ml.docilealligator.infinityforreddit.adapters.NavigationDrawerRecyclerViewAdapter; +import ml.docilealligator.infinityforreddit.adapters.SubredditAutocompleteRecyclerViewAdapter; +import ml.docilealligator.infinityforreddit.apis.RedditAPI; import ml.docilealligator.infinityforreddit.asynctasks.InsertSubscribedThings; import ml.docilealligator.infinityforreddit.asynctasks.SwitchAccount; import ml.docilealligator.infinityforreddit.asynctasks.SwitchToAnonymousMode; @@ -91,6 +97,7 @@ import ml.docilealligator.infinityforreddit.bottomsheetfragments.RandomBottomShe import ml.docilealligator.infinityforreddit.bottomsheetfragments.SortTimeBottomSheetFragment; import ml.docilealligator.infinityforreddit.bottomsheetfragments.SortTypeBottomSheetFragment; import ml.docilealligator.infinityforreddit.customtheme.CustomThemeWrapper; +import ml.docilealligator.infinityforreddit.customviews.LinearLayoutManagerBugFixed; import ml.docilealligator.infinityforreddit.events.ChangeConfirmToExitEvent; import ml.docilealligator.infinityforreddit.events.ChangeDisableSwipingBetweenTabsEvent; import ml.docilealligator.infinityforreddit.events.ChangeLockBottomAppBarEvent; @@ -106,21 +113,22 @@ import ml.docilealligator.infinityforreddit.multireddit.MultiRedditViewModel; import ml.docilealligator.infinityforreddit.post.Post; import ml.docilealligator.infinityforreddit.post.PostDataSource; import ml.docilealligator.infinityforreddit.readpost.InsertReadPost; +import ml.docilealligator.infinityforreddit.subreddit.ParseSubredditData; import ml.docilealligator.infinityforreddit.subreddit.SubredditData; import ml.docilealligator.infinityforreddit.subscribedsubreddit.SubscribedSubredditData; import ml.docilealligator.infinityforreddit.subscribedsubreddit.SubscribedSubredditViewModel; import ml.docilealligator.infinityforreddit.subscribeduser.SubscribedUserData; import ml.docilealligator.infinityforreddit.user.FetchUserData; import ml.docilealligator.infinityforreddit.user.UserData; +import ml.docilealligator.infinityforreddit.utils.APIUtils; import ml.docilealligator.infinityforreddit.utils.CustomThemeSharedPreferencesUtils; import ml.docilealligator.infinityforreddit.utils.SharedPreferencesUtils; import ml.docilealligator.infinityforreddit.utils.Utils; import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; import retrofit2.Retrofit; -import static androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_NO; -import static androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_YES; - public class MainActivity extends BaseActivity implements SortTypeSelectionCallback, PostTypeBottomSheetFragment.PostTypeSelectionCallback, PostLayoutBottomSheetFragment.PostLayoutSelectionCallback, ActivityToolbarInterface, FABMoreOptionsBottomSheetFragment.FABOptionSelectionCallback, @@ -754,6 +762,10 @@ public class MainActivity extends BaseActivity implements SortTypeSelectionCallb } else if (stringId == R.string.multi_reddit) { intent = new Intent(MainActivity.this, SubscribedThingListingActivity.class); intent.putExtra(SubscribedThingListingActivity.EXTRA_SHOW_MULTIREDDITS, true); + } else if (stringId == R.string.rpan) { + intent = new Intent(MainActivity.this, RPANActivity.class); + } else if (stringId == R.string.trending) { + intent = new Intent(MainActivity.this, TrendingActivity.class); } else if (stringId == R.string.upvoted) { intent = new Intent(MainActivity.this, AccountPostsActivity.class); intent.putExtra(AccountPostsActivity.EXTRA_USER_WHERE, PostDataSource.USER_WHERE_UPVOTED); @@ -835,7 +847,7 @@ public class MainActivity extends BaseActivity implements SortTypeSelectionCallb } }); adapter.setInboxCount(inboxCount); - navDrawerRecyclerView.setLayoutManager(new LinearLayoutManager(this)); + navDrawerRecyclerView.setLayoutManager(new LinearLayoutManagerBugFixed(this)); navDrawerRecyclerView.setAdapter(adapter); int tabCount = mMainActivityTabsSharedPreferences.getInt((mAccountName == null ? "" : mAccountName) + SharedPreferencesUtils.MAIN_PAGE_TAB_COUNT, 3); @@ -1216,6 +1228,10 @@ public class MainActivity extends BaseActivity implements SortTypeSelectionCallb case PostTypeBottomSheetFragment.TYPE_VIDEO: intent = new Intent(MainActivity.this, PostVideoActivity.class); startActivity(intent); + break; + case PostTypeBottomSheetFragment.TYPE_GALLERY: + intent = new Intent(MainActivity.this, PostGalleryActivity.class); + startActivity(intent); } } @@ -1293,7 +1309,7 @@ public class MainActivity extends BaseActivity implements SortTypeSelectionCallb adapter.setShowAvatarOnTheRightInTheNavigationDrawer(event.showAvatarOnTheRightInTheNavigationDrawer); int previousPosition = -1; if (navDrawerRecyclerView.getLayoutManager() != null) { - previousPosition = ((LinearLayoutManager) navDrawerRecyclerView.getLayoutManager()).findFirstVisibleItemPosition(); + previousPosition = ((LinearLayoutManagerBugFixed) navDrawerRecyclerView.getLayoutManager()).findFirstVisibleItemPosition(); } RecyclerView.LayoutManager layoutManager = navDrawerRecyclerView.getLayoutManager(); @@ -1373,7 +1389,7 @@ public class MainActivity extends BaseActivity implements SortTypeSelectionCallb } private void goToSubreddit() { - /*View rootView = getLayoutInflater().inflate(R.layout.dialog_go_to_thing_edit_text, coordinatorLayout, false); + View rootView = getLayoutInflater().inflate(R.layout.dialog_go_to_thing_edit_text, coordinatorLayout, false); TextInputEditText thingEditText = rootView.findViewById(R.id.text_input_edit_text_go_to_thing_edit_text); RecyclerView recyclerView = rootView.findViewById(R.id.recycler_view_go_to_thing_edit_text); InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); @@ -1461,15 +1477,17 @@ public class MainActivity extends BaseActivity implements SortTypeSelectionCallb subredditIntent.putExtra(ViewSubredditDetailActivity.EXTRA_SUBREDDIT_NAME_KEY, thingEditText.getText().toString()); startActivity(subredditIntent); }) - .setNegativeButton(R.string.cancel, null) + .setNegativeButton(R.string.cancel, (dialogInterface, i) -> { + if (imm != null) { + imm.hideSoftInputFromWindow(thingEditText.getWindowToken(), 0); + } + }) .setOnDismissListener(dialogInterface -> { if (imm != null) { imm.hideSoftInputFromWindow(thingEditText.getWindowToken(), 0); } }) - .show();*/ - Intent intent = new Intent(this, RPANActivity.class); - startActivity(intent); + .show(); } private void goToUser() { @@ -1504,7 +1522,11 @@ public class MainActivity extends BaseActivity implements SortTypeSelectionCallb userIntent.putExtra(ViewUserDetailActivity.EXTRA_USER_NAME_KEY, thingEditText.getText().toString()); startActivity(userIntent); }) - .setNegativeButton(R.string.cancel, null) + .setNegativeButton(R.string.cancel, (dialogInterface, i) -> { + if (imm != null) { + imm.hideSoftInputFromWindow(thingEditText.getWindowToken(), 0); + } + }) .setOnDismissListener(dialogInterface -> { if (imm != null) { imm.hideSoftInputFromWindow(thingEditText.getWindowToken(), 0); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/MotionTestActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/MotionTestActivity.java deleted file mode 100644 index ba8d0681..00000000 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/MotionTestActivity.java +++ /dev/null @@ -1,41 +0,0 @@ -package ml.docilealligator.infinityforreddit.activities; - -import android.os.Bundle; -import android.util.Log; - -import androidx.appcompat.app.AppCompatActivity; -import androidx.constraintlayout.motion.widget.MotionLayout; - -import ml.docilealligator.infinityforreddit.R; - -public class MotionTestActivity extends AppCompatActivity { - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_motion_test); - - MotionLayout motionLayout = findViewById(R.id.motion_layout); - motionLayout.addTransitionListener(new MotionLayout.TransitionListener() { - @Override - public void onTransitionStarted(MotionLayout motionLayout, int i, int i1) { - Log.i("asdfasdf", "start " + (i == R.id.start) + " " + (i1 == R.id.end)); - } - - @Override - public void onTransitionChange(MotionLayout motionLayout, int i, int i1, float v) { - Log.i("asdfasdf", "start " + (i == R.id.start) + " " + (i1 == R.id.end) + " " + v); - } - - @Override - public void onTransitionCompleted(MotionLayout motionLayout, int i) { - Log.i("asdfasdf", "complete " + (i == R.id.start)); - } - - @Override - public void onTransitionTrigger(MotionLayout motionLayout, int i, boolean b, float v) { - Log.i("asdfasdf", "trigger " + (i == R.id.start) + " " + v + " " + b); - } - }); - } -}
\ No newline at end of file diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostFilterPreferenceActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostFilterPreferenceActivity.java index e64bf21e..4ed7534d 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostFilterPreferenceActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostFilterPreferenceActivity.java @@ -36,6 +36,8 @@ import ml.docilealligator.infinityforreddit.postfilter.PostFilterViewModel; public class PostFilterPreferenceActivity extends BaseActivity { public static final String EXTRA_POST = "EP"; + public static final String EXTRA_SUBREDDIT_NAME = "ESN"; + public static final String EXTRA_USER_NAME = "EUN"; @BindView(R.id.coordinator_layout_post_filter_preference_activity) CoordinatorLayout coordinatorLayout; @@ -76,26 +78,36 @@ public class PostFilterPreferenceActivity extends BaseActivity { getSupportActionBar().setDisplayHomeAsUpEnabled(true); Post post = getIntent().getParcelableExtra(EXTRA_POST); + String subredditName = getIntent().getStringExtra(EXTRA_SUBREDDIT_NAME); + String username = getIntent().getStringExtra(EXTRA_USER_NAME); fab.setOnClickListener(view -> { - if (post == null) { + if (post != null) { + showPostFilterOptions(post, null); + } else if (subredditName != null) { + excludeSubredditInFilter(subredditName, null); + } else if (username != null) { + excludeUserInFilter(username, null); + } else { Intent intent = new Intent(PostFilterPreferenceActivity.this, CustomizePostFilterActivity.class); intent.putExtra(CustomizePostFilterActivity.EXTRA_FROM_SETTINGS, true); startActivity(intent); - } else { - showPostFilterOptions(post, null); } }); adapter = new PostFilterRecyclerViewAdapter(postFilter -> { - if (post == null) { + if (post != null) { + showPostFilterOptions(post, postFilter); + } else if (subredditName != null) { + excludeSubredditInFilter(subredditName, postFilter); + } else if (username != null) { + excludeUserInFilter(username, postFilter); + } else { PostFilterOptionsBottomSheetFragment postFilterOptionsBottomSheetFragment = new PostFilterOptionsBottomSheetFragment(); Bundle bundle = new Bundle(); bundle.putParcelable(PostFilterOptionsBottomSheetFragment.EXTRA_POST_FILTER, postFilter); postFilterOptionsBottomSheetFragment.setArguments(bundle); postFilterOptionsBottomSheetFragment.show(getSupportFragmentManager(), postFilterOptionsBottomSheetFragment.getTag()); - } else { - showPostFilterOptions(post, postFilter); } }); @@ -145,6 +157,24 @@ public class PostFilterPreferenceActivity extends BaseActivity { .show(); } + public void excludeSubredditInFilter(String subredditName, PostFilter postFilter) { + Intent intent = new Intent(this, CustomizePostFilterActivity.class); + intent.putExtra(CustomizePostFilterActivity.EXTRA_EXCLUDE_SUBREDDIT, subredditName); + if (postFilter != null) { + intent.putExtra(CustomizePostFilterActivity.EXTRA_POST_FILTER, postFilter); + } + startActivity(intent); + } + + public void excludeUserInFilter(String username, PostFilter postFilter) { + Intent intent = new Intent(this, CustomizePostFilterActivity.class); + intent.putExtra(CustomizePostFilterActivity.EXTRA_EXCLUDE_USER, username); + if (postFilter != null) { + intent.putExtra(CustomizePostFilterActivity.EXTRA_POST_FILTER, postFilter); + } + startActivity(intent); + } + public void editPostFilter(PostFilter postFilter) { Intent intent = new Intent(PostFilterPreferenceActivity.this, CustomizePostFilterActivity.class); intent.putExtra(CustomizePostFilterActivity.EXTRA_POST_FILTER, postFilter); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostGalleryActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostGalleryActivity.java new file mode 100644 index 00000000..8edb4516 --- /dev/null +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostGalleryActivity.java @@ -0,0 +1,709 @@ +package ml.docilealligator.infinityforreddit.activities; + +import android.content.ActivityNotFoundException; +import android.content.Intent; +import android.content.SharedPreferences; +import android.content.res.Configuration; +import android.content.res.Resources; +import android.graphics.Bitmap; +import android.graphics.Rect; +import android.net.Uri; +import android.os.Build; +import android.os.Bundle; +import android.os.Environment; +import android.os.Handler; +import android.provider.MediaStore; +import android.view.Menu; +import android.view.MenuItem; +import android.view.View; +import android.widget.EditText; +import android.widget.LinearLayout; +import android.widget.TextView; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.appcompat.widget.Toolbar; +import androidx.coordinatorlayout.widget.CoordinatorLayout; +import androidx.core.content.ContextCompat; +import androidx.core.content.FileProvider; +import androidx.recyclerview.widget.GridLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + +import com.bumptech.glide.Glide; +import com.bumptech.glide.RequestManager; +import com.bumptech.glide.request.RequestOptions; +import com.google.android.material.appbar.AppBarLayout; +import com.google.android.material.button.MaterialButton; +import com.google.android.material.dialog.MaterialAlertDialogBuilder; +import com.google.android.material.snackbar.Snackbar; +import com.google.android.material.switchmaterial.SwitchMaterial; +import com.google.gson.Gson; +import com.libRG.CustomTextView; + +import org.greenrobot.eventbus.EventBus; +import org.greenrobot.eventbus.Subscribe; +import org.json.JSONException; +import org.json.JSONObject; +import org.xmlpull.v1.XmlPullParserException; + +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.Executor; + +import javax.inject.Inject; +import javax.inject.Named; + +import butterknife.BindView; +import butterknife.ButterKnife; +import jp.wasabeef.glide.transformations.RoundedCornersTransformation; +import ml.docilealligator.infinityforreddit.Flair; +import ml.docilealligator.infinityforreddit.Infinity; +import ml.docilealligator.infinityforreddit.R; +import ml.docilealligator.infinityforreddit.RedditDataRoomDatabase; +import ml.docilealligator.infinityforreddit.RedditGalleryPayload; +import ml.docilealligator.infinityforreddit.adapters.RedditGallerySubmissionRecyclerViewAdapter; +import ml.docilealligator.infinityforreddit.asynctasks.LoadSubredditIcon; +import ml.docilealligator.infinityforreddit.bottomsheetfragments.FlairBottomSheetFragment; +import ml.docilealligator.infinityforreddit.bottomsheetfragments.SelectOrCaptureImageBottomSheetFragment; +import ml.docilealligator.infinityforreddit.customtheme.CustomThemeWrapper; +import ml.docilealligator.infinityforreddit.events.SubmitGalleryPostEvent; +import ml.docilealligator.infinityforreddit.events.SwitchAccountEvent; +import ml.docilealligator.infinityforreddit.services.SubmitPostService; +import ml.docilealligator.infinityforreddit.utils.JSONUtils; +import ml.docilealligator.infinityforreddit.utils.SharedPreferencesUtils; +import ml.docilealligator.infinityforreddit.utils.UploadImageUtils; +import ml.docilealligator.infinityforreddit.utils.Utils; +import pl.droidsonroids.gif.GifImageView; +import retrofit2.Retrofit; + +public class PostGalleryActivity extends BaseActivity implements FlairBottomSheetFragment.FlairSelectionCallback { + + static final String EXTRA_SUBREDDIT_NAME = "ESN"; + + private static final String SUBREDDIT_NAME_STATE = "SNS"; + private static final String SUBREDDIT_ICON_STATE = "SIS"; + private static final String SUBREDDIT_SELECTED_STATE = "SSS"; + private static final String SUBREDDIT_IS_USER_STATE = "SIUS"; + private static final String LOAD_SUBREDDIT_ICON_STATE = "LSIS"; + private static final String IS_POSTING_STATE = "IPS"; + private static final String FLAIR_STATE = "FS"; + private static final String IS_SPOILER_STATE = "ISS"; + private static final String IS_NSFW_STATE = "INS"; + private static final String REDDIT_GALLERY_IMAGE_INFO_STATE = "RGIIS"; + + private static final int SUBREDDIT_SELECTION_REQUEST_CODE = 0; + private static final int PICK_IMAGE_REQUEST_CODE = 1; + private static final int CAPTURE_IMAGE_REQUEST_CODE = 2; + + @BindView(R.id.coordinator_layout_post_gallery_activity) + CoordinatorLayout coordinatorLayout; + @BindView(R.id.appbar_layout_post_gallery_activity) + AppBarLayout appBarLayout; + @BindView(R.id.toolbar_post_gallery_activity) + Toolbar toolbar; + @BindView(R.id.subreddit_icon_gif_image_view_post_gallery_activity) + GifImageView iconGifImageView; + @BindView(R.id.subreddit_name_text_view_post_gallery_activity) + TextView subredditNameTextView; + @BindView(R.id.rules_button_post_gallery_activity) + MaterialButton rulesButton; + @BindView(R.id.divider_1_post_gallery_activity) + View divider1; + @BindView(R.id.flair_custom_text_view_post_gallery_activity) + CustomTextView flairTextView; + @BindView(R.id.spoiler_custom_text_view_post_gallery_activity) + CustomTextView spoilerTextView; + @BindView(R.id.nsfw_custom_text_view_post_gallery_activity) + CustomTextView nsfwTextView; + @BindView(R.id.divider_2_post_gallery_activity) + View divider2; + @BindView(R.id.receive_post_reply_notifications_linear_layout_post_gallery_activity) + LinearLayout receivePostReplyNotificationsLinearLayout; + @BindView(R.id.receive_post_reply_notifications_text_view_post_gallery_activity) + TextView receivePostReplyNotificationsTextView; + @BindView(R.id.receive_post_reply_notifications_switch_material_post_gallery_activity) + SwitchMaterial receivePostReplyNotificationsSwitchMaterial; + @BindView(R.id.divider_3_post_gallery_activity) + View divider3; + @BindView(R.id.post_title_edit_text_post_gallery_activity) + EditText titleEditText; + @BindView(R.id.divider_4_post_gallery_activity) + View divider4; + @BindView(R.id.images_recycler_view_post_gallery_activity) + RecyclerView imagesRecyclerView; + @Inject + @Named("no_oauth") + Retrofit mRetrofit; + @Inject + @Named("oauth") + Retrofit mOauthRetrofit; + @Inject + @Named("upload_media") + Retrofit mUploadMediaRetrofit; + @Inject + RedditDataRoomDatabase mRedditDataRoomDatabase; + @Inject + @Named("default") + SharedPreferences mSharedPreferences; + @Inject + @Named("current_account") + SharedPreferences mCurrentAccountSharedPreferences; + @Inject + CustomThemeWrapper mCustomThemeWrapper; + @Inject + Executor mExecutor; + private ArrayList<RedditGallerySubmissionRecyclerViewAdapter.RedditGalleryImageInfo> redditGalleryImageInfoList; + private String mAccessToken; + private String mAccountName; + private String iconUrl; + private String subredditName; + private boolean subredditSelected = false; + private boolean subredditIsUser; + private boolean loadSubredditIconSuccessful = true; + private boolean isPosting; + private int primaryTextColor; + private int flairBackgroundColor; + private int flairTextColor; + private int spoilerBackgroundColor; + private int spoilerTextColor; + private int nsfwBackgroundColor; + private int nsfwTextColor; + private Flair flair; + private boolean isSpoiler = false; + private boolean isNSFW = false; + private Resources resources; + private Menu mMemu; + private RequestManager mGlide; + private FlairBottomSheetFragment flairSelectionBottomSheetFragment; + private Snackbar mPostingSnackbar; + private RedditGallerySubmissionRecyclerViewAdapter adapter; + private Uri imageUri; + private boolean isUploading; + + @Override + protected void onCreate(Bundle savedInstanceState) { + ((Infinity) getApplication()).getAppComponent().inject(this); + + setImmersiveModeNotApplicable(); + + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_post_gallery); + + ButterKnife.bind(this); + + EventBus.getDefault().register(this); + + applyCustomTheme(); + + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && isChangeStatusBarIconColor()) { + addOnOffsetChangedListener(appBarLayout); + } + + setSupportActionBar(toolbar); + getSupportActionBar().setDisplayHomeAsUpEnabled(true); + + mGlide = Glide.with(this); + + mPostingSnackbar = Snackbar.make(coordinatorLayout, R.string.posting, Snackbar.LENGTH_INDEFINITE); + + resources = getResources(); + + mAccessToken = mCurrentAccountSharedPreferences.getString(SharedPreferencesUtils.ACCESS_TOKEN, null); + mAccountName = mCurrentAccountSharedPreferences.getString(SharedPreferencesUtils.ACCOUNT_NAME, null); + + adapter = new RedditGallerySubmissionRecyclerViewAdapter(this, mCustomThemeWrapper, new RedditGallerySubmissionRecyclerViewAdapter.ItemClickListener() { + @Override + public void onAddImageClicked() { + if (!isUploading) { + SelectOrCaptureImageBottomSheetFragment fragment = new SelectOrCaptureImageBottomSheetFragment(); + fragment.show(getSupportFragmentManager(), fragment.getTag()); + } else { + Snackbar.make(coordinatorLayout, R.string.please_wait_image_is_uploading, Snackbar.LENGTH_SHORT).show(); + } + } + }); + imagesRecyclerView.setAdapter(adapter); + Resources resources = getResources(); + int nColumns = resources.getBoolean(R.bool.isTablet) || resources.getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE ? 3 : 2; + ((GridLayoutManager) imagesRecyclerView.getLayoutManager()).setSpanCount(nColumns); + imagesRecyclerView.addItemDecoration(new RecyclerView.ItemDecoration() { + @Override + public void getItemOffsets(@NonNull Rect outRect, @NonNull View view, @NonNull RecyclerView parent, @NonNull RecyclerView.State state) { + GridLayoutManager.LayoutParams layoutParams = (GridLayoutManager.LayoutParams) view.getLayoutParams(); + + int spanIndex = layoutParams.getSpanIndex(); + + int offset = (int) (Utils.convertDpToPixel(16, PostGalleryActivity.this)); + int halfOffset = offset / 2; + + if (nColumns == 2) { + if (spanIndex == 0) { + outRect.set(halfOffset, 0, halfOffset, offset); + } else { + outRect.set(halfOffset, 0, halfOffset, offset); + } + } else if (nColumns == 3) { + if (spanIndex == 0) { + outRect.set(halfOffset, 0, halfOffset, offset); + } else if (spanIndex == 1) { + outRect.set(halfOffset, 0, halfOffset, offset); + } else { + outRect.set(halfOffset, 0, halfOffset, offset); + } + } + } + }); + + if (savedInstanceState != null) { + subredditName = savedInstanceState.getString(SUBREDDIT_NAME_STATE); + iconUrl = savedInstanceState.getString(SUBREDDIT_ICON_STATE); + subredditSelected = savedInstanceState.getBoolean(SUBREDDIT_SELECTED_STATE); + subredditIsUser = savedInstanceState.getBoolean(SUBREDDIT_IS_USER_STATE); + loadSubredditIconSuccessful = savedInstanceState.getBoolean(LOAD_SUBREDDIT_ICON_STATE); + isPosting = savedInstanceState.getBoolean(IS_POSTING_STATE); + flair = savedInstanceState.getParcelable(FLAIR_STATE); + isSpoiler = savedInstanceState.getBoolean(IS_SPOILER_STATE); + isNSFW = savedInstanceState.getBoolean(IS_NSFW_STATE); + redditGalleryImageInfoList = savedInstanceState.getParcelableArrayList(REDDIT_GALLERY_IMAGE_INFO_STATE); + if (redditGalleryImageInfoList != null && !redditGalleryImageInfoList.isEmpty()) { + if (redditGalleryImageInfoList.get(redditGalleryImageInfoList.size() - 1).payload == null) { + imageUri = Uri.parse(redditGalleryImageInfoList.get(redditGalleryImageInfoList.size() - 1).imageUrlString); + uploadImage(); + } + } + adapter.setRedditGalleryImageInfoList(redditGalleryImageInfoList); + + if (subredditName != null) { + subredditNameTextView.setTextColor(primaryTextColor); + subredditNameTextView.setText(subredditName); + flairTextView.setVisibility(View.VISIBLE); + if (!loadSubredditIconSuccessful) { + loadSubredditIcon(); + } + } + displaySubredditIcon(); + + if (isPosting) { + mPostingSnackbar.show(); + } + + if (flair != null) { + flairTextView.setText(flair.getText()); + flairTextView.setBackgroundColor(flairBackgroundColor); + flairTextView.setBorderColor(flairBackgroundColor); + flairTextView.setTextColor(flairTextColor); + } + if (isSpoiler) { + spoilerTextView.setBackgroundColor(spoilerBackgroundColor); + spoilerTextView.setBorderColor(spoilerBackgroundColor); + spoilerTextView.setTextColor(spoilerTextColor); + } + if (isNSFW) { + nsfwTextView.setBackgroundColor(nsfwBackgroundColor); + nsfwTextView.setBorderColor(nsfwBackgroundColor); + nsfwTextView.setTextColor(nsfwTextColor); + } + } else { + isPosting = false; + + if (getIntent().hasExtra(EXTRA_SUBREDDIT_NAME)) { + loadSubredditIconSuccessful = false; + subredditName = getIntent().getStringExtra(EXTRA_SUBREDDIT_NAME); + subredditSelected = true; + subredditNameTextView.setTextColor(primaryTextColor); + subredditNameTextView.setText(subredditName); + flairTextView.setVisibility(View.VISIBLE); + loadSubredditIcon(); + } else { + mGlide.load(R.drawable.subreddit_default_icon) + .apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(72, 0))) + .into(iconGifImageView); + } + } + + iconGifImageView.setOnClickListener(view -> { + Intent intent = new Intent(this, SubredditSelectionActivity.class); + startActivityForResult(intent, SUBREDDIT_SELECTION_REQUEST_CODE); + }); + + subredditNameTextView.setOnClickListener(view -> { + Intent intent = new Intent(this, SubredditSelectionActivity.class); + startActivityForResult(intent, SUBREDDIT_SELECTION_REQUEST_CODE); + }); + + rulesButton.setOnClickListener(view -> { + if (subredditName == null) { + Snackbar.make(coordinatorLayout, R.string.select_a_subreddit, Snackbar.LENGTH_SHORT).show(); + } else { + Intent intent = new Intent(this, RulesActivity.class); + if (subredditIsUser) { + intent.putExtra(RulesActivity.EXTRA_SUBREDDIT_NAME, "u_" + subredditName); + } else { + intent.putExtra(RulesActivity.EXTRA_SUBREDDIT_NAME, subredditName); + } + startActivity(intent); + } + }); + + flairTextView.setOnClickListener(view -> { + if (flair == null) { + flairSelectionBottomSheetFragment = new FlairBottomSheetFragment(); + Bundle bundle = new Bundle(); + bundle.putString(FlairBottomSheetFragment.EXTRA_ACCESS_TOKEN, mAccessToken); + bundle.putString(FlairBottomSheetFragment.EXTRA_SUBREDDIT_NAME, subredditName); + flairSelectionBottomSheetFragment.setArguments(bundle); + flairSelectionBottomSheetFragment.show(getSupportFragmentManager(), flairSelectionBottomSheetFragment.getTag()); + } else { + flairTextView.setBackgroundColor(resources.getColor(android.R.color.transparent)); + flairTextView.setTextColor(primaryTextColor); + flairTextView.setText(getString(R.string.flair)); + flair = null; + } + }); + + spoilerTextView.setOnClickListener(view -> { + if (!isSpoiler) { + spoilerTextView.setBackgroundColor(spoilerBackgroundColor); + spoilerTextView.setBorderColor(spoilerBackgroundColor); + spoilerTextView.setTextColor(spoilerTextColor); + isSpoiler = true; + } else { + spoilerTextView.setBackgroundColor(resources.getColor(android.R.color.transparent)); + spoilerTextView.setTextColor(primaryTextColor); + isSpoiler = false; + } + }); + + nsfwTextView.setOnClickListener(view -> { + if (!isNSFW) { + nsfwTextView.setBackgroundColor(nsfwBackgroundColor); + nsfwTextView.setBorderColor(nsfwBackgroundColor); + nsfwTextView.setTextColor(nsfwTextColor); + isNSFW = true; + } else { + nsfwTextView.setBackgroundColor(resources.getColor(android.R.color.transparent)); + nsfwTextView.setTextColor(primaryTextColor); + isNSFW = false; + } + }); + + receivePostReplyNotificationsLinearLayout.setOnClickListener(view -> { + receivePostReplyNotificationsSwitchMaterial.performClick(); + }); + } + + @Override + protected SharedPreferences getDefaultSharedPreferences() { + return mSharedPreferences; + } + + @Override + protected CustomThemeWrapper getCustomThemeWrapper() { + return mCustomThemeWrapper; + } + + @Override + protected void applyCustomTheme() { + coordinatorLayout.setBackgroundColor(mCustomThemeWrapper.getBackgroundColor()); + applyAppBarLayoutAndToolbarTheme(appBarLayout, toolbar); + int secondaryTextColor = mCustomThemeWrapper.getSecondaryTextColor(); + subredditNameTextView.setTextColor(secondaryTextColor); + rulesButton.setTextColor(mCustomThemeWrapper.getButtonTextColor()); + rulesButton.setBackgroundColor(mCustomThemeWrapper.getColorPrimaryLightTheme()); + primaryTextColor = mCustomThemeWrapper.getPrimaryTextColor(); + receivePostReplyNotificationsTextView.setTextColor(primaryTextColor); + int dividerColor = mCustomThemeWrapper.getDividerColor(); + divider1.setBackgroundColor(dividerColor); + divider2.setBackgroundColor(dividerColor); + divider3.setBackgroundColor(dividerColor); + divider4.setBackgroundColor(dividerColor); + flairBackgroundColor = mCustomThemeWrapper.getFlairBackgroundColor(); + flairTextColor = mCustomThemeWrapper.getFlairTextColor(); + spoilerBackgroundColor = mCustomThemeWrapper.getSpoilerBackgroundColor(); + spoilerTextColor = mCustomThemeWrapper.getSpoilerTextColor(); + nsfwBackgroundColor = mCustomThemeWrapper.getNsfwBackgroundColor(); + nsfwTextColor = mCustomThemeWrapper.getNsfwTextColor(); + flairTextView.setTextColor(primaryTextColor); + spoilerTextView.setTextColor(primaryTextColor); + nsfwTextView.setTextColor(primaryTextColor); + titleEditText.setTextColor(primaryTextColor); + titleEditText.setHintTextColor(secondaryTextColor); + } + + public void selectImage() { + Intent intent = new Intent(); + intent.setType("image/*"); + intent.setAction(Intent.ACTION_GET_CONTENT); + startActivityForResult(Intent.createChooser(intent, resources.getString(R.string.select_from_gallery)), PICK_IMAGE_REQUEST_CODE); + } + + public void captureImage() { + Intent pictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); + try { + imageUri = FileProvider.getUriForFile(this, "ml.docilealligator.infinityforreddit.provider", + File.createTempFile("temp_img", ".jpg", getExternalFilesDir(Environment.DIRECTORY_PICTURES))); + pictureIntent.putExtra(MediaStore.EXTRA_OUTPUT, imageUri); + startActivityForResult(pictureIntent, CAPTURE_IMAGE_REQUEST_CODE); + } catch (IOException ex) { + Snackbar.make(coordinatorLayout, R.string.error_creating_temp_file, Snackbar.LENGTH_SHORT).show(); + } catch (ActivityNotFoundException e) { + Snackbar.make(coordinatorLayout, R.string.no_camera_available, Snackbar.LENGTH_SHORT).show(); + } + } + + private void uploadImage() { + Handler handler = new Handler(); + isUploading = true; + mExecutor.execute(() -> { + try { + Bitmap resource = Glide.with(PostGalleryActivity.this).asBitmap().load(imageUri).submit().get(); + String response = UploadImageUtils.uploadImage(mOauthRetrofit, mUploadMediaRetrofit, mAccessToken, resource, true); + String mediaId = new JSONObject(response).getJSONObject(JSONUtils.ASSET_KEY).getString(JSONUtils.ASSET_ID_KEY); + handler.post(() -> { + adapter.setImageAsUploaded(mediaId); + isUploading = false; + }); + } catch (ExecutionException | InterruptedException e) { + e.printStackTrace(); + handler.post(() -> { + adapter.removeFailedToUploadImage(); + Snackbar.make(coordinatorLayout, R.string.get_image_bitmap_failed, Snackbar.LENGTH_LONG).show(); + isUploading = false; + }); + } catch (XmlPullParserException | JSONException | IOException e) { + e.printStackTrace(); + handler.post(() -> { + adapter.removeFailedToUploadImage(); + Snackbar.make(coordinatorLayout, R.string.upload_image_failed, Snackbar.LENGTH_LONG).show(); + isUploading = false; + }); + } + }); + } + + private void displaySubredditIcon() { + if (iconUrl != null && !iconUrl.equals("")) { + mGlide.load(iconUrl) + .apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(72, 0))) + .error(mGlide.load(R.drawable.subreddit_default_icon) + .apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(72, 0)))) + .into(iconGifImageView); + } else { + mGlide.load(R.drawable.subreddit_default_icon) + .apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(72, 0))) + .into(iconGifImageView); + } + } + + private void loadSubredditIcon() { + LoadSubredditIcon.loadSubredditIcon(mExecutor, new Handler(), mRedditDataRoomDatabase, subredditName, mRetrofit, iconImageUrl -> { + iconUrl = iconImageUrl; + displaySubredditIcon(); + loadSubredditIconSuccessful = true; + }); + } + + private void promptAlertDialog(int titleResId, int messageResId) { + new MaterialAlertDialogBuilder(this, R.style.MaterialAlertDialogTheme) + .setTitle(titleResId) + .setMessage(messageResId) + .setPositiveButton(R.string.discard_dialog_button, (dialogInterface, i) + -> finish()) + .setNegativeButton(R.string.no, null) + .show(); + } + + @Override + public boolean onCreateOptionsMenu(Menu menu) { + getMenuInflater().inflate(R.menu.post_gallery_activity, menu); + applyMenuItemTheme(menu); + mMemu = menu; + if (isPosting) { + mMemu.findItem(R.id.action_send_post_gallery_activity).setEnabled(false); + mMemu.findItem(R.id.action_send_post_gallery_activity).getIcon().setAlpha(130); + } + return true; + } + + @Override + public boolean onOptionsItemSelected(@NonNull MenuItem item) { + int itemId = item.getItemId(); + if (itemId == android.R.id.home) { + if (isPosting) { + promptAlertDialog(R.string.exit_when_submit, R.string.exit_when_submit_post_detail); + return true; + } else { + if (!titleEditText.getText().toString().equals("") || redditGalleryImageInfoList != null) { + promptAlertDialog(R.string.discard, R.string.discard_detail); + return true; + } + } + finish(); + return true; + } else if (itemId == R.id.action_send_post_gallery_activity) { + if (!subredditSelected) { + Snackbar.make(coordinatorLayout, R.string.select_a_subreddit, Snackbar.LENGTH_SHORT).show(); + return true; + } + + if (titleEditText.getText() == null || titleEditText.getText().toString().equals("")) { + Snackbar.make(coordinatorLayout, R.string.title_required, Snackbar.LENGTH_SHORT).show(); + return true; + } + + if (redditGalleryImageInfoList == null || redditGalleryImageInfoList.isEmpty()) { + Snackbar.make(coordinatorLayout, R.string.select_an_image, Snackbar.LENGTH_SHORT).show(); + return true; + } + + if (redditGalleryImageInfoList.get(redditGalleryImageInfoList.size() - 1).payload == null) { + Snackbar.make(coordinatorLayout, R.string.please_wait_image_is_uploading, Snackbar.LENGTH_LONG).show(); + return true; + } + + isPosting = true; + + item.setEnabled(false); + item.getIcon().setAlpha(130); + + mPostingSnackbar.show(); + + String subredditName; + if (subredditIsUser) { + subredditName = "u_" + subredditNameTextView.getText().toString(); + } else { + subredditName = subredditNameTextView.getText().toString(); + } + + Intent intent = new Intent(this, SubmitPostService.class); + intent.putExtra(SubmitPostService.EXTRA_ACCESS_TOKEN, mAccessToken); + intent.putExtra(SubmitPostService.EXTRA_SUBREDDIT_NAME, subredditName); + intent.putExtra(SubmitPostService.EXTRA_POST_TYPE, SubmitPostService.EXTRA_POST_TYPE_GALLERY); + ArrayList<RedditGalleryPayload.Item> items = new ArrayList<>(); + for (RedditGallerySubmissionRecyclerViewAdapter.RedditGalleryImageInfo i : redditGalleryImageInfoList) { + items.add(i.payload); + } + RedditGalleryPayload payload = new RedditGalleryPayload(subredditName, subredditIsUser ? "profile" : "subreddit", + titleEditText.getText().toString(), isSpoiler, isNSFW, receivePostReplyNotificationsSwitchMaterial.isChecked(), + flair, items); + intent.putExtra(SubmitPostService.EXTRA_REDDIT_GALLERY_PAYLOAD, new Gson().toJson(payload)); + + ContextCompat.startForegroundService(this, intent); + + return true; + } + + return false; + } + + @Override + public void onBackPressed() { + if (isPosting) { + promptAlertDialog(R.string.exit_when_submit, R.string.exit_when_submit_post_detail); + } else { + if (!titleEditText.getText().toString().equals("") || redditGalleryImageInfoList != null) { + promptAlertDialog(R.string.discard, R.string.discard_detail); + } else { + finish(); + } + } + } + + @Override + protected void onSaveInstanceState(@NonNull Bundle outState) { + super.onSaveInstanceState(outState); + outState.putString(SUBREDDIT_NAME_STATE, subredditName); + outState.putString(SUBREDDIT_ICON_STATE, iconUrl); + outState.putBoolean(SUBREDDIT_SELECTED_STATE, subredditSelected); + outState.putBoolean(SUBREDDIT_IS_USER_STATE, subredditIsUser); + outState.putBoolean(LOAD_SUBREDDIT_ICON_STATE, loadSubredditIconSuccessful); + outState.putBoolean(IS_POSTING_STATE, isPosting); + outState.putParcelable(FLAIR_STATE, flair); + outState.putBoolean(IS_SPOILER_STATE, isSpoiler); + outState.putBoolean(IS_NSFW_STATE, isNSFW); + redditGalleryImageInfoList = adapter.getRedditGalleryImageInfoList(); + outState.putParcelableArrayList(REDDIT_GALLERY_IMAGE_INFO_STATE, redditGalleryImageInfoList); + } + + @Override + protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) { + super.onActivityResult(requestCode, resultCode, data); + if (requestCode == SUBREDDIT_SELECTION_REQUEST_CODE) { + if (resultCode == RESULT_OK) { + subredditName = data.getExtras().getString(SubredditSelectionActivity.EXTRA_RETURN_SUBREDDIT_NAME); + iconUrl = data.getExtras().getString(SubredditSelectionActivity.EXTRA_RETURN_SUBREDDIT_ICON_URL); + subredditSelected = true; + subredditIsUser = data.getExtras().getBoolean(SubredditSelectionActivity.EXTRA_RETURN_SUBREDDIT_IS_USER); + + subredditNameTextView.setTextColor(primaryTextColor); + subredditNameTextView.setText(subredditName); + displaySubredditIcon(); + + flairTextView.setVisibility(View.VISIBLE); + flairTextView.setBackgroundColor(resources.getColor(android.R.color.transparent)); + flairTextView.setTextColor(primaryTextColor); + flairTextView.setText(getString(R.string.flair)); + flair = null; + } + } else if (requestCode == PICK_IMAGE_REQUEST_CODE) { + if (resultCode == RESULT_OK) { + if (data == null) { + Snackbar.make(coordinatorLayout, R.string.error_getting_image, Snackbar.LENGTH_SHORT).show(); + return; + } + + imageUri = data.getData(); + adapter.addImage(imageUri.toString()); + uploadImage(); + } + } else if (requestCode == CAPTURE_IMAGE_REQUEST_CODE) { + if (resultCode == RESULT_OK) { + adapter.addImage(imageUri.toString()); + uploadImage(); + } + } + } + + @Override + protected void onDestroy() { + EventBus.getDefault().unregister(this); + super.onDestroy(); + } + + @Override + public void flairSelected(Flair flair) { + this.flair = flair; + flairTextView.setText(flair.getText()); + flairTextView.setBackgroundColor(flairBackgroundColor); + flairTextView.setBorderColor(flairBackgroundColor); + flairTextView.setTextColor(flairTextColor); + } + + @Subscribe + public void onAccountSwitchEvent(SwitchAccountEvent event) { + finish(); + } + + @Subscribe + public void onSubmitGalleryPostEvent(SubmitGalleryPostEvent submitGalleryPostEvent) { + isPosting = false; + mPostingSnackbar.dismiss(); + if (submitGalleryPostEvent.postSuccess) { + Intent intent = new Intent(this, LinkResolverActivity.class); + intent.setData(Uri.parse(submitGalleryPostEvent.postUrl)); + startActivity(intent); + finish(); + } else { + mMemu.findItem(R.id.action_send_post_gallery_activity).setEnabled(true); + mMemu.findItem(R.id.action_send_post_gallery_activity).getIcon().setAlpha(255); + if (submitGalleryPostEvent.errorMessage == null || submitGalleryPostEvent.errorMessage.equals("")) { + Snackbar.make(coordinatorLayout, R.string.post_failed, Snackbar.LENGTH_SHORT).show(); + } else { + Snackbar.make(coordinatorLayout, submitGalleryPostEvent.errorMessage.substring(0, 1).toUpperCase() + + submitGalleryPostEvent.errorMessage.substring(1), Snackbar.LENGTH_SHORT).show(); + } + } + } +}
\ No newline at end of file diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostImageActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostImageActivity.java index cbab1914..acf5034d 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostImageActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostImageActivity.java @@ -1,8 +1,8 @@ package ml.docilealligator.infinityforreddit.activities; +import android.content.ActivityNotFoundException; import android.content.Intent; import android.content.SharedPreferences; -import android.content.res.ColorStateList; import android.content.res.Resources; import android.net.Uri; import android.os.Build; @@ -13,9 +13,9 @@ import android.provider.MediaStore; import android.view.Menu; import android.view.MenuItem; import android.view.View; -import android.widget.Button; import android.widget.EditText; import android.widget.ImageView; +import android.widget.LinearLayout; import android.widget.TextView; import androidx.annotation.NonNull; @@ -30,9 +30,11 @@ import com.bumptech.glide.Glide; import com.bumptech.glide.RequestManager; import com.bumptech.glide.request.RequestOptions; import com.google.android.material.appbar.AppBarLayout; +import com.google.android.material.button.MaterialButton; import com.google.android.material.dialog.MaterialAlertDialogBuilder; import com.google.android.material.floatingactionbutton.FloatingActionButton; import com.google.android.material.snackbar.Snackbar; +import com.google.android.material.switchmaterial.SwitchMaterial; import com.libRG.CustomTextView; import org.greenrobot.eventbus.EventBus; @@ -93,7 +95,7 @@ public class PostImageActivity extends BaseActivity implements FlairBottomSheetF @BindView(R.id.subreddit_name_text_view_post_image_activity) TextView subredditNameTextView; @BindView(R.id.rules_button_post_image_activity) - Button rulesButton; + MaterialButton rulesButton; @BindView(R.id.divider_1_post_image_activity) View divider1; @BindView(R.id.flair_custom_text_view_post_image_activity) @@ -104,10 +106,18 @@ public class PostImageActivity extends BaseActivity implements FlairBottomSheetF CustomTextView nsfwTextView; @BindView(R.id.divider_2_post_image_activity) View divider2; - @BindView(R.id.post_title_edit_text_post_image_activity) - EditText titleEditText; + @BindView(R.id.receive_post_reply_notifications_linear_layout_post_image_activity) + LinearLayout receivePostReplyNotificationsLinearLayout; + @BindView(R.id.receive_post_reply_notifications_text_view_post_image_activity) + TextView receivePostReplyNotificationsTextView; + @BindView(R.id.receive_post_reply_notifications_switch_material_post_image_activity) + SwitchMaterial receivePostReplyNotificationsSwitchMaterial; @BindView(R.id.divider_3_post_image_activity) View divider3; + @BindView(R.id.post_title_edit_text_post_image_activity) + EditText titleEditText; + @BindView(R.id.divider_4_post_image_activity) + View divider4; @BindView(R.id.select_image_constraint_layout_post_image_activity) ConstraintLayout constraintLayout; @BindView(R.id.capture_fab_post_image_activity) @@ -331,18 +341,20 @@ public class PostImageActivity extends BaseActivity implements FlairBottomSheetF } }); + receivePostReplyNotificationsLinearLayout.setOnClickListener(view -> { + receivePostReplyNotificationsSwitchMaterial.performClick(); + }); + captureFab.setOnClickListener(view -> { Intent pictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); - if (pictureIntent.resolveActivity(getPackageManager()) != null) { - try { - imageUri = FileProvider.getUriForFile(this, "ml.docilealligator.infinityforreddit.provider", - File.createTempFile("temp_img", ".jpg", getExternalFilesDir(Environment.DIRECTORY_PICTURES))); - pictureIntent.putExtra(MediaStore.EXTRA_OUTPUT, imageUri); - startActivityForResult(pictureIntent, CAPTURE_IMAGE_REQUEST_CODE); - } catch (IOException ex) { - Snackbar.make(coordinatorLayout, R.string.error_creating_temp_file, Snackbar.LENGTH_SHORT).show(); - } - } else { + try { + imageUri = FileProvider.getUriForFile(this, "ml.docilealligator.infinityforreddit.provider", + File.createTempFile("temp_img", ".jpg", getExternalFilesDir(Environment.DIRECTORY_PICTURES))); + pictureIntent.putExtra(MediaStore.EXTRA_OUTPUT, imageUri); + startActivityForResult(pictureIntent, CAPTURE_IMAGE_REQUEST_CODE); + } catch (IOException ex) { + Snackbar.make(coordinatorLayout, R.string.error_creating_temp_file, Snackbar.LENGTH_SHORT).show(); + } catch (ActivityNotFoundException e) { Snackbar.make(coordinatorLayout, R.string.no_camera_available, Snackbar.LENGTH_SHORT).show(); } }); @@ -380,12 +392,14 @@ public class PostImageActivity extends BaseActivity implements FlairBottomSheetF int secondaryTextColor = mCustomThemeWrapper.getSecondaryTextColor(); subredditNameTextView.setTextColor(secondaryTextColor); rulesButton.setTextColor(mCustomThemeWrapper.getButtonTextColor()); - rulesButton.setBackgroundTintList(ColorStateList.valueOf(mCustomThemeWrapper.getColorPrimaryLightTheme())); + rulesButton.setBackgroundColor(mCustomThemeWrapper.getColorPrimaryLightTheme()); + primaryTextColor = mCustomThemeWrapper.getPrimaryTextColor(); + receivePostReplyNotificationsTextView.setTextColor(primaryTextColor); int dividerColor = mCustomThemeWrapper.getDividerColor(); divider1.setBackgroundColor(dividerColor); divider2.setBackgroundColor(dividerColor); divider3.setBackgroundColor(dividerColor); - primaryTextColor = mCustomThemeWrapper.getPrimaryTextColor(); + divider4.setBackgroundColor(dividerColor); flairBackgroundColor = mCustomThemeWrapper.getFlairBackgroundColor(); flairTextColor = mCustomThemeWrapper.getFlairTextColor(); spoilerBackgroundColor = mCustomThemeWrapper.getSpoilerBackgroundColor(); @@ -435,7 +449,7 @@ public class PostImageActivity extends BaseActivity implements FlairBottomSheetF new MaterialAlertDialogBuilder(this, R.style.MaterialAlertDialogTheme) .setTitle(titleResId) .setMessage(messageResId) - .setPositiveButton(R.string.yes, (dialogInterface, i) + .setPositiveButton(R.string.discard_dialog_button, (dialogInterface, i) -> finish()) .setNegativeButton(R.string.no, null) .show(); @@ -455,68 +469,69 @@ public class PostImageActivity extends BaseActivity implements FlairBottomSheetF @Override public boolean onOptionsItemSelected(@NonNull MenuItem item) { - switch (item.getItemId()) { - case android.R.id.home: - if (isPosting) { - promptAlertDialog(R.string.exit_when_submit, R.string.exit_when_submit_post_detail); - return true; - } else { - if (!titleEditText.getText().toString().equals("") || imageUri != null) { - promptAlertDialog(R.string.discard, R.string.discard_detail); - return true; - } - } - finish(); + int itemId = item.getItemId(); + if (itemId == android.R.id.home) { + if (isPosting) { + promptAlertDialog(R.string.exit_when_submit, R.string.exit_when_submit_post_detail); return true; - case R.id.action_send_post_image_activity: - if (!subredditSelected) { - Snackbar.make(coordinatorLayout, R.string.select_a_subreddit, Snackbar.LENGTH_SHORT).show(); + } else { + if (!titleEditText.getText().toString().equals("") || imageUri != null) { + promptAlertDialog(R.string.discard, R.string.discard_detail); return true; } + } + finish(); + return true; + } else if (itemId == R.id.action_send_post_image_activity) { + if (!subredditSelected) { + Snackbar.make(coordinatorLayout, R.string.select_a_subreddit, Snackbar.LENGTH_SHORT).show(); + return true; + } - if (titleEditText.getText() == null || titleEditText.getText().toString().equals("")) { - Snackbar.make(coordinatorLayout, R.string.title_required, Snackbar.LENGTH_SHORT).show(); - return true; - } + if (titleEditText.getText() == null || titleEditText.getText().toString().equals("")) { + Snackbar.make(coordinatorLayout, R.string.title_required, Snackbar.LENGTH_SHORT).show(); + return true; + } - if (imageUri == null) { - Snackbar.make(coordinatorLayout, R.string.select_an_image, Snackbar.LENGTH_SHORT).show(); - return true; - } + if (imageUri == null) { + Snackbar.make(coordinatorLayout, R.string.select_an_image, Snackbar.LENGTH_SHORT).show(); + return true; + } - isPosting = true; + isPosting = true; - item.setEnabled(false); - item.getIcon().setAlpha(130); + item.setEnabled(false); + item.getIcon().setAlpha(130); - mPostingSnackbar.show(); + mPostingSnackbar.show(); - String subredditName; - if (subredditIsUser) { - subredditName = "u_" + subredditNameTextView.getText().toString(); - } else { - subredditName = subredditNameTextView.getText().toString(); - } + String subredditName; + if (subredditIsUser) { + subredditName = "u_" + subredditNameTextView.getText().toString(); + } else { + subredditName = subredditNameTextView.getText().toString(); + } - Intent intent = new Intent(this, SubmitPostService.class); - intent.setData(imageUri); - intent.putExtra(SubmitPostService.EXTRA_ACCESS_TOKEN, mAccessToken); - intent.putExtra(SubmitPostService.EXTRA_SUBREDDIT_NAME, subredditName); - intent.putExtra(SubmitPostService.EXTRA_TITLE, titleEditText.getText().toString()); - intent.putExtra(SubmitPostService.EXTRA_FLAIR, flair); - intent.putExtra(SubmitPostService.EXTRA_IS_SPOILER, isSpoiler); - intent.putExtra(SubmitPostService.EXTRA_IS_NSFW, isNSFW); - String mimeType = getContentResolver().getType(imageUri); - if (mimeType != null && mimeType.contains("gif")) { - intent.putExtra(SubmitPostService.EXTRA_POST_TYPE, SubmitPostService.EXTRA_POST_TYPE_VIDEO); - } else { - intent.putExtra(SubmitPostService.EXTRA_POST_TYPE, SubmitPostService.EXTRA_POST_TYPE_IMAGE); - } - intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); + Intent intent = new Intent(this, SubmitPostService.class); + intent.setData(imageUri); + intent.putExtra(SubmitPostService.EXTRA_ACCESS_TOKEN, mAccessToken); + intent.putExtra(SubmitPostService.EXTRA_SUBREDDIT_NAME, subredditName); + intent.putExtra(SubmitPostService.EXTRA_TITLE, titleEditText.getText().toString()); + intent.putExtra(SubmitPostService.EXTRA_FLAIR, flair); + intent.putExtra(SubmitPostService.EXTRA_IS_SPOILER, isSpoiler); + intent.putExtra(SubmitPostService.EXTRA_IS_NSFW, isNSFW); + intent.putExtra(SubmitPostService.EXTRA_RECEIVE_POST_REPLY_NOTIFICATIONS, receivePostReplyNotificationsSwitchMaterial.isChecked()); + String mimeType = getContentResolver().getType(imageUri); + if (mimeType != null && mimeType.contains("gif")) { + intent.putExtra(SubmitPostService.EXTRA_POST_TYPE, SubmitPostService.EXTRA_POST_TYPE_VIDEO); + } else { + intent.putExtra(SubmitPostService.EXTRA_POST_TYPE, SubmitPostService.EXTRA_POST_TYPE_IMAGE); + } + intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); - ContextCompat.startForegroundService(this, intent); + ContextCompat.startForegroundService(this, intent); - return true; + return true; } return false; @@ -631,7 +646,7 @@ public class PostImageActivity extends BaseActivity implements FlairBottomSheetF } @Subscribe - public void onSubmitVideoOrGifPostEvent(SubmitVideoOrGifPostEvent submitVideoOrGifPostEvent) { + public void onSubmitGifPostEvent(SubmitVideoOrGifPostEvent submitVideoOrGifPostEvent) { isPosting = false; mPostingSnackbar.dismiss(); mMemu.findItem(R.id.action_send_post_image_activity).setEnabled(true); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostLinkActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostLinkActivity.java index ab1852bc..8ce97d55 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostLinkActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostLinkActivity.java @@ -2,7 +2,6 @@ package ml.docilealligator.infinityforreddit.activities; import android.content.Intent; import android.content.SharedPreferences; -import android.content.res.ColorStateList; import android.content.res.Resources; import android.os.Build; import android.os.Bundle; @@ -10,8 +9,8 @@ import android.os.Handler; import android.view.Menu; import android.view.MenuItem; import android.view.View; -import android.widget.Button; import android.widget.EditText; +import android.widget.LinearLayout; import android.widget.TextView; import android.widget.Toast; @@ -28,6 +27,7 @@ import com.google.android.material.appbar.AppBarLayout; import com.google.android.material.button.MaterialButton; import com.google.android.material.dialog.MaterialAlertDialogBuilder; import com.google.android.material.snackbar.Snackbar; +import com.google.android.material.switchmaterial.SwitchMaterial; import com.libRG.CustomTextView; import org.greenrobot.eventbus.EventBus; @@ -89,19 +89,27 @@ public class PostLinkActivity extends BaseActivity implements FlairBottomSheetFr @BindView(R.id.subreddit_name_text_view_post_link_activity) TextView subredditNameTextView; @BindView(R.id.rules_button_post_link_activity) - Button rulesButton; + MaterialButton rulesButton; @BindView(R.id.divider_1_post_link_activity) View divider1; @BindView(R.id.divider_2_post_link_activity) View divider2; - @BindView(R.id.divider_3_post_link_activity) - View divider3; + @BindView(R.id.divider_4_post_link_activity) + View divider4; @BindView(R.id.flair_custom_text_view_post_link_activity) CustomTextView flairTextView; @BindView(R.id.spoiler_custom_text_view_post_link_activity) CustomTextView spoilerTextView; @BindView(R.id.nsfw_custom_text_view_post_link_activity) CustomTextView nsfwTextView; + @BindView(R.id.receive_post_reply_notifications_linear_layout_post_link_activity) + LinearLayout receivePostReplyNotificationsLinearLayout; + @BindView(R.id.receive_post_reply_notifications_text_view_post_link_activity) + TextView receivePostReplyNotificationsTextView; + @BindView(R.id.receive_post_reply_notifications_switch_material_post_link_activity) + SwitchMaterial receivePostReplyNotificationsSwitchMaterial; + @BindView(R.id.divider_3_post_link_activity) + View divider3; @BindView(R.id.post_title_edit_text_post_link_activity) EditText titleEditText; @BindView(R.id.suggest_title_button_post_link_activity) @@ -310,6 +318,10 @@ public class PostLinkActivity extends BaseActivity implements FlairBottomSheetFr } }); + receivePostReplyNotificationsLinearLayout.setOnClickListener(view -> { + receivePostReplyNotificationsSwitchMaterial.performClick(); + }); + suggestTitleButton.setOnClickListener(view -> { Toast.makeText(this, R.string.please_wait, Toast.LENGTH_SHORT).show(); String url = linkEditText.getText().toString().trim(); @@ -354,12 +366,14 @@ public class PostLinkActivity extends BaseActivity implements FlairBottomSheetFr int secondaryTextColor = mCustomThemeWrapper.getSecondaryTextColor(); subredditNameTextView.setTextColor(secondaryTextColor); rulesButton.setTextColor(mCustomThemeWrapper.getButtonTextColor()); - rulesButton.setBackgroundTintList(ColorStateList.valueOf(mCustomThemeWrapper.getColorPrimaryLightTheme())); + rulesButton.setBackgroundColor(mCustomThemeWrapper.getColorPrimaryLightTheme()); + primaryTextColor = mCustomThemeWrapper.getPrimaryTextColor(); + receivePostReplyNotificationsTextView.setTextColor(primaryTextColor); int dividerColor = mCustomThemeWrapper.getDividerColor(); divider1.setBackgroundColor(dividerColor); divider2.setBackgroundColor(dividerColor); divider3.setBackgroundColor(dividerColor); - primaryTextColor = mCustomThemeWrapper.getPrimaryTextColor(); + divider4.setBackgroundColor(dividerColor); flairBackgroundColor = mCustomThemeWrapper.getFlairBackgroundColor(); flairTextColor = mCustomThemeWrapper.getFlairTextColor(); spoilerBackgroundColor = mCustomThemeWrapper.getSpoilerBackgroundColor(); @@ -404,7 +418,7 @@ public class PostLinkActivity extends BaseActivity implements FlairBottomSheetFr new MaterialAlertDialogBuilder(this, R.style.MaterialAlertDialogTheme) .setTitle(titleResId) .setMessage(messageResId) - .setPositiveButton(R.string.yes, (dialogInterface, i) -> finish()) + .setPositiveButton(R.string.discard_dialog_button, (dialogInterface, i) -> finish()) .setNegativeButton(R.string.no, null) .show(); } @@ -475,6 +489,7 @@ public class PostLinkActivity extends BaseActivity implements FlairBottomSheetFr intent.putExtra(SubmitPostService.EXTRA_FLAIR, flair); intent.putExtra(SubmitPostService.EXTRA_IS_SPOILER, isSpoiler); intent.putExtra(SubmitPostService.EXTRA_IS_NSFW, isNSFW); + intent.putExtra(SubmitPostService.EXTRA_RECEIVE_POST_REPLY_NOTIFICATIONS, receivePostReplyNotificationsSwitchMaterial.isChecked()); intent.putExtra(SubmitPostService.EXTRA_POST_TYPE, SubmitPostService.EXTRA_POST_TEXT_OR_LINK); ContextCompat.startForegroundService(this, intent); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostTextActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostTextActivity.java index f1cd11cc..a03f7355 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostTextActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostTextActivity.java @@ -3,7 +3,6 @@ package ml.docilealligator.infinityforreddit.activities; import android.content.ActivityNotFoundException; import android.content.Intent; import android.content.SharedPreferences; -import android.content.res.ColorStateList; import android.content.res.Resources; import android.net.Uri; import android.os.Build; @@ -14,8 +13,8 @@ import android.provider.MediaStore; import android.view.Menu; import android.view.MenuItem; import android.view.View; -import android.widget.Button; import android.widget.EditText; +import android.widget.LinearLayout; import android.widget.TextView; import android.widget.Toast; @@ -32,8 +31,10 @@ import com.bumptech.glide.Glide; import com.bumptech.glide.RequestManager; import com.bumptech.glide.request.RequestOptions; import com.google.android.material.appbar.AppBarLayout; +import com.google.android.material.button.MaterialButton; import com.google.android.material.dialog.MaterialAlertDialogBuilder; import com.google.android.material.snackbar.Snackbar; +import com.google.android.material.switchmaterial.SwitchMaterial; import com.libRG.CustomTextView; import org.greenrobot.eventbus.EventBus; @@ -61,6 +62,7 @@ import ml.docilealligator.infinityforreddit.asynctasks.LoadSubredditIcon; import ml.docilealligator.infinityforreddit.bottomsheetfragments.FlairBottomSheetFragment; import ml.docilealligator.infinityforreddit.bottomsheetfragments.UploadedImagesBottomSheetFragment; import ml.docilealligator.infinityforreddit.customtheme.CustomThemeWrapper; +import ml.docilealligator.infinityforreddit.customviews.LinearLayoutManagerBugFixed; import ml.docilealligator.infinityforreddit.events.SubmitTextOrLinkPostEvent; import ml.docilealligator.infinityforreddit.events.SwitchAccountEvent; import ml.docilealligator.infinityforreddit.services.SubmitPostService; @@ -90,6 +92,7 @@ public class PostTextActivity extends BaseActivity implements FlairBottomSheetFr private static final int SUBREDDIT_SELECTION_REQUEST_CODE = 0; private static final int PICK_IMAGE_REQUEST_CODE = 100; private static final int CAPTURE_IMAGE_REQUEST_CODE = 200; + private static final int MARKDOWN_PREVIEW_REQUEST_CODE = 300; @BindView(R.id.coordinator_layout_post_text_activity) CoordinatorLayout coordinatorLayout; @@ -97,12 +100,12 @@ public class PostTextActivity extends BaseActivity implements FlairBottomSheetFr AppBarLayout appBarLayout; @BindView(R.id.toolbar_post_text_activity) Toolbar toolbar; - @BindView(R.id.subreddit_icon_gif_image_view_search_activity) + @BindView(R.id.subreddit_icon_gif_image_view_post_text_activity) GifImageView iconGifImageView; - @BindView(R.id.subreddit_name_text_view_search_activity) + @BindView(R.id.subreddit_name_text_view_post_text_activity) TextView subredditNameTextView; @BindView(R.id.rules_button_post_text_activity) - Button rulesButton; + MaterialButton rulesButton; @BindView(R.id.divider_1_post_text_activity) View divider1; @BindView(R.id.flair_custom_text_view_post_text_activity) @@ -113,10 +116,18 @@ public class PostTextActivity extends BaseActivity implements FlairBottomSheetFr CustomTextView nsfwTextView; @BindView(R.id.divider_2_post_text_activity) View divider2; - @BindView(R.id.post_title_edit_text_post_text_activity) - EditText titleEditText; + @BindView(R.id.receive_post_reply_notifications_linear_layout_post_text_activity) + LinearLayout receivePostReplyNotificationsLinearLayout; + @BindView(R.id.receive_post_reply_notifications_text_view_post_text_activity) + TextView receivePostReplyNotificationsTextView; + @BindView(R.id.receive_post_reply_notifications_switch_material_post_text_activity) + SwitchMaterial receivePostReplyNotificationsSwitchMaterial; @BindView(R.id.divider_3_post_text_activity) View divider3; + @BindView(R.id.post_title_edit_text_post_text_activity) + EditText titleEditText; + @BindView(R.id.divider_4_post_text_activity) + View divider4; @BindView(R.id.post_text_content_edit_text_post_text_activity) EditText contentEditText; @BindView(R.id.markdown_bottom_bar_recycler_view_post_text_activity) @@ -333,6 +344,10 @@ public class PostTextActivity extends BaseActivity implements FlairBottomSheetFr } }); + receivePostReplyNotificationsLinearLayout.setOnClickListener(view -> { + receivePostReplyNotificationsSwitchMaterial.performClick(); + }); + MarkdownBottomBarRecyclerViewAdapter adapter = new MarkdownBottomBarRecyclerViewAdapter( mCustomThemeWrapper, new MarkdownBottomBarRecyclerViewAdapter.ItemClickListener() { @Override @@ -353,7 +368,7 @@ public class PostTextActivity extends BaseActivity implements FlairBottomSheetFr } }); - markdownBottomBarRecyclerView.setLayoutManager(new LinearLayoutManager(this, + markdownBottomBarRecyclerView.setLayoutManager(new LinearLayoutManagerBugFixed(this, LinearLayoutManager.HORIZONTAL, false)); markdownBottomBarRecyclerView.setAdapter(adapter); } @@ -375,12 +390,14 @@ public class PostTextActivity extends BaseActivity implements FlairBottomSheetFr int secondaryTextColor = mCustomThemeWrapper.getSecondaryTextColor(); subredditNameTextView.setTextColor(secondaryTextColor); rulesButton.setTextColor(mCustomThemeWrapper.getButtonTextColor()); - rulesButton.setBackgroundTintList(ColorStateList.valueOf(mCustomThemeWrapper.getColorPrimaryLightTheme())); + rulesButton.setBackgroundColor(mCustomThemeWrapper.getColorPrimaryLightTheme()); + primaryTextColor = mCustomThemeWrapper.getPrimaryTextColor(); + receivePostReplyNotificationsTextView.setTextColor(primaryTextColor); int dividerColor = mCustomThemeWrapper.getDividerColor(); divider1.setBackgroundColor(dividerColor); divider2.setBackgroundColor(dividerColor); divider3.setBackgroundColor(dividerColor); - primaryTextColor = mCustomThemeWrapper.getPrimaryTextColor(); + divider4.setBackgroundColor(dividerColor); flairBackgroundColor = mCustomThemeWrapper.getFlairBackgroundColor(); flairTextColor = mCustomThemeWrapper.getFlairTextColor(); spoilerBackgroundColor = mCustomThemeWrapper.getSpoilerBackgroundColor(); @@ -423,9 +440,9 @@ public class PostTextActivity extends BaseActivity implements FlairBottomSheetFr new MaterialAlertDialogBuilder(this, R.style.MaterialAlertDialogTheme) .setTitle(titleResId) .setMessage(messageResId) - .setPositiveButton(R.string.yes, (dialogInterface, i) + .setPositiveButton(R.string.discard_dialog_button, (dialogInterface, i) -> finish()) - .setNegativeButton(R.string.no, null) + .setNegativeButton(R.string.cancel, null) .show(); } @@ -459,48 +476,55 @@ public class PostTextActivity extends BaseActivity implements FlairBottomSheetFr } else if (itemId == R.id.action_preview_post_text_activity) { Intent intent = new Intent(this, FullMarkdownActivity.class); intent.putExtra(FullMarkdownActivity.EXTRA_COMMENT_MARKDOWN, contentEditText.getText().toString()); - startActivity(intent); + intent.putExtra(FullMarkdownActivity.EXTRA_SUBMIT_POST, true); + startActivityForResult(intent, MARKDOWN_PREVIEW_REQUEST_CODE); } else if (itemId == R.id.action_send_post_text_activity) { - if (!subredditSelected) { - Snackbar.make(coordinatorLayout, R.string.select_a_subreddit, Snackbar.LENGTH_SHORT).show(); - return true; - } + submitPost(item); + return true; + } - if (titleEditText.getText() == null || titleEditText.getText().toString().equals("")) { - Snackbar.make(coordinatorLayout, R.string.title_required, Snackbar.LENGTH_SHORT).show(); - return true; - } + return false; + } - isPosting = true; + private void submitPost(MenuItem item) { + if (!subredditSelected) { + Snackbar.make(coordinatorLayout, R.string.select_a_subreddit, Snackbar.LENGTH_SHORT).show(); + return; + } - item.setEnabled(false); - item.getIcon().setAlpha(130); + if (titleEditText.getText() == null || titleEditText.getText().toString().equals("")) { + Snackbar.make(coordinatorLayout, R.string.title_required, Snackbar.LENGTH_SHORT).show(); + return; + } - mPostingSnackbar.show(); + isPosting = true; - String subredditName; - if (subredditIsUser) { - subredditName = "u_" + subredditNameTextView.getText().toString(); - } else { - subredditName = subredditNameTextView.getText().toString(); - } + if (item != null) { + item.setEnabled(false); + item.getIcon().setAlpha(130); + } - Intent intent = new Intent(this, SubmitPostService.class); - intent.putExtra(SubmitPostService.EXTRA_ACCESS_TOKEN, mAccessToken); - intent.putExtra(SubmitPostService.EXTRA_SUBREDDIT_NAME, subredditName); - intent.putExtra(SubmitPostService.EXTRA_TITLE, titleEditText.getText().toString()); - intent.putExtra(SubmitPostService.EXTRA_CONTENT, contentEditText.getText().toString()); - intent.putExtra(SubmitPostService.EXTRA_KIND, APIUtils.KIND_SELF); - intent.putExtra(SubmitPostService.EXTRA_FLAIR, flair); - intent.putExtra(SubmitPostService.EXTRA_IS_SPOILER, isSpoiler); - intent.putExtra(SubmitPostService.EXTRA_IS_NSFW, isNSFW); - intent.putExtra(SubmitPostService.EXTRA_POST_TYPE, SubmitPostService.EXTRA_POST_TEXT_OR_LINK); - ContextCompat.startForegroundService(this, intent); + mPostingSnackbar.show(); - return true; + String subredditName; + if (subredditIsUser) { + subredditName = "u_" + subredditNameTextView.getText().toString(); + } else { + subredditName = subredditNameTextView.getText().toString(); } - return false; + Intent intent = new Intent(this, SubmitPostService.class); + intent.putExtra(SubmitPostService.EXTRA_ACCESS_TOKEN, mAccessToken); + intent.putExtra(SubmitPostService.EXTRA_SUBREDDIT_NAME, subredditName); + intent.putExtra(SubmitPostService.EXTRA_TITLE, titleEditText.getText().toString()); + intent.putExtra(SubmitPostService.EXTRA_CONTENT, contentEditText.getText().toString()); + intent.putExtra(SubmitPostService.EXTRA_KIND, APIUtils.KIND_SELF); + intent.putExtra(SubmitPostService.EXTRA_FLAIR, flair); + intent.putExtra(SubmitPostService.EXTRA_IS_SPOILER, isSpoiler); + intent.putExtra(SubmitPostService.EXTRA_IS_NSFW, isNSFW); + intent.putExtra(SubmitPostService.EXTRA_RECEIVE_POST_REPLY_NOTIFICATIONS, receivePostReplyNotificationsSwitchMaterial.isChecked()); + intent.putExtra(SubmitPostService.EXTRA_POST_TYPE, SubmitPostService.EXTRA_POST_TEXT_OR_LINK); + ContextCompat.startForegroundService(this, intent); } @Override @@ -561,6 +585,8 @@ public class PostTextActivity extends BaseActivity implements FlairBottomSheetFr } else if (requestCode == CAPTURE_IMAGE_REQUEST_CODE) { Utils.uploadImageToReddit(this, mExecutor, mOauthRetrofit, mUploadMediaRetrofit, mAccessToken, contentEditText, coordinatorLayout, capturedImageUri, uploadedImages); + } else if (requestCode == MARKDOWN_PREVIEW_REQUEST_CODE) { + submitPost(mMenu.findItem(R.id.action_send_post_text_activity)); } } diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostVideoActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostVideoActivity.java index 420477ff..109d10d3 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostVideoActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostVideoActivity.java @@ -2,7 +2,6 @@ package ml.docilealligator.infinityforreddit.activities; import android.content.Intent; import android.content.SharedPreferences; -import android.content.res.ColorStateList; import android.content.res.Resources; import android.net.Uri; import android.os.Build; @@ -12,8 +11,8 @@ import android.provider.MediaStore; import android.view.Menu; import android.view.MenuItem; import android.view.View; -import android.widget.Button; import android.widget.EditText; +import android.widget.LinearLayout; import android.widget.TextView; import androidx.annotation.NonNull; @@ -35,9 +34,11 @@ import com.google.android.exoplayer2.upstream.DataSource; import com.google.android.exoplayer2.upstream.DefaultDataSourceFactory; import com.google.android.exoplayer2.util.Util; import com.google.android.material.appbar.AppBarLayout; +import com.google.android.material.button.MaterialButton; import com.google.android.material.dialog.MaterialAlertDialogBuilder; import com.google.android.material.floatingactionbutton.FloatingActionButton; import com.google.android.material.snackbar.Snackbar; +import com.google.android.material.switchmaterial.SwitchMaterial; import com.libRG.CustomTextView; import org.greenrobot.eventbus.EventBus; @@ -95,7 +96,7 @@ public class PostVideoActivity extends BaseActivity implements FlairBottomSheetF @BindView(R.id.subreddit_name_text_view_post_video_activity) TextView subredditNameTextView; @BindView(R.id.rules_button_post_video_activity) - Button rulesButton; + MaterialButton rulesButton; @BindView(R.id.divider_1_post_video_activity) View divider1; @BindView(R.id.flair_custom_text_view_post_video_activity) @@ -106,10 +107,18 @@ public class PostVideoActivity extends BaseActivity implements FlairBottomSheetF CustomTextView nsfwTextView; @BindView(R.id.divider_2_post_video_activity) View divider2; - @BindView(R.id.post_title_edit_text_post_video_activity) - EditText titleEditText; + @BindView(R.id.receive_post_reply_notifications_linear_layout_post_video_activity) + LinearLayout receivePostReplyNotificationsLinearLayout; + @BindView(R.id.receive_post_reply_notifications_text_view_post_video_activity) + TextView receivePostReplyNotificationsTextView; + @BindView(R.id.receive_post_reply_notifications_switch_material_post_video_activity) + SwitchMaterial receivePostReplyNotificationsSwitchMaterial; @BindView(R.id.divider_3_post_video_activity) View divider3; + @BindView(R.id.post_title_edit_text_post_video_activity) + EditText titleEditText; + @BindView(R.id.divider_4_post_video_activity) + View divider4; @BindView(R.id.select_video_constraint_layout_post_video_activity) ConstraintLayout constraintLayout; @BindView(R.id.capture_fab_post_video_activity) @@ -345,6 +354,10 @@ public class PostVideoActivity extends BaseActivity implements FlairBottomSheetF } }); + receivePostReplyNotificationsLinearLayout.setOnClickListener(view -> { + receivePostReplyNotificationsSwitchMaterial.performClick(); + }); + captureFab.setOnClickListener(view -> { Intent takeVideoIntent = new Intent(MediaStore.ACTION_VIDEO_CAPTURE); if (takeVideoIntent.resolveActivity(getPackageManager()) != null) { @@ -386,12 +399,14 @@ public class PostVideoActivity extends BaseActivity implements FlairBottomSheetF int secondaryTextColor = mCustomThemeWrapper.getSecondaryTextColor(); subredditNameTextView.setTextColor(secondaryTextColor); rulesButton.setTextColor(mCustomThemeWrapper.getButtonTextColor()); - rulesButton.setBackgroundTintList(ColorStateList.valueOf(mCustomThemeWrapper.getColorPrimaryLightTheme())); + rulesButton.setBackgroundColor(mCustomThemeWrapper.getColorPrimaryLightTheme()); + primaryTextColor = mCustomThemeWrapper.getPrimaryTextColor(); + receivePostReplyNotificationsTextView.setTextColor(primaryTextColor); int dividerColor = mCustomThemeWrapper.getDividerColor(); divider1.setBackgroundColor(dividerColor); divider2.setBackgroundColor(dividerColor); divider3.setBackgroundColor(dividerColor); - primaryTextColor = mCustomThemeWrapper.getPrimaryTextColor(); + divider4.setBackgroundColor(dividerColor); flairBackgroundColor = mCustomThemeWrapper.getFlairBackgroundColor(); flairTextColor = mCustomThemeWrapper.getFlairTextColor(); spoilerBackgroundColor = mCustomThemeWrapper.getSpoilerBackgroundColor(); @@ -444,7 +459,7 @@ public class PostVideoActivity extends BaseActivity implements FlairBottomSheetF new MaterialAlertDialogBuilder(this, R.style.MaterialAlertDialogTheme) .setTitle(titleResId) .setMessage(messageResId) - .setPositiveButton(R.string.yes, (dialogInterface, i) -> finish()) + .setPositiveButton(R.string.discard_dialog_button, (dialogInterface, i) -> finish()) .setNegativeButton(R.string.no, null) .show(); } @@ -463,63 +478,64 @@ public class PostVideoActivity extends BaseActivity implements FlairBottomSheetF @Override public boolean onOptionsItemSelected(@NonNull MenuItem item) { - switch (item.getItemId()) { - case android.R.id.home: - if (isPosting) { - promptAlertDialog(R.string.exit_when_submit, R.string.exit_when_submit_post_detail); - return true; - } else { - if (!titleEditText.getText().toString().equals("") || videoUri != null) { - promptAlertDialog(R.string.discard, R.string.discard_detail); - return true; - } - } - finish(); + int itemId = item.getItemId(); + if (itemId == android.R.id.home) { + if (isPosting) { + promptAlertDialog(R.string.exit_when_submit, R.string.exit_when_submit_post_detail); return true; - case R.id.action_send_post_video_activity: - if (!subredditSelected) { - Snackbar.make(coordinatorLayout, R.string.select_a_subreddit, Snackbar.LENGTH_SHORT).show(); - return true; - } - - if (titleEditText.getText() == null || titleEditText.getText().toString().equals("")) { - Snackbar.make(coordinatorLayout, R.string.title_required, Snackbar.LENGTH_SHORT).show(); - return true; - } - - if (videoUri == null) { - Snackbar.make(coordinatorLayout, R.string.select_an_image, Snackbar.LENGTH_SHORT).show(); + } else { + if (!titleEditText.getText().toString().equals("") || videoUri != null) { + promptAlertDialog(R.string.discard, R.string.discard_detail); return true; } + } + finish(); + return true; + } else if (itemId == R.id.action_send_post_video_activity) { + if (!subredditSelected) { + Snackbar.make(coordinatorLayout, R.string.select_a_subreddit, Snackbar.LENGTH_SHORT).show(); + return true; + } - isPosting = true; + if (titleEditText.getText() == null || titleEditText.getText().toString().equals("")) { + Snackbar.make(coordinatorLayout, R.string.title_required, Snackbar.LENGTH_SHORT).show(); + return true; + } - item.setEnabled(false); - item.getIcon().setAlpha(130); + if (videoUri == null) { + Snackbar.make(coordinatorLayout, R.string.select_an_image, Snackbar.LENGTH_SHORT).show(); + return true; + } - mPostingSnackbar.show(); + isPosting = true; - String subredditName; - if (subredditIsUser) { - subredditName = "u_" + subredditNameTextView.getText().toString(); - } else { - subredditName = subredditNameTextView.getText().toString(); - } + item.setEnabled(false); + item.getIcon().setAlpha(130); - Intent intent = new Intent(this, SubmitPostService.class); - intent.setData(videoUri); - intent.putExtra(SubmitPostService.EXTRA_ACCESS_TOKEN, mAccessToken); - intent.putExtra(SubmitPostService.EXTRA_SUBREDDIT_NAME, subredditName); - intent.putExtra(SubmitPostService.EXTRA_TITLE, titleEditText.getText().toString()); - intent.putExtra(SubmitPostService.EXTRA_FLAIR, flair); - intent.putExtra(SubmitPostService.EXTRA_IS_SPOILER, isSpoiler); - intent.putExtra(SubmitPostService.EXTRA_IS_NSFW, isNSFW); - intent.putExtra(SubmitPostService.EXTRA_POST_TYPE, SubmitPostService.EXTRA_POST_TYPE_VIDEO); - intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); + mPostingSnackbar.show(); - ContextCompat.startForegroundService(this, intent); + String subredditName; + if (subredditIsUser) { + subredditName = "u_" + subredditNameTextView.getText().toString(); + } else { + subredditName = subredditNameTextView.getText().toString(); + } - return true; + Intent intent = new Intent(this, SubmitPostService.class); + intent.setData(videoUri); + intent.putExtra(SubmitPostService.EXTRA_ACCESS_TOKEN, mAccessToken); + intent.putExtra(SubmitPostService.EXTRA_SUBREDDIT_NAME, subredditName); + intent.putExtra(SubmitPostService.EXTRA_TITLE, titleEditText.getText().toString()); + intent.putExtra(SubmitPostService.EXTRA_FLAIR, flair); + intent.putExtra(SubmitPostService.EXTRA_IS_SPOILER, isSpoiler); + intent.putExtra(SubmitPostService.EXTRA_IS_NSFW, isNSFW); + intent.putExtra(SubmitPostService.EXTRA_RECEIVE_POST_REPLY_NOTIFICATIONS, receivePostReplyNotificationsSwitchMaterial.isChecked()); + intent.putExtra(SubmitPostService.EXTRA_POST_TYPE, SubmitPostService.EXTRA_POST_TYPE_VIDEO); + intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); + + ContextCompat.startForegroundService(this, intent); + + return true; } return false; diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/RPANActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/RPANActivity.java index c22d481f..d99511ac 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/RPANActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/RPANActivity.java @@ -1,5 +1,7 @@ package ml.docilealligator.infinityforreddit.activities; +import android.content.ActivityNotFoundException; +import android.content.Intent; import android.content.SharedPreferences; import android.graphics.Color; import android.graphics.drawable.ColorDrawable; @@ -7,6 +9,8 @@ import android.graphics.drawable.Drawable; import android.media.AudioManager; import android.os.Bundle; import android.os.Handler; +import android.view.Menu; +import android.view.MenuItem; import android.view.View; import android.widget.ProgressBar; import android.widget.Toast; @@ -23,12 +27,15 @@ import androidx.viewpager2.adapter.FragmentStateAdapter; import androidx.viewpager2.widget.ViewPager2; import com.evernote.android.state.State; +import com.google.android.material.snackbar.Snackbar; import com.livefront.bridge.Bridge; +import org.greenrobot.eventbus.EventBus; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; +import java.io.IOException; import java.lang.reflect.Field; import java.util.ArrayList; import java.util.concurrent.Executor; @@ -44,12 +51,15 @@ import ml.docilealligator.infinityforreddit.RPANBroadcast; import ml.docilealligator.infinityforreddit.apis.Strapi; import ml.docilealligator.infinityforreddit.customtheme.CustomThemeWrapper; import ml.docilealligator.infinityforreddit.font.ContentFontFamily; +import ml.docilealligator.infinityforreddit.font.ContentFontStyle; import ml.docilealligator.infinityforreddit.font.FontFamily; +import ml.docilealligator.infinityforreddit.font.FontStyle; import ml.docilealligator.infinityforreddit.font.TitleFontFamily; +import ml.docilealligator.infinityforreddit.font.TitleFontStyle; import ml.docilealligator.infinityforreddit.fragments.ViewRPANBroadcastFragment; -import ml.docilealligator.infinityforreddit.utils.APIUtils; import ml.docilealligator.infinityforreddit.utils.JSONUtils; import ml.docilealligator.infinityforreddit.utils.SharedPreferencesUtils; +import okhttp3.ResponseBody; import retrofit2.Call; import retrofit2.Callback; import retrofit2.Response; @@ -57,6 +67,8 @@ import retrofit2.Retrofit; public class RPANActivity extends AppCompatActivity { + public static final String EXTRA_RPAN_BROADCAST_FULLNAME_OR_ID = "ERBFOI"; + @BindView(R.id.coordinator_layout_rpan_activity) CoordinatorLayout coordinatorLayout; @BindView(R.id.view_pager_2_rpan_activity) @@ -70,14 +82,9 @@ public class RPANActivity extends AppCompatActivity { @Named("default") SharedPreferences mSharedPreferences; @Inject - @Named("current_account") - SharedPreferences mCurrentAccountSharedPreferences; - @Inject CustomThemeWrapper mCustomThemeWrapper; @Inject Executor mExecutor; - private String mAccessToken; - private String mAccountName; @State ArrayList<RPANBroadcast> rpanBroadcasts; @State @@ -92,6 +99,15 @@ public class RPANActivity extends AppCompatActivity { getTheme().applyStyle(R.style.Theme_Normal, true); + getTheme().applyStyle(FontStyle.valueOf(mSharedPreferences + .getString(SharedPreferencesUtils.FONT_SIZE_KEY, FontStyle.Normal.name())).getResId(), true); + + getTheme().applyStyle(TitleFontStyle.valueOf(mSharedPreferences + .getString(SharedPreferencesUtils.TITLE_FONT_SIZE_KEY, TitleFontStyle.Normal.name())).getResId(), true); + + getTheme().applyStyle(ContentFontStyle.valueOf(mSharedPreferences + .getString(SharedPreferencesUtils.CONTENT_FONT_SIZE_KEY, ContentFontStyle.Normal.name())).getResId(), true); + getTheme().applyStyle(FontFamily.valueOf(mSharedPreferences .getString(SharedPreferencesUtils.FONT_FAMILY_KEY, FontFamily.Default.name())).getResId(), true); @@ -114,9 +130,6 @@ public class RPANActivity extends AppCompatActivity { actionBar.setHomeAsUpIndicator(upArrow); actionBar.setBackgroundDrawable(new ColorDrawable(Color.parseColor("#00000000"))); - mAccessToken = mCurrentAccountSharedPreferences.getString(SharedPreferencesUtils.ACCESS_TOKEN, null); - mAccountName = mCurrentAccountSharedPreferences.getString(SharedPreferencesUtils.ACCOUNT_NAME, null); - if (rpanBroadcasts == null) { loadRPANVideos(); } else { @@ -125,25 +138,95 @@ public class RPANActivity extends AppCompatActivity { } private void loadRPANVideos() { - strapiRetrofit.create(Strapi.class).getAllBroadcasts(APIUtils.getOAuthHeader(mAccessToken)).enqueue(new Callback<String>() { - @Override - public void onResponse(@NonNull Call<String> call, @NonNull Response<String> response) { - progressBar.setVisibility(View.GONE); - if (response.isSuccessful()) { - parseRPANBroadcasts(response.body()); - } else { + String rpanBroadcastFullNameOrId = getIntent().getStringExtra(EXTRA_RPAN_BROADCAST_FULLNAME_OR_ID); + if (rpanBroadcastFullNameOrId == null) { + strapiRetrofit.create(Strapi.class).getAllBroadcasts().enqueue(new Callback<String>() { + @Override + public void onResponse(@NonNull Call<String> call, @NonNull Response<String> response) { + progressBar.setVisibility(View.GONE); + if (response.isSuccessful()) { + parseRPANBroadcasts(response.body()); + } else { + try { + ResponseBody responseBody = response.errorBody(); + if (responseBody != null) { + JSONObject errorObject = new JSONObject(responseBody.string()); + String errorMessage = errorObject.getString(JSONUtils.DATA_KEY); + if (!errorMessage.isEmpty() && !errorMessage.equals("null")) { + Snackbar.make(coordinatorLayout, errorMessage, Snackbar.LENGTH_LONG).show(); + } else { + Toast.makeText(RPANActivity.this, + R.string.load_rpan_broadcasts_failed, Toast.LENGTH_SHORT).show(); + } + } else { + Toast.makeText(RPANActivity.this, + R.string.load_rpan_broadcasts_failed, Toast.LENGTH_SHORT).show(); + } + } catch (IOException | JSONException e) { + e.printStackTrace(); + Toast.makeText(RPANActivity.this, + R.string.load_rpan_broadcasts_failed, Toast.LENGTH_SHORT).show(); + } + } + } + + @Override + public void onFailure(@NonNull Call<String> call, @NonNull Throwable t) { + progressBar.setVisibility(View.GONE); Toast.makeText(RPANActivity.this, R.string.load_rpan_broadcasts_failed, Toast.LENGTH_SHORT).show(); } - } + }); + } else { + strapiRetrofit.create(Strapi.class).getRPANBroadcast(rpanBroadcastFullNameOrId).enqueue(new Callback<String>() { + @Override + public void onResponse(@NonNull Call<String> call, @NonNull Response<String> response) { + progressBar.setVisibility(View.GONE); + if (response.isSuccessful()) { + Handler handler = new Handler(); + mExecutor.execute(() -> { + try { + rpanBroadcasts = new ArrayList<>(); + rpanBroadcasts.add(parseSingleRPANBroadcast(new JSONObject(response.body()).getJSONObject(JSONUtils.DATA_KEY))); + handler.post(() -> initializeViewPager()); + } catch (JSONException e) { + e.printStackTrace(); + handler.post(() -> Toast.makeText(RPANActivity.this, + R.string.parse_rpan_broadcasts_failed, Toast.LENGTH_SHORT).show()); + } + }); + } else { + try { + ResponseBody responseBody = response.errorBody(); + if (responseBody != null) { + JSONObject errorObject = new JSONObject(responseBody.string()); + String errorMessage = errorObject.getString(JSONUtils.DATA_KEY); + if (!errorMessage.isEmpty() && !errorMessage.equals("null")) { + Snackbar.make(coordinatorLayout, errorMessage, Snackbar.LENGTH_LONG).show(); + } else { + Toast.makeText(RPANActivity.this, + R.string.load_rpan_broadcasts_failed, Toast.LENGTH_SHORT).show(); + } + } else { + Toast.makeText(RPANActivity.this, + R.string.load_rpan_broadcasts_failed, Toast.LENGTH_SHORT).show(); + } + } catch (IOException | JSONException e) { + e.printStackTrace(); + Toast.makeText(RPANActivity.this, + R.string.load_rpan_broadcasts_failed, Toast.LENGTH_SHORT).show(); + } + } + } - @Override - public void onFailure(@NonNull Call<String> call, @NonNull Throwable t) { - progressBar.setVisibility(View.GONE); - Toast.makeText(RPANActivity.this, - R.string.load_rpan_broadcasts_failed, Toast.LENGTH_SHORT).show(); - } - }); + @Override + public void onFailure(@NonNull Call<String> call, @NonNull Throwable t) { + progressBar.setVisibility(View.GONE); + Toast.makeText(RPANActivity.this, + R.string.load_rpan_broadcasts_failed, Toast.LENGTH_SHORT).show(); + } + }); + } } private void parseRPANBroadcasts(String response) { @@ -156,49 +239,12 @@ public class RPANActivity extends AppCompatActivity { JSONArray dataArray = responseObject.getJSONArray(JSONUtils.DATA_KEY); for (int i = 0; i < dataArray.length(); i++) { - JSONObject singleData = dataArray.getJSONObject(i); - JSONObject rpanPostObject = singleData.getJSONObject(JSONUtils.POST_KEY); - RPANBroadcast.RPANPost rpanPost = new RPANBroadcast.RPANPost( - rpanPostObject.getString(JSONUtils.TITLE_KEY), - rpanPostObject.getJSONObject(JSONUtils.SUBREDDIT_KEY).getString(JSONUtils.NAME_KEY), - rpanPostObject.getJSONObject(JSONUtils.SUBREDDIT_KEY).getJSONObject(JSONUtils.STYLES_KEY).getString(JSONUtils.ICON_KEY), - rpanPostObject.getJSONObject(JSONUtils.AUTHOR_INFO_KEY).getString(JSONUtils.NAME_KEY), - rpanPostObject.getInt(JSONUtils.SCORE_KEY), - rpanPostObject.getString(JSONUtils.VOTE_STATE_KEY), - rpanPostObject.getDouble(JSONUtils.UPVOTE_RATIO_CAMEL_CASE_KEY), - rpanPostObject.getString(JSONUtils.PERMALINK_KEY), - rpanPostObject.getJSONObject(JSONUtils.OUTBOUND_LINK_KEY).getString(JSONUtils.URL_KEY), - rpanPostObject.getBoolean(JSONUtils.IS_NSFW_KEY), - rpanPostObject.getBoolean(JSONUtils.IS_LOCKED_KEY), - rpanPostObject.getBoolean(JSONUtils.IS_ARCHIVED_KEY), - rpanPostObject.getBoolean(JSONUtils.IS_SPOILER), - rpanPostObject.getString(JSONUtils.SUGGESTED_COMMENT_SORT_CAMEL_CASE_KEY), - rpanPostObject.getString(JSONUtils.LIVE_COMMENTS_WEBSOCKET_KEY) - ); - - JSONObject rpanStreamObject = singleData.getJSONObject(JSONUtils.STREAM_KEY); - RPANBroadcast.RPANStream rpanStream = new RPANBroadcast.RPANStream( - rpanStreamObject.getString(JSONUtils.STREAM_ID_KEY), - rpanStreamObject.getString(JSONUtils.HLS_URL_KEY), - rpanStreamObject.getString(JSONUtils.THUMBNAIL_KEY), - rpanStreamObject.getInt(JSONUtils.WIDTH_KEY), - rpanStreamObject.getInt(JSONUtils.HEIGHT_KEY), - rpanStreamObject.getLong(JSONUtils.PUBLISH_AT_KEY), - rpanStreamObject.getString(JSONUtils.STATE_KEY) - ); - - rpanBroadcasts.add(new RPANBroadcast( - singleData.getInt(JSONUtils.UPVOTES_KEY), - singleData.getInt(JSONUtils.DOWNVOTES_KEY), - singleData.getInt(JSONUtils.UNIQUE_WATCHERS_KEY), - singleData.getInt(JSONUtils.CONTINUOUS_WATCHERS_KEY), - singleData.getInt(JSONUtils.TOTAL_CONTINUOUS_WATCHERS_KEY), - singleData.getBoolean(JSONUtils.CHAT_DISABLED_KEY), - singleData.getDouble(JSONUtils.BROADCAST_TIME_KEY), - singleData.getDouble(JSONUtils.ESTIMATED_REMAINING_TIME_KEY), - rpanPost, - rpanStream - )); + try { + JSONObject singleData = dataArray.getJSONObject(i); + rpanBroadcasts.add(parseSingleRPANBroadcast(singleData)); + } catch (JSONException e) { + e.printStackTrace(); + } } handler.post(() -> { @@ -215,6 +261,52 @@ public class RPANActivity extends AppCompatActivity { }); } + private RPANBroadcast parseSingleRPANBroadcast(JSONObject singleData) throws JSONException { + JSONObject rpanPostObject = singleData.getJSONObject(JSONUtils.POST_KEY); + RPANBroadcast.RPANPost rpanPost = new RPANBroadcast.RPANPost( + rpanPostObject.getString(JSONUtils.ID_KEY), + rpanPostObject.getString(JSONUtils.TITLE_KEY), + rpanPostObject.getJSONObject(JSONUtils.SUBREDDIT_KEY).getString(JSONUtils.NAME_KEY), + rpanPostObject.getJSONObject(JSONUtils.SUBREDDIT_KEY).getJSONObject(JSONUtils.STYLES_KEY).getString(JSONUtils.ICON_KEY), + rpanPostObject.getJSONObject(JSONUtils.AUTHOR_INFO_KEY).getString(JSONUtils.NAME_KEY), + rpanPostObject.getInt(JSONUtils.SCORE_KEY), + rpanPostObject.getString(JSONUtils.VOTE_STATE_KEY), + rpanPostObject.getDouble(JSONUtils.UPVOTE_RATIO_CAMEL_CASE_KEY), + rpanPostObject.getString(JSONUtils.PERMALINK_KEY), + rpanPostObject.getJSONObject(JSONUtils.OUTBOUND_LINK_KEY).getString(JSONUtils.URL_KEY), + rpanPostObject.getBoolean(JSONUtils.IS_NSFW_KEY), + rpanPostObject.getBoolean(JSONUtils.IS_LOCKED_KEY), + rpanPostObject.getBoolean(JSONUtils.IS_ARCHIVED_KEY), + rpanPostObject.getBoolean(JSONUtils.IS_SPOILER), + rpanPostObject.getString(JSONUtils.SUGGESTED_COMMENT_SORT_CAMEL_CASE_KEY), + rpanPostObject.getString(JSONUtils.LIVE_COMMENTS_WEBSOCKET_KEY) + ); + + JSONObject rpanStreamObject = singleData.getJSONObject(JSONUtils.STREAM_KEY); + RPANBroadcast.RPANStream rpanStream = new RPANBroadcast.RPANStream( + rpanStreamObject.getString(JSONUtils.STREAM_ID_KEY), + rpanStreamObject.getString(JSONUtils.HLS_URL_KEY), + rpanStreamObject.getString(JSONUtils.THUMBNAIL_KEY), + rpanStreamObject.getInt(JSONUtils.WIDTH_KEY), + rpanStreamObject.getInt(JSONUtils.HEIGHT_KEY), + rpanStreamObject.getLong(JSONUtils.PUBLISH_AT_KEY), + rpanStreamObject.getString(JSONUtils.STATE_KEY) + ); + + return new RPANBroadcast( + singleData.getInt(JSONUtils.UPVOTES_KEY), + singleData.getInt(JSONUtils.DOWNVOTES_KEY), + singleData.getInt(JSONUtils.UNIQUE_WATCHERS_KEY), + singleData.getInt(JSONUtils.CONTINUOUS_WATCHERS_KEY), + singleData.getInt(JSONUtils.TOTAL_CONTINUOUS_WATCHERS_KEY), + singleData.getBoolean(JSONUtils.CHAT_DISABLED_KEY), + singleData.getDouble(JSONUtils.BROADCAST_TIME_KEY), + singleData.getDouble(JSONUtils.ESTIMATED_REMAINING_TIME_KEY), + rpanPost, + rpanStream + ); + } + private void initializeViewPager() { sectionsPagerAdapter = new SectionsPagerAdapter(this); viewPager2.setAdapter(sectionsPagerAdapter); @@ -240,6 +332,54 @@ public class RPANActivity extends AppCompatActivity { } catch (NoSuchFieldException | IllegalAccessException ignore) {} } + @Override + public boolean onCreateOptionsMenu(Menu menu) { + getMenuInflater().inflate(R.menu.rpan_activity, menu); + return true; + } + + @Override + public boolean onOptionsItemSelected(@NonNull MenuItem item) { + if (item.getItemId() == android.R.id.home) { + finish(); + return true; + } else if (item.getItemId() == R.id.action_share_rpan_link_rpan_activity) { + if (rpanBroadcasts != null) { + int position = viewPager2.getCurrentItem(); + if (position >= 0 && position < rpanBroadcasts.size()) { + shareLink(rpanBroadcasts.get(position).rpanPost.rpanUrl); + return true; + } + } + } else if (item.getItemId() == R.id.action_share_post_link_rpan_activity) { + if (rpanBroadcasts != null) { + int position = viewPager2.getCurrentItem(); + if (position >= 0 && position < rpanBroadcasts.size()) { + shareLink(rpanBroadcasts.get(position).rpanPost.postPermalink); + return true; + } + } + } + return false; + } + + @Override + protected void onDestroy() { + super.onDestroy(); + EventBus.getDefault().unregister(this); + } + + private void shareLink(String link) { + try { + Intent intent = new Intent(Intent.ACTION_SEND); + intent.setType("text/plain"); + intent.putExtra(Intent.EXTRA_TEXT, link); + startActivity(Intent.createChooser(intent, getString(R.string.share))); + } catch (ActivityNotFoundException e) { + Toast.makeText(this, R.string.no_activity_found_for_share, Toast.LENGTH_SHORT).show(); + } + } + private class SectionsPagerAdapter extends FragmentStateAdapter { public SectionsPagerAdapter(FragmentActivity fa) { diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ReportActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ReportActivity.java index c13785bf..4b8f9b38 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ReportActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ReportActivity.java @@ -11,7 +11,6 @@ import android.widget.Toast; import androidx.annotation.NonNull; import androidx.appcompat.widget.Toolbar; import androidx.coordinatorlayout.widget.CoordinatorLayout; -import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; import com.google.android.material.appbar.AppBarLayout; @@ -117,7 +116,6 @@ public class ReportActivity extends BaseActivity { } else { mAdapter = new ReportReasonRecyclerViewAdapter(mCustomThemeWrapper, ReportReason.getGeneralReasons(this)); } - recyclerView.setLayoutManager(new LinearLayoutManager(this)); recyclerView.setAdapter(mAdapter); if (rulesReasons == null) { diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/RulesActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/RulesActivity.java index dfc8da16..ca687cf1 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/RulesActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/RulesActivity.java @@ -15,7 +15,6 @@ import android.widget.TextView; import androidx.annotation.NonNull; import androidx.appcompat.widget.Toolbar; import androidx.coordinatorlayout.widget.CoordinatorLayout; -import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; import com.google.android.material.appbar.AppBarLayout; @@ -119,7 +118,6 @@ public class RulesActivity extends BaseActivity { mSubredditName = getIntent().getExtras().getString(EXTRA_SUBREDDIT_NAME); - recyclerView.setLayoutManager(new LinearLayoutManager(this)); mAdapter = new RulesRecyclerViewAdapter(this, mCustomThemeWrapper); recyclerView.setAdapter(mAdapter); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/SearchActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/SearchActivity.java index a4f77b95..66369953 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/SearchActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/SearchActivity.java @@ -18,7 +18,6 @@ import androidx.annotation.Nullable; import androidx.appcompat.widget.Toolbar; import androidx.coordinatorlayout.widget.CoordinatorLayout; import androidx.lifecycle.ViewModelProvider; -import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; import com.ferfalk.simplesearchview.SimpleSearchView; @@ -183,11 +182,24 @@ public class SearchActivity extends BaseActivity { subredditAutocompleteRecyclerViewAdapter = new SubredditAutocompleteRecyclerViewAdapter(this, mCustomThemeWrapper, subredditData -> { - Intent intent = new Intent(SearchActivity.this, ViewSubredditDetailActivity.class); - intent.putExtra(ViewSubredditDetailActivity.EXTRA_SUBREDDIT_NAME_KEY, subredditData.getName()); - startActivity(intent); - finish(); - }); + if (searchOnlySubreddits) { + Intent returnIntent = new Intent(); + if (getIntent().getBooleanExtra(EXTRA_IS_MULTI_SELECTION, false)) { + ArrayList<String> subredditNameList = new ArrayList<>(); + subredditNameList.add(subredditData.getName()); + returnIntent.putStringArrayListExtra(RETURN_EXTRA_SELECTED_SUBREDDIT_NAMES, subredditNameList); + } else { + returnIntent.putExtra(EXTRA_RETURN_SUBREDDIT_NAME, subredditData.getName()); + returnIntent.putExtra(EXTRA_RETURN_SUBREDDIT_ICON_URL, subredditData.getIconUrl()); + } + setResult(Activity.RESULT_OK, returnIntent); + } else { + Intent intent = new Intent(SearchActivity.this, ViewSubredditDetailActivity.class); + intent.putExtra(ViewSubredditDetailActivity.EXTRA_SUBREDDIT_NAME_KEY, subredditData.getName()); + startActivity(intent); + } + finish(); + }); simpleSearchView.setOnQueryTextListener(new SimpleSearchView.OnQueryTextListener() { @Override @@ -287,7 +299,6 @@ public class SearchActivity extends BaseActivity { }); recyclerView.setVisibility(View.VISIBLE); recyclerView.setNestedScrollingEnabled(false); - recyclerView.setLayoutManager(new LinearLayoutManager(this)); recyclerView.setAdapter(adapter); if (mSharedPreferences.getBoolean(SharedPreferencesUtils.ENABLE_SEARCH_HISTORY, true)) { diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/SearchResultActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/SearchResultActivity.java index 7098b86a..f2096b97 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/SearchResultActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/SearchResultActivity.java @@ -85,7 +85,9 @@ public class SearchResultActivity extends BaseActivity implements SortTypeSelect PostLayoutBottomSheetFragment.PostLayoutSelectionCallback, ActivityToolbarInterface, FABMoreOptionsBottomSheetFragment.FABOptionSelectionCallback, RandomBottomSheetFragment.RandomOptionSelectionCallback, PostTypeBottomSheetFragment.PostTypeSelectionCallback, RecyclerViewContentScrollingInterface { - static final String EXTRA_QUERY = "QK"; + + static final String EXTRA_QUERY = "EQ"; + static final String EXTRA_TRENDING_SOURCE = "ETS"; static final String EXTRA_SUBREDDIT_NAME = "ESN"; private static final String INSERT_SEARCH_QUERY_SUCCESS_STATE = "ISQSS"; @@ -647,7 +649,11 @@ public class SearchResultActivity extends BaseActivity implements SortTypeSelect subredditIntent.putExtra(ViewSubredditDetailActivity.EXTRA_SUBREDDIT_NAME_KEY, thingEditText.getText().toString()); startActivity(subredditIntent); }) - .setNegativeButton(R.string.cancel, null) + .setNegativeButton(R.string.cancel, (dialogInterface, i) -> { + if (imm != null) { + imm.hideSoftInputFromWindow(thingEditText.getWindowToken(), 0); + } + }) .setOnDismissListener(dialogInterface -> { if (imm != null) { imm.hideSoftInputFromWindow(thingEditText.getWindowToken(), 0); @@ -688,7 +694,11 @@ public class SearchResultActivity extends BaseActivity implements SortTypeSelect userIntent.putExtra(ViewUserDetailActivity.EXTRA_USER_NAME_KEY, thingEditText.getText().toString()); startActivity(userIntent); }) - .setNegativeButton(R.string.cancel, null) + .setNegativeButton(R.string.cancel, (dialogInterface, i) -> { + if (imm != null) { + imm.hideSoftInputFromWindow(thingEditText.getWindowToken(), 0); + } + }) .setOnDismissListener(dialogInterface -> { if (imm != null) { imm.hideSoftInputFromWindow(thingEditText.getWindowToken(), 0); @@ -724,6 +734,10 @@ public class SearchResultActivity extends BaseActivity implements SortTypeSelect case PostTypeBottomSheetFragment.TYPE_VIDEO: intent = new Intent(this, PostVideoActivity.class); startActivity(intent); + break; + case PostTypeBottomSheetFragment.TYPE_GALLERY: + intent = new Intent(this, PostGalleryActivity.class); + startActivity(intent); } } @@ -760,6 +774,7 @@ public class SearchResultActivity extends BaseActivity implements SortTypeSelect bundle.putInt(PostFragment.EXTRA_POST_TYPE, PostDataSource.TYPE_SEARCH); bundle.putString(PostFragment.EXTRA_NAME, mSubredditName); bundle.putString(PostFragment.EXTRA_QUERY, mQuery); + bundle.putString(PostFragment.EXTRA_TRENDING_SOURCE, getIntent().getStringExtra(EXTRA_TRENDING_SOURCE)); bundle.putString(PostFragment.EXTRA_ACCESS_TOKEN, mAccessToken); bundle.putString(PostFragment.EXTRA_ACCOUNT_NAME, mAccountName); mFragment.setArguments(bundle); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/SelectUserFlairActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/SelectUserFlairActivity.java index 84db322c..f9a7460e 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/SelectUserFlairActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/SelectUserFlairActivity.java @@ -13,7 +13,6 @@ import android.widget.Toast; import androidx.annotation.NonNull; import androidx.appcompat.widget.Toolbar; import androidx.coordinatorlayout.widget.CoordinatorLayout; -import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; import com.google.android.material.appbar.AppBarLayout; @@ -36,6 +35,7 @@ import ml.docilealligator.infinityforreddit.SelectUserFlair; import ml.docilealligator.infinityforreddit.UserFlair; import ml.docilealligator.infinityforreddit.adapters.UserFlairRecyclerViewAdapter; import ml.docilealligator.infinityforreddit.customtheme.CustomThemeWrapper; +import ml.docilealligator.infinityforreddit.customviews.LinearLayoutManagerBugFixed; import ml.docilealligator.infinityforreddit.utils.SharedPreferencesUtils; import retrofit2.Retrofit; @@ -63,7 +63,7 @@ public class SelectUserFlairActivity extends BaseActivity implements ActivityToo SharedPreferences mCurrentAccountSharedPreferences; @Inject CustomThemeWrapper mCustomThemeWrapper; - private LinearLayoutManager mLinearLayoutManager; + private LinearLayoutManagerBugFixed mLinearLayoutManager; private boolean mNullAccessToken = false; private String mAccessToken; private String mAccountName; @@ -170,7 +170,7 @@ public class SelectUserFlairActivity extends BaseActivity implements ActivityToo .show(); } }); - mLinearLayoutManager = new LinearLayoutManager(SelectUserFlairActivity.this); + mLinearLayoutManager = new LinearLayoutManagerBugFixed(SelectUserFlairActivity.this); recyclerView.setLayoutManager(mLinearLayoutManager); recyclerView.setAdapter(mAdapter); } diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/SelectedSubredditsAndUsersActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/SelectedSubredditsAndUsersActivity.java index cfc30dcf..38502fd4 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/SelectedSubredditsAndUsersActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/SelectedSubredditsAndUsersActivity.java @@ -11,7 +11,6 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.appcompat.widget.Toolbar; import androidx.coordinatorlayout.widget.CoordinatorLayout; -import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; import com.google.android.material.appbar.AppBarLayout; @@ -31,6 +30,7 @@ import ml.docilealligator.infinityforreddit.bottomsheetfragments.SelectSubreddit import ml.docilealligator.infinityforreddit.customtheme.CustomThemeWrapper; import ml.docilealligator.infinityforreddit.Infinity; import ml.docilealligator.infinityforreddit.R; +import ml.docilealligator.infinityforreddit.customviews.LinearLayoutManagerBugFixed; import ml.docilealligator.infinityforreddit.utils.SharedPreferencesUtils; public class SelectedSubredditsAndUsersActivity extends BaseActivity implements ActivityToolbarInterface { @@ -56,7 +56,7 @@ public class SelectedSubredditsAndUsersActivity extends BaseActivity implements SharedPreferences mSharedPreferences; @Inject CustomThemeWrapper mCustomThemeWrapper; - private LinearLayoutManager linearLayoutManager; + private LinearLayoutManagerBugFixed linearLayoutManager; private SelectedSubredditsRecyclerViewAdapter adapter; private ArrayList<String> subreddits; @@ -88,7 +88,7 @@ public class SelectedSubredditsAndUsersActivity extends BaseActivity implements } adapter = new SelectedSubredditsRecyclerViewAdapter(mCustomThemeWrapper, subreddits); - linearLayoutManager = new LinearLayoutManager(this); + linearLayoutManager = new LinearLayoutManagerBugFixed(this); recyclerView.setLayoutManager(linearLayoutManager); recyclerView.setAdapter(adapter); recyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() { diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/SubmitCrosspostActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/SubmitCrosspostActivity.java index 7e97c0a6..d6c5e68f 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/SubmitCrosspostActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/SubmitCrosspostActivity.java @@ -2,7 +2,6 @@ package ml.docilealligator.infinityforreddit.activities; import android.content.Intent; import android.content.SharedPreferences; -import android.content.res.ColorStateList; import android.content.res.Resources; import android.graphics.Bitmap; import android.graphics.drawable.Drawable; @@ -12,10 +11,10 @@ import android.os.Handler; import android.view.Menu; import android.view.MenuItem; import android.view.View; -import android.widget.Button; import android.widget.EditText; import android.widget.FrameLayout; import android.widget.ImageView; +import android.widget.LinearLayout; import android.widget.TextView; import androidx.annotation.NonNull; @@ -32,8 +31,10 @@ import com.bumptech.glide.request.transition.Transition; import com.davemorrissey.labs.subscaleview.ImageSource; import com.davemorrissey.labs.subscaleview.SubsamplingScaleImageView; import com.google.android.material.appbar.AppBarLayout; +import com.google.android.material.button.MaterialButton; import com.google.android.material.dialog.MaterialAlertDialogBuilder; import com.google.android.material.snackbar.Snackbar; +import com.google.android.material.switchmaterial.SwitchMaterial; import com.libRG.CustomTextView; import org.greenrobot.eventbus.EventBus; @@ -91,7 +92,7 @@ public class SubmitCrosspostActivity extends BaseActivity implements FlairBottom @BindView(R.id.subreddit_name_text_view_submit_crosspost_activity) TextView subredditNameTextView; @BindView(R.id.rules_button_submit_crosspost_activity) - Button rulesButton; + MaterialButton rulesButton; @BindView(R.id.divider_1_submit_crosspost_activity) View divider1; @BindView(R.id.flair_custom_text_view_submit_crosspost_activity) @@ -102,10 +103,18 @@ public class SubmitCrosspostActivity extends BaseActivity implements FlairBottom CustomTextView nsfwTextView; @BindView(R.id.divider_2_submit_crosspost_activity) View divider2; - @BindView(R.id.post_title_edit_text_submit_crosspost_activity) - EditText titleEditText; + @BindView(R.id.receive_post_reply_notifications_linear_layout_submit_crosspost_activity) + LinearLayout receivePostReplyNotificationsLinearLayout; + @BindView(R.id.receive_post_reply_notifications_text_view_submit_crosspost_activity) + TextView receivePostReplyNotificationsTextView; + @BindView(R.id.receive_post_reply_notifications_switch_material_submit_crosspost_activity) + SwitchMaterial receivePostReplyNotificationsSwitchMaterial; @BindView(R.id.divider_3_submit_crosspost_activity) View divider3; + @BindView(R.id.post_title_edit_text_submit_crosspost_activity) + EditText titleEditText; + @BindView(R.id.divider_4_submit_crosspost_activity) + View divider4; @BindView(R.id.post_content_text_view_submit_crosspost_activity) TextView contentTextView; @BindView(R.id.frame_layout_submit_crosspost_activity) @@ -360,6 +369,10 @@ public class SubmitCrosspostActivity extends BaseActivity implements FlairBottom isNSFW = false; } }); + + receivePostReplyNotificationsLinearLayout.setOnClickListener(view -> { + receivePostReplyNotificationsSwitchMaterial.performClick(); + }); } @Nullable @@ -389,12 +402,14 @@ public class SubmitCrosspostActivity extends BaseActivity implements FlairBottom int secondaryTextColor = mCustomThemeWrapper.getSecondaryTextColor(); subredditNameTextView.setTextColor(secondaryTextColor); rulesButton.setTextColor(mCustomThemeWrapper.getButtonTextColor()); - rulesButton.setBackgroundTintList(ColorStateList.valueOf(mCustomThemeWrapper.getColorPrimaryLightTheme())); + rulesButton.setBackgroundColor(mCustomThemeWrapper.getColorPrimaryLightTheme()); + primaryTextColor = mCustomThemeWrapper.getPrimaryTextColor(); + receivePostReplyNotificationsTextView.setTextColor(primaryTextColor); int dividerColor = mCustomThemeWrapper.getDividerColor(); divider1.setBackgroundColor(dividerColor); divider2.setBackgroundColor(dividerColor); divider3.setBackgroundColor(dividerColor); - primaryTextColor = mCustomThemeWrapper.getPrimaryTextColor(); + divider4.setBackgroundColor(dividerColor); flairBackgroundColor = mCustomThemeWrapper.getFlairBackgroundColor(); flairTextColor = mCustomThemeWrapper.getFlairTextColor(); spoilerBackgroundColor = mCustomThemeWrapper.getSpoilerBackgroundColor(); @@ -457,61 +472,62 @@ public class SubmitCrosspostActivity extends BaseActivity implements FlairBottom @Override public boolean onOptionsItemSelected(@NonNull MenuItem item) { - switch (item.getItemId()) { - case android.R.id.home: - if (isPosting) { - promptAlertDialog(R.string.exit_when_submit, R.string.exit_when_submit_post_detail); - return true; - } else { - if (!titleEditText.getText().toString().equals("")) { - promptAlertDialog(R.string.discard, R.string.discard_detail); - return true; - } - } - finish(); + int itemId = item.getItemId(); + if (itemId == android.R.id.home) { + if (isPosting) { + promptAlertDialog(R.string.exit_when_submit, R.string.exit_when_submit_post_detail); return true; - case R.id.action_send_submit_crosspost_activity: - if (!subredditSelected) { - Snackbar.make(coordinatorLayout, R.string.select_a_subreddit, Snackbar.LENGTH_SHORT).show(); - return true; - } - - if (titleEditText.getText() == null || titleEditText.getText().toString().equals("")) { - Snackbar.make(coordinatorLayout, R.string.title_required, Snackbar.LENGTH_SHORT).show(); + } else { + if (!titleEditText.getText().toString().equals("")) { + promptAlertDialog(R.string.discard, R.string.discard_detail); return true; } + } + finish(); + return true; + } else if (itemId == R.id.action_send_submit_crosspost_activity) { + if (!subredditSelected) { + Snackbar.make(coordinatorLayout, R.string.select_a_subreddit, Snackbar.LENGTH_SHORT).show(); + return true; + } - isPosting = true; + if (titleEditText.getText() == null || titleEditText.getText().toString().equals("")) { + Snackbar.make(coordinatorLayout, R.string.title_required, Snackbar.LENGTH_SHORT).show(); + return true; + } - item.setEnabled(false); - item.getIcon().setAlpha(130); + isPosting = true; - mPostingSnackbar.show(); + item.setEnabled(false); + item.getIcon().setAlpha(130); - String subredditName; - if (subredditIsUser) { - subredditName = "u_" + subredditNameTextView.getText().toString(); - } else { - subredditName = subredditNameTextView.getText().toString(); - } + mPostingSnackbar.show(); - Intent intent = new Intent(this, SubmitPostService.class); - intent.putExtra(SubmitPostService.EXTRA_ACCESS_TOKEN, mAccessToken); - intent.putExtra(SubmitPostService.EXTRA_SUBREDDIT_NAME, subredditName); - intent.putExtra(SubmitPostService.EXTRA_TITLE, titleEditText.getText().toString()); - if (post.isCrosspost()) { - intent.putExtra(SubmitPostService.EXTRA_CONTENT, "t3_" + post.getCrosspostParentId()); - } else { - intent.putExtra(SubmitPostService.EXTRA_CONTENT, post.getFullName()); - } - intent.putExtra(SubmitPostService.EXTRA_KIND, APIUtils.KIND_CROSSPOST); - intent.putExtra(SubmitPostService.EXTRA_FLAIR, flair); - intent.putExtra(SubmitPostService.EXTRA_IS_SPOILER, isSpoiler); - intent.putExtra(SubmitPostService.EXTRA_IS_NSFW, isNSFW); - intent.putExtra(SubmitPostService.EXTRA_POST_TYPE, SubmitPostService.EXTRA_POST_TYPE_CROSSPOST); - ContextCompat.startForegroundService(this, intent); + String subredditName; + if (subredditIsUser) { + subredditName = "u_" + subredditNameTextView.getText().toString(); + } else { + subredditName = subredditNameTextView.getText().toString(); + } - return true; + Intent intent = new Intent(this, SubmitPostService.class); + intent.putExtra(SubmitPostService.EXTRA_ACCESS_TOKEN, mAccessToken); + intent.putExtra(SubmitPostService.EXTRA_SUBREDDIT_NAME, subredditName); + intent.putExtra(SubmitPostService.EXTRA_TITLE, titleEditText.getText().toString()); + if (post.isCrosspost()) { + intent.putExtra(SubmitPostService.EXTRA_CONTENT, "t3_" + post.getCrosspostParentId()); + } else { + intent.putExtra(SubmitPostService.EXTRA_CONTENT, post.getFullName()); + } + intent.putExtra(SubmitPostService.EXTRA_KIND, APIUtils.KIND_CROSSPOST); + intent.putExtra(SubmitPostService.EXTRA_FLAIR, flair); + intent.putExtra(SubmitPostService.EXTRA_IS_SPOILER, isSpoiler); + intent.putExtra(SubmitPostService.EXTRA_IS_NSFW, isNSFW); + intent.putExtra(SubmitPostService.EXTRA_RECEIVE_POST_REPLY_NOTIFICATIONS, receivePostReplyNotificationsSwitchMaterial.isChecked()); + intent.putExtra(SubmitPostService.EXTRA_POST_TYPE, SubmitPostService.EXTRA_POST_TYPE_CROSSPOST); + ContextCompat.startForegroundService(this, intent); + + return true; } return false; @@ -588,7 +604,7 @@ public class SubmitCrosspostActivity extends BaseActivity implements FlairBottom } @Subscribe - public void onSubmitTextPostEvent(SubmitCrosspostEvent submitCrosspostEvent) { + public void onSubmitCrosspostEvent(SubmitCrosspostEvent submitCrosspostEvent) { isPosting = false; mPostingSnackbar.dismiss(); if (submitCrosspostEvent.postSuccess) { @@ -597,8 +613,8 @@ public class SubmitCrosspostActivity extends BaseActivity implements FlairBottom startActivity(intent); finish(); } else { - mMenu.findItem(R.id.action_send_post_text_activity).setEnabled(true); - mMenu.findItem(R.id.action_send_post_text_activity).getIcon().setAlpha(255); + mMenu.findItem(R.id.action_send_submit_crosspost_activity).setEnabled(true); + mMenu.findItem(R.id.action_send_submit_crosspost_activity).getIcon().setAlpha(255); if (submitCrosspostEvent.errorMessage == null || submitCrosspostEvent.errorMessage.equals("")) { Snackbar.make(coordinatorLayout, R.string.post_failed, Snackbar.LENGTH_SHORT).show(); } else { diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/SubredditMultiselectionActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/SubredditMultiselectionActivity.java index 69b83579..f2d00212 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/SubredditMultiselectionActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/SubredditMultiselectionActivity.java @@ -19,7 +19,6 @@ import androidx.annotation.Nullable; import androidx.appcompat.widget.Toolbar; import androidx.coordinatorlayout.widget.CoordinatorLayout; import androidx.lifecycle.ViewModelProvider; -import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; import androidx.swiperefreshlayout.widget.SwipeRefreshLayout; @@ -41,6 +40,7 @@ import ml.docilealligator.infinityforreddit.R; import ml.docilealligator.infinityforreddit.RedditDataRoomDatabase; import ml.docilealligator.infinityforreddit.adapters.SubredditMultiselectionRecyclerViewAdapter; import ml.docilealligator.infinityforreddit.customtheme.CustomThemeWrapper; +import ml.docilealligator.infinityforreddit.customviews.LinearLayoutManagerBugFixed; import ml.docilealligator.infinityforreddit.subscribedsubreddit.SubscribedSubredditViewModel; import ml.docilealligator.infinityforreddit.utils.SharedPreferencesUtils; import retrofit2.Retrofit; @@ -83,7 +83,7 @@ public class SubredditMultiselectionActivity extends BaseActivity implements Act public SubscribedSubredditViewModel mSubscribedSubredditViewModel; private String mAccessToken; private String mAccountName; - private LinearLayoutManager mLinearLayoutManager; + private LinearLayoutManagerBugFixed mLinearLayoutManager; private SubredditMultiselectionRecyclerViewAdapter mAdapter; private RequestManager mGlide; @@ -142,7 +142,7 @@ public class SubredditMultiselectionActivity extends BaseActivity implements Act } private void bindView() { - mLinearLayoutManager = new LinearLayoutManager(this); + mLinearLayoutManager = new LinearLayoutManagerBugFixed(this); mRecyclerView.setLayoutManager(mLinearLayoutManager); mAdapter = new SubredditMultiselectionRecyclerViewAdapter(this, mCustomThemeWrapper); mRecyclerView.setAdapter(mAdapter); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/SubscribedThingListingActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/SubscribedThingListingActivity.java index e5b2e225..0d33b2a8 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/SubscribedThingListingActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/SubscribedThingListingActivity.java @@ -47,6 +47,7 @@ import ml.docilealligator.infinityforreddit.RedditDataRoomDatabase; import ml.docilealligator.infinityforreddit.asynctasks.InsertMultireddit; import ml.docilealligator.infinityforreddit.asynctasks.InsertSubscribedThings; import ml.docilealligator.infinityforreddit.customtheme.CustomThemeWrapper; +import ml.docilealligator.infinityforreddit.customviews.ViewPagerBugFixed; import ml.docilealligator.infinityforreddit.events.GoBackToMainPageEvent; import ml.docilealligator.infinityforreddit.events.RefreshMultiRedditsEvent; import ml.docilealligator.infinityforreddit.events.SwitchAccountEvent; @@ -77,7 +78,7 @@ public class SubscribedThingListingActivity extends BaseActivity implements Acti @BindView(R.id.tab_layout_subscribed_thing_listing_activity) TabLayout tabLayout; @BindView(R.id.view_pager_subscribed_thing_listing_activity) - ViewPager viewPager; + ViewPagerBugFixed viewPager; @BindView(R.id.fab_subscribed_thing_listing_activity) FloatingActionButton fab; @Inject @@ -211,7 +212,7 @@ public class SubscribedThingListingActivity extends BaseActivity implements Acti tabLayout.setupWithViewPager(viewPager); if (showMultiReddits) { - viewPager.setCurrentItem(2); + viewPager.setCurrentItem(2, false); } loadSubscriptions(false); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/TrendingActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/TrendingActivity.java new file mode 100644 index 00000000..ca1a5887 --- /dev/null +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/TrendingActivity.java @@ -0,0 +1,328 @@ +package ml.docilealligator.infinityforreddit.activities; + +import android.content.Intent; +import android.content.SharedPreferences; +import android.os.Build; +import android.os.Bundle; +import android.os.Handler; +import android.util.DisplayMetrics; +import android.view.Menu; +import android.view.MenuItem; +import android.view.View; +import android.view.Window; +import android.view.WindowManager; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.TextView; + +import androidx.annotation.NonNull; +import androidx.appcompat.widget.Toolbar; +import androidx.coordinatorlayout.widget.CoordinatorLayout; +import androidx.recyclerview.widget.RecyclerView; +import androidx.swiperefreshlayout.widget.SwipeRefreshLayout; + +import com.bumptech.glide.Glide; +import com.google.android.material.appbar.AppBarLayout; +import com.google.android.material.appbar.CollapsingToolbarLayout; +import com.r0adkll.slidr.Slidr; + +import org.greenrobot.eventbus.EventBus; +import org.greenrobot.eventbus.Subscribe; +import org.json.JSONArray; +import org.json.JSONException; +import org.json.JSONObject; + +import java.util.ArrayList; +import java.util.concurrent.Executor; + +import javax.inject.Inject; +import javax.inject.Named; + +import butterknife.BindView; +import butterknife.ButterKnife; +import ml.docilealligator.infinityforreddit.Infinity; +import ml.docilealligator.infinityforreddit.R; +import ml.docilealligator.infinityforreddit.TrendingSearch; +import ml.docilealligator.infinityforreddit.adapters.TrendingSearchRecyclerViewAdapter; +import ml.docilealligator.infinityforreddit.apis.RedditAPI; +import ml.docilealligator.infinityforreddit.customtheme.CustomThemeWrapper; +import ml.docilealligator.infinityforreddit.events.SwitchAccountEvent; +import ml.docilealligator.infinityforreddit.post.ParsePost; +import ml.docilealligator.infinityforreddit.post.Post; +import ml.docilealligator.infinityforreddit.utils.APIUtils; +import ml.docilealligator.infinityforreddit.utils.JSONUtils; +import ml.docilealligator.infinityforreddit.utils.SharedPreferencesUtils; +import ml.docilealligator.infinityforreddit.utils.Utils; +import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; +import retrofit2.Retrofit; + +public class TrendingActivity extends BaseActivity { + + private static final String TRENDING_SEARCHES_STATE = "TSS"; + + @BindView(R.id.coordinator_layout_trending_activity) + CoordinatorLayout coordinatorLayout; + @BindView(R.id.collapsing_toolbar_layout_trending_activity) + CollapsingToolbarLayout collapsingToolbarLayout; + @BindView(R.id.appbar_layout_trending_activity) + AppBarLayout appBarLayout; + @BindView(R.id.toolbar_trending_activity) + Toolbar toolbar; + @BindView(R.id.swipe_refresh_layout_trending_activity) + SwipeRefreshLayout swipeRefreshLayout; + @BindView(R.id.recycler_view_trending_activity) + RecyclerView recyclerView; + @BindView(R.id.fetch_trending_search_linear_layout_trending_activity) + LinearLayout errorLinearLayout; + @BindView(R.id.fetch_trending_search_image_view_trending_activity) + ImageView errorImageView; + @BindView(R.id.fetch_trending_search_text_view_trending_activity) + TextView errorTextView; + @Inject + @Named("oauth") + Retrofit mOauthRetrofit; + @Inject + @Named("default") + SharedPreferences mSharedPreferences; + @Inject + @Named("post_layout") + SharedPreferences mPostLayoutSharedPreferences; + @Inject + @Named("current_account") + SharedPreferences mCurrentAccountSharedPreferences; + @Inject + CustomThemeWrapper mCustomThemeWrapper; + @Inject + Executor mExecutor; + private String mAccessToken; + private String mAccountName; + private boolean isRefreshing = false; + private ArrayList<TrendingSearch> trendingSearches; + private TrendingSearchRecyclerViewAdapter adapter; + + @Override + protected void onCreate(Bundle savedInstanceState) { + ((Infinity) getApplication()).getAppComponent().inject(this); + + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_trending); + + ButterKnife.bind(this); + + EventBus.getDefault().register(this); + + applyCustomTheme(); + + if (mSharedPreferences.getBoolean(SharedPreferencesUtils.SWIPE_RIGHT_TO_GO_BACK, true)) { + Slidr.attach(this); + } + + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { + Window window = getWindow(); + + if (isChangeStatusBarIconColor()) { + addOnOffsetChangedListener(appBarLayout); + } + + if (isImmersiveInterface()) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) { + coordinatorLayout.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE | + View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | + View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION); + } else { + window.setFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS, WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS); + } + adjustToolbar(toolbar); + + int navBarResourceId = getResources().getIdentifier("navigation_bar_height", "dimen", "android"); + if (navBarResourceId > 0) { + recyclerView.setPadding(0, 0, 0, recyclerView.getPaddingBottom() + getResources().getDimensionPixelSize(navBarResourceId)); + } + } + } + + setSupportActionBar(toolbar); + getSupportActionBar().setDisplayHomeAsUpEnabled(true); + setToolbarGoToTop(toolbar); + + mAccessToken = mCurrentAccountSharedPreferences.getString(SharedPreferencesUtils.ACCESS_TOKEN, null); + mAccountName = mCurrentAccountSharedPreferences.getString(SharedPreferencesUtils.ACCOUNT_NAME, null); + + DisplayMetrics displayMetrics = new DisplayMetrics(); + getWindowManager().getDefaultDisplay().getMetrics(displayMetrics); + int windowWidth = displayMetrics.widthPixels; + + String dataSavingModeString = mSharedPreferences.getString(SharedPreferencesUtils.DATA_SAVING_MODE, SharedPreferencesUtils.DATA_SAVING_MODE_OFF); + boolean dataSavingMode = false; + if (dataSavingModeString.equals(SharedPreferencesUtils.DATA_SAVING_MODE_ALWAYS)) { + dataSavingMode = true; + } else if (dataSavingModeString.equals(SharedPreferencesUtils.DATA_SAVING_MODE_ONLY_ON_CELLULAR_DATA)) { + int networkType = Utils.getConnectedNetwork(this); + dataSavingMode = networkType == Utils.NETWORK_TYPE_CELLULAR; + } + boolean disableImagePreview = mSharedPreferences.getBoolean(SharedPreferencesUtils.DISABLE_IMAGE_PREVIEW, false); + adapter = new TrendingSearchRecyclerViewAdapter(this, mCustomThemeWrapper, windowWidth, + dataSavingMode, disableImagePreview, new TrendingSearchRecyclerViewAdapter.ItemClickListener() { + @Override + public void onClick(TrendingSearch trendingSearch) { + Intent intent = new Intent(TrendingActivity.this, SearchResultActivity.class); + intent.putExtra(SearchResultActivity.EXTRA_QUERY, trendingSearch.queryString); + intent.putExtra(SearchResultActivity.EXTRA_TRENDING_SOURCE, "trending"); + startActivity(intent); + } + }); + recyclerView.setAdapter(adapter); + + swipeRefreshLayout.setEnabled(mSharedPreferences.getBoolean(SharedPreferencesUtils.PULL_TO_REFRESH, true)); + swipeRefreshLayout.setOnRefreshListener(this::fetchTrendingSearches); + + if (savedInstanceState != null) { + trendingSearches = savedInstanceState.getParcelableArrayList(TRENDING_SEARCHES_STATE); + } + if (trendingSearches != null) { + adapter.setTrendingSearches(trendingSearches); + } else { + fetchTrendingSearches(); + } + } + + private void fetchTrendingSearches() { + if (isRefreshing) { + return; + } + isRefreshing = true; + + errorLinearLayout.setVisibility(View.GONE); + Glide.with(this).clear(errorImageView); + swipeRefreshLayout.setRefreshing(true); + trendingSearches = null; + adapter.setTrendingSearches(null); + Handler handler = new Handler(); + mOauthRetrofit.create(RedditAPI.class).getTrendingSearches(APIUtils.getOAuthHeader(mAccessToken)).enqueue(new Callback<String>() { + @Override + public void onResponse(@NonNull Call<String> call, @NonNull Response<String> response) { + if (response.isSuccessful()) { + mExecutor.execute(() -> { + try { + JSONArray trendingSearchesArray = new JSONObject(response.body()).getJSONArray(JSONUtils.TRENDING_SEARCHES_KEY); + ArrayList<TrendingSearch> trendingSearchList = new ArrayList<>(); + for (int i = 0; i < trendingSearchesArray.length(); i++) { + try { + JSONObject trendingSearchObject = trendingSearchesArray.getJSONObject(i); + String queryString = trendingSearchObject.getString(JSONUtils.QUERY_STRING_KEY); + String displayString = trendingSearchObject.getString(JSONUtils.DISPLAY_STRING_KEY); + JSONArray childrenWithOnlyOneChild = trendingSearchObject + .getJSONObject(JSONUtils.RESULTS_KEY) + .getJSONObject(JSONUtils.DATA_KEY) + .getJSONArray(JSONUtils.CHILDREN_KEY); + if (childrenWithOnlyOneChild.length() > 0) { + Post post = ParsePost.parseBasicData(childrenWithOnlyOneChild.getJSONObject(0) + .getJSONObject(JSONUtils.DATA_KEY)); + + trendingSearchList.add(new TrendingSearch(queryString, displayString, + post.getTitle(), post.getPreviews())); + } + } catch (JSONException e) { + e.printStackTrace(); + } + } + + handler.post(() -> { + trendingSearches = trendingSearchList; + swipeRefreshLayout.setRefreshing(false); + adapter.setTrendingSearches(trendingSearches); + isRefreshing = false; + }); + } catch (JSONException e) { + e.printStackTrace(); + handler.post(() -> { + swipeRefreshLayout.setRefreshing(false); + showErrorView(R.string.error_parse_trending_search); + isRefreshing = false; + }); + } + }); + } else { + handler.post(() -> { + swipeRefreshLayout.setRefreshing(false); + showErrorView(R.string.error_fetch_trending_search); + isRefreshing = false; + }); + } + } + + @Override + public void onFailure(@NonNull Call<String> call, @NonNull Throwable t) { + handler.post(() -> { + swipeRefreshLayout.setRefreshing(false); + showErrorView(R.string.error_fetch_trending_search); + isRefreshing = false; + }); + } + }); + } + + private void showErrorView(int stringId) { + errorLinearLayout.setVisibility(View.VISIBLE); + Glide.with(this).load(R.drawable.error_image).into(errorImageView); + errorTextView.setText(stringId); + } + + @Override + public boolean onCreateOptionsMenu(Menu menu) { + getMenuInflater().inflate(R.menu.trending_activity, menu); + applyMenuItemTheme(menu); + return true; + } + + @Override + public boolean onOptionsItemSelected(@NonNull MenuItem item) { + if (item.getItemId() == android.R.id.home) { + finish(); + return true; + } else if (item.getItemId() == R.id.action_refresh_trending_activity) { + fetchTrendingSearches(); + return true; + } + + return false; + } + + @Override + protected void onSaveInstanceState(@NonNull Bundle outState) { + super.onSaveInstanceState(outState); + outState.putParcelableArrayList(TRENDING_SEARCHES_STATE, trendingSearches); + } + + @Override + protected void onDestroy() { + super.onDestroy(); + EventBus.getDefault().unregister(this); + } + + @Override + protected SharedPreferences getDefaultSharedPreferences() { + return mSharedPreferences; + } + + @Override + protected CustomThemeWrapper getCustomThemeWrapper() { + return mCustomThemeWrapper; + } + + @Override + protected void applyCustomTheme() { + coordinatorLayout.setBackgroundColor(mCustomThemeWrapper.getBackgroundColor()); + applyAppBarLayoutAndToolbarTheme(appBarLayout, toolbar); + swipeRefreshLayout.setProgressBackgroundColorSchemeColor(mCustomThemeWrapper.getCircularProgressBarBackground()); + swipeRefreshLayout.setColorSchemeColors(mCustomThemeWrapper.getColorAccent()); + errorTextView.setTextColor(mCustomThemeWrapper.getSecondaryTextColor()); + } + + @Subscribe + public void onAccountSwitchEvent(SwitchAccountEvent event) { + finish(); + } +}
\ No newline at end of file diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewImageOrGifActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewImageOrGifActivity.java index 3988d3c8..9602da8b 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewImageOrGifActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewImageOrGifActivity.java @@ -12,11 +12,14 @@ import android.os.Build; import android.os.Bundle; import android.os.Handler; import android.text.Html; +import android.text.Spanned; import android.view.Menu; import android.view.MenuItem; import android.view.View; +import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.ProgressBar; +import android.widget.TextView; import android.widget.Toast; import androidx.annotation.NonNull; @@ -42,6 +45,7 @@ import com.github.piasy.biv.loader.ImageLoader; import com.github.piasy.biv.loader.glide.GlideImageLoader; import com.github.piasy.biv.view.BigImageView; import com.github.piasy.biv.view.GlideImageViewFactory; +import com.google.android.material.bottomappbar.BottomAppBar; import com.r0adkll.slidr.Slidr; import com.r0adkll.slidr.model.SlidrConfig; import com.r0adkll.slidr.model.SlidrPosition; @@ -85,6 +89,16 @@ public class ViewImageOrGifActivity extends AppCompatActivity implements SetAsWa BigImageView mImageView; @BindView(R.id.load_image_error_linear_layout_view_image_or_gif_activity) LinearLayout mLoadErrorLinearLayout; + @BindView(R.id.bottom_navigation_view_image_or_gif_activity) + BottomAppBar bottomAppBar; + @BindView(R.id.title_text_view_view_image_or_gif_activity) + TextView titleTextView; + @BindView(R.id.download_image_view_view_image_or_gif_activity) + ImageView downloadImageView; + @BindView(R.id.share_image_view_view_image_or_gif_activity) + ImageView shareImageView; + @BindView(R.id.wallpaper_image_view_view_image_or_gif_activity) + ImageView wallpaperImageView; @Inject @Named("default") SharedPreferences mSharedPreferences; @@ -130,11 +144,6 @@ public class ViewImageOrGifActivity extends AppCompatActivity implements SetAsWa ButterKnife.bind(this); - ActionBar actionBar = getSupportActionBar(); - Drawable upArrow = getResources().getDrawable(R.drawable.ic_arrow_back_white_24dp); - actionBar.setHomeAsUpIndicator(upArrow); - actionBar.setBackgroundDrawable(new ColorDrawable(getResources().getColor(R.color.transparentActionBarAndExoPlayerControllerColor))); - if (mSharedPreferences.getBoolean(SharedPreferencesUtils.SWIPE_VERTICALLY_TO_GO_BACK_FROM_MEDIA, true)) { Slidr.attach(this, new SlidrConfig.Builder().position(SlidrPosition.VERTICAL).distanceThreshold(0.125f).build()); } @@ -151,10 +160,44 @@ public class ViewImageOrGifActivity extends AppCompatActivity implements SetAsWa String postTitle = intent.getStringExtra(EXTRA_POST_TITLE_KEY); mSubredditName = intent.getStringExtra(EXTRA_SUBREDDIT_OR_USERNAME_KEY); + boolean useBottomAppBar = mSharedPreferences.getBoolean(SharedPreferencesUtils.USE_BOTTOM_TOOLBAR_IN_MEDIA_VIEWER, false); if (postTitle != null) { - setTitle(Html.fromHtml(String.format("<small>%s</small>", postTitle))); + Spanned title = Html.fromHtml(String.format("<small>%s</small>", postTitle)); + if (useBottomAppBar) { + titleTextView.setText(title); + } else { + setTitle(title); + } } else { - setTitle(""); + if (!useBottomAppBar) { + setTitle(""); + } + } + + if (useBottomAppBar) { + getSupportActionBar().hide(); + bottomAppBar.setVisibility(View.VISIBLE); + downloadImageView.setOnClickListener(view -> { + if (isDownloading) { + return; + } + isDownloading = true; + requestPermissionAndDownload(); + }); + shareImageView.setOnClickListener(view -> { + if (isGif) + shareGif(); + else + shareImage(); + }); + wallpaperImageView.setOnClickListener(view -> { + setWallpaper(); + }); + } else { + ActionBar actionBar = getSupportActionBar(); + Drawable upArrow = getResources().getDrawable(R.drawable.ic_arrow_back_white_24dp); + actionBar.setHomeAsUpIndicator(upArrow); + actionBar.setBackgroundDrawable(new ColorDrawable(getResources().getColor(R.color.transparentActionBarAndExoPlayerControllerColor))); } mLoadErrorLinearLayout.setOnClickListener(view -> { @@ -170,6 +213,9 @@ public class ViewImageOrGifActivity extends AppCompatActivity implements SetAsWa | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN); isActionBarHidden = false; + if (useBottomAppBar) { + bottomAppBar.setVisibility(View.VISIBLE); + } } else { getWindow().getDecorView().setSystemUiVisibility( View.SYSTEM_UI_FLAG_LAYOUT_STABLE @@ -179,6 +225,9 @@ public class ViewImageOrGifActivity extends AppCompatActivity implements SetAsWa | View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_IMMERSIVE); isActionBarHidden = true; + if (useBottomAppBar) { + bottomAppBar.setVisibility(View.GONE); + } } }); @@ -287,26 +336,8 @@ public class ViewImageOrGifActivity extends AppCompatActivity implements SetAsWa if (isDownloading) { return false; } - isDownloading = true; - - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { - if (ContextCompat.checkSelfPermission(this, - Manifest.permission.WRITE_EXTERNAL_STORAGE) - != PackageManager.PERMISSION_GRANTED) { - - // Permission is not granted - // No explanation needed; request the permission - ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, - PERMISSION_REQUEST_WRITE_EXTERNAL_STORAGE); - } else { - // Permission has already been granted - download(); - } - } else { - download(); - } - + requestPermissionAndDownload(); return true; } else if (itemId == R.id.action_share_view_image_or_gif_activity) { if (isGif) @@ -315,31 +346,32 @@ public class ViewImageOrGifActivity extends AppCompatActivity implements SetAsWa shareImage(); return true; } else if (itemId == R.id.action_set_wallpaper_view_image_or_gif_activity) { - if (!isGif) { - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { - SetAsWallpaperBottomSheetFragment setAsWallpaperBottomSheetFragment = new SetAsWallpaperBottomSheetFragment(); - setAsWallpaperBottomSheetFragment.show(getSupportFragmentManager(), setAsWallpaperBottomSheetFragment.getTag()); - } else { - WallpaperSetter.set(mExecutor, new Handler(), mImageUrl, WallpaperSetter.BOTH_SCREENS, this, - new WallpaperSetter.SetWallpaperListener() { - @Override - public void success() { - Toast.makeText(ViewImageOrGifActivity.this, R.string.wallpaper_set, Toast.LENGTH_SHORT).show(); - } - - @Override - public void failed() { - Toast.makeText(ViewImageOrGifActivity.this, R.string.error_set_wallpaper, Toast.LENGTH_SHORT).show(); - } - }); - } - } + setWallpaper(); return true; } return false; } + private void requestPermissionAndDownload() { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && Build.VERSION.SDK_INT < Build.VERSION_CODES.Q) { + if (ContextCompat.checkSelfPermission(this, + Manifest.permission.WRITE_EXTERNAL_STORAGE) + != PackageManager.PERMISSION_GRANTED) { + + // Permission is not granted + // No explanation needed; request the permission + ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, + PERMISSION_REQUEST_WRITE_EXTERNAL_STORAGE); + } else { + // Permission has already been granted + download(); + } + } else { + download(); + } + } + private void download() { isDownloading = false; @@ -433,6 +465,28 @@ public class ViewImageOrGifActivity extends AppCompatActivity implements SetAsWa }).submit(); } + private void setWallpaper() { + if (!isGif) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { + SetAsWallpaperBottomSheetFragment setAsWallpaperBottomSheetFragment = new SetAsWallpaperBottomSheetFragment(); + setAsWallpaperBottomSheetFragment.show(getSupportFragmentManager(), setAsWallpaperBottomSheetFragment.getTag()); + } else { + WallpaperSetter.set(mExecutor, new Handler(), mImageUrl, WallpaperSetter.BOTH_SCREENS, this, + new WallpaperSetter.SetWallpaperListener() { + @Override + public void success() { + Toast.makeText(ViewImageOrGifActivity.this, R.string.wallpaper_set, Toast.LENGTH_SHORT).show(); + } + + @Override + public void failed() { + Toast.makeText(ViewImageOrGifActivity.this, R.string.error_set_wallpaper, Toast.LENGTH_SHORT).show(); + } + }); + } + } + } + @Override public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) { if (requestCode == PERMISSION_REQUEST_WRITE_EXTERNAL_STORAGE && grantResults.length > 0) { diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewImgurMediaActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewImgurMediaActivity.java index c16cef7d..8aab0011 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewImgurMediaActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewImgurMediaActivity.java @@ -36,7 +36,13 @@ import javax.inject.Named; import butterknife.BindView; import butterknife.ButterKnife; +import ml.docilealligator.infinityforreddit.ImgurMedia; +import ml.docilealligator.infinityforreddit.Infinity; +import ml.docilealligator.infinityforreddit.R; +import ml.docilealligator.infinityforreddit.SetAsWallpaperCallback; +import ml.docilealligator.infinityforreddit.WallpaperSetter; import ml.docilealligator.infinityforreddit.apis.ImgurAPI; +import ml.docilealligator.infinityforreddit.customviews.ViewPagerBugFixed; import ml.docilealligator.infinityforreddit.font.ContentFontFamily; import ml.docilealligator.infinityforreddit.font.ContentFontStyle; import ml.docilealligator.infinityforreddit.font.FontFamily; @@ -45,14 +51,9 @@ import ml.docilealligator.infinityforreddit.font.TitleFontFamily; import ml.docilealligator.infinityforreddit.font.TitleFontStyle; import ml.docilealligator.infinityforreddit.fragments.ViewImgurImageFragment; import ml.docilealligator.infinityforreddit.fragments.ViewImgurVideoFragment; -import ml.docilealligator.infinityforreddit.ImgurMedia; -import ml.docilealligator.infinityforreddit.Infinity; -import ml.docilealligator.infinityforreddit.R; -import ml.docilealligator.infinityforreddit.SetAsWallpaperCallback; import ml.docilealligator.infinityforreddit.utils.APIUtils; import ml.docilealligator.infinityforreddit.utils.JSONUtils; import ml.docilealligator.infinityforreddit.utils.SharedPreferencesUtils; -import ml.docilealligator.infinityforreddit.WallpaperSetter; import retrofit2.Call; import retrofit2.Callback; import retrofit2.Response; @@ -72,11 +73,12 @@ public class ViewImgurMediaActivity extends AppCompatActivity implements SetAsWa @BindView(R.id.progress_bar_view_imgur_media_activity) ProgressBar progressBar; @BindView(R.id.view_pager_view_imgur_media_activity) - ViewPager viewPager; + ViewPagerBugFixed viewPager; @BindView(R.id.load_image_error_linear_layout_view_imgur_media_activity) LinearLayout errorLinearLayout; private SectionsPagerAdapter sectionsPagerAdapter; private ArrayList<ImgurMedia> images; + private boolean useBottomAppBar; @Inject @Named("imgur") Retrofit imgurRetrofit; @@ -116,12 +118,17 @@ public class ViewImgurMediaActivity extends AppCompatActivity implements SetAsWa ButterKnife.bind(this); - ActionBar actionBar = getSupportActionBar(); - Drawable upArrow = getResources().getDrawable(R.drawable.ic_arrow_back_white_24dp); - actionBar.setHomeAsUpIndicator(upArrow); - actionBar.setBackgroundDrawable(new ColorDrawable(getResources().getColor(R.color.transparentActionBarAndExoPlayerControllerColor))); + useBottomAppBar = sharedPreferences.getBoolean(SharedPreferencesUtils.USE_BOTTOM_TOOLBAR_IN_MEDIA_VIEWER, false); - setTitle(" "); + if (!useBottomAppBar) { + ActionBar actionBar = getSupportActionBar(); + Drawable upArrow = getResources().getDrawable(R.drawable.ic_arrow_back_white_24dp); + actionBar.setHomeAsUpIndicator(upArrow); + actionBar.setBackgroundDrawable(new ColorDrawable(getResources().getColor(R.color.transparentActionBarAndExoPlayerControllerColor))); + setTitle(" "); + } else { + getSupportActionBar().hide(); + } String imgurId = getIntent().getStringExtra(EXTRA_IMGUR_ID); if (imgurId == null) { @@ -153,6 +160,10 @@ public class ViewImgurMediaActivity extends AppCompatActivity implements SetAsWa errorLinearLayout.setOnClickListener(view -> fetchImgurMedia(imgurId)); } + public boolean isUseBottomAppBar() { + return useBottomAppBar; + } + private void fetchImgurMedia(String imgurId) { errorLinearLayout.setVisibility(View.GONE); progressBar.setVisibility(View.VISIBLE); @@ -264,15 +275,18 @@ public class ViewImgurMediaActivity extends AppCompatActivity implements SetAsWa } private void setupViewPager() { - setToolbarTitle(0); + if (!useBottomAppBar) { + setToolbarTitle(0); + viewPager.addOnPageChangeListener(new ViewPager.SimpleOnPageChangeListener() { + @Override + public void onPageSelected(int position) { + setToolbarTitle(position); + } + }); + } sectionsPagerAdapter = new SectionsPagerAdapter(getSupportFragmentManager()); - viewPager.addOnPageChangeListener(new ViewPager.SimpleOnPageChangeListener() { - @Override - public void onPageSelected(int position) { - setToolbarTitle(position); - } - }); viewPager.setAdapter(sectionsPagerAdapter); + viewPager.setOffscreenPageLimit(3); } private void setToolbarTitle(int position) { @@ -378,12 +392,16 @@ public class ViewImgurMediaActivity extends AppCompatActivity implements SetAsWa ViewImgurVideoFragment fragment = new ViewImgurVideoFragment(); Bundle bundle = new Bundle(); bundle.putParcelable(ViewImgurVideoFragment.EXTRA_IMGUR_VIDEO, imgurMedia); + bundle.putInt(ViewImgurVideoFragment.EXTRA_INDEX, position); + bundle.putInt(ViewImgurVideoFragment.EXTRA_MEDIA_COUNT, images.size()); fragment.setArguments(bundle); return fragment; } else { ViewImgurImageFragment fragment = new ViewImgurImageFragment(); Bundle bundle = new Bundle(); bundle.putParcelable(ViewImgurImageFragment.EXTRA_IMGUR_IMAGES, imgurMedia); + bundle.putInt(ViewImgurImageFragment.EXTRA_INDEX, position); + bundle.putInt(ViewImgurImageFragment.EXTRA_MEDIA_COUNT, images.size()); fragment.setArguments(bundle); return fragment; } diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewPostDetailActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewPostDetailActivity.java index 34fbc55a..ae3538b1 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewPostDetailActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewPostDetailActivity.java @@ -1,8 +1,11 @@ package ml.docilealligator.infinityforreddit.activities; +import static ml.docilealligator.infinityforreddit.activities.CommentActivity.RETURN_EXTRA_COMMENT_DATA_KEY; + import android.app.Activity; import android.content.Intent; import android.content.SharedPreferences; +import android.content.res.ColorStateList; import android.os.Build; import android.os.Bundle; import android.os.Handler; @@ -11,6 +14,7 @@ import android.view.MenuItem; import android.view.View; import android.view.Window; import android.view.WindowManager; +import android.widget.ImageView; import android.widget.Toast; import androidx.annotation.NonNull; @@ -27,8 +31,11 @@ import com.evernote.android.state.State; import com.github.piasy.biv.BigImageViewer; import com.github.piasy.biv.loader.glide.GlideImageLoader; import com.google.android.material.appbar.AppBarLayout; +import com.google.android.material.card.MaterialCardView; import com.google.android.material.floatingactionbutton.FloatingActionButton; import com.google.android.material.snackbar.Snackbar; +import com.google.android.material.textfield.TextInputEditText; +import com.google.android.material.textfield.TextInputLayout; import com.livefront.bridge.Bridge; import com.r0adkll.slidr.Slidr; import com.r0adkll.slidr.model.SlidrInterface; @@ -62,8 +69,6 @@ import ml.docilealligator.infinityforreddit.post.Post; import ml.docilealligator.infinityforreddit.utils.SharedPreferencesUtils; import retrofit2.Retrofit; -import static ml.docilealligator.infinityforreddit.activities.CommentActivity.RETURN_EXTRA_COMMENT_DATA_KEY; - public class ViewPostDetailActivity extends BaseActivity implements SortTypeSelectionCallback, ActivityToolbarInterface { public static final String EXTRA_POST_DATA = "EPD"; @@ -89,6 +94,18 @@ public class ViewPostDetailActivity extends BaseActivity implements SortTypeSele ViewPager2 viewPager2; @BindView(R.id.fab_view_post_detail_activity) FloatingActionButton fab; + @BindView(R.id.search_panel_material_card_view_view_post_detail_activity) + MaterialCardView searchPanelMaterialCardView; + @BindView(R.id.search_text_input_layout_view_post_detail_activity) + TextInputLayout searchTextInputLayout; + @BindView(R.id.search_text_input_edit_text_view_post_detail_activity) + TextInputEditText searchTextInputEditText; + @BindView(R.id.previous_result_image_view_view_post_detail_activity) + ImageView previousResultImageView; + @BindView(R.id.next_result_image_view_view_post_detail_activity) + ImageView nextResultImageView; + @BindView(R.id.close_search_panel_image_view_view_post_detail_activity) + ImageView closeSearchPanelImageView; @Inject @Named("oauth") Retrofit mOauthRetrofit; @@ -160,6 +177,11 @@ public class ViewPostDetailActivity extends BaseActivity implements SortTypeSele CoordinatorLayout.LayoutParams params = (CoordinatorLayout.LayoutParams) fab.getLayoutParams(); params.bottomMargin += navBarHeight; fab.setLayoutParams(params); + + searchPanelMaterialCardView.setContentPadding(searchPanelMaterialCardView.getPaddingStart(), + searchPanelMaterialCardView.getPaddingTop(), + searchPanelMaterialCardView.getPaddingEnd(), + searchPanelMaterialCardView.getPaddingBottom() + navBarHeight); } } } @@ -256,6 +278,14 @@ public class ViewPostDetailActivity extends BaseActivity implements SortTypeSele mCoordinatorLayout.setBackgroundColor(mCustomThemeWrapper.getBackgroundColor()); applyAppBarLayoutAndToolbarTheme(mAppBarLayout, mToolbar); applyFABTheme(fab); + searchPanelMaterialCardView.setBackgroundTintList(ColorStateList.valueOf(mCustomThemeWrapper.getColorPrimary())); + int searchPanelTextAndIconColor = mCustomThemeWrapper.getToolbarPrimaryTextAndIconColor(); + searchTextInputLayout.setBoxStrokeColor(searchPanelTextAndIconColor); + searchTextInputLayout.setDefaultHintTextColor(ColorStateList.valueOf(searchPanelTextAndIconColor)); + searchTextInputEditText.setTextColor(searchPanelTextAndIconColor); + previousResultImageView.setColorFilter(searchPanelTextAndIconColor, android.graphics.PorterDuff.Mode.SRC_IN); + nextResultImageView.setColorFilter(searchPanelTextAndIconColor, android.graphics.PorterDuff.Mode.SRC_IN); + closeSearchPanelImageView.setColorFilter(searchPanelTextAndIconColor, android.graphics.PorterDuff.Mode.SRC_IN); } private void checkNewAccountAndBindView(Bundle savedInstanceState) { @@ -284,6 +314,31 @@ public class ViewPostDetailActivity extends BaseActivity implements SortTypeSele if (savedInstanceState == null) { viewPager2.setCurrentItem(getIntent().getIntExtra(EXTRA_POST_LIST_POSITION, 0), false); } + + searchPanelMaterialCardView.setOnClickListener(null); + + nextResultImageView.setOnClickListener(view -> { + ViewPostDetailFragment fragment = sectionsPagerAdapter.getCurrentFragment(); + if (fragment != null) { + searchComment(fragment, true); + } + }); + + previousResultImageView.setOnClickListener(view -> { + ViewPostDetailFragment fragment = sectionsPagerAdapter.getCurrentFragment(); + if (fragment != null) { + searchComment(fragment, false); + } + }); + + closeSearchPanelImageView.setOnClickListener(view -> { + ViewPostDetailFragment fragment = sectionsPagerAdapter.getCurrentFragment(); + if (fragment != null) { + fragment.resetSearchCommentIndex(); + } + + searchPanelMaterialCardView.setVisibility(View.GONE); + }); } public boolean isNsfwSubreddit() { @@ -372,6 +427,23 @@ public class ViewPostDetailActivity extends BaseActivity implements SortTypeSele } } + public boolean toggleSearchPanelVisibility() { + if (searchPanelMaterialCardView.getVisibility() == View.GONE) { + searchPanelMaterialCardView.setVisibility(View.VISIBLE); + return false; + } else { + searchPanelMaterialCardView.setVisibility(View.GONE); + searchTextInputEditText.setText(""); + return true; + } + } + + public void searchComment(ViewPostDetailFragment fragment, boolean searchNextComment) { + if (!searchTextInputEditText.getText().toString().isEmpty()) { + fragment.searchComment(searchTextInputEditText.getText().toString(), searchNextComment); + } + } + @Subscribe public void onAccountSwitchEvent(SwitchAccountEvent event) { if (!getClass().getName().equals(event.excludeActivityClassName)) { diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewPrivateMessagesActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewPrivateMessagesActivity.java index b7f914b9..ad09e76e 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewPrivateMessagesActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewPrivateMessagesActivity.java @@ -14,7 +14,6 @@ import android.widget.LinearLayout; import androidx.annotation.NonNull; import androidx.appcompat.widget.Toolbar; import androidx.coordinatorlayout.widget.CoordinatorLayout; -import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; import androidx.transition.AutoTransition; import androidx.transition.TransitionManager; @@ -39,6 +38,7 @@ import ml.docilealligator.infinityforreddit.RedditDataRoomDatabase; import ml.docilealligator.infinityforreddit.adapters.PrivateMessagesDetailRecyclerViewAdapter; import ml.docilealligator.infinityforreddit.asynctasks.LoadUserData; import ml.docilealligator.infinityforreddit.customtheme.CustomThemeWrapper; +import ml.docilealligator.infinityforreddit.customviews.LinearLayoutManagerBugFixed; import ml.docilealligator.infinityforreddit.events.RepliedToPrivateMessageEvent; import ml.docilealligator.infinityforreddit.message.Message; import ml.docilealligator.infinityforreddit.message.ReadMessage; @@ -87,7 +87,7 @@ public class ViewPrivateMessagesActivity extends BaseActivity implements Activit CustomThemeWrapper mCustomThemeWrapper; @Inject Executor mExecutor; - private LinearLayoutManager mLinearLayoutManager; + private LinearLayoutManagerBugFixed mLinearLayoutManager; private PrivateMessagesDetailRecyclerViewAdapter mAdapter; private Message privateMessage; private String mAccessToken; @@ -154,7 +154,7 @@ public class ViewPrivateMessagesActivity extends BaseActivity implements Activit } mAdapter = new PrivateMessagesDetailRecyclerViewAdapter(this, mSharedPreferences, getResources().getConfiguration().locale, privateMessage, mAccountName, mCustomThemeWrapper); - mLinearLayoutManager = new LinearLayoutManager(this); + mLinearLayoutManager = new LinearLayoutManagerBugFixed(this); mLinearLayoutManager.setStackFromEnd(true); mRecyclerView.setLayoutManager(mLinearLayoutManager); mRecyclerView.setAdapter(mAdapter); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewRedditGalleryActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewRedditGalleryActivity.java index 267bd56b..b5047cc6 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewRedditGalleryActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewRedditGalleryActivity.java @@ -28,6 +28,7 @@ import javax.inject.Named; import butterknife.BindView; import butterknife.ButterKnife; +import ml.docilealligator.infinityforreddit.customviews.ViewPagerBugFixed; import ml.docilealligator.infinityforreddit.font.ContentFontFamily; import ml.docilealligator.infinityforreddit.font.ContentFontStyle; import ml.docilealligator.infinityforreddit.font.FontFamily; @@ -51,10 +52,11 @@ public class ViewRedditGalleryActivity extends AppCompatActivity implements SetA @BindView(R.id.hauler_view_view_reddit_gallery_activity) HaulerView haulerView; @BindView(R.id.view_pager_view_reddit_gallery_activity) - ViewPager viewPager; + ViewPagerBugFixed viewPager; private SectionsPagerAdapter sectionsPagerAdapter; private ArrayList<Post.Gallery> gallery; private String subredditName; + private boolean useBottomAppBar; @Inject @Named("default") SharedPreferences sharedPreferences; @@ -91,12 +93,17 @@ public class ViewRedditGalleryActivity extends AppCompatActivity implements SetA ButterKnife.bind(this); - ActionBar actionBar = getSupportActionBar(); - Drawable upArrow = getResources().getDrawable(R.drawable.ic_arrow_back_white_24dp); - actionBar.setHomeAsUpIndicator(upArrow); - actionBar.setBackgroundDrawable(new ColorDrawable(getResources().getColor(R.color.transparentActionBarAndExoPlayerControllerColor))); + useBottomAppBar = sharedPreferences.getBoolean(SharedPreferencesUtils.USE_BOTTOM_TOOLBAR_IN_MEDIA_VIEWER, false); - setTitle(" "); + if (!useBottomAppBar) { + ActionBar actionBar = getSupportActionBar(); + Drawable upArrow = getResources().getDrawable(R.drawable.ic_arrow_back_white_24dp); + actionBar.setHomeAsUpIndicator(upArrow); + actionBar.setBackgroundDrawable(new ColorDrawable(getResources().getColor(R.color.transparentActionBarAndExoPlayerControllerColor))); + setTitle(" "); + } else { + getSupportActionBar().hide(); + } gallery = getIntent().getParcelableArrayListExtra(EXTRA_REDDIT_GALLERY); if (gallery == null || gallery.isEmpty()) { @@ -118,16 +125,23 @@ public class ViewRedditGalleryActivity extends AppCompatActivity implements SetA setupViewPager(); } + public boolean isUseBottomAppBar() { + return useBottomAppBar; + } + private void setupViewPager() { - setToolbarTitle(0); + if (!useBottomAppBar) { + setToolbarTitle(0); + viewPager.addOnPageChangeListener(new ViewPager.SimpleOnPageChangeListener() { + @Override + public void onPageSelected(int position) { + setToolbarTitle(position); + } + }); + } sectionsPagerAdapter = new SectionsPagerAdapter(getSupportFragmentManager()); - viewPager.addOnPageChangeListener(new ViewPager.SimpleOnPageChangeListener() { - @Override - public void onPageSelected(int position) { - setToolbarTitle(position); - } - }); viewPager.setAdapter(sectionsPagerAdapter); + viewPager.setOffscreenPageLimit(3); } private void setToolbarTitle(int position) { @@ -230,6 +244,8 @@ public class ViewRedditGalleryActivity extends AppCompatActivity implements SetA Bundle bundle = new Bundle(); bundle.putParcelable(ViewRedditGalleryVideoFragment.EXTRA_REDDIT_GALLERY_VIDEO, media); bundle.putString(ViewRedditGalleryVideoFragment.EXTRA_SUBREDDIT_NAME, subredditName); + bundle.putInt(ViewRedditGalleryVideoFragment.EXTRA_INDEX, position); + bundle.putInt(ViewRedditGalleryVideoFragment.EXTRA_MEDIA_COUNT, gallery.size()); fragment.setArguments(bundle); return fragment; } else { @@ -237,6 +253,8 @@ public class ViewRedditGalleryActivity extends AppCompatActivity implements SetA Bundle bundle = new Bundle(); bundle.putParcelable(ViewRedditGalleryImageOrGifFragment.EXTRA_REDDIT_GALLERY_MEDIA, media); bundle.putString(ViewRedditGalleryImageOrGifFragment.EXTRA_SUBREDDIT_NAME, subredditName); + bundle.putInt(ViewRedditGalleryImageOrGifFragment.EXTRA_INDEX, position); + bundle.putInt(ViewRedditGalleryImageOrGifFragment.EXTRA_MEDIA_COUNT, gallery.size()); fragment.setArguments(bundle); return fragment; } diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewSubredditDetailActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewSubredditDetailActivity.java index bed746c4..57620c51 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewSubredditDetailActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewSubredditDetailActivity.java @@ -4,11 +4,13 @@ import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; import android.content.res.ColorStateList; +import android.net.Uri; import android.os.Build; import android.os.Bundle; import android.os.Handler; import android.text.Editable; import android.text.TextWatcher; +import android.text.util.Linkify; import android.view.Gravity; import android.view.KeyEvent; import android.view.Menu; @@ -64,7 +66,14 @@ import javax.inject.Named; import butterknife.BindView; import butterknife.ButterKnife; +import io.noties.markwon.AbstractMarkwonPlugin; +import io.noties.markwon.Markwon; +import io.noties.markwon.MarkwonConfiguration; +import io.noties.markwon.core.MarkwonTheme; +import io.noties.markwon.linkify.LinkifyPlugin; +import io.noties.markwon.movement.MovementMethodPlugin; import jp.wasabeef.glide.transformations.RoundedCornersTransformation; +import me.saket.bettermovementmethod.BetterLinkMovementMethod; import ml.docilealligator.infinityforreddit.ActivityToolbarInterface; import ml.docilealligator.infinityforreddit.AppBarStateChangeListener; import ml.docilealligator.infinityforreddit.FragmentCommunicator; @@ -81,12 +90,14 @@ import ml.docilealligator.infinityforreddit.asynctasks.AddSubredditOrUserToMulti import ml.docilealligator.infinityforreddit.asynctasks.CheckIsSubscribedToSubreddit; import ml.docilealligator.infinityforreddit.asynctasks.InsertSubredditData; import ml.docilealligator.infinityforreddit.asynctasks.SwitchAccount; +import ml.docilealligator.infinityforreddit.bottomsheetfragments.CopyTextBottomSheetFragment; import ml.docilealligator.infinityforreddit.bottomsheetfragments.FABMoreOptionsBottomSheetFragment; import ml.docilealligator.infinityforreddit.bottomsheetfragments.PostLayoutBottomSheetFragment; import ml.docilealligator.infinityforreddit.bottomsheetfragments.PostTypeBottomSheetFragment; import ml.docilealligator.infinityforreddit.bottomsheetfragments.RandomBottomSheetFragment; import ml.docilealligator.infinityforreddit.bottomsheetfragments.SortTimeBottomSheetFragment; import ml.docilealligator.infinityforreddit.bottomsheetfragments.SortTypeBottomSheetFragment; +import ml.docilealligator.infinityforreddit.bottomsheetfragments.UrlMenuBottomSheetFragment; import ml.docilealligator.infinityforreddit.customtheme.CustomThemeWrapper; import ml.docilealligator.infinityforreddit.events.ChangeNSFWEvent; import ml.docilealligator.infinityforreddit.events.GoBackToMainPageEvent; @@ -212,6 +223,7 @@ public class ViewSubredditDetailActivity extends BaseActivity implements SortTyp private String mAccessToken; private String mAccountName; private String subredditName; + private String description; private boolean mFetchSubredditInfoSuccess = false; private int mNCurrentOnlineSubscribers = 0; private boolean isNsfwSubreddit = false; @@ -373,6 +385,44 @@ public class ViewSubredditDetailActivity extends BaseActivity implements SortTyp glide = Glide.with(this); Locale locale = getResources().getConfiguration().locale; + Markwon markwon = Markwon.builder(this) + .usePlugin(new AbstractMarkwonPlugin() { + @Override + public void configureConfiguration(@NonNull MarkwonConfiguration.Builder builder) { + builder.linkResolver((view, link) -> { + Intent intent = new Intent(ViewSubredditDetailActivity.this, LinkResolverActivity.class); + Uri uri = Uri.parse(link); + intent.setData(uri); + startActivity(intent); + }); + } + + @Override + public void configureTheme(@NonNull MarkwonTheme.Builder builder) { + builder.linkColor(mCustomThemeWrapper.getLinkColor()); + } + }) + .usePlugin(MovementMethodPlugin.create(BetterLinkMovementMethod.linkify(Linkify.WEB_URLS, this).setOnLinkLongClickListener((textView, url) -> { + UrlMenuBottomSheetFragment urlMenuBottomSheetFragment = new UrlMenuBottomSheetFragment(); + Bundle bundle = new Bundle(); + bundle.putString(UrlMenuBottomSheetFragment.EXTRA_URL, url); + urlMenuBottomSheetFragment.setArguments(bundle); + urlMenuBottomSheetFragment.show(getSupportFragmentManager(), urlMenuBottomSheetFragment.getTag()); + return true; + }))) + .usePlugin(LinkifyPlugin.create(Linkify.WEB_URLS)).build(); + + descriptionTextView.setOnLongClickListener(view -> { + if (description != null && !description.equals("") && descriptionTextView.getSelectionStart() == -1 && descriptionTextView.getSelectionEnd() == -1) { + Bundle bundle = new Bundle(); + bundle.putString(CopyTextBottomSheetFragment.EXTRA_RAW_TEXT, description); + CopyTextBottomSheetFragment copyTextBottomSheetFragment = new CopyTextBottomSheetFragment(); + copyTextBottomSheetFragment.setArguments(bundle); + copyTextBottomSheetFragment.show(getSupportFragmentManager(), copyTextBottomSheetFragment.getTag()); + } + return true; + }); + mSubredditViewModel = new ViewModelProvider(this, new SubredditViewModel.Factory(getApplication(), mRedditDataRoomDatabase, subredditName)) .get(SubredditViewModel.class); @@ -424,11 +474,12 @@ public class ViewSubredditDetailActivity extends BaseActivity implements SortTyp nSubscribersTextView.setText(nSubscribers); creationTimeTextView.setText(new SimpleDateFormat("MMM d, yyyy", locale).format(subredditData.getCreatedUTC())); - if (hideSubredditDescription || subredditData.getDescription().equals("")) { + description = subredditData.getDescription(); + if (hideSubredditDescription || description.equals("")) { descriptionTextView.setVisibility(View.GONE); } else { descriptionTextView.setVisibility(View.VISIBLE); - descriptionTextView.setText(subredditData.getDescription()); + markwon.setMarkdown(descriptionTextView, description); } if (subredditData.isNSFW()) { @@ -1114,6 +1165,11 @@ public class ViewSubredditDetailActivity extends BaseActivity implements SortTyp } Intent intent = new Intent(this, MultiredditSelectionActivity.class); startActivityForResult(intent, ADD_TO_MULTIREDDIT_REQUEST_CODE); + } else if (itemId == R.id.action_add_to_post_filter_view_subreddit_detail_activity) { + Intent intent = new Intent(this, PostFilterPreferenceActivity.class); + intent.putExtra(PostFilterPreferenceActivity.EXTRA_SUBREDDIT_NAME, subredditName); + startActivity(intent); + return true; } else if (itemId == R.id.action_share_view_subreddit_detail_activity) { Intent shareIntent = new Intent(Intent.ACTION_SEND); shareIntent.setType("text/plain"); @@ -1228,6 +1284,11 @@ public class ViewSubredditDetailActivity extends BaseActivity implements SortTyp intent = new Intent(this, PostVideoActivity.class); intent.putExtra(PostVideoActivity.EXTRA_SUBREDDIT_NAME, subredditName); startActivity(intent); + break; + case PostTypeBottomSheetFragment.TYPE_GALLERY: + intent = new Intent(this, PostGalleryActivity.class); + intent.putExtra(PostVideoActivity.EXTRA_SUBREDDIT_NAME, subredditName); + startActivity(intent); } } @@ -1431,7 +1492,11 @@ public class ViewSubredditDetailActivity extends BaseActivity implements SortTyp subredditIntent.putExtra(ViewSubredditDetailActivity.EXTRA_SUBREDDIT_NAME_KEY, thingEditText.getText().toString()); startActivity(subredditIntent); }) - .setNegativeButton(R.string.cancel, null) + .setNegativeButton(R.string.cancel, (dialogInterface, i) -> { + if (imm != null) { + imm.hideSoftInputFromWindow(thingEditText.getWindowToken(), 0); + } + }) .setOnDismissListener(dialogInterface -> { if (imm != null) { imm.hideSoftInputFromWindow(thingEditText.getWindowToken(), 0); @@ -1472,7 +1537,11 @@ public class ViewSubredditDetailActivity extends BaseActivity implements SortTyp userIntent.putExtra(ViewUserDetailActivity.EXTRA_USER_NAME_KEY, thingEditText.getText().toString()); startActivity(userIntent); }) - .setNegativeButton(R.string.cancel, null) + .setNegativeButton(R.string.cancel, (dialogInterface, i) -> { + if (imm != null) { + imm.hideSoftInputFromWindow(thingEditText.getWindowToken(), 0); + } + }) .setOnDismissListener(dialogInterface -> { if (imm != null) { imm.hideSoftInputFromWindow(thingEditText.getWindowToken(), 0); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewUserDetailActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewUserDetailActivity.java index c1ef9ea2..d6fbb3d4 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewUserDetailActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewUserDetailActivity.java @@ -981,6 +981,11 @@ public class ViewUserDetailActivity extends BaseActivity implements SortTypeSele } Intent intent = new Intent(this, MultiredditSelectionActivity.class); startActivityForResult(intent, ADD_TO_MULTIREDDIT_REQUEST_CODE); + } else if (itemId == R.id.action_add_to_post_filter_view_user_detail_activity) { + Intent intent = new Intent(this, PostFilterPreferenceActivity.class); + intent.putExtra(PostFilterPreferenceActivity.EXTRA_USER_NAME, username); + startActivity(intent); + return true; } else if (itemId == R.id.action_report_view_user_detail_activity) { Intent reportIntent = new Intent(this, LinkResolverActivity.class); reportIntent.setData(Uri.parse("https://www.reddithelp.com/en/categories/rules-reporting/account-and-community-restrictions/what-should-i-do-if-i-see-something-i")); @@ -1242,7 +1247,11 @@ public class ViewUserDetailActivity extends BaseActivity implements SortTypeSele subredditIntent.putExtra(ViewSubredditDetailActivity.EXTRA_SUBREDDIT_NAME_KEY, thingEditText.getText().toString()); startActivity(subredditIntent); }) - .setNegativeButton(R.string.cancel, null) + .setNegativeButton(R.string.cancel, (dialogInterface, i) -> { + if (imm != null) { + imm.hideSoftInputFromWindow(thingEditText.getWindowToken(), 0); + } + }) .setOnDismissListener(dialogInterface -> { if (imm != null) { imm.hideSoftInputFromWindow(thingEditText.getWindowToken(), 0); @@ -1283,7 +1292,11 @@ public class ViewUserDetailActivity extends BaseActivity implements SortTypeSele userIntent.putExtra(ViewUserDetailActivity.EXTRA_USER_NAME_KEY, thingEditText.getText().toString()); startActivity(userIntent); }) - .setNegativeButton(R.string.cancel, null) + .setNegativeButton(R.string.cancel, (dialogInterface, i) -> { + if (imm != null) { + imm.hideSoftInputFromWindow(thingEditText.getWindowToken(), 0); + } + }) .setOnDismissListener(dialogInterface -> { if (imm != null) { imm.hideSoftInputFromWindow(thingEditText.getWindowToken(), 0); @@ -1386,6 +1399,10 @@ public class ViewUserDetailActivity extends BaseActivity implements SortTypeSele case PostTypeBottomSheetFragment.TYPE_VIDEO: intent = new Intent(this, PostVideoActivity.class); startActivity(intent); + break; + case PostTypeBottomSheetFragment.TYPE_GALLERY: + intent = new Intent(this, PostGalleryActivity.class); + startActivity(intent); } } diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewVideoActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewVideoActivity.java index 849a3853..7362e892 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewVideoActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewVideoActivity.java @@ -3,8 +3,10 @@ package ml.docilealligator.infinityforreddit.activities; import android.Manifest; import android.content.Intent; import android.content.SharedPreferences; +import android.content.pm.ActivityInfo; import android.content.pm.PackageManager; import android.content.res.Configuration; +import android.content.res.Resources; import android.graphics.drawable.ColorDrawable; import android.graphics.drawable.Drawable; import android.media.AudioManager; @@ -12,14 +14,18 @@ import android.net.Uri; import android.os.Build; import android.os.Bundle; import android.os.Handler; +import android.provider.Settings; import android.text.Html; import android.view.Menu; import android.view.MenuItem; +import android.view.OrientationEventListener; import android.view.View; import android.view.ViewGroup; import android.widget.ImageButton; +import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.ProgressBar; +import android.widget.TextView; import android.widget.Toast; import androidx.annotation.NonNull; @@ -47,6 +53,7 @@ import com.google.android.exoplayer2.upstream.DefaultHttpDataSourceFactory; import com.google.android.exoplayer2.upstream.cache.CacheDataSourceFactory; import com.google.android.exoplayer2.upstream.cache.SimpleCache; import com.google.android.exoplayer2.util.Util; +import com.google.android.material.bottomappbar.BottomAppBar; import com.google.android.material.snackbar.Snackbar; import com.thefuntasty.hauler.DragDirection; import com.thefuntasty.hauler.HaulerView; @@ -66,8 +73,11 @@ import ml.docilealligator.infinityforreddit.Infinity; import ml.docilealligator.infinityforreddit.R; import ml.docilealligator.infinityforreddit.apis.VReddIt; import ml.docilealligator.infinityforreddit.font.ContentFontFamily; +import ml.docilealligator.infinityforreddit.font.ContentFontStyle; import ml.docilealligator.infinityforreddit.font.FontFamily; +import ml.docilealligator.infinityforreddit.font.FontStyle; import ml.docilealligator.infinityforreddit.font.TitleFontFamily; +import ml.docilealligator.infinityforreddit.font.TitleFontStyle; import ml.docilealligator.infinityforreddit.post.FetchPost; import ml.docilealligator.infinityforreddit.post.Post; import ml.docilealligator.infinityforreddit.services.DownloadMediaService; @@ -116,6 +126,12 @@ public class ViewVideoActivity extends AppCompatActivity { ImageButton muteButton; @BindView(R.id.hd_exo_playback_control_view) ImageButton hdButton; + @BindView(R.id.bottom_navigation_exo_playback_control_view) + BottomAppBar bottomAppBar; + @BindView(R.id.title_text_view_exo_playback_control_view) + TextView titleTextView; + @BindView(R.id.download_image_view_exo_playback_control_view) + ImageView downloadImageView; private Uri mVideoUri; private SimpleExoPlayer player; @@ -135,6 +151,7 @@ public class ViewVideoActivity extends AppCompatActivity { private int videoType; private boolean isDataSavingMode; private boolean isHd; + private Integer originalOrientation; @Inject @Named("no_oauth") @@ -170,6 +187,15 @@ public class ViewVideoActivity extends AppCompatActivity { getTheme().applyStyle(R.style.Theme_Normal, true); + getTheme().applyStyle(FontStyle.valueOf(mSharedPreferences + .getString(SharedPreferencesUtils.FONT_SIZE_KEY, FontStyle.Normal.name())).getResId(), true); + + getTheme().applyStyle(TitleFontStyle.valueOf(mSharedPreferences + .getString(SharedPreferencesUtils.TITLE_FONT_SIZE_KEY, TitleFontStyle.Normal.name())).getResId(), true); + + getTheme().applyStyle(ContentFontStyle.valueOf(mSharedPreferences + .getString(SharedPreferencesUtils.CONTENT_FONT_SIZE_KEY, ContentFontStyle.Normal.name())).getResId(), true); + getTheme().applyStyle(FontFamily.valueOf(mSharedPreferences .getString(SharedPreferencesUtils.FONT_FAMILY_KEY, FontFamily.Default.name())).getResId(), true); @@ -184,10 +210,31 @@ public class ViewVideoActivity extends AppCompatActivity { ButterKnife.bind(this); setVolumeControlStream(AudioManager.STREAM_MUSIC); - ActionBar actionBar = getSupportActionBar(); - Drawable upArrow = getResources().getDrawable(R.drawable.ic_arrow_back_white_24dp); - actionBar.setHomeAsUpIndicator(upArrow); - actionBar.setBackgroundDrawable(new ColorDrawable(getResources().getColor(R.color.transparentActionBarAndExoPlayerControllerColor))); + Resources resources = getResources(); + + boolean useBottomAppBar = mSharedPreferences.getBoolean(SharedPreferencesUtils.USE_BOTTOM_TOOLBAR_IN_MEDIA_VIEWER, false); + if (useBottomAppBar) { + getSupportActionBar().hide(); + bottomAppBar.setVisibility(View.VISIBLE); + downloadImageView.setOnClickListener(view -> { + if (isDownloading) { + return; + } + + if (videoDownloadUrl == null) { + Toast.makeText(this, R.string.fetching_video_info_please_wait, Toast.LENGTH_SHORT).show(); + return; + } + + isDownloading = true; + requestPermissionAndDownload(); + }); + } else { + ActionBar actionBar = getSupportActionBar(); + Drawable upArrow = resources.getDrawable(R.drawable.ic_arrow_back_white_24dp); + actionBar.setHomeAsUpIndicator(upArrow); + actionBar.setBackgroundDrawable(new ColorDrawable(resources.getColor(R.color.transparentActionBarAndExoPlayerControllerColor))); + } String dataSavingModeString = mSharedPreferences.getString(SharedPreferencesUtils.DATA_SAVING_MODE, SharedPreferencesUtils.DATA_SAVING_MODE_OFF); int networkType = Utils.getConnectedNetwork(this); @@ -199,18 +246,18 @@ public class ViewVideoActivity extends AppCompatActivity { isHd = !isDataSavingMode; if (!mSharedPreferences.getBoolean(SharedPreferencesUtils.VIDEO_PLAYER_IGNORE_NAV_BAR, false)) { - if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT || getResources().getBoolean(R.bool.isTablet)) { + if (resources.getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT || resources.getBoolean(R.bool.isTablet)) { //Set player controller bottom margin in order to display it above the navbar - int resourceId = getResources().getIdentifier("navigation_bar_height", "dimen", "android"); + int resourceId = resources.getIdentifier("navigation_bar_height", "dimen", "android"); LinearLayout controllerLinearLayout = findViewById(R.id.linear_layout_exo_playback_control_view); ViewGroup.MarginLayoutParams params = (ViewGroup.MarginLayoutParams) controllerLinearLayout.getLayoutParams(); - params.bottomMargin = getResources().getDimensionPixelSize(resourceId); + params.bottomMargin = resources.getDimensionPixelSize(resourceId); } else { //Set player controller right margin in order to display it above the navbar - int resourceId = getResources().getIdentifier("navigation_bar_height", "dimen", "android"); + int resourceId = resources.getIdentifier("navigation_bar_height", "dimen", "android"); LinearLayout controllerLinearLayout = findViewById(R.id.linear_layout_exo_playback_control_view); ViewGroup.MarginLayoutParams params = (ViewGroup.MarginLayoutParams) controllerLinearLayout.getLayoutParams(); - params.rightMargin = getResources().getDimensionPixelSize(resourceId); + params.rightMargin = resources.getDimensionPixelSize(resourceId); } } @@ -225,13 +272,45 @@ public class ViewVideoActivity extends AppCompatActivity { isNSFW = intent.getBooleanExtra(EXTRA_IS_NSFW, false); if (savedInstanceState == null) { resumePosition = intent.getLongExtra(EXTRA_PROGRESS_SECONDS, -1); + if (mSharedPreferences.getBoolean(SharedPreferencesUtils.VIDEO_PLAYER_AUTOMATIC_LANDSCAPE_ORIENTATION, false)) { + originalOrientation = resources.getConfiguration().orientation; + setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE); + + if (android.provider.Settings.System.getInt(getContentResolver(), + Settings.System.ACCELEROMETER_ROTATION, 0) == 1) { + OrientationEventListener orientationEventListener = new OrientationEventListener(this) { + @Override + public void onOrientationChanged(int orientation) { + int epsilon = 10; + int leftLandscape = 90; + int rightLandscape = 270; + if(epsilonCheck(orientation, leftLandscape, epsilon) || + epsilonCheck(orientation, rightLandscape, epsilon)) { + setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR); + disable(); + } + } + + private boolean epsilonCheck(int a, int b, int epsilon) { + return a > b - epsilon && a < b + epsilon; + } + }; + orientationEventListener.enable(); + } + } } if (postTitle != null) { - setTitle(Html.fromHtml(String.format("<small>%s</small>", postTitle))); + if (useBottomAppBar) { + titleTextView.setText(Html.fromHtml(String.format("<small>%s</small>", postTitle))); + } else { + setTitle(Html.fromHtml(String.format("<small>%s</small>", postTitle))); + } } else { - setTitle(""); + if (!useBottomAppBar) { + setTitle(""); + } } videoPlayerView.setControllerVisibilityListener(visibility -> { @@ -539,29 +618,33 @@ public class ViewVideoActivity extends AppCompatActivity { } isDownloading = true; - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { - if (ContextCompat.checkSelfPermission(this, - Manifest.permission.WRITE_EXTERNAL_STORAGE) - != PackageManager.PERMISSION_GRANTED) { - - // Permission is not granted - // No explanation needed; request the permission - ActivityCompat.requestPermissions(this, - new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, - PERMISSION_REQUEST_WRITE_EXTERNAL_STORAGE); - } else { - // Permission has already been granted - download(); - } - } else { - download(); - } + requestPermissionAndDownload(); return true; } return false; } + private void requestPermissionAndDownload() { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && Build.VERSION.SDK_INT < Build.VERSION_CODES.Q) { + if (ContextCompat.checkSelfPermission(this, + Manifest.permission.WRITE_EXTERNAL_STORAGE) + != PackageManager.PERMISSION_GRANTED) { + + // Permission is not granted + // No explanation needed; request the permission + ActivityCompat.requestPermissions(this, + new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, + PERMISSION_REQUEST_WRITE_EXTERNAL_STORAGE); + } else { + // Permission has already been granted + download(); + } + } else { + download(); + } + } + @Override protected void onStart() { super.onStart(); @@ -575,6 +658,9 @@ public class ViewVideoActivity extends AppCompatActivity { super.onStop(); wasPlaying = player.getPlayWhenReady(); player.setPlayWhenReady(false); + if (originalOrientation != null) { + setRequestedOrientation(originalOrientation); + } } @Override diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/WikiActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/WikiActivity.java new file mode 100644 index 00000000..f4cc17fa --- /dev/null +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/WikiActivity.java @@ -0,0 +1,370 @@ +package ml.docilealligator.infinityforreddit.activities; + +import android.content.Intent; +import android.content.SharedPreferences; +import android.graphics.Color; +import android.net.Uri; +import android.os.Build; +import android.os.Bundle; +import android.text.SpannableStringBuilder; +import android.text.Spanned; +import android.text.TextPaint; +import android.text.style.ClickableSpan; +import android.text.util.Linkify; +import android.view.MenuItem; +import android.view.View; +import android.view.Window; +import android.view.WindowManager; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.TextView; + +import androidx.annotation.NonNull; +import androidx.appcompat.widget.Toolbar; +import androidx.coordinatorlayout.widget.CoordinatorLayout; +import androidx.recyclerview.widget.RecyclerView; +import androidx.swiperefreshlayout.widget.SwipeRefreshLayout; + +import com.bumptech.glide.Glide; +import com.google.android.material.appbar.AppBarLayout; +import com.r0adkll.slidr.Slidr; +import com.r0adkll.slidr.model.SlidrInterface; + +import org.commonmark.ext.gfm.tables.TableBlock; +import org.greenrobot.eventbus.EventBus; +import org.greenrobot.eventbus.Subscribe; +import org.json.JSONException; +import org.json.JSONObject; + +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import javax.inject.Inject; +import javax.inject.Named; + +import butterknife.BindView; +import butterknife.ButterKnife; +import io.noties.markwon.AbstractMarkwonPlugin; +import io.noties.markwon.Markwon; +import io.noties.markwon.MarkwonConfiguration; +import io.noties.markwon.core.MarkwonTheme; +import io.noties.markwon.ext.strikethrough.StrikethroughPlugin; +import io.noties.markwon.html.HtmlPlugin; +import io.noties.markwon.linkify.LinkifyPlugin; +import io.noties.markwon.recycler.MarkwonAdapter; +import io.noties.markwon.recycler.table.TableEntry; +import io.noties.markwon.recycler.table.TableEntryPlugin; +import ml.docilealligator.infinityforreddit.Infinity; +import ml.docilealligator.infinityforreddit.R; +import ml.docilealligator.infinityforreddit.apis.RedditAPI; +import ml.docilealligator.infinityforreddit.customtheme.CustomThemeWrapper; +import ml.docilealligator.infinityforreddit.customviews.LinearLayoutManagerBugFixed; +import ml.docilealligator.infinityforreddit.customviews.MarkwonLinearLayoutManager; +import ml.docilealligator.infinityforreddit.events.SwitchAccountEvent; +import ml.docilealligator.infinityforreddit.utils.JSONUtils; +import ml.docilealligator.infinityforreddit.utils.SharedPreferencesUtils; +import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; +import retrofit2.Retrofit; + +public class WikiActivity extends BaseActivity { + + public static final String EXTRA_SUBREDDIT_NAME = "ESN"; + private static final String WIKI_MARKDOWN_STATE = "WMS"; + + @BindView(R.id.coordinator_layout_comment_wiki_activity) + CoordinatorLayout coordinatorLayout; + @BindView(R.id.appbar_layout_comment_wiki_activity) + AppBarLayout appBarLayout; + @BindView(R.id.toolbar_comment_wiki_activity) + Toolbar toolbar; + @BindView(R.id.swipe_refresh_layout_wiki_activity) + SwipeRefreshLayout swipeRefreshLayout; + @BindView(R.id.content_markdown_view_comment_wiki_activity) + RecyclerView markdownRecyclerView; + @BindView(R.id.fetch_wiki_linear_layout_wiki_activity) + LinearLayout mFetchWikiInfoLinearLayout; + @BindView(R.id.fetch_wiki_image_view_wiki_activity) + ImageView mFetchWikiInfoImageView; + @BindView(R.id.fetch_wiki_text_view_wiki_activity) + TextView mFetchWikiInfoTextView; + + @Inject + @Named("no_oauth") + Retrofit retrofit; + @Inject + @Named("default") + SharedPreferences mSharedPreferences; + @Inject + CustomThemeWrapper mCustomThemeWrapper; + private SlidrInterface mSlidrInterface; + private String wikiMarkdown; + private Markwon markwon; + private MarkwonAdapter markwonAdapter; + private boolean isRefreshing = false; + + @Override + protected void onCreate(Bundle savedInstanceState) { + ((Infinity) getApplication()).getAppComponent().inject(this); + + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_wiki); + + ButterKnife.bind(this); + + EventBus.getDefault().register(this); + + applyCustomTheme(); + + setSupportActionBar(toolbar); + getSupportActionBar().setDisplayHomeAsUpEnabled(true); + + if (mSharedPreferences.getBoolean(SharedPreferencesUtils.SWIPE_RIGHT_TO_GO_BACK, true)) { + mSlidrInterface = Slidr.attach(this); + } + + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { + Window window = getWindow(); + + if (isChangeStatusBarIconColor()) { + addOnOffsetChangedListener(appBarLayout); + } + + if (isImmersiveInterface()) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) { + coordinatorLayout.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE | + View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | + View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION); + } else { + window.setFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS, WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS); + } + adjustToolbar(toolbar); + markdownRecyclerView.setPadding(markdownRecyclerView.getPaddingLeft(), 0, markdownRecyclerView.getPaddingRight(), getNavBarHeight()); + } + } + + swipeRefreshLayout.setEnabled(mSharedPreferences.getBoolean(SharedPreferencesUtils.PULL_TO_REFRESH, true)); + swipeRefreshLayout.setOnRefreshListener(this::loadWiki); + + int markdownColor = mCustomThemeWrapper.getPrimaryTextColor(); + int spoilerBackgroundColor = markdownColor | 0xFF000000; + int linkColor = mCustomThemeWrapper.getLinkColor(); + markwon = Markwon.builder(this) + .usePlugin(HtmlPlugin.create()) + .usePlugin(new AbstractMarkwonPlugin() { + @NonNull + @Override + public String processMarkdown(@NonNull String markdown) { + StringBuilder markdownStringBuilder = new StringBuilder(markdown); + Pattern spoilerPattern = Pattern.compile(">![\\S\\s]*?!<"); + Matcher matcher = spoilerPattern.matcher(markdownStringBuilder); + while (matcher.find()) { + markdownStringBuilder.replace(matcher.start(), matcher.start() + 1, ">"); + } + return super.processMarkdown(markdownStringBuilder.toString()); + } + + @Override + public void afterSetText(@NonNull TextView textView) { + textView.setHighlightColor(Color.TRANSPARENT); + SpannableStringBuilder markdownStringBuilder = new SpannableStringBuilder(textView.getText().toString()); + Pattern spoilerPattern = Pattern.compile(">![\\S\\s]*?!<"); + Matcher matcher = spoilerPattern.matcher(markdownStringBuilder); + int start = 0; + boolean find = false; + while (matcher.find(start)) { + if (markdownStringBuilder.length() < 4 + || matcher.start() < 0 + || matcher.end() > markdownStringBuilder.length()) { + break; + } + find = true; + markdownStringBuilder.delete(matcher.end() - 2, matcher.end()); + markdownStringBuilder.delete(matcher.start(), matcher.start() + 2); + ClickableSpan clickableSpan = new ClickableSpan() { + private boolean isShowing = false; + @Override + public void updateDrawState(@NonNull TextPaint ds) { + if (isShowing) { + super.updateDrawState(ds); + ds.setColor(markdownColor); + } else { + ds.bgColor = spoilerBackgroundColor; + ds.setColor(markdownColor); + } + ds.setUnderlineText(false); + } + + @Override + public void onClick(@NonNull View view) { + isShowing = !isShowing; + view.invalidate(); + } + }; + markdownStringBuilder.setSpan(clickableSpan, matcher.start(), matcher.end() - 4, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); + start = matcher.end() - 4; + } + if (find) { + textView.setText(markdownStringBuilder); + } + } + + @Override + public void beforeSetText(@NonNull TextView textView, @NonNull Spanned markdown) { + textView.setTextColor(markdownColor); + } + + @Override + public void configureConfiguration(@NonNull MarkwonConfiguration.Builder builder) { + builder.linkResolver((view, link) -> { + Intent intent = new Intent(WikiActivity.this, LinkResolverActivity.class); + Uri uri = Uri.parse(link); + intent.setData(uri); + startActivity(intent); + }); + } + + @Override + public void configureTheme(@NonNull MarkwonTheme.Builder builder) { + builder.linkColor(linkColor); + } + }) + .usePlugin(StrikethroughPlugin.create()) + .usePlugin(LinkifyPlugin.create(Linkify.WEB_URLS)) + .usePlugin(TableEntryPlugin.create(this)) + .build(); + + markwonAdapter = MarkwonAdapter.builder(R.layout.adapter_default_entry, R.id.text) + .include(TableBlock.class, TableEntry.create(builder -> builder + .tableLayout(R.layout.adapter_table_block, R.id.table_layout) + .textLayoutIsRoot(R.layout.view_table_entry_cell))) + .build(); + LinearLayoutManagerBugFixed linearLayoutManager = new MarkwonLinearLayoutManager(this, new MarkwonLinearLayoutManager.HorizontalScrollViewScrolledListener() { + @Override + public void onScrolledLeft() { + if (mSlidrInterface != null) { + mSlidrInterface.lock(); + } + } + + @Override + public void onScrolledRight() { + if (mSlidrInterface != null) { + mSlidrInterface.unlock(); + } + } + }); + markdownRecyclerView.setLayoutManager(linearLayoutManager); + markdownRecyclerView.setAdapter(markwonAdapter); + + if (savedInstanceState != null) { + wikiMarkdown = savedInstanceState.getString(WIKI_MARKDOWN_STATE); + } + + if (wikiMarkdown == null) { + loadWiki(); + } else { + markwonAdapter.setMarkdown(markwon, wikiMarkdown); + markwonAdapter.notifyDataSetChanged(); + } + } + + private void loadWiki() { + if (isRefreshing) { + return; + } + isRefreshing = true; + + swipeRefreshLayout.setRefreshing(true); + + Glide.with(this).clear(mFetchWikiInfoImageView); + mFetchWikiInfoLinearLayout.setVisibility(View.GONE); + + retrofit.create(RedditAPI.class).getWiki(getIntent().getStringExtra(EXTRA_SUBREDDIT_NAME)).enqueue(new Callback<String>() { + @Override + public void onResponse(@NonNull Call<String> call, @NonNull Response<String> response) { + if (response.isSuccessful()) { + try { + markwonAdapter.setMarkdown(markwon, new JSONObject(response.body()) + .getJSONObject(JSONUtils.DATA_KEY).getString(JSONUtils.CONTENT_MD_KEY)); + markwonAdapter.notifyDataSetChanged(); + } catch (JSONException e) { + e.printStackTrace(); + showErrorView(R.string.error_loading_wiki); + } + } else { + if (response.code() == 404 || response.code() == 403) { + showErrorView(R.string.no_wiki); + } else { + showErrorView(R.string.error_loading_wiki); + } + } + isRefreshing = false; + swipeRefreshLayout.setRefreshing(false); + } + + @Override + public void onFailure(@NonNull Call<String> call, @NonNull Throwable t) { + showErrorView(R.string.error_loading_wiki); + isRefreshing = false; + swipeRefreshLayout.setRefreshing(false); + } + }); + } + + private void showErrorView(int stringResId) { + swipeRefreshLayout.setRefreshing(false); + mFetchWikiInfoLinearLayout.setVisibility(View.VISIBLE); + mFetchWikiInfoTextView.setText(stringResId); + Glide.with(this).load(R.drawable.error_image).into(mFetchWikiInfoImageView); + } + + @Override + public boolean onOptionsItemSelected(@NonNull MenuItem item) { + if (item.getItemId() == android.R.id.home) { + finish(); + return true; + } + + return false; + } + + @Override + protected void onSaveInstanceState(@NonNull Bundle outState) { + super.onSaveInstanceState(outState); + outState.putString(WIKI_MARKDOWN_STATE, wikiMarkdown); + } + + @Override + protected void onDestroy() { + super.onDestroy(); + EventBus.getDefault().unregister(this); + } + + @Override + protected SharedPreferences getDefaultSharedPreferences() { + return mSharedPreferences; + } + + @Override + protected CustomThemeWrapper getCustomThemeWrapper() { + return mCustomThemeWrapper; + } + + @Override + protected void applyCustomTheme() { + coordinatorLayout.setBackgroundColor(mCustomThemeWrapper.getBackgroundColor()); + applyAppBarLayoutAndToolbarTheme(appBarLayout, toolbar); + swipeRefreshLayout.setProgressBackgroundColorSchemeColor(mCustomThemeWrapper.getCircularProgressBarBackground()); + swipeRefreshLayout.setColorSchemeColors(mCustomThemeWrapper.getColorAccent()); + mFetchWikiInfoTextView.setTextColor(mCustomThemeWrapper.getSecondaryTextColor()); + } + + @Subscribe + public void onAccountSwitchEvent(SwitchAccountEvent event) { + if (!getClass().getName().equals(event.excludeActivityClassName)) { + finish(); + } + } +}
\ No newline at end of file diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/CommentsListingRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/CommentsListingRecyclerViewAdapter.java index f3a9c582..15dce401 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/CommentsListingRecyclerViewAdapter.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/CommentsListingRecyclerViewAdapter.java @@ -16,6 +16,7 @@ import android.view.View; import android.view.ViewGroup; import android.widget.Button; import android.widget.ImageView; +import android.widget.LinearLayout; import android.widget.ProgressBar; import android.widget.TextView; import android.widget.Toast; @@ -400,6 +401,8 @@ public class CommentsListingRecyclerViewAdapter extends PagedListAdapter<Comment public class CommentViewHolder extends RecyclerView.ViewHolder { @BindView(R.id.vertical_block_indentation_item_comment) CommentIndentationView commentIndentationView; + @BindView(R.id.linear_layout_item_comment) + LinearLayout linearLayout; @BindView(R.id.author_text_view_item_post_comment) TextView authorTextView; @BindView(R.id.author_flair_text_view_item_post_comment) @@ -455,6 +458,8 @@ public class CommentsListingRecyclerViewAdapter extends PagedListAdapter<Comment constraintSet.applyTo(bottomConstraintLayout); } + linearLayout.getLayoutTransition().setAnimateParentHierarchy(false); + commentIndentationView.setVisibility(View.GONE); if (mShowCommentDivider) { diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/CommentsRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/CommentsRecyclerViewAdapter.java index f88012b9..14f53a2d 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/CommentsRecyclerViewAdapter.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/CommentsRecyclerViewAdapter.java @@ -139,6 +139,8 @@ public class CommentsRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerVi private Drawable mCommentIcon; + private int mSearchCommentIndex = -1; + public CommentsRecyclerViewAdapter(AppCompatActivity activity, ViewPostDetailFragment fragment, CustomThemeWrapper customThemeWrapper, Executor executor, Retrofit retrofit, Retrofit oauthRetrofit, @@ -312,14 +314,12 @@ public class CommentsRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerVi @Override public int getItemViewType(int position) { if (mVisibleComments.size() == 0) { - if (position == 0) { - if (isInitiallyLoading) { - return VIEW_TYPE_FIRST_LOADING; - } else if (isInitiallyLoadingFailed) { - return VIEW_TYPE_FIRST_LOADING_FAILED; - } else { - return VIEW_TYPE_NO_COMMENT_PLACEHOLDER; - } + if (isInitiallyLoading) { + return VIEW_TYPE_FIRST_LOADING; + } else if (isInitiallyLoadingFailed) { + return VIEW_TYPE_FIRST_LOADING_FAILED; + } else { + return VIEW_TYPE_NO_COMMENT_PLACEHOLDER; } } @@ -514,6 +514,10 @@ public class CommentsRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerVi } else { ((CommentViewHolder) holder).saveButton.setImageResource(R.drawable.ic_bookmark_border_grey_24dp); } + + if (position == mSearchCommentIndex) { + holder.itemView.setBackgroundColor(Color.parseColor("#03A9F4")); + } } } else if (holder instanceof CommentFullyCollapsedViewHolder) { Comment comment = getCurrentComment(position); @@ -692,8 +696,10 @@ public class CommentsRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerVi } } - mVisibleComments.get(placeholderPosition).setLoadingMoreChildren(false); - mVisibleComments.get(placeholderPosition).setLoadMoreChildrenFailed(true); + if (placeholderPosition >= mVisibleComments.size() || placeholderPosition < 0) { + mVisibleComments.get(placeholderPosition).setLoadingMoreChildren(false); + mVisibleComments.get(placeholderPosition).setLoadMoreChildrenFailed(true); + } ((LoadMoreChildCommentsViewHolder) holder).placeholderTextView.setText(R.string.comment_load_more_comments_failed); } @@ -895,25 +901,12 @@ public class CommentsRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerVi } public void initiallyLoading() { - if (mVisibleComments.size() != 0) { - int previousSize = mVisibleComments.size(); - mVisibleComments.clear(); - if (mIsSingleCommentThreadMode) { - notifyItemRangeRemoved(0, previousSize + 1); - } else { - notifyItemRangeRemoved(0, previousSize); - } - } - - if (isInitiallyLoading || isInitiallyLoadingFailed) { - isInitiallyLoading = true; - isInitiallyLoadingFailed = false; - notifyItemChanged(0); - } else { - isInitiallyLoading = true; - isInitiallyLoadingFailed = false; - notifyItemInserted(0); - } + resetCommentSearchIndex(); + notifyItemRangeRemoved(0, getItemCount()); + mVisibleComments.clear(); + isInitiallyLoading = true; + isInitiallyLoadingFailed = false; + notifyItemInserted(0); } public void initiallyLoadCommentsFailed() { @@ -1036,9 +1029,22 @@ public class CommentsRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerVi } } + public int getSearchCommentIndex() { + return mSearchCommentIndex; + } + + public void highlightSearchResult(int searchCommentIndex) { + mSearchCommentIndex = searchCommentIndex; + } + + public void resetCommentSearchIndex() { + mSearchCommentIndex = -1; + } + @Override public void onViewRecycled(@NonNull RecyclerView.ViewHolder holder) { if (holder instanceof CommentViewHolder) { + holder.itemView.setBackgroundColor(mCommentBackgroundColor); ((CommentViewHolder) holder).authorTextView.setTextColor(mUsernameColor); ((CommentViewHolder) holder).authorFlairTextView.setVisibility(View.GONE); ((CommentViewHolder) holder).authorTextView.setCompoundDrawablesWithIntrinsicBounds(null, null, null, null); @@ -1050,7 +1056,6 @@ public class CommentsRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerVi ((CommentViewHolder) holder).scoreTextView.setTextColor(mCommentIconAndInfoColor); ((CommentViewHolder) holder).downvoteButton.setColorFilter(mCommentIconAndInfoColor, android.graphics.PorterDuff.Mode.SRC_IN); ((CommentViewHolder) holder).replyButton.setColorFilter(mCommentIconAndInfoColor, android.graphics.PorterDuff.Mode.SRC_IN); - ((CommentViewHolder) holder).itemView.setBackgroundColor(mCommentBackgroundColor); } } @@ -1082,6 +1087,8 @@ public class CommentsRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerVi } public class CommentViewHolder extends RecyclerView.ViewHolder { + @BindView(R.id.linear_layout_item_comment) + LinearLayout linearLayout; @BindView(R.id.author_text_view_item_post_comment) TextView authorTextView; @BindView(R.id.author_flair_text_view_item_post_comment) @@ -1140,6 +1147,10 @@ public class CommentsRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerVi constraintSet.applyTo(bottomConstraintLayout); } + if (linearLayout.getLayoutTransition() != null) { + linearLayout.getLayoutTransition().setAnimateParentHierarchy(false); + } + if (mShowCommentDivider) { commentDivider.setBackgroundColor(mDividerColor); commentDivider.setVisibility(View.VISIBLE); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/MarkdownBottomBarRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/MarkdownBottomBarRecyclerViewAdapter.java index fec4d3c2..54f0c090 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/MarkdownBottomBarRecyclerViewAdapter.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/MarkdownBottomBarRecyclerViewAdapter.java @@ -31,7 +31,7 @@ public class MarkdownBottomBarRecyclerViewAdapter extends RecyclerView.Adapter<R public static final int CODE_BLOCK = 9; public static final int UPLOAD_IMAGE = 10; - private static final int ITEM_COUNT = 11; + private static final int ITEM_COUNT = 10; private CustomThemeWrapper customThemeWrapper; private ItemClickListener itemClickListener; diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/NavigationDrawerRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/NavigationDrawerRecyclerViewAdapter.java index 863b2da3..bf9dea5b 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/NavigationDrawerRecyclerViewAdapter.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/NavigationDrawerRecyclerViewAdapter.java @@ -56,8 +56,9 @@ public class NavigationDrawerRecyclerViewAdapter extends RecyclerView.Adapter<Re private static final int VIEW_TYPE_FAVORITE_SUBSCRIBED_SUBREDDIT = 4; private static final int VIEW_TYPE_SUBSCRIBED_SUBREDDIT = 5; private static final int VIEW_TYPE_ACCOUNT = 6; - private static final int CURRENT_MENU_ITEMS = 17; + private static final int CURRENT_MENU_ITEMS = 20; private static final int ACCOUNT_SECTION_ITEMS = 4; + private static final int REDDIT_SECTION_ITEMS = 2; private static final int POST_SECTION_ITEMS = 5; private static final int PREFERENCES_SECTION_ITEMS = 3; @@ -76,6 +77,7 @@ public class NavigationDrawerRecyclerViewAdapter extends RecyclerView.Adapter<Re private boolean isLoggedIn; private boolean isInMainPage = true; private boolean collapseAccountSection; + private boolean collapseRedditSection; private boolean collapsePostSection; private boolean collapsePreferencesSection; private boolean collapseFavoriteSubredditsSection; @@ -105,6 +107,7 @@ public class NavigationDrawerRecyclerViewAdapter extends RecyclerView.Adapter<Re showAvatarOnTheRightInTheNavigationDrawer = sharedPreferences.getBoolean(SharedPreferencesUtils.SHOW_AVATAR_ON_THE_RIGHT, false); isLoggedIn = accountName != null; collapseAccountSection = navigationDrawerSharedPreferences.getBoolean(SharedPreferencesUtils.COLLAPSE_ACCOUNT_SECTION, false); + collapseRedditSection = navigationDrawerSharedPreferences.getBoolean(SharedPreferencesUtils.COLLAPSE_REDDIT_SECTION, false); collapsePostSection = navigationDrawerSharedPreferences.getBoolean(SharedPreferencesUtils.COLLAPSE_POST_SECTION, false); collapsePreferencesSection = navigationDrawerSharedPreferences.getBoolean(SharedPreferencesUtils.COLLAPSE_PREFERENCES_SECTION, false); collapseFavoriteSubredditsSection = navigationDrawerSharedPreferences.getBoolean(SharedPreferencesUtils.COLLAPSE_FAVORITE_SUBREDDITS_SECTION, false); @@ -127,21 +130,25 @@ public class NavigationDrawerRecyclerViewAdapter extends RecyclerView.Adapter<Re if (isInMainPage) { if (isLoggedIn) { if (position == CURRENT_MENU_ITEMS - (collapseAccountSection ? ACCOUNT_SECTION_ITEMS : 0) + - (collapseRedditSection ? REDDIT_SECTION_ITEMS : 0) - (collapsePostSection ? POST_SECTION_ITEMS : 0) - (collapsePreferencesSection ? PREFERENCES_SECTION_ITEMS : 0)) { return VIEW_TYPE_MENU_GROUP_TITLE; } else if (!hideFavoriteSubredditsSection && !favoriteSubscribedSubreddits.isEmpty() && position == CURRENT_MENU_ITEMS - (collapseAccountSection ? ACCOUNT_SECTION_ITEMS : 0) + - (collapseRedditSection ? REDDIT_SECTION_ITEMS : 0) - (collapsePostSection ? POST_SECTION_ITEMS : 0) - (collapsePreferencesSection ? PREFERENCES_SECTION_ITEMS : 0) + (collapseFavoriteSubredditsSection ? 0 : favoriteSubscribedSubreddits.size()) + 1) { return VIEW_TYPE_MENU_GROUP_TITLE; } else if (position > CURRENT_MENU_ITEMS - (collapseAccountSection ? ACCOUNT_SECTION_ITEMS : 0) + - (collapseRedditSection ? REDDIT_SECTION_ITEMS : 0) - (collapsePostSection ? POST_SECTION_ITEMS : 0) - (collapsePreferencesSection ? PREFERENCES_SECTION_ITEMS : 0)) { if (!favoriteSubscribedSubreddits.isEmpty() && !hideFavoriteSubredditsSection && !collapseFavoriteSubredditsSection && position <= CURRENT_MENU_ITEMS - (collapseAccountSection ? ACCOUNT_SECTION_ITEMS : 0) + - (collapseRedditSection ? REDDIT_SECTION_ITEMS : 0) - (collapsePostSection ? POST_SECTION_ITEMS : 0) - (collapsePreferencesSection ? PREFERENCES_SECTION_ITEMS : 0) + favoriteSubscribedSubreddits.size()) { @@ -152,11 +159,17 @@ public class NavigationDrawerRecyclerViewAdapter extends RecyclerView.Adapter<Re } else if (position == 0) { return VIEW_TYPE_NAV_HEADER; } else if (position == 1 - || position == 6 - (collapseAccountSection ? ACCOUNT_SECTION_ITEMS : 0) - || position == 12 - (collapseAccountSection ? ACCOUNT_SECTION_ITEMS : 0) + || position == (ACCOUNT_SECTION_ITEMS + 2) - (collapseAccountSection ? ACCOUNT_SECTION_ITEMS : 0) + || position == (ACCOUNT_SECTION_ITEMS + REDDIT_SECTION_ITEMS + 3) + - (collapseAccountSection ? ACCOUNT_SECTION_ITEMS : 0) + - (collapseRedditSection ? REDDIT_SECTION_ITEMS : 0) + || position == (ACCOUNT_SECTION_ITEMS + REDDIT_SECTION_ITEMS + POST_SECTION_ITEMS + 4) + - (collapseAccountSection ? ACCOUNT_SECTION_ITEMS : 0) + - (collapseRedditSection ? REDDIT_SECTION_ITEMS : 0) - (collapsePostSection ? POST_SECTION_ITEMS : 0)) { return VIEW_TYPE_MENU_GROUP_TITLE; - } else if (position == 16 - (collapseAccountSection ? ACCOUNT_SECTION_ITEMS : 0) + } else if (position == (CURRENT_MENU_ITEMS - 1) - (collapseAccountSection ? ACCOUNT_SECTION_ITEMS : 0) + - (collapseRedditSection ? REDDIT_SECTION_ITEMS : 0) - (collapsePostSection ? POST_SECTION_ITEMS : 0) - (collapsePreferencesSection ? PREFERENCES_SECTION_ITEMS : 0)) { return VIEW_TYPE_DIVIDER; @@ -217,15 +230,13 @@ public class NavigationDrawerRecyclerViewAdapter extends RecyclerView.Adapter<Re @Override public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) { if (holder instanceof NavHeaderViewHolder) { + RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) ((NavHeaderViewHolder) holder).profileImageView.getLayoutParams(); if (showAvatarOnTheRightInTheNavigationDrawer) { - RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) ((NavHeaderViewHolder) holder).profileImageView.getLayoutParams(); params.addRule(RelativeLayout.ALIGN_PARENT_END); - ((NavHeaderViewHolder) holder).profileImageView.setLayoutParams(params); } else { - RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) ((NavHeaderViewHolder) holder).profileImageView.getLayoutParams(); params.removeRule(RelativeLayout.ALIGN_PARENT_END); - ((NavHeaderViewHolder) holder).profileImageView.setLayoutParams(params); } + ((NavHeaderViewHolder) holder).profileImageView.setLayoutParams(params); if (isLoggedIn) { ((NavHeaderViewHolder) holder).karmaTextView.setText(appCompatActivity.getString(R.string.karma_info, karma)); ((NavHeaderViewHolder) holder).accountNameTextView.setText(accountName); @@ -258,7 +269,7 @@ public class NavigationDrawerRecyclerViewAdapter extends RecyclerView.Adapter<Re ((NavHeaderViewHolder) holder).dropIconImageView.setImageDrawable(resources.getDrawable(R.drawable.ic_baseline_arrow_drop_up_24px)); } - ((NavHeaderViewHolder) holder).itemView.setOnClickListener(view -> { + holder.itemView.setOnClickListener(view -> { if (isInMainPage) { if (requireAuthToAccountSection) { BiometricManager biometricManager = BiometricManager.from(appCompatActivity); @@ -301,15 +312,27 @@ public class NavigationDrawerRecyclerViewAdapter extends RecyclerView.Adapter<Re ((MenuGroupTitleViewHolder) holder).collapseIndicatorImageView.setImageResource(R.drawable.ic_baseline_arrow_drop_down_24px); } type = 0; - } else if (position == 6 - (collapseAccountSection ? ACCOUNT_SECTION_ITEMS : 0)) { + } else if (position == (ACCOUNT_SECTION_ITEMS + 2) - (collapseAccountSection ? ACCOUNT_SECTION_ITEMS : 0)) { + ((MenuGroupTitleViewHolder) holder).titleTextView.setText(R.string.label_reddit); + if (collapseRedditSection) { + ((MenuGroupTitleViewHolder) holder).collapseIndicatorImageView.setImageResource(R.drawable.ic_baseline_arrow_drop_up_24px); + } else { + ((MenuGroupTitleViewHolder) holder).collapseIndicatorImageView.setImageResource(R.drawable.ic_baseline_arrow_drop_down_24px); + } + type = 1; + } else if (position == (ACCOUNT_SECTION_ITEMS + REDDIT_SECTION_ITEMS + 3) + - (collapseAccountSection ? ACCOUNT_SECTION_ITEMS : 0) + - (collapseRedditSection ? REDDIT_SECTION_ITEMS : 0)) { ((MenuGroupTitleViewHolder) holder).titleTextView.setText(R.string.label_post); if (collapsePostSection) { ((MenuGroupTitleViewHolder) holder).collapseIndicatorImageView.setImageResource(R.drawable.ic_baseline_arrow_drop_up_24px); } else { ((MenuGroupTitleViewHolder) holder).collapseIndicatorImageView.setImageResource(R.drawable.ic_baseline_arrow_drop_down_24px); } - type = 1; - } else if (position == 12 - (collapseAccountSection ? ACCOUNT_SECTION_ITEMS : 0) + type = 2; + } else if (position == (ACCOUNT_SECTION_ITEMS + REDDIT_SECTION_ITEMS + POST_SECTION_ITEMS + 4) + - (collapseAccountSection ? ACCOUNT_SECTION_ITEMS : 0) + - (collapseRedditSection ? REDDIT_SECTION_ITEMS : 0) - (collapsePostSection ? POST_SECTION_ITEMS : 0)) { ((MenuGroupTitleViewHolder) holder).titleTextView.setText(R.string.label_preferences); if (collapsePreferencesSection) { @@ -317,10 +340,11 @@ public class NavigationDrawerRecyclerViewAdapter extends RecyclerView.Adapter<Re } else { ((MenuGroupTitleViewHolder) holder).collapseIndicatorImageView.setImageResource(R.drawable.ic_baseline_arrow_drop_down_24px); } - type = 2; + type = 3; } else { if (!hideFavoriteSubredditsSection && !favoriteSubscribedSubreddits.isEmpty() && position == CURRENT_MENU_ITEMS - (collapseAccountSection ? ACCOUNT_SECTION_ITEMS : 0) + - (collapseRedditSection ? REDDIT_SECTION_ITEMS : 0) - (collapsePostSection ? POST_SECTION_ITEMS : 0) - (collapsePreferencesSection ? PREFERENCES_SECTION_ITEMS : 0)) { ((MenuGroupTitleViewHolder) holder).titleTextView.setText(R.string.favorites); @@ -329,7 +353,7 @@ public class NavigationDrawerRecyclerViewAdapter extends RecyclerView.Adapter<Re } else { ((MenuGroupTitleViewHolder) holder).collapseIndicatorImageView.setImageResource(R.drawable.ic_baseline_arrow_drop_down_24px); } - type = 3; + type = 4; } else { ((MenuGroupTitleViewHolder) holder).titleTextView.setText(R.string.subscriptions); if (collapseSubscribedSubredditsSection) { @@ -337,11 +361,11 @@ public class NavigationDrawerRecyclerViewAdapter extends RecyclerView.Adapter<Re } else { ((MenuGroupTitleViewHolder) holder).collapseIndicatorImageView.setImageResource(R.drawable.ic_baseline_arrow_drop_down_24px); } - type = 4; + type = 5; } } - ((MenuGroupTitleViewHolder) holder).itemView.setOnClickListener(view -> { + holder.itemView.setOnClickListener(view -> { switch (type) { case 0: if (collapseAccountSection) { @@ -353,6 +377,15 @@ public class NavigationDrawerRecyclerViewAdapter extends RecyclerView.Adapter<Re } break; case 1: + if (collapseRedditSection) { + collapseRedditSection = !collapseRedditSection; + notifyItemRangeInserted(holder.getBindingAdapterPosition() + 1, REDDIT_SECTION_ITEMS); + } else { + collapseRedditSection = !collapseRedditSection; + notifyItemRangeRemoved(holder.getBindingAdapterPosition() + 1, REDDIT_SECTION_ITEMS); + } + break; + case 2: if (collapsePostSection) { collapsePostSection = !collapsePostSection; notifyItemRangeInserted(holder.getBindingAdapterPosition() + 1, POST_SECTION_ITEMS); @@ -361,7 +394,7 @@ public class NavigationDrawerRecyclerViewAdapter extends RecyclerView.Adapter<Re notifyItemRangeRemoved(holder.getBindingAdapterPosition() + 1, POST_SECTION_ITEMS); } break; - case 2: + case 3: if (collapsePreferencesSection) { collapsePreferencesSection = !collapsePreferencesSection; notifyItemRangeInserted(holder.getBindingAdapterPosition() + 1, PREFERENCES_SECTION_ITEMS); @@ -370,7 +403,7 @@ public class NavigationDrawerRecyclerViewAdapter extends RecyclerView.Adapter<Re notifyItemRangeRemoved(holder.getBindingAdapterPosition() + 1, PREFERENCES_SECTION_ITEMS); } break; - case 3: + case 4: if (collapseFavoriteSubredditsSection) { collapseFavoriteSubredditsSection = !collapseFavoriteSubredditsSection; notifyItemRangeInserted(holder.getBindingAdapterPosition() + 1, favoriteSubscribedSubreddits.size()); @@ -379,7 +412,7 @@ public class NavigationDrawerRecyclerViewAdapter extends RecyclerView.Adapter<Re notifyItemRangeRemoved(holder.getBindingAdapterPosition() + 1, favoriteSubscribedSubreddits.size()); } break; - case 4: + case 5: if (collapseSubscribedSubredditsSection) { collapseSubscribedSubredditsSection = !collapseSubscribedSubredditsSection; notifyItemRangeInserted(holder.getBindingAdapterPosition() + 1, subscribedSubreddits.size()); @@ -399,14 +432,28 @@ public class NavigationDrawerRecyclerViewAdapter extends RecyclerView.Adapter<Re if (isInMainPage) { if (isLoggedIn) { int pseudoPosition = position; - if (collapseAccountSection && collapsePostSection) { - pseudoPosition += ACCOUNT_SECTION_ITEMS + POST_SECTION_ITEMS; - } else if (collapseAccountSection && collapsePreferencesSection) { - pseudoPosition += ACCOUNT_SECTION_ITEMS; + if (collapseAccountSection && collapseRedditSection && collapsePostSection) { + pseudoPosition += ACCOUNT_SECTION_ITEMS + REDDIT_SECTION_ITEMS + POST_SECTION_ITEMS; + } else if (collapseAccountSection && collapseRedditSection) { + pseudoPosition += ACCOUNT_SECTION_ITEMS + REDDIT_SECTION_ITEMS; + } else if (collapseAccountSection && collapsePostSection) { + if (position > REDDIT_SECTION_ITEMS + 2) { + pseudoPosition += ACCOUNT_SECTION_ITEMS + POST_SECTION_ITEMS; + } else { + pseudoPosition += ACCOUNT_SECTION_ITEMS; + } + } else if (collapseRedditSection && collapsePostSection) { + if (position > ACCOUNT_SECTION_ITEMS + 1) { + pseudoPosition += REDDIT_SECTION_ITEMS + POST_SECTION_ITEMS; + } } else if (collapseAccountSection) { pseudoPosition += ACCOUNT_SECTION_ITEMS; - } else if (collapsePostSection) { + } else if (collapseRedditSection) { if (position > ACCOUNT_SECTION_ITEMS + 1) { + pseudoPosition += REDDIT_SECTION_ITEMS; + } + } else if (collapsePostSection) { + if (position > ACCOUNT_SECTION_ITEMS + REDDIT_SECTION_ITEMS + 2) { pseudoPosition += POST_SECTION_ITEMS; } } @@ -431,32 +478,40 @@ public class NavigationDrawerRecyclerViewAdapter extends RecyclerView.Adapter<Re ((MenuItemViewHolder) holder).menuTextView.setText(R.string.inbox); } ((MenuItemViewHolder) holder).imageView.setImageDrawable(ContextCompat.getDrawable(appCompatActivity, R.drawable.ic_inbox_24dp)); - ((MenuItemViewHolder) holder).itemView.setOnClickListener(view -> { + holder.itemView.setOnClickListener(view -> { Intent intent = new Intent(appCompatActivity, InboxActivity.class); appCompatActivity.startActivity(intent); }); break; case 7: + stringId = R.string.rpan; + drawableId = R.drawable.ic_rpan_24dp; + break; + case 8: + stringId = R.string.trending; + drawableId = R.drawable.ic_trending_24dp; + break; + case 10: stringId = R.string.upvoted; drawableId = R.drawable.ic_arrow_upward_black_24dp; break; - case 8: + case 11: stringId = R.string.downvoted; drawableId = R.drawable.ic_arrow_downward_black_24dp; break; - case 9: + case 12: stringId = R.string.hidden; drawableId = R.drawable.ic_outline_lock_24dp; break; - case 10: + case 13: stringId = R.string.account_saved_thing_activity_label; drawableId = R.drawable.ic_outline_bookmarks_24dp; break; - case 11: + case 14: stringId = R.string.gilded; drawableId = R.drawable.ic_star_border_24dp; break; - case 13: + case 16: if ((resources.getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK) != Configuration.UI_MODE_NIGHT_YES) { stringId = R.string.dark_theme; drawableId = R.drawable.ic_dark_theme_24dp; @@ -465,7 +520,7 @@ public class NavigationDrawerRecyclerViewAdapter extends RecyclerView.Adapter<Re drawableId = R.drawable.ic_light_theme_24dp; } break; - case 14: + case 17: setOnClickListener = false; if (isNSFWEnabled) { stringId = R.string.disable_nsfw; @@ -475,21 +530,21 @@ public class NavigationDrawerRecyclerViewAdapter extends RecyclerView.Adapter<Re drawableId = R.drawable.ic_nsfw_on_24dp; } - ((MenuItemViewHolder) holder).itemView.setOnClickListener(view -> { + holder.itemView.setOnClickListener(view -> { if (isNSFWEnabled) { isNSFWEnabled = false; ((MenuItemViewHolder) holder).menuTextView.setText(R.string.enable_nsfw); - ((MenuItemViewHolder) holder).imageView.setImageDrawable(appCompatActivity.getDrawable(R.drawable.ic_nsfw_on_24dp)); + ((MenuItemViewHolder) holder).imageView.setImageDrawable(ContextCompat.getDrawable(appCompatActivity, R.drawable.ic_nsfw_on_24dp)); itemClickListener.onMenuClick(R.string.disable_nsfw); } else { isNSFWEnabled = true; ((MenuItemViewHolder) holder).menuTextView.setText(R.string.disable_nsfw); - ((MenuItemViewHolder) holder).imageView.setImageDrawable(appCompatActivity.getDrawable(R.drawable.ic_nsfw_off_24dp)); + ((MenuItemViewHolder) holder).imageView.setImageDrawable(ContextCompat.getDrawable(appCompatActivity, R.drawable.ic_nsfw_off_24dp)); itemClickListener.onMenuClick(R.string.enable_nsfw); } }); break; - case 15: + case 18: stringId = R.string.settings; drawableId = R.drawable.ic_settings_24dp; } @@ -518,16 +573,16 @@ public class NavigationDrawerRecyclerViewAdapter extends RecyclerView.Adapter<Re drawableId = R.drawable.ic_nsfw_on_24dp; } - ((MenuItemViewHolder) holder).itemView.setOnClickListener(view -> { + holder.itemView.setOnClickListener(view -> { if (isNSFWEnabled) { isNSFWEnabled = false; ((MenuItemViewHolder) holder).menuTextView.setText(R.string.enable_nsfw); - ((MenuItemViewHolder) holder).imageView.setImageDrawable(appCompatActivity.getDrawable(R.drawable.ic_nsfw_on_24dp)); + ((MenuItemViewHolder) holder).imageView.setImageDrawable(ContextCompat.getDrawable(appCompatActivity, R.drawable.ic_nsfw_on_24dp)); itemClickListener.onMenuClick(R.string.disable_nsfw); } else { isNSFWEnabled = true; ((MenuItemViewHolder) holder).menuTextView.setText(R.string.disable_nsfw); - ((MenuItemViewHolder) holder).imageView.setImageDrawable(appCompatActivity.getDrawable(R.drawable.ic_nsfw_off_24dp)); + ((MenuItemViewHolder) holder).imageView.setImageDrawable(ContextCompat.getDrawable(appCompatActivity, R.drawable.ic_nsfw_off_24dp)); itemClickListener.onMenuClick(R.string.enable_nsfw); } }); @@ -558,15 +613,16 @@ public class NavigationDrawerRecyclerViewAdapter extends RecyclerView.Adapter<Re if (stringId != 0) { ((MenuItemViewHolder) holder).menuTextView.setText(stringId); - ((MenuItemViewHolder) holder).imageView.setImageDrawable(appCompatActivity.getDrawable(drawableId)); + ((MenuItemViewHolder) holder).imageView.setImageDrawable(ContextCompat.getDrawable(appCompatActivity, drawableId)); if (setOnClickListener) { int finalStringId = stringId; - ((MenuItemViewHolder) holder).itemView.setOnClickListener(view -> itemClickListener.onMenuClick(finalStringId)); + holder.itemView.setOnClickListener(view -> itemClickListener.onMenuClick(finalStringId)); } } } else if (holder instanceof FavoriteSubscribedThingViewHolder) { SubscribedSubredditData subreddit = favoriteSubscribedSubreddits.get(position - (CURRENT_MENU_ITEMS - (collapseAccountSection ? ACCOUNT_SECTION_ITEMS : 0) + - (collapseRedditSection ? REDDIT_SECTION_ITEMS : 0) - (collapsePostSection ? POST_SECTION_ITEMS : 0) - (collapsePreferencesSection ? PREFERENCES_SECTION_ITEMS : 0)) - 1); @@ -585,17 +641,19 @@ public class NavigationDrawerRecyclerViewAdapter extends RecyclerView.Adapter<Re .into(((FavoriteSubscribedThingViewHolder) holder).iconGifImageView); } - ((FavoriteSubscribedThingViewHolder) holder).itemView.setOnClickListener(view -> { + holder.itemView.setOnClickListener(view -> { itemClickListener.onSubscribedSubredditClick(subredditName); }); } else if (holder instanceof SubscribedThingViewHolder) { SubscribedSubredditData subreddit = favoriteSubscribedSubreddits.isEmpty() || hideFavoriteSubredditsSection ? subscribedSubreddits.get(position - (CURRENT_MENU_ITEMS - (collapseAccountSection ? ACCOUNT_SECTION_ITEMS : 0) + - (collapseRedditSection ? REDDIT_SECTION_ITEMS : 0) - (collapsePostSection ? POST_SECTION_ITEMS : 0) - (collapsePreferencesSection ? PREFERENCES_SECTION_ITEMS : 0)) - 1) : subscribedSubreddits.get(position - (CURRENT_MENU_ITEMS - (collapseAccountSection ? ACCOUNT_SECTION_ITEMS : 0) + - (collapseRedditSection ? REDDIT_SECTION_ITEMS : 0) - (collapsePostSection ? POST_SECTION_ITEMS : 0) - (collapsePreferencesSection ? PREFERENCES_SECTION_ITEMS : 0)) - (collapseFavoriteSubredditsSection ? 0 : favoriteSubscribedSubreddits.size()) @@ -615,7 +673,7 @@ public class NavigationDrawerRecyclerViewAdapter extends RecyclerView.Adapter<Re .into(((SubscribedThingViewHolder) holder).iconGifImageView); } - ((SubscribedThingViewHolder) holder).itemView.setOnClickListener(view -> { + holder.itemView.setOnClickListener(view -> { itemClickListener.onSubscribedSubredditClick(subredditName); }); } else if (holder instanceof AccountViewHolder) { @@ -624,7 +682,7 @@ public class NavigationDrawerRecyclerViewAdapter extends RecyclerView.Adapter<Re .apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(128, 0))) .into(((AccountViewHolder) holder).profileImageGifImageView); ((AccountViewHolder) holder).usernameTextView.setText(accounts.get(position - 1).getAccountName()); - ((AccountViewHolder) holder).itemView.setOnClickListener(view -> + holder.itemView.setOnClickListener(view -> itemClickListener.onAccountClick(accounts.get(position - 1).getAccountName())); } } @@ -669,18 +727,21 @@ public class NavigationDrawerRecyclerViewAdapter extends RecyclerView.Adapter<Re if (hideFavoriteSubredditsSection && hideSubscribedSubredditsSection) { return CURRENT_MENU_ITEMS - (collapseAccountSection ? ACCOUNT_SECTION_ITEMS : 0) + - (collapseRedditSection ? REDDIT_SECTION_ITEMS : 0) - (collapsePostSection ? POST_SECTION_ITEMS : 0) - (collapsePreferencesSection ? PREFERENCES_SECTION_ITEMS : 0); } else if (hideFavoriteSubredditsSection) { return CURRENT_MENU_ITEMS + (subscribedSubreddits.isEmpty() ? 0 : subscribedSubreddits.size() + 1) - (collapseAccountSection ? ACCOUNT_SECTION_ITEMS : 0) + - (collapseRedditSection ? REDDIT_SECTION_ITEMS : 0) - (collapsePostSection ? POST_SECTION_ITEMS : 0) - (collapsePreferencesSection ? PREFERENCES_SECTION_ITEMS : 0) - (collapseSubscribedSubredditsSection ? subscribedSubreddits.size() : 0); } else if (hideSubscribedSubredditsSection) { return CURRENT_MENU_ITEMS + (favoriteSubscribedSubreddits.isEmpty() ? 0 : favoriteSubscribedSubreddits.size() + 1) - (collapseAccountSection ? ACCOUNT_SECTION_ITEMS : 0) + - (collapseRedditSection ? REDDIT_SECTION_ITEMS : 0) - (collapsePostSection ? POST_SECTION_ITEMS : 0) - (collapsePreferencesSection ? PREFERENCES_SECTION_ITEMS : 0) - (collapseFavoriteSubredditsSection ? favoriteSubscribedSubreddits.size() : 0); @@ -688,6 +749,7 @@ public class NavigationDrawerRecyclerViewAdapter extends RecyclerView.Adapter<Re return CURRENT_MENU_ITEMS + (favoriteSubscribedSubreddits.isEmpty() ? 0 : favoriteSubscribedSubreddits.size() + 1) + (subscribedSubreddits.isEmpty() ? 0 : subscribedSubreddits.size() + 1) - (collapseAccountSection ? ACCOUNT_SECTION_ITEMS : 0) + - (collapseRedditSection ? REDDIT_SECTION_ITEMS : 0) - (collapsePostSection ? POST_SECTION_ITEMS : 0) - (collapsePreferencesSection ? PREFERENCES_SECTION_ITEMS : 0) - (collapseFavoriteSubredditsSection ? favoriteSubscribedSubreddits.size() : 0) @@ -695,6 +757,7 @@ public class NavigationDrawerRecyclerViewAdapter extends RecyclerView.Adapter<Re } return CURRENT_MENU_ITEMS - 1 - (collapseAccountSection ? ACCOUNT_SECTION_ITEMS : 0) + - (collapseRedditSection ? REDDIT_SECTION_ITEMS : 0) - (collapsePostSection ? POST_SECTION_ITEMS : 0) - (collapsePreferencesSection ? PREFERENCES_SECTION_ITEMS : 0); } else { diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostDetailRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostDetailRecyclerViewAdapter.java index 323e22c6..5529f1fd 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostDetailRecyclerViewAdapter.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostDetailRecyclerViewAdapter.java @@ -1,5 +1,7 @@ package ml.docilealligator.infinityforreddit.adapters; +import static ml.docilealligator.infinityforreddit.activities.CommentActivity.WRITE_COMMENT_REQUEST_CODE; + import android.content.Intent; import android.content.SharedPreferences; import android.content.res.ColorStateList; @@ -33,7 +35,6 @@ import androidx.constraintlayout.widget.ConstraintLayout; import androidx.constraintlayout.widget.ConstraintSet; import androidx.core.graphics.drawable.DrawableCompat; import androidx.recyclerview.widget.ItemTouchHelper; -import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; import com.bumptech.glide.RequestBuilder; @@ -103,9 +104,9 @@ import ml.docilealligator.infinityforreddit.asynctasks.LoadUserData; import ml.docilealligator.infinityforreddit.bottomsheetfragments.CopyTextBottomSheetFragment; import ml.docilealligator.infinityforreddit.bottomsheetfragments.ShareLinkBottomSheetFragment; import ml.docilealligator.infinityforreddit.bottomsheetfragments.UrlMenuBottomSheetFragment; -import ml.docilealligator.infinityforreddit.comment.Comment; import ml.docilealligator.infinityforreddit.customtheme.CustomThemeWrapper; import ml.docilealligator.infinityforreddit.customviews.AspectRatioGifImageView; +import ml.docilealligator.infinityforreddit.customviews.LinearLayoutManagerBugFixed; import ml.docilealligator.infinityforreddit.customviews.MarkwonLinearLayoutManager; import ml.docilealligator.infinityforreddit.fragments.ViewPostDetailFragment; import ml.docilealligator.infinityforreddit.post.Post; @@ -116,8 +117,6 @@ import ml.docilealligator.infinityforreddit.utils.Utils; import pl.droidsonroids.gif.GifImageView; import retrofit2.Retrofit; -import static ml.docilealligator.infinityforreddit.activities.CommentActivity.WRITE_COMMENT_REQUEST_CODE; - public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> implements CacheManager { private static final int VIEW_TYPE_POST_DETAIL_VIDEO_AUTOPLAY = 1; private static final int VIEW_TYPE_POST_DETAIL_VIDEO_AND_GIF_PREVIEW = 2; @@ -143,38 +142,32 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler private String mAccessToken; private String mAccountName; private Post mPost; - private ArrayList<Comment> mVisibleComments; private String mSubredditNamePrefixed; private Locale mLocale; - private String mSingleCommentId; - private boolean mIsSingleCommentThreadMode; private boolean mNeedBlurNsfw; private boolean mDoNotBlurNsfwInNsfwSubreddits; private boolean mNeedBlurSpoiler; private boolean mVoteButtonsOnTheRight; private boolean mShowElapsedTime; private String mTimeFormatPattern; - private boolean mExpandChildren; - private boolean mCommentToolbarHidden; - private boolean mCommentToolbarHideOnClick; - private boolean mSwapTapAndLong; - private boolean mShowCommentDivider; private boolean mShowAbsoluteNumberOfVotes; private boolean mAutoplay = false; private boolean mAutoplayNsfwVideos; private boolean mMuteAutoplayingVideos; - private boolean mFullyCollapseComment; private double mStartAutoplayVisibleAreaOffset; private boolean mMuteNSFWVideo; private boolean mAutomaticallyTryRedgifs; private boolean mDataSavingMode; private boolean mDisableImagePreview; private boolean mOnlyDisablePreviewInVideoAndGifPosts; + private boolean mHidePostType; + private boolean mHidePostFlair; + private boolean mHideTheNumberOfAwards; + private boolean mHideSubredditAndUserPrefix; + private boolean mHideTheNumberOfVotes; + private boolean mHideTheNumberOfComments; + private boolean mSeparatePostAndComments; private PostDetailRecyclerViewAdapterCallback mPostDetailRecyclerViewAdapterCallback; - private boolean isInitiallyLoading; - private boolean isInitiallyLoadingFailed; - private boolean mHasMoreComments; - private boolean loadMoreCommentsFailed; private int mColorAccent; private int mCardViewColor; @@ -202,21 +195,22 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler private int mDownvotedColor; private int mVoteAndReplyUnavailableVoteButtonColor; private int mPostIconAndInfoColor; - private int mCommentIconAndInfoColor; private Drawable mCommentIcon; private float mScale; private ExoCreator mExoCreator; - public PostDetailRecyclerViewAdapter(AppCompatActivity activity, ViewPostDetailFragment fragment, Executor executor, CustomThemeWrapper customThemeWrapper, + public PostDetailRecyclerViewAdapter(AppCompatActivity activity, ViewPostDetailFragment fragment, + Executor executor, CustomThemeWrapper customThemeWrapper, Retrofit retrofit, Retrofit oauthRetrofit, Retrofit gfycatRetrofit, - Retrofit redgifsRetrofit, - RedditDataRoomDatabase redditDataRoomDatabase, RequestManager glide, - int imageViewWidth, String accessToken, String accountName, - Post post, Locale locale, String singleCommentId, - boolean isSingleCommentThreadMode, + Retrofit redgifsRetrofit, RedditDataRoomDatabase redditDataRoomDatabase, + RequestManager glide, int imageViewWidth, + boolean separatePostAndComments, String accessToken, + String accountName, Post post, Locale locale, SharedPreferences sharedPreferences, - SharedPreferences nsfwAndSpoilerSharedPreferences, ExoCreator exoCreator, + SharedPreferences nsfwAndSpoilerSharedPreferences, + SharedPreferences postDetailsSharedPreferences, + ExoCreator exoCreator, PostDetailRecyclerViewAdapterCallback postDetailRecyclerViewAdapterCallback) { mActivity = activity; mFragment = fragment; @@ -343,14 +337,12 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler .textLayoutIsRoot(R.layout.view_table_entry_cell))) .build(); mImageViewWidth = imageViewWidth; + mSeparatePostAndComments = separatePostAndComments; mAccessToken = accessToken; mAccountName = accountName; mPost = post; - mVisibleComments = new ArrayList<>(); mSubredditNamePrefixed = post.getSubredditNamePrefixed(); mLocale = locale; - mSingleCommentId = singleCommentId; - mIsSingleCommentThreadMode = isSingleCommentThreadMode; mNeedBlurNsfw = nsfwAndSpoilerSharedPreferences.getBoolean((mAccountName == null ? "" : mAccountName) + SharedPreferencesUtils.BLUR_NSFW_BASE, true); mDoNotBlurNsfwInNsfwSubreddits = nsfwAndSpoilerSharedPreferences.getBoolean((mAccountName == null ? "" : mAccountName) + SharedPreferencesUtils.DO_NOT_BLUR_NSFW_IN_NSFW_SUBREDDITS, false); @@ -358,11 +350,6 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler mVoteButtonsOnTheRight = sharedPreferences.getBoolean(SharedPreferencesUtils.VOTE_BUTTONS_ON_THE_RIGHT_KEY, false); mShowElapsedTime = sharedPreferences.getBoolean(SharedPreferencesUtils.SHOW_ELAPSED_TIME_KEY, false); mTimeFormatPattern = sharedPreferences.getString(SharedPreferencesUtils.TIME_FORMAT_KEY, SharedPreferencesUtils.TIME_FORMAT_DEFAULT_VALUE); - mExpandChildren = !sharedPreferences.getBoolean(SharedPreferencesUtils.SHOW_TOP_LEVEL_COMMENTS_FIRST, false); - mCommentToolbarHidden = sharedPreferences.getBoolean(SharedPreferencesUtils.COMMENT_TOOLBAR_HIDDEN, false); - mCommentToolbarHideOnClick = sharedPreferences.getBoolean(SharedPreferencesUtils.COMMENT_TOOLBAR_HIDE_ON_CLICK, true); - mSwapTapAndLong = sharedPreferences.getBoolean(SharedPreferencesUtils.SWAP_TAP_AND_LONG_COMMENTS, false); - mShowCommentDivider = sharedPreferences.getBoolean(SharedPreferencesUtils.SHOW_COMMENT_DIVIDER, false); mShowAbsoluteNumberOfVotes = sharedPreferences.getBoolean(SharedPreferencesUtils.SHOW_ABSOLUTE_NUMBER_OF_VOTES, true); String autoplayString = sharedPreferences.getString(SharedPreferencesUtils.VIDEO_AUTOPLAY, SharedPreferencesUtils.VIDEO_AUTOPLAY_VALUE_NEVER); @@ -374,7 +361,6 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler } mAutoplayNsfwVideos = sharedPreferences.getBoolean(SharedPreferencesUtils.AUTOPLAY_NSFW_VIDEOS, true); mMuteAutoplayingVideos = sharedPreferences.getBoolean(SharedPreferencesUtils.MUTE_AUTOPLAYING_VIDEOS, true); - mFullyCollapseComment = sharedPreferences.getBoolean(SharedPreferencesUtils.FULLY_COLLAPSE_COMMENT, false); Resources resources = activity.getResources(); mStartAutoplayVisibleAreaOffset = resources.getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT ? @@ -393,11 +379,14 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler mDisableImagePreview = sharedPreferences.getBoolean(SharedPreferencesUtils.DISABLE_IMAGE_PREVIEW, false); mOnlyDisablePreviewInVideoAndGifPosts = sharedPreferences.getBoolean(SharedPreferencesUtils.ONLY_DISABLE_PREVIEW_IN_VIDEO_AND_GIF_POSTS, false); + mHidePostType = postDetailsSharedPreferences.getBoolean(SharedPreferencesUtils.HIDE_POST_TYPE, false); + mHidePostFlair = postDetailsSharedPreferences.getBoolean(SharedPreferencesUtils.HIDE_POST_FLAIR, false); + mHideTheNumberOfAwards = postDetailsSharedPreferences.getBoolean(SharedPreferencesUtils.HIDE_THE_NUMBER_OF_AWARDS, false); + mHideSubredditAndUserPrefix = postDetailsSharedPreferences.getBoolean(SharedPreferencesUtils.HIDE_SUBREDDIT_AND_USER_PREFIX, false); + mHideTheNumberOfVotes = postDetailsSharedPreferences.getBoolean(SharedPreferencesUtils.HIDE_THE_NUMBER_OF_VOTES, false); + mHideTheNumberOfComments = postDetailsSharedPreferences.getBoolean(SharedPreferencesUtils.HIDE_THE_NUMBER_OF_COMMENTS, false); + mPostDetailRecyclerViewAdapterCallback = postDetailRecyclerViewAdapterCallback; - isInitiallyLoading = true; - isInitiallyLoadingFailed = false; - mHasMoreComments = false; - loadMoreCommentsFailed = false; mScale = resources.getDisplayMetrics().density; mColorAccent = customThemeWrapper.getColorAccent(); @@ -425,7 +414,6 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler mDownvotedColor = customThemeWrapper.getDownvoted(); mVoteAndReplyUnavailableVoteButtonColor = customThemeWrapper.getVoteAndReplyUnavailableButtonColor(); mPostIconAndInfoColor = customThemeWrapper.getPostIconAndInfoColor(); - mCommentIconAndInfoColor = customThemeWrapper.getCommentIconAndInfoColor(); mCommentIcon = activity.getDrawable(R.drawable.ic_comment_grey_24dp); if (mCommentIcon != null) { @@ -439,7 +427,7 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler public int getItemViewType(int position) { switch (mPost.getPostType()) { case Post.VIDEO_TYPE: - if (mAutoplay) { + if (mAutoplay && !mSeparatePostAndComments) { if (!mAutoplayNsfwVideos && mPost.isNSFW()) { return VIEW_TYPE_POST_DETAIL_VIDEO_AND_GIF_PREVIEW; } @@ -615,8 +603,13 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler ((PostDetailBaseViewHolder) holder).mCrosspostImageView.setVisibility(View.VISIBLE); } - ((PostDetailBaseViewHolder) holder).mSubredditTextView.setText(mPost.getSubredditNamePrefixed()); - ((PostDetailBaseViewHolder) holder).mUserTextView.setText(mPost.getAuthorNamePrefixed()); + if (!mHideSubredditAndUserPrefix) { + ((PostDetailBaseViewHolder) holder).mSubredditTextView.setText(mPost.getSubredditNamePrefixed()); + ((PostDetailBaseViewHolder) holder).mUserTextView.setText(mPost.getAuthorNamePrefixed()); + } else { + ((PostDetailBaseViewHolder) holder).mSubredditTextView.setText(mPost.getSubredditName()); + ((PostDetailBaseViewHolder) holder).mUserTextView.setText(mPost.getAuthor()); + } if (mShowElapsedTime) { ((PostDetailBaseViewHolder) holder).mPostTimeTextView.setText( @@ -637,12 +630,12 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler ((PostDetailBaseViewHolder) holder).mSpoilerTextView.setVisibility(View.VISIBLE); } - if (mPost.getFlair() != null && !mPost.getFlair().equals("")) { + if (!mHidePostFlair && mPost.getFlair() != null && !mPost.getFlair().equals("")) { ((PostDetailBaseViewHolder) holder).mFlairTextView.setVisibility(View.VISIBLE); Utils.setHTMLWithImageToTextView(((PostDetailBaseViewHolder) holder).mFlairTextView, mPost.getFlair(), false); } - if (mPost.getAwards() != null && !mPost.getAwards().equals("")) { + if (!mHideTheNumberOfAwards && mPost.getAwards() != null && !mPost.getAwards().equals("")) { ((PostDetailBaseViewHolder) holder).mAwardsTextView.setVisibility(View.VISIBLE); Utils.setHTMLWithImageToTextView(((PostDetailBaseViewHolder) holder).mAwardsTextView, mPost.getAwards(), true); } @@ -655,7 +648,11 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler ((PostDetailBaseViewHolder) holder).mNSFWTextView.setVisibility(View.GONE); } - ((PostDetailBaseViewHolder) holder).mScoreTextView.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, mPost.getScore() + mPost.getVoteType())); + if (!mHideTheNumberOfVotes) { + ((PostDetailBaseViewHolder) holder).mScoreTextView.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, mPost.getScore() + mPost.getVoteType())); + } else { + ((PostDetailBaseViewHolder) holder).mScoreTextView.setText(mActivity.getString(R.string.vote)); + } ((PostDetailBaseViewHolder) holder).commentsCountTextView.setText(Integer.toString(mPost.getNComments())); @@ -703,10 +700,12 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler ((PostDetailVideoAutoplayViewHolder) holder).bindVideoUri(Uri.parse(mPost.getVideoUrl())); } } else if (holder instanceof PostDetailVideoAndGifPreviewHolder) { - if (mPost.getPostType() == Post.GIF_TYPE) { - ((PostDetailVideoAndGifPreviewHolder) holder).mTypeTextView.setText(mActivity.getString(R.string.gif)); - } else { - ((PostDetailVideoAndGifPreviewHolder) holder).mTypeTextView.setText(mActivity.getString(R.string.video)); + if (!mHidePostType) { + if (mPost.getPostType() == Post.GIF_TYPE) { + ((PostDetailVideoAndGifPreviewHolder) holder).mTypeTextView.setText(mActivity.getString(R.string.gif)); + } else { + ((PostDetailVideoAndGifPreviewHolder) holder).mTypeTextView.setText(mActivity.getString(R.string.video)); + } } Post.Preview preview = getSuitablePreview(mPost.getPreviews()); if (preview != null) { @@ -714,10 +713,12 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler loadImage((PostDetailVideoAndGifPreviewHolder) holder, preview); } } else if (holder instanceof PostDetailImageAndGifAutoplayViewHolder) { - if (mPost.getPostType() == Post.IMAGE_TYPE) { - ((PostDetailImageAndGifAutoplayViewHolder) holder).mTypeTextView.setText(R.string.image); - } else { - ((PostDetailImageAndGifAutoplayViewHolder) holder).mTypeTextView.setText(R.string.gif); + if (!mHidePostType) { + if (mPost.getPostType() == Post.IMAGE_TYPE) { + ((PostDetailImageAndGifAutoplayViewHolder) holder).mTypeTextView.setText(R.string.image); + } else { + ((PostDetailImageAndGifAutoplayViewHolder) holder).mTypeTextView.setText(R.string.gif); + } } Post.Preview preview = getSuitablePreview(mPost.getPreviews()); @@ -744,7 +745,9 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler } else if (holder instanceof PostDetailNoPreviewViewHolder) { if (mPost.getPostType() == Post.LINK_TYPE || mPost.getPostType() == Post.NO_PREVIEW_LINK_TYPE) { - ((PostDetailNoPreviewViewHolder) holder).mTypeTextView.setText(R.string.link); + if (!mHidePostType) { + ((PostDetailNoPreviewViewHolder) holder).mTypeTextView.setText(R.string.link); + } String noPreviewLinkDomain = Uri.parse(mPost.getUrl()).getHost(); ((PostDetailNoPreviewViewHolder) holder).mLinkTextView.setVisibility(View.VISIBLE); ((PostDetailNoPreviewViewHolder) holder).mLinkTextView.setText(noPreviewLinkDomain); @@ -753,27 +756,35 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler ((PostDetailNoPreviewViewHolder) holder).mLinkTextView.setVisibility(View.GONE); switch (mPost.getPostType()) { case Post.VIDEO_TYPE: - ((PostDetailNoPreviewViewHolder) holder).mTypeTextView.setText(R.string.video); + if (!mHidePostType) { + ((PostDetailNoPreviewViewHolder) holder).mTypeTextView.setText(R.string.video); + } ((PostDetailNoPreviewViewHolder) holder).mNoPreviewPostTypeImageView.setImageResource(R.drawable.ic_outline_video_24dp); break; case Post.IMAGE_TYPE: - ((PostDetailNoPreviewViewHolder) holder).mTypeTextView.setText(R.string.image); + if (!mHidePostType) { + ((PostDetailNoPreviewViewHolder) holder).mTypeTextView.setText(R.string.image); + } ((PostDetailNoPreviewViewHolder) holder).mNoPreviewPostTypeImageView.setImageResource(R.drawable.ic_image_24dp); break; case Post.GIF_TYPE: - ((PostDetailNoPreviewViewHolder) holder).mTypeTextView.setText(R.string.gif); + if (!mHidePostType) { + ((PostDetailNoPreviewViewHolder) holder).mTypeTextView.setText(R.string.gif); + } ((PostDetailNoPreviewViewHolder) holder).mNoPreviewPostTypeImageView.setImageResource(R.drawable.ic_image_24dp); break; case Post.GALLERY_TYPE: - ((PostDetailNoPreviewViewHolder) holder).mTypeTextView.setText(R.string.gallery); - ((PostDetailNoPreviewViewHolder) holder).mNoPreviewPostTypeImageView.setImageResource(R.drawable.ic_gallery_24dp); + if (!mHidePostType) { + ((PostDetailNoPreviewViewHolder) holder).mTypeTextView.setText(R.string.gallery); + } + ((PostDetailNoPreviewViewHolder) holder).mNoPreviewPostTypeImageView.setImageResource(R.drawable.ic_gallery_reverse_color_24dp); break; } } if (mPost.getSelfText() != null && !mPost.getSelfText().equals("")) { ((PostDetailNoPreviewViewHolder) holder).mContentMarkdownView.setVisibility(View.VISIBLE); - LinearLayoutManager linearLayoutManager = new MarkwonLinearLayoutManager(mActivity, new MarkwonLinearLayoutManager.HorizontalScrollViewScrolledListener() { + LinearLayoutManagerBugFixed linearLayoutManager = new MarkwonLinearLayoutManager(mActivity, new MarkwonLinearLayoutManager.HorizontalScrollViewScrolledListener() { @Override public void onScrolledLeft() { ((ViewPostDetailActivity) mActivity).lockSwipeRightToGoBack(); @@ -803,7 +814,7 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler } else if (holder instanceof PostDetailTextViewHolder) { if (mPost.getSelfText() != null && !mPost.getSelfText().equals("")) { ((PostDetailTextViewHolder) holder).mContentMarkdownView.setVisibility(View.VISIBLE); - LinearLayoutManager linearLayoutManager = new MarkwonLinearLayoutManager(mActivity, new MarkwonLinearLayoutManager.HorizontalScrollViewScrolledListener() { + LinearLayoutManagerBugFixed linearLayoutManager = new MarkwonLinearLayoutManager(mActivity, new MarkwonLinearLayoutManager.HorizontalScrollViewScrolledListener() { @Override public void onScrolledLeft() { ((ViewPostDetailActivity) mActivity).lockSwipeRightToGoBack(); @@ -867,7 +878,8 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler private void loadImage(PostDetailBaseViewHolder holder, @NonNull Post.Preview preview) { if (holder instanceof PostDetailImageAndGifAutoplayViewHolder) { - String url = mPost.getPostType() == Post.IMAGE_TYPE ? preview.getPreviewUrl() : mPost.getUrl(); + boolean blurImage = (mPost.isNSFW() && mNeedBlurNsfw && !(mDoNotBlurNsfwInNsfwSubreddits && mFragment != null && mFragment.getIsNsfwSubreddit()) && !(mPost.getPostType() == Post.GIF_TYPE && mAutoplayNsfwVideos)) || (mPost.isSpoiler() && mNeedBlurSpoiler); + String url = mPost.getPostType() == Post.IMAGE_TYPE || blurImage ? preview.getPreviewUrl() : mPost.getUrl(); RequestBuilder<Drawable> imageRequestBuilder = mGlide.load(url) .listener(new RequestListener<Drawable>() { @Override @@ -889,7 +901,7 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler } }); - if ((mPost.isNSFW() && mNeedBlurNsfw && !(mDoNotBlurNsfwInNsfwSubreddits && mFragment != null && mFragment.getIsNsfwSubreddit()) && !(mPost.getPostType() == Post.GIF_TYPE && mAutoplayNsfwVideos)) || (mPost.isSpoiler() && mNeedBlurSpoiler)) { + if (blurImage) { imageRequestBuilder.apply(RequestOptions.bitmapTransform(new BlurTransformation(50, 10))).into(((PostDetailImageAndGifAutoplayViewHolder) holder).mImageView); } else { if (mImageViewWidth > preview.getPreviewWidth()) { @@ -1196,21 +1208,29 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler mActivity.startActivity(crosspostIntent); }); - mTypeTextView.setOnClickListener(view -> { - Intent intent = new Intent(mActivity, FilteredPostsActivity.class); - intent.putExtra(FilteredPostsActivity.EXTRA_NAME, mSubredditNamePrefixed.substring(2)); - intent.putExtra(FilteredPostsActivity.EXTRA_POST_TYPE, PostDataSource.TYPE_SUBREDDIT); - intent.putExtra(FilteredPostsActivity.EXTRA_FILTER, mPost.getPostType()); - mActivity.startActivity(intent); - }); + if (!mHidePostType) { + mTypeTextView.setOnClickListener(view -> { + Intent intent = new Intent(mActivity, FilteredPostsActivity.class); + intent.putExtra(FilteredPostsActivity.EXTRA_NAME, mSubredditNamePrefixed.substring(2)); + intent.putExtra(FilteredPostsActivity.EXTRA_POST_TYPE, PostDataSource.TYPE_SUBREDDIT); + intent.putExtra(FilteredPostsActivity.EXTRA_FILTER, mPost.getPostType()); + mActivity.startActivity(intent); + }); + } else { + mTypeTextView.setVisibility(View.GONE); + } - mFlairTextView.setOnClickListener(view -> { - Intent intent = new Intent(mActivity, FilteredPostsActivity.class); - intent.putExtra(FilteredPostsActivity.EXTRA_NAME, mSubredditNamePrefixed.substring(2)); - intent.putExtra(FilteredPostsActivity.EXTRA_POST_TYPE, PostDataSource.TYPE_SUBREDDIT); - intent.putExtra(FilteredPostsActivity.EXTRA_CONTAIN_FLAIR, mPost.getFlair()); - mActivity.startActivity(intent); - }); + if (!mHidePostFlair) { + mFlairTextView.setOnClickListener(view -> { + Intent intent = new Intent(mActivity, FilteredPostsActivity.class); + intent.putExtra(FilteredPostsActivity.EXTRA_NAME, mSubredditNamePrefixed.substring(2)); + intent.putExtra(FilteredPostsActivity.EXTRA_POST_TYPE, PostDataSource.TYPE_SUBREDDIT); + intent.putExtra(FilteredPostsActivity.EXTRA_CONTAIN_FLAIR, mPost.getFlair()); + mActivity.startActivity(intent); + }); + } else { + mFlairTextView.setVisibility(View.GONE); + } mNSFWTextView.setOnClickListener(view -> { Intent intent = new Intent(mActivity, FilteredPostsActivity.class); @@ -1254,8 +1274,10 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler mScoreTextView.setTextColor(mPostIconAndInfoColor); } - mScoreTextView.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, - mPost.getScore() + mPost.getVoteType())); + if (!mHideTheNumberOfVotes) { + mScoreTextView.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, + mPost.getScore() + mPost.getVoteType())); + } mPostDetailRecyclerViewAdapterCallback.updatePost(mPost); @@ -1273,8 +1295,10 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler } mDownvoteButton.setColorFilter(mPostIconAndInfoColor, android.graphics.PorterDuff.Mode.SRC_IN); - mScoreTextView.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, - mPost.getScore() + mPost.getVoteType())); + if (!mHideTheNumberOfVotes) { + mScoreTextView.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, + mPost.getScore() + mPost.getVoteType())); + } mPostDetailRecyclerViewAdapterCallback.updatePost(mPost); } @@ -1283,8 +1307,10 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler public void onVoteThingFail() { Toast.makeText(mActivity, R.string.vote_failed, Toast.LENGTH_SHORT).show(); mPost.setVoteType(previousVoteType); - mScoreTextView.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, - mPost.getScore() + previousVoteType)); + if (!mHideTheNumberOfVotes) { + mScoreTextView.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, + mPost.getScore() + previousVoteType)); + } mUpvoteButton.setColorFilter(previousUpvoteButtonColorFilter); mDownvoteButton.setColorFilter(previousDownvoteButtonColorFilter); mScoreTextView.setTextColor(previousScoreTextViewColor); @@ -1328,8 +1354,10 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler mScoreTextView.setTextColor(mPostIconAndInfoColor); } - mScoreTextView.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, - mPost.getScore() + mPost.getVoteType())); + if (!mHideTheNumberOfVotes) { + mScoreTextView.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, + mPost.getScore() + mPost.getVoteType())); + } mPostDetailRecyclerViewAdapterCallback.updatePost(mPost); @@ -1347,8 +1375,10 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler } mUpvoteButton.setColorFilter(mPostIconAndInfoColor, android.graphics.PorterDuff.Mode.SRC_IN); - mScoreTextView.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, - mPost.getScore() + mPost.getVoteType())); + if (!mHideTheNumberOfVotes) { + mScoreTextView.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, + mPost.getScore() + mPost.getVoteType())); + } mPostDetailRecyclerViewAdapterCallback.updatePost(mPost); } @@ -1357,8 +1387,10 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler public void onVoteThingFail() { Toast.makeText(mActivity, R.string.vote_failed, Toast.LENGTH_SHORT).show(); mPost.setVoteType(previousVoteType); - mScoreTextView.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, - mPost.getScore() + previousVoteType)); + if (!mHideTheNumberOfVotes) { + mScoreTextView.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, + mPost.getScore() + previousVoteType)); + } mUpvoteButton.setColorFilter(previousUpvoteButtonColorFilter); mDownvoteButton.setColorFilter(previousDownvoteButtonColorFilter); mScoreTextView.setTextColor(previousScoreTextViewColor); @@ -1368,31 +1400,35 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler }, mPost.getFullName(), newVoteType); }); - commentsCountTextView.setOnClickListener(view -> { - if (mPost.isArchived()) { - Toast.makeText(mActivity, R.string.archived_post_comment_unavailable, Toast.LENGTH_SHORT).show(); - return; - } + if (!mHideTheNumberOfComments) { + commentsCountTextView.setOnClickListener(view -> { + if (mPost.isArchived()) { + Toast.makeText(mActivity, R.string.archived_post_comment_unavailable, Toast.LENGTH_SHORT).show(); + return; + } - if (mPost.isLocked()) { - Toast.makeText(mActivity, R.string.locked_post_comment_unavailable, Toast.LENGTH_SHORT).show(); - return; - } + if (mPost.isLocked()) { + Toast.makeText(mActivity, R.string.locked_post_comment_unavailable, Toast.LENGTH_SHORT).show(); + return; + } - if (mAccessToken == null) { - Toast.makeText(mActivity, R.string.login_first, Toast.LENGTH_SHORT).show(); - return; - } + if (mAccessToken == null) { + Toast.makeText(mActivity, R.string.login_first, Toast.LENGTH_SHORT).show(); + return; + } - Intent intent = new Intent(mActivity, CommentActivity.class); - intent.putExtra(CommentActivity.EXTRA_PARENT_FULLNAME_KEY, mPost.getFullName()); - intent.putExtra(CommentActivity.EXTRA_COMMENT_PARENT_TEXT_MARKDOWN_KEY, mPost.getTitle()); - intent.putExtra(CommentActivity.EXTRA_COMMENT_PARENT_BODY_MARKDOWN_KEY, mPost.getSelfText()); - intent.putExtra(CommentActivity.EXTRA_COMMENT_PARENT_BODY_KEY, mPost.getSelfTextPlain()); - intent.putExtra(CommentActivity.EXTRA_IS_REPLYING_KEY, false); - intent.putExtra(CommentActivity.EXTRA_PARENT_DEPTH_KEY, 0); - mActivity.startActivityForResult(intent, WRITE_COMMENT_REQUEST_CODE); - }); + Intent intent = new Intent(mActivity, CommentActivity.class); + intent.putExtra(CommentActivity.EXTRA_PARENT_FULLNAME_KEY, mPost.getFullName()); + intent.putExtra(CommentActivity.EXTRA_COMMENT_PARENT_TEXT_MARKDOWN_KEY, mPost.getTitle()); + intent.putExtra(CommentActivity.EXTRA_COMMENT_PARENT_BODY_MARKDOWN_KEY, mPost.getSelfText()); + intent.putExtra(CommentActivity.EXTRA_COMMENT_PARENT_BODY_KEY, mPost.getSelfTextPlain()); + intent.putExtra(CommentActivity.EXTRA_IS_REPLYING_KEY, false); + intent.putExtra(CommentActivity.EXTRA_PARENT_DEPTH_KEY, 0); + mActivity.startActivityForResult(intent, WRITE_COMMENT_REQUEST_CODE); + }); + } else { + commentsCountTextView.setVisibility(View.GONE); + } mSaveButton.setOnClickListener(view -> { if (mAccessToken == null) { @@ -1615,11 +1651,11 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler muteButton.setOnClickListener(view -> { if (helper != null) { if (helper.getVolume() != 0) { - muteButton.setImageDrawable(mActivity.getDrawable(R.drawable.ic_mute_white_rounded_18dp)); + muteButton.setImageDrawable(mActivity.getDrawable(R.drawable.ic_mute_white_rounded_24dp)); helper.setVolume(0f); volume = 0f; } else { - muteButton.setImageDrawable(mActivity.getDrawable(R.drawable.ic_unmute_white_rounded_18dp)); + muteButton.setImageDrawable(mActivity.getDrawable(R.drawable.ic_unmute_white_rounded_24dp)); helper.setVolume(1f); volume = 1f; } @@ -1701,9 +1737,9 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler helper.setVolume(volume); muteButton.setVisibility(View.VISIBLE); if (volume != 0f) { - muteButton.setImageDrawable(mActivity.getDrawable(R.drawable.ic_unmute_white_rounded_18dp)); + muteButton.setImageDrawable(mActivity.getDrawable(R.drawable.ic_unmute_white_rounded_24dp)); } else { - muteButton.setImageDrawable(mActivity.getDrawable(R.drawable.ic_mute_white_rounded_18dp)); + muteButton.setImageDrawable(mActivity.getDrawable(R.drawable.ic_mute_white_rounded_24dp)); } break; } diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostRecyclerViewAdapter.java index c55b7533..12d6c0d1 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostRecyclerViewAdapter.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostRecyclerViewAdapter.java @@ -29,6 +29,7 @@ import androidx.appcompat.app.AppCompatActivity; import androidx.constraintlayout.widget.Barrier; import androidx.constraintlayout.widget.ConstraintLayout; import androidx.constraintlayout.widget.ConstraintSet; +import androidx.core.content.ContextCompat; import androidx.core.graphics.drawable.DrawableCompat; import androidx.paging.PagedListAdapter; import androidx.recyclerview.widget.DiffUtil; @@ -106,19 +107,15 @@ import retrofit2.Retrofit; public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView.ViewHolder> implements CacheManager { private static final int VIEW_TYPE_POST_CARD_VIDEO_AUTOPLAY_TYPE = 1; - private static final int VIEW_TYPE_POST_CARD_VIDEO_AND_GIF_PREVIEW_TYPE = 2; - private static final int VIEW_TYPE_POST_CARD_IMAGE_AND_GIF_AUTOPLAY_TYPE = 3; - private static final int VIEW_TYPE_POST_CARD_LINK_TYPE = 4; - private static final int VIEW_TYPE_POST_CARD_NO_PREVIEW_LINK_TYPE = 5; - private static final int VIEW_TYPE_POST_CARD_TEXT_TYPE = 6; - private static final int VIEW_TYPE_POST_CARD_GALLERY_TYPE = 7; - private static final int VIEW_TYPE_POST_COMPACT = 8; - private static final int VIEW_TYPE_POST_GALLERY = 9; - private static final int VIEW_TYPE_POST_CARD_2_VIDEO_AUTOPLAY_TYPE = 10; - private static final int VIEW_TYPE_POST_CARD_2_WITH_PREVIEW = 11; - private static final int VIEW_TYPE_POST_CARD_2_TEXT_TYPE = 12; - private static final int VIEW_TYPE_ERROR = 13; - private static final int VIEW_TYPE_LOADING = 14; + private static final int VIEW_TYPE_POST_CARD_WITH_PREVIEW_TYPE = 2; + private static final int VIEW_TYPE_POST_CARD_TEXT_TYPE = 3; + private static final int VIEW_TYPE_POST_COMPACT = 4; + private static final int VIEW_TYPE_POST_GALLERY = 5; + private static final int VIEW_TYPE_POST_CARD_2_VIDEO_AUTOPLAY_TYPE = 6; + private static final int VIEW_TYPE_POST_CARD_2_WITH_PREVIEW_TYPE = 7; + private static final int VIEW_TYPE_POST_CARD_2_TEXT_TYPE = 8; + private static final int VIEW_TYPE_ERROR = 9; + private static final int VIEW_TYPE_LOADING = 10; private static final DiffUtil.ItemCallback<Post> DIFF_CALLBACK = new DiffUtil.ItemCallback<Post>() { @Override @@ -148,6 +145,7 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView private boolean canStartActivity = true; private int mPostType; private int mPostLayout; + private int mDefaultLinkPostLayout; private int mColorPrimaryLightTheme; private int mColorAccent; private int mCardViewBackgroundColor; @@ -295,6 +293,7 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView mHideTheNumberOfComments = sharedPreferences.getBoolean(SharedPreferencesUtils.HIDE_THE_NUMBER_OF_COMMENTS, false); mPostLayout = postLayout; + mDefaultLinkPostLayout = Integer.parseInt(sharedPreferences.getString(SharedPreferencesUtils.DEFAULT_LINK_POST_LAYOUT_KEY, "-1")); mColorPrimaryLightTheme = customThemeWrapper.getColorPrimaryLightTheme(); mColorAccent = customThemeWrapper.getColorAccent(); @@ -366,33 +365,45 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView case Post.VIDEO_TYPE: if (mAutoplay) { if (!mAutoplayNsfwVideos && post.isNSFW()) { - return VIEW_TYPE_POST_CARD_VIDEO_AND_GIF_PREVIEW_TYPE; + return VIEW_TYPE_POST_CARD_WITH_PREVIEW_TYPE; } return VIEW_TYPE_POST_CARD_VIDEO_AUTOPLAY_TYPE; } - return VIEW_TYPE_POST_CARD_VIDEO_AND_GIF_PREVIEW_TYPE; + return VIEW_TYPE_POST_CARD_WITH_PREVIEW_TYPE; case Post.GIF_TYPE: - if (mAutoplay) { - if (!mAutoplayNsfwVideos && post.isNSFW()) { - return VIEW_TYPE_POST_CARD_VIDEO_AND_GIF_PREVIEW_TYPE; - } - return VIEW_TYPE_POST_CARD_IMAGE_AND_GIF_AUTOPLAY_TYPE; - } - return VIEW_TYPE_POST_CARD_VIDEO_AND_GIF_PREVIEW_TYPE; case Post.IMAGE_TYPE: - return VIEW_TYPE_POST_CARD_IMAGE_AND_GIF_AUTOPLAY_TYPE; + case Post.GALLERY_TYPE: + return VIEW_TYPE_POST_CARD_WITH_PREVIEW_TYPE; case Post.LINK_TYPE: - return VIEW_TYPE_POST_CARD_LINK_TYPE; case Post.NO_PREVIEW_LINK_TYPE: - return VIEW_TYPE_POST_CARD_NO_PREVIEW_LINK_TYPE; - case Post.GALLERY_TYPE: - return VIEW_TYPE_POST_CARD_GALLERY_TYPE; + switch (mDefaultLinkPostLayout) { + case SharedPreferencesUtils.POST_LAYOUT_CARD_2: + return VIEW_TYPE_POST_CARD_2_WITH_PREVIEW_TYPE; + case SharedPreferencesUtils.POST_LAYOUT_GALLERY: + return VIEW_TYPE_POST_GALLERY; + case SharedPreferencesUtils.POST_LAYOUT_COMPACT: + return VIEW_TYPE_POST_COMPACT; + } + return VIEW_TYPE_POST_CARD_WITH_PREVIEW_TYPE; default: return VIEW_TYPE_POST_CARD_TEXT_TYPE; } } return VIEW_TYPE_POST_CARD_TEXT_TYPE; } else if (mPostLayout == SharedPreferencesUtils.POST_LAYOUT_COMPACT) { + Post post = getItem(position); + if (post != null) { + if (post.getPostType() == Post.LINK_TYPE || post.getPostType() == Post.NO_PREVIEW_LINK_TYPE) { + switch (mDefaultLinkPostLayout) { + case SharedPreferencesUtils.POST_LAYOUT_CARD: + return VIEW_TYPE_POST_CARD_WITH_PREVIEW_TYPE; + case SharedPreferencesUtils.POST_LAYOUT_GALLERY: + return VIEW_TYPE_POST_GALLERY; + case SharedPreferencesUtils.POST_LAYOUT_CARD_2: + return VIEW_TYPE_POST_CARD_2_WITH_PREVIEW_TYPE; + } + } + } return VIEW_TYPE_POST_COMPACT; } else if (mPostLayout == SharedPreferencesUtils.POST_LAYOUT_GALLERY) { return VIEW_TYPE_POST_GALLERY; @@ -403,17 +414,26 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView case Post.VIDEO_TYPE: if (mAutoplay) { if (!mAutoplayNsfwVideos && post.isNSFW()) { - return VIEW_TYPE_POST_CARD_2_WITH_PREVIEW; + return VIEW_TYPE_POST_CARD_2_WITH_PREVIEW_TYPE; } return VIEW_TYPE_POST_CARD_2_VIDEO_AUTOPLAY_TYPE; } - return VIEW_TYPE_POST_CARD_2_WITH_PREVIEW; + return VIEW_TYPE_POST_CARD_2_WITH_PREVIEW_TYPE; case Post.GIF_TYPE: case Post.IMAGE_TYPE: + case Post.GALLERY_TYPE: + return VIEW_TYPE_POST_CARD_2_WITH_PREVIEW_TYPE; case Post.LINK_TYPE: case Post.NO_PREVIEW_LINK_TYPE: - case Post.GALLERY_TYPE: - return VIEW_TYPE_POST_CARD_2_WITH_PREVIEW; + switch (mDefaultLinkPostLayout) { + case SharedPreferencesUtils.POST_LAYOUT_CARD: + return VIEW_TYPE_POST_CARD_WITH_PREVIEW_TYPE; + case SharedPreferencesUtils.POST_LAYOUT_GALLERY: + return VIEW_TYPE_POST_GALLERY; + case SharedPreferencesUtils.POST_LAYOUT_COMPACT: + return VIEW_TYPE_POST_COMPACT; + } + return VIEW_TYPE_POST_CARD_2_WITH_PREVIEW_TYPE; default: return VIEW_TYPE_POST_CARD_2_TEXT_TYPE; } @@ -431,11 +451,7 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView return new PostWithPreviewTypeViewHolder(LayoutInflater.from(parent.getContext()).inflate(R.layout.item_post_with_preview, parent, false)); } return new PostVideoAutoplayViewHolder(LayoutInflater.from(parent.getContext()).inflate(R.layout.item_post_video_type_autoplay, parent, false)); - } else if (viewType == VIEW_TYPE_POST_CARD_VIDEO_AND_GIF_PREVIEW_TYPE - || viewType == VIEW_TYPE_POST_CARD_IMAGE_AND_GIF_AUTOPLAY_TYPE - || viewType == VIEW_TYPE_POST_CARD_LINK_TYPE - || viewType == VIEW_TYPE_POST_CARD_NO_PREVIEW_LINK_TYPE - || viewType == VIEW_TYPE_POST_CARD_GALLERY_TYPE) { + } else if (viewType == VIEW_TYPE_POST_CARD_WITH_PREVIEW_TYPE) { return new PostWithPreviewTypeViewHolder(LayoutInflater.from(parent.getContext()).inflate(R.layout.item_post_with_preview, parent, false)); } else if (viewType == VIEW_TYPE_POST_CARD_TEXT_TYPE) { return new PostTextTypeViewHolder(LayoutInflater.from(parent.getContext()).inflate(R.layout.item_post_text, parent, false)); @@ -449,7 +465,7 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView return new PostGalleryViewHolder(LayoutInflater.from(parent.getContext()).inflate(R.layout.item_post_gallery, parent, false)); } else if (viewType == VIEW_TYPE_POST_CARD_2_VIDEO_AUTOPLAY_TYPE) { return new PostCard2VideoAutoplayViewHolder(LayoutInflater.from(parent.getContext()).inflate(R.layout.item_post_card_2_video_autoplay, parent, false)); - } else if (viewType == VIEW_TYPE_POST_CARD_2_WITH_PREVIEW) { + } else if (viewType == VIEW_TYPE_POST_CARD_2_WITH_PREVIEW_TYPE) { return new PostCard2WithPreviewViewHolder(LayoutInflater.from(parent.getContext()).inflate(R.layout.item_post_card_2_with_preview, parent, false)); } else if (viewType == VIEW_TYPE_POST_CARD_2_TEXT_TYPE) { return new PostCard2TextTypeViewHolder(LayoutInflater.from(parent.getContext()).inflate(R.layout.item_post_card_2_text, parent, false)); @@ -709,7 +725,11 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView } else { ((PostVideoAutoplayViewHolder) holder).aspectRatioFrameLayout.setAspectRatio(1); } - ((PostVideoAutoplayViewHolder) holder).setVolume(mMuteAutoplayingVideos || (post.isNSFW() && mMuteNSFWVideo) ? 0f : 1f); + if (mFragment.getMasterMutingOption() == null) { + ((PostVideoAutoplayViewHolder) holder).setVolume(mMuteAutoplayingVideos || (post.isNSFW() && mMuteNSFWVideo) ? 0f : 1f); + } else { + ((PostVideoAutoplayViewHolder) holder).setVolume(mFragment.getMasterMutingOption() ? 0f : 1f); + } if (post.isGfycat() || post.isRedgifs() && !post.isLoadGfyOrRedgifsVideoSuccess()) { ((PostVideoAutoplayViewHolder) holder).fetchGfycatOrRedgifsVideoLinks = new FetchGfycatOrRedgifsVideoLinks(new FetchGfycatOrRedgifsVideoLinks.FetchGfycatOrRedgifsVideoLinksListener() { @@ -740,10 +760,12 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView } else if (holder instanceof PostWithPreviewTypeViewHolder) { if (post.getPostType() == Post.VIDEO_TYPE) { ((PostWithPreviewTypeViewHolder) holder).videoOrGifIndicatorImageView.setVisibility(View.VISIBLE); + ((PostWithPreviewTypeViewHolder) holder).videoOrGifIndicatorImageView.setImageDrawable(ContextCompat.getDrawable(mActivity, R.drawable.ic_play_circle_36dp)); ((PostWithPreviewTypeViewHolder) holder).typeTextView.setText(mActivity.getString(R.string.video)); } else if (post.getPostType() == Post.GIF_TYPE) { if (!mAutoplay) { ((PostWithPreviewTypeViewHolder) holder).videoOrGifIndicatorImageView.setVisibility(View.VISIBLE); + ((PostWithPreviewTypeViewHolder) holder).videoOrGifIndicatorImageView.setImageDrawable(ContextCompat.getDrawable(mActivity, R.drawable.ic_play_circle_36dp)); } ((PostWithPreviewTypeViewHolder) holder).typeTextView.setText(mActivity.getString(R.string.gif)); } else if (post.getPostType() == Post.IMAGE_TYPE) { @@ -759,6 +781,8 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView } } else if (post.getPostType() == Post.GALLERY_TYPE) { ((PostWithPreviewTypeViewHolder) holder).typeTextView.setText(mActivity.getString(R.string.gallery)); + ((PostWithPreviewTypeViewHolder) holder).videoOrGifIndicatorImageView.setVisibility(View.VISIBLE); + ((PostWithPreviewTypeViewHolder) holder).videoOrGifIndicatorImageView.setImageDrawable(ContextCompat.getDrawable(mActivity, R.drawable.ic_gallery_reverse_color_24dp)); } if (post.getPostType() != Post.NO_PREVIEW_LINK_TYPE) { @@ -776,7 +800,7 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView } else if (post.getPostType() == Post.LINK_TYPE) { ((PostWithPreviewTypeViewHolder) holder).noPreviewLinkImageView.setImageResource(R.drawable.ic_link); } else if (post.getPostType() == Post.GALLERY_TYPE) { - ((PostWithPreviewTypeViewHolder) holder).noPreviewLinkImageView.setImageResource(R.drawable.ic_gallery_24dp); + ((PostWithPreviewTypeViewHolder) holder).noPreviewLinkImageView.setImageResource(R.drawable.ic_gallery_reverse_color_24dp); } } else if (mDataSavingMode && mOnlyDisablePreviewInVideoAndGifPosts && (post.getPostType() == Post.VIDEO_TYPE || post.getPostType() == Post.GIF_TYPE)) { ((PostWithPreviewTypeViewHolder) holder).noPreviewLinkImageView.setVisibility(View.VISIBLE); @@ -808,7 +832,7 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView } else if (post.getPostType() == Post.LINK_TYPE) { ((PostWithPreviewTypeViewHolder) holder).noPreviewLinkImageView.setImageResource(R.drawable.ic_link); } else if (post.getPostType() == Post.GALLERY_TYPE) { - ((PostWithPreviewTypeViewHolder) holder).noPreviewLinkImageView.setImageResource(R.drawable.ic_gallery_24dp); + ((PostWithPreviewTypeViewHolder) holder).noPreviewLinkImageView.setImageResource(R.drawable.ic_gallery_reverse_color_24dp); } } } @@ -833,7 +857,11 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView } else { ((PostCard2VideoAutoplayViewHolder) holder).aspectRatioFrameLayout.setAspectRatio(1); } - ((PostCard2VideoAutoplayViewHolder) holder).setVolume(mMuteAutoplayingVideos || (post.isNSFW() && mMuteNSFWVideo) ? 0f : 1f); + if (mFragment.getMasterMutingOption() == null) { + ((PostCard2VideoAutoplayViewHolder) holder).setVolume(mMuteAutoplayingVideos || (post.isNSFW() && mMuteNSFWVideo) ? 0f : 1f); + } else { + ((PostCard2VideoAutoplayViewHolder) holder).setVolume(mFragment.getMasterMutingOption() ? 0f : 1f); + } if (post.isGfycat() || post.isRedgifs() && !post.isLoadGfyOrRedgifsVideoSuccess()) { ((PostCard2VideoAutoplayViewHolder) holder).fetchGfycatOrRedgifsVideoLinks = new FetchGfycatOrRedgifsVideoLinks(new FetchGfycatOrRedgifsVideoLinks.FetchGfycatOrRedgifsVideoLinksListener() { @@ -864,10 +892,12 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView } else if (holder instanceof PostCard2WithPreviewViewHolder) { if (post.getPostType() == Post.VIDEO_TYPE) { ((PostCard2WithPreviewViewHolder) holder).videoOrGifIndicatorImageView.setVisibility(View.VISIBLE); + ((PostCard2WithPreviewViewHolder) holder).videoOrGifIndicatorImageView.setImageDrawable(ContextCompat.getDrawable(mActivity, R.drawable.ic_play_circle_36dp)); ((PostCard2WithPreviewViewHolder) holder).typeTextView.setText(mActivity.getString(R.string.video)); } else if (post.getPostType() == Post.GIF_TYPE) { if (!mAutoplay) { ((PostCard2WithPreviewViewHolder) holder).videoOrGifIndicatorImageView.setVisibility(View.VISIBLE); + ((PostCard2WithPreviewViewHolder) holder).videoOrGifIndicatorImageView.setImageDrawable(ContextCompat.getDrawable(mActivity, R.drawable.ic_play_circle_36dp)); } ((PostCard2WithPreviewViewHolder) holder).typeTextView.setText(mActivity.getString(R.string.gif)); } else if (post.getPostType() == Post.IMAGE_TYPE) { @@ -883,6 +913,8 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView } } else if (post.getPostType() == Post.GALLERY_TYPE) { ((PostCard2WithPreviewViewHolder) holder).typeTextView.setText(mActivity.getString(R.string.gallery)); + ((PostCard2WithPreviewViewHolder) holder).videoOrGifIndicatorImageView.setVisibility(View.VISIBLE); + ((PostCard2WithPreviewViewHolder) holder).videoOrGifIndicatorImageView.setImageDrawable(ContextCompat.getDrawable(mActivity, R.drawable.ic_gallery_reverse_color_24dp)); } if (post.getPostType() != Post.NO_PREVIEW_LINK_TYPE) { @@ -901,7 +933,7 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView } else if (post.getPostType() == Post.LINK_TYPE) { ((PostCard2WithPreviewViewHolder) holder).noPreviewImageView.setImageResource(R.drawable.ic_link); } else if (post.getPostType() == Post.GALLERY_TYPE) { - ((PostCard2WithPreviewViewHolder) holder).noPreviewImageView.setImageResource(R.drawable.ic_gallery_24dp); + ((PostCard2WithPreviewViewHolder) holder).noPreviewImageView.setImageResource(R.drawable.ic_gallery_reverse_color_24dp); } } else if (mDataSavingMode && mOnlyDisablePreviewInVideoAndGifPosts && (post.getPostType() == Post.VIDEO_TYPE || post.getPostType() == Post.GIF_TYPE)) { ((PostCard2WithPreviewViewHolder) holder).progressBar.setVisibility(View.GONE); @@ -935,7 +967,7 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView } else if (post.getPostType() == Post.LINK_TYPE) { ((PostCard2WithPreviewViewHolder) holder).noPreviewImageView.setImageResource(R.drawable.ic_link); } else if (post.getPostType() == Post.GALLERY_TYPE) { - ((PostCard2WithPreviewViewHolder) holder).noPreviewImageView.setImageResource(R.drawable.ic_gallery_24dp); + ((PostCard2WithPreviewViewHolder) holder).noPreviewImageView.setImageResource(R.drawable.ic_gallery_reverse_color_24dp); } } } @@ -1170,7 +1202,7 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView ((PostCompactBaseViewHolder) holder).relativeLayout.setVisibility(View.VISIBLE); if (post.getPostType() == Post.GALLERY_TYPE && post.getPreviews() != null && post.getPreviews().isEmpty()) { ((PostCompactBaseViewHolder) holder).noPreviewPostImageFrameLayout.setVisibility(View.VISIBLE); - ((PostCompactBaseViewHolder) holder).noPreviewPostImageView.setImageResource(R.drawable.ic_gallery_24dp); + ((PostCompactBaseViewHolder) holder).noPreviewPostImageView.setImageResource(R.drawable.ic_gallery_reverse_color_24dp); } ArrayList<Post.Preview> previews = post.getPreviews(); if (previews != null && !previews.isEmpty()) { @@ -1259,7 +1291,7 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView ((PostCompactBaseViewHolder) holder).typeTextView.setText(R.string.gallery); if (mDataSavingMode && mDisableImagePreview) { ((PostCompactBaseViewHolder) holder).noPreviewPostImageFrameLayout.setVisibility(View.VISIBLE); - ((PostCompactBaseViewHolder) holder).noPreviewPostImageView.setImageResource(R.drawable.ic_gallery_24dp); + ((PostCompactBaseViewHolder) holder).noPreviewPostImageView.setImageResource(R.drawable.ic_gallery_reverse_color_24dp); } break; case Post.TEXT_TYPE: @@ -1324,12 +1356,11 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView ((PostGalleryViewHolder) holder).noPreviewImageView.setImageResource(R.drawable.ic_outline_video_24dp); ((PostGalleryViewHolder) holder).videoOrGifIndicatorImageView.setVisibility(View.GONE); } else if (post.getPostType() == Post.IMAGE_TYPE || post.getPostType() == Post.GIF_TYPE) { - ((PostGalleryViewHolder) holder).videoOrGifIndicatorImageView.setVisibility(View.GONE); } else if (post.getPostType() == Post.LINK_TYPE) { ((PostGalleryViewHolder) holder).noPreviewImageView.setImageResource(R.drawable.ic_link); } else if (post.getPostType() == Post.GALLERY_TYPE) { - ((PostGalleryViewHolder) holder).noPreviewImageView.setImageResource(R.drawable.ic_gallery_24dp); + ((PostGalleryViewHolder) holder).noPreviewImageView.setImageResource(R.drawable.ic_gallery_reverse_color_24dp); } ((PostGalleryViewHolder) holder).noPreviewImageView.setImageResource(R.drawable.ic_image_24dp); } @@ -1339,7 +1370,7 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView ((PostGalleryViewHolder) holder).imageView.setVisibility(View.VISIBLE); ((PostGalleryViewHolder) holder).progressBar.setVisibility(View.VISIBLE); ((PostGalleryViewHolder) holder).videoOrGifIndicatorImageView.setVisibility(View.VISIBLE); - ((PostGalleryViewHolder) holder).videoOrGifIndicatorImageView.setImageDrawable(mActivity.getDrawable(R.drawable.ic_play_circle_36dp)); + ((PostGalleryViewHolder) holder).videoOrGifIndicatorImageView.setImageDrawable(ContextCompat.getDrawable(mActivity, R.drawable.ic_play_circle_36dp)); Post.Preview preview = getSuitablePreview(post.getPreviews()); if (preview != null) { @@ -1364,7 +1395,7 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView ((PostGalleryViewHolder) holder).imageView.setVisibility(View.VISIBLE); ((PostGalleryViewHolder) holder).progressBar.setVisibility(View.VISIBLE); ((PostGalleryViewHolder) holder).videoOrGifIndicatorImageView.setVisibility(View.VISIBLE); - ((PostGalleryViewHolder) holder).videoOrGifIndicatorImageView.setImageDrawable(mActivity.getDrawable(R.drawable.ic_play_circle_36dp)); + ((PostGalleryViewHolder) holder).videoOrGifIndicatorImageView.setImageDrawable(ContextCompat.getDrawable(mActivity, R.drawable.ic_play_circle_36dp)); Post.Preview preview = getSuitablePreview(post.getPreviews()); if (preview != null) { @@ -1389,7 +1420,7 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView ((PostGalleryViewHolder) holder).imageView.setVisibility(View.VISIBLE); ((PostGalleryViewHolder) holder).progressBar.setVisibility(View.VISIBLE); ((PostGalleryViewHolder) holder).videoOrGifIndicatorImageView.setVisibility(View.VISIBLE); - ((PostGalleryViewHolder) holder).videoOrGifIndicatorImageView.setImageDrawable(mActivity.getDrawable(R.drawable.ic_link_post_type_indicator)); + ((PostGalleryViewHolder) holder).videoOrGifIndicatorImageView.setImageDrawable(ContextCompat.getDrawable(mActivity, R.drawable.ic_link_post_type_indicator)); Post.Preview preview = getSuitablePreview(post.getPreviews()); if (preview != null) { @@ -1424,7 +1455,7 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView ((PostGalleryViewHolder) holder).imageView.setVisibility(View.VISIBLE); ((PostGalleryViewHolder) holder).progressBar.setVisibility(View.VISIBLE); ((PostGalleryViewHolder) holder).videoOrGifIndicatorImageView.setVisibility(View.VISIBLE); - ((PostGalleryViewHolder) holder).videoOrGifIndicatorImageView.setImageDrawable(mActivity.getDrawable(R.drawable.ic_gallery_24dp)); + ((PostGalleryViewHolder) holder).videoOrGifIndicatorImageView.setImageDrawable(ContextCompat.getDrawable(mActivity, R.drawable.ic_gallery_reverse_color_24dp)); Post.Preview preview = getSuitablePreview(post.getPreviews()); if (preview != null) { @@ -1441,7 +1472,7 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView loadImage(holder, post, preview); } else { ((PostGalleryViewHolder) holder).noPreviewImageView.setVisibility(View.VISIBLE); - ((PostGalleryViewHolder) holder).noPreviewImageView.setImageResource(R.drawable.ic_gallery_24dp); + ((PostGalleryViewHolder) holder).noPreviewImageView.setImageResource(R.drawable.ic_gallery_reverse_color_24dp); } break; } @@ -1494,7 +1525,8 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView private void loadImage(final RecyclerView.ViewHolder holder, final Post post, @NonNull Post.Preview preview) { if (holder instanceof PostWithPreviewTypeViewHolder) { String url; - if (post.getPostType() == Post.GIF_TYPE && mAutoplay) { + boolean blurImage = (post.isNSFW() && mNeedBlurNsfw && !(mDoNotBlurNsfwInNsfwSubreddits && mFragment != null && mFragment.getIsNsfwSubreddit()) && !(post.getPostType() == Post.GIF_TYPE && mAutoplayNsfwVideos)) || post.isSpoiler() && mNeedBlurSpoiler; + if (post.getPostType() == Post.GIF_TYPE && mAutoplay && !blurImage) { url = post.getUrl(); } else { url = preview.getPreviewUrl(); @@ -1520,7 +1552,7 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView } }); - if ((post.isNSFW() && mNeedBlurNsfw && !(mDoNotBlurNsfwInNsfwSubreddits && mFragment != null && mFragment.getIsNsfwSubreddit()) && !(post.getPostType() == Post.GIF_TYPE && mAutoplayNsfwVideos)) || post.isSpoiler() && mNeedBlurSpoiler) { + if (blurImage) { imageRequestBuilder.apply(RequestOptions.bitmapTransform(new BlurTransformation(50, 10))) .into(((PostWithPreviewTypeViewHolder) holder).imageView); } else { @@ -1563,7 +1595,8 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView } } else if (holder instanceof PostGalleryViewHolder) { String url; - if (post.getPostType() == Post.GIF_TYPE && mAutoplay) { + boolean blurImage = (post.isNSFW() && mNeedBlurNsfw && !(mDoNotBlurNsfwInNsfwSubreddits && mFragment != null && mFragment.getIsNsfwSubreddit()) && !(post.getPostType() == Post.GIF_TYPE && mAutoplayNsfwVideos)) || post.isSpoiler() && mNeedBlurSpoiler; + if (post.getPostType() == Post.GIF_TYPE && mAutoplay && !blurImage) { url = post.getUrl(); } else { url = preview.getPreviewUrl(); @@ -1589,7 +1622,7 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView } }); - if ((post.isNSFW() && mNeedBlurNsfw && !(mDoNotBlurNsfwInNsfwSubreddits && mFragment != null && mFragment.getIsNsfwSubreddit()) && !(post.getPostType() == Post.GIF_TYPE && mAutoplayNsfwVideos)) || post.isSpoiler() && mNeedBlurSpoiler) { + if (blurImage) { imageRequestBuilder.apply(RequestOptions.bitmapTransform(new BlurTransformation(50, 10))) .into(((PostGalleryViewHolder) holder).imageView); } else { @@ -1601,7 +1634,8 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView } } else if (holder instanceof PostCard2WithPreviewViewHolder) { String url; - if (post.getPostType() == Post.GIF_TYPE && mAutoplay) { + boolean blurImage = (post.isNSFW() && mNeedBlurNsfw && !(mDoNotBlurNsfwInNsfwSubreddits && mFragment != null && mFragment.getIsNsfwSubreddit()) && !(post.getPostType() == Post.GIF_TYPE && mAutoplayNsfwVideos)) || post.isSpoiler() && mNeedBlurSpoiler; + if (post.getPostType() == Post.GIF_TYPE && mAutoplay && !blurImage) { url = post.getUrl(); } else { url = preview.getPreviewUrl(); @@ -1627,7 +1661,7 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView } }); - if ((post.isNSFW() && mNeedBlurNsfw && !(mDoNotBlurNsfwInNsfwSubreddits && mFragment != null && mFragment.getIsNsfwSubreddit()) && !(post.getPostType() == Post.GIF_TYPE && mAutoplayNsfwVideos)) || post.isSpoiler() && mNeedBlurSpoiler) { + if (blurImage) { imageRequestBuilder.apply(RequestOptions.bitmapTransform(new BlurTransformation(50, 10))) .into(((PostCard2WithPreviewViewHolder) holder).imageView); } else { @@ -1838,6 +1872,10 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView mHideTheNumberOfComments = hideTheNumberOfComments; } + public void setDefaultLinkPostLayout(int defaultLinkPostLayout) { + mDefaultLinkPostLayout = defaultLinkPostLayout; + } + @Override public void onViewRecycled(@NonNull RecyclerView.ViewHolder holder) { super.onViewRecycled(holder); @@ -1849,15 +1887,15 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView ((PostBaseViewHolder) holder).markPostRead(post, false); } } - ((PostBaseViewHolder) holder).itemView.setVisibility(View.VISIBLE); + holder.itemView.setVisibility(View.VISIBLE); RecyclerView.LayoutParams params = (RecyclerView.LayoutParams) holder.itemView.getLayoutParams(); params.height = ViewGroup.LayoutParams.WRAP_CONTENT; if (holder instanceof PostCard2VideoAutoplayViewHolder || holder instanceof PostCard2WithPreviewViewHolder) { int paddingPixel = (int) Utils.convertDpToPixel(16, mActivity); - ((PostBaseViewHolder) holder).itemView.setPadding(0, paddingPixel, 0, 0); + holder.itemView.setPadding(0, paddingPixel, 0, 0); } else if (holder instanceof PostCard2TextTypeViewHolder) { int paddingPixel = (int) Utils.convertDpToPixel(12, mActivity); - ((PostBaseViewHolder) holder).itemView.setPadding(0, paddingPixel, 0, 0); + holder.itemView.setPadding(0, paddingPixel, 0, 0); } else { int marginPixel = (int) Utils.convertDpToPixel(8, mActivity); params.topMargin = marginPixel; @@ -1865,9 +1903,9 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView } holder.itemView.setLayoutParams(params); if (((PostBaseViewHolder) holder).itemViewIsNotCardView) { - ((PostBaseViewHolder) holder).itemView.setBackgroundColor(mCardViewBackgroundColor); + holder.itemView.setBackgroundColor(mCardViewBackgroundColor); } else { - ((PostBaseViewHolder) holder).itemView.setBackgroundTintList(ColorStateList.valueOf(mCardViewBackgroundColor)); + holder.itemView.setBackgroundTintList(ColorStateList.valueOf(mCardViewBackgroundColor)); } ((PostBaseViewHolder) holder).titleTextView.setTextColor(mPostTitleColor); if (holder instanceof PostVideoAutoplayViewHolder) { @@ -1892,6 +1930,16 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView ((PostTextTypeViewHolder) holder).contentTextView.setText(""); ((PostTextTypeViewHolder) holder).contentTextView.setTextColor(mPostContentColor); ((PostTextTypeViewHolder) holder).contentTextView.setVisibility(View.GONE); + } else if (holder instanceof PostCard2VideoAutoplayViewHolder) { + ((PostCard2VideoAutoplayViewHolder) holder).mediaUri = null; + if (((PostCard2VideoAutoplayViewHolder) holder).fetchGfycatOrRedgifsVideoLinks != null) { + ((PostCard2VideoAutoplayViewHolder) holder).fetchGfycatOrRedgifsVideoLinks.cancel(); + } + ((PostCard2VideoAutoplayViewHolder) holder).errorLoadingGfycatImageView.setVisibility(View.GONE); + ((PostCard2VideoAutoplayViewHolder) holder).muteButton.setVisibility(View.GONE); + ((PostCard2VideoAutoplayViewHolder) holder).resetVolume(); + mGlide.clear(((PostCard2VideoAutoplayViewHolder) holder).previewImageView); + ((PostCard2VideoAutoplayViewHolder) holder).previewImageView.setVisibility(View.GONE); } else if (holder instanceof PostCard2WithPreviewViewHolder) { mGlide.clear(((PostCard2WithPreviewViewHolder) holder).imageView); ((PostCard2WithPreviewViewHolder) holder).imageView.setVisibility(View.GONE); @@ -2761,13 +2809,15 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView muteButton.setOnClickListener(view -> { if (helper != null) { if (helper.getVolume() != 0) { - muteButton.setImageDrawable(mActivity.getDrawable(R.drawable.ic_mute_white_rounded_18dp)); + muteButton.setImageDrawable(ContextCompat.getDrawable(mActivity, R.drawable.ic_mute_white_rounded_24dp)); helper.setVolume(0f); volume = 0f; + mFragment.videoAutoplayChangeMutingOption(true); } else { - muteButton.setImageDrawable(mActivity.getDrawable(R.drawable.ic_unmute_white_rounded_18dp)); + muteButton.setImageDrawable(ContextCompat.getDrawable(mActivity, R.drawable.ic_unmute_white_rounded_24dp)); helper.setVolume(1f); volume = 1f; + mFragment.videoAutoplayChangeMutingOption(false); } } }); @@ -2851,12 +2901,15 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView for (int i = 0; i < trackGroups.length; i++) { String mimeType = trackGroups.get(i).getFormat(0).sampleMimeType; if (mimeType != null && mimeType.contains("audio")) { + if (mFragment.getMasterMutingOption() != null) { + volume = mFragment.getMasterMutingOption() ? 0f : 1f; + } helper.setVolume(volume); muteButton.setVisibility(View.VISIBLE); if (volume != 0f) { - muteButton.setImageDrawable(mActivity.getDrawable(R.drawable.ic_unmute_white_rounded_18dp)); + muteButton.setImageDrawable(ContextCompat.getDrawable(mActivity, R.drawable.ic_unmute_white_rounded_24dp)); } else { - muteButton.setImageDrawable(mActivity.getDrawable(R.drawable.ic_mute_white_rounded_18dp)); + muteButton.setImageDrawable(ContextCompat.getDrawable(mActivity, R.drawable.ic_mute_white_rounded_24dp)); } break; } @@ -3212,6 +3265,10 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView constraintSet.applyTo(bottomConstraintLayout); } + if (((ViewGroup) itemView).getLayoutTransition() != null) { + ((ViewGroup) itemView).getLayoutTransition().setAnimateParentHierarchy(false); + } + itemView.setBackgroundColor(mCardViewBackgroundColor); postTimeTextView.setTextColor(mSecondaryTextColor); titleTextView.setTextColor(mPostTitleColor); @@ -3975,13 +4032,15 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView muteButton.setOnClickListener(view -> { if (helper != null) { if (helper.getVolume() != 0) { - muteButton.setImageDrawable(mActivity.getDrawable(R.drawable.ic_mute_white_rounded_18dp)); + muteButton.setImageDrawable(ContextCompat.getDrawable(mActivity, R.drawable.ic_mute_white_rounded_24dp)); helper.setVolume(0f); volume = 0f; + mFragment.videoAutoplayChangeMutingOption(true); } else { - muteButton.setImageDrawable(mActivity.getDrawable(R.drawable.ic_unmute_white_rounded_18dp)); + muteButton.setImageDrawable(ContextCompat.getDrawable(mActivity, R.drawable.ic_unmute_white_rounded_24dp)); helper.setVolume(1f); volume = 1f; + mFragment.videoAutoplayChangeMutingOption(false); } } }); @@ -4065,12 +4124,15 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView for (int i = 0; i < trackGroups.length; i++) { String mimeType = trackGroups.get(i).getFormat(0).sampleMimeType; if (mimeType != null && mimeType.contains("audio")) { + if (mFragment.getMasterMutingOption() != null) { + volume = mFragment.getMasterMutingOption() ? 0f : 1f; + } helper.setVolume(volume); muteButton.setVisibility(View.VISIBLE); if (volume != 0f) { - muteButton.setImageDrawable(mActivity.getDrawable(R.drawable.ic_unmute_white_rounded_18dp)); + muteButton.setImageDrawable(ContextCompat.getDrawable(mActivity, R.drawable.ic_unmute_white_rounded_24dp)); } else { - muteButton.setImageDrawable(mActivity.getDrawable(R.drawable.ic_mute_white_rounded_18dp)); + muteButton.setImageDrawable(ContextCompat.getDrawable(mActivity, R.drawable.ic_mute_white_rounded_24dp)); } break; } diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/RPANCommentStreamRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/RPANCommentStreamRecyclerViewAdapter.java index 60f596ab..ba7dcd34 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/RPANCommentStreamRecyclerViewAdapter.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/RPANCommentStreamRecyclerViewAdapter.java @@ -23,12 +23,10 @@ import ml.docilealligator.infinityforreddit.RPANComment; public class RPANCommentStreamRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> { private RequestManager glide; private ArrayList<RPANComment> rpanComments; - private ItemClickListener itemClickListener; - public RPANCommentStreamRecyclerViewAdapter(Context context, ItemClickListener itemClickListener) { + public RPANCommentStreamRecyclerViewAdapter(Context context) { glide = Glide.with(context); rpanComments = new ArrayList<>(); - this.itemClickListener = itemClickListener; } @NonNull @@ -80,14 +78,6 @@ public class RPANCommentStreamRecyclerViewAdapter extends RecyclerView.Adapter<R iconImageView = itemView.findViewById(R.id.icon_image_view_item_rpan_comment); authorTextView = itemView.findViewById(R.id.author_text_view_item_rpan_comment); contentTextView = itemView.findViewById(R.id.content_text_view_item_rpan_comment); - - itemView.setOnClickListener(view -> { - itemClickListener.onClick(); - }); } } - - public interface ItemClickListener { - void onClick(); - } } diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/RedditGallerySubmissionRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/RedditGallerySubmissionRecyclerViewAdapter.java new file mode 100644 index 00000000..bec2d265 --- /dev/null +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/RedditGallerySubmissionRecyclerViewAdapter.java @@ -0,0 +1,231 @@ +package ml.docilealligator.infinityforreddit.adapters; + +import android.content.Context; +import android.content.res.ColorStateList; +import android.graphics.drawable.Drawable; +import android.os.Parcel; +import android.os.Parcelable; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.view.ViewTreeObserver; +import android.widget.ImageView; +import android.widget.ProgressBar; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.recyclerview.widget.RecyclerView; + +import com.bumptech.glide.Glide; +import com.bumptech.glide.RequestManager; +import com.bumptech.glide.load.DataSource; +import com.bumptech.glide.load.engine.GlideException; +import com.bumptech.glide.load.resource.bitmap.CenterCrop; +import com.bumptech.glide.load.resource.bitmap.RoundedCorners; +import com.bumptech.glide.request.RequestListener; +import com.bumptech.glide.request.RequestOptions; +import com.bumptech.glide.request.target.Target; +import com.google.android.material.floatingactionbutton.FloatingActionButton; + +import java.util.ArrayList; + +import butterknife.BindView; +import butterknife.ButterKnife; +import ml.docilealligator.infinityforreddit.R; +import ml.docilealligator.infinityforreddit.RedditGalleryPayload; +import ml.docilealligator.infinityforreddit.customtheme.CustomThemeWrapper; +import ml.docilealligator.infinityforreddit.customviews.AspectRatioGifImageView; + +public class RedditGallerySubmissionRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> { + + private static final int VIEW_TYPE_IMAGE = 1; + private static final int VIEW_TYPE_ADD_IMAGE = 2; + + private ArrayList<RedditGalleryImageInfo> redditGalleryImageInfoList; + private CustomThemeWrapper customThemeWrapper; + private ItemClickListener itemClickListener; + private RequestManager glide; + + public RedditGallerySubmissionRecyclerViewAdapter(Context context, CustomThemeWrapper customThemeWrapper, + ItemClickListener itemClickListener) { + glide = Glide.with(context); + this.customThemeWrapper = customThemeWrapper; + this.itemClickListener = itemClickListener; + } + + @Override + public int getItemViewType(int position) { + if (redditGalleryImageInfoList == null || position >= redditGalleryImageInfoList.size()) { + return VIEW_TYPE_ADD_IMAGE; + } + + return VIEW_TYPE_IMAGE; + } + + @NonNull + @Override + public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { + if (viewType == VIEW_TYPE_ADD_IMAGE) { + return new AddImageViewHolder(LayoutInflater.from(parent.getContext()).inflate(R.layout.item_reddit_gallery_submission_add_image, parent, false)); + } + return new ImageViewHolder(LayoutInflater.from(parent.getContext()).inflate(R.layout.item_reddit_gallery_submission_image, parent, false)); + } + + @Override + public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) { + if (holder instanceof ImageViewHolder) { + glide.load(redditGalleryImageInfoList.get(position).imageUrlString) + .apply(new RequestOptions().transform(new CenterCrop(), new RoundedCorners(48))) + .listener(new RequestListener<Drawable>() { + + @Override + public boolean onLoadFailed(@Nullable GlideException e, Object model, Target<Drawable> target, boolean isFirstResource) { + ((ImageViewHolder) holder).progressBar.setVisibility(View.GONE); + ((ImageViewHolder) holder).closeImageView.setVisibility(View.VISIBLE); + return false; + } + + @Override + public boolean onResourceReady(Drawable resource, Object model, Target<Drawable> target, DataSource dataSource, boolean isFirstResource) { + return false; + } + }) + .into(((ImageViewHolder) holder).imageView); + + if (redditGalleryImageInfoList.get(position).payload != null) { + ((ImageViewHolder) holder).progressBar.setVisibility(View.GONE); + ((ImageViewHolder) holder).closeImageView.setVisibility(View.VISIBLE); + } + } + } + + @Override + public int getItemCount() { + return redditGalleryImageInfoList == null ? 1 : (redditGalleryImageInfoList.size() >= 20 ? 20 : redditGalleryImageInfoList.size() + 1); + } + + @Override + public void onViewRecycled(@NonNull RecyclerView.ViewHolder holder) { + super.onViewRecycled(holder); + if (holder instanceof ImageViewHolder) { + glide.clear(((ImageViewHolder) holder).imageView); + ((ImageViewHolder) holder).progressBar.setVisibility(View.VISIBLE); + ((ImageViewHolder) holder).closeImageView.setVisibility(View.GONE); + } + } + + public ArrayList<RedditGalleryImageInfo> getRedditGalleryImageInfoList() { + return redditGalleryImageInfoList; + } + + public void setRedditGalleryImageInfoList(ArrayList<RedditGalleryImageInfo> redditGalleryImageInfoList) { + this.redditGalleryImageInfoList = redditGalleryImageInfoList; + notifyDataSetChanged(); + } + + public void addImage(String imageUrl) { + if (redditGalleryImageInfoList == null) { + redditGalleryImageInfoList = new ArrayList<>(); + } + redditGalleryImageInfoList.add(new RedditGalleryImageInfo(imageUrl)); + notifyItemInserted(redditGalleryImageInfoList.size() - 1); + } + + public void setImageAsUploaded(String mediaId) { + redditGalleryImageInfoList.get(redditGalleryImageInfoList.size() - 1).payload = new RedditGalleryPayload.Item("", "", mediaId); + notifyItemChanged(redditGalleryImageInfoList.size() - 1); + } + + public void removeFailedToUploadImage() { + redditGalleryImageInfoList.remove(redditGalleryImageInfoList.size() - 1); + notifyItemRemoved(redditGalleryImageInfoList.size()); + } + + class ImageViewHolder extends RecyclerView.ViewHolder { + @BindView(R.id.aspect_ratio_gif_image_view_item_reddit_gallery_submission_image) + AspectRatioGifImageView imageView; + @BindView(R.id.progress_bar_item_reddit_gallery_submission_image) + ProgressBar progressBar; + @BindView(R.id.close_image_view_item_reddit_gallery_submission_image) + ImageView closeImageView; + + public ImageViewHolder(@NonNull View itemView) { + super(itemView); + + ButterKnife.bind(this, itemView); + + imageView.setRatio(1); + + closeImageView.setOnClickListener(view -> { + redditGalleryImageInfoList.remove(getBindingAdapterPosition()); + notifyItemRemoved(getBindingAdapterPosition()); + }); + } + } + + class AddImageViewHolder extends RecyclerView.ViewHolder { + + public AddImageViewHolder(@NonNull View itemView) { + super(itemView); + + FloatingActionButton fab = itemView.findViewById(R.id.fab_item_gallery_submission_add_image); + fab.setBackgroundTintList(ColorStateList.valueOf(customThemeWrapper.getColorPrimaryLightTheme())); + fab.setImageTintList(ColorStateList.valueOf(customThemeWrapper.getFABIconColor())); + + itemView.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() { + @Override + public void onGlobalLayout() { + itemView.getViewTreeObserver().removeOnGlobalLayoutListener(this); + int width = itemView.getMeasuredWidth(); + ViewGroup.LayoutParams params = itemView.getLayoutParams(); + params.height = width; + itemView.setLayoutParams(params); + } + }); + + fab.setOnClickListener(view -> itemClickListener.onAddImageClicked()); + itemView.setOnClickListener(view -> fab.performClick()); + } + } + + public static class RedditGalleryImageInfo implements Parcelable { + public String imageUrlString; + public RedditGalleryPayload.Item payload; + + public RedditGalleryImageInfo(String imageUrlString) { + this.imageUrlString = imageUrlString; + } + + protected RedditGalleryImageInfo(Parcel in) { + imageUrlString = in.readString(); + payload = in.readParcelable(RedditGalleryPayload.Item.class.getClassLoader()); + } + + public static final Creator<RedditGalleryImageInfo> CREATOR = new Creator<RedditGalleryImageInfo>() { + @Override + public RedditGalleryImageInfo createFromParcel(Parcel in) { + return new RedditGalleryImageInfo(in); + } + + @Override + public RedditGalleryImageInfo[] newArray(int size) { + return new RedditGalleryImageInfo[size]; + } + }; + + @Override + public int describeContents() { + return 0; + } + + @Override + public void writeToParcel(Parcel parcel, int i) { + parcel.writeString(imageUrlString); + parcel.writeParcelable(payload, i); + } + } + + public interface ItemClickListener { + void onAddImageClicked(); + } +} diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/TrendingSearchRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/TrendingSearchRecyclerViewAdapter.java new file mode 100644 index 00000000..8ab40aff --- /dev/null +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/TrendingSearchRecyclerViewAdapter.java @@ -0,0 +1,228 @@ +package ml.docilealligator.infinityforreddit.adapters; + +import android.content.Context; +import android.content.res.ColorStateList; +import android.graphics.drawable.Drawable; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.ImageView; +import android.widget.ProgressBar; +import android.widget.RelativeLayout; +import android.widget.TextView; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.recyclerview.widget.RecyclerView; + +import com.bumptech.glide.Glide; +import com.bumptech.glide.RequestBuilder; +import com.bumptech.glide.RequestManager; +import com.bumptech.glide.load.DataSource; +import com.bumptech.glide.load.engine.GlideException; +import com.bumptech.glide.request.RequestListener; +import com.bumptech.glide.request.target.Target; + +import java.util.ArrayList; + +import butterknife.BindView; +import butterknife.ButterKnife; +import ml.docilealligator.infinityforreddit.R; +import ml.docilealligator.infinityforreddit.TrendingSearch; +import ml.docilealligator.infinityforreddit.customtheme.CustomThemeWrapper; +import ml.docilealligator.infinityforreddit.customviews.AspectRatioGifImageView; +import ml.docilealligator.infinityforreddit.post.Post; + +public class TrendingSearchRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> { + private ArrayList<TrendingSearch> trendingSearches; + private CustomThemeWrapper customThemeWrapper; + private RequestManager glide; + private int imageViewWidth; + private boolean dataSavingMode; + private boolean disableImagePreview; + private float mScale; + private ItemClickListener itemClickListener; + + public TrendingSearchRecyclerViewAdapter(Context context, CustomThemeWrapper customThemeWrapper, + int imageViewWidth, boolean dataSavingMode, boolean disableImagePreview, + ItemClickListener itemClickListener) { + this.customThemeWrapper = customThemeWrapper; + this.glide = Glide.with(context); + this.imageViewWidth = imageViewWidth; + this.dataSavingMode = dataSavingMode; + this.disableImagePreview = disableImagePreview; + mScale = context.getResources().getDisplayMetrics().density; + this.itemClickListener = itemClickListener; + } + + @NonNull + @Override + public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { + return new TrendingSearchViewHolder(LayoutInflater.from(parent.getContext()).inflate(R.layout.item_trending_search, parent, false)); + } + + @Override + public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) { + if (holder instanceof TrendingSearchViewHolder) { + TrendingSearch trendingSearch = trendingSearches.get(position); + if (dataSavingMode && disableImagePreview) { + ((TrendingSearchViewHolder) holder).noPreviewLinkImageView.setVisibility(View.VISIBLE); + } else { + Post.Preview preview = getSuitablePreview(trendingSearch.previews); + if (preview != null) { + ((TrendingSearchViewHolder) holder).imageWrapperRelativeLayout.setVisibility(View.VISIBLE); + if (preview.getPreviewWidth() <= 0 || preview.getPreviewHeight() <= 0) { + int height = (int) (400 * mScale); + ((TrendingSearchViewHolder) holder).imageView.setScaleType(ImageView.ScaleType.CENTER_CROP); + ((TrendingSearchViewHolder) holder).imageView.getLayoutParams().height = height; + preview.setPreviewWidth(imageViewWidth); + preview.setPreviewHeight(height); + } else { + ((TrendingSearchViewHolder) holder).imageView + .setRatio((float) preview.getPreviewHeight() / preview.getPreviewWidth()); + } + loadImage((TrendingSearchViewHolder) holder, preview); + } else { + ((TrendingSearchViewHolder) holder).noPreviewLinkImageView.setVisibility(View.VISIBLE); + } + } + + ((TrendingSearchViewHolder) holder).titleTextView.setText(trendingSearch.displayString); + } + } + + @Override + public int getItemCount() { + return trendingSearches == null ? 0 : trendingSearches.size(); + } + + @Override + public void onViewRecycled(@NonNull RecyclerView.ViewHolder holder) { + super.onViewRecycled(holder); + if (holder instanceof TrendingSearchViewHolder) { + glide.clear(((TrendingSearchViewHolder) holder).imageView); + ((TrendingSearchViewHolder) holder).imageWrapperRelativeLayout.setVisibility(View.GONE); + ((TrendingSearchViewHolder) holder).errorRelativeLayout.setVisibility(View.GONE); + ((TrendingSearchViewHolder) holder).noPreviewLinkImageView.setVisibility(View.GONE); + ((TrendingSearchViewHolder) holder).progressBar.setVisibility(View.GONE); + } + } + + @Nullable + private Post.Preview getSuitablePreview(ArrayList<Post.Preview> previews) { + Post.Preview preview; + if (!previews.isEmpty()) { + int previewIndex; + if (dataSavingMode && previews.size() > 2) { + previewIndex = previews.size() / 2; + } else { + previewIndex = 0; + } + preview = previews.get(previewIndex); + if (preview.getPreviewWidth() * preview.getPreviewHeight() > 10_000_000) { + for (int i = previews.size() - 1; i >= 1; i--) { + preview = previews.get(i); + if (imageViewWidth >= preview.getPreviewWidth()) { + if (preview.getPreviewWidth() * preview.getPreviewHeight() <= 10_000_000) { + return preview; + } + } else { + int height = imageViewWidth / preview.getPreviewWidth() * preview.getPreviewHeight(); + if (imageViewWidth * height <= 10_000_000) { + return preview; + } + } + } + } + + if (preview.getPreviewWidth() * preview.getPreviewHeight() > 10_000_000) { + int divisor = 2; + do { + preview.setPreviewWidth(preview.getPreviewWidth() / divisor); + preview.setPreviewHeight(preview.getPreviewHeight() / divisor); + divisor *= 2; + } while (preview.getPreviewWidth() * preview.getPreviewHeight() > 10_000_000); + } + return preview; + } + + return null; + } + + private void loadImage(final TrendingSearchViewHolder holder, @NonNull Post.Preview preview) { + String url = preview.getPreviewUrl(); + RequestBuilder<Drawable> imageRequestBuilder = glide.load(url).listener(new RequestListener<Drawable>() { + @Override + public boolean onLoadFailed(@Nullable GlideException e, Object model, Target<Drawable> target, boolean isFirstResource) { + holder.progressBar.setVisibility(View.GONE); + holder.errorRelativeLayout.setVisibility(View.VISIBLE); + holder.errorRelativeLayout.setOnClickListener(view -> { + holder.progressBar.setVisibility(View.VISIBLE); + holder.errorRelativeLayout.setVisibility(View.GONE); + loadImage(holder, preview); + }); + return false; + } + + @Override + public boolean onResourceReady(Drawable resource, Object model, Target<Drawable> target, DataSource dataSource, boolean isFirstResource) { + holder.errorRelativeLayout.setVisibility(View.GONE); + holder.progressBar.setVisibility(View.GONE); + return false; + } + }); + + if (imageViewWidth > preview.getPreviewWidth()) { + imageRequestBuilder.override(preview.getPreviewWidth(), preview.getPreviewHeight()).into(holder.imageView); + } else { + imageRequestBuilder.into(holder.imageView); + } + } + + public void setTrendingSearches(ArrayList<TrendingSearch> trendingSearches) { + if (trendingSearches != null) { + this.trendingSearches = trendingSearches; + notifyItemRangeInserted(0, trendingSearches.size()); + } else { + int size = this.trendingSearches == null ? 0 : this.trendingSearches.size(); + this.trendingSearches = null; + notifyItemRangeRemoved(0, size); + } + } + + class TrendingSearchViewHolder extends RecyclerView.ViewHolder { + + @BindView(R.id.image_wrapper_relative_layout_item_trending_search) + RelativeLayout imageWrapperRelativeLayout; + @BindView(R.id.progress_bar_item_trending_search) + ProgressBar progressBar; + @BindView(R.id.image_view_item_trending_search) + AspectRatioGifImageView imageView; + @BindView(R.id.load_image_error_relative_layout_item_trending_search) + RelativeLayout errorRelativeLayout; + @BindView(R.id.load_image_error_text_view_item_trending_search) + TextView errorTextView; + @BindView(R.id.image_view_no_preview_gallery_item_trending_search) + ImageView noPreviewLinkImageView; + @BindView(R.id.title_text_view_item_trending_search) + TextView titleTextView; + + public TrendingSearchViewHolder(@NonNull View itemView) { + super(itemView); + ButterKnife.bind(this, itemView); + + noPreviewLinkImageView.setBackgroundColor(customThemeWrapper.getNoPreviewPostTypeBackgroundColor()); + noPreviewLinkImageView.setColorFilter(customThemeWrapper.getNoPreviewPostTypeIconTint(), android.graphics.PorterDuff.Mode.SRC_IN); + progressBar.setIndeterminateTintList(ColorStateList.valueOf(customThemeWrapper.getColorAccent())); + errorTextView.setTextColor(customThemeWrapper.getPrimaryTextColor()); + + itemView.setOnClickListener(view -> { + itemClickListener.onClick(trendingSearches.get(getBindingAdapterPosition())); + }); + } + } + + public interface ItemClickListener { + void onClick(TrendingSearch trendingSearch); + } +} diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/apis/RedditAPI.java b/app/src/main/java/ml/docilealligator/infinityforreddit/apis/RedditAPI.java index 5269da5f..44a65ebb 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/apis/RedditAPI.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/apis/RedditAPI.java @@ -5,6 +5,7 @@ import java.util.Map; import okhttp3.MultipartBody; import okhttp3.RequestBody; import retrofit2.Call; +import retrofit2.http.Body; import retrofit2.http.DELETE; import retrofit2.http.FieldMap; import retrofit2.http.FormUrlEncoded; @@ -137,21 +138,23 @@ public interface RedditAPI { @GET("search.json?include_over_18=1&raw_json=1&type=link") Call<String> searchPostsOauth(@Query("q") String query, @Query("after") String after, - @Query("sort") String sort, + @Query("sort") String sort, @Query("source") String source, @HeaderMap Map<String, String> headers); @GET("search.json?include_over_18=1&raw_json=1&type=link") Call<String> searchPostsOauth(@Query("q") String query, @Query("after") String after, @Query("sort") String sort, @Query("t") String sortTime, + @Query("source") String source, @HeaderMap Map<String, String> headers); @GET("search.json?include_over_18=1&raw_json=1&type=link") Call<String> searchPosts(@Query("q") String query, @Query("after") String after, - @Query("sort") String sort); + @Query("sort") String sort, @Query("source") String source); @GET("search.json?include_over_18=1&raw_json=1&type=link") Call<String> searchPosts(@Query("q") String query, @Query("after") String after, - @Query("sort") String sort, @Query("t") String sortTime); + @Query("sort") String sort, @Query("t") String sortTime, + @Query("source") String source); @GET("r/{subredditName}/search.json?include_over_18=1&raw_json=1&type=link&restrict_sr=true") Call<String> searchPostsInSpecificSubredditOauth(@Path("subredditName") String subredditName, @@ -345,15 +348,24 @@ public interface RedditAPI { @FormUrlEncoded - @PUT("/api/multi{multipath}r/{subredditName}") + @PUT("/api/multi{multipath}/r/{subredditName}") Call<String> addSubredditToMultiReddit(@HeaderMap Map<String, String> headers, @FieldMap Map<String, String> params, @Path(value = "multipath", encoded = true) String multipath, @Path("subredditName") String subredditName); @FormUrlEncoded - @POST("/api/quarantine_optin?raw_json=1") + @POST("/api/quarantine_option?raw_json=1") Call<String> optInQuarantinedSubreddit(@HeaderMap Map<String, String> headers, @FieldMap Map<String, String> params); @GET("/api/subreddit_autocomplete_v2?typeahead_active=true&include_profiles=false&raw_json=1") Call<String> subredditAutocomplete(@HeaderMap Map<String ,String> headers, @Query("query") String query, @Query("include_over_18") boolean nsfw); + + @POST("/api/submit_gallery_post.json?resubmit=true&raw_json=1") + Call<String> submitGalleryPost(@HeaderMap Map<String, String> headers, @Body String body); + + @GET("/api/trending_searches_v1.json?withAds=0&raw_json=1&gilding_detail=1") + Call<String> getTrendingSearches(@HeaderMap Map<String, String> headers); + + @GET("/r/{subredditName}/wiki/index.json?raw_json=1") + Call<String> getWiki(@Path("subredditName") String subredditName); } diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/apis/Strapi.java b/app/src/main/java/ml/docilealligator/infinityforreddit/apis/Strapi.java index 02af768f..e68b8850 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/apis/Strapi.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/apis/Strapi.java @@ -1,58 +1,12 @@ package ml.docilealligator.infinityforreddit.apis; -import java.util.Map; - import retrofit2.Call; -import retrofit2.http.FormUrlEncoded; import retrofit2.http.GET; -import retrofit2.http.HeaderMap; -import retrofit2.http.POST; import retrofit2.http.Path; public interface Strapi { @GET("/broadcasts") - Call<String> getAllBroadcasts(@HeaderMap Map<String ,String> headers); - - /* - Response: - {"status": "success", "status_message": ""} - */ - @FormUrlEncoded - @POST("/videos/{rpan_id}/vote/up") - Call<String> upvote(@HeaderMap Map<String, String> headers, @Path("rpan_id") String rpanId); - - @FormUrlEncoded - @POST("/videos/{rpan_id}/vote/down") - Call<String> downvote(@HeaderMap Map<String, String> headers, @Path("rpan_id") String rpanId); - - @FormUrlEncoded - @POST("/videos/{rpan_id}/vote/unset") - Call<String> unsetVote(@HeaderMap Map<String, String> headers, @Path("rpan_id") String rpanId); - - /* - Request payload: {text: "Noice"} - - Response: - {"status": "success", "status_message": "", "data": {"auto_mute_status": {"level": 0, "level_changed": false}, - "r2_comment": {"total_awards_received": 0, "approved_at_utc": null, "comment_type": null, "edited": false, - "mod_reason_by": null, "banned_by": null, "author_flair_type": "text", "removal_reason": null, "link_id": "t3_of7btc", - "author_flair_template_id": null, "likes": true, "rtjson": {"document": [{"c": [{"e": "text", "t": "Noice"}], "e": "par"}]}, - "replies": "", "user_reports": [], "saved": false, "id": "h4avk42", "banned_at_utc": null, "mod_reason_title": null, - "gilded": 0, "archived": false, "no_follow": false, "author": "Hostilenemy", "can_mod_post": false, "send_replies": true, - "parent_id": "t3_of7btc", "score": 1, "author_fullname": "t2_z40p4", "approved_by": null, "mod_note": null, - "all_awardings": [], "subreddit_id": "t5_3psukr", "body": "Noice", "awarders": [], "downs": 0, "author_flair_css_class": null, - "name": "t1_h4avk42", "author_patreon_flair": false, "collapsed": false, "author_flair_richtext": [], "is_submitter": false, - "body_html": "<div class=\"md\"><p>Noice</p>\n</div>", "gildings": {}, "collapsed_reason": null, "distinguished": null, - "associated_award": null, "stickied": false, "author_premium": false, "can_gild": false, "top_awarded_type": null, - "author_flair_text_color": null, "score_hidden": false, "permalink": "/r/RedditSets/comments/of7btc/whistleface_762021_house_music/h4avk42/", - "num_reports": null, "locked": false, "report_reasons": null, "created": 1625647709.0, "subreddit": "RedditSets", "author_flair_text": null, - "treatment_tags": [], "rte_mode": "markdown", "created_utc": 1625618909.0, "subreddit_name_prefixed": "r/RedditSets", - "controversiality": 0, "author_flair_background_color": null, "collapsed_because_crowd_control": null, "mod_reports": [], - "subreddit_type": "public", "ups": 1}}} - */ - @FormUrlEncoded - @POST("/broadcasts/{rpan_id}/comment_v2") - Call<String> sendComment(@HeaderMap Map<String, String> headers, @Path("rpan_id") String rpanId); + Call<String> getAllBroadcasts(); @GET("/videos/{rpan_id_or_fullname}") Call<String> getRPANBroadcast(@Path("rpan_id_or_fullname") String rpanIdOrFullname); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/bottomsheetfragments/CopyTextBottomSheetFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/bottomsheetfragments/CopyTextBottomSheetFragment.java index 6e87c4ee..7b6452ec 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/bottomsheetfragments/CopyTextBottomSheetFragment.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/bottomsheetfragments/CopyTextBottomSheetFragment.java @@ -53,23 +53,26 @@ public class CopyTextBottomSheetFragment extends RoundedBottomSheetDialogFragmen View rootView = inflater.inflate(R.layout.fragment_copy_text_bottom_sheet, container, false); ButterKnife.bind(this, rootView); - String rawText = getArguments().getString(EXTRA_RAW_TEXT); - markdownText = getArguments().getString(EXTRA_MARKDOWN); - if (markdownText != null) { - markdownText = markdownText.replaceAll("<sup>", "^").replaceAll("</sup>", ""); - } + String rawText = getArguments().getString(EXTRA_RAW_TEXT, null); + markdownText = getArguments().getString(EXTRA_MARKDOWN, null); - copyRawTextTextView.setOnClickListener(view -> { - showCopyDialog(rawText); - dismiss(); - }); + if (rawText != null) { + copyRawTextTextView.setOnClickListener(view -> { + showCopyDialog(rawText); + dismiss(); + }); - copyAllRawTextTextView.setOnClickListener(view -> { - copyText(rawText); - dismiss(); - }); + copyAllRawTextTextView.setOnClickListener(view -> { + copyText(rawText); + dismiss(); + }); + } else { + copyRawTextTextView.setVisibility(View.GONE); + copyAllRawTextTextView.setVisibility(View.GONE); + } if (markdownText != null) { + markdownText = markdownText.replaceAll("<sup>", "^").replaceAll("</sup>", ""); copyMarkdownTextView.setOnClickListener(view -> { showCopyDialog(markdownText); dismiss(); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/bottomsheetfragments/FlairBottomSheetFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/bottomsheetfragments/FlairBottomSheetFragment.java index d8b39b7e..b7b651a6 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/bottomsheetfragments/FlairBottomSheetFragment.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/bottomsheetfragments/FlairBottomSheetFragment.java @@ -12,7 +12,6 @@ import android.widget.TextView; import androidx.annotation.NonNull; import androidx.fragment.app.Fragment; -import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; import com.google.android.material.bottomsheet.BottomSheetDialogFragment; @@ -87,7 +86,6 @@ public class FlairBottomSheetFragment extends BottomSheetDialogFragment { dismiss(); }); - recyclerView.setLayoutManager(new LinearLayoutManager(getActivity())); recyclerView.setAdapter(mAdapter); mAccessToken = getArguments().getString(EXTRA_ACCESS_TOKEN); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/bottomsheetfragments/PostTypeBottomSheetFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/bottomsheetfragments/PostTypeBottomSheetFragment.java index 64b604ab..046c512b 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/bottomsheetfragments/PostTypeBottomSheetFragment.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/bottomsheetfragments/PostTypeBottomSheetFragment.java @@ -30,6 +30,7 @@ public class PostTypeBottomSheetFragment extends RoundedBottomSheetDialogFragmen public static final int TYPE_LINK = 1; public static final int TYPE_IMAGE = 2; public static final int TYPE_VIDEO = 3; + public static final int TYPE_GALLERY = 4; @BindView(R.id.text_type_linear_layout_post_type_bottom_sheet_fragment) TextView textTypeTextView; @BindView(R.id.link_type_linear_layout_post_type_bottom_sheet_fragment) @@ -38,6 +39,8 @@ public class PostTypeBottomSheetFragment extends RoundedBottomSheetDialogFragmen TextView imageTypeTextView; @BindView(R.id.video_type_linear_layout_post_type_bottom_sheet_fragment) TextView videoTypeTextView; + @BindView(R.id.gallery_type_linear_layout_post_type_bottom_sheet_fragment) + TextView galleryTypeTextView; private Activity activity; public PostTypeBottomSheetFragment() { @@ -75,6 +78,11 @@ public class PostTypeBottomSheetFragment extends RoundedBottomSheetDialogFragmen dismiss(); }); + galleryTypeTextView.setOnClickListener(view -> { + ((PostTypeSelectionCallback) activity).postTypeSelected(TYPE_GALLERY); + dismiss(); + }); + return rootView; } diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/bottomsheetfragments/SelectOrCaptureImageBottomSheetFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/bottomsheetfragments/SelectOrCaptureImageBottomSheetFragment.java new file mode 100644 index 00000000..4be9b51f --- /dev/null +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/bottomsheetfragments/SelectOrCaptureImageBottomSheetFragment.java @@ -0,0 +1,52 @@ +package ml.docilealligator.infinityforreddit.bottomsheetfragments; + +import android.content.Context; +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 com.deishelon.roundedbottomsheet.RoundedBottomSheetDialogFragment; + +import ml.docilealligator.infinityforreddit.R; +import ml.docilealligator.infinityforreddit.activities.PostGalleryActivity; + +public class SelectOrCaptureImageBottomSheetFragment extends RoundedBottomSheetDialogFragment { + + private PostGalleryActivity mActivity; + + public SelectOrCaptureImageBottomSheetFragment() { + // Required empty public constructor + } + + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, + Bundle savedInstanceState) { + // Inflate the layout for this fragment + View rootView = inflater.inflate(R.layout.fragment_select_or_capture_image_bottom_sheet, container, false); + + TextView selectImageTextView = rootView.findViewById(R.id.select_image_text_view_select_or_capture_image_bottom_sheet_fragment); + TextView captureImageTextView = rootView.findViewById(R.id.capture_image_text_view_select_or_capture_image_bottom_sheet_fragment); + + selectImageTextView.setOnClickListener(view -> { + mActivity.selectImage(); + dismiss(); + }); + + captureImageTextView.setOnClickListener(view -> { + mActivity.captureImage(); + dismiss(); + }); + + return rootView; + } + + @Override + public void onAttach(@NonNull Context context) { + super.onAttach(context); + mActivity = (PostGalleryActivity) context; + } +}
\ No newline at end of file diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/broadcastreceivers/WallpaperChangeReceiver.java b/app/src/main/java/ml/docilealligator/infinityforreddit/broadcastreceivers/WallpaperChangeReceiver.java index f994b1a9..5a596308 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/broadcastreceivers/WallpaperChangeReceiver.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/broadcastreceivers/WallpaperChangeReceiver.java @@ -4,6 +4,8 @@ import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; +import androidx.core.content.ContextCompat; + import ml.docilealligator.infinityforreddit.services.MaterialYouService; public class WallpaperChangeReceiver extends BroadcastReceiver { @@ -11,6 +13,6 @@ public class WallpaperChangeReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { Intent materialYouIntent = new Intent(context, MaterialYouService.class); - context.startService(materialYouIntent); + ContextCompat.startForegroundService(context, materialYouIntent); } } diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/customviews/LinearLayoutManagerBugFixed.java b/app/src/main/java/ml/docilealligator/infinityforreddit/customviews/LinearLayoutManagerBugFixed.java new file mode 100644 index 00000000..e2264225 --- /dev/null +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/customviews/LinearLayoutManagerBugFixed.java @@ -0,0 +1,25 @@ +package ml.docilealligator.infinityforreddit.customviews; + +import android.content.Context; +import android.util.AttributeSet; + +import androidx.recyclerview.widget.LinearLayoutManager; + +public class LinearLayoutManagerBugFixed extends LinearLayoutManager { + public LinearLayoutManagerBugFixed(Context context) { + super(context); + } + + public LinearLayoutManagerBugFixed(Context context, int orientation, boolean reverseLayout) { + super(context, orientation, reverseLayout); + } + + public LinearLayoutManagerBugFixed(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { + super(context, attrs, defStyleAttr, defStyleRes); + } + + @Override + public boolean supportsPredictiveItemAnimations() { + return false; + } +} diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/customviews/MarkwonLinearLayoutManager.java b/app/src/main/java/ml/docilealligator/infinityforreddit/customviews/MarkwonLinearLayoutManager.java index a654b437..35923fa6 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/customviews/MarkwonLinearLayoutManager.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/customviews/MarkwonLinearLayoutManager.java @@ -5,9 +5,7 @@ import android.view.View; import android.view.ViewTreeObserver; import android.widget.HorizontalScrollView; -import androidx.recyclerview.widget.LinearLayoutManager; - -public class MarkwonLinearLayoutManager extends LinearLayoutManager { +public class MarkwonLinearLayoutManager extends LinearLayoutManagerBugFixed { public interface HorizontalScrollViewScrolledListener { void onScrolledLeft(); void onScrolledRight(); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/customviews/ViewPagerBugFixed.java b/app/src/main/java/ml/docilealligator/infinityforreddit/customviews/ViewPagerBugFixed.java new file mode 100644 index 00000000..78e7b88e --- /dev/null +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/customviews/ViewPagerBugFixed.java @@ -0,0 +1,37 @@ +package ml.docilealligator.infinityforreddit.customviews; + +import android.content.Context; +import android.util.AttributeSet; +import android.view.MotionEvent; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.viewpager.widget.ViewPager; + +public class ViewPagerBugFixed extends ViewPager { + public ViewPagerBugFixed(@NonNull Context context) { + super(context); + } + + public ViewPagerBugFixed(@NonNull Context context, @Nullable AttributeSet attrs) { + super(context, attrs); + } + + @Override + public boolean onTouchEvent(MotionEvent ev) { + try { + return super.onTouchEvent(ev); + } catch (IllegalArgumentException ignore) {} + + return false; + } + + @Override + public boolean onInterceptTouchEvent(MotionEvent ev) { + try { + return super.onInterceptTouchEvent(ev); + } catch (IllegalArgumentException ignore) {} + + return false; + } +} diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/events/ChangeDefaultLinkPostLayoutEvent.java b/app/src/main/java/ml/docilealligator/infinityforreddit/events/ChangeDefaultLinkPostLayoutEvent.java new file mode 100644 index 00000000..d7897beb --- /dev/null +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/events/ChangeDefaultLinkPostLayoutEvent.java @@ -0,0 +1,9 @@ +package ml.docilealligator.infinityforreddit.events; + +public class ChangeDefaultLinkPostLayoutEvent { + public int defaultLinkPostLayout; + + public ChangeDefaultLinkPostLayoutEvent(int defaultLinkPostLayout) { + this.defaultLinkPostLayout = defaultLinkPostLayout; + } +} diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/events/ChangeRememberMutingOptionInPostFeedEvent.java b/app/src/main/java/ml/docilealligator/infinityforreddit/events/ChangeRememberMutingOptionInPostFeedEvent.java new file mode 100644 index 00000000..d49d5939 --- /dev/null +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/events/ChangeRememberMutingOptionInPostFeedEvent.java @@ -0,0 +1,9 @@ +package ml.docilealligator.infinityforreddit.events; + +public class ChangeRememberMutingOptionInPostFeedEvent { + public boolean rememberMutingOptionInPostFeedEvent; + + public ChangeRememberMutingOptionInPostFeedEvent(boolean rememberMutingOptionInPostFeedEvent) { + this.rememberMutingOptionInPostFeedEvent = rememberMutingOptionInPostFeedEvent; + } +} diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/events/SubmitGalleryPostEvent.java b/app/src/main/java/ml/docilealligator/infinityforreddit/events/SubmitGalleryPostEvent.java new file mode 100644 index 00000000..fcab85cd --- /dev/null +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/events/SubmitGalleryPostEvent.java @@ -0,0 +1,13 @@ +package ml.docilealligator.infinityforreddit.events; + +public class SubmitGalleryPostEvent { + public boolean postSuccess; + public String postUrl; + public String errorMessage; + + public SubmitGalleryPostEvent(boolean postSuccess, String postUrl, String errorMessage) { + this.postSuccess = postSuccess; + this.postUrl = postUrl; + this.errorMessage = errorMessage; + } +} diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/events/ToggleSecureModeEvent.java b/app/src/main/java/ml/docilealligator/infinityforreddit/events/ToggleSecureModeEvent.java new file mode 100644 index 00000000..a7c27eb3 --- /dev/null +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/events/ToggleSecureModeEvent.java @@ -0,0 +1,9 @@ +package ml.docilealligator.infinityforreddit.events; + +public class ToggleSecureModeEvent { + public boolean isSecureMode; + + public ToggleSecureModeEvent(boolean isSecureMode) { + this.isSecureMode = isSecureMode; + } +} diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/CommentsListingFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/CommentsListingFragment.java index c730b4ba..04cabb7a 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/CommentsListingFragment.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/CommentsListingFragment.java @@ -25,7 +25,6 @@ import androidx.core.content.res.ResourcesCompat; import androidx.fragment.app.Fragment; import androidx.lifecycle.ViewModelProvider; import androidx.recyclerview.widget.ItemTouchHelper; -import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; import androidx.swiperefreshlayout.widget.SwipeRefreshLayout; @@ -50,6 +49,7 @@ import ml.docilealligator.infinityforreddit.activities.BaseActivity; import ml.docilealligator.infinityforreddit.adapters.CommentsListingRecyclerViewAdapter; import ml.docilealligator.infinityforreddit.comment.CommentViewModel; import ml.docilealligator.infinityforreddit.customtheme.CustomThemeWrapper; +import ml.docilealligator.infinityforreddit.customviews.LinearLayoutManagerBugFixed; import ml.docilealligator.infinityforreddit.utils.SharedPreferencesUtils; import ml.docilealligator.infinityforreddit.utils.Utils; import retrofit2.Retrofit; @@ -105,7 +105,7 @@ public class CommentsListingFragment extends Fragment implements FragmentCommuni private String mAccessToken; private RequestManager mGlide; private AppCompatActivity mActivity; - private LinearLayoutManager mLinearLayoutManager; + private LinearLayoutManagerBugFixed mLinearLayoutManager; private CommentsListingRecyclerViewAdapter mAdapter; private SortType sortType; private ColorDrawable backgroundSwipeRight; @@ -255,7 +255,7 @@ public class CommentsListingFragment extends Fragment implements FragmentCommuni private void bindView(Resources resources) { if (mActivity != null && !mActivity.isFinishing() && !mActivity.isDestroyed()) { - mLinearLayoutManager = new LinearLayoutManager(mActivity); + mLinearLayoutManager = new LinearLayoutManagerBugFixed(mActivity); mCommentRecyclerView.setLayoutManager(mLinearLayoutManager); mAdapter = new CommentsListingRecyclerViewAdapter(mActivity, mOauthRetrofit, customThemeWrapper, diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/FollowedUsersListingFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/FollowedUsersListingFragment.java index 38726cd8..1fda28d4 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/FollowedUsersListingFragment.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/FollowedUsersListingFragment.java @@ -17,7 +17,6 @@ import android.widget.TextView; import androidx.annotation.NonNull; import androidx.fragment.app.Fragment; import androidx.lifecycle.ViewModelProvider; -import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; import androidx.swiperefreshlayout.widget.SwipeRefreshLayout; @@ -40,6 +39,7 @@ import ml.docilealligator.infinityforreddit.activities.BaseActivity; import ml.docilealligator.infinityforreddit.activities.SubscribedThingListingActivity; import ml.docilealligator.infinityforreddit.adapters.FollowedUsersRecyclerViewAdapter; import ml.docilealligator.infinityforreddit.customtheme.CustomThemeWrapper; +import ml.docilealligator.infinityforreddit.customviews.LinearLayoutManagerBugFixed; import ml.docilealligator.infinityforreddit.subscribeduser.SubscribedUserViewModel; import ml.docilealligator.infinityforreddit.utils.SharedPreferencesUtils; import retrofit2.Retrofit; @@ -78,7 +78,7 @@ public class FollowedUsersListingFragment extends Fragment implements FragmentCo SubscribedUserViewModel mSubscribedUserViewModel; private Activity mActivity; private RequestManager mGlide; - private LinearLayoutManager mLinearLayoutManager; + private LinearLayoutManagerBugFixed mLinearLayoutManager; public FollowedUsersListingFragment() { // Required empty public constructor @@ -109,7 +109,7 @@ public class FollowedUsersListingFragment extends Fragment implements FragmentCo mGlide = Glide.with(this); - mLinearLayoutManager = new LinearLayoutManager(mActivity); + mLinearLayoutManager = new LinearLayoutManagerBugFixed(mActivity); mRecyclerView.setLayoutManager(mLinearLayoutManager); FollowedUsersRecyclerViewAdapter adapter = new FollowedUsersRecyclerViewAdapter(mActivity, mExecutor, mOauthRetrofit, mRedditDataRoomDatabase, mCustomThemeWrapper, diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/InboxFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/InboxFragment.java index b9879c3e..567f3a1b 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/InboxFragment.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/InboxFragment.java @@ -14,7 +14,6 @@ import androidx.annotation.NonNull; 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 androidx.swiperefreshlayout.widget.SwipeRefreshLayout; @@ -38,6 +37,7 @@ import ml.docilealligator.infinityforreddit.RedditDataRoomDatabase; import ml.docilealligator.infinityforreddit.activities.BaseActivity; import ml.docilealligator.infinityforreddit.adapters.MessageRecyclerViewAdapter; import ml.docilealligator.infinityforreddit.customtheme.CustomThemeWrapper; +import ml.docilealligator.infinityforreddit.customviews.LinearLayoutManagerBugFixed; import ml.docilealligator.infinityforreddit.events.RepliedToPrivateMessageEvent; import ml.docilealligator.infinityforreddit.message.FetchMessage; import ml.docilealligator.infinityforreddit.message.MessageViewModel; @@ -72,7 +72,7 @@ public class InboxFragment extends Fragment implements FragmentCommunicator { private String mWhere; private MessageRecyclerViewAdapter mAdapter; private RequestManager mGlide; - private LinearLayoutManager mLinearLayoutManager; + private LinearLayoutManagerBugFixed mLinearLayoutManager; private BaseActivity mActivity; public InboxFragment() { @@ -106,7 +106,7 @@ public class InboxFragment extends Fragment implements FragmentCommunicator { mWhere = arguments.getString(EXTRA_MESSAGE_WHERE, FetchMessage.WHERE_INBOX); mAdapter = new MessageRecyclerViewAdapter(mActivity, mOauthRetrofit, mCustomThemeWrapper, mAccessToken, mWhere, () -> mMessageViewModel.retryLoadingMore()); - mLinearLayoutManager = new LinearLayoutManager(mActivity); + mLinearLayoutManager = new LinearLayoutManagerBugFixed(mActivity); mRecyclerView.setLayoutManager(mLinearLayoutManager); mRecyclerView.setAdapter(mAdapter); DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(mActivity, mLinearLayoutManager.getOrientation()); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/MultiRedditListingFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/MultiRedditListingFragment.java index fc0723eb..0f80d47a 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/MultiRedditListingFragment.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/MultiRedditListingFragment.java @@ -17,7 +17,6 @@ import androidx.annotation.NonNull; import androidx.appcompat.app.AppCompatActivity; import androidx.fragment.app.Fragment; import androidx.lifecycle.ViewModelProvider; -import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; import androidx.swiperefreshlayout.widget.SwipeRefreshLayout; @@ -43,6 +42,7 @@ import ml.docilealligator.infinityforreddit.activities.ViewMultiRedditDetailActi import ml.docilealligator.infinityforreddit.adapters.MultiRedditListingRecyclerViewAdapter; import ml.docilealligator.infinityforreddit.bottomsheetfragments.MultiRedditOptionsBottomSheetFragment; import ml.docilealligator.infinityforreddit.customtheme.CustomThemeWrapper; +import ml.docilealligator.infinityforreddit.customviews.LinearLayoutManagerBugFixed; import ml.docilealligator.infinityforreddit.multireddit.MultiReddit; import ml.docilealligator.infinityforreddit.multireddit.MultiRedditViewModel; import ml.docilealligator.infinityforreddit.utils.SharedPreferencesUtils; @@ -80,7 +80,7 @@ public class MultiRedditListingFragment extends Fragment implements FragmentComm public MultiRedditViewModel mMultiRedditViewModel; private AppCompatActivity mActivity; private RequestManager mGlide; - private LinearLayoutManager mLinearLayoutManager; + private LinearLayoutManagerBugFixed mLinearLayoutManager; public MultiRedditListingFragment() { // Required empty public constructor @@ -114,7 +114,7 @@ public class MultiRedditListingFragment extends Fragment implements FragmentComm mGlide = Glide.with(this); - mLinearLayoutManager = new LinearLayoutManager(mActivity); + mLinearLayoutManager = new LinearLayoutManagerBugFixed(mActivity); mRecyclerView.setLayoutManager(mLinearLayoutManager); MultiRedditListingRecyclerViewAdapter adapter = new MultiRedditListingRecyclerViewAdapter(mActivity, mExecutor, mOauthRetrofit, mRedditDataRoomDatabase, mCustomThemeWrapper, accessToken, diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/PostFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/PostFragment.java index 4aa058d7..c98f27e6 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/PostFragment.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/PostFragment.java @@ -1,6 +1,9 @@ package ml.docilealligator.infinityforreddit.fragments; +import static im.ene.toro.media.PlaybackInfo.INDEX_UNSET; +import static im.ene.toro.media.PlaybackInfo.TIME_UNSET; + import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; @@ -29,13 +32,13 @@ import android.widget.Toast; import androidx.annotation.DimenRes; import androidx.annotation.NonNull; +import androidx.annotation.Nullable; import androidx.appcompat.app.AppCompatActivity; import androidx.core.content.res.ResourcesCompat; import androidx.fragment.app.Fragment; import androidx.lifecycle.ViewModelProvider; import androidx.paging.PagedList; import androidx.recyclerview.widget.ItemTouchHelper; -import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.LinearSmoothScroller; import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.StaggeredGridLayoutManager; @@ -78,9 +81,11 @@ import ml.docilealligator.infinityforreddit.activities.ViewSubredditDetailActivi import ml.docilealligator.infinityforreddit.adapters.PostRecyclerViewAdapter; import ml.docilealligator.infinityforreddit.customtheme.CustomThemeWrapper; import ml.docilealligator.infinityforreddit.customviews.CustomToroContainer; +import ml.docilealligator.infinityforreddit.customviews.LinearLayoutManagerBugFixed; import ml.docilealligator.infinityforreddit.events.ChangeAutoplayNsfwVideosEvent; import ml.docilealligator.infinityforreddit.events.ChangeCompactLayoutToolbarHiddenByDefaultEvent; import ml.docilealligator.infinityforreddit.events.ChangeDataSavingModeEvent; +import ml.docilealligator.infinityforreddit.events.ChangeDefaultLinkPostLayoutEvent; import ml.docilealligator.infinityforreddit.events.ChangeDefaultPostLayoutEvent; import ml.docilealligator.infinityforreddit.events.ChangeDisableImagePreviewEvent; import ml.docilealligator.infinityforreddit.events.ChangeEnableSwipeActionSwitchEvent; @@ -97,6 +102,7 @@ import ml.docilealligator.infinityforreddit.events.ChangeNSFWBlurEvent; import ml.docilealligator.infinityforreddit.events.ChangeNetworkStatusEvent; import ml.docilealligator.infinityforreddit.events.ChangeOnlyDisablePreviewInVideoAndGifPostsEvent; import ml.docilealligator.infinityforreddit.events.ChangePostLayoutEvent; +import ml.docilealligator.infinityforreddit.events.ChangeRememberMutingOptionInPostFeedEvent; import ml.docilealligator.infinityforreddit.events.ChangeSavePostFeedScrolledPositionEvent; import ml.docilealligator.infinityforreddit.events.ChangeShowAbsoluteNumberOfVotesEvent; import ml.docilealligator.infinityforreddit.events.ChangeShowElapsedTimeEvent; @@ -123,9 +129,6 @@ import ml.docilealligator.infinityforreddit.utils.SharedPreferencesUtils; import ml.docilealligator.infinityforreddit.utils.Utils; import retrofit2.Retrofit; -import static im.ene.toro.media.PlaybackInfo.INDEX_UNSET; -import static im.ene.toro.media.PlaybackInfo.TIME_UNSET; - /** * A simple {@link Fragment} subclass. @@ -136,6 +139,7 @@ public class PostFragment extends Fragment implements FragmentCommunicator { public static final String EXTRA_USER_NAME = "EUN"; public static final String EXTRA_USER_WHERE = "EUW"; public static final String EXTRA_QUERY = "EQ"; + public static final String EXTRA_TRENDING_SOURCE = "ETS"; public static final String EXTRA_POST_TYPE = "EPT"; public static final String EXTRA_FILTER = "EF"; public static final String EXTRA_ACCESS_TOKEN = "EAT"; @@ -201,7 +205,7 @@ public class PostFragment extends Fragment implements FragmentCommunicator { Executor mExecutor; private RequestManager mGlide; private AppCompatActivity activity; - private LinearLayoutManager mLinearLayoutManager; + private LinearLayoutManagerBugFixed mLinearLayoutManager; private StaggeredGridLayoutManager mStaggeredGridLayoutManager; private long postFragmentId; private int postType; @@ -210,6 +214,8 @@ public class PostFragment extends Fragment implements FragmentCommunicator { private boolean hasPost = false; private boolean isShown = false; private boolean savePostFeedScrolledPosition; + private boolean rememberMutingOptionInPostFeed; + private Boolean masterMutingOption; private PostRecyclerViewAdapter mAdapter; private RecyclerView.SmoothScroller smoothScroller; private Window window; @@ -221,6 +227,7 @@ public class PostFragment extends Fragment implements FragmentCommunicator { private String subredditName; private String username; private String query; + private String trendingSource; private String where; private String multiRedditPath; private String concatenatedSubredditNames; @@ -415,6 +422,7 @@ public class PostFragment extends Fragment implements FragmentCommunicator { accountName = getArguments().getString(EXTRA_ACCOUNT_NAME); int defaultPostLayout = Integer.parseInt(mSharedPreferences.getString(SharedPreferencesUtils.DEFAULT_POST_LAYOUT_KEY, "0")); savePostFeedScrolledPosition = mSharedPreferences.getBoolean(SharedPreferencesUtils.SAVE_FRONT_PAGE_SCROLLED_POSITION, false); + rememberMutingOptionInPostFeed = mSharedPreferences.getBoolean(SharedPreferencesUtils.REMEMBER_MUTING_OPTION_IN_POST_FEED, false); Locale locale = getResources().getConfiguration().locale; int usage; @@ -423,6 +431,7 @@ public class PostFragment extends Fragment implements FragmentCommunicator { if (postType == PostDataSource.TYPE_SEARCH) { subredditName = getArguments().getString(EXTRA_NAME); query = getArguments().getString(EXTRA_QUERY); + trendingSource = getArguments().getString(EXTRA_TRENDING_SOURCE); if (savedInstanceState == null) { postFragmentId += query.hashCode(); } @@ -450,6 +459,7 @@ public class PostFragment extends Fragment implements FragmentCommunicator { Intent intent = new Intent(activity, FilteredPostsActivity.class); intent.putExtra(FilteredPostsActivity.EXTRA_NAME, subredditName); intent.putExtra(FilteredPostsActivity.EXTRA_QUERY, query); + intent.putExtra(FilteredPostsActivity.EXTRA_TRENDING_SOURCE, trendingSource); intent.putExtra(FilteredPostsActivity.EXTRA_POST_TYPE, postType); intent.putExtra(FilteredPostsActivity.EXTRA_FILTER, filter); startActivity(intent); @@ -460,6 +470,7 @@ public class PostFragment extends Fragment implements FragmentCommunicator { Intent intent = new Intent(activity, FilteredPostsActivity.class); intent.putExtra(FilteredPostsActivity.EXTRA_NAME, subredditName); intent.putExtra(FilteredPostsActivity.EXTRA_QUERY, query); + intent.putExtra(FilteredPostsActivity.EXTRA_TRENDING_SOURCE, trendingSource); intent.putExtra(FilteredPostsActivity.EXTRA_POST_TYPE, postType); intent.putExtra(FilteredPostsActivity.EXTRA_CONTAIN_FLAIR, flair); startActivity(intent); @@ -470,6 +481,7 @@ public class PostFragment extends Fragment implements FragmentCommunicator { Intent intent = new Intent(activity, FilteredPostsActivity.class); intent.putExtra(FilteredPostsActivity.EXTRA_NAME, subredditName); intent.putExtra(FilteredPostsActivity.EXTRA_QUERY, query); + intent.putExtra(FilteredPostsActivity.EXTRA_TRENDING_SOURCE, trendingSource); intent.putExtra(FilteredPostsActivity.EXTRA_POST_TYPE, postType); intent.putExtra(FilteredPostsActivity.EXTRA_FILTER, Post.NSFW_TYPE); startActivity(intent); @@ -835,7 +847,7 @@ public class PostFragment extends Fragment implements FragmentCommunicator { int nColumns = getNColumns(resources); if (nColumns == 1) { - mLinearLayoutManager = new LinearLayoutManager(activity); + mLinearLayoutManager = new LinearLayoutManagerBugFixed(activity); mPostRecyclerView.setLayoutManager(mLinearLayoutManager); } else { mStaggeredGridLayoutManager = new StaggeredGridLayoutManager(nColumns, StaggeredGridLayoutManager.VERTICAL); @@ -1096,8 +1108,8 @@ public class PostFragment extends Fragment implements FragmentCommunicator { mPostViewModel = new ViewModelProvider(PostFragment.this, new PostViewModel.Factory(mExecutor, new Handler(), accessToken == null ? mRetrofit : mOauthRetrofit, accessToken, accountName, mSharedPreferences, - mPostFeedScrolledPositionSharedPreferences, subredditName, query, postType, sortType, - postFilter, readPosts)).get(PostViewModel.class); + mPostFeedScrolledPositionSharedPreferences, subredditName, query, trendingSource, + postType, sortType, postFilter, readPosts)).get(PostViewModel.class); } else if (postType == PostDataSource.TYPE_SUBREDDIT) { mPostViewModel = new ViewModelProvider(PostFragment.this, new PostViewModel.Factory(mExecutor, new Handler(), accessToken == null ? mRetrofit : mOauthRetrofit, accessToken, @@ -1132,8 +1144,8 @@ public class PostFragment extends Fragment implements FragmentCommunicator { mPostViewModel = new ViewModelProvider(PostFragment.this, new PostViewModel.Factory(mExecutor, new Handler(), mRetrofit, null, accountName, mSharedPreferences, - mPostFeedScrolledPositionSharedPreferences, subredditName, query, postType, sortType, - postFilter, readPosts)).get(PostViewModel.class); + mPostFeedScrolledPositionSharedPreferences, subredditName, query, trendingSource, + postType, sortType, postFilter, readPosts)).get(PostViewModel.class); } else if (postType == PostDataSource.TYPE_SUBREDDIT) { mPostViewModel = new ViewModelProvider(this, new PostViewModel.Factory(mExecutor, new Handler(), mRetrofit, null, @@ -1448,9 +1460,16 @@ public class PostFragment extends Fragment implements FragmentCommunicator { break; } + int previousPosition = -1; + if (mLinearLayoutManager != null) { + previousPosition = mLinearLayoutManager.findFirstVisibleItemPosition(); + } else if (mStaggeredGridLayoutManager != null) { + int[] into = new int[mStaggeredGridLayoutManager.getSpanCount()]; + previousPosition = mStaggeredGridLayoutManager.findFirstVisibleItemPositions(into)[0]; + } int nColumns = getNColumns(getResources()); if (nColumns == 1) { - mLinearLayoutManager = new LinearLayoutManager(activity); + mLinearLayoutManager = new LinearLayoutManagerBugFixed(activity); if (mPostRecyclerView.getItemDecorationCount() > 0) { mPostRecyclerView.removeItemDecorationAt(0); } @@ -1468,6 +1487,10 @@ public class PostFragment extends Fragment implements FragmentCommunicator { mLinearLayoutManager = null; } + if (previousPosition > 0) { + mPostRecyclerView.scrollToPosition(previousPosition); + } + if (mAdapter != null) { mAdapter.setPostLayout(postLayout); refreshAdapter(); @@ -1509,6 +1532,7 @@ public class PostFragment extends Fragment implements FragmentCommunicator { Intent intent = new Intent(activity, FilteredPostsActivity.class); intent.putExtra(FilteredPostsActivity.EXTRA_NAME, subredditName); intent.putExtra(FilteredPostsActivity.EXTRA_QUERY, query); + intent.putExtra(FilteredPostsActivity.EXTRA_TRENDING_SOURCE, trendingSource); intent.putExtra(FilteredPostsActivity.EXTRA_POST_TYPE, postType); startActivity(intent); } else if (postType == PostDataSource.TYPE_SUBREDDIT) { @@ -1543,6 +1567,17 @@ public class PostFragment extends Fragment implements FragmentCommunicator { } } + @Nullable + public Boolean getMasterMutingOption() { + return masterMutingOption; + } + + public void videoAutoplayChangeMutingOption(boolean isMute) { + if (rememberMutingOptionInPostFeed) { + masterMutingOption = isMute; + } + } + @Subscribe public void onPostUpdateEvent(PostUpdateEventToPostList event) { PagedList<Post> posts = mAdapter.getCurrentList(); @@ -1650,6 +1685,14 @@ public class PostFragment extends Fragment implements FragmentCommunicator { } @Subscribe + public void onChangeDefaultLinkPostLayoutEvent(ChangeDefaultLinkPostLayoutEvent event) { + if (mAdapter != null) { + mAdapter.setDefaultLinkPostLayout(event.defaultLinkPostLayout); + refreshAdapter(); + } + } + + @Subscribe public void onChangeShowAbsoluteNumberOfVotesEvent(ChangeShowAbsoluteNumberOfVotesEvent changeShowAbsoluteNumberOfVotesEvent) { if (mAdapter != null) { mAdapter.setShowAbsoluteNumberOfVotes(changeShowAbsoluteNumberOfVotesEvent.showAbsoluteNumberOfVotes); @@ -1871,6 +1914,14 @@ public class PostFragment extends Fragment implements FragmentCommunicator { } } + @Subscribe + public void onChangeRememberMutingOptionInPostFeedEvent(ChangeRememberMutingOptionInPostFeedEvent event) { + rememberMutingOptionInPostFeed = event.rememberMutingOptionInPostFeedEvent; + if (!event.rememberMutingOptionInPostFeedEvent) { + masterMutingOption = null; + } + } + private void refreshAdapter() { int previousPosition = -1; if (mLinearLayoutManager != null) { @@ -1885,7 +1936,6 @@ public class PostFragment extends Fragment implements FragmentCommunicator { mPostRecyclerView.setLayoutManager(null); mPostRecyclerView.setAdapter(mAdapter); mPostRecyclerView.setLayoutManager(layoutManager); - if (previousPosition > 0) { mPostRecyclerView.scrollToPosition(previousPosition); } diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/SidebarFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/SidebarFragment.java index 7297cb54..d7a77b07 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/SidebarFragment.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/SidebarFragment.java @@ -17,7 +17,6 @@ import android.widget.Toast; import androidx.annotation.NonNull; import androidx.fragment.app.Fragment; import androidx.lifecycle.ViewModelProvider; -import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; import androidx.swiperefreshlayout.widget.SwipeRefreshLayout; @@ -48,8 +47,10 @@ import ml.docilealligator.infinityforreddit.RedditDataRoomDatabase; import ml.docilealligator.infinityforreddit.activities.LinkResolverActivity; import ml.docilealligator.infinityforreddit.activities.ViewSubredditDetailActivity; import ml.docilealligator.infinityforreddit.asynctasks.InsertSubredditData; +import ml.docilealligator.infinityforreddit.bottomsheetfragments.CopyTextBottomSheetFragment; import ml.docilealligator.infinityforreddit.bottomsheetfragments.UrlMenuBottomSheetFragment; import ml.docilealligator.infinityforreddit.customtheme.CustomThemeWrapper; +import ml.docilealligator.infinityforreddit.customviews.LinearLayoutManagerBugFixed; import ml.docilealligator.infinityforreddit.subreddit.FetchSubredditData; import ml.docilealligator.infinityforreddit.subreddit.SubredditData; import ml.docilealligator.infinityforreddit.subreddit.SubredditViewModel; @@ -65,7 +66,7 @@ public class SidebarFragment extends Fragment { private Activity activity; private String subredditName; public SubredditViewModel mSubredditViewModel; - private LinearLayoutManager linearLayoutManager; + private LinearLayoutManagerBugFixed linearLayoutManager; private int markdownColor; @Inject @Named("no_oauth") @@ -76,6 +77,7 @@ public class SidebarFragment extends Fragment { CustomThemeWrapper mCustomThemeWrapper; @Inject Executor mExecutor; + private String sidebarDescription; public SidebarFragment() { // Required empty public constructor @@ -99,7 +101,7 @@ public class SidebarFragment extends Fragment { swipeRefreshLayout.setProgressBackgroundColorSchemeColor(mCustomThemeWrapper.getCircularProgressBarBackground()); swipeRefreshLayout.setColorSchemeColors(mCustomThemeWrapper.getColorAccent()); - markdownColor = mCustomThemeWrapper.getSecondaryTextColor(); + markdownColor = mCustomThemeWrapper.getPrimaryTextColor(); Markwon markwon = Markwon.builder(activity) .usePlugin(HtmlPlugin.create()) @@ -107,6 +109,16 @@ public class SidebarFragment extends Fragment { @Override public void beforeSetText(@NonNull TextView textView, @NonNull Spanned markdown) { textView.setTextColor(markdownColor); + textView.setOnLongClickListener(view -> { + if (sidebarDescription != null && !sidebarDescription.equals("") && textView.getSelectionStart() == -1 && textView.getSelectionEnd() == -1) { + Bundle bundle = new Bundle(); + bundle.putString(CopyTextBottomSheetFragment.EXTRA_MARKDOWN, sidebarDescription); + CopyTextBottomSheetFragment copyTextBottomSheetFragment = new CopyTextBottomSheetFragment(); + copyTextBottomSheetFragment.setArguments(bundle); + copyTextBottomSheetFragment.show(getChildFragmentManager(), copyTextBottomSheetFragment.getTag()); + } + return true; + }); } @Override @@ -142,7 +154,7 @@ public class SidebarFragment extends Fragment { .textLayoutIsRoot(R.layout.view_table_entry_cell))) .build(); - linearLayoutManager = new LinearLayoutManager(activity); + linearLayoutManager = new LinearLayoutManagerBugFixed(activity); recyclerView.setLayoutManager(linearLayoutManager); recyclerView.setAdapter(markwonAdapter); recyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() { @@ -162,8 +174,9 @@ public class SidebarFragment extends Fragment { .get(SubredditViewModel.class); mSubredditViewModel.getSubredditLiveData().observe(getViewLifecycleOwner(), subredditData -> { if (subredditData != null) { - if (subredditData.getSidebarDescription() != null && !subredditData.getSidebarDescription().equals("")) { - markwonAdapter.setMarkdown(markwon, subredditData.getSidebarDescription()); + sidebarDescription = subredditData.getSidebarDescription(); + if (sidebarDescription != null && !sidebarDescription.equals("")) { + markwonAdapter.setMarkdown(markwon, sidebarDescription); markwonAdapter.notifyDataSetChanged(); } } else { diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/SubredditListingFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/SubredditListingFragment.java index e35520bd..46513616 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/SubredditListingFragment.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/SubredditListingFragment.java @@ -19,7 +19,6 @@ import androidx.annotation.NonNull; import androidx.coordinatorlayout.widget.CoordinatorLayout; import androidx.fragment.app.Fragment; import androidx.lifecycle.ViewModelProvider; -import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; import androidx.swiperefreshlayout.widget.SwipeRefreshLayout; @@ -46,6 +45,7 @@ import ml.docilealligator.infinityforreddit.activities.SearchSubredditsResultAct import ml.docilealligator.infinityforreddit.activities.ViewSubredditDetailActivity; import ml.docilealligator.infinityforreddit.adapters.SubredditListingRecyclerViewAdapter; import ml.docilealligator.infinityforreddit.customtheme.CustomThemeWrapper; +import ml.docilealligator.infinityforreddit.customviews.LinearLayoutManagerBugFixed; import ml.docilealligator.infinityforreddit.subreddit.SubredditData; import ml.docilealligator.infinityforreddit.subreddit.SubredditListingViewModel; import ml.docilealligator.infinityforreddit.utils.SharedPreferencesUtils; @@ -97,7 +97,7 @@ public class SubredditListingFragment extends Fragment implements FragmentCommun CustomThemeWrapper mCustomThemeWrapper; @Inject Executor mExecutor; - private LinearLayoutManager mLinearLayoutManager; + private LinearLayoutManagerBugFixed mLinearLayoutManager; private SubredditListingRecyclerViewAdapter mAdapter; private Activity mActivity; private SortType sortType; @@ -131,7 +131,7 @@ public class SubredditListingFragment extends Fragment implements FragmentCommun } } - mLinearLayoutManager = new LinearLayoutManager(getActivity()); + mLinearLayoutManager = new LinearLayoutManagerBugFixed(getActivity()); mSubredditListingRecyclerView.setLayoutManager(mLinearLayoutManager); String query = getArguments().getString(EXTRA_QUERY); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/SubscribedSubredditsListingFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/SubscribedSubredditsListingFragment.java index 7bb69a76..61333955 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/SubscribedSubredditsListingFragment.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/SubscribedSubredditsListingFragment.java @@ -17,7 +17,6 @@ import android.widget.TextView; import androidx.annotation.NonNull; import androidx.fragment.app.Fragment; import androidx.lifecycle.ViewModelProvider; -import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; import androidx.swiperefreshlayout.widget.SwipeRefreshLayout; @@ -41,6 +40,7 @@ import ml.docilealligator.infinityforreddit.FragmentCommunicator; import ml.docilealligator.infinityforreddit.Infinity; import ml.docilealligator.infinityforreddit.R; import ml.docilealligator.infinityforreddit.RedditDataRoomDatabase; +import ml.docilealligator.infinityforreddit.customviews.LinearLayoutManagerBugFixed; import ml.docilealligator.infinityforreddit.subscribedsubreddit.SubscribedSubredditViewModel; import ml.docilealligator.infinityforreddit.utils.SharedPreferencesUtils; import retrofit2.Retrofit; @@ -82,7 +82,7 @@ public class SubscribedSubredditsListingFragment extends Fragment implements Fra public SubscribedSubredditViewModel mSubscribedSubredditViewModel; private Activity mActivity; private RequestManager mGlide; - private LinearLayoutManager mLinearLayoutManager; + private LinearLayoutManagerBugFixed mLinearLayoutManager; public SubscribedSubredditsListingFragment() { // Required empty public constructor @@ -115,7 +115,7 @@ public class SubscribedSubredditsListingFragment extends Fragment implements Fra mGlide = Glide.with(this); - mLinearLayoutManager = new LinearLayoutManager(mActivity); + mLinearLayoutManager = new LinearLayoutManagerBugFixed(mActivity); mRecyclerView.setLayoutManager(mLinearLayoutManager); SubscribedSubredditsRecyclerViewAdapter adapter; diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/UserListingFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/UserListingFragment.java index 5e894706..912176d5 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/UserListingFragment.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/UserListingFragment.java @@ -19,7 +19,6 @@ import androidx.annotation.NonNull; import androidx.coordinatorlayout.widget.CoordinatorLayout; import androidx.fragment.app.Fragment; import androidx.lifecycle.ViewModelProvider; -import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; import androidx.swiperefreshlayout.widget.SwipeRefreshLayout; @@ -46,6 +45,7 @@ import ml.docilealligator.infinityforreddit.activities.SearchUsersResultActivity import ml.docilealligator.infinityforreddit.activities.ViewUserDetailActivity; import ml.docilealligator.infinityforreddit.adapters.UserListingRecyclerViewAdapter; import ml.docilealligator.infinityforreddit.customtheme.CustomThemeWrapper; +import ml.docilealligator.infinityforreddit.customviews.LinearLayoutManagerBugFixed; import ml.docilealligator.infinityforreddit.user.UserData; import ml.docilealligator.infinityforreddit.user.UserListingViewModel; import ml.docilealligator.infinityforreddit.utils.SharedPreferencesUtils; @@ -97,7 +97,7 @@ public class UserListingFragment extends Fragment implements FragmentCommunicato CustomThemeWrapper mCustomThemeWrapper; @Inject Executor mExecutor; - private LinearLayoutManager mLinearLayoutManager; + private LinearLayoutManagerBugFixed mLinearLayoutManager; private String mQuery; private UserListingRecyclerViewAdapter mAdapter; private Activity mActivity; @@ -132,7 +132,7 @@ public class UserListingFragment extends Fragment implements FragmentCommunicato } } - mLinearLayoutManager = new LinearLayoutManager(getActivity()); + mLinearLayoutManager = new LinearLayoutManagerBugFixed(mActivity); mUserListingRecyclerView.setLayoutManager(mLinearLayoutManager); mQuery = getArguments().getString(EXTRA_QUERY); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewImgurImageFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewImgurImageFragment.java index 0dcf1f01..2b6e9ea9 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewImgurImageFragment.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewImgurImageFragment.java @@ -16,8 +16,10 @@ import android.view.MenuInflater; import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; +import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.ProgressBar; +import android.widget.TextView; import android.widget.Toast; import androidx.annotation.NonNull; @@ -36,6 +38,7 @@ import com.bumptech.glide.request.target.Target; import com.bumptech.glide.request.transition.Transition; import com.davemorrissey.labs.subscaleview.ImageSource; import com.davemorrissey.labs.subscaleview.SubsamplingScaleImageView; +import com.google.android.material.bottomappbar.BottomAppBar; import java.io.File; import java.util.concurrent.Executor; @@ -57,6 +60,8 @@ import ml.docilealligator.infinityforreddit.services.DownloadMediaService; public class ViewImgurImageFragment extends Fragment { public static final String EXTRA_IMGUR_IMAGES = "EII"; + public static final String EXTRA_INDEX = "EI"; + public static final String EXTRA_MEDIA_COUNT = "EMC"; private static final int PERMISSION_REQUEST_WRITE_EXTERNAL_STORAGE = 0; @BindView(R.id.progress_bar_view_imgur_image_fragment) @@ -65,6 +70,16 @@ public class ViewImgurImageFragment extends Fragment { SubsamplingScaleImageView imageView; @BindView(R.id.load_image_error_linear_layout_view_imgur_image_fragment) LinearLayout errorLinearLayout; + @BindView(R.id.bottom_navigation_view_imgur_image_fragment) + BottomAppBar bottomAppBar; + @BindView(R.id.title_text_view_view_imgur_image_fragment) + TextView titleTextView; + @BindView(R.id.download_image_view_view_imgur_image_fragment) + ImageView downloadImageView; + @BindView(R.id.share_image_view_view_imgur_image_fragment) + ImageView shareImageView; + @BindView(R.id.wallpaper_image_view_view_imgur_image_fragment) + ImageView wallpaperImageView; @Inject Executor mExecutor; @@ -81,7 +96,7 @@ public class ViewImgurImageFragment extends Fragment { @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { - View rootView = inflater.inflate(R.layout.fragment_view_imgur_images, container, false); + View rootView = inflater.inflate(R.layout.fragment_view_imgur_image, container, false); ((Infinity) activity.getApplication()).getAppComponent().inject(this); @@ -100,6 +115,9 @@ public class ViewImgurImageFragment extends Fragment { | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN); isActionBarHidden = false; + if (activity.isUseBottomAppBar()) { + bottomAppBar.setVisibility(View.VISIBLE); + } } else { activity.getWindow().getDecorView().setSystemUiVisibility( View.SYSTEM_UI_FLAG_LAYOUT_STABLE @@ -109,6 +127,9 @@ public class ViewImgurImageFragment extends Fragment { | View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_IMMERSIVE); isActionBarHidden = true; + if (activity.isUseBottomAppBar()) { + bottomAppBar.setVisibility(View.GONE); + } } }); imageView.setMinimumDpi(80); @@ -121,6 +142,25 @@ public class ViewImgurImageFragment extends Fragment { loadImage(); }); + if (activity.isUseBottomAppBar()) { + bottomAppBar.setVisibility(View.VISIBLE); + titleTextView.setText(getString(R.string.view_imgur_media_activity_image_label, + getArguments().getInt(EXTRA_INDEX) + 1, getArguments().getInt(EXTRA_MEDIA_COUNT))); + downloadImageView.setOnClickListener(view -> { + if (isDownloading) { + return; + } + isDownloading = true; + requestPermissionAndDownload(); + }); + shareImageView.setOnClickListener(view -> { + shareImage(); + }); + wallpaperImageView.setOnClickListener(view -> { + setWallpaper(); + }); + } + return rootView; } @@ -164,83 +204,39 @@ public class ViewImgurImageFragment extends Fragment { if (isDownloading) { return false; } - isDownloading = true; - - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { - if (ContextCompat.checkSelfPermission(activity, - Manifest.permission.WRITE_EXTERNAL_STORAGE) - != PackageManager.PERMISSION_GRANTED) { - - // Permission is not granted - // No explanation needed; request the permission - requestPermissions(new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, - PERMISSION_REQUEST_WRITE_EXTERNAL_STORAGE); - } else { - // Permission has already been granted - download(); - } - } else { - download(); - } - + requestPermissionAndDownload(); return true; } else if (itemId == R.id.action_share_view_imgur_image_fragment) { - glide.asBitmap().load(imgurMedia.getLink()).into(new CustomTarget<Bitmap>() { - - @Override - public void onResourceReady(@NonNull Bitmap resource, @Nullable Transition<? super Bitmap> transition) { - if (activity.getExternalCacheDir() != null) { - Toast.makeText(activity, R.string.save_image_first, Toast.LENGTH_SHORT).show(); - SaveBitmapImageToFile.SaveBitmapImageToFile(mExecutor, new Handler(), resource, activity.getExternalCacheDir().getPath(), - imgurMedia.getFileName(), - new SaveBitmapImageToFile.SaveBitmapImageToFileListener() { - @Override - public void saveSuccess(File imageFile) { - Uri uri = FileProvider.getUriForFile(activity, - BuildConfig.APPLICATION_ID + ".provider", imageFile); - Intent shareIntent = new Intent(); - shareIntent.setAction(Intent.ACTION_SEND); - shareIntent.putExtra(Intent.EXTRA_STREAM, uri); - shareIntent.setType("image/*"); - shareIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); - startActivity(Intent.createChooser(shareIntent, getString(R.string.share))); - } - - @Override - public void saveFailed() { - Toast.makeText(activity, - R.string.cannot_save_image, Toast.LENGTH_SHORT).show(); - } - }); - } else { - Toast.makeText(activity, - R.string.cannot_get_storage, Toast.LENGTH_SHORT).show(); - } - } - - @Override - public void onLoadCleared(@Nullable Drawable placeholder) { - - } - }); + shareImage(); return true; } else if (itemId == R.id.action_set_wallpaper_view_imgur_image_fragment) { - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { - SetAsWallpaperBottomSheetFragment setAsWallpaperBottomSheetFragment = new SetAsWallpaperBottomSheetFragment(); - Bundle bundle = new Bundle(); - bundle.putInt(SetAsWallpaperBottomSheetFragment.EXTRA_VIEW_PAGER_POSITION, activity.getCurrentPagePosition()); - setAsWallpaperBottomSheetFragment.setArguments(bundle); - setAsWallpaperBottomSheetFragment.show(activity.getSupportFragmentManager(), setAsWallpaperBottomSheetFragment.getTag()); - } else { - ((SetAsWallpaperCallback) activity).setToBoth(activity.getCurrentPagePosition()); - } + setWallpaper(); return true; } return false; } + private void requestPermissionAndDownload() { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && Build.VERSION.SDK_INT < Build.VERSION_CODES.Q) { + if (ContextCompat.checkSelfPermission(activity, + Manifest.permission.WRITE_EXTERNAL_STORAGE) + != PackageManager.PERMISSION_GRANTED) { + + // Permission is not granted + // No explanation needed; request the permission + requestPermissions(new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, + PERMISSION_REQUEST_WRITE_EXTERNAL_STORAGE); + } else { + // Permission has already been granted + download(); + } + } else { + download(); + } + } + private void download() { isDownloading = false; @@ -252,6 +248,59 @@ public class ViewImgurImageFragment extends Fragment { Toast.makeText(activity, R.string.download_started, Toast.LENGTH_SHORT).show(); } + private void shareImage() { + glide.asBitmap().load(imgurMedia.getLink()).into(new CustomTarget<Bitmap>() { + + @Override + public void onResourceReady(@NonNull Bitmap resource, @Nullable Transition<? super Bitmap> transition) { + if (activity.getExternalCacheDir() != null) { + Toast.makeText(activity, R.string.save_image_first, Toast.LENGTH_SHORT).show(); + SaveBitmapImageToFile.SaveBitmapImageToFile(mExecutor, new Handler(), resource, activity.getExternalCacheDir().getPath(), + imgurMedia.getFileName(), + new SaveBitmapImageToFile.SaveBitmapImageToFileListener() { + @Override + public void saveSuccess(File imageFile) { + Uri uri = FileProvider.getUriForFile(activity, + BuildConfig.APPLICATION_ID + ".provider", imageFile); + Intent shareIntent = new Intent(); + shareIntent.setAction(Intent.ACTION_SEND); + shareIntent.putExtra(Intent.EXTRA_STREAM, uri); + shareIntent.setType("image/*"); + shareIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); + startActivity(Intent.createChooser(shareIntent, getString(R.string.share))); + } + + @Override + public void saveFailed() { + Toast.makeText(activity, + R.string.cannot_save_image, Toast.LENGTH_SHORT).show(); + } + }); + } else { + Toast.makeText(activity, + R.string.cannot_get_storage, Toast.LENGTH_SHORT).show(); + } + } + + @Override + public void onLoadCleared(@Nullable Drawable placeholder) { + + } + }); + } + + private void setWallpaper() { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { + SetAsWallpaperBottomSheetFragment setAsWallpaperBottomSheetFragment = new SetAsWallpaperBottomSheetFragment(); + Bundle bundle = new Bundle(); + bundle.putInt(SetAsWallpaperBottomSheetFragment.EXTRA_VIEW_PAGER_POSITION, activity.getCurrentPagePosition()); + setAsWallpaperBottomSheetFragment.setArguments(bundle); + setAsWallpaperBottomSheetFragment.show(activity.getSupportFragmentManager(), setAsWallpaperBottomSheetFragment.getTag()); + } else { + ((SetAsWallpaperCallback) activity).setToBoth(activity.getCurrentPagePosition()); + } + } + @Override public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) { if (requestCode == PERMISSION_REQUEST_WRITE_EXTERNAL_STORAGE && grantResults.length > 0) { @@ -269,4 +318,10 @@ public class ViewImgurImageFragment extends Fragment { super.onAttach(context); activity = (ViewImgurMediaActivity) context; } + + @Override + public void onDestroyView() { + super.onDestroyView(); + glide.clear(imageView); + } } diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewImgurVideoFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewImgurVideoFragment.java index 01961e17..65b283e1 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewImgurVideoFragment.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewImgurVideoFragment.java @@ -1,7 +1,6 @@ package ml.docilealligator.infinityforreddit.fragments; import android.Manifest; -import android.app.Activity; import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; @@ -18,7 +17,9 @@ import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; import android.widget.ImageButton; +import android.widget.ImageView; import android.widget.LinearLayout; +import android.widget.TextView; import android.widget.Toast; import androidx.annotation.NonNull; @@ -39,6 +40,7 @@ import com.google.android.exoplayer2.ui.PlayerView; import com.google.android.exoplayer2.upstream.DataSource; import com.google.android.exoplayer2.upstream.DefaultDataSourceFactory; import com.google.android.exoplayer2.util.Util; +import com.google.android.material.bottomappbar.BottomAppBar; import javax.inject.Inject; import javax.inject.Named; @@ -48,6 +50,7 @@ import butterknife.ButterKnife; import ml.docilealligator.infinityforreddit.ImgurMedia; import ml.docilealligator.infinityforreddit.Infinity; import ml.docilealligator.infinityforreddit.R; +import ml.docilealligator.infinityforreddit.activities.ViewImgurMediaActivity; import ml.docilealligator.infinityforreddit.services.DownloadMediaService; import ml.docilealligator.infinityforreddit.utils.SharedPreferencesUtils; @@ -56,12 +59,20 @@ public class ViewImgurVideoFragment extends Fragment { public static final String EXTRA_IMGUR_VIDEO = "EIV"; private static final String IS_MUTE_STATE = "IMS"; private static final String POSITION_STATE = "PS"; + public static final String EXTRA_INDEX = "EI"; + public static final String EXTRA_MEDIA_COUNT = "EMC"; private static final int PERMISSION_REQUEST_WRITE_EXTERNAL_STORAGE = 0; @BindView(R.id.player_view_view_imgur_video_fragment) PlayerView videoPlayerView; @BindView(R.id.mute_exo_playback_control_view) ImageButton muteButton; - private Activity activity; + @BindView(R.id.bottom_navigation_exo_playback_control_view) + BottomAppBar bottomAppBar; + @BindView(R.id.title_text_view_exo_playback_control_view) + TextView titleTextView; + @BindView(R.id.download_image_view_exo_playback_control_view) + ImageView downloadImageView; + private ViewImgurMediaActivity activity; private ImgurMedia imgurMedia; private SimpleExoPlayer player; private DataSource.Factory dataSourceFactory; @@ -136,6 +147,19 @@ public class ViewImgurVideoFragment extends Fragment { player.prepare(new ProgressiveMediaSource.Factory(dataSourceFactory).createMediaSource(Uri.parse(imgurMedia.getLink()))); preparePlayer(savedInstanceState); + if (activity.isUseBottomAppBar()) { + bottomAppBar.setVisibility(View.VISIBLE); + titleTextView.setText(getString(R.string.view_imgur_media_activity_video_label, + getArguments().getInt(EXTRA_INDEX) + 1, getArguments().getInt(EXTRA_MEDIA_COUNT))); + downloadImageView.setOnClickListener(view -> { + if (isDownloading) { + return; + } + isDownloading = true; + requestPermissionAndDownload(); + }); + } + return rootView; } @@ -149,25 +173,29 @@ public class ViewImgurVideoFragment extends Fragment { public boolean onOptionsItemSelected(@NonNull MenuItem item) { if (item.getItemId() == R.id.action_download_view_imgur_video_fragment) { isDownloading = true; - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { - if (ContextCompat.checkSelfPermission(activity, - Manifest.permission.WRITE_EXTERNAL_STORAGE) - != PackageManager.PERMISSION_GRANTED) { - - // Permission is not granted - // No explanation needed; request the permission - requestPermissions(new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, - PERMISSION_REQUEST_WRITE_EXTERNAL_STORAGE); - } else { - // Permission has already been granted - download(); - } + requestPermissionAndDownload(); + return true; + } + return false; + } + + private void requestPermissionAndDownload() { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && Build.VERSION.SDK_INT < Build.VERSION_CODES.Q) { + if (ContextCompat.checkSelfPermission(activity, + Manifest.permission.WRITE_EXTERNAL_STORAGE) + != PackageManager.PERMISSION_GRANTED) { + + // Permission is not granted + // No explanation needed; request the permission + requestPermissions(new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, + PERMISSION_REQUEST_WRITE_EXTERNAL_STORAGE); } else { + // Permission has already been granted download(); } - return true; + } else { + download(); } - return false; } @Override @@ -282,6 +310,6 @@ public class ViewImgurVideoFragment extends Fragment { @Override public void onAttach(@NonNull Context context) { super.onAttach(context); - activity = (Activity) context; + activity = (ViewImgurMediaActivity) context; } } diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewPostDetailFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewPostDetailFragment.java index 40d2ff9f..2b79125d 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewPostDetailFragment.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewPostDetailFragment.java @@ -1,5 +1,10 @@ package ml.docilealligator.infinityforreddit.fragments; +import static im.ene.toro.media.PlaybackInfo.INDEX_UNSET; +import static im.ene.toro.media.PlaybackInfo.TIME_UNSET; +import static ml.docilealligator.infinityforreddit.activities.CommentActivity.RETURN_EXTRA_COMMENT_DATA_KEY; +import static ml.docilealligator.infinityforreddit.activities.CommentActivity.WRITE_COMMENT_REQUEST_CODE; + import android.annotation.SuppressLint; import android.app.Activity; import android.content.Context; @@ -33,7 +38,6 @@ import androidx.core.graphics.drawable.DrawableCompat; import androidx.fragment.app.Fragment; import androidx.recyclerview.widget.ConcatAdapter; import androidx.recyclerview.widget.ItemTouchHelper; -import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.LinearSmoothScroller; import androidx.recyclerview.widget.RecyclerView; import androidx.swiperefreshlayout.widget.SwipeRefreshLayout; @@ -89,6 +93,7 @@ import ml.docilealligator.infinityforreddit.comment.FetchRemovedComment; import ml.docilealligator.infinityforreddit.comment.ParseComment; import ml.docilealligator.infinityforreddit.customtheme.CustomThemeWrapper; import ml.docilealligator.infinityforreddit.customviews.CustomToroContainer; +import ml.docilealligator.infinityforreddit.customviews.LinearLayoutManagerBugFixed; import ml.docilealligator.infinityforreddit.events.ChangeNSFWBlurEvent; import ml.docilealligator.infinityforreddit.events.ChangeNetworkStatusEvent; import ml.docilealligator.infinityforreddit.events.ChangeSpoilerBlurEvent; @@ -111,11 +116,6 @@ import retrofit2.Callback; import retrofit2.Response; import retrofit2.Retrofit; -import static im.ene.toro.media.PlaybackInfo.INDEX_UNSET; -import static im.ene.toro.media.PlaybackInfo.TIME_UNSET; -import static ml.docilealligator.infinityforreddit.activities.CommentActivity.RETURN_EXTRA_COMMENT_DATA_KEY; -import static ml.docilealligator.infinityforreddit.activities.CommentActivity.WRITE_COMMENT_REQUEST_CODE; - public class ViewPostDetailFragment extends Fragment implements FragmentCommunicator { public static final String EXTRA_POST_DATA = "EPD"; @@ -167,6 +167,9 @@ public class ViewPostDetailFragment extends Fragment implements FragmentCommunic @Named("current_account") SharedPreferences mCurrentAccountSharedPreferences; @Inject + @Named("post_details") + SharedPreferences mPostDetailsSharedPreferences; + @Inject CustomThemeWrapper mCustomThemeWrapper; @Inject ExoCreator mExoCreator; @@ -215,8 +218,8 @@ public class ViewPostDetailFragment extends Fragment implements FragmentCommunic private boolean mLockFab; private boolean mSwipeUpToHideFab; private boolean mExpandChildren; + private boolean mSeparatePostAndComments = false; private int mWindowWidth; - private LinearLayoutManager mLinearLayoutManager; private ConcatAdapter mConcatAdapter; private PostDetailRecyclerViewAdapter mPostAdapter; private CommentsRecyclerViewAdapter mCommentsAdapter; @@ -261,13 +264,17 @@ public class ViewPostDetailFragment extends Fragment implements FragmentCommunic mUnsavedIcon = getMenuItemIcon(R.drawable.ic_bookmark_border_toolbar_24dp); if (getResources().getBoolean(R.bool.isTablet) || getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) { - mLinearLayoutManager = new LinearLayoutManager(activity); mCommentsRecyclerView = rootView.findViewById(R.id.comments_recycler_view_view_post_detail_fragment); - mCommentsRecyclerView.setLayoutManager(mLinearLayoutManager); - mRecyclerView.setLayoutManager(new LinearLayoutManager(activity)); + } + if (!((mPostDetailsSharedPreferences.getBoolean(SharedPreferencesUtils.SEPARATE_POST_AND_COMMENTS_IN_LANDSCAPE_MODE, true) + && getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) + || (mPostDetailsSharedPreferences.getBoolean(SharedPreferencesUtils.SEPARATE_POST_AND_COMMENTS_IN_PORTRAIT_MODE, false)))) { + if (mCommentsRecyclerView != null) { + mCommentsRecyclerView.setVisibility(View.GONE); + mCommentsRecyclerView = null; + } } else { - mLinearLayoutManager = new LinearLayoutManager(activity); - mRecyclerView.setLayoutManager(mLinearLayoutManager); + mSeparatePostAndComments = true; } if (activity != null && activity.isImmersiveInterface()) { @@ -319,9 +326,9 @@ public class ViewPostDetailFragment extends Fragment implements FragmentCommunic } if (!isLoadingMoreChildren && loadMoreChildrenSuccess) { - int visibleItemCount = mLinearLayoutManager.getChildCount(); - int totalItemCount = mLinearLayoutManager.getItemCount(); - int firstVisibleItemPosition = mLinearLayoutManager.findFirstVisibleItemPosition(); + int visibleItemCount = (mCommentsRecyclerView == null ? mRecyclerView : mCommentsRecyclerView).getLayoutManager().getChildCount(); + int totalItemCount = (mCommentsRecyclerView == null ? mRecyclerView : mCommentsRecyclerView).getLayoutManager().getItemCount(); + int firstVisibleItemPosition = ((LinearLayoutManagerBugFixed) (mCommentsRecyclerView == null ? mRecyclerView : mCommentsRecyclerView).getLayoutManager()).findFirstVisibleItemPosition(); if (mCommentsAdapter != null && mCommentsAdapter.getItemCount() >= 1 && (visibleItemCount + firstVisibleItemPosition >= totalItemCount) && firstVisibleItemPosition >= 0) { fetchMoreComments(); @@ -537,13 +544,9 @@ public class ViewPostDetailFragment extends Fragment implements FragmentCommunic mPostAdapter = new PostDetailRecyclerViewAdapter(activity, this, mExecutor, mCustomThemeWrapper, mRetrofit, mOauthRetrofit, mGfycatRetrofit, mRedgifsRetrofit, mRedditDataRoomDatabase, mGlide, - mWindowWidth, mAccessToken, mAccountName, mPost, mLocale, mSingleCommentId, - isSingleCommentThreadMode, mSharedPreferences, mNsfwAndSpoilerSharedPreferences, mExoCreator, new PostDetailRecyclerViewAdapter.PostDetailRecyclerViewAdapterCallback() { - @Override - public void updatePost(Post post) { - EventBus.getDefault().post(new PostUpdateEventToPostList(mPost, postListPosition)); - } - }); + mWindowWidth, mSeparatePostAndComments, mAccessToken, mAccountName, mPost, mLocale, + mSharedPreferences, mNsfwAndSpoilerSharedPreferences, mPostDetailsSharedPreferences, + mExoCreator, post -> EventBus.getDefault().post(new PostUpdateEventToPostList(mPost, postListPosition))); mCommentsAdapter = new CommentsRecyclerViewAdapter(activity, this, mCustomThemeWrapper, mExecutor, mRetrofit, mOauthRetrofit, mAccessToken, mAccountName, mPost, mLocale, mSingleCommentId, @@ -755,8 +758,9 @@ public class ViewPostDetailFragment extends Fragment implements FragmentCommunic } public void goToTop() { - if (mLinearLayoutManager != null) { - mLinearLayoutManager.scrollToPositionWithOffset(0, 0); + ((LinearLayoutManagerBugFixed) mRecyclerView.getLayoutManager()).scrollToPositionWithOffset(0, 0); + if (mCommentsRecyclerView != null) { + ((LinearLayoutManagerBugFixed) mCommentsRecyclerView.getLayoutManager()).scrollToPositionWithOffset(0, 0); } } @@ -766,6 +770,61 @@ public class ViewPostDetailFragment extends Fragment implements FragmentCommunic } } + public void searchComment(String query, boolean searchNextComment) { + if (mCommentsAdapter != null) { + ArrayList<Comment> visibleComments = mCommentsAdapter.getVisibleComments(); + int currentSearchIndex = mCommentsAdapter.getSearchCommentIndex(); + if (currentSearchIndex >= 0) { + mCommentsAdapter.notifyItemChanged(currentSearchIndex); + } + if (visibleComments != null) { + if (searchNextComment) { + for (int i = currentSearchIndex + 1; i < visibleComments.size(); i++) { + if (visibleComments.get(i).getCommentRawText() != null && + visibleComments.get(i).getCommentRawText().toLowerCase().contains(query.toLowerCase())) { + if (mCommentsAdapter != null) { + mCommentsAdapter.highlightSearchResult(i); + mCommentsAdapter.notifyItemChanged(i); + if (mCommentsRecyclerView == null) { + mRecyclerView.scrollToPosition(i + 1); + } else { + mCommentsRecyclerView.scrollToPosition(i); + } + } + return; + } + } + + return; + } else { + for (int i = currentSearchIndex - 1; i >= 0; i--) { + if (visibleComments.get(i).getCommentRawText() !=null && + visibleComments.get(i).getCommentRawText().toLowerCase().contains(query.toLowerCase())) { + if (mCommentsAdapter != null) { + mCommentsAdapter.highlightSearchResult(i); + mCommentsAdapter.notifyItemChanged(i); + if (mCommentsRecyclerView == null) { + mRecyclerView.scrollToPosition(i + 1); + } else { + mCommentsRecyclerView.scrollToPosition(i); + } + } + return; + } + } + + return; + } + } + } + } + + public void resetSearchCommentIndex() { + if (mCommentsAdapter != null) { + mCommentsAdapter.resetCommentSearchIndex(); + } + } + @Override public void onCreateOptionsMenu(@NonNull Menu menu, @NonNull MenuInflater inflater) { inflater.inflate(R.menu.view_post_detail_fragment, menu); @@ -779,7 +838,11 @@ public class ViewPostDetailFragment extends Fragment implements FragmentCommunic @Override public boolean onOptionsItemSelected(@NonNull MenuItem item) { int itemId = item.getItemId(); - if (itemId == R.id.action_refresh_view_post_detail_fragment) { + if (itemId == R.id.action_search_view_post_detail_fragment) { + if (activity.toggleSearchPanelVisibility() && mCommentsAdapter != null) { + mCommentsAdapter.resetCommentSearchIndex(); + } + } else if (itemId == R.id.action_refresh_view_post_detail_fragment) { refresh(true, true); return true; } else if (itemId == R.id.action_comment_view_post_detail_fragment) { @@ -1116,10 +1179,10 @@ public class ViewPostDetailFragment extends Fragment implements FragmentCommunic mPostAdapter = new PostDetailRecyclerViewAdapter(activity, ViewPostDetailFragment.this, mExecutor, mCustomThemeWrapper, mRetrofit, mOauthRetrofit, mGfycatRetrofit, mRedgifsRetrofit, - mRedditDataRoomDatabase, mGlide, mWindowWidth, mAccessToken, - mAccountName, mPost, mLocale, mSingleCommentId, - isSingleCommentThreadMode, mSharedPreferences, - mNsfwAndSpoilerSharedPreferences, mExoCreator, + mRedditDataRoomDatabase, mGlide, mWindowWidth, mSeparatePostAndComments, + mAccessToken, mAccountName, mPost, mLocale, mSharedPreferences, + mNsfwAndSpoilerSharedPreferences, mPostDetailsSharedPreferences, + mExoCreator, post1 -> EventBus.getDefault().post(new PostUpdateEventToPostList(mPost, postListPosition))); mCommentsAdapter = new CommentsRecyclerViewAdapter(activity, @@ -1187,9 +1250,9 @@ public class ViewPostDetailFragment extends Fragment implements FragmentCommunic } if (!isLoadingMoreChildren && loadMoreChildrenSuccess) { - int visibleItemCount = mLinearLayoutManager.getChildCount(); - int totalItemCount = mLinearLayoutManager.getItemCount(); - int firstVisibleItemPosition = mLinearLayoutManager.findFirstVisibleItemPosition(); + int visibleItemCount = (mCommentsRecyclerView == null ? mRecyclerView : mCommentsRecyclerView).getLayoutManager().getChildCount(); + int totalItemCount = (mCommentsRecyclerView == null ? mRecyclerView : mCommentsRecyclerView).getLayoutManager().getItemCount(); + int firstVisibleItemPosition = ((LinearLayoutManagerBugFixed) (mCommentsRecyclerView == null ? mRecyclerView : mCommentsRecyclerView).getLayoutManager()).findFirstVisibleItemPosition(); if ((visibleItemCount + firstVisibleItemPosition >= totalItemCount) && firstVisibleItemPosition >= 0) { fetchMoreComments(); @@ -1325,9 +1388,9 @@ public class ViewPostDetailFragment extends Fragment implements FragmentCommunic } if (!isLoadingMoreChildren && loadMoreChildrenSuccess) { - int visibleItemCount = mLinearLayoutManager.getChildCount(); - int totalItemCount = mLinearLayoutManager.getItemCount(); - int firstVisibleItemPosition = mLinearLayoutManager.findFirstVisibleItemPosition(); + int visibleItemCount = (mCommentsRecyclerView == null ? mRecyclerView : mCommentsRecyclerView).getLayoutManager().getChildCount(); + int totalItemCount = (mCommentsRecyclerView == null ? mRecyclerView : mCommentsRecyclerView).getLayoutManager().getItemCount(); + int firstVisibleItemPosition = ((LinearLayoutManagerBugFixed) (mCommentsRecyclerView == null ? mRecyclerView : mCommentsRecyclerView).getLayoutManager()).findFirstVisibleItemPosition(); if ((visibleItemCount + firstVisibleItemPosition >= totalItemCount) && firstVisibleItemPosition >= 0) { fetchMoreComments(); @@ -1657,36 +1720,28 @@ public class ViewPostDetailFragment extends Fragment implements FragmentCommunic } public void scrollToNextParentComment() { - if (mLinearLayoutManager != null) { - int currentPosition = mLinearLayoutManager.findFirstVisibleItemPosition(); - if (mCommentsAdapter != null) { - int nextParentPosition = mCommentsAdapter.getNextParentCommentPosition(mCommentsRecyclerView == null ? currentPosition - 1 : currentPosition); - if (nextParentPosition < 0) { - return; - } - mSmoothScroller.setTargetPosition(mCommentsRecyclerView == null ? nextParentPosition + 1 : nextParentPosition); - if (mLinearLayoutManager != null) { - mIsSmoothScrolling = true; - mLinearLayoutManager.startSmoothScroll(mSmoothScroller); - } + int currentPosition = ((LinearLayoutManagerBugFixed) (mCommentsRecyclerView == null ? mRecyclerView : mCommentsRecyclerView).getLayoutManager()).findFirstVisibleItemPosition(); + if (mCommentsAdapter != null) { + int nextParentPosition = mCommentsAdapter.getNextParentCommentPosition(mCommentsRecyclerView == null ? currentPosition - 1 : currentPosition); + if (nextParentPosition < 0) { + return; } + mSmoothScroller.setTargetPosition(mCommentsRecyclerView == null ? nextParentPosition + 1 : nextParentPosition); + mIsSmoothScrolling = true; + (mCommentsRecyclerView == null ? mRecyclerView : mCommentsRecyclerView).getLayoutManager().startSmoothScroll(mSmoothScroller); } } public void scrollToPreviousParentComment() { - if (mLinearLayoutManager != null) { - int currentPosition = mLinearLayoutManager.findFirstVisibleItemPosition(); - if (mCommentsAdapter != null) { - int previousParentPosition = mCommentsAdapter.getPreviousParentCommentPosition(mCommentsRecyclerView == null ? currentPosition - 1 : currentPosition); - if (previousParentPosition < 0) { - return; - } - mSmoothScroller.setTargetPosition(mCommentsRecyclerView == null ? previousParentPosition + 1 : previousParentPosition); - if (mLinearLayoutManager != null) { - mIsSmoothScrolling = true; - mLinearLayoutManager.startSmoothScroll(mSmoothScroller); - } + int currentPosition = ((LinearLayoutManagerBugFixed) (mCommentsRecyclerView == null ? mRecyclerView : mCommentsRecyclerView).getLayoutManager()).findFirstVisibleItemPosition(); + if (mCommentsAdapter != null) { + int previousParentPosition = mCommentsAdapter.getPreviousParentCommentPosition(mCommentsRecyclerView == null ? currentPosition - 1 : currentPosition); + if (previousParentPosition < 0) { + return; } + mSmoothScroller.setTargetPosition(mCommentsRecyclerView == null ? previousParentPosition + 1 : previousParentPosition); + mIsSmoothScrolling = true; + (mCommentsRecyclerView == null ? mRecyclerView : mCommentsRecyclerView).getLayoutManager().startSmoothScroll(mSmoothScroller); } } @@ -1767,7 +1822,7 @@ public class ViewPostDetailFragment extends Fragment implements FragmentCommunic private void refreshAdapter(RecyclerView recyclerView, RecyclerView.Adapter<RecyclerView.ViewHolder> adapter) { int previousPosition = -1; if (recyclerView.getLayoutManager() != null) { - previousPosition = ((LinearLayoutManager) recyclerView.getLayoutManager()).findFirstVisibleItemPosition(); + previousPosition = ((LinearLayoutManagerBugFixed) recyclerView.getLayoutManager()).findFirstVisibleItemPosition(); } RecyclerView.LayoutManager layoutManager = recyclerView.getLayoutManager(); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewRPANBroadcastFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewRPANBroadcastFragment.java index 219a55de..8c0c2f57 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewRPANBroadcastFragment.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewRPANBroadcastFragment.java @@ -6,20 +6,22 @@ import android.content.res.Configuration; import android.net.Uri; import android.os.Bundle; import android.os.Handler; -import android.util.Log; import android.view.LayoutInflater; import android.view.MotionEvent; import android.view.View; import android.view.ViewGroup; import android.widget.ImageButton; +import android.widget.ImageView; +import android.widget.TextView; import androidx.annotation.NonNull; import androidx.appcompat.app.AppCompatActivity; import androidx.constraintlayout.widget.ConstraintLayout; import androidx.fragment.app.Fragment; -import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; +import com.bumptech.glide.Glide; +import com.bumptech.glide.request.RequestOptions; import com.google.android.exoplayer2.ExoPlaybackException; import com.google.android.exoplayer2.ExoPlayerFactory; import com.google.android.exoplayer2.Player; @@ -47,18 +49,21 @@ import javax.inject.Named; import butterknife.BindView; import butterknife.ButterKnife; +import jp.wasabeef.glide.transformations.RoundedCornersTransformation; import ml.docilealligator.infinityforreddit.Infinity; import ml.docilealligator.infinityforreddit.R; import ml.docilealligator.infinityforreddit.RPANBroadcast; import ml.docilealligator.infinityforreddit.RPANComment; import ml.docilealligator.infinityforreddit.adapters.RPANCommentStreamRecyclerViewAdapter; import ml.docilealligator.infinityforreddit.customtheme.CustomThemeWrapper; +import ml.docilealligator.infinityforreddit.customviews.LinearLayoutManagerBugFixed; import ml.docilealligator.infinityforreddit.utils.JSONUtils; import ml.docilealligator.infinityforreddit.utils.SharedPreferencesUtils; import okhttp3.OkHttpClient; import okhttp3.Request; import okhttp3.WebSocket; import okhttp3.WebSocketListener; +import retrofit2.Retrofit; public class ViewRPANBroadcastFragment extends Fragment { @@ -69,6 +74,14 @@ public class ViewRPANBroadcastFragment extends Fragment { ConstraintLayout constraintLayout; @BindView(R.id.player_view_view_rpan_broadcast_fragment) PlayerView playerView; + @BindView(R.id.subreddit_icon_image_view_exo_rpan_broadcast_playback_control_view) + ImageView subredditIconImageView; + @BindView(R.id.subreddit_name_text_view_exo_rpan_broadcast_playback_control_view) + TextView subredditNameTextView; + @BindView(R.id.username_text_view_exo_rpan_broadcast_playback_control_view) + TextView usernameTextView; + @BindView(R.id.title_text_view_exo_rpan_broadcast_playback_control_view) + TextView titleTextView; @BindView(R.id.recycler_view_exo_rpan_broadcast_playback_control_view) RecyclerView recyclerView; @BindView(R.id.mute_exo_rpan_broadcast_playback_control_view) @@ -76,6 +89,9 @@ public class ViewRPANBroadcastFragment extends Fragment { @BindView(R.id.hd_exo_rpan_broadcast_playback_control_view) ImageButton hdButton; @Inject + @Named("strapi") + Retrofit mStrapiRetrofit; + @Inject @Named("default") SharedPreferences mSharedPreferences; @Inject @@ -142,6 +158,7 @@ public class ViewRPANBroadcastFragment extends Fragment { | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_IMMERSIVE); + playerView.setControllerShowTimeoutMs(0); break; case View.VISIBLE: mActivity.getWindow().getDecorView().setSystemUiVisibility( @@ -221,6 +238,15 @@ public class ViewRPANBroadcastFragment extends Fragment { } }); + Glide.with(mActivity).load(rpanBroadcast.rpanPost.subredditIconUrl) + .apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(72, 0))) + .error(Glide.with(mActivity).load(R.drawable.subreddit_default_icon) + .apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(72, 0)))) + .into(subredditIconImageView); + subredditNameTextView.setText(rpanBroadcast.rpanPost.subredditName); + usernameTextView.setText(rpanBroadcast.rpanPost.username); + titleTextView.setText(rpanBroadcast.rpanPost.title); + recyclerView.setOnTouchListener(new View.OnTouchListener() { float x1; float x2; @@ -248,12 +274,7 @@ public class ViewRPANBroadcastFragment extends Fragment { return false; } }); - adapter = new RPANCommentStreamRecyclerViewAdapter(mActivity, new RPANCommentStreamRecyclerViewAdapter.ItemClickListener() { - @Override - public void onClick() { - - } - }); + adapter = new RPANCommentStreamRecyclerViewAdapter(mActivity); recyclerView.setAdapter(adapter); handler = new Handler(); @@ -288,7 +309,7 @@ public class ViewRPANBroadcastFragment extends Fragment { payload.getLong(JSONUtils.CREATED_UTC_KEY)); handler.post(() -> { - LinearLayoutManager manager = ((LinearLayoutManager) recyclerView.getLayoutManager()); + LinearLayoutManagerBugFixed manager = ((LinearLayoutManagerBugFixed) recyclerView.getLayoutManager()); boolean shouldScrollToBottom = false; if (manager != null) { int lastPosition = manager.findLastCompletelyVisibleItemPosition(); @@ -373,7 +394,6 @@ public class ViewRPANBroadcastFragment extends Fragment { @Override public void onMessage(@NonNull WebSocket webSocket, @NonNull String text) { - Log.i("asfasdf", "s " + text); messageReceivedListener.onMessage(text); } diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewRedditGalleryImageOrGifFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewRedditGalleryImageOrGifFragment.java index 75e3b2c6..cee6d404 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewRedditGalleryImageOrGifFragment.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewRedditGalleryImageOrGifFragment.java @@ -16,8 +16,10 @@ import android.view.MenuInflater; import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; +import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.ProgressBar; +import android.widget.TextView; import android.widget.Toast; import androidx.annotation.NonNull; @@ -41,6 +43,7 @@ import com.github.piasy.biv.loader.ImageLoader; import com.github.piasy.biv.loader.glide.GlideImageLoader; import com.github.piasy.biv.view.BigImageView; import com.github.piasy.biv.view.GlideImageViewFactory; +import com.google.android.material.bottomappbar.BottomAppBar; import java.io.File; import java.util.concurrent.Executor; @@ -64,6 +67,8 @@ public class ViewRedditGalleryImageOrGifFragment extends Fragment { public static final String EXTRA_REDDIT_GALLERY_MEDIA = "ERGM"; public static final String EXTRA_SUBREDDIT_NAME = "ESN"; + public static final String EXTRA_INDEX = "EI"; + public static final String EXTRA_MEDIA_COUNT = "EMC"; private static final int PERMISSION_REQUEST_WRITE_EXTERNAL_STORAGE = 0; @BindView(R.id.progress_bar_view_reddit_gallery_image_or_gif_fragment) @@ -72,6 +77,16 @@ public class ViewRedditGalleryImageOrGifFragment extends Fragment { BigImageView imageView; @BindView(R.id.load_image_error_linear_layout_view_reddit_gallery_image_or_gif_fragment) LinearLayout errorLinearLayout; + @BindView(R.id.bottom_navigation_view_reddit_gallery_image_or_gif_fragment) + BottomAppBar bottomAppBar; + @BindView(R.id.title_text_view_view_reddit_gallery_image_or_gif_fragment) + TextView titleTextView; + @BindView(R.id.download_image_view_view_reddit_gallery_image_or_gif_fragment) + ImageView downloadImageView; + @BindView(R.id.share_image_view_view_reddit_gallery_image_or_gif_fragment) + ImageView shareImageView; + @BindView(R.id.wallpaper_image_view_view_reddit_gallery_image_or_gif_fragment) + ImageView wallpaperImageView; @Inject Executor mExecutor; @@ -192,6 +207,9 @@ public class ViewRedditGalleryImageOrGifFragment extends Fragment { | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN); isActionBarHidden = false; + if (activity.isUseBottomAppBar()) { + bottomAppBar.setVisibility(View.VISIBLE); + } } else { activity.getWindow().getDecorView().setSystemUiVisibility( View.SYSTEM_UI_FLAG_LAYOUT_STABLE @@ -201,6 +219,9 @@ public class ViewRedditGalleryImageOrGifFragment extends Fragment { | View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_IMMERSIVE); isActionBarHidden = true; + if (activity.isUseBottomAppBar()) { + bottomAppBar.setVisibility(View.GONE); + } } }); @@ -210,6 +231,34 @@ public class ViewRedditGalleryImageOrGifFragment extends Fragment { loadImage(); }); + if (activity.isUseBottomAppBar()) { + bottomAppBar.setVisibility(View.VISIBLE); + if (media.mediaType == Post.Gallery.TYPE_GIF) { + titleTextView.setText(getString(R.string.view_reddit_gallery_activity_gif_label, + getArguments().getInt(EXTRA_INDEX) + 1, getArguments().getInt(EXTRA_MEDIA_COUNT))); + } else { + titleTextView.setText(getString(R.string.view_reddit_gallery_activity_image_label, + getArguments().getInt(EXTRA_INDEX) + 1, getArguments().getInt(EXTRA_MEDIA_COUNT))); + } + downloadImageView.setOnClickListener(view -> { + if (isDownloading) { + return; + } + isDownloading = true; + requestPermissionAndDownload(); + }); + shareImageView.setOnClickListener(view -> { + if (media.mediaType == Post.Gallery.TYPE_GIF) { + shareGif(); + } else { + shareImage(); + } + }); + wallpaperImageView.setOnClickListener(view -> { + setWallpaper(); + }); + } + return rootView; } @@ -225,53 +274,46 @@ public class ViewRedditGalleryImageOrGifFragment extends Fragment { @Override public boolean onOptionsItemSelected(@NonNull MenuItem item) { - switch (item.getItemId()) { - case R.id.action_download_view_reddit_gallery_image_or_gif_fragment: - if (isDownloading) { - return false; - } + int itemId = item.getItemId(); + if (itemId == R.id.action_download_view_reddit_gallery_image_or_gif_fragment) { + if (isDownloading) { + return false; + } + isDownloading = true; + requestPermissionAndDownload(); + return true; + } else if (itemId == R.id.action_share_view_reddit_gallery_image_or_gif_fragment) { + if (media.mediaType == Post.Gallery.TYPE_GIF) { + shareGif(); + } else { + shareImage(); + } + return true; + } else if (itemId == R.id.action_set_wallpaper_view_reddit_gallery_image_or_gif_fragment) { + setWallpaper(); + return true; + } - isDownloading = true; + return false; + } - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { - if (ContextCompat.checkSelfPermission(activity, - Manifest.permission.WRITE_EXTERNAL_STORAGE) - != PackageManager.PERMISSION_GRANTED) { - - // Permission is not granted - // No explanation needed; request the permission - requestPermissions(new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, - PERMISSION_REQUEST_WRITE_EXTERNAL_STORAGE); - } else { - // Permission has already been granted - download(); - } - } else { - download(); - } + private void requestPermissionAndDownload() { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && Build.VERSION.SDK_INT < Build.VERSION_CODES.Q) { + if (ContextCompat.checkSelfPermission(activity, + Manifest.permission.WRITE_EXTERNAL_STORAGE) + != PackageManager.PERMISSION_GRANTED) { - return true; - case R.id.action_share_view_reddit_gallery_image_or_gif_fragment: - if (media.mediaType == Post.Gallery.TYPE_GIF) { - shareGif(); - } else { - shareImage(); - } - return true; - case R.id.action_set_wallpaper_view_reddit_gallery_image_or_gif_fragment: - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { - SetAsWallpaperBottomSheetFragment setAsWallpaperBottomSheetFragment = new SetAsWallpaperBottomSheetFragment(); - Bundle bundle = new Bundle(); - bundle.putInt(SetAsWallpaperBottomSheetFragment.EXTRA_VIEW_PAGER_POSITION, activity.getCurrentPagePosition()); - setAsWallpaperBottomSheetFragment.setArguments(bundle); - setAsWallpaperBottomSheetFragment.show(activity.getSupportFragmentManager(), setAsWallpaperBottomSheetFragment.getTag()); - } else { - ((SetAsWallpaperCallback) activity).setToBoth(activity.getCurrentPagePosition()); - } - return true; + // Permission is not granted + // No explanation needed; request the permission + requestPermissions(new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, + PERMISSION_REQUEST_WRITE_EXTERNAL_STORAGE); + } else { + // Permission has already been granted + download(); + } + } else { + download(); } - - return false; } private void download() { @@ -366,6 +408,20 @@ public class ViewRedditGalleryImageOrGifFragment extends Fragment { }).submit(); } + private void setWallpaper() { + if (media.mediaType != Post.Gallery.TYPE_GIF) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { + SetAsWallpaperBottomSheetFragment setAsWallpaperBottomSheetFragment = new SetAsWallpaperBottomSheetFragment(); + Bundle bundle = new Bundle(); + bundle.putInt(SetAsWallpaperBottomSheetFragment.EXTRA_VIEW_PAGER_POSITION, activity.getCurrentPagePosition()); + setAsWallpaperBottomSheetFragment.setArguments(bundle); + setAsWallpaperBottomSheetFragment.show(activity.getSupportFragmentManager(), setAsWallpaperBottomSheetFragment.getTag()); + } else { + ((SetAsWallpaperCallback) activity).setToBoth(activity.getCurrentPagePosition()); + } + } + } + @Override public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) { if (requestCode == PERMISSION_REQUEST_WRITE_EXTERNAL_STORAGE && grantResults.length > 0) { @@ -385,8 +441,21 @@ public class ViewRedditGalleryImageOrGifFragment extends Fragment { } @Override - public void onDestroy() { - super.onDestroy(); + public void onResume() { + super.onResume(); + SubsamplingScaleImageView ssiv = imageView.getSSIV(); + if (ssiv == null || !ssiv.hasImage()) { + imageView.showImage(Uri.parse(media.url)); + } + } + + @Override + public void onDestroyView() { + super.onDestroyView(); BigImageViewer.imageLoader().cancelAll(); + SubsamplingScaleImageView subsamplingScaleImageView = imageView.getSSIV(); + if (subsamplingScaleImageView != null) { + subsamplingScaleImageView.recycle(); + } } } diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewRedditGalleryVideoFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewRedditGalleryVideoFragment.java index a1258ce2..de1e5566 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewRedditGalleryVideoFragment.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewRedditGalleryVideoFragment.java @@ -1,7 +1,6 @@ package ml.docilealligator.infinityforreddit.fragments; import android.Manifest; -import android.app.Activity; import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; @@ -18,7 +17,9 @@ import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; import android.widget.ImageButton; +import android.widget.ImageView; import android.widget.LinearLayout; +import android.widget.TextView; import android.widget.Toast; import androidx.annotation.NonNull; @@ -39,6 +40,7 @@ import com.google.android.exoplayer2.ui.PlayerView; import com.google.android.exoplayer2.upstream.DataSource; import com.google.android.exoplayer2.upstream.DefaultDataSourceFactory; import com.google.android.exoplayer2.util.Util; +import com.google.android.material.bottomappbar.BottomAppBar; import javax.inject.Inject; import javax.inject.Named; @@ -46,8 +48,9 @@ import javax.inject.Named; import butterknife.BindView; import butterknife.ButterKnife; import ml.docilealligator.infinityforreddit.Infinity; -import ml.docilealligator.infinityforreddit.post.Post; import ml.docilealligator.infinityforreddit.R; +import ml.docilealligator.infinityforreddit.activities.ViewRedditGalleryActivity; +import ml.docilealligator.infinityforreddit.post.Post; import ml.docilealligator.infinityforreddit.services.DownloadMediaService; import ml.docilealligator.infinityforreddit.utils.SharedPreferencesUtils; @@ -57,12 +60,20 @@ public class ViewRedditGalleryVideoFragment extends Fragment { public static final String EXTRA_SUBREDDIT_NAME = "ESN"; private static final String IS_MUTE_STATE = "IMS"; private static final String POSITION_STATE = "PS"; + public static final String EXTRA_INDEX = "EI"; + public static final String EXTRA_MEDIA_COUNT = "EMC"; private static final int PERMISSION_REQUEST_WRITE_EXTERNAL_STORAGE = 0; @BindView(R.id.player_view_view_reddit_gallery_video_fragment) PlayerView videoPlayerView; @BindView(R.id.mute_exo_playback_control_view) ImageButton muteButton; - private Activity activity; + @BindView(R.id.bottom_navigation_exo_playback_control_view) + BottomAppBar bottomAppBar; + @BindView(R.id.title_text_view_exo_playback_control_view) + TextView titleTextView; + @BindView(R.id.download_image_view_exo_playback_control_view) + ImageView downloadImageView; + private ViewRedditGalleryActivity activity; private Post.Gallery galleryVideo; private String subredditName; private SimpleExoPlayer player; @@ -139,6 +150,19 @@ public class ViewRedditGalleryVideoFragment extends Fragment { player.prepare(new ProgressiveMediaSource.Factory(dataSourceFactory).createMediaSource(Uri.parse(galleryVideo.url))); preparePlayer(savedInstanceState); + if (activity.isUseBottomAppBar()) { + bottomAppBar.setVisibility(View.VISIBLE); + titleTextView.setText(getString(R.string.view_reddit_gallery_activity_video_label, + getArguments().getInt(EXTRA_INDEX) + 1, getArguments().getInt(EXTRA_MEDIA_COUNT))); + downloadImageView.setOnClickListener(view -> { + if (isDownloading) { + return; + } + isDownloading = true; + requestPermissionAndDownload(); + }); + } + return rootView; } @@ -152,25 +176,29 @@ public class ViewRedditGalleryVideoFragment extends Fragment { public boolean onOptionsItemSelected(@NonNull MenuItem item) { if (item.getItemId() == R.id.action_download_view_reddit_gallery_video_fragment) { isDownloading = true; - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { - if (ContextCompat.checkSelfPermission(activity, - Manifest.permission.WRITE_EXTERNAL_STORAGE) - != PackageManager.PERMISSION_GRANTED) { - - // Permission is not granted - // No explanation needed; request the permission - requestPermissions(new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, - PERMISSION_REQUEST_WRITE_EXTERNAL_STORAGE); - } else { - // Permission has already been granted - download(); - } + requestPermissionAndDownload(); + return true; + } + return false; + } + + private void requestPermissionAndDownload() { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && Build.VERSION.SDK_INT < Build.VERSION_CODES.Q) { + if (ContextCompat.checkSelfPermission(activity, + Manifest.permission.WRITE_EXTERNAL_STORAGE) + != PackageManager.PERMISSION_GRANTED) { + + // Permission is not granted + // No explanation needed; request the permission + requestPermissions(new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, + PERMISSION_REQUEST_WRITE_EXTERNAL_STORAGE); } else { + // Permission has already been granted download(); } - return true; + } else { + download(); } - return false; } @Override @@ -286,6 +314,6 @@ public class ViewRedditGalleryVideoFragment extends Fragment { @Override public void onAttach(@NonNull Context context) { super.onAttach(context); - activity = (Activity) context; + activity = (ViewRedditGalleryActivity) context; } }
\ No newline at end of file diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/post/ParsePost.java b/app/src/main/java/ml/docilealligator/infinityforreddit/post/ParsePost.java index 53b5aa39..881fb4d8 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/post/ParsePost.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/post/ParsePost.java @@ -119,7 +119,7 @@ public class ParsePost { }); } - private static Post parseBasicData(JSONObject data) throws JSONException { + public static Post parseBasicData(JSONObject data) throws JSONException { String id = data.getString(JSONUtils.ID_KEY); String fullName = data.getString(JSONUtils.NAME_KEY); String subredditName = data.getString(JSONUtils.SUBREDDIT_KEY); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/post/PostDataSource.java b/app/src/main/java/ml/docilealligator/infinityforreddit/post/PostDataSource.java index 9c8490ef..57a6b5e3 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/post/PostDataSource.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/post/PostDataSource.java @@ -48,6 +48,7 @@ public class PostDataSource extends PageKeyedDataSource<String, Post> { private SharedPreferences postFeedScrolledPositionSharedPreferences; private String subredditOrUserName; private String query; + private String trendingSource; private int postType; private SortType sortType; private PostFilter postFilter; @@ -151,8 +152,8 @@ public class PostDataSource extends PageKeyedDataSource<String, Post> { PostDataSource(Executor executor, Handler handler, Retrofit retrofit, String accessToken, String accountName, SharedPreferences sharedPreferences, SharedPreferences postFeedScrolledPositionSharedPreferences, - String subredditOrUserName, String query, int postType, SortType sortType, PostFilter postFilter, - List<ReadPost> readPostList) { + String subredditOrUserName, String query, String trendingSource, int postType, + SortType sortType, PostFilter postFilter, List<ReadPost> readPostList) { this.executor = executor; this.handler = handler; this.retrofit = retrofit; @@ -162,6 +163,7 @@ public class PostDataSource extends PageKeyedDataSource<String, Post> { this.postFeedScrolledPositionSharedPreferences = postFeedScrolledPositionSharedPreferences; this.subredditOrUserName = subredditOrUserName; this.query = query; + this.trendingSource = trendingSource; paginationNetworkStateLiveData = new MutableLiveData<>(); initialLoadStateLiveData = new MutableLiveData<>(); hasPostLiveData = new MutableLiveData<>(); @@ -639,16 +641,17 @@ public class PostDataSource extends PageKeyedDataSource<String, Post> { if (subredditOrUserName == null) { if (accessToken == null) { if (sortType.getTime() != null) { - getPost = api.searchPosts(query, lastItem, sortType.getType().value, sortType.getTime().value); + getPost = api.searchPosts(query, lastItem, sortType.getType().value, sortType.getTime().value, + trendingSource); } else { - getPost = api.searchPosts(query, lastItem, sortType.getType().value); + getPost = api.searchPosts(query, lastItem, sortType.getType().value, trendingSource); } } else { if(sortType.getTime() != null) { getPost = api.searchPostsOauth(query, lastItem, sortType.getType().value, - sortType.getTime().value, APIUtils.getOAuthHeader(accessToken)); + sortType.getTime().value, trendingSource, APIUtils.getOAuthHeader(accessToken)); } else { - getPost = api.searchPostsOauth(query, lastItem, sortType.getType().value, + getPost = api.searchPostsOauth(query, lastItem, sortType.getType().value, trendingSource, APIUtils.getOAuthHeader(accessToken)); } } @@ -732,16 +735,18 @@ public class PostDataSource extends PageKeyedDataSource<String, Post> { if (subredditOrUserName == null) { if (accessToken == null) { if (sortType.getTime() != null) { - getPost = api.searchPosts(query, after, sortType.getType().value, sortType.getTime().value); + getPost = api.searchPosts(query, after, sortType.getType().value, sortType.getTime().value, + trendingSource); } else { - getPost = api.searchPosts(query, after, sortType.getType().value); + getPost = api.searchPosts(query, after, sortType.getType().value, trendingSource); } } else { if (sortType.getTime() != null) { getPost = api.searchPostsOauth(query, after, sortType.getType().value, - sortType.getTime().value, APIUtils.getOAuthHeader(accessToken)); + sortType.getTime().value, trendingSource, APIUtils.getOAuthHeader(accessToken)); } else { - getPost = api.searchPostsOauth(query, after, sortType.getType().value, APIUtils.getOAuthHeader(accessToken)); + getPost = api.searchPostsOauth(query, after, sortType.getType().value, trendingSource, + APIUtils.getOAuthHeader(accessToken)); } } } else { diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/post/PostDataSourceFactory.java b/app/src/main/java/ml/docilealligator/infinityforreddit/post/PostDataSourceFactory.java index ff4088b7..dd8312b7 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/post/PostDataSourceFactory.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/post/PostDataSourceFactory.java @@ -26,6 +26,7 @@ class PostDataSourceFactory extends DataSource.Factory { private SharedPreferences postFeedScrolledPositionSharedPreferences; private String name; private String query; + private String trendingSource; private int postType; private SortType sortType; private PostFilter postFilter; @@ -94,8 +95,8 @@ class PostDataSourceFactory extends DataSource.Factory { PostDataSourceFactory(Executor executor, Handler handler, Retrofit retrofit, String accessToken, String accountName, SharedPreferences sharedPreferences, SharedPreferences postFeedScrolledPositionSharedPreferences, - String name, String query, int postType, SortType sortType, PostFilter postFilter, - List<ReadPost> readPostList) { + String name, String query, String trendingSource, int postType, SortType sortType, + PostFilter postFilter, List<ReadPost> readPostList) { this.executor = executor; this.handler = handler; this.retrofit = retrofit; @@ -105,6 +106,7 @@ class PostDataSourceFactory extends DataSource.Factory { this.postFeedScrolledPositionSharedPreferences = postFeedScrolledPositionSharedPreferences; this.name = name; this.query = query; + this.trendingSource = trendingSource; postDataSourceLiveData = new MutableLiveData<>(); this.postType = postType; this.sortType = sortType; @@ -121,7 +123,7 @@ class PostDataSourceFactory extends DataSource.Factory { postFilter, readPostList); } else if (postType == PostDataSource.TYPE_SEARCH) { postDataSource = new PostDataSource(executor, handler, retrofit, accessToken, accountName, - sharedPreferences, postFeedScrolledPositionSharedPreferences, name, query, + sharedPreferences, postFeedScrolledPositionSharedPreferences, name, query, trendingSource, postType, sortType, postFilter, readPostList); } else if (postType == PostDataSource.TYPE_SUBREDDIT || postType == PostDataSource.TYPE_MULTI_REDDIT) { Log.i("asdasfd", "s5 " + (postFilter == null)); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/post/PostViewModel.java b/app/src/main/java/ml/docilealligator/infinityforreddit/post/PostViewModel.java index 3649f430..ea56f54e 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/post/PostViewModel.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/post/PostViewModel.java @@ -137,9 +137,10 @@ public class PostViewModel extends ViewModel { public PostViewModel(Executor executor, Handler handler, Retrofit retrofit, String accessToken, String accountName, SharedPreferences sharedPreferences, SharedPreferences cache, String subredditName, - String query, int postType, SortType sortType, PostFilter postFilter, List<ReadPost> readPostList) { + String query, String trendingSource, int postType, SortType sortType, + PostFilter postFilter, List<ReadPost> readPostList) { postDataSourceFactory = new PostDataSourceFactory(executor, handler, retrofit, accessToken, accountName, - sharedPreferences, cache, subredditName, query, postType, sortType, postFilter, + sharedPreferences, cache, subredditName, query, trendingSource, postType, sortType, postFilter, readPostList); initialLoadingState = Transformations.switchMap(postDataSourceFactory.getPostDataSourceLiveData(), @@ -211,6 +212,7 @@ public class PostViewModel extends ViewModel { private SharedPreferences postFeedScrolledPositionSharedPreferences; private String name; private String query; + private String trendingSource; private int postType; private SortType sortType; private PostFilter postFilter; @@ -272,8 +274,8 @@ public class PostViewModel extends ViewModel { public Factory(Executor executor, Handler handler, Retrofit retrofit, String accessToken, String accountName, SharedPreferences sharedPreferences, SharedPreferences postFeedScrolledPositionSharedPreferences, - String name, String query, int postType, SortType sortType, PostFilter postFilter, - List<ReadPost> readPostList) { + String name, String query, String trendingSource, int postType, SortType sortType, + PostFilter postFilter, List<ReadPost> readPostList) { this.executor = executor; this.handler = handler; this.retrofit = retrofit; @@ -283,6 +285,7 @@ public class PostViewModel extends ViewModel { this.postFeedScrolledPositionSharedPreferences = postFeedScrolledPositionSharedPreferences; this.name = name; this.query = query; + this.trendingSource = trendingSource; this.postType = postType; this.sortType = sortType; this.postFilter = postFilter; @@ -310,7 +313,7 @@ public class PostViewModel extends ViewModel { postFeedScrolledPositionSharedPreferences, postType, sortType, postFilter, readPostList); } else if (postType == PostDataSource.TYPE_SEARCH) { return (T) new PostViewModel(executor, handler, retrofit, accessToken, accountName, sharedPreferences, - postFeedScrolledPositionSharedPreferences, name, query, postType, sortType, + postFeedScrolledPositionSharedPreferences, name, query, trendingSource, postType, sortType, postFilter, readPostList); } else if (postType == PostDataSource.TYPE_SUBREDDIT || postType == PostDataSource.TYPE_MULTI_REDDIT) { return (T) new PostViewModel(executor, handler, retrofit, accessToken, accountName, sharedPreferences, diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/post/SubmitPost.java b/app/src/main/java/ml/docilealligator/infinityforreddit/post/SubmitPost.java index b7dd5f59..bf6fdbda 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/post/SubmitPost.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/post/SubmitPost.java @@ -13,7 +13,6 @@ import org.xmlpull.v1.XmlPullParserException; import java.io.File; import java.io.IOException; import java.util.HashMap; -import java.util.Locale; import java.util.Map; import java.util.concurrent.Executor; @@ -31,22 +30,24 @@ import retrofit2.Retrofit; public class SubmitPost { public static void submitTextOrLinkPost(Executor executor, Handler handler, Retrofit oauthRetrofit, String accessToken, - Locale locale, String subredditName, String title, String content, - Flair flair, boolean isSpoiler, boolean isNSFW, String kind, + String subredditName, String title, String content, + Flair flair, boolean isSpoiler, boolean isNSFW, + boolean receivePostReplyNotifications, String kind, SubmitPostListener submitPostListener) { submitPost(executor, handler, oauthRetrofit, accessToken, subredditName, title, content, - flair, isSpoiler, isNSFW, kind, null, submitPostListener); + flair, isSpoiler, isNSFW, receivePostReplyNotifications, kind, null, submitPostListener); } public static void submitImagePost(Executor executor, Handler handler, Retrofit oauthRetrofit, Retrofit uploadMediaRetrofit, String accessToken, String subredditName, String title, Bitmap image, - Flair flair, boolean isSpoiler, boolean isNSFW, SubmitPostListener submitPostListener) { + Flair flair, boolean isSpoiler, boolean isNSFW, + boolean receivePostReplyNotifications, SubmitPostListener submitPostListener) { try { String imageUrlOrError = UploadImageUtils.uploadImage(oauthRetrofit, uploadMediaRetrofit, accessToken, image); if (imageUrlOrError != null && !imageUrlOrError.startsWith("Error: ")) { submitPost(executor, handler, oauthRetrofit, accessToken, subredditName, title, imageUrlOrError, flair, isSpoiler, isNSFW, - APIUtils.KIND_IMAGE, null, submitPostListener); + receivePostReplyNotifications, APIUtils.KIND_IMAGE, null, submitPostListener); } else { submitPostListener.submitFailed(imageUrlOrError); } @@ -60,7 +61,7 @@ public class SubmitPost { Retrofit uploadVideoRetrofit, String accessToken, String subredditName, String title, File buffer, String mimeType, Bitmap posterBitmap, Flair flair, boolean isSpoiler, boolean isNSFW, - SubmitPostListener submitPostListener) { + boolean receivePostReplyNotifications, SubmitPostListener submitPostListener) { RedditAPI api = oauthRetrofit.create(RedditAPI.class); String fileType = mimeType.substring(mimeType.indexOf("/") + 1); @@ -97,11 +98,13 @@ public class SubmitPost { if (fileType.equals("gif")) { submitPost(executor, handler, oauthRetrofit, accessToken, subredditName, title, url, flair, isSpoiler, isNSFW, - APIUtils.KIND_VIDEOGIF, imageUrlOrError, submitPostListener); + receivePostReplyNotifications, APIUtils.KIND_VIDEOGIF, imageUrlOrError, + submitPostListener); } else { submitPost(executor, handler, oauthRetrofit, accessToken, subredditName, title, url, flair, isSpoiler, isNSFW, - APIUtils.KIND_VIDEO, imageUrlOrError, submitPostListener); + receivePostReplyNotifications, APIUtils.KIND_VIDEO, imageUrlOrError, + submitPostListener); } } else { submitPostListener.submitFailed(imageUrlOrError); @@ -119,16 +122,18 @@ public class SubmitPost { } public static void submitCrosspost(Executor executor, Handler handler, Retrofit oauthRetrofit, String accessToken, - String subredditName, String title, String crosspostFullname, - Flair flair, boolean isSpoiler, boolean isNSFW, String kind, - SubmitPostListener submitPostListener) { + String subredditName, String title, String crosspostFullname, + Flair flair, boolean isSpoiler, boolean isNSFW, + boolean receivePostReplyNotifications, String kind, + SubmitPostListener submitPostListener) { submitPost(executor, handler, oauthRetrofit, accessToken, subredditName, title, crosspostFullname, - flair, isSpoiler, isNSFW, kind, null, submitPostListener); + flair, isSpoiler, isNSFW, receivePostReplyNotifications, kind, null, submitPostListener); } private static void submitPost(Executor executor, Handler handler, Retrofit oauthRetrofit, String accessToken, String subredditName, String title, String content, - Flair flair, boolean isSpoiler, boolean isNSFW, String kind, + Flair flair, boolean isSpoiler, boolean isNSFW, + boolean receivePostReplyNotifications, String kind, @Nullable String posterUrl, SubmitPostListener submitPostListener) { RedditAPI api = oauthRetrofit.create(RedditAPI.class); @@ -165,6 +170,7 @@ public class SubmitPost { } params.put(APIUtils.SPOILER_KEY, Boolean.toString(isSpoiler)); params.put(APIUtils.NSFW_KEY, Boolean.toString(isNSFW)); + params.put(APIUtils.SEND_REPLIES_KEY, Boolean.toString(receivePostReplyNotifications)); Call<String> submitPostCall = api.submit(APIUtils.getOAuthHeader(accessToken), params); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/services/DownloadMediaService.java b/app/src/main/java/ml/docilealligator/infinityforreddit/services/DownloadMediaService.java index a326d81f..e5534ef9 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/services/DownloadMediaService.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/services/DownloadMediaService.java @@ -263,7 +263,7 @@ public class DownloadMediaService extends Service { contentValues.put(MediaStore.MediaColumns.RELATIVE_PATH, destinationFileUriString); contentValues.put(mediaType == EXTRA_MEDIA_TYPE_VIDEO ? MediaStore.Video.Media.IS_PENDING : MediaStore.Images.Media.IS_PENDING, 1); - final Uri contentUri = mediaType == EXTRA_MEDIA_TYPE_VIDEO ? MediaStore.Video.Media.getContentUri(MediaStore.VOLUME_EXTERNAL) : MediaStore.Images.Media.getContentUri(MediaStore.VOLUME_EXTERNAL); + final Uri contentUri = mediaType == EXTRA_MEDIA_TYPE_VIDEO ? MediaStore.Video.Media.getContentUri(MediaStore.VOLUME_EXTERNAL_PRIMARY) : MediaStore.Images.Media.getContentUri(MediaStore.VOLUME_EXTERNAL_PRIMARY); Uri uri = contentResolver.insert(contentUri, contentValues); if (uri == null) { diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/services/DownloadRedditVideoService.java b/app/src/main/java/ml/docilealligator/infinityforreddit/services/DownloadRedditVideoService.java index f1b9633e..a398871e 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/services/DownloadRedditVideoService.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/services/DownloadRedditVideoService.java @@ -25,7 +25,6 @@ import android.os.Looper; import android.os.Message; import android.os.Process; import android.provider.MediaStore; -import android.util.Log; import androidx.core.app.NotificationCompat; import androidx.core.app.NotificationManagerCompat; @@ -417,7 +416,7 @@ public class DownloadRedditVideoService extends Service { Uri uri = null; try { - final Uri contentUri = MediaStore.Video.Media.getContentUri(MediaStore.VOLUME_EXTERNAL); + final Uri contentUri = MediaStore.Video.Media.getContentUri(MediaStore.VOLUME_EXTERNAL_PRIMARY); uri = contentResolver.insert(contentUri, contentValues); if (uri == null) { diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/services/MaterialYouService.java b/app/src/main/java/ml/docilealligator/infinityforreddit/services/MaterialYouService.java index 7fc764f8..66bd4e0b 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/services/MaterialYouService.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/services/MaterialYouService.java @@ -1,9 +1,18 @@ package ml.docilealligator.infinityforreddit.services; -import android.app.IntentService; +import android.app.Notification; +import android.app.NotificationChannel; +import android.app.NotificationManager; +import android.app.Service; import android.content.Intent; import android.content.SharedPreferences; +import android.os.Build; import android.os.Handler; +import android.os.IBinder; + +import androidx.annotation.Nullable; +import androidx.core.app.NotificationCompat; +import androidx.core.app.NotificationManagerCompat; import java.util.concurrent.Executor; @@ -11,12 +20,14 @@ import javax.inject.Inject; import javax.inject.Named; import ml.docilealligator.infinityforreddit.Infinity; +import ml.docilealligator.infinityforreddit.R; import ml.docilealligator.infinityforreddit.RedditDataRoomDatabase; import ml.docilealligator.infinityforreddit.customtheme.CustomThemeWrapper; import ml.docilealligator.infinityforreddit.utils.MaterialYouUtils; +import ml.docilealligator.infinityforreddit.utils.NotificationUtils; import ml.docilealligator.infinityforreddit.utils.SharedPreferencesUtils; -public class MaterialYouService extends IntentService { +public class MaterialYouService extends Service { @Inject @Named("default") @@ -38,16 +49,50 @@ public class MaterialYouService extends IntentService { Executor executor; public MaterialYouService() { - super("MaterialYouService"); } + @Nullable @Override - protected void onHandleIntent(Intent intent) { + public IBinder onBind(Intent intent) { + return null; + } + + @Override + public int onStartCommand(Intent intent, int flags, int startId) { ((Infinity) getApplication()).getAppComponent().inject(this); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + NotificationChannel serviceChannel = new NotificationChannel( + NotificationUtils.CHANNEL_ID_MATERIAL_YOU, + NotificationUtils.CHANNEL_MATERIAL_YOU, + NotificationManager.IMPORTANCE_LOW + ); + + NotificationManagerCompat manager = NotificationManagerCompat.from(this); + manager.createNotificationChannel(serviceChannel); + } + Notification notification = new NotificationCompat.Builder(this, NotificationUtils.CHANNEL_ID_MATERIAL_YOU) + .setContentTitle(getString(R.string.material_you_notification_title)) + .setContentText(getString(R.string.please_wait)) + .setSmallIcon(R.drawable.ic_notification) + .setColor(customThemeWrapper.getColorPrimaryLightTheme()) + .build(); + startForeground(NotificationUtils.MATERIAL_YOU_NOTIFICATION_ID, notification); + if (mSharedPreferences.getBoolean(SharedPreferencesUtils.ENABLE_MATERIAL_YOU, false)) { MaterialYouUtils.changeTheme(this, executor, new Handler(), redditDataRoomDatabase, customThemeWrapper, lightThemeSharedPreferences, darkThemeSharedPreferences, - amoledThemeSharedPreferences); + amoledThemeSharedPreferences, () -> { + stopService(); + }); + } else { + stopService(); } + + return START_NOT_STICKY; + } + + private void stopService() { + stopForeground(true); + stopSelf(); } }
\ No newline at end of file diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/services/SubmitPostService.java b/app/src/main/java/ml/docilealligator/infinityforreddit/services/SubmitPostService.java index 12b4e1a5..e22bc541 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/services/SubmitPostService.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/services/SubmitPostService.java @@ -25,6 +25,9 @@ import androidx.core.app.NotificationManagerCompat; import com.bumptech.glide.Glide; import org.greenrobot.eventbus.EventBus; +import org.json.JSONArray; +import org.json.JSONException; +import org.json.JSONObject; import java.io.File; import java.io.FileOutputStream; @@ -41,15 +44,19 @@ import javax.inject.Named; import ml.docilealligator.infinityforreddit.Flair; import ml.docilealligator.infinityforreddit.Infinity; import ml.docilealligator.infinityforreddit.R; +import ml.docilealligator.infinityforreddit.apis.RedditAPI; import ml.docilealligator.infinityforreddit.customtheme.CustomThemeWrapper; import ml.docilealligator.infinityforreddit.events.SubmitCrosspostEvent; +import ml.docilealligator.infinityforreddit.events.SubmitGalleryPostEvent; import ml.docilealligator.infinityforreddit.events.SubmitImagePostEvent; import ml.docilealligator.infinityforreddit.events.SubmitTextOrLinkPostEvent; import ml.docilealligator.infinityforreddit.events.SubmitVideoOrGifPostEvent; import ml.docilealligator.infinityforreddit.post.Post; import ml.docilealligator.infinityforreddit.post.SubmitPost; import ml.docilealligator.infinityforreddit.utils.APIUtils; +import ml.docilealligator.infinityforreddit.utils.JSONUtils; import ml.docilealligator.infinityforreddit.utils.NotificationUtils; +import retrofit2.Response; import retrofit2.Retrofit; public class SubmitPostService extends Service { @@ -57,15 +64,19 @@ public class SubmitPostService extends Service { public static final String EXTRA_SUBREDDIT_NAME = "ESN"; public static final String EXTRA_TITLE = "ET"; public static final String EXTRA_CONTENT = "EC"; + public static final String EXTRA_REDDIT_GALLERY_PAYLOAD = "ERGP"; public static final String EXTRA_KIND = "EK"; public static final String EXTRA_FLAIR = "EF"; public static final String EXTRA_IS_SPOILER = "EIS"; public static final String EXTRA_IS_NSFW = "EIN"; + public static final String EXTRA_RECEIVE_POST_REPLY_NOTIFICATIONS = "ERPRN"; public static final String EXTRA_POST_TYPE = "EPT"; public static final int EXTRA_POST_TEXT_OR_LINK = 0; public static final int EXTRA_POST_TYPE_IMAGE = 1; public static final int EXTRA_POST_TYPE_VIDEO = 2; - public static final int EXTRA_POST_TYPE_CROSSPOST = 3; + public static final int EXTRA_POST_TYPE_GALLERY = 3; + public static final int EXTRA_POST_TYPE_CROSSPOST = 4; + private static final String EXTRA_MEDIA_URI = "EU"; @Inject @Named("oauth") @@ -107,22 +118,28 @@ public class SubmitPostService extends Service { Flair flair = bundle.getParcelable(EXTRA_FLAIR); boolean isSpoiler = bundle.getBoolean(EXTRA_IS_SPOILER, false); boolean isNSFW = bundle.getBoolean(EXTRA_IS_NSFW, false); + boolean receivePostReplyNotifications = bundle.getBoolean(EXTRA_RECEIVE_POST_REPLY_NOTIFICATIONS, true); int postType = bundle.getInt(EXTRA_POST_TYPE, EXTRA_POST_TEXT_OR_LINK); if (postType == EXTRA_POST_TEXT_OR_LINK) { String content = bundle.getString(EXTRA_CONTENT); String kind = bundle.getString(EXTRA_KIND); - submitTextOrLinkPost(accessToken, subredditName, title, content, flair, isSpoiler, isNSFW, kind); + submitTextOrLinkPost(accessToken, subredditName, title, content, flair, isSpoiler, isNSFW, + receivePostReplyNotifications, kind); } else if (postType == EXTRA_POST_TYPE_CROSSPOST) { String content = bundle.getString(EXTRA_CONTENT); submitCrosspost(mExecutor, handler, accessToken, subredditName, title, content, - flair, isSpoiler, isNSFW); + flair, isSpoiler, isNSFW, receivePostReplyNotifications); } else if (postType == EXTRA_POST_TYPE_IMAGE) { Uri mediaUri = Uri.parse(bundle.getString(EXTRA_MEDIA_URI)); - submitImagePost(accessToken, mediaUri, subredditName, title, flair, isSpoiler, isNSFW); - } else { + submitImagePost(accessToken, mediaUri, subredditName, title, flair, isSpoiler, isNSFW, + receivePostReplyNotifications); + } else if (postType == EXTRA_POST_TYPE_VIDEO) { Uri mediaUri = Uri.parse(bundle.getString(EXTRA_MEDIA_URI)); - submitVideoPost(accessToken, mediaUri, subredditName, title, flair, isSpoiler, isNSFW); + submitVideoPost(accessToken, mediaUri, subredditName, title, flair, isSpoiler, isNSFW, + receivePostReplyNotifications); + } else { + submitGalleryPost(accessToken, bundle.getString(EXTRA_REDDIT_GALLERY_PAYLOAD)); } } } @@ -169,9 +186,11 @@ public class SubmitPostService extends Service { } else if (postType == EXTRA_POST_TYPE_IMAGE) { bundle.putString(EXTRA_MEDIA_URI, intent.getData().toString()); startForeground(NotificationUtils.SUBMIT_POST_SERVICE_NOTIFICATION_ID + randomNotificationIdOffset, createNotification(R.string.posting_image)); - } else { + } else if (postType == EXTRA_POST_TYPE_VIDEO) { bundle.putString(EXTRA_MEDIA_URI, intent.getData().toString()); startForeground(NotificationUtils.SUBMIT_POST_SERVICE_NOTIFICATION_ID + randomNotificationIdOffset, createNotification(R.string.posting_video)); + } else { + startForeground(NotificationUtils.SUBMIT_POST_SERVICE_NOTIFICATION_ID + randomNotificationIdOffset, createNotification(R.string.posting_gallery)); } Message msg = serviceHandler.obtainMessage(); @@ -190,10 +209,12 @@ public class SubmitPostService extends Service { .build(); } - private void submitTextOrLinkPost(String accessToken, String subredditName, String title, String content, Flair flair, boolean isSpoiler, boolean isNSFW, String kind) { + private void submitTextOrLinkPost(String accessToken, String subredditName, String title, String content, + Flair flair, boolean isSpoiler, boolean isNSFW, boolean receivePostReplyNotifications, + String kind) { SubmitPost.submitTextOrLinkPost(mExecutor, handler, mOauthRetrofit, accessToken, - getResources().getConfiguration().locale, subredditName, title, content, flair, isSpoiler, - isNSFW, kind, new SubmitPost.SubmitPostListener() { + subredditName, title, content, flair, isSpoiler, + isNSFW, receivePostReplyNotifications, kind, new SubmitPost.SubmitPostListener() { @Override public void submitSuccessful(Post post) { handler.post(() -> EventBus.getDefault().post(new SubmitTextOrLinkPostEvent(true, post, null))); @@ -211,9 +232,11 @@ public class SubmitPostService extends Service { } private void submitCrosspost(Executor executor, Handler handler, String accessToken, String subredditName, - String title, String content, Flair flair, boolean isSpoiler, boolean isNSFW) { + String title, String content, Flair flair, boolean isSpoiler, boolean isNSFW, + boolean receivePostReplyNotifications) { SubmitPost.submitCrosspost(executor, handler, mOauthRetrofit, accessToken, subredditName, title, - content, flair, isSpoiler, isNSFW, APIUtils.KIND_CROSSPOST, new SubmitPost.SubmitPostListener() { + content, flair, isSpoiler, isNSFW, receivePostReplyNotifications, APIUtils.KIND_CROSSPOST, + new SubmitPost.SubmitPostListener() { @Override public void submitSuccessful(Post post) { handler.post(() -> EventBus.getDefault().post(new SubmitCrosspostEvent(true, post, null))); @@ -230,11 +253,12 @@ public class SubmitPostService extends Service { }); } - private void submitImagePost(String accessToken, Uri mediaUri, String subredditName, String title, Flair flair, boolean isSpoiler, boolean isNSFW) { + private void submitImagePost(String accessToken, Uri mediaUri, String subredditName, String title, + Flair flair, boolean isSpoiler, boolean isNSFW, boolean receivePostReplyNotifications) { try { Bitmap resource = Glide.with(this).asBitmap().load(mediaUri).submit().get(); SubmitPost.submitImagePost(mExecutor, handler, mOauthRetrofit, mUploadMediaRetrofit, - accessToken, subredditName, title, resource, flair, isSpoiler, isNSFW, + accessToken, subredditName, title, resource, flair, isSpoiler, isNSFW, receivePostReplyNotifications, new SubmitPost.SubmitPostListener() { @Override public void submitSuccessful(Post post) { @@ -261,7 +285,7 @@ public class SubmitPostService extends Service { } private void submitVideoPost(String accessToken, Uri mediaUri, String subredditName, String title, - Flair flair, boolean isSpoiler, boolean isNSFW) { + Flair flair, boolean isSpoiler, boolean isNSFW, boolean receivePostReplyNotifications) { try { InputStream in = getContentResolver().openInputStream(mediaUri); String type = getContentResolver().getType(mediaUri); @@ -279,7 +303,8 @@ public class SubmitPostService extends Service { if (type != null) { SubmitPost.submitVideoPost(mExecutor, handler, mOauthRetrofit, mUploadMediaRetrofit, mUploadVideoRetrofit, accessToken, subredditName, title, new File(cacheFilePath), - type, resource, flair, isSpoiler, isNSFW, new SubmitPost.SubmitPostListener() { + type, resource, flair, isSpoiler, isNSFW, receivePostReplyNotifications, + new SubmitPost.SubmitPostListener() { @Override public void submitSuccessful(Post post) { handler.post(() -> { @@ -315,6 +340,42 @@ public class SubmitPostService extends Service { } } + private void submitGalleryPost(String accessToken, String payload) { + try { + Response<String> response = mOauthRetrofit.create(RedditAPI.class).submitGalleryPost(APIUtils.getOAuthHeader(accessToken), payload).execute(); + if (response.isSuccessful()) { + JSONObject responseObject = new JSONObject(response.body()).getJSONObject(JSONUtils.JSON_KEY); + if (responseObject.getJSONArray(JSONUtils.ERRORS_KEY).length() != 0) { + JSONArray error = responseObject.getJSONArray(JSONUtils.ERRORS_KEY) + .getJSONArray(responseObject.getJSONArray(JSONUtils.ERRORS_KEY).length() - 1); + if (error.length() != 0) { + String errorMessage; + if (error.length() >= 2) { + errorMessage = error.getString(1); + } else { + errorMessage = error.getString(0); + } + handler.post(() -> EventBus.getDefault().post(new SubmitGalleryPostEvent(false, null, errorMessage))); + } else { + handler.post(() -> EventBus.getDefault().post(new SubmitGalleryPostEvent(false, null, null))); + } + } else { + String postUrl = responseObject.getJSONObject(JSONUtils.DATA_KEY).getString(JSONUtils.URL_KEY); + handler.post(() -> { + EventBus.getDefault().post(new SubmitGalleryPostEvent(true, postUrl, null)); + }); + } + } else { + handler.post(() -> EventBus.getDefault().post(new SubmitGalleryPostEvent(false, null, response.message()))); + } + } catch (IOException | JSONException e) { + e.printStackTrace(); + handler.post(() -> EventBus.getDefault().post(new SubmitGalleryPostEvent(false, null, e.getMessage()))); + } finally { + stopService(); + } + } + private static void copyFileToCache(InputStream fileInputStream, String destinationFilePath) throws IOException { OutputStream out = new FileOutputStream(destinationFilePath); byte[] buf = new byte[2048]; diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/settings/AcknowledgementFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/settings/AcknowledgementFragment.java index 59adcf9d..2f2aa91e 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/settings/AcknowledgementFragment.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/settings/AcknowledgementFragment.java @@ -11,7 +11,6 @@ import android.view.ViewGroup; import androidx.annotation.NonNull; import androidx.fragment.app.Fragment; -import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; import java.util.ArrayList; @@ -20,6 +19,7 @@ import butterknife.BindView; import butterknife.ButterKnife; import ml.docilealligator.infinityforreddit.adapters.AcknowledgementRecyclerViewAdapter; import ml.docilealligator.infinityforreddit.R; +import ml.docilealligator.infinityforreddit.customviews.LinearLayoutManagerBugFixed; /** * A simple {@link Fragment} subclass. @@ -127,7 +127,7 @@ public class AcknowledgementFragment extends Fragment { Uri.parse("https://github.com/saket/Better-Link-Movement-Method"))); AcknowledgementRecyclerViewAdapter adapter = new AcknowledgementRecyclerViewAdapter(activity, acknowledgements); - recyclerView.setLayoutManager(new LinearLayoutManager(activity)); + recyclerView.setLayoutManager(new LinearLayoutManagerBugFixed(activity)); recyclerView.setAdapter(adapter); return rootView; diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/settings/CrashReportsFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/settings/CrashReportsFragment.java index 350addf8..6cb67a5f 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/settings/CrashReportsFragment.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/settings/CrashReportsFragment.java @@ -17,7 +17,6 @@ import androidx.annotation.NonNull; import androidx.appcompat.view.menu.MenuItemImpl; import androidx.core.graphics.drawable.DrawableCompat; import androidx.fragment.app.Fragment; -import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; import com.crazylegend.crashyreporter.CrashyReporter; @@ -49,7 +48,6 @@ public class CrashReportsFragment extends Fragment { setHasOptionsMenu(true); - recyclerView.setLayoutManager(new LinearLayoutManager(activity)); recyclerView.setAdapter(new CrashReportsRecyclerViewAdapter(CrashyReporter.INSTANCE.getLogsAsStrings())); return recyclerView; diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/settings/PostDetailsPreferenceFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/settings/PostDetailsPreferenceFragment.java new file mode 100644 index 00000000..2e0db830 --- /dev/null +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/settings/PostDetailsPreferenceFragment.java @@ -0,0 +1,18 @@ +package ml.docilealligator.infinityforreddit.settings; + +import android.os.Bundle; + +import androidx.preference.PreferenceFragmentCompat; +import androidx.preference.PreferenceManager; + +import ml.docilealligator.infinityforreddit.R; +import ml.docilealligator.infinityforreddit.utils.SharedPreferencesUtils; + +public class PostDetailsPreferenceFragment extends PreferenceFragmentCompat { + @Override + public void onCreatePreferences(Bundle savedInstanceState, String rootKey) { + PreferenceManager preferenceManager = getPreferenceManager(); + preferenceManager.setSharedPreferencesName(SharedPreferencesUtils.POST_DETAILS_SHARED_PREFERENCES_FILE); + setPreferencesFromResource(R.xml.post_details_preferences, rootKey); + } +} diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/settings/PostPreferenceFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/settings/PostPreferenceFragment.java index f3a4f30c..5b508a96 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/settings/PostPreferenceFragment.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/settings/PostPreferenceFragment.java @@ -11,6 +11,7 @@ import org.greenrobot.eventbus.EventBus; import ml.docilealligator.infinityforreddit.R; import ml.docilealligator.infinityforreddit.events.ChangeCompactLayoutToolbarHiddenByDefaultEvent; +import ml.docilealligator.infinityforreddit.events.ChangeDefaultLinkPostLayoutEvent; import ml.docilealligator.infinityforreddit.events.ChangeDefaultPostLayoutEvent; import ml.docilealligator.infinityforreddit.events.ChangeHidePostFlairEvent; import ml.docilealligator.infinityforreddit.events.ChangeHidePostTypeEvent; @@ -31,6 +32,7 @@ public class PostPreferenceFragment extends PreferenceFragmentCompat { setPreferencesFromResource(R.xml.post_preferences, rootKey); ListPreference defaultPostLayoutList = findPreference(SharedPreferencesUtils.DEFAULT_POST_LAYOUT_KEY); + ListPreference defaultLinkPostLayoutList = findPreference(SharedPreferencesUtils.DEFAULT_LINK_POST_LAYOUT_KEY); SwitchPreference showDividerInCompactLayoutSwitch = findPreference(SharedPreferencesUtils.SHOW_DIVIDER_IN_COMPACT_LAYOUT); SwitchPreference showThumbnailOnTheRightInCompactLayoutSwitch = findPreference(SharedPreferencesUtils.SHOW_THUMBNAIL_ON_THE_LEFT_IN_COMPACT_LAYOUT); SwitchPreference showAbsoluteNumberOfVotesSwitch = findPreference(SharedPreferencesUtils.SHOW_ABSOLUTE_NUMBER_OF_VOTES); @@ -50,6 +52,13 @@ public class PostPreferenceFragment extends PreferenceFragmentCompat { }); } + if (defaultLinkPostLayoutList != null) { + defaultLinkPostLayoutList.setOnPreferenceChangeListener((preference, newValue) -> { + EventBus.getDefault().post(new ChangeDefaultLinkPostLayoutEvent(Integer.parseInt((String) newValue))); + return true; + }); + } + if (showDividerInCompactLayoutSwitch != null) { showDividerInCompactLayoutSwitch.setOnPreferenceChangeListener((preference, newValue) -> { EventBus.getDefault().post(new ShowDividerInCompactLayoutPreferenceEvent((Boolean) newValue)); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/settings/SecurityPreferenceFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/settings/SecurityPreferenceFragment.java index cb6917c8..c4dd2b16 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/settings/SecurityPreferenceFragment.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/settings/SecurityPreferenceFragment.java @@ -1,5 +1,8 @@ package ml.docilealligator.infinityforreddit.settings; +import static androidx.biometric.BiometricManager.Authenticators.BIOMETRIC_STRONG; +import static androidx.biometric.BiometricManager.Authenticators.DEVICE_CREDENTIAL; + import android.content.Context; import android.content.SharedPreferences; import android.os.Bundle; @@ -18,14 +21,12 @@ import java.util.concurrent.Executor; import javax.inject.Inject; import javax.inject.Named; -import ml.docilealligator.infinityforreddit.events.ChangeRequireAuthToAccountSectionEvent; import ml.docilealligator.infinityforreddit.Infinity; import ml.docilealligator.infinityforreddit.R; +import ml.docilealligator.infinityforreddit.events.ChangeRequireAuthToAccountSectionEvent; +import ml.docilealligator.infinityforreddit.events.ToggleSecureModeEvent; import ml.docilealligator.infinityforreddit.utils.SharedPreferencesUtils; -import static androidx.biometric.BiometricManager.Authenticators.BIOMETRIC_STRONG; -import static androidx.biometric.BiometricManager.Authenticators.DEVICE_CREDENTIAL; - public class SecurityPreferenceFragment extends PreferenceFragmentCompat { private AppCompatActivity activity; @@ -40,6 +41,7 @@ public class SecurityPreferenceFragment extends PreferenceFragmentCompat { ((Infinity) activity.getApplication()).getAppComponent().inject(this); SwitchPreference requireAuthToAccountSectionSwitch = findPreference(SharedPreferencesUtils.REQUIRE_AUTHENTICATION_TO_GO_TO_ACCOUNT_SECTION_IN_NAVIGATION_DRAWER); + SwitchPreference secureModeSwitch = findPreference(SharedPreferencesUtils.SECURE_MODE); if (requireAuthToAccountSectionSwitch != null) { requireAuthToAccountSectionSwitch.setOnPreferenceChangeListener((preference, newValue) -> { @@ -47,6 +49,13 @@ public class SecurityPreferenceFragment extends PreferenceFragmentCompat { return true; }); } + + if (secureModeSwitch != null) { + secureModeSwitch.setOnPreferenceChangeListener((preference, newValue) -> { + EventBus.getDefault().post(new ToggleSecureModeEvent((Boolean) newValue)); + return true; + }); + } } @Override diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/settings/ThemePreferenceFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/settings/ThemePreferenceFragment.java index 9dafc175..0e0a8c7d 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/settings/ThemePreferenceFragment.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/settings/ThemePreferenceFragment.java @@ -1,5 +1,10 @@ package ml.docilealligator.infinityforreddit.settings; +import static androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_AUTO_BATTERY; +import static androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM; +import static androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_NO; +import static androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_YES; + import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; @@ -38,11 +43,6 @@ import ml.docilealligator.infinityforreddit.utils.CustomThemeSharedPreferencesUt import ml.docilealligator.infinityforreddit.utils.MaterialYouUtils; import ml.docilealligator.infinityforreddit.utils.SharedPreferencesUtils; -import static androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_AUTO_BATTERY; -import static androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM; -import static androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_NO; -import static androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_YES; - /** * A simple {@link Fragment} subclass. */ @@ -182,7 +182,7 @@ public class ThemePreferenceFragment extends PreferenceFragmentCompat { MaterialYouUtils.changeTheme(activity, executor, new Handler(), redditDataRoomDatabase, customThemeWrapper, lightThemeSharedPreferences, darkThemeSharedPreferences, - amoledThemeSharedPreferences); + amoledThemeSharedPreferences, null); applyMaterialYouPreference.setVisible(true); } else { applyMaterialYouPreference.setVisible(false); @@ -194,7 +194,7 @@ public class ThemePreferenceFragment extends PreferenceFragmentCompat { MaterialYouUtils.changeTheme(activity, executor, new Handler(), redditDataRoomDatabase, customThemeWrapper, lightThemeSharedPreferences, darkThemeSharedPreferences, - amoledThemeSharedPreferences); + amoledThemeSharedPreferences, null); return true; }); } diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/settings/TranslationFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/settings/TranslationFragment.java index a0f9cd1e..62f5c50a 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/settings/TranslationFragment.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/settings/TranslationFragment.java @@ -9,7 +9,6 @@ import android.view.ViewGroup; import androidx.annotation.NonNull; import androidx.fragment.app.Fragment; -import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; import javax.inject.Inject; @@ -44,7 +43,6 @@ public class TranslationFragment extends Fragment { ButterKnife.bind(this, rootView); TranslationFragmentRecyclerViewAdapter adapter = new TranslationFragmentRecyclerViewAdapter(activity, customThemeWrapper); - recyclerView.setLayoutManager(new LinearLayoutManager(activity)); recyclerView.setAdapter(adapter); return rootView; diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/settings/VideoPreferenceFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/settings/VideoPreferenceFragment.java index f7941534..6a89dcd6 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/settings/VideoPreferenceFragment.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/settings/VideoPreferenceFragment.java @@ -22,6 +22,7 @@ import javax.inject.Named; import ml.docilealligator.infinityforreddit.events.ChangeAutoplayNsfwVideosEvent; import ml.docilealligator.infinityforreddit.events.ChangeMuteAutoplayingVideosEvent; import ml.docilealligator.infinityforreddit.events.ChangeMuteNSFWVideoEvent; +import ml.docilealligator.infinityforreddit.events.ChangeRememberMutingOptionInPostFeedEvent; import ml.docilealligator.infinityforreddit.events.ChangeStartAutoplayVisibleAreaOffsetEvent; import ml.docilealligator.infinityforreddit.events.ChangeVideoAutoplayEvent; import ml.docilealligator.infinityforreddit.Infinity; @@ -43,6 +44,7 @@ public class VideoPreferenceFragment extends PreferenceFragmentCompat { ListPreference videoAutoplayListPreference = findPreference(SharedPreferencesUtils.VIDEO_AUTOPLAY); SwitchPreference muteAutoplayingVideosSwitchPreference = findPreference(SharedPreferencesUtils.MUTE_AUTOPLAYING_VIDEOS); + SwitchPreference rememberMutingOptionInPostFeedSwitchPreference = findPreference(SharedPreferencesUtils.REMEMBER_MUTING_OPTION_IN_POST_FEED); SwitchPreference muteNSFWVideosSwitchPreference = findPreference(SharedPreferencesUtils.MUTE_NSFW_VIDEO); SwitchPreference autoplayNsfwVideosSwitchPreference = findPreference(SharedPreferencesUtils.AUTOPLAY_NSFW_VIDEOS); SeekBarPreference startAutoplayVisibleAreaOffsetPortrait = findPreference(SharedPreferencesUtils.START_AUTOPLAY_VISIBLE_AREA_OFFSET_PORTRAIT); @@ -74,6 +76,13 @@ public class VideoPreferenceFragment extends PreferenceFragmentCompat { }); } + if (rememberMutingOptionInPostFeedSwitchPreference != null) { + rememberMutingOptionInPostFeedSwitchPreference.setOnPreferenceChangeListener((preference, newValue) -> { + EventBus.getDefault().post(new ChangeRememberMutingOptionInPostFeedEvent((Boolean) newValue)); + return true; + }); + } + int orientation = getResources().getConfiguration().orientation; if (startAutoplayVisibleAreaOffsetPortrait != null) { diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/utils/APIUtils.java b/app/src/main/java/ml/docilealligator/infinityforreddit/utils/APIUtils.java index 5ad14398..465a31eb 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/utils/APIUtils.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/utils/APIUtils.java @@ -73,6 +73,7 @@ public class APIUtils { public static final String SPOILER_KEY = "spoiler"; public static final String NSFW_KEY = "nsfw"; public static final String CROSSPOST_FULLNAME_KEY = "crosspost_fullname"; + public static final String SEND_REPLIES_KEY = "sendreplies"; public static final String KIND_KEY = "kind"; public static final String KIND_SELF = "self"; public static final String KIND_LINK = "link"; diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/utils/JSONUtils.java b/app/src/main/java/ml/docilealligator/infinityforreddit/utils/JSONUtils.java index 027d69dd..b76f198e 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/utils/JSONUtils.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/utils/JSONUtils.java @@ -164,4 +164,11 @@ public class JSONUtils { public static final String ESTIMATED_REMAINING_TIME_KEY = "estimated_remaining_time"; public static final String PAYLOAD_KEY = "payload"; public static final String AUTHOR_ICON_IMAGE = "author_icon_img"; + public static final String ASSET_KEY = "asset"; + public static final String ASSET_ID_KEY = "asset_id"; + public static final String TRENDING_SEARCHES_KEY = "trending_searches"; + public static final String QUERY_STRING_KEY = "query_string"; + public static final String DISPLAY_STRING_KEY = "display_string"; + public static final String RESULTS_KEY = "results"; + public static final String CONTENT_MD_KEY = "content_md"; } diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/utils/MaterialYouUtils.java b/app/src/main/java/ml/docilealligator/infinityforreddit/utils/MaterialYouUtils.java index 37e92aa1..d470e1d0 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/utils/MaterialYouUtils.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/utils/MaterialYouUtils.java @@ -9,6 +9,7 @@ import android.os.Build; import android.os.Handler; import androidx.annotation.ColorInt; +import androidx.annotation.Nullable; import org.greenrobot.eventbus.EventBus; @@ -44,27 +45,28 @@ public class MaterialYouUtils { CustomThemeWrapper customThemeWrapper, SharedPreferences lightThemeSharedPreferences, SharedPreferences darkThemeSharedPreferences, - SharedPreferences amoledThemeSharedPreferences) { + SharedPreferences amoledThemeSharedPreferences, + @Nullable MaterialYouListener materialYouListener) { executor.execute(() -> { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O_MR1) { WallpaperManager wallpaperManager = WallpaperManager.getInstance(context); WallpaperColors wallpaperColors = wallpaperManager.getWallpaperColors(WallpaperManager.FLAG_SYSTEM); if (wallpaperColors != null) { - CustomTheme lightTheme = CustomThemeWrapper.getIndigo(context); - CustomTheme darkTheme = CustomThemeWrapper.getIndigoDark(context); - CustomTheme amoledTheme = CustomThemeWrapper.getIndigoAmoled(context); - - int colorPrimaryInt = shiftColorTo255(wallpaperColors.getPrimaryColor().toArgb(), 0.4); - int colorPrimaryDarkInt = shiftColorTo0(colorPrimaryInt, 0.3); - int backgroundColor = shiftColorTo255(colorPrimaryInt, 0.6); - int cardViewBackgroundColor = shiftColorTo255(colorPrimaryInt, 0.9); + int colorPrimaryInt = lightenColor(wallpaperColors.getPrimaryColor().toArgb(), 0.4); + int colorPrimaryDarkInt = darkenColor(colorPrimaryInt, 0.3); + int backgroundColor = lightenColor(colorPrimaryInt, 0.2); + int cardViewBackgroundColor = lightenColor(colorPrimaryInt, 0.6); Color colorAccent = wallpaperColors.getSecondaryColor(); - int colorAccentInt = shiftColorTo255(colorAccent == null ? customThemeWrapper.getColorAccent() : colorAccent.toArgb(), 0.4); + int colorAccentInt = lightenColor(colorAccent == null ? customThemeWrapper.getColorAccent() : colorAccent.toArgb(), 0.4); int colorPrimaryAppropriateTextColor = getAppropriateTextColor(colorPrimaryInt); int backgroundColorAppropriateTextColor = getAppropriateTextColor(backgroundColor); + CustomTheme lightTheme = CustomThemeWrapper.getIndigo(context); + CustomTheme darkTheme = CustomThemeWrapper.getIndigoDark(context); + CustomTheme amoledTheme = CustomThemeWrapper.getIndigoAmoled(context); + lightTheme.colorPrimary = colorPrimaryInt; lightTheme.colorPrimaryDark = colorPrimaryDarkInt; lightTheme.colorAccent = colorAccentInt; @@ -76,6 +78,7 @@ public class MaterialYouUtils { lightTheme.bottomAppBarBackgroundColor = colorPrimaryInt; lightTheme.navBarColor = colorPrimaryInt; lightTheme.primaryTextColor = backgroundColorAppropriateTextColor; + lightTheme.secondaryTextColor = backgroundColorAppropriateTextColor == Color.BLACK ? Color.parseColor("#8A000000") : Color.parseColor("#B3FFFFFF"); lightTheme.bottomAppBarIconColor = colorPrimaryAppropriateTextColor; lightTheme.primaryIconColor = backgroundColorAppropriateTextColor; lightTheme.fabIconColor = colorPrimaryAppropriateTextColor; @@ -88,7 +91,11 @@ public class MaterialYouUtils { lightTheme.tabLayoutWithExpandedCollapsingToolbarTabIndicator = colorPrimaryAppropriateTextColor; lightTheme.tabLayoutWithExpandedCollapsingToolbarTextColor = colorPrimaryAppropriateTextColor; lightTheme.circularProgressBarBackground = colorPrimaryInt; - lightTheme.isLightStatusBar = getAppropriateTextColor(colorPrimaryInt) == Color.toArgb(Color.BLACK); + lightTheme.dividerColor = backgroundColorAppropriateTextColor == Color.BLACK ? Color.parseColor("#E0E0E0") : Color.parseColor("69666C"); + lightTheme.isLightStatusBar = colorPrimaryAppropriateTextColor == Color.BLACK; + lightTheme.isChangeStatusBarIconColorAfterToolbarCollapsedInImmersiveInterface = + (lightTheme.isLightStatusBar && getAppropriateTextColor(cardViewBackgroundColor) == Color.WHITE) + || (!lightTheme.isLightStatusBar && getAppropriateTextColor(cardViewBackgroundColor) == Color.BLACK); lightTheme.name = "Material You"; darkTheme.colorAccent = colorPrimaryInt; @@ -111,24 +118,27 @@ public class MaterialYouUtils { CustomThemeSharedPreferencesUtils.insertThemeToSharedPreferences(darkTheme, darkThemeSharedPreferences); CustomThemeSharedPreferencesUtils.insertThemeToSharedPreferences(amoledTheme, amoledThemeSharedPreferences); - handler.post(() -> EventBus.getDefault().post(new RecreateActivityEvent())); + handler.post(() -> { + if (materialYouListener != null) { + materialYouListener.applied(); + } + EventBus.getDefault().post(new RecreateActivityEvent()); + }); } } }); } - private static int shiftColorTo255(int color, double ratio) { - int offset = (int) (Math.min(Math.min(255 - Color.red(color), 255 - Color.green(color)), 255 - Color.blue(color)) * ratio); - return Color.argb(Color.alpha(color), Color.red(color) + offset, - Color.green(color) + offset, - Color.blue(color) + offset); + private static int lightenColor(int color, double ratio) { + return Color.argb(Color.alpha(color), (int) (Color.red(color) + (255 - Color.red(color)) * ratio), + (int) (Color.green(color) + (255 - Color.green(color)) * ratio), + (int) (Color.blue(color) + (255 - Color.blue(color)) * ratio)); } - private static int shiftColorTo0(int color, double ratio) { - int offset = (int) (Math.min(Math.min(Color.red(color), Color.green(color)), Color.blue(color)) * ratio); - return Color.argb(Color.alpha(color), Color.red(color) - offset, - Color.green(color) - offset, - Color.blue(color) - offset); + private static int darkenColor(int color, double ratio) { + return Color.argb(Color.alpha(color), (int) (Color.red(color) * (1 - ratio)), + (int) (Color.green(color) * (1 - ratio)), + (int) (Color.blue(color) * (1 - ratio))); } @@ -138,4 +148,8 @@ public class MaterialYouUtils { double luminance = 1 - (0.299 * Color.red(color) + 0.587 * Color.green(color) + 0.114 * Color.blue(color)) / 255; return luminance < 0.5 ? Color.BLACK : Color.WHITE; } + + public interface MaterialYouListener { + void applied(); + } } diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/utils/NotificationUtils.java b/app/src/main/java/ml/docilealligator/infinityforreddit/utils/NotificationUtils.java index 3c3255de..5552271f 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/utils/NotificationUtils.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/utils/NotificationUtils.java @@ -22,11 +22,14 @@ public class NotificationUtils { public static final String CHANNEL_DOWNLOAD_IMAGE = "Download Image"; public static final String CHANNEL_ID_DOWNLOAD_GIF = "download_gif"; public static final String CHANNEL_DOWNLOAD_GIF = "Download Gif"; + public static final String CHANNEL_ID_MATERIAL_YOU = "material_you"; + public static final String CHANNEL_MATERIAL_YOU = "Material You"; public static final int SUBMIT_POST_SERVICE_NOTIFICATION_ID = 10000; public static final int DOWNLOAD_REDDIT_VIDEO_NOTIFICATION_ID = 20000; public static final int DOWNLOAD_VIDEO_NOTIFICATION_ID = 30000; public static final int DOWNLOAD_IMAGE_NOTIFICATION_ID = 40000; public static final int DOWNLOAD_GIF_NOTIFICATION_ID = 50000; + public static final int MATERIAL_YOU_NOTIFICATION_ID = 60000; private static final int SUMMARY_BASE_ID_UNREAD_MESSAGE = 0; private static final int NOTIFICATION_BASE_ID_UNREAD_MESSAGE = 1; diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/utils/SharedPreferencesUtils.java b/app/src/main/java/ml/docilealligator/infinityforreddit/utils/SharedPreferencesUtils.java index 82343e4f..f3247d99 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/utils/SharedPreferencesUtils.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/utils/SharedPreferencesUtils.java @@ -182,6 +182,11 @@ public class SharedPreferencesUtils { public static final String SHOW_ONLY_ONE_COMMENT_LEVEL_INDICATOR = "show_only_one_comment_level_indicator"; public static final String ENABLE_MATERIAL_YOU = "enable_material_you"; public static final String APPLY_MATERIAL_YOU = "apply_material_you"; + public static final String VIDEO_PLAYER_AUTOMATIC_LANDSCAPE_ORIENTATION = "video_player_automatic_landscape_orientation"; + public static final String REMEMBER_MUTING_OPTION_IN_POST_FEED = "remember_muting_option_in_post_feed"; + public static final String DEFAULT_LINK_POST_LAYOUT_KEY = "default_link_post_layout"; + public static final String USE_BOTTOM_TOOLBAR_IN_MEDIA_VIEWER = "use_bottom_toolbar_in_media_viewer"; + public static final String SECURE_MODE = "secure_mode"; public static final String DEFAULT_PREFERENCES_FILE = "ml.docilealligator.infinityforreddit_preferences"; public static final String MAIN_PAGE_TABS_SHARED_PREFERENCES_FILE = "ml.docilealligator.infinityforreddit.main_page_tabs"; @@ -308,6 +313,7 @@ public class SharedPreferencesUtils { public static final String NAVIGATION_DRAWER_SHARED_PREFERENCES_FILE = "ml.docilealligator.infinityforreddit.navigation_drawer"; public static final String COLLAPSE_ACCOUNT_SECTION = "collapse_account_section"; + public static final String COLLAPSE_REDDIT_SECTION = "collapse_reddit_section"; public static final String COLLAPSE_POST_SECTION = "collapse_post_section"; public static final String COLLAPSE_PREFERENCES_SECTION = "collapse_preferences_section"; public static final String COLLAPSE_FAVORITE_SUBREDDITS_SECTION = "collapse_favorite_subreddits_section"; @@ -315,6 +321,10 @@ public class SharedPreferencesUtils { public static final String HIDE_FAVORITE_SUBREDDITS_SECTION = "hide_favorite_subreddits_sections"; public static final String HIDE_SUBSCRIBED_SUBREDDITS_SECTIONS = "hide_subscribed_subreddits_sections"; + public static final String POST_DETAILS_SHARED_PREFERENCES_FILE = "ml.docilealligator.infinityforreddit.post_details"; + public static final String SEPARATE_POST_AND_COMMENTS_IN_PORTRAIT_MODE = "separate_post_and_comments_in_portrait_mode"; + public static final String SEPARATE_POST_AND_COMMENTS_IN_LANDSCAPE_MODE = "separate_post_and_comments_in_landscape_mode"; + //Legacy Settings public static final String MAIN_PAGE_TAB_1_TITLE_LEGACY = "main_page_tab_1_title"; public static final String MAIN_PAGE_TAB_2_TITLE_LEGACY = "main_page_tab_2_title"; diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/utils/UploadImageUtils.java b/app/src/main/java/ml/docilealligator/infinityforreddit/utils/UploadImageUtils.java index 4eff065d..c7b5f728 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/utils/UploadImageUtils.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/utils/UploadImageUtils.java @@ -28,7 +28,13 @@ import retrofit2.Retrofit; public class UploadImageUtils { @Nullable public static String uploadImage(Retrofit oauthRetrofit, Retrofit uploadMediaRetrofit, - String accessToken, Bitmap image) throws IOException, JSONException, XmlPullParserException { + String accessToken, Bitmap image) throws IOException, JSONException, XmlPullParserException { + return uploadImage(oauthRetrofit, uploadMediaRetrofit, accessToken, image, false); + } + + @Nullable + public static String uploadImage(Retrofit oauthRetrofit, Retrofit uploadMediaRetrofit, + String accessToken, Bitmap image, boolean returnResponseForGallerySubmission) throws IOException, JSONException, XmlPullParserException { RedditAPI api = oauthRetrofit.create(RedditAPI.class); Map<String, String> uploadImageParams = new HashMap<>(); @@ -51,6 +57,9 @@ public class UploadImageUtils { Call<String> uploadMediaToAWS = uploadMediaToAWSApi.uploadMediaToAWS(nameValuePairsMap, fileToUpload); Response<String> uploadMediaToAWSResponse = uploadMediaToAWS.execute(); if (uploadMediaToAWSResponse.isSuccessful()) { + if (returnResponseForGallerySubmission) { + return uploadImageResponse.body(); + } return parseXMLResponseFromAWS(uploadMediaToAWSResponse.body()); } else { return "Error: " + uploadMediaToAWSResponse.code(); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/utils/Utils.java b/app/src/main/java/ml/docilealligator/infinityforreddit/utils/Utils.java index e01f41cd..ad2b7405 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/utils/Utils.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/utils/Utils.java @@ -220,15 +220,17 @@ public class Utils { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { Network nw = connMgr.getActiveNetwork(); if (nw == null) return NETWORK_TYPE_OTHER; - NetworkCapabilities actNw = connMgr.getNetworkCapabilities(nw); - if (actNw != null) { - if (actNw.hasTransport(NetworkCapabilities.TRANSPORT_WIFI)) { - return NETWORK_TYPE_WIFI; - } - if (actNw.hasTransport(NetworkCapabilities.TRANSPORT_CELLULAR)) { - return NETWORK_TYPE_CELLULAR; + try { + NetworkCapabilities actNw = connMgr.getNetworkCapabilities(nw); + if (actNw != null) { + if (actNw.hasTransport(NetworkCapabilities.TRANSPORT_WIFI)) { + return NETWORK_TYPE_WIFI; + } + if (actNw.hasTransport(NetworkCapabilities.TRANSPORT_CELLULAR)) { + return NETWORK_TYPE_CELLULAR; + } } - } + } catch (SecurityException ignore) {} return NETWORK_TYPE_OTHER; } else { boolean isWifi = false; @@ -311,6 +313,13 @@ public class Utils { } public static void hideKeyboard(Activity activity) { + /*if (activity.getCurrentFocus() == null || !(activity.getCurrentFocus() instanceof EditText)) { + editText.requestFocus(); + } + InputMethodManager imm = (InputMethodManager) activity.getSystemService(Context.INPUT_METHOD_SERVICE); + imm.hideSoftInputFromWindow(editText.getWindowToken(), 0); + activity.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);*/ + InputMethodManager inputMethodManager = (InputMethodManager) activity.getSystemService(Activity.INPUT_METHOD_SERVICE); if (inputMethodManager != null && activity.getCurrentFocus() != null) { inputMethodManager.hideSoftInputFromWindow(activity.getCurrentFocus().getWindowToken(), 0); diff --git a/app/src/main/res/drawable-night/ic_gallery_24dp.xml b/app/src/main/res/drawable-night/ic_gallery_24dp.xml index 74716ba7..d54dba10 100644 --- a/app/src/main/res/drawable-night/ic_gallery_24dp.xml +++ b/app/src/main/res/drawable-night/ic_gallery_24dp.xml @@ -1,4 +1,4 @@ -<vector android:height="24dp" android:tint="#000000" +<vector android:height="24dp" android:tint="#FFFFFF" android:viewportHeight="24" android:viewportWidth="24" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android"> <path android:fillColor="@android:color/white" android:pathData="M20,4v12L8,16L8,4h12m0,-2L8,2c-1.1,0 -2,0.9 -2,2v12c0,1.1 0.9,2 2,2h12c1.1,0 2,-0.9 2,-2L22,4c0,-1.1 -0.9,-2 -2,-2zM11.5,11.67l1.69,2.26 2.48,-3.1L19,15L9,15zM2,6v14c0,1.1 0.9,2 2,2h14v-2L4,20L4,6L2,6z"/> diff --git a/app/src/main/res/drawable-night/ic_gallery_reverse_color_24dp.xml b/app/src/main/res/drawable-night/ic_gallery_reverse_color_24dp.xml new file mode 100644 index 00000000..74716ba7 --- /dev/null +++ b/app/src/main/res/drawable-night/ic_gallery_reverse_color_24dp.xml @@ -0,0 +1,5 @@ +<vector android:height="24dp" android:tint="#000000" + android:viewportHeight="24" android:viewportWidth="24" + android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android"> + <path android:fillColor="@android:color/white" android:pathData="M20,4v12L8,16L8,4h12m0,-2L8,2c-1.1,0 -2,0.9 -2,2v12c0,1.1 0.9,2 2,2h12c1.1,0 2,-0.9 2,-2L22,4c0,-1.1 -0.9,-2 -2,-2zM11.5,11.67l1.69,2.26 2.48,-3.1L19,15L9,15zM2,6v14c0,1.1 0.9,2 2,2h14v-2L4,20L4,6L2,6z"/> +</vector> diff --git a/app/src/main/res/drawable-night/ic_outline_add_a_photo_day_night_24dp.xml b/app/src/main/res/drawable-night/ic_outline_add_a_photo_day_night_24dp.xml new file mode 100644 index 00000000..57869fc5 --- /dev/null +++ b/app/src/main/res/drawable-night/ic_outline_add_a_photo_day_night_24dp.xml @@ -0,0 +1,9 @@ +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="24dp" + android:height="24dp" + android:viewportWidth="24" + android:viewportHeight="24"> + <path + android:fillColor="#FFFFFF" + android:pathData="M21,6h-3.17L16,4h-6v2h5.12l1.83,2L21,8v12L5,20v-9L3,11v9c0,1.1 0.9,2 2,2h16c1.1,0 2,-0.9 2,-2L23,8c0,-1.1 -0.9,-2 -2,-2zM8,14c0,2.76 2.24,5 5,5s5,-2.24 5,-5 -2.24,-5 -5,-5 -5,2.24 -5,5zM13,11c1.65,0 3,1.35 3,3s-1.35,3 -3,3 -3,-1.35 -3,-3 1.35,-3 3,-3zM5,6h3L8,4L5,4L5,1L3,1v3L0,4v2h3v3h2z"/> +</vector> diff --git a/app/src/main/res/drawable-night/ic_outline_select_photo_day_night_24dp.xml b/app/src/main/res/drawable-night/ic_outline_select_photo_day_night_24dp.xml new file mode 100644 index 00000000..136ace9f --- /dev/null +++ b/app/src/main/res/drawable-night/ic_outline_select_photo_day_night_24dp.xml @@ -0,0 +1,9 @@ +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="24dp" + android:height="24dp" + android:viewportWidth="24" + android:viewportHeight="24"> + <path + android:fillColor="#FFFFFF" + android:pathData="M18,20L4,20L4,6h9L13,4L4,4c-1.1,0 -2,0.9 -2,2v14c0,1.1 0.9,2 2,2h14c1.1,0 2,-0.9 2,-2v-9h-2v9zM10.21,16.83l-1.96,-2.36L5.5,18h11l-3.54,-4.71zM20,4L20,1h-2v3h-3c0.01,0.01 0,2 0,2h3v2.99c0.01,0.01 2,0 2,0L20,6h3L23,4h-3z"/> +</vector> diff --git a/app/src/main/res/drawable-night/ic_rpan_24dp.xml b/app/src/main/res/drawable-night/ic_rpan_24dp.xml new file mode 100644 index 00000000..1c8156c1 --- /dev/null +++ b/app/src/main/res/drawable-night/ic_rpan_24dp.xml @@ -0,0 +1,9 @@ +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="24dp" + android:height="24dp" + android:viewportWidth="24" + android:viewportHeight="24"> + <path + android:fillColor="@android:color/white" + android:pathData="M21,6h-7.59l3.29,-3.29L16,2l-4,4 -4,-4 -0.71,0.71L10.59,6L3,6c-1.1,0 -2,0.89 -2,2v12c0,1.1 0.9,2 2,2h18c1.1,0 2,-0.9 2,-2L23,8c0,-1.11 -0.9,-2 -2,-2zM21,20L3,20L3,8h18v12zM9,10v8l7,-4z"/> +</vector> diff --git a/app/src/main/res/drawable-night/ic_trending_24dp.xml b/app/src/main/res/drawable-night/ic_trending_24dp.xml new file mode 100644 index 00000000..d441a7f7 --- /dev/null +++ b/app/src/main/res/drawable-night/ic_trending_24dp.xml @@ -0,0 +1,9 @@ +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="24dp" + android:height="24dp" + android:viewportWidth="24" + android:viewportHeight="24"> + <path + android:fillColor="@android:color/white" + android:pathData="M16,6l2.29,2.29 -4.88,4.88 -4,-4L2,16.59 3.41,18l6,-6 4,4 6.3,-6.29L22,12V6z"/> +</vector> diff --git a/app/src/main/res/drawable/background_autoplay.xml b/app/src/main/res/drawable/background_autoplay.xml index 8859f467..fd34b51c 100644 --- a/app/src/main/res/drawable/background_autoplay.xml +++ b/app/src/main/res/drawable/background_autoplay.xml @@ -1,11 +1,11 @@ <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" > - <solid - android:color="#80000000" /> + <solid + android:color="#40000000" /> - <corners - android:topLeftRadius="16dp" - android:topRightRadius="16dp" /> + <corners + android:topLeftRadius="16dp" + android:topRightRadius="16dp" /> -</shape> +</shape>
\ No newline at end of file diff --git a/app/src/main/res/drawable/exo_player_control_button_circular_background.xml b/app/src/main/res/drawable/exo_player_control_button_circular_background.xml new file mode 100644 index 00000000..363fffc1 --- /dev/null +++ b/app/src/main/res/drawable/exo_player_control_button_circular_background.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="utf-8"?> +<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval" > + <size android:width="16dp" android:height="16dp"/> + <solid + android:color="#40000000" /> +</shape>
\ No newline at end of file diff --git a/app/src/main/res/drawable/ic_close_24dp.xml b/app/src/main/res/drawable/ic_close_24dp.xml new file mode 100644 index 00000000..a20716a2 --- /dev/null +++ b/app/src/main/res/drawable/ic_close_24dp.xml @@ -0,0 +1,9 @@ +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="24dp" + android:height="24dp" + android:viewportWidth="24" + android:viewportHeight="24"> + <path + android:fillColor="@android:color/white" + android:pathData="M19,6.41L17.59,5 12,10.59 6.41,5 5,6.41 10.59,12 5,17.59 6.41,19 12,13.41 17.59,19 19,17.59 13.41,12z"/> +</vector> diff --git a/app/src/main/res/drawable/ic_fullscreen_white_rounded_18dp.xml b/app/src/main/res/drawable/ic_fullscreen_white_rounded_24dp.xml index 9977b60f..0dbedfee 100644 --- a/app/src/main/res/drawable/ic_fullscreen_white_rounded_18dp.xml +++ b/app/src/main/res/drawable/ic_fullscreen_white_rounded_24dp.xml @@ -1,9 +1,9 @@ <vector xmlns:android="http://schemas.android.com/apk/res/android" - android:width="18dp" - android:height="18dp" + android:width="24dp" + android:height="24dp" android:viewportWidth="24" android:viewportHeight="24"> <path - android:pathData="M6,14c-0.55,0 -1,0.45 -1,1v3c0,0.55 0.45,1 1,1h3c0.55,0 1,-0.45 1,-1s-0.45,-1 -1,-1L7,17v-2c0,-0.55 -0.45,-1 -1,-1zM6,10c0.55,0 1,-0.45 1,-1L7,7h2c0.55,0 1,-0.45 1,-1s-0.45,-1 -1,-1L6,5c-0.55,0 -1,0.45 -1,1v3c0,0.55 0.45,1 1,1zM17,17h-2c-0.55,0 -1,0.45 -1,1s0.45,1 1,1h3c0.55,0 1,-0.45 1,-1v-3c0,-0.55 -0.45,-1 -1,-1s-1,0.45 -1,1v2zM14,6c0,0.55 0.45,1 1,1h2v2c0,0.55 0.45,1 1,1s1,-0.45 1,-1L19,6c0,-0.55 -0.45,-1 -1,-1h-3c-0.55,0 -1,0.45 -1,1z" - android:fillColor="#FFFFFF"/> + android:fillColor="@android:color/white" + android:pathData="M6,14c-0.55,0 -1,0.45 -1,1v3c0,0.55 0.45,1 1,1h3c0.55,0 1,-0.45 1,-1s-0.45,-1 -1,-1L7,17v-2c0,-0.55 -0.45,-1 -1,-1zM6,10c0.55,0 1,-0.45 1,-1L7,7h2c0.55,0 1,-0.45 1,-1s-0.45,-1 -1,-1L6,5c-0.55,0 -1,0.45 -1,1v3c0,0.55 0.45,1 1,1zM17,17h-2c-0.55,0 -1,0.45 -1,1s0.45,1 1,1h3c0.55,0 1,-0.45 1,-1v-3c0,-0.55 -0.45,-1 -1,-1s-1,0.45 -1,1v2zM14,6c0,0.55 0.45,1 1,1h2v2c0,0.55 0.45,1 1,1s1,-0.45 1,-1L19,6c0,-0.55 -0.45,-1 -1,-1h-3c-0.55,0 -1,0.45 -1,1z"/> </vector> diff --git a/app/src/main/res/drawable/ic_gallery_24dp.xml b/app/src/main/res/drawable/ic_gallery_24dp.xml index d54dba10..74716ba7 100644 --- a/app/src/main/res/drawable/ic_gallery_24dp.xml +++ b/app/src/main/res/drawable/ic_gallery_24dp.xml @@ -1,4 +1,4 @@ -<vector android:height="24dp" android:tint="#FFFFFF" +<vector android:height="24dp" android:tint="#000000" android:viewportHeight="24" android:viewportWidth="24" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android"> <path android:fillColor="@android:color/white" android:pathData="M20,4v12L8,16L8,4h12m0,-2L8,2c-1.1,0 -2,0.9 -2,2v12c0,1.1 0.9,2 2,2h12c1.1,0 2,-0.9 2,-2L22,4c0,-1.1 -0.9,-2 -2,-2zM11.5,11.67l1.69,2.26 2.48,-3.1L19,15L9,15zM2,6v14c0,1.1 0.9,2 2,2h14v-2L4,20L4,6L2,6z"/> diff --git a/app/src/main/res/drawable/ic_gallery_reverse_color_24dp.xml b/app/src/main/res/drawable/ic_gallery_reverse_color_24dp.xml new file mode 100644 index 00000000..d54dba10 --- /dev/null +++ b/app/src/main/res/drawable/ic_gallery_reverse_color_24dp.xml @@ -0,0 +1,5 @@ +<vector android:height="24dp" android:tint="#FFFFFF" + android:viewportHeight="24" android:viewportWidth="24" + android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android"> + <path android:fillColor="@android:color/white" android:pathData="M20,4v12L8,16L8,4h12m0,-2L8,2c-1.1,0 -2,0.9 -2,2v12c0,1.1 0.9,2 2,2h12c1.1,0 2,-0.9 2,-2L22,4c0,-1.1 -0.9,-2 -2,-2zM11.5,11.67l1.69,2.26 2.48,-3.1L19,15L9,15zM2,6v14c0,1.1 0.9,2 2,2h14v-2L4,20L4,6L2,6z"/> +</vector> diff --git a/app/src/main/res/drawable/ic_mute_white_rounded_18dp.xml b/app/src/main/res/drawable/ic_mute_white_rounded_24dp.xml index b4f8f660..bc45d400 100644 --- a/app/src/main/res/drawable/ic_mute_white_rounded_18dp.xml +++ b/app/src/main/res/drawable/ic_mute_white_rounded_24dp.xml @@ -1,9 +1,9 @@ <vector xmlns:android="http://schemas.android.com/apk/res/android" - android:width="18dp" - android:height="18dp" + android:width="24dp" + android:height="24dp" android:viewportWidth="24" android:viewportHeight="24"> <path - android:pathData="M3.63,3.63c-0.39,0.39 -0.39,1.02 0,1.41L7.29,8.7 7,9L4,9c-0.55,0 -1,0.45 -1,1v4c0,0.55 0.45,1 1,1h3l3.29,3.29c0.63,0.63 1.71,0.18 1.71,-0.71v-4.17l4.18,4.18c-0.49,0.37 -1.02,0.68 -1.6,0.91 -0.36,0.15 -0.58,0.53 -0.58,0.92 0,0.72 0.73,1.18 1.39,0.91 0.8,-0.33 1.55,-0.77 2.22,-1.31l1.34,1.34c0.39,0.39 1.02,0.39 1.41,0 0.39,-0.39 0.39,-1.02 0,-1.41L5.05,3.63c-0.39,-0.39 -1.02,-0.39 -1.42,0zM19,12c0,0.82 -0.15,1.61 -0.41,2.34l1.53,1.53c0.56,-1.17 0.88,-2.48 0.88,-3.87 0,-3.83 -2.4,-7.11 -5.78,-8.4 -0.59,-0.23 -1.22,0.23 -1.22,0.86v0.19c0,0.38 0.25,0.71 0.61,0.85C17.18,6.54 19,9.06 19,12zM10.29,5.71l-0.17,0.17L12,7.76L12,6.41c0,-0.89 -1.08,-1.33 -1.71,-0.7zM16.5,12c0,-1.77 -1.02,-3.29 -2.5,-4.03v1.79l2.48,2.48c0.01,-0.08 0.02,-0.16 0.02,-0.24z" - android:fillColor="#ffffff"/> + android:fillColor="@android:color/white" + android:pathData="M3.63,3.63c-0.39,0.39 -0.39,1.02 0,1.41L7.29,8.7 7,9L4,9c-0.55,0 -1,0.45 -1,1v4c0,0.55 0.45,1 1,1h3l3.29,3.29c0.63,0.63 1.71,0.18 1.71,-0.71v-4.17l4.18,4.18c-0.49,0.37 -1.02,0.68 -1.6,0.91 -0.36,0.15 -0.58,0.53 -0.58,0.92 0,0.72 0.73,1.18 1.39,0.91 0.8,-0.33 1.55,-0.77 2.22,-1.31l1.34,1.34c0.39,0.39 1.02,0.39 1.41,0 0.39,-0.39 0.39,-1.02 0,-1.41L5.05,3.63c-0.39,-0.39 -1.02,-0.39 -1.42,0zM19,12c0,0.82 -0.15,1.61 -0.41,2.34l1.53,1.53c0.56,-1.17 0.88,-2.48 0.88,-3.87 0,-3.83 -2.4,-7.11 -5.78,-8.4 -0.59,-0.23 -1.22,0.23 -1.22,0.86v0.19c0,0.38 0.25,0.71 0.61,0.85C17.18,6.54 19,9.06 19,12zM10.29,5.71l-0.17,0.17L12,7.76L12,6.41c0,-0.89 -1.08,-1.33 -1.71,-0.7zM16.5,12c0,-1.77 -1.02,-3.29 -2.5,-4.03v1.79l2.48,2.48c0.01,-0.08 0.02,-0.16 0.02,-0.24z"/> </vector> diff --git a/app/src/main/res/drawable/ic_outline_add_a_photo_day_night_24dp.xml b/app/src/main/res/drawable/ic_outline_add_a_photo_day_night_24dp.xml new file mode 100644 index 00000000..98c1ac80 --- /dev/null +++ b/app/src/main/res/drawable/ic_outline_add_a_photo_day_night_24dp.xml @@ -0,0 +1,9 @@ +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="24dp" + android:height="24dp" + android:viewportWidth="24" + android:viewportHeight="24"> + <path + android:fillColor="#FF000000" + android:pathData="M21,6h-3.17L16,4h-6v2h5.12l1.83,2L21,8v12L5,20v-9L3,11v9c0,1.1 0.9,2 2,2h16c1.1,0 2,-0.9 2,-2L23,8c0,-1.1 -0.9,-2 -2,-2zM8,14c0,2.76 2.24,5 5,5s5,-2.24 5,-5 -2.24,-5 -5,-5 -5,2.24 -5,5zM13,11c1.65,0 3,1.35 3,3s-1.35,3 -3,3 -3,-1.35 -3,-3 1.35,-3 3,-3zM5,6h3L8,4L5,4L5,1L3,1v3L0,4v2h3v3h2z"/> +</vector> diff --git a/app/src/main/res/drawable/ic_outline_select_photo_day_night_24dp.xml b/app/src/main/res/drawable/ic_outline_select_photo_day_night_24dp.xml new file mode 100644 index 00000000..9551f621 --- /dev/null +++ b/app/src/main/res/drawable/ic_outline_select_photo_day_night_24dp.xml @@ -0,0 +1,9 @@ +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="24dp" + android:height="24dp" + android:viewportWidth="24" + android:viewportHeight="24"> + <path + android:fillColor="#FF000000" + android:pathData="M18,20L4,20L4,6h9L13,4L4,4c-1.1,0 -2,0.9 -2,2v14c0,1.1 0.9,2 2,2h14c1.1,0 2,-0.9 2,-2v-9h-2v9zM10.21,16.83l-1.96,-2.36L5.5,18h11l-3.54,-4.71zM20,4L20,1h-2v3h-3c0.01,0.01 0,2 0,2h3v2.99c0.01,0.01 2,0 2,0L20,6h3L23,4h-3z"/> +</vector> diff --git a/app/src/main/res/drawable/ic_pause_white_rounded_18dp.xml b/app/src/main/res/drawable/ic_pause_white_rounded_24dp.xml index 479c57b0..a5e498b5 100644 --- a/app/src/main/res/drawable/ic_pause_white_rounded_18dp.xml +++ b/app/src/main/res/drawable/ic_pause_white_rounded_24dp.xml @@ -1,9 +1,9 @@ <vector xmlns:android="http://schemas.android.com/apk/res/android" - android:width="18dp" - android:height="18dp" + android:width="24dp" + android:height="24dp" android:viewportWidth="24" android:viewportHeight="24"> <path - android:pathData="M8,19c1.1,0 2,-0.9 2,-2L10,7c0,-1.1 -0.9,-2 -2,-2s-2,0.9 -2,2v10c0,1.1 0.9,2 2,2zM14,7v10c0,1.1 0.9,2 2,2s2,-0.9 2,-2L18,7c0,-1.1 -0.9,-2 -2,-2s-2,0.9 -2,2z" - android:fillColor="#ffffff"/> + android:fillColor="@android:color/white" + android:pathData="M8,19c1.1,0 2,-0.9 2,-2L10,7c0,-1.1 -0.9,-2 -2,-2s-2,0.9 -2,2v10c0,1.1 0.9,2 2,2zM14,7v10c0,1.1 0.9,2 2,2s2,-0.9 2,-2L18,7c0,-1.1 -0.9,-2 -2,-2s-2,0.9 -2,2z"/> </vector> diff --git a/app/src/main/res/drawable/ic_play_arrow_white_rounded_18dp.xml b/app/src/main/res/drawable/ic_play_arrow_white_rounded_24dp.xml index 3400b3ac..78fbfbba 100644 --- a/app/src/main/res/drawable/ic_play_arrow_white_rounded_18dp.xml +++ b/app/src/main/res/drawable/ic_play_arrow_white_rounded_24dp.xml @@ -1,9 +1,9 @@ <vector xmlns:android="http://schemas.android.com/apk/res/android" - android:width="18dp" - android:height="18dp" + android:width="24dp" + android:height="24dp" android:viewportWidth="24" android:viewportHeight="24"> <path - android:pathData="M8,6.82v10.36c0,0.79 0.87,1.27 1.54,0.84l8.14,-5.18c0.62,-0.39 0.62,-1.29 0,-1.69L9.54,5.98C8.87,5.55 8,6.03 8,6.82z" - android:fillColor="#ffffff"/> + android:fillColor="@android:color/white" + android:pathData="M8,6.82v10.36c0,0.79 0.87,1.27 1.54,0.84l8.14,-5.18c0.62,-0.39 0.62,-1.29 0,-1.69L9.54,5.98C8.87,5.55 8,6.03 8,6.82z"/> </vector> diff --git a/app/src/main/res/drawable/ic_rpan_24dp.xml b/app/src/main/res/drawable/ic_rpan_24dp.xml new file mode 100644 index 00000000..bb61e6ff --- /dev/null +++ b/app/src/main/res/drawable/ic_rpan_24dp.xml @@ -0,0 +1,9 @@ +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="24dp" + android:height="24dp" + android:viewportWidth="24" + android:viewportHeight="24"> + <path + android:fillColor="@android:color/black" + android:pathData="M21,6h-7.59l3.29,-3.29L16,2l-4,4 -4,-4 -0.71,0.71L10.59,6L3,6c-1.1,0 -2,0.89 -2,2v12c0,1.1 0.9,2 2,2h18c1.1,0 2,-0.9 2,-2L23,8c0,-1.11 -0.9,-2 -2,-2zM21,20L3,20L3,8h18v12zM9,10v8l7,-4z"/> +</vector> diff --git a/app/src/main/res/drawable/ic_trending_24dp.xml b/app/src/main/res/drawable/ic_trending_24dp.xml new file mode 100644 index 00000000..b237138b --- /dev/null +++ b/app/src/main/res/drawable/ic_trending_24dp.xml @@ -0,0 +1,9 @@ +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="24dp" + android:height="24dp" + android:viewportWidth="24" + android:viewportHeight="24"> + <path + android:fillColor="@android:color/black" + android:pathData="M16,6l2.29,2.29 -4.88,4.88 -4,-4L2,16.59 3.41,18l6,-6 4,4 6.3,-6.29L22,12V6z"/> +</vector> diff --git a/app/src/main/res/drawable/ic_unmute_white_rounded_18dp.xml b/app/src/main/res/drawable/ic_unmute_white_rounded_24dp.xml index 90b8f85d..3afb6532 100644 --- a/app/src/main/res/drawable/ic_unmute_white_rounded_18dp.xml +++ b/app/src/main/res/drawable/ic_unmute_white_rounded_24dp.xml @@ -1,9 +1,9 @@ <vector xmlns:android="http://schemas.android.com/apk/res/android" - android:width="18dp" - android:height="18dp" + android:width="24dp" + android:height="24dp" android:viewportWidth="24" android:viewportHeight="24"> <path - android:pathData="M3,10v4c0,0.55 0.45,1 1,1h3l3.29,3.29c0.63,0.63 1.71,0.18 1.71,-0.71L12,6.41c0,-0.89 -1.08,-1.34 -1.71,-0.71L7,9L4,9c-0.55,0 -1,0.45 -1,1zM16.5,12c0,-1.77 -1.02,-3.29 -2.5,-4.03v8.05c1.48,-0.73 2.5,-2.25 2.5,-4.02zM14,4.45v0.2c0,0.38 0.25,0.71 0.6,0.85C17.18,6.53 19,9.06 19,12s-1.82,5.47 -4.4,6.5c-0.36,0.14 -0.6,0.47 -0.6,0.85v0.2c0,0.63 0.63,1.07 1.21,0.85C18.6,19.11 21,15.84 21,12s-2.4,-7.11 -5.79,-8.4c-0.58,-0.23 -1.21,0.22 -1.21,0.85z" - android:fillColor="#ffffff"/> + android:fillColor="@android:color/white" + android:pathData="M3,10v4c0,0.55 0.45,1 1,1h3l3.29,3.29c0.63,0.63 1.71,0.18 1.71,-0.71L12,6.41c0,-0.89 -1.08,-1.34 -1.71,-0.71L7,9L4,9c-0.55,0 -1,0.45 -1,1zM16.5,12c0,-1.77 -1.02,-3.29 -2.5,-4.03v8.05c1.48,-0.73 2.5,-2.25 2.5,-4.02zM14,4.45v0.2c0,0.38 0.25,0.71 0.6,0.85C17.18,6.53 19,9.06 19,12s-1.82,5.47 -4.4,6.5c-0.36,0.14 -0.6,0.47 -0.6,0.85v0.2c0,0.63 0.63,1.07 1.21,0.85C18.6,19.11 21,15.84 21,12s-2.4,-7.11 -5.79,-8.4c-0.58,-0.23 -1.21,0.22 -1.21,0.85z"/> </vector> diff --git a/app/src/main/res/drawable/ic_wallpaper_white_24dp.xml b/app/src/main/res/drawable/ic_wallpaper_white_24dp.xml new file mode 100644 index 00000000..9db92d6f --- /dev/null +++ b/app/src/main/res/drawable/ic_wallpaper_white_24dp.xml @@ -0,0 +1,5 @@ +<vector android:height="24dp" + android:viewportHeight="24" android:viewportWidth="24" + android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android"> + <path android:fillColor="@android:color/white" android:pathData="M4,4h7L11,2L4,2c-1.1,0 -2,0.9 -2,2v7h2L4,4zM10,13l-4,5h12l-3,-4 -2.03,2.71L10,13zM17,8.5c0,-0.83 -0.67,-1.5 -1.5,-1.5S14,7.67 14,8.5s0.67,1.5 1.5,1.5S17,9.33 17,8.5zM20,2h-7v2h7v7h2L22,4c0,-1.1 -0.9,-2 -2,-2zM20,20h-7v2h7c1.1,0 2,-0.9 2,-2v-7h-2v7zM4,13L2,13v7c0,1.1 0.9,2 2,2h7v-2L4,20v-7z"/> +</vector> diff --git a/app/src/main/res/drawable/trending_search_title_background.xml b/app/src/main/res/drawable/trending_search_title_background.xml new file mode 100644 index 00000000..8bcd7150 --- /dev/null +++ b/app/src/main/res/drawable/trending_search_title_background.xml @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="utf-8"?> +<shape xmlns:android="http://schemas.android.com/apk/res/android" + android:shape="rectangle"> + <gradient android:startColor="#323232" + android:endColor="@android:color/transparent" + android:angle="90" + android:type="linear" + android:useLevel="true" /> +</shape>
\ No newline at end of file diff --git a/app/src/main/res/layout-land/fragment_view_post_detail.xml b/app/src/main/res/layout-land/fragment_view_post_detail.xml index 6d0beecc..3b35b38b 100644 --- a/app/src/main/res/layout-land/fragment_view_post_detail.xml +++ b/app/src/main/res/layout-land/fragment_view_post_detail.xml @@ -22,7 +22,9 @@ android:id="@+id/post_detail_recycler_view_view_post_detail_fragment" android:layout_width="0dp" android:layout_height="match_parent" - android:layout_weight="1" /> + android:layout_weight="1" + android:clipToPadding="false" + app:layoutManager=".customviews.LinearLayoutManagerBugFixed" /> <androidx.recyclerview.widget.RecyclerView android:id="@+id/comments_recycler_view_view_post_detail_fragment" @@ -30,7 +32,8 @@ android:layout_height="match_parent" android:layout_weight="1" android:paddingBottom="144dp" - android:clipToPadding="false" /> + android:clipToPadding="false" + app:layoutManager=".customviews.LinearLayoutManagerBugFixed" /> </LinearLayout> diff --git a/app/src/main/res/layout-sw600dp/fragment_view_post_detail.xml b/app/src/main/res/layout-sw600dp/fragment_view_post_detail.xml index 6d0beecc..d1637b0c 100644 --- a/app/src/main/res/layout-sw600dp/fragment_view_post_detail.xml +++ b/app/src/main/res/layout-sw600dp/fragment_view_post_detail.xml @@ -22,7 +22,9 @@ android:id="@+id/post_detail_recycler_view_view_post_detail_fragment" android:layout_width="0dp" android:layout_height="match_parent" - android:layout_weight="1" /> + android:layout_weight="1" + android:clipToPadding="false" + app:layoutManager=".customviews.LinearLayoutManagerBugFixed" /> <androidx.recyclerview.widget.RecyclerView android:id="@+id/comments_recycler_view_view_post_detail_fragment" @@ -30,7 +32,8 @@ android:layout_height="match_parent" android:layout_weight="1" android:paddingBottom="144dp" - android:clipToPadding="false" /> + android:clipToPadding="false" + app:layoutManager=".customviews.LinearLayoutManagerBugFixed" /> </LinearLayout> diff --git a/app/src/main/res/layout/activity_comment_full_markdown.xml b/app/src/main/res/layout/activity_comment_full_markdown.xml index 509ad624..e1f89252 100644 --- a/app/src/main/res/layout/activity_comment_full_markdown.xml +++ b/app/src/main/res/layout/activity_comment_full_markdown.xml @@ -14,7 +14,6 @@ android:theme="@style/AppTheme.AppBarOverlay"> <com.google.android.material.appbar.CollapsingToolbarLayout - android:id="@+id/collapsing_toolbar_layout_comment_full_markdown_activity" android:layout_width="match_parent" android:layout_height="match_parent" app:layout_scrollFlags="scroll|enterAlways" @@ -37,6 +36,8 @@ android:id="@+id/content_markdown_view_comment_full_markdown_activity" android:layout_width="match_parent" android:layout_height="match_parent" + android:paddingStart="16dp" + android:paddingEnd="16dp" app:layout_behavior="@string/appbar_scrolling_view_behavior" /> </androidx.coordinatorlayout.widget.CoordinatorLayout>
\ No newline at end of file diff --git a/app/src/main/res/layout/activity_custom_theme_listing.xml b/app/src/main/res/layout/activity_custom_theme_listing.xml index 92a200af..e0d88d70 100644 --- a/app/src/main/res/layout/activity_custom_theme_listing.xml +++ b/app/src/main/res/layout/activity_custom_theme_listing.xml @@ -37,6 +37,7 @@ android:id="@+id/recycler_view_customize_theme_listing_activity" android:layout_width="match_parent" android:layout_height="match_parent" + app:layoutManager=".customviews.LinearLayoutManagerBugFixed" app:layout_behavior="@string/appbar_scrolling_view_behavior" /> <com.google.android.material.floatingactionbutton.FloatingActionButton diff --git a/app/src/main/res/layout/activity_customize_theme.xml b/app/src/main/res/layout/activity_customize_theme.xml index c7183da9..bd67a775 100644 --- a/app/src/main/res/layout/activity_customize_theme.xml +++ b/app/src/main/res/layout/activity_customize_theme.xml @@ -38,6 +38,7 @@ android:id="@+id/recycler_view_customize_theme_activity" android:layout_width="match_parent" android:layout_height="match_parent" + app:layoutManager=".customviews.LinearLayoutManagerBugFixed" app:layout_behavior="@string/appbar_scrolling_view_behavior" /> </androidx.coordinatorlayout.widget.CoordinatorLayout>
\ No newline at end of file diff --git a/app/src/main/res/layout/activity_inbox.xml b/app/src/main/res/layout/activity_inbox.xml index b65c0d89..256fee87 100644 --- a/app/src/main/res/layout/activity_inbox.xml +++ b/app/src/main/res/layout/activity_inbox.xml @@ -26,6 +26,8 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:minHeight="?attr/actionBarSize" + app:layout_collapseMode="pin" + app:layout_scrollFlags="scroll|enterAlways" app:popupTheme="@style/AppTheme.PopupOverlay" app:navigationIcon="?attr/homeAsUpIndicator" /> @@ -45,7 +47,7 @@ </com.google.android.material.appbar.AppBarLayout> - <androidx.viewpager.widget.ViewPager + <androidx.viewpager2.widget.ViewPager2 android:id="@+id/view_pager_inbox_activity" android:layout_width="match_parent" android:layout_height="match_parent" diff --git a/app/src/main/res/layout/activity_motion_test.xml b/app/src/main/res/layout/activity_motion_test.xml deleted file mode 100644 index c65afba9..00000000 --- a/app/src/main/res/layout/activity_motion_test.xml +++ /dev/null @@ -1,17 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<ml.docilealligator.infinityforreddit.customviews.ClickableMotionLayout 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="match_parent" - android:id="@+id/motion_layout" - tools:context=".activities.MotionTestActivity" - app:layoutDescription="@xml/activity_motion_test_scene"> - - <View - android:id="@+id/button" - android:background="@color/colorAccent" - android:layout_width="64dp" - android:layout_height="64dp" /> - -</ml.docilealligator.infinityforreddit.customviews.ClickableMotionLayout>
\ No newline at end of file diff --git a/app/src/main/res/layout/activity_post_gallery.xml b/app/src/main/res/layout/activity_post_gallery.xml new file mode 100644 index 00000000..150870e0 --- /dev/null +++ b/app/src/main/res/layout/activity_post_gallery.xml @@ -0,0 +1,204 @@ +<?xml version="1.0" encoding="utf-8"?> +<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" + xmlns:tools="http://schemas.android.com/tools" + android:id="@+id/coordinator_layout_post_gallery_activity" + android:layout_width="match_parent" + android:layout_height="match_parent" + tools:application=".PostImageActivity"> + + <com.google.android.material.appbar.AppBarLayout + android:id="@+id/appbar_layout_post_gallery_activity" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:theme="@style/AppTheme.AppBarOverlay"> + + <androidx.appcompat.widget.Toolbar + android:id="@+id/toolbar_post_gallery_activity" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:minHeight="?attr/actionBarSize" + app:navigationIcon="?attr/homeAsUpIndicator" + app:popupTheme="@style/AppTheme.PopupOverlay" /> + + </com.google.android.material.appbar.AppBarLayout> + + <androidx.core.widget.NestedScrollView + android:layout_width="match_parent" + android:layout_height="match_parent" + app:layout_behavior="@string/appbar_scrolling_view_behavior"> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="match_parent" + android:orientation="vertical"> + + <RelativeLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:paddingStart="16dp" + android:paddingTop="8dp" + android:paddingEnd="16dp" + android:paddingBottom="8dp"> + + <pl.droidsonroids.gif.GifImageView + android:id="@+id/subreddit_icon_gif_image_view_post_gallery_activity" + android:layout_width="24dp" + android:layout_height="24dp" + android:layout_alignParentStart="true" + android:layout_centerVertical="true" /> + + <TextView + android:id="@+id/subreddit_name_text_view_post_gallery_activity" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_centerVertical="true" + android:layout_marginStart="32dp" + android:layout_marginEnd="16dp" + android:layout_toStartOf="@id/rules_button_post_gallery_activity" + android:layout_toEndOf="@id/subreddit_icon_gif_image_view_post_gallery_activity" + android:text="@string/choose_a_subreddit" + android:textSize="?attr/font_default" + android:fontFamily="?attr/font_family" /> + + <com.google.android.material.button.MaterialButton + android:id="@+id/rules_button_post_gallery_activity" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_alignParentEnd="true" + android:layout_centerVertical="true" + android:text="@string/rules" + android:textSize="?attr/font_default" + android:fontFamily="?attr/font_family" /> + + </RelativeLayout> + + <View + android:id="@+id/divider_1_post_gallery_activity" + android:layout_width="match_parent" + android:layout_height="1dp" /> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content"> + + <com.libRG.CustomTextView + android:id="@+id/flair_custom_text_view_post_gallery_activity" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_margin="16dp" + android:padding="4dp" + android:text="@string/flair" + android:textColor="?attr/primaryTextColor" + android:textSize="?attr/font_default" + android:fontFamily="?attr/font_family" + android:visibility="gone" + app:lib_setRadius="3dp" + app:lib_setRoundedView="true" + app:lib_setShape="rectangle" /> + + <com.libRG.CustomTextView + android:id="@+id/spoiler_custom_text_view_post_gallery_activity" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_margin="16dp" + android:padding="4dp" + android:text="@string/spoiler" + android:textColor="?attr/primaryTextColor" + android:textSize="?attr/font_default" + android:fontFamily="?attr/font_family" + app:lib_setRadius="3dp" + app:lib_setRoundedView="true" + app:lib_setShape="rectangle" /> + + <com.libRG.CustomTextView + android:id="@+id/nsfw_custom_text_view_post_gallery_activity" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_margin="16dp" + android:padding="4dp" + android:text="@string/nsfw" + android:textColor="?attr/primaryTextColor" + android:textSize="?attr/font_default" + android:fontFamily="?attr/font_family" + app:lib_setRadius="3dp" + app:lib_setRoundedView="true" + app:lib_setShape="rectangle" /> + + </LinearLayout> + + <View + android:id="@+id/divider_2_post_gallery_activity" + android:layout_width="match_parent" + android:layout_height="1dp" /> + + <LinearLayout + android:id="@+id/receive_post_reply_notifications_linear_layout_post_gallery_activity" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:padding="8dp" + android:paddingBottom="8dp" + android:paddingStart="16dp" + android:paddingEnd="16dp" + android:clickable="true" + android:focusable="true" + android:background="?attr/selectableItemBackground"> + + <TextView + android:id="@+id/receive_post_reply_notifications_text_view_post_gallery_activity" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_weight="1" + android:layout_gravity="center_vertical" + android:layout_marginEnd="16dp" + android:text="@string/receive_post_reply_notifications" + android:textSize="?attr/font_default" + android:fontFamily="?attr/font_family" /> + + <com.google.android.material.switchmaterial.SwitchMaterial + android:id="@+id/receive_post_reply_notifications_switch_material_post_gallery_activity" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center_vertical" + android:checked="true" /> + + </LinearLayout> + + <View + android:id="@+id/divider_3_post_gallery_activity" + android:layout_width="match_parent" + android:layout_height="1dp" /> + + <EditText + android:id="@+id/post_title_edit_text_post_gallery_activity" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:background="#00000000" + android:gravity="top" + android:hint="@string/post_title_hint" + android:inputType="textCapSentences|textMultiLine" + android:padding="16dp" + android:textColor="?attr/primaryTextColor" + android:textSize="?attr/title_font_18" + android:fontFamily="?attr/title_font_family" /> + + <View + android:id="@+id/divider_4_post_gallery_activity" + android:layout_width="match_parent" + android:layout_height="1dp" /> + + <androidx.recyclerview.widget.RecyclerView + android:id="@+id/images_recycler_view_post_gallery_activity" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:paddingTop="16dp" + android:paddingStart="8dp" + android:paddingEnd="8dp" + app:layoutManager="androidx.recyclerview.widget.GridLayoutManager" + app:spanCount="2" /> + + </LinearLayout> + + </androidx.core.widget.NestedScrollView> + +</androidx.coordinatorlayout.widget.CoordinatorLayout>
\ No newline at end of file diff --git a/app/src/main/res/layout/activity_post_image.xml b/app/src/main/res/layout/activity_post_image.xml index cacfd04c..2e66a7ea 100644 --- a/app/src/main/res/layout/activity_post_image.xml +++ b/app/src/main/res/layout/activity_post_image.xml @@ -61,7 +61,7 @@ android:textSize="?attr/font_default" android:fontFamily="?attr/font_family" /> - <Button + <com.google.android.material.button.MaterialButton android:id="@+id/rules_button_post_image_activity" android:layout_width="wrap_content" android:layout_height="wrap_content" @@ -132,6 +132,43 @@ android:layout_width="match_parent" android:layout_height="1dp" /> + <LinearLayout + android:id="@+id/receive_post_reply_notifications_linear_layout_post_image_activity" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:padding="8dp" + android:paddingBottom="8dp" + android:paddingStart="16dp" + android:paddingEnd="16dp" + android:clickable="true" + android:focusable="true" + android:background="?attr/selectableItemBackground"> + + <TextView + android:id="@+id/receive_post_reply_notifications_text_view_post_image_activity" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_weight="1" + android:layout_gravity="center_vertical" + android:layout_marginEnd="16dp" + android:text="@string/receive_post_reply_notifications" + android:textSize="?attr/font_default" + android:fontFamily="?attr/font_family" /> + + <com.google.android.material.switchmaterial.SwitchMaterial + android:id="@+id/receive_post_reply_notifications_switch_material_post_image_activity" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center_vertical" + android:checked="true" /> + + </LinearLayout> + + <View + android:id="@+id/divider_3_post_image_activity" + android:layout_width="match_parent" + android:layout_height="1dp" /> + <EditText android:id="@+id/post_title_edit_text_post_image_activity" android:layout_width="match_parent" @@ -146,7 +183,7 @@ android:fontFamily="?attr/title_font_family" /> <View - android:id="@+id/divider_3_post_image_activity" + android:id="@+id/divider_4_post_image_activity" android:layout_width="match_parent" android:layout_height="1dp" /> diff --git a/app/src/main/res/layout/activity_post_link.xml b/app/src/main/res/layout/activity_post_link.xml index 1e16bada..427b8306 100644 --- a/app/src/main/res/layout/activity_post_link.xml +++ b/app/src/main/res/layout/activity_post_link.xml @@ -61,7 +61,7 @@ android:textSize="?attr/font_default" android:fontFamily="?attr/font_family" /> - <Button + <com.google.android.material.button.MaterialButton android:id="@+id/rules_button_post_link_activity" android:layout_width="wrap_content" android:layout_height="wrap_content" @@ -133,6 +133,43 @@ android:layout_height="1dp" /> <LinearLayout + android:id="@+id/receive_post_reply_notifications_linear_layout_post_link_activity" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:padding="8dp" + android:paddingBottom="8dp" + android:paddingStart="16dp" + android:paddingEnd="16dp" + android:clickable="true" + android:focusable="true" + android:background="?attr/selectableItemBackground"> + + <TextView + android:id="@+id/receive_post_reply_notifications_text_view_post_link_activity" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_weight="1" + android:layout_gravity="center_vertical" + android:layout_marginEnd="16dp" + android:text="@string/receive_post_reply_notifications" + android:textSize="?attr/font_default" + android:fontFamily="?attr/font_family" /> + + <com.google.android.material.switchmaterial.SwitchMaterial + android:id="@+id/receive_post_reply_notifications_switch_material_post_link_activity" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center_vertical" + android:checked="true" /> + + </LinearLayout> + + <View + android:id="@+id/divider_3_post_link_activity" + android:layout_width="match_parent" + android:layout_height="1dp" /> + + <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:paddingStart="0dp" @@ -158,12 +195,14 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_vertical" - android:text="@string/suggest_title" /> + android:text="@string/suggest_title" + android:textSize="?attr/font_default" + android:fontFamily="?attr/font_family" /> </LinearLayout> <View - android:id="@+id/divider_3_post_link_activity" + android:id="@+id/divider_4_post_link_activity" android:layout_width="match_parent" android:layout_height="1dp" /> diff --git a/app/src/main/res/layout/activity_post_text.xml b/app/src/main/res/layout/activity_post_text.xml index d9b02754..f18bf667 100644 --- a/app/src/main/res/layout/activity_post_text.xml +++ b/app/src/main/res/layout/activity_post_text.xml @@ -48,26 +48,26 @@ android:paddingBottom="8dp"> <pl.droidsonroids.gif.GifImageView - android:id="@+id/subreddit_icon_gif_image_view_search_activity" + android:id="@+id/subreddit_icon_gif_image_view_post_text_activity" android:layout_width="24dp" android:layout_height="24dp" android:layout_alignParentStart="true" android:layout_centerVertical="true" /> <TextView - android:id="@+id/subreddit_name_text_view_search_activity" + android:id="@+id/subreddit_name_text_view_post_text_activity" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerVertical="true" android:layout_marginStart="32dp" android:layout_marginEnd="16dp" android:layout_toStartOf="@id/rules_button_post_text_activity" - android:layout_toEndOf="@id/subreddit_icon_gif_image_view_search_activity" + android:layout_toEndOf="@id/subreddit_icon_gif_image_view_post_text_activity" android:text="@string/choose_a_subreddit" android:textSize="?attr/font_default" android:fontFamily="?attr/font_family" /> - <Button + <com.google.android.material.button.MaterialButton android:id="@+id/rules_button_post_text_activity" android:layout_width="wrap_content" android:layout_height="wrap_content" @@ -95,7 +95,6 @@ android:layout_margin="16dp" android:padding="4dp" android:text="@string/flair" - android:textColor="?attr/primaryTextColor" android:textSize="?attr/font_default" android:fontFamily="?attr/font_family" android:visibility="gone" @@ -110,7 +109,6 @@ android:layout_margin="16dp" android:padding="4dp" android:text="@string/spoiler" - android:textColor="?attr/primaryTextColor" android:textSize="?attr/font_default" android:fontFamily="?attr/font_family" app:lib_setRadius="3dp" @@ -124,7 +122,6 @@ android:layout_margin="16dp" android:padding="4dp" android:text="@string/nsfw" - android:textColor="?attr/primaryTextColor" android:textSize="?attr/font_default" android:fontFamily="?attr/font_family" app:lib_setRadius="3dp" @@ -138,6 +135,43 @@ android:layout_width="match_parent" android:layout_height="1dp" /> + <LinearLayout + android:id="@+id/receive_post_reply_notifications_linear_layout_post_text_activity" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:padding="8dp" + android:paddingBottom="8dp" + android:paddingStart="16dp" + android:paddingEnd="16dp" + android:clickable="true" + android:focusable="true" + android:background="?attr/selectableItemBackground"> + + <TextView + android:id="@+id/receive_post_reply_notifications_text_view_post_text_activity" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_weight="1" + android:layout_gravity="center_vertical" + android:layout_marginEnd="16dp" + android:text="@string/receive_post_reply_notifications" + android:textSize="?attr/font_default" + android:fontFamily="?attr/font_family" /> + + <com.google.android.material.switchmaterial.SwitchMaterial + android:id="@+id/receive_post_reply_notifications_switch_material_post_text_activity" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center_vertical" + android:checked="true" /> + + </LinearLayout> + + <View + android:id="@+id/divider_3_post_text_activity" + android:layout_width="match_parent" + android:layout_height="1dp" /> + <EditText android:id="@+id/post_title_edit_text_post_text_activity" android:layout_width="match_parent" @@ -147,12 +181,11 @@ android:hint="@string/post_title_hint" android:inputType="textCapSentences|textMultiLine" android:padding="16dp" - android:textColor="?attr/primaryTextColor" android:textSize="?attr/title_font_18" android:fontFamily="?attr/title_font_family" /> <View - android:id="@+id/divider_3_post_text_activity" + android:id="@+id/divider_4_post_text_activity" android:layout_width="match_parent" android:layout_height="1dp" /> @@ -165,7 +198,6 @@ android:hint="@string/post_text_content_hint" android:inputType="textCapSentences|textMultiLine" android:padding="16dp" - android:textColor="?attr/primaryTextColor" android:textSize="?attr/content_font_18" android:fontFamily="?attr/content_font_family" /> diff --git a/app/src/main/res/layout/activity_post_video.xml b/app/src/main/res/layout/activity_post_video.xml index c50c8be1..e1c297cb 100644 --- a/app/src/main/res/layout/activity_post_video.xml +++ b/app/src/main/res/layout/activity_post_video.xml @@ -61,7 +61,7 @@ android:textSize="?attr/font_default" android:fontFamily="?attr/font_family" /> - <Button + <com.google.android.material.button.MaterialButton android:id="@+id/rules_button_post_video_activity" android:layout_width="wrap_content" android:layout_height="wrap_content" @@ -132,6 +132,43 @@ android:layout_width="match_parent" android:layout_height="1dp" /> + <LinearLayout + android:id="@+id/receive_post_reply_notifications_linear_layout_post_video_activity" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:padding="8dp" + android:paddingBottom="8dp" + android:paddingStart="16dp" + android:paddingEnd="16dp" + android:clickable="true" + android:focusable="true" + android:background="?attr/selectableItemBackground"> + + <TextView + android:id="@+id/receive_post_reply_notifications_text_view_post_video_activity" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_weight="1" + android:layout_gravity="center_vertical" + android:layout_marginEnd="16dp" + android:text="@string/receive_post_reply_notifications" + android:textSize="?attr/font_default" + android:fontFamily="?attr/font_family" /> + + <com.google.android.material.switchmaterial.SwitchMaterial + android:id="@+id/receive_post_reply_notifications_switch_material_post_video_activity" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center_vertical" + android:checked="true" /> + + </LinearLayout> + + <View + android:id="@+id/divider_3_post_video_activity" + android:layout_width="match_parent" + android:layout_height="1dp" /> + <EditText android:id="@+id/post_title_edit_text_post_video_activity" android:layout_width="match_parent" @@ -146,7 +183,7 @@ android:fontFamily="?attr/title_font_family" /> <View - android:id="@+id/divider_3_post_video_activity" + android:id="@+id/divider_4_post_video_activity" android:layout_width="match_parent" android:layout_height="1dp" /> diff --git a/app/src/main/res/layout/activity_report.xml b/app/src/main/res/layout/activity_report.xml index ff8ecb4b..a0d114b6 100644 --- a/app/src/main/res/layout/activity_report.xml +++ b/app/src/main/res/layout/activity_report.xml @@ -27,6 +27,7 @@ android:id="@+id/recycler_view_report_activity" android:layout_width="match_parent" android:layout_height="match_parent" + app:layoutManager=".customviews.LinearLayoutManagerBugFixed" app:layout_behavior="@string/appbar_scrolling_view_behavior" /> </androidx.coordinatorlayout.widget.CoordinatorLayout>
\ No newline at end of file diff --git a/app/src/main/res/layout/activity_rules.xml b/app/src/main/res/layout/activity_rules.xml index 377c4fe1..0cb088b2 100644 --- a/app/src/main/res/layout/activity_rules.xml +++ b/app/src/main/res/layout/activity_rules.xml @@ -44,6 +44,7 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:clipToPadding="false" + app:layoutManager=".customviews.LinearLayoutManagerBugFixed" app:layout_behavior="@string/appbar_scrolling_view_behavior" /> <TextView diff --git a/app/src/main/res/layout/activity_search.xml b/app/src/main/res/layout/activity_search.xml index 7de8bd69..29b5b94f 100644 --- a/app/src/main/res/layout/activity_search.xml +++ b/app/src/main/res/layout/activity_search.xml @@ -95,7 +95,8 @@ android:id="@+id/recycler_view_search_activity" android:layout_width="match_parent" android:layout_height="wrap_content" - android:visibility="gone" /> + android:visibility="gone" + app:layoutManager=".customviews.LinearLayoutManagerBugFixed" /> </LinearLayout> diff --git a/app/src/main/res/layout/activity_submit_crosspost.xml b/app/src/main/res/layout/activity_submit_crosspost.xml index ec5b1f42..b4e555d1 100644 --- a/app/src/main/res/layout/activity_submit_crosspost.xml +++ b/app/src/main/res/layout/activity_submit_crosspost.xml @@ -61,7 +61,7 @@ android:textSize="?attr/font_default" android:fontFamily="?attr/font_family" /> - <Button + <com.google.android.material.button.MaterialButton android:id="@+id/rules_button_submit_crosspost_activity" android:layout_width="wrap_content" android:layout_height="wrap_content" @@ -132,6 +132,43 @@ android:layout_width="match_parent" android:layout_height="1dp" /> + <LinearLayout + android:id="@+id/receive_post_reply_notifications_linear_layout_submit_crosspost_activity" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:padding="8dp" + android:paddingBottom="8dp" + android:paddingStart="16dp" + android:paddingEnd="16dp" + android:clickable="true" + android:focusable="true" + android:background="?attr/selectableItemBackground"> + + <TextView + android:id="@+id/receive_post_reply_notifications_text_view_submit_crosspost_activity" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_weight="1" + android:layout_gravity="center_vertical" + android:layout_marginEnd="16dp" + android:text="@string/receive_post_reply_notifications" + android:textSize="?attr/font_default" + android:fontFamily="?attr/font_family" /> + + <com.google.android.material.switchmaterial.SwitchMaterial + android:id="@+id/receive_post_reply_notifications_switch_material_submit_crosspost_activity" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center_vertical" + android:checked="true" /> + + </LinearLayout> + + <View + android:id="@+id/divider_3_submit_crosspost_activity" + android:layout_width="match_parent" + android:layout_height="1dp" /> + <EditText android:id="@+id/post_title_edit_text_submit_crosspost_activity" android:layout_width="match_parent" @@ -146,7 +183,7 @@ android:fontFamily="?attr/title_font_family" /> <View - android:id="@+id/divider_3_submit_crosspost_activity" + android:id="@+id/divider_4_submit_crosspost_activity" android:layout_width="match_parent" android:layout_height="1dp" /> diff --git a/app/src/main/res/layout/activity_subscribed_thing_listing.xml b/app/src/main/res/layout/activity_subscribed_thing_listing.xml index d1f49996..109d3f74 100644 --- a/app/src/main/res/layout/activity_subscribed_thing_listing.xml +++ b/app/src/main/res/layout/activity_subscribed_thing_listing.xml @@ -45,7 +45,7 @@ </com.google.android.material.appbar.AppBarLayout> - <androidx.viewpager.widget.ViewPager + <ml.docilealligator.infinityforreddit.customviews.ViewPagerBugFixed android:id="@+id/view_pager_subscribed_thing_listing_activity" android:layout_width="match_parent" android:layout_height="match_parent" diff --git a/app/src/main/res/layout/activity_theme_preview.xml b/app/src/main/res/layout/activity_theme_preview.xml index 6ca8a0b0..f2504287 100644 --- a/app/src/main/res/layout/activity_theme_preview.xml +++ b/app/src/main/res/layout/activity_theme_preview.xml @@ -7,7 +7,7 @@ android:id="@+id/coordinator_layout_theme_preview_activity" tools:context=".activities.CustomThemePreviewActivity"> - <androidx.viewpager.widget.ViewPager + <ml.docilealligator.infinityforreddit.customviews.ViewPagerBugFixed android:id="@+id/view_pager_theme_preview_activity" android:layout_width="match_parent" android:layout_height="wrap_content" @@ -194,6 +194,7 @@ android:background="?attr/selectableItemBackgroundBorderless" /> </LinearLayout> + </com.google.android.material.bottomappbar.BottomAppBar> <com.google.android.material.floatingactionbutton.FloatingActionButton diff --git a/app/src/main/res/layout/activity_trending.xml b/app/src/main/res/layout/activity_trending.xml new file mode 100644 index 00000000..9bfe6798 --- /dev/null +++ b/app/src/main/res/layout/activity_trending.xml @@ -0,0 +1,76 @@ +<?xml version="1.0" encoding="utf-8"?> +<androidx.coordinatorlayout.widget.CoordinatorLayout 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="match_parent" + android:id="@+id/coordinator_layout_trending_activity" + tools:context=".activities.TrendingActivity"> + + <com.google.android.material.appbar.AppBarLayout + android:id="@+id/appbar_layout_trending_activity" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:theme="@style/AppTheme.AppBarOverlay"> + + <com.google.android.material.appbar.CollapsingToolbarLayout + android:id="@+id/collapsing_toolbar_layout_trending_activity" + android:layout_width="match_parent" + android:layout_height="match_parent" + app:layout_scrollFlags="scroll|enterAlways" + app:titleEnabled="false" + app:toolbarId="@+id/toolbar_trending_activity"> + + <androidx.appcompat.widget.Toolbar + android:id="@+id/toolbar_trending_activity" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:minHeight="?attr/actionBarSize" + app:popupTheme="@style/AppTheme.PopupOverlay" + app:navigationIcon="?attr/homeAsUpIndicator" /> + + </com.google.android.material.appbar.CollapsingToolbarLayout> + + </com.google.android.material.appbar.AppBarLayout> + + <androidx.swiperefreshlayout.widget.SwipeRefreshLayout + android:id="@+id/swipe_refresh_layout_trending_activity" + android:layout_width="match_parent" + android:layout_height="match_parent" + app:layout_behavior="@string/appbar_scrolling_view_behavior"> + + <androidx.recyclerview.widget.RecyclerView + android:id="@+id/recycler_view_trending_activity" + android:layout_width="match_parent" + android:layout_height="match_parent" + app:layoutManager=".customviews.LinearLayoutManagerBugFixed" /> + + </androidx.swiperefreshlayout.widget.SwipeRefreshLayout> + + <LinearLayout + android:id="@+id/fetch_trending_search_linear_layout_trending_activity" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:layout_marginTop="48dp" + android:layout_marginBottom="48dp" + android:gravity="center" + android:orientation="vertical" + android:visibility="gone"> + + <ImageView + android:id="@+id/fetch_trending_search_image_view_trending_activity" + android:layout_width="150dp" + android:layout_height="wrap_content" /> + + <TextView + android:id="@+id/fetch_trending_search_text_view_trending_activity" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginTop="16dp" + android:gravity="center" + android:textSize="?attr/font_default" + android:fontFamily="?attr/font_family" /> + + </LinearLayout> + +</androidx.coordinatorlayout.widget.CoordinatorLayout>
\ No newline at end of file diff --git a/app/src/main/res/layout/activity_view_image_or_gif.xml b/app/src/main/res/layout/activity_view_image_or_gif.xml index 4ecd9fda..fa0a5aa8 100644 --- a/app/src/main/res/layout/activity_view_image_or_gif.xml +++ b/app/src/main/res/layout/activity_view_image_or_gif.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" +<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/hauler_view_view_image_or_gif_activity" @@ -12,7 +12,7 @@ android:id="@+id/progress_bar_view_image_or_gif_activity" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_centerInParent="true" /> + android:layout_gravity="center" /> <com.github.piasy.biv.view.BigImageView android:id="@+id/image_view_view_image_or_gif_activity" @@ -40,4 +40,61 @@ </LinearLayout> -</RelativeLayout> + <com.google.android.material.bottomappbar.BottomAppBar + android:id="@+id/bottom_navigation_view_image_or_gif_activity" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_gravity="bottom" + android:backgroundTint="#80000000" + android:visibility="gone" + style="@style/Widget.MaterialComponents.BottomAppBar"> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content"> + + <TextView + android:id="@+id/title_text_view_view_image_or_gif_activity" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_weight="1" + android:layout_gravity="center_vertical" + android:gravity="center_vertical" + android:paddingTop="8dp" + android:paddingBottom="8dp" + android:textColor="#FFFFFF" + android:textSize="?attr/font_20" + android:fontFamily="?attr/font_family" + android:maxLines="1" + android:ellipsize="end" /> + + <ImageView + android:id="@+id/download_image_view_view_image_or_gif_activity" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:padding="16dp" + android:src="@drawable/ic_file_download_toolbar_white_24dp" + android:background="?attr/selectableItemBackgroundBorderless" /> + + <ImageView + android:id="@+id/share_image_view_view_image_or_gif_activity" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:padding="16dp" + android:src="@drawable/ic_share_toolbar_white_24dp" + android:background="?attr/selectableItemBackgroundBorderless" /> + + <ImageView + android:id="@+id/wallpaper_image_view_view_image_or_gif_activity" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginEnd="16dp" + android:padding="16dp" + android:src="@drawable/ic_wallpaper_white_24dp" + android:background="?attr/selectableItemBackgroundBorderless" /> + + </LinearLayout> + + </com.google.android.material.bottomappbar.BottomAppBar> + +</androidx.coordinatorlayout.widget.CoordinatorLayout> diff --git a/app/src/main/res/layout/activity_view_imgur_media.xml b/app/src/main/res/layout/activity_view_imgur_media.xml index 0b29fb8b..408ddff4 100644 --- a/app/src/main/res/layout/activity_view_imgur_media.xml +++ b/app/src/main/res/layout/activity_view_imgur_media.xml @@ -23,10 +23,10 @@ android:layout_height="wrap_content" android:layout_centerInParent="true" /> - <androidx.viewpager.widget.ViewPager + <ml.docilealligator.infinityforreddit.customviews.ViewPagerBugFixed + android:id="@+id/view_pager_view_imgur_media_activity" android:layout_width="match_parent" - android:layout_height="match_parent" - android:id="@+id/view_pager_view_imgur_media_activity" /> + android:layout_height="match_parent" /> <LinearLayout android:id="@+id/load_image_error_linear_layout_view_imgur_media_activity" diff --git a/app/src/main/res/layout/activity_view_post_detail.xml b/app/src/main/res/layout/activity_view_post_detail.xml index d16899f3..da98158d 100644 --- a/app/src/main/res/layout/activity_view_post_detail.xml +++ b/app/src/main/res/layout/activity_view_post_detail.xml @@ -47,4 +47,77 @@ app:tint="@android:color/white" app:srcCompat="@drawable/ic_keyboard_arrow_down_24dp" /> + <com.google.android.material.card.MaterialCardView + android:id="@+id/search_panel_material_card_view_view_post_detail_activity" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_gravity="bottom" + android:visibility="gone" + app:cardElevation="16dp"> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:paddingStart="0dp" + android:paddingEnd="8dp"> + + <com.google.android.material.textfield.TextInputLayout + android:id="@+id/search_text_input_layout_view_post_detail_activity" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_weight="1" + android:paddingTop="8dp" + android:paddingBottom="8dp" + android:paddingStart="16dp" + android:paddingEnd="16dp" + style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"> + + <com.google.android.material.textfield.TextInputEditText + android:id="@+id/search_text_input_edit_text_view_post_detail_activity" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:fontFamily="?attr/font_family" + android:textSize="?attr/font_default" + android:hint="@string/search_comments" + android:maxLines="1" /> + + </com.google.android.material.textfield.TextInputLayout> + + <ImageView + android:id="@+id/previous_result_image_view_view_post_detail_activity" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center_vertical" + android:padding="8dp" + android:src="@drawable/ic_arrow_upward_black_24dp" + android:background="?actionBarItemBackground" + android:clickable="true" + android:focusable="true" /> + + <ImageView + android:id="@+id/next_result_image_view_view_post_detail_activity" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center_vertical" + android:padding="8dp" + android:src="@drawable/ic_arrow_downward_black_24dp" + android:background="?actionBarItemBackground" + android:clickable="true" + android:focusable="true" /> + + <ImageView + android:id="@+id/close_search_panel_image_view_view_post_detail_activity" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center_vertical" + android:padding="8dp" + android:src="@drawable/ic_close_black_24dp" + android:background="?actionBarItemBackground" + android:clickable="true" + android:focusable="true" /> + + </LinearLayout> + + </com.google.android.material.card.MaterialCardView> + </androidx.coordinatorlayout.widget.CoordinatorLayout>
\ No newline at end of file diff --git a/app/src/main/res/layout/activity_view_reddit_gallery.xml b/app/src/main/res/layout/activity_view_reddit_gallery.xml index d0bff7c2..6027fce2 100644 --- a/app/src/main/res/layout/activity_view_reddit_gallery.xml +++ b/app/src/main/res/layout/activity_view_reddit_gallery.xml @@ -13,7 +13,7 @@ android:layout_height="match_parent" android:fillViewport="true"> - <androidx.viewpager.widget.ViewPager + <ml.docilealligator.infinityforreddit.customviews.ViewPagerBugFixed android:id="@+id/view_pager_view_reddit_gallery_activity" android:layout_width="match_parent" android:layout_height="match_parent" /> diff --git a/app/src/main/res/layout/activity_wiki.xml b/app/src/main/res/layout/activity_wiki.xml new file mode 100644 index 00000000..c8f49864 --- /dev/null +++ b/app/src/main/res/layout/activity_wiki.xml @@ -0,0 +1,77 @@ +<?xml version="1.0" encoding="utf-8"?> +<androidx.coordinatorlayout.widget.CoordinatorLayout 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="match_parent" + android:id="@+id/coordinator_layout_comment_wiki_activity" + tools:context=".activities.WikiActivity"> + + <com.google.android.material.appbar.AppBarLayout + android:id="@+id/appbar_layout_comment_wiki_activity" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:theme="@style/AppTheme.AppBarOverlay"> + + <com.google.android.material.appbar.CollapsingToolbarLayout + android:layout_width="match_parent" + android:layout_height="match_parent" + app:layout_scrollFlags="scroll|enterAlways" + app:titleEnabled="false" + app:toolbarId="@+id/toolbar_comment_wiki_activity"> + + <androidx.appcompat.widget.Toolbar + android:id="@+id/toolbar_comment_wiki_activity" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:minHeight="?attr/actionBarSize" + app:popupTheme="@style/AppTheme.PopupOverlay" + app:navigationIcon="?attr/homeAsUpIndicator" /> + + </com.google.android.material.appbar.CollapsingToolbarLayout> + + </com.google.android.material.appbar.AppBarLayout> + + <androidx.swiperefreshlayout.widget.SwipeRefreshLayout + android:id="@+id/swipe_refresh_layout_wiki_activity" + android:layout_width="match_parent" + android:layout_height="match_parent" + app:layout_behavior="@string/appbar_scrolling_view_behavior"> + + <androidx.recyclerview.widget.RecyclerView + android:id="@+id/content_markdown_view_comment_wiki_activity" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:paddingStart="16dp" + android:paddingEnd="16dp" /> + + </androidx.swiperefreshlayout.widget.SwipeRefreshLayout> + + <LinearLayout + android:id="@+id/fetch_wiki_linear_layout_wiki_activity" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:layout_marginTop="48dp" + android:layout_marginBottom="48dp" + android:gravity="center" + android:orientation="vertical" + android:visibility="gone" + app:layout_behavior="@string/appbar_scrolling_view_behavior" > + + <ImageView + android:id="@+id/fetch_wiki_image_view_wiki_activity" + android:layout_width="150dp" + android:layout_height="wrap_content" /> + + <TextView + android:id="@+id/fetch_wiki_text_view_wiki_activity" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginTop="16dp" + android:gravity="center" + android:textSize="?attr/font_default" + android:fontFamily="?attr/font_family" /> + + </LinearLayout> + +</androidx.coordinatorlayout.widget.CoordinatorLayout>
\ No newline at end of file diff --git a/app/src/main/res/layout/exo_autoplay_playback_control_view.xml b/app/src/main/res/layout/exo_autoplay_playback_control_view.xml index 438d0172..4f7020c4 100644 --- a/app/src/main/res/layout/exo_autoplay_playback_control_view.xml +++ b/app/src/main/res/layout/exo_autoplay_playback_control_view.xml @@ -1,92 +1,122 @@ <?xml version="1.0" encoding="utf-8"?> -<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" +<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" + xmlns:tools="http://schemas.android.com/tools" android:id="@+id/linear_layout_exo_playback_control_view" android:layout_width="match_parent" - android:layout_height="wrap_content" - android:paddingStart="8dp" - android:paddingEnd="8dp" + android:layout_height="match_parent" android:layout_gravity="bottom" - android:orientation="vertical" - android:background="@drawable/background_autoplay"> + android:orientation="vertical"> - <RelativeLayout - android:layout_width="match_parent" - android:layout_height="wrap_content"> - - <TextView - android:id="@id/exo_position" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_alignParentStart="true" - android:layout_centerVertical="true" - android:includeFontPadding="false" - android:layout_marginStart="8dp" - android:textColor="#FFFFFF" - android:textSize="12sp" - android:textStyle="bold" - android:fontFamily="?attr/font_family" /> + <ImageView + android:id="@+id/mute_exo_playback_control_view" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:padding="8dp" + android:layout_toStartOf="@id/fullscreen_exo_playback_control_view" + android:src="@drawable/ic_mute_white_rounded_24dp" + android:background="@drawable/exo_player_control_button_circular_background" + android:clickable="true" + android:focusable="true" + android:visibility="gone" + tools:visibility="visible" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintEnd_toStartOf="@id/frame_layout" /> - <TextView - android:id="@+id/slash" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_toEndOf="@id/exo_position" - android:layout_centerVertical="true" - android:text="/" - android:textColor="#FFFFFF" - android:textSize="12sp" - android:textStyle="bold" - android:fontFamily="?attr/font_family" /> + <ImageView + android:id="@+id/fullscreen_exo_playback_control_view" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:padding="8dp" + android:layout_alignParentEnd="true" + android:src="@drawable/ic_fullscreen_white_rounded_24dp" + android:background="@drawable/exo_player_control_button_circular_background" + android:clickable="true" + android:focusable="true" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toEndOf="@id/frame_layout" + app:layout_constraintEnd_toEndOf="parent" /> - <TextView android:id="@id/exo_duration" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_toEndOf="@id/slash" - android:layout_centerVertical="true" - android:includeFontPadding="false" - android:textColor="#FFFFFF" - android:textSize="12sp" - android:textStyle="bold" - android:fontFamily="?attr/font_family" /> + <FrameLayout + android:id="@+id/frame_layout" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintEnd_toEndOf="parent"> <ImageView android:id="@id/exo_play" android:layout_width="wrap_content" android:layout_height="wrap_content" android:padding="8dp" android:layout_centerInParent="true" - android:src="@drawable/ic_play_arrow_white_rounded_18dp" /> + android:src="@drawable/ic_play_arrow_white_rounded_24dp" + android:background="@drawable/exo_player_control_button_circular_background" + android:clickable="true" + android:focusable="true" /> <ImageView android:id="@id/exo_pause" android:layout_width="wrap_content" android:layout_height="wrap_content" android:padding="8dp" android:layout_centerInParent="true" - android:src="@drawable/ic_pause_white_rounded_18dp" /> + android:src="@drawable/ic_pause_white_rounded_24dp" + android:background="@drawable/exo_player_control_button_circular_background" + android:clickable="true" + android:focusable="true" /> + + </FrameLayout> - <ImageView - android:id="@+id/mute_exo_playback_control_view" + <androidx.constraintlayout.widget.ConstraintLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:paddingTop="16dp" + android:background="@drawable/background_autoplay" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintEnd_toEndOf="parent"> + + <TextView + android:id="@id/exo_position" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:padding="8dp" - android:layout_toStartOf="@id/fullscreen_exo_playback_control_view" - android:src="@drawable/ic_mute_white_rounded_18dp" - android:visibility="gone" /> + android:includeFontPadding="false" + android:layout_marginStart="16dp" + android:textColor="#FFFFFF" + android:textSize="?attr/font_default" + android:textStyle="bold" + android:fontFamily="?attr/font_family" + app:layout_constraintBottom_toTopOf="@id/exo_progress" + app:layout_constraintStart_toStartOf="parent" /> - <ImageView - android:id="@+id/fullscreen_exo_playback_control_view" + <TextView android:id="@id/exo_duration" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:padding="8dp" - android:layout_alignParentEnd="true" - android:src="@drawable/ic_fullscreen_white_rounded_18dp" /> + android:includeFontPadding="false" + android:layout_marginEnd="16dp" + android:textColor="#FFFFFF" + android:textSize="?attr/font_default" + android:textStyle="bold" + android:fontFamily="?attr/font_family" + app:layout_constraintBottom_toTopOf="@id/exo_progress" + app:layout_constraintEnd_toEndOf="parent" /> - </RelativeLayout> + <com.google.android.exoplayer2.ui.DefaultTimeBar + android:id="@id/exo_progress" + android:layout_width="match_parent" + android:layout_height="24dp" + android:layout_marginBottom="8dp" + android:layout_marginStart="8dp" + android:layout_marginEnd="8dp" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:bar_height="2dp" /> - <com.google.android.exoplayer2.ui.DefaultTimeBar - android:id="@id/exo_progress" - android:layout_width="wrap_content" - android:layout_height="24dp" - app:bar_height="2dp" /> + </androidx.constraintlayout.widget.ConstraintLayout> -</LinearLayout>
\ No newline at end of file +</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file diff --git a/app/src/main/res/layout/exo_playback_control_view.xml b/app/src/main/res/layout/exo_playback_control_view.xml index dd9bef64..b81b5026 100644 --- a/app/src/main/res/layout/exo_playback_control_view.xml +++ b/app/src/main/res/layout/exo_playback_control_view.xml @@ -58,7 +58,7 @@ android:paddingLeft="4dp" android:paddingRight="4dp" android:includeFontPadding="false" - android:textColor="#FFBEBEBE" + android:textColor="#FFFFFF" android:fontFamily="?attr/font_family" /> <com.google.android.exoplayer2.ui.DefaultTimeBar @@ -78,9 +78,49 @@ android:paddingLeft="4dp" android:paddingRight="4dp" android:includeFontPadding="false" - android:textColor="#FFBEBEBE" + android:textColor="#FFFFFF" android:fontFamily="?attr/font_family" /> </LinearLayout> + <com.google.android.material.bottomappbar.BottomAppBar + android:id="@+id/bottom_navigation_exo_playback_control_view" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_gravity="bottom" + android:backgroundTint="#80000000" + android:visibility="gone" + style="@style/Widget.MaterialComponents.BottomAppBar"> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content"> + + <TextView + android:id="@+id/title_text_view_exo_playback_control_view" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_weight="1" + android:layout_gravity="center_vertical" + android:gravity="center_vertical" + android:paddingTop="8dp" + android:paddingBottom="8dp" + android:textColor="#FFFFFF" + android:textSize="?attr/font_20" + android:fontFamily="?attr/font_family" + android:maxLines="1" + android:ellipsize="end" /> + + <ImageView + android:id="@+id/download_image_view_exo_playback_control_view" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:padding="16dp" + android:src="@drawable/ic_file_download_toolbar_white_24dp" + android:background="?attr/selectableItemBackgroundBorderless" /> + + </LinearLayout> + + </com.google.android.material.bottomappbar.BottomAppBar> + </LinearLayout>
\ No newline at end of file diff --git a/app/src/main/res/layout/exo_rpan_broadcast_playback_control_view.xml b/app/src/main/res/layout/exo_rpan_broadcast_playback_control_view.xml index da7faea2..7922dc7a 100644 --- a/app/src/main/res/layout/exo_rpan_broadcast_playback_control_view.xml +++ b/app/src/main/res/layout/exo_rpan_broadcast_playback_control_view.xml @@ -1,47 +1,137 @@ <?xml version="1.0" encoding="utf-8"?> <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:background="#44000000" android:id="@+id/constraint_layout_exo_rpan_broadcast_playback_control_view" + android:focusableInTouchMode="true" xmlns:app="http://schemas.android.com/apk/res-auto"> - <LinearLayout + <androidx.constraintlayout.widget.ConstraintLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:paddingStart="16dp" + android:paddingEnd="16dp" + app:layout_constraintBottom_toTopOf="@id/title_text_view_exo_rpan_broadcast_playback_control_view" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintVertical_bias="1"> + + <ImageView + android:id="@+id/subreddit_icon_image_view_exo_rpan_broadcast_playback_control_view" + android:layout_width="24dp" + android:layout_height="24dp" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toStartOf="parent" /> + + <TextView + android:id="@+id/subreddit_name_text_view_exo_rpan_broadcast_playback_control_view" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:paddingBottom="4dp" + android:paddingStart="16dp" + android:paddingEnd="16dp" + android:textColor="@color/colorAccent" + app:layout_constraintBottom_toTopOf="@id/username_text_view_exo_rpan_broadcast_playback_control_view" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintStart_toEndOf="@id/barrier5" /> + + <TextView + android:id="@+id/username_text_view_exo_rpan_broadcast_playback_control_view" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:paddingStart="16dp" + android:paddingEnd="16dp" + android:textColor="#02BAEE" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toEndOf="@id/barrier5" /> + + <androidx.constraintlayout.widget.Barrier + android:id="@+id/barrier5" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + app:barrierDirection="end" + app:constraint_referenced_ids="subreddit_icon_image_view_exo_rpan_broadcast_playback_control_view" /> + + </androidx.constraintlayout.widget.ConstraintLayout> + + <TextView + android:id="@+id/title_text_view_exo_rpan_broadcast_playback_control_view" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:padding="16dp" + android:textColor="#FFFFFF" + android:textSize="20sp" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintBottom_toTopOf="@id/control_linear_layout" + app:layout_constraintVertical_bias="1" /> + + <androidx.constraintlayout.widget.ConstraintLayout android:id="@+id/control_linear_layout" android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center" - android:paddingTop="4dp" android:orientation="horizontal" - app:layout_constraintTop_toTopOf="parent" + android:paddingTop="4dp" app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintEnd_toEndOf="parent"> + app:layout_constraintTop_toTopOf="parent"> <ImageButton android:id="@+id/hd_exo_rpan_broadcast_playback_control_view" - android:src="@drawable/ic_video_quality_24dp" style="@style/ExoMediaButton" - android:visibility="gone" /> + android:src="@drawable/ic_video_quality_24dp" + android:visibility="gone" + app:layout_constraintEnd_toStartOf="@+id/exo_rew" + app:layout_constraintHorizontal_bias="0.5" + app:layout_constraintHorizontal_chainStyle="spread_inside" + app:layout_constraintStart_toStartOf="parent" + tools:layout_editor_absoluteY="4dp" /> - <ImageButton android:id="@id/exo_rew" - style="@style/ExoMediaButton.Rewind" /> + <ImageButton + android:id="@id/exo_rew" + style="@style/ExoMediaButton.Rewind" + app:layout_constraintEnd_toStartOf="@+id/exo_play" + app:layout_constraintHorizontal_bias="0.5" + app:layout_constraintStart_toEndOf="@+id/hd_exo_rpan_broadcast_playback_control_view" + tools:layout_editor_absoluteY="4dp" /> - <ImageButton android:id="@id/exo_play" - style="@style/ExoMediaButton.Play"/> + <ImageButton + android:id="@id/exo_play" + style="@style/ExoMediaButton.Play" + app:layout_constraintEnd_toStartOf="@+id/exo_pause" + app:layout_constraintHorizontal_bias="0.5" + app:layout_constraintStart_toEndOf="@+id/exo_rew" + tools:layout_editor_absoluteY="4dp" /> - <ImageButton android:id="@id/exo_pause" - style="@style/ExoMediaButton.Pause" /> + <ImageButton + android:id="@id/exo_pause" + style="@style/ExoMediaButton.Pause" + app:layout_constraintEnd_toStartOf="@+id/exo_ffwd" + app:layout_constraintHorizontal_bias="0.5" + app:layout_constraintStart_toEndOf="@+id/exo_play" + tools:layout_editor_absoluteY="4dp" /> - <ImageButton android:id="@id/exo_ffwd" - style="@style/ExoMediaButton.FastForward" /> + <ImageButton + android:id="@id/exo_ffwd" + style="@style/ExoMediaButton.FastForward" + app:layout_constraintEnd_toStartOf="@+id/mute_exo_rpan_broadcast_playback_control_view" + app:layout_constraintHorizontal_bias="0.5" + app:layout_constraintStart_toEndOf="@+id/exo_pause" + tools:layout_editor_absoluteY="4dp" /> <ImageButton android:id="@+id/mute_exo_rpan_broadcast_playback_control_view" style="@style/ExoMediaButton" - android:visibility="gone" /> + android:visibility="gone" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintHorizontal_bias="0.5" + app:layout_constraintStart_toEndOf="@+id/exo_ffwd" + tools:layout_editor_absoluteY="4dp" /> - </LinearLayout> + </androidx.constraintlayout.widget.ConstraintLayout> <androidx.recyclerview.widget.RecyclerView android:id="@+id/recycler_view_exo_rpan_broadcast_playback_control_view" @@ -52,7 +142,7 @@ android:paddingEnd="16dp" app:layout_constraintTop_toBottomOf="@id/control_linear_layout" app:layout_constraintBottom_toTopOf="@id/time_bar_linear_layout" - app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" /> + app:layoutManager=".customviews.LinearLayoutManagerBugFixed" /> <LinearLayout android:id="@+id/time_bar_linear_layout" diff --git a/app/src/main/res/layout/fragment_crash_reports.xml b/app/src/main/res/layout/fragment_crash_reports.xml index bc87d22c..3756ef57 100644 --- a/app/src/main/res/layout/fragment_crash_reports.xml +++ b/app/src/main/res/layout/fragment_crash_reports.xml @@ -3,4 +3,6 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" + xmlns:app="http://schemas.android.com/apk/res-auto" + app:layoutManager=".customviews.LinearLayoutManagerBugFixed" tools:context=".settings.CrashReportsFragment" />
\ No newline at end of file diff --git a/app/src/main/res/layout/fragment_flair_bottom_sheet.xml b/app/src/main/res/layout/fragment_flair_bottom_sheet.xml index 7827bb3a..f3ed6751 100644 --- a/app/src/main/res/layout/fragment_flair_bottom_sheet.xml +++ b/app/src/main/res/layout/fragment_flair_bottom_sheet.xml @@ -3,6 +3,7 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" + xmlns:app="http://schemas.android.com/apk/res-auto" android:orientation="vertical" tools:application=".FlairBottomSheetFragment"> @@ -39,6 +40,7 @@ <androidx.recyclerview.widget.RecyclerView android:id="@+id/recycler_view_bottom_sheet_fragment" android:layout_width="match_parent" - android:layout_height="match_parent" /> + android:layout_height="match_parent" + app:layoutManager=".customviews.LinearLayoutManagerBugFixed" /> </LinearLayout>
\ No newline at end of file diff --git a/app/src/main/res/layout/fragment_inbox.xml b/app/src/main/res/layout/fragment_inbox.xml index 3fcaecbf..7b45b676 100644 --- a/app/src/main/res/layout/fragment_inbox.xml +++ b/app/src/main/res/layout/fragment_inbox.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" +<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" @@ -22,7 +22,7 @@ android:id="@+id/fetch_messages_info_linear_layout_inbox_fragment" android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_centerInParent="true" + android:layout_gravity="center" android:gravity="center" android:orientation="vertical" android:visibility="gone"> @@ -43,4 +43,4 @@ </LinearLayout> -</RelativeLayout>
\ No newline at end of file +</FrameLayout>
\ No newline at end of file diff --git a/app/src/main/res/layout/fragment_post_type_bottom_sheet.xml b/app/src/main/res/layout/fragment_post_type_bottom_sheet.xml index e89e36a2..7138d814 100644 --- a/app/src/main/res/layout/fragment_post_type_bottom_sheet.xml +++ b/app/src/main/res/layout/fragment_post_type_bottom_sheet.xml @@ -86,6 +86,25 @@ android:focusable="true" android:background="?attr/selectableItemBackground" /> + <TextView + android:id="@+id/gallery_type_linear_layout_post_type_bottom_sheet_fragment" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:gravity="center_vertical" + android:paddingTop="16dp" + android:paddingBottom="16dp" + android:paddingStart="32dp" + android:paddingEnd="32dp" + android:text="@string/bottom_sheet_post_gallery" + android:textColor="?attr/primaryTextColor" + android:textSize="?attr/font_default" + android:fontFamily="?attr/font_family" + android:drawableStart="@drawable/ic_gallery_24dp" + android:drawablePadding="48dp" + android:clickable="true" + android:focusable="true" + android:background="?attr/selectableItemBackground" /> + </LinearLayout> </androidx.core.widget.NestedScrollView>
\ No newline at end of file diff --git a/app/src/main/res/layout/fragment_select_or_capture_image_bottom_sheet.xml b/app/src/main/res/layout/fragment_select_or_capture_image_bottom_sheet.xml new file mode 100644 index 00000000..55f60691 --- /dev/null +++ b/app/src/main/res/layout/fragment_select_or_capture_image_bottom_sheet.xml @@ -0,0 +1,53 @@ +<?xml version="1.0" encoding="utf-8"?> +<androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:paddingBottom="8dp" + android:overScrollMode="never"> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="vertical"> + + <TextView + android:id="@+id/select_image_text_view_select_or_capture_image_bottom_sheet_fragment" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:gravity="center_vertical" + android:paddingTop="16dp" + android:paddingBottom="16dp" + android:paddingStart="32dp" + android:paddingEnd="32dp" + android:text="@string/select_image" + android:textColor="?attr/primaryTextColor" + android:textSize="?attr/font_default" + android:fontFamily="?attr/font_family" + android:drawableStart="@drawable/ic_outline_select_photo_day_night_24dp" + android:drawablePadding="48dp" + android:clickable="true" + android:focusable="true" + android:background="?attr/selectableItemBackground" /> + + <TextView + android:id="@+id/capture_image_text_view_select_or_capture_image_bottom_sheet_fragment" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:gravity="center_vertical" + android:paddingTop="16dp" + android:paddingBottom="16dp" + android:paddingStart="32dp" + android:paddingEnd="32dp" + android:text="@string/capture" + android:textColor="?attr/primaryTextColor" + android:textSize="?attr/font_default" + android:fontFamily="?attr/font_family" + android:drawableStart="@drawable/ic_outline_add_a_photo_day_night_24dp" + android:drawablePadding="48dp" + android:clickable="true" + android:focusable="true" + android:background="?attr/selectableItemBackground" /> + + </LinearLayout> + +</androidx.core.widget.NestedScrollView>
\ No newline at end of file diff --git a/app/src/main/res/layout/fragment_translation.xml b/app/src/main/res/layout/fragment_translation.xml index a4a58ed6..a0cb2ea7 100644 --- a/app/src/main/res/layout/fragment_translation.xml +++ b/app/src/main/res/layout/fragment_translation.xml @@ -3,5 +3,7 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" + xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/recycler_view_translation_fragment" + app:layoutManager=".customviews.LinearLayoutManagerBugFixed" tools:context=".settings.TranslationFragment" />
\ No newline at end of file diff --git a/app/src/main/res/layout/fragment_uploaded_images_bottom_sheet.xml b/app/src/main/res/layout/fragment_uploaded_images_bottom_sheet.xml index 79b6fa82..f3e96ef5 100644 --- a/app/src/main/res/layout/fragment_uploaded_images_bottom_sheet.xml +++ b/app/src/main/res/layout/fragment_uploaded_images_bottom_sheet.xml @@ -40,7 +40,7 @@ android:layout_margin="16dp" android:backgroundTint="@color/colorPrimary" android:textColor="#FFFFFF" - android:text="@string/upload" /> + android:text="@string/select_image" /> </LinearLayout> diff --git a/app/src/main/res/layout/fragment_view_imgur_image.xml b/app/src/main/res/layout/fragment_view_imgur_image.xml new file mode 100644 index 00000000..78bde93d --- /dev/null +++ b/app/src/main/res/layout/fragment_view_imgur_image.xml @@ -0,0 +1,97 @@ +<?xml version="1.0" encoding="utf-8"?> +<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:tools="http://schemas.android.com/tools" + xmlns:app="http://schemas.android.com/apk/res-auto" + android:id="@+id/constraintLayout" + android:layout_width="match_parent" + android:layout_height="match_parent" + tools:context=".fragments.ViewImgurImageFragment"> + + <ProgressBar + android:id="@+id/progress_bar_view_imgur_image_fragment" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center" /> + + <com.davemorrissey.labs.subscaleview.SubsamplingScaleImageView + android:id="@+id/image_view_view_imgur_image_fragment" + android:layout_width="match_parent" + android:layout_height="match_parent" /> + + <LinearLayout + android:id="@+id/load_image_error_linear_layout_view_imgur_image_fragment" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:visibility="gone"> + + <TextView + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:drawableTop="@drawable/ic_error_outline_white_24dp" + android:layout_gravity="center" + android:gravity="center" + android:textColor="@android:color/white" + android:text="@string/error_loading_image_tap_to_retry" + android:textSize="?attr/font_default" + android:fontFamily="?attr/font_family" /> + + </LinearLayout> + + <com.google.android.material.bottomappbar.BottomAppBar + android:id="@+id/bottom_navigation_view_imgur_image_fragment" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_gravity="bottom" + android:backgroundTint="#80000000" + android:visibility="gone" + style="@style/Widget.MaterialComponents.BottomAppBar"> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content"> + + <TextView + android:id="@+id/title_text_view_view_imgur_image_fragment" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_weight="1" + android:layout_gravity="center_vertical" + android:gravity="center_vertical" + android:paddingTop="8dp" + android:paddingBottom="8dp" + android:textColor="#FFFFFF" + android:textSize="?attr/font_20" + android:fontFamily="?attr/font_family" + android:maxLines="1" + android:ellipsize="end" /> + + <ImageView + android:id="@+id/download_image_view_view_imgur_image_fragment" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:padding="16dp" + android:src="@drawable/ic_file_download_toolbar_white_24dp" + android:background="?attr/selectableItemBackgroundBorderless" /> + + <ImageView + android:id="@+id/share_image_view_view_imgur_image_fragment" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:padding="16dp" + android:src="@drawable/ic_share_toolbar_white_24dp" + android:background="?attr/selectableItemBackgroundBorderless" /> + + <ImageView + android:id="@+id/wallpaper_image_view_view_imgur_image_fragment" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginEnd="16dp" + android:padding="16dp" + android:src="@drawable/ic_wallpaper_white_24dp" + android:background="?attr/selectableItemBackgroundBorderless" /> + + </LinearLayout> + + </com.google.android.material.bottomappbar.BottomAppBar> + +</androidx.coordinatorlayout.widget.CoordinatorLayout>
\ No newline at end of file diff --git a/app/src/main/res/layout/fragment_view_imgur_images.xml b/app/src/main/res/layout/fragment_view_imgur_images.xml deleted file mode 100644 index 7a658b92..00000000 --- a/app/src/main/res/layout/fragment_view_imgur_images.xml +++ /dev/null @@ -1,40 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:tools="http://schemas.android.com/tools" - xmlns:app="http://schemas.android.com/apk/res-auto" - android:id="@+id/constraintLayout" - android:layout_width="match_parent" - android:layout_height="match_parent" - tools:context=".fragments.ViewImgurImageFragment"> - - <ProgressBar - android:id="@+id/progress_bar_view_imgur_image_fragment" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_centerInParent="true" /> - - <com.davemorrissey.labs.subscaleview.SubsamplingScaleImageView - android:id="@+id/image_view_view_imgur_image_fragment" - android:layout_width="match_parent" - android:layout_height="match_parent" /> - - <LinearLayout - android:id="@+id/load_image_error_linear_layout_view_imgur_image_fragment" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:visibility="gone"> - - <TextView - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:drawableTop="@drawable/ic_error_outline_white_24dp" - android:layout_gravity="center" - android:gravity="center" - android:textColor="@android:color/white" - android:text="@string/error_loading_image_tap_to_retry" - android:textSize="?attr/font_default" - android:fontFamily="?attr/font_family" /> - - </LinearLayout> - -</RelativeLayout>
\ No newline at end of file diff --git a/app/src/main/res/layout/fragment_view_imgur_video.xml b/app/src/main/res/layout/fragment_view_imgur_video.xml index 19331536..824a6b02 100644 --- a/app/src/main/res/layout/fragment_view_imgur_video.xml +++ b/app/src/main/res/layout/fragment_view_imgur_video.xml @@ -1,15 +1,9 @@ <?xml version="1.0" encoding="utf-8"?> -<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" +<com.google.android.exoplayer2.ui.PlayerView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" + android:id="@+id/player_view_view_imgur_video_fragment" xmlns:app="http://schemas.android.com/apk/res-auto" - tools:context=".fragments.ViewImgurVideoFragment"> - - <com.google.android.exoplayer2.ui.PlayerView - android:id="@+id/player_view_view_imgur_video_fragment" - android:layout_width="match_parent" - android:layout_height="match_parent" - app:controller_layout_id="@layout/exo_playback_control_view"/> - -</RelativeLayout>
\ No newline at end of file + app:controller_layout_id="@layout/exo_playback_control_view" + tools:context=".fragments.ViewImgurVideoFragment" />
\ No newline at end of file diff --git a/app/src/main/res/layout/fragment_view_post_detail.xml b/app/src/main/res/layout/fragment_view_post_detail.xml index 7875516b..72b9e3d0 100644 --- a/app/src/main/res/layout/fragment_view_post_detail.xml +++ b/app/src/main/res/layout/fragment_view_post_detail.xml @@ -17,7 +17,8 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:paddingBottom="144dp" - android:clipToPadding="false" /> + android:clipToPadding="false" + app:layoutManager=".customviews.LinearLayoutManagerBugFixed" /> </androidx.swiperefreshlayout.widget.SwipeRefreshLayout> diff --git a/app/src/main/res/layout/fragment_view_reddit_gallery_image_or_gif.xml b/app/src/main/res/layout/fragment_view_reddit_gallery_image_or_gif.xml index 7f27835d..b41c5600 100644 --- a/app/src/main/res/layout/fragment_view_reddit_gallery_image_or_gif.xml +++ b/app/src/main/res/layout/fragment_view_reddit_gallery_image_or_gif.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" +<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/constraintLayout" @@ -11,7 +11,7 @@ android:id="@+id/progress_bar_view_reddit_gallery_image_or_gif_fragment" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_centerInParent="true" /> + android:layout_gravity="center" /> <com.github.piasy.biv.view.BigImageView android:id="@+id/image_view_view_reddit_gallery_image_or_gif_fragment" @@ -39,4 +39,61 @@ </LinearLayout> -</RelativeLayout>
\ No newline at end of file + <com.google.android.material.bottomappbar.BottomAppBar + android:id="@+id/bottom_navigation_view_reddit_gallery_image_or_gif_fragment" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_gravity="bottom" + android:backgroundTint="#80000000" + android:visibility="gone" + style="@style/Widget.MaterialComponents.BottomAppBar"> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content"> + + <TextView + android:id="@+id/title_text_view_view_reddit_gallery_image_or_gif_fragment" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_weight="1" + android:layout_gravity="center_vertical" + android:gravity="center_vertical" + android:paddingTop="8dp" + android:paddingBottom="8dp" + android:textColor="#FFFFFF" + android:textSize="?attr/font_20" + android:fontFamily="?attr/font_family" + android:maxLines="1" + android:ellipsize="end" /> + + <ImageView + android:id="@+id/download_image_view_view_reddit_gallery_image_or_gif_fragment" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:padding="16dp" + android:src="@drawable/ic_file_download_toolbar_white_24dp" + android:background="?attr/selectableItemBackgroundBorderless" /> + + <ImageView + android:id="@+id/share_image_view_view_reddit_gallery_image_or_gif_fragment" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:padding="16dp" + android:src="@drawable/ic_share_toolbar_white_24dp" + android:background="?attr/selectableItemBackgroundBorderless" /> + + <ImageView + android:id="@+id/wallpaper_image_view_view_reddit_gallery_image_or_gif_fragment" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginEnd="16dp" + android:padding="16dp" + android:src="@drawable/ic_wallpaper_white_24dp" + android:background="?attr/selectableItemBackgroundBorderless" /> + + </LinearLayout> + + </com.google.android.material.bottomappbar.BottomAppBar> + +</androidx.coordinatorlayout.widget.CoordinatorLayout>
\ No newline at end of file diff --git a/app/src/main/res/layout/fragment_view_rpan_broadcast.xml b/app/src/main/res/layout/fragment_view_rpan_broadcast.xml index 6a5aedf4..abab4f52 100644 --- a/app/src/main/res/layout/fragment_view_rpan_broadcast.xml +++ b/app/src/main/res/layout/fragment_view_rpan_broadcast.xml @@ -10,7 +10,6 @@ android:id="@+id/player_view_view_rpan_broadcast_fragment" android:layout_width="match_parent" android:layout_height="match_parent" - app:controller_layout_id="@layout/exo_rpan_broadcast_playback_control_view" - app:show_timeout="0" /> + app:controller_layout_id="@layout/exo_rpan_broadcast_playback_control_view" /> </FrameLayout>
\ No newline at end of file diff --git a/app/src/main/res/layout/item_comment.xml b/app/src/main/res/layout/item_comment.xml index 1e4740eb..f72eadc0 100644 --- a/app/src/main/res/layout/item_comment.xml +++ b/app/src/main/res/layout/item_comment.xml @@ -3,227 +3,220 @@ 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:orientation="vertical" - android:background="?attr/cardViewBackgroundColor"> + android:layout_height="wrap_content"> + + <ml.docilealligator.infinityforreddit.customviews.CommentIndentationView + android:id="@+id/vertical_block_indentation_item_comment" + android:layout_width="wrap_content" + android:layout_height="match_parent" /> <LinearLayout + android:id="@+id/linear_layout_item_comment" android:layout_width="match_parent" - android:layout_height="wrap_content"> - - <ml.docilealligator.infinityforreddit.customviews.CommentIndentationView - android:id="@+id/vertical_block_indentation_item_comment" - android:layout_width="wrap_content" - android:layout_height="match_parent" /> + android:layout_height="wrap_content" + android:layout_marginTop="12dp" + android:orientation="vertical" + android:animateLayoutChanges="true"> - <LinearLayout + <androidx.constraintlayout.widget.ConstraintLayout android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_marginTop="12dp" - android:orientation="vertical" - android:animateLayoutChanges="true"> + android:paddingStart="16dp" + android:paddingEnd="16dp"> - <androidx.constraintlayout.widget.ConstraintLayout - android:layout_width="match_parent" + <TextView + android:id="@+id/author_text_view_item_post_comment" + android:layout_width="wrap_content" android:layout_height="wrap_content" - android:paddingStart="16dp" - android:paddingEnd="16dp"> - - <TextView - android:id="@+id/author_text_view_item_post_comment" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginEnd="8dp" - android:drawablePadding="4dp" - android:textSize="?attr/font_default" - android:fontFamily="?attr/font_family" - app:layout_constraintBottom_toTopOf="@id/author_flair_text_view_item_post_comment" - app:layout_constraintEnd_toStartOf="@+id/barrier" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toTopOf="parent" - app:layout_constrainedWidth="true" - app:layout_constraintHorizontal_bias="0" /> - - <TextView - android:id="@+id/author_flair_text_view_item_post_comment" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginEnd="8dp" - android:fontFamily="?attr/font_family" - android:textSize="?attr/font_12" - android:visibility="gone" - app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintEnd_toStartOf="@+id/barrier" - app:layout_constraintHorizontal_bias="0" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@id/author_text_view_item_post_comment" - app:layout_constrainedWidth="true" - tools:visibility="visible" /> - - <TextView - android:id="@+id/top_score_text_view_item_post_comment" - android:layout_width="0dp" - android:layout_height="wrap_content" - android:layout_marginEnd="8dp" - android:gravity="end" - android:textSize="?attr/font_default" - android:fontFamily="?attr/font_family" - app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintEnd_toStartOf="@id/comment_time_text_view_item_post_comment" - app:layout_constraintTop_toTopOf="parent" /> - - <TextView - android:id="@+id/comment_time_text_view_item_post_comment" - android:layout_width="0dp" - android:layout_height="wrap_content" - android:gravity="end" - android:textSize="?attr/font_default" - android:fontFamily="?attr/font_family" - app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintTop_toTopOf="parent" /> - - <androidx.constraintlayout.widget.Barrier - android:id="@+id/barrier" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - app:barrierDirection="start" - app:constraint_referenced_ids="top_score_text_view_item_post_comment" /> - - </androidx.constraintlayout.widget.ConstraintLayout> + android:layout_marginEnd="8dp" + android:drawablePadding="4dp" + android:textSize="?attr/font_default" + android:fontFamily="?attr/font_family" + app:layout_constraintBottom_toTopOf="@id/author_flair_text_view_item_post_comment" + app:layout_constraintEnd_toStartOf="@+id/barrier" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" + app:layout_constrainedWidth="true" + app:layout_constraintHorizontal_bias="0" /> <TextView - android:id="@+id/awards_text_view_item_comment" + android:id="@+id/author_flair_text_view_item_post_comment" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_marginTop="8dp" - android:paddingStart="16dp" - android:paddingEnd="16dp" + android:layout_marginEnd="8dp" + android:fontFamily="?attr/font_family" + android:textSize="?attr/font_12" android:visibility="gone" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toStartOf="@+id/barrier" + app:layout_constraintHorizontal_bias="0" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@id/author_text_view_item_post_comment" + app:layout_constrainedWidth="true" + tools:visibility="visible" /> + + <TextView + android:id="@+id/top_score_text_view_item_post_comment" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_marginEnd="8dp" + android:gravity="end" android:textSize="?attr/font_default" android:fontFamily="?attr/font_family" - tools:visibility="visible" /> + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toStartOf="@id/comment_time_text_view_item_post_comment" + app:layout_constraintTop_toTopOf="parent" /> <TextView - android:id="@+id/comment_markdown_view_item_post_comment" + android:id="@+id/comment_time_text_view_item_post_comment" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:gravity="end" + android:textSize="?attr/font_default" + android:fontFamily="?attr/font_family" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintTop_toTopOf="parent" /> + + <androidx.constraintlayout.widget.Barrier + android:id="@+id/barrier" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_marginTop="8dp" - android:layout_marginStart="16dp" - android:layout_marginEnd="16dp" - android:layout_marginBottom="8dp" - android:textColor="?attr/primaryTextColor" - android:textSize="?attr/content_font_default" - android:fontFamily="?attr/content_font_family" /> - - <androidx.constraintlayout.widget.ConstraintLayout - android:id="@+id/bottom_constraint_layout_item_post_comment" - android:layout_width="match_parent" + app:barrierDirection="start" + app:constraint_referenced_ids="top_score_text_view_item_post_comment" /> + + </androidx.constraintlayout.widget.ConstraintLayout> + + <TextView + android:id="@+id/awards_text_view_item_comment" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginTop="8dp" + android:paddingStart="16dp" + android:paddingEnd="16dp" + android:visibility="gone" + android:textSize="?attr/font_default" + android:fontFamily="?attr/font_family" + tools:visibility="visible" /> + + <TextView + android:id="@+id/comment_markdown_view_item_post_comment" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginTop="8dp" + android:layout_marginStart="16dp" + android:layout_marginEnd="16dp" + android:layout_marginBottom="8dp" + android:textColor="?attr/primaryTextColor" + android:textSize="?attr/content_font_default" + android:fontFamily="?attr/content_font_family" /> + + <androidx.constraintlayout.widget.ConstraintLayout + android:id="@+id/bottom_constraint_layout_item_post_comment" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:paddingStart="4dp" + android:paddingEnd="4dp"> + + <ImageView + android:id="@+id/up_vote_button_item_post_comment" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:padding="8dp" + android:background="?actionBarItemBackground" + android:clickable="true" + android:focusable="true" + android:src="@drawable/ic_arrow_upward_grey_24dp" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintBottom_toBottomOf="parent" /> + + <TextView + android:id="@+id/score_text_view_item_post_comment" + android:layout_width="64dp" + android:layout_height="wrap_content" + android:gravity="center" + android:textSize="?attr/font_12" + android:textStyle="bold" + android:fontFamily="?attr/font_family" + app:layout_constraintStart_toEndOf="@+id/up_vote_button_item_post_comment" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintBottom_toBottomOf="parent"/> + + <ImageView + android:id="@+id/down_vote_button_item_post_comment" + android:layout_width="wrap_content" android:layout_height="wrap_content" - android:paddingStart="4dp" - android:paddingEnd="4dp"> - - <ImageView - android:id="@+id/up_vote_button_item_post_comment" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:padding="8dp" - android:background="?actionBarItemBackground" - android:clickable="true" - android:focusable="true" - android:src="@drawable/ic_arrow_upward_grey_24dp" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toTopOf="parent" - app:layout_constraintBottom_toBottomOf="parent" /> - - <TextView - android:id="@+id/score_text_view_item_post_comment" - android:layout_width="64dp" - android:layout_height="wrap_content" - android:gravity="center" - android:textSize="?attr/font_12" - android:textStyle="bold" - android:fontFamily="?attr/font_family" - app:layout_constraintStart_toEndOf="@+id/up_vote_button_item_post_comment" - app:layout_constraintTop_toTopOf="parent" - app:layout_constraintBottom_toBottomOf="parent"/> - - <ImageView - android:id="@+id/down_vote_button_item_post_comment" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:padding="8dp" - android:background="?actionBarItemBackground" - android:clickable="true" - android:focusable="true" - android:src="@drawable/ic_arrow_downward_grey_24dp" - app:layout_constraintStart_toEndOf="@+id/score_text_view_item_post_comment" - app:layout_constraintEnd_toStartOf="@id/more_button_item_post_comment" - app:layout_constraintTop_toTopOf="parent" - app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintHorizontal_bias="0" /> - - <ImageView - android:id="@+id/more_button_item_post_comment" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:padding="8dp" - android:background="?actionBarItemBackground" - android:clickable="true" - android:focusable="true" - android:src="@drawable/ic_more_vert_grey_24dp" - app:layout_constraintEnd_toStartOf="@+id/expand_button_item_post_comment" - app:layout_constraintTop_toTopOf="parent" - app:layout_constraintBottom_toBottomOf="parent"/> - - <ImageView - android:id="@+id/expand_button_item_post_comment" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:padding="8dp" - android:background="?actionBarItemBackground" - android:clickable="true" - android:focusable="true" - android:src="@drawable/ic_expand_less_grey_24dp" - android:visibility="gone" - app:layout_constraintEnd_toStartOf="@+id/save_button_item_post_comment" - app:layout_constraintTop_toTopOf="parent" - app:layout_constraintBottom_toBottomOf="parent"/> - - <ImageView - android:id="@+id/save_button_item_post_comment" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:padding="8dp" - android:background="?actionBarItemBackground" - android:clickable="true" - android:focusable="true" - app:layout_constraintEnd_toStartOf="@+id/reply_button_item_post_comment" - app:layout_constraintTop_toTopOf="parent" - app:layout_constraintBottom_toBottomOf="parent"/> - - <ImageView - android:id="@+id/reply_button_item_post_comment" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:padding="8dp" - android:background="?actionBarItemBackground" - android:clickable="true" - android:focusable="true" - android:src="@drawable/ic_reply_grey_24dp" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintTop_toTopOf="parent" - app:layout_constraintBottom_toBottomOf="parent"/> - - </androidx.constraintlayout.widget.ConstraintLayout> - - <View - android:id="@+id/divider_item_comment" - android:layout_width="match_parent" - android:layout_height="1dp" - android:visibility="gone" /> - - </LinearLayout> + android:padding="8dp" + android:background="?actionBarItemBackground" + android:clickable="true" + android:focusable="true" + android:src="@drawable/ic_arrow_downward_grey_24dp" + app:layout_constraintStart_toEndOf="@+id/score_text_view_item_post_comment" + app:layout_constraintEnd_toStartOf="@id/more_button_item_post_comment" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintHorizontal_bias="0" /> + + <ImageView + android:id="@+id/more_button_item_post_comment" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:padding="8dp" + android:background="?actionBarItemBackground" + android:clickable="true" + android:focusable="true" + android:src="@drawable/ic_more_vert_grey_24dp" + app:layout_constraintEnd_toStartOf="@+id/expand_button_item_post_comment" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintBottom_toBottomOf="parent"/> + + <ImageView + android:id="@+id/expand_button_item_post_comment" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:padding="8dp" + android:background="?actionBarItemBackground" + android:clickable="true" + android:focusable="true" + android:src="@drawable/ic_expand_less_grey_24dp" + android:visibility="gone" + app:layout_constraintEnd_toStartOf="@+id/save_button_item_post_comment" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintBottom_toBottomOf="parent"/> + + <ImageView + android:id="@+id/save_button_item_post_comment" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:padding="8dp" + android:background="?actionBarItemBackground" + android:clickable="true" + android:focusable="true" + app:layout_constraintEnd_toStartOf="@+id/reply_button_item_post_comment" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintBottom_toBottomOf="parent"/> + + <ImageView + android:id="@+id/reply_button_item_post_comment" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:padding="8dp" + android:background="?actionBarItemBackground" + android:clickable="true" + android:focusable="true" + android:src="@drawable/ic_reply_grey_24dp" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintBottom_toBottomOf="parent"/> + + </androidx.constraintlayout.widget.ConstraintLayout> + + <View + android:id="@+id/divider_item_comment" + android:layout_width="match_parent" + android:layout_height="1dp" + android:visibility="gone" /> </LinearLayout> diff --git a/app/src/main/res/layout/item_post_card_2_video_autoplay.xml b/app/src/main/res/layout/item_post_card_2_video_autoplay.xml index da85dcea..8cb3ef10 100644 --- a/app/src/main/res/layout/item_post_card_2_video_autoplay.xml +++ b/app/src/main/res/layout/item_post_card_2_video_autoplay.xml @@ -29,8 +29,8 @@ android:id="@+id/player_view_item_post_card_2_video_autoplay" android:layout_width="match_parent" android:layout_height="match_parent" - app:controller_layout_id="@layout/exo_autoplay_playback_control_view" - android:animateLayoutChanges="true" /> + app:show_timeout="1000" + app:controller_layout_id="@layout/exo_autoplay_playback_control_view" /> <pl.droidsonroids.gif.GifImageView android:id="@+id/preview_image_view_item_post_card_2_video_autoplay" diff --git a/app/src/main/res/layout/item_post_card_2_with_preview.xml b/app/src/main/res/layout/item_post_card_2_with_preview.xml index 777be8ae..0accab55 100644 --- a/app/src/main/res/layout/item_post_card_2_with_preview.xml +++ b/app/src/main/res/layout/item_post_card_2_with_preview.xml @@ -28,12 +28,12 @@ <ImageView android:id="@+id/video_or_gif_indicator_image_view_item_post_card_2_with_preview" - android:layout_width="wrap_content" - android:layout_height="wrap_content" + android:layout_width="36dp" + android:layout_height="36dp" android:layout_margin="16dp" android:layout_gravity="start" + android:scaleType="center" android:background="@drawable/play_button_round_background" - android:src="@drawable/ic_play_circle_36dp" android:visibility="gone" /> <ProgressBar @@ -46,7 +46,6 @@ android:id="@+id/load_image_error_relative_layout_item_post_card_2_with_preview" android:layout_width="match_parent" android:layout_height="match_parent" - android:layout_gravity="center" android:visibility="gone"> <TextView @@ -54,8 +53,9 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:drawableTop="@drawable/ic_error_outline_black_24dp" - android:layout_gravity="center" - android:gravity="center" + android:layout_centerInParent="true" + android:paddingStart="16dp" + android:paddingEnd="16dp" android:text="@string/error_loading_image_tap_to_retry" android:textSize="?attr/font_default" android:fontFamily="?attr/font_family" /> diff --git a/app/src/main/res/layout/item_post_compact_right_thumbnail.xml b/app/src/main/res/layout/item_post_compact_right_thumbnail.xml index d66545d4..6b1b7abf 100644 --- a/app/src/main/res/layout/item_post_compact_right_thumbnail.xml +++ b/app/src/main/res/layout/item_post_compact_right_thumbnail.xml @@ -3,7 +3,8 @@ xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="wrap_content" - android:orientation="vertical"> + android:orientation="vertical" + android:animateLayoutChanges="true"> <androidx.constraintlayout.widget.ConstraintLayout android:layout_width="match_parent" diff --git a/app/src/main/res/layout/item_post_detail_gallery.xml b/app/src/main/res/layout/item_post_detail_gallery.xml index 2b3a0e99..712a7725 100644 --- a/app/src/main/res/layout/item_post_detail_gallery.xml +++ b/app/src/main/res/layout/item_post_detail_gallery.xml @@ -208,12 +208,27 @@ android:layout_height="wrap_content" android:visibility="gone"> - <ml.docilealligator.infinityforreddit.customviews.AspectRatioGifImageView - android:id="@+id/image_view_item_post_detail_gallery" + <FrameLayout android:layout_width="match_parent" - android:layout_height="wrap_content" - android:adjustViewBounds="true" - android:scaleType="fitStart" /> + android:layout_height="wrap_content"> + + <ml.docilealligator.infinityforreddit.customviews.AspectRatioGifImageView + android:id="@+id/image_view_item_post_detail_gallery" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:adjustViewBounds="true" + android:scaleType="fitStart" /> + + <ImageView + android:layout_width="36dp" + android:layout_height="36dp" + android:layout_margin="16dp" + android:layout_gravity="start" + android:scaleType="center" + android:background="@drawable/play_button_round_background" + android:src="@drawable/ic_gallery_reverse_color_24dp" /> + + </FrameLayout> <RelativeLayout android:id="@+id/load_wrapper_item_post_detail_gallery" diff --git a/app/src/main/res/layout/item_post_detail_video_and_gif_preview.xml b/app/src/main/res/layout/item_post_detail_video_and_gif_preview.xml index ed2a28d9..c2930a41 100644 --- a/app/src/main/res/layout/item_post_detail_video_and_gif_preview.xml +++ b/app/src/main/res/layout/item_post_detail_video_and_gif_preview.xml @@ -217,8 +217,8 @@ android:scaleType="fitStart" /> <ImageView - android:layout_width="wrap_content" - android:layout_height="wrap_content" + android:layout_width="36dp" + android:layout_height="36dp" android:layout_margin="16dp" android:layout_gravity="start" android:background="@drawable/play_button_round_background" diff --git a/app/src/main/res/layout/item_post_detail_video_autoplay.xml b/app/src/main/res/layout/item_post_detail_video_autoplay.xml index 5202299d..78396e50 100644 --- a/app/src/main/res/layout/item_post_detail_video_autoplay.xml +++ b/app/src/main/res/layout/item_post_detail_video_autoplay.xml @@ -213,8 +213,8 @@ android:id="@+id/player_view_item_post_detail_video_autoplay" android:layout_width="match_parent" android:layout_height="match_parent" - app:controller_layout_id="@layout/exo_autoplay_playback_control_view" - android:animateLayoutChanges="true" /> + app:show_timeout="1000" + app:controller_layout_id="@layout/exo_autoplay_playback_control_view" /> <pl.droidsonroids.gif.GifImageView android:id="@+id/preview_image_view_item_post_detail_video_autoplay" diff --git a/app/src/main/res/layout/item_post_gallery.xml b/app/src/main/res/layout/item_post_gallery.xml index 3d32cd04..19a2e418 100644 --- a/app/src/main/res/layout/item_post_gallery.xml +++ b/app/src/main/res/layout/item_post_gallery.xml @@ -3,6 +3,7 @@ xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="wrap_content" + xmlns:tools="http://schemas.android.com/tools" android:layout_marginTop="8dp" android:layout_marginBottom="8dp" app:cardElevation="2dp" @@ -43,16 +44,17 @@ android:id="@+id/load_image_error_relative_layout_item_post_gallery" android:layout_width="match_parent" android:layout_height="match_parent" - android:layout_gravity="center" - android:visibility="gone"> + android:visibility="gone" + tools:visibility="visible"> <TextView android:id="@+id/load_image_error_text_view_item_gallery" android:layout_width="match_parent" android:layout_height="wrap_content" + android:paddingStart="16dp" + android:paddingEnd="16dp" app:drawableTopCompat="@drawable/ic_error_outline_black_24dp" - android:layout_gravity="center" - android:gravity="center" + android:layout_centerInParent="true" android:text="@string/error_loading_image_tap_to_retry" android:textSize="?attr/font_default" android:fontFamily="?attr/font_family" /> diff --git a/app/src/main/res/layout/item_post_video_type_autoplay.xml b/app/src/main/res/layout/item_post_video_type_autoplay.xml index 3b78eb27..0d83ca9f 100644 --- a/app/src/main/res/layout/item_post_video_type_autoplay.xml +++ b/app/src/main/res/layout/item_post_video_type_autoplay.xml @@ -206,8 +206,8 @@ android:id="@+id/player_view_item_post_video_type_autoplay" android:layout_width="match_parent" android:layout_height="match_parent" - app:controller_layout_id="@layout/exo_autoplay_playback_control_view" - android:animateLayoutChanges="true" /> + app:show_timeout="1000" + app:controller_layout_id="@layout/exo_autoplay_playback_control_view" /> <pl.droidsonroids.gif.GifImageView android:id="@+id/preview_image_view_item_post_video_type_autoplay" diff --git a/app/src/main/res/layout/item_post_with_preview.xml b/app/src/main/res/layout/item_post_with_preview.xml index 3d2f09b3..b3ef0a9b 100644 --- a/app/src/main/res/layout/item_post_with_preview.xml +++ b/app/src/main/res/layout/item_post_with_preview.xml @@ -221,12 +221,12 @@ <ImageView android:id="@+id/video_or_gif_indicator_image_view_item_post_with_preview" - android:layout_width="wrap_content" - android:layout_height="wrap_content" + android:layout_width="36dp" + android:layout_height="36dp" android:layout_margin="16dp" android:layout_gravity="start" + android:scaleType="center" android:background="@drawable/play_button_round_background" - android:src="@drawable/ic_play_circle_36dp" android:visibility="gone" /> <ProgressBar diff --git a/app/src/main/res/layout/item_reddit_gallery_submission_add_image.xml b/app/src/main/res/layout/item_reddit_gallery_submission_add_image.xml new file mode 100644 index 00000000..ebb89953 --- /dev/null +++ b/app/src/main/res/layout/item_reddit_gallery_submission_add_image.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="utf-8"?> +<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="match_parent" + android:layout_height="match_parent" + xmlns:app="http://schemas.android.com/apk/res-auto"> + + <com.google.android.material.floatingactionbutton.FloatingActionButton + android:id="@+id/fab_item_gallery_submission_add_image" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:src="@drawable/ic_outline_select_photo_24dp" + android:layout_gravity="center" /> + +</FrameLayout>
\ No newline at end of file diff --git a/app/src/main/res/layout/item_reddit_gallery_submission_image.xml b/app/src/main/res/layout/item_reddit_gallery_submission_image.xml new file mode 100644 index 00000000..c6d42e81 --- /dev/null +++ b/app/src/main/res/layout/item_reddit_gallery_submission_image.xml @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="utf-8"?> +<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="match_parent" + android:layout_height="wrap_content"> + + <ml.docilealligator.infinityforreddit.customviews.AspectRatioGifImageView + android:id="@+id/aspect_ratio_gif_image_view_item_reddit_gallery_submission_image" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:scaleType="centerCrop" /> + + <ProgressBar + android:id="@+id/progress_bar_item_reddit_gallery_submission_image" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center" /> + + <ImageView + android:id="@+id/close_image_view_item_reddit_gallery_submission_image" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_margin="16dp" + android:layout_gravity="top|end" + android:background="@drawable/play_button_round_background" + android:src="@drawable/ic_close_24dp" + android:visibility="gone" /> + +</FrameLayout>
\ No newline at end of file diff --git a/app/src/main/res/layout/item_rpan_comment.xml b/app/src/main/res/layout/item_rpan_comment.xml index 97f8969f..54ace9c5 100644 --- a/app/src/main/res/layout/item_rpan_comment.xml +++ b/app/src/main/res/layout/item_rpan_comment.xml @@ -3,7 +3,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="8dp" - android:paddingBottom="8dp"> + android:layout_marginBottom="8dp"> <ImageView android:id="@+id/icon_image_view_item_rpan_comment" diff --git a/app/src/main/res/layout/item_trending_search.xml b/app/src/main/res/layout/item_trending_search.xml new file mode 100644 index 00000000..d1cdbded --- /dev/null +++ b/app/src/main/res/layout/item_trending_search.xml @@ -0,0 +1,75 @@ +<?xml version="1.0" encoding="utf-8"?> +<com.google.android.material.card.MaterialCardView xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="match_parent" + android:layout_height="wrap_content" + xmlns:app="http://schemas.android.com/apk/res-auto" + android:layout_marginTop="8dp" + android:layout_marginBottom="8dp" + android:layout_marginStart="16dp" + android:layout_marginEnd="16dp" + app:cardCornerRadius="16dp" + app:cardElevation="2dp"> + + <RelativeLayout + android:id="@+id/image_wrapper_relative_layout_item_trending_search" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:visibility="gone"> + + <ml.docilealligator.infinityforreddit.customviews.AspectRatioGifImageView + android:id="@+id/image_view_item_trending_search" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:adjustViewBounds="true" + android:scaleType="fitStart" /> + + <ProgressBar + android:id="@+id/progress_bar_item_trending_search" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_centerInParent="true" /> + + <RelativeLayout + android:id="@+id/load_image_error_relative_layout_item_trending_search" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:layout_centerInParent="true" + android:visibility="gone"> + + <TextView + android:id="@+id/load_image_error_text_view_item_trending_search" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:drawableTop="@drawable/ic_error_outline_black_24dp" + android:layout_gravity="center" + android:gravity="center" + android:text="@string/error_loading_image_tap_to_retry" + android:textSize="?attr/font_default" + android:fontFamily="?attr/font_family" /> + + </RelativeLayout> + + </RelativeLayout> + + <ImageView + android:id="@+id/image_view_no_preview_gallery_item_trending_search" + android:layout_width="match_parent" + android:layout_height="150dp" + android:scaleType="center" + android:src="@drawable/ic_image_24dp" + android:visibility="gone" /> + + <TextView + android:id="@+id/title_text_view_item_trending_search" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_gravity="bottom" + android:padding="16dp" + android:background="@drawable/trending_search_title_background" + android:maxLines="2" + android:textColor="#FFFFFF" + android:textSize="?attr/title_font_20" + android:fontFamily="?attr/title_font_family" + android:textStyle="bold" /> + +</com.google.android.material.card.MaterialCardView>
\ No newline at end of file diff --git a/app/src/main/res/menu/full_markdown_activity.xml b/app/src/main/res/menu/full_markdown_activity.xml new file mode 100644 index 00000000..ef700721 --- /dev/null +++ b/app/src/main/res/menu/full_markdown_activity.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="utf-8"?> +<menu xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto"> + <item + android:id="@+id/action_send_full_markdown_activity" + android:orderInCategory="1" + android:title="@string/action_send" + android:icon="@drawable/ic_send_toolbar_24dp" + app:showAsAction="ifRoom" /> +</menu>
\ No newline at end of file diff --git a/app/src/main/res/menu/post_gallery_activity.xml b/app/src/main/res/menu/post_gallery_activity.xml new file mode 100644 index 00000000..4bdcff54 --- /dev/null +++ b/app/src/main/res/menu/post_gallery_activity.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="utf-8"?> +<menu xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto"> + <item + android:id="@+id/action_send_post_gallery_activity" + android:orderInCategory="1" + android:title="@string/action_send" + android:icon="@drawable/ic_send_toolbar_24dp" + app:showAsAction="ifRoom" /> +</menu>
\ No newline at end of file diff --git a/app/src/main/res/menu/rpan_activity.xml b/app/src/main/res/menu/rpan_activity.xml new file mode 100644 index 00000000..bb165fd4 --- /dev/null +++ b/app/src/main/res/menu/rpan_activity.xml @@ -0,0 +1,15 @@ +<?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_share_rpan_link_rpan_activity" + android:orderInCategory="1" + android:title="@string/action_share_rpan_link" + app:showAsAction="never" /> + + <item + android:id="@+id/action_share_post_link_rpan_activity" + android:orderInCategory="1" + android:title="@string/action_share_post_link" + app:showAsAction="never" /> +</menu>
\ No newline at end of file diff --git a/app/src/main/res/menu/trending_activity.xml b/app/src/main/res/menu/trending_activity.xml new file mode 100644 index 00000000..2bd2db1c --- /dev/null +++ b/app/src/main/res/menu/trending_activity.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="utf-8"?> +<menu xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto"> + <item + android:id="@+id/action_refresh_trending_activity" + android:orderInCategory="1" + android:title="@string/action_refresh" + android:icon="@drawable/ic_refresh_24dp" + app:showAsAction="ifRoom" /> +</menu>
\ No newline at end of file diff --git a/app/src/main/res/menu/view_post_detail_fragment.xml b/app/src/main/res/menu/view_post_detail_fragment.xml index 437355e0..5f732534 100644 --- a/app/src/main/res/menu/view_post_detail_fragment.xml +++ b/app/src/main/res/menu/view_post_detail_fragment.xml @@ -2,8 +2,15 @@ <menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto"> <item - android:id="@+id/action_comment_view_post_detail_fragment" + android:id="@+id/action_search_view_post_detail_fragment" android:orderInCategory="1" + android:title="@string/action_search" + android:icon="@drawable/ic_search_toolbar_24dp" + app:showAsAction="ifRoom" /> + + <item + android:id="@+id/action_comment_view_post_detail_fragment" + android:orderInCategory="2" android:title="@string/action_add_comment" android:icon="@drawable/ic_comment_toolbar_24dp" app:showAsAction="ifRoom" @@ -11,98 +18,98 @@ <item android:id="@+id/action_save_view_post_detail_fragment" - android:orderInCategory="2" + android:orderInCategory="3" android:title="@string/action_save_post" app:showAsAction="ifRoom" android:visible="false" /> <item android:id="@+id/action_sort_view_post_detail_fragment" - android:orderInCategory="3" + android:orderInCategory="4" android:title="@string/action_sort" app:showAsAction="never" android:visible="false" /> <item android:id="@+id/action_refresh_view_post_detail_fragment" - android:orderInCategory="4" + android:orderInCategory="5" android:title="@string/action_refresh" app:showAsAction="never" /> <item android:id="@+id/action_view_crosspost_parent_view_post_detail_fragment" - android:orderInCategory="5" + android:orderInCategory="6" android:title="@string/action_view_crosspost_parent" app:showAsAction="never" android:visible="false" /> <item android:id="@+id/action_hide_view_post_detail_fragment" - android:orderInCategory="6" + android:orderInCategory="7" app:showAsAction="never" android:visible="false" /> <item android:id="@+id/action_edit_view_post_detail_fragment" - android:orderInCategory="7" + android:orderInCategory="8" android:title="@string/action_edit_post" app:showAsAction="never" android:visible="false" /> <item android:id="@+id/action_delete_view_post_detail_fragment" - android:orderInCategory="8" + android:orderInCategory="9" android:title="@string/action_delete_post" app:showAsAction="never" android:visible="false" /> <item android:id="@+id/action_nsfw_view_post_detail_fragment" - android:orderInCategory="9" + android:orderInCategory="10" app:showAsAction="never" android:visible="false" /> <item android:id="@+id/action_spoiler_view_post_detail_fragment" - android:orderInCategory="10" + android:orderInCategory="11" app:showAsAction="never" android:visible="false" /> <item android:id="@+id/action_edit_flair_view_post_detail_fragment" - android:orderInCategory="11" + android:orderInCategory="12" android:title="@string/action_edit_flair" app:showAsAction="never" android:visible="false" /> <item android:id="@+id/action_give_award_view_post_detail_fragment" - android:orderInCategory="12" + android:orderInCategory="13" android:title="@string/action_give_award" app:showAsAction="never" /> <item android:id="@+id/action_report_view_post_detail_fragment" - android:orderInCategory="13" + android:orderInCategory="14" android:title="@string/action_report" app:showAsAction="never" /> <item android:id="@+id/action_see_removed_view_post_detail_fragment" - android:orderInCategory="14" + android:orderInCategory="15" android:title="@string/action_see_removed" app:showAsAction="never" android:visible="false" /> <item android:id="@+id/action_crosspost_view_post_detail_fragment" - android:orderInCategory="15" + android:orderInCategory="16" android:title="@string/action_crosspost" app:showAsAction="never" /> <item android:id="@+id/action_add_to_post_filter_view_post_detail_fragment" - android:orderInCategory="16" + android:orderInCategory="17" android:title="@string/action_add_to_post_filter" app:showAsAction="never" /> </menu> diff --git a/app/src/main/res/menu/view_subreddit_detail_activity.xml b/app/src/main/res/menu/view_subreddit_detail_activity.xml index 3521819a..c1631814 100644 --- a/app/src/main/res/menu/view_subreddit_detail_activity.xml +++ b/app/src/main/res/menu/view_subreddit_detail_activity.xml @@ -48,8 +48,14 @@ app:showAsAction="never" /> <item - android:id="@+id/action_share_view_subreddit_detail_activity" + android:id="@+id/action_add_to_post_filter_view_subreddit_detail_activity" android:orderInCategory="8" + android:title="@string/action_add_to_post_filter" + app:showAsAction="never" /> + + <item + android:id="@+id/action_share_view_subreddit_detail_activity" + android:orderInCategory="9" android:title="@string/action_share" app:showAsAction="never" /> </menu> diff --git a/app/src/main/res/menu/view_user_detail_activity.xml b/app/src/main/res/menu/view_user_detail_activity.xml index 05e4c3cb..8d89ff08 100644 --- a/app/src/main/res/menu/view_user_detail_activity.xml +++ b/app/src/main/res/menu/view_user_detail_activity.xml @@ -51,12 +51,18 @@ app:showAsAction="never" /> <item - android:id="@+id/action_report_view_user_detail_activity" + android:id="@+id/action_add_to_post_filter_view_user_detail_activity" android:orderInCategory="9" + android:title="@string/action_add_to_post_filter" + app:showAsAction="never" /> + + <item + android:id="@+id/action_report_view_user_detail_activity" + android:orderInCategory="10" android:title="@string/action_report" /> <item android:id="@+id/action_block_user_view_user_detail_activity" - android:orderInCategory="10" + android:orderInCategory="11" android:title="@string/action_block_user" /> </menu> diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index d3fc9156..b8227553 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -71,36 +71,44 @@ <string name="parse_user_info_error">"Ein Fehler trat beim Abruf der Benutzerinformationen auf"</string> <string name="no_system_webview_error">"Fehler beim Öffnen des System-WebView"</string> <string name="error_loading_image_tap_to_retry">"Fehler beim Laden des Bildes. Tippen für Neuversuch."</string> - <string name="load_posts_error">"Fehler beim Laden der Beiträge. Tippen für Neuversuch."</string> + <string name="load_posts_error">"Fehler beim Laden der Beiträge. +Tippen für Neuversuch."</string> <string name="load_more_posts_error">"Fehler beim Laden der Beiträge."</string> - <string name="load_post_error">"Fehler beim Laden des Beitrags. Tippen für Neuversuch."</string> - <string name="search_subreddits_error">"Fehler beim Suchen von Subreddits. Tippen für Neuversuch."</string> - <string name="search_users_error">"Fehler beim Suchen nach Benutzern. Tippen für Neuversuch."</string> + <string name="load_post_error">"Fehler beim Laden des Beitrags. +Tippen für Neuversuch."</string> + <string name="search_subreddits_error">"Fehler beim Suchen von Subreddits. +Tippen für Neuversuch."</string> + <string name="search_users_error">"Fehler beim Suchen nach Benutzern. +Tippen für Neuversuch."</string> <string name="no_posts">"Keine Beiträge gefunden"</string> <string name="no_comments">"Keine Kommentare gefunden"</string> <string name="no_subreddits">"Keine Subreddits gefunden"</string> <string name="no_users">"Keine Benutzer gefunden"</string> <string name="no_multi_reddits">"Keine Multireddits gefunden"</string> <string name="no_storage_permission">"Keine Speicherberechtigung, um diese Datei zu speichern"</string> - <string name="load_comments_failed">"Fehler beim Laden der Kommentare. Berühren, um es erneut zu versuchen."</string> + <string name="load_comments_failed">"Fehler beim Laden der Kommentare. +Tippen für Neuversuch."</string> <string name="retry">"Wiederholen"</string> <string name="comments">"Kommentare"</string> <string name="no_comments_yet">"Noch keine Kommentare. Einen Kommentar schreiben?"</string> <string name="vote_failed">"Abstimmung fehlgeschlagen"</string> <string name="refresh_post_failed">"Fehler beim Aktualisieren des Beitrags"</string> - <string name="load_messages_failed">"Fehler beim Laden der Nachrichten. Berühren, um es erneut zu versuchen."</string> + <string name="load_messages_failed">"Fehler beim Laden der Nachrichten. +Tippen für Neuversuch."</string> <string name="no_messages">"Leer"</string> <string name="nsfw">"NSFW"</string> <string name="karma_info">"Karma: %1$d"</string> - <string name="karma_info_user_detail">"Karma: %1$d (%2$d + %3$d)"</string> - <string name="cakeday_info">"Cake Day: %1$s"</string> + <string name="karma_info_user_detail">"Karma: +%1$d (%2$d + %3$d)"</string> + <string name="cakeday_info">"Cake Day: +%1$s"</string> <string name="since">"Seit:"</string> <string name="profile">"Profil"</string> <string name="subscriptions">"Abonnements"</string> <string name="multi_reddit">"Multireddit"</string> <string name="inbox">"Posteingang"</string> - <string name="upvoted">"Upgevoted"</string> - <string name="downvoted">"Downgevoted"</string> + <string name="upvoted">"Upgevotet"</string> + <string name="downvoted">"Downgevotet"</string> <string name="hidden">"Versteckt"</string> <string name="saved">"Gespeichert"</string> <string name="gilded">"Vergoldet"</string> @@ -135,7 +143,7 @@ <string name="send_comment_success">"Kommentar gesendet"</string> <string name="send_comment_failed">"Konnte diesen Kommentar nicht senden"</string> <string name="send_message_username_hint">"Benutzer"</string> - <string name="send_message_subject_hint">"Betreff"</string> + <string name="send_message_subject_hint">"Betreff (maximal 100 Zeichen)"</string> <string name="send_message_content_hint">"Nachricht"</string> <string name="reply_message_failed">"Konnte nicht auf diese Nachricht antworten"</string> <string name="error_getting_message">"Fehler beim Abrufen dieser Nachricht"</string> @@ -181,9 +189,11 @@ <string name="flair">"Flair"</string> <string name="spoiler">"Spoiler"</string> <string name="no_flair">"Kein Flair"</string> - <string name="error_loading_flairs">"Fehler beim Laden der Flairs. Berühren, um es erneut zu versuchen."</string> + <string name="error_loading_flairs">"Fehler beim Laden der Flairs. +Tippen für Neuversuch."</string> <string name="no_rule">"Keine Regel"</string> - <string name="error_loading_rules">"Fehler beim Laden der Regeln. Berühren, um es erneut zu versuchen."</string> + <string name="error_loading_rules">"Fehler beim Laden der Regeln. +Tippen für Neuversuch."</string> <string name="error_loading_rules_without_retry">"Fehler beim Laden der Regeln"</string> <string name="search_in">"Suchen in"</string> <string name="all_subreddits">"Alle Subreddits"</string> @@ -220,11 +230,13 @@ <string name="image">"BILD"</string> <string name="video">"VIDEO"</string> <string name="gif">"GIF"</string> - <string name="gallery">"GALLERIE"</string> + <string name="gallery">"GALERIE"</string> <string name="best">"Beste"</string> <string name="search">"Suchen"</string> <string name="posting_video">"Poste Video"</string> <string name="posting_image">"Poste Bild"</string> + + <!-- Fuzzy --> <string name="please_wait">"Bitte warten."</string> <string name="add_account">"Konto hinzufügen"</string> <string name="anonymous_account">"Anonym"</string> @@ -311,8 +323,7 @@ <string name="settings_immersive_interface_title">"Immersive Oberfläche"</string> <!-- Fuzzy --> - <string name="settings_immersive_interface_summary">"Funktioniert nicht auf allen Seiten -Funktioniert vielleicht nicht auf Android 11"</string> + <string name="settings_immersive_interface_summary">"Funktioniert nicht auf allen Seiten"</string> <string name="settings_immersive_interface_ignore_nav_bar_title">"Navigationsleiste in der immersiven Oberfläche ignorieren"</string> <string name="settings_immersive_interface_ignore_nav_bar_summary">"Weniger Abstand für die untere Navigationsleiste"</string> <string name="settings_customize_tabs_in_main_page_title">"Reiter auf der Hauptseite anpassen"</string> @@ -324,6 +335,8 @@ Funktioniert vielleicht nicht auf Android 11"</string> <string name="settings_volume_keys_navigate_posts_title">"Lautstärketasten nutzen, um durch Beiträge zu navigieren"</string> <string name="settings_mute_video_title">"Videos stummschalten"</string> <string name="settings_mute_nsfw_video_title">"NSFW-Videos stummschalten"</string> + + <!-- Fuzzy --> <string name="settings_automatically_try_redgifs_title">"Automatisch versuchen, Redgifs abzurufen, falls Videos auf Gfycat entfernt wurden."</string> <string name="settings_video_player_ignore_nav_bar_title">"Navigationsleiste im Video-Player ignorieren"</string> <string name="settings_video_player_ignore_nav_bar_summary">"Kein extra Rand beim Video-Controller"</string> @@ -405,7 +418,7 @@ Funktioniert vielleicht nicht auf Android 11"</string> <string name="settings_customize_dark_theme_title">"Dunkles Thema"</string> <string name="settings_customize_amoled_theme_title">"AMOLED-Thema"</string> <string name="settings_manage_themes_title">"Themen verwalten"</string> - <string name="settings_custom_theme_cannot_apply_to_settings_page_summary">"Benutzerdefiniterte Themen können nicht auf die Einstellungs-Seite angewandt werden (ausgenommen Werkzeug-, Status- und Navigationsleiste)"</string> + <string name="settings_custom_theme_cannot_apply_to_settings_page_summary">"Benutzerdefinierte Themen können nicht auf die Einstellungs-Seite angewandt werden (ausgenommen Werkzeug-, Status- und Navigationsleiste)."</string> <string name="settings_advanced_master_title">"Erweitert"</string> <string name="settings_delete_all_subreddits_data_in_database_title">"Alle Subreddits aus der Datenbank löschen"</string> <string name="settings_delete_all_users_data_in_database_title">"Alle Benutzer aus der Datenbank löschen"</string> @@ -461,7 +474,8 @@ Funktioniert vielleicht nicht auf Android 11"</string> <string name="error_getting_multi_reddit_data">"Fehler beim Abrufen der Multireddit-Daten"</string> <string name="error_loading_multi_reddit_list">"Kann Multireddits nicht synchronisieren"</string> <string name="error_loading_subscriptions">"Kann Abonnements nicht synchronisieren"</string> - <string name="share_this_app">"Schau dir Infinity for Reddit an, ein super Reddit-Client! https://play.google.com/store/apps/details?id=ml.docilealligator.infinityforreddit"</string> + <string name="share_this_app">"Schau dir Infinity for Reddit an, ein super Reddit-Client! +https://play.google.com/store/apps/details?id=ml.docilealligator.infinityforreddit"</string> <string name="error_getting_subreddit_name">"Fehler beim Abrufen des Subreddit-Namens"</string> <string name="share_post_link">"Beitrags-Link teilen"</string> <string name="share_image_link">"Bild-Link teilen"</string> @@ -484,7 +498,7 @@ Funktioniert vielleicht nicht auf Android 11"</string> <string name="exit_app">"Verlassen?"</string> <string name="light_theme">"Helles Thema"</string> <string name="dark_theme">"Dunkles Thema"</string> - <string name="multi_reddit_name_hint">"Name (Max. 50 Zeichen)"</string> + <string name="multi_reddit_name_hint">"Name (Maximal 50 Zeichen)"</string> <string name="multi_reddit_description_hint">"Beschreibung"</string> <string name="private_multi_reddit">"Privat"</string> <string name="no_multi_reddit_name">"Wo ist der Name?"</string> @@ -553,7 +567,7 @@ Funktioniert vielleicht nicht auf Android 11"</string> <string name="theme_item_bottom_app_bar_background_color">"Farbe für untere Navigationsleiste"</string> <string name="theme_item_bottom_app_bar_background_color_detail">"Angewandt auf: Untere Navigationsleiste"</string> <string name="theme_item_primary_icon_color">"Primäre Symbolfarbe"</string> - <string name="theme_item_primary_icon_color_detail">"Angewandt auf: Symbole in der Navigationsleiste"</string> + <string name="theme_item_primary_icon_color_detail">"Angewandt auf: Symbole in der Navigationsleiste."</string> <string name="theme_item_bottom_app_bar_icon_color">"Symbolfarbe für untere Navigationsleiste"</string> <string name="theme_item_bottom_app_bar_icon_color_detail">"Angewandt auf: Symbole in der unteren Navigationsleiste"</string> <string name="theme_item_post_icon_and_info_color">"Farbe für Beitragssymbol und Information"</string> @@ -584,10 +598,10 @@ Funktioniert vielleicht nicht auf Android 11"</string> <string name="theme_item_tab_layout_with_collapsed_collapsing_toolbar_text_color_detail">"Angewandt auf: Textfarbe im Reiterlayout (eingeklappte Werkzeugleiste)"</string> <string name="theme_item_tab_layout_with_collapsed_collapsing_toolbar_tab_indicator">"Indikatorfarbe für Reiterlayout in der eingeklappten Werkzeugleiste"</string> <string name="theme_item_tab_layout_with_collapsed_collapsing_toolbar_tab_indicator_detail">"Angewandt auf: Indikatorfarbe im Reiterlayout (eingeklappte Werkzeugleiste)"</string> - <string name="theme_item_upvoted_color">"Upgevoted Farbe"</string> - <string name="theme_item_upvoted_color_detail">"Angewandt auf: Abstimmungs-Knöpfe und Punktzahlen (upgevoted)"</string> - <string name="theme_item_downvoted_color">"Downgevoted Farbe"</string> - <string name="theme_item_downvoted_color_detail">"Angewandt auf: Abstimmungs-Knöpfe und Punktzahlen (downgevoted)"</string> + <string name="theme_item_upvoted_color">"Upgevotet Farbe"</string> + <string name="theme_item_upvoted_color_detail">"Angewandt auf: Abstimmungs-Knöpfe und Punktzahlen (upgevotet)"</string> + <string name="theme_item_downvoted_color">"Downgevotet Farbe"</string> + <string name="theme_item_downvoted_color_detail">"Angewandt auf: Abstimmungs-Knöpfe und Punktzahlen (downgevotet)"</string> <string name="theme_item_post_type_background_color">"Hintergrundfarbe für Beitragsart"</string> <string name="theme_item_post_type_background_color_detail">"Angewandt auf: Hintergrund der Beitragsart (BILD, TEXT, VIDEO, GIF, LINK)"</string> <string name="theme_item_post_type_text_color">"Textfarbe für Beitragsart"</string> @@ -681,7 +695,7 @@ Funktioniert vielleicht nicht auf Android 11"</string> <string name="create_light_theme">"Erstelle ein helles Thema basierend auf dem Indigo-Thema"</string> <string name="create_dark_theme">"Erstelle ein dunkles Thema basierend auf dem Indigo-Dunkel-Thema"</string> <string name="create_amoled_theme">"Erstelle ein AMOLED-Thema basierend auf dem Indigo-AMOLED-Thema"</string> - <string name="create_theme_info">"Wenn du stattdessen ein Thema basierend auf einem anderen Thema erstellen möchtest, klicke auf den \"+\"-Knopf auf einem Thema"</string> + <string name="create_theme_info">"Wenn du stattdessen ein Thema basierend auf einem anderen Thema erstellen möchtest, klicke auf den \"+\"-Knopf auf einem Thema."</string> <string name="edit_theme_name">"Thema-Name bearbeiten"</string> <string name="edit_theme">"Thema bearbeiten"</string> <string name="delete_theme">"Thema löschen"</string> @@ -838,7 +852,10 @@ Reiter könnten den Inhalt verlieren, wenn zu anderen gewechselt wird. Selbes Ve <string name="settings_data_saving_mode">"Datensparmodus"</string> <!-- Fuzzy --> - <string name="settings_data_saving_mode_info_summary">"Im Datensparmodus werden Vorschaubilder mit geringerer Auflösung geladen."</string> + <string name="settings_data_saving_mode_info_summary">"Im Datensparmodus: +Vorschaubilder haben eine geringere Auflösung. +Reddit-Videos haben eine geringere Auflösung. +Automatisches Abspielen von Videos ist deaktiviert."</string> <string name="settings_translation_title">"Übersetzung"</string> <string name="settings_translation_summary">"Übersetze diese App auf POEditor. Danke an alle Beitragenden."</string> <string name="settings_credits_national_flags">"Nationalflaggen"</string> @@ -868,11 +885,12 @@ Reiter könnten den Inhalt verlieren, wenn zu anderen gewechselt wird. Selbes Ve <string name="anonymous">"Anonym"</string> <!-- Fuzzy --> - <string name="give_award_error_message">"Code: %1$d/ Nachricht: %2$s"</string> + <string name="give_award_error_message">"Code: %1$d/ +Nachricht: %2$s"</string> <string name="give_award_success">"Auszeichnung verliehen"</string> <string name="give_award_failed">"Fehlgeschlagen"</string> <string name="warning">"Warnung"</string> - <string name="this_is_a_nsfw_subreddit">"Dieses ist ein NSFW-Subreddit"</string> + <string name="this_is_a_nsfw_subreddit">"Dies ist ein NSFW-Subreddit."</string> <string name="this_user_has_nsfw_content">"Dieser Nutzer hat NSFW-Inhalte"</string> <string name="dismiss">"Verwerfen"</string> <string name="leave">"Verlassen"</string> @@ -1006,6 +1024,8 @@ Reiter könnten den Inhalt verlieren, wenn zu anderen gewechselt wird. Selbes Ve <string name="action_copy_link">"Link kopieren"</string> <string name="action_add_to_post_filter">"Zum Beitrags-Filter hinzufügen"</string> <string name="settings_do_not_blur_nsfw_in_nsfw_subreddits_title">"NSFW-Bilder in NSFW-Subreddits nicht verwischen"</string> + + <!-- Fuzzy --> <string name="settings_show_avatar_on_the_right">"Avatar links anzeigen"</string> <string name="settings_backup_settings_title">"Einstellungen sichern"</string> <string name="settings_restore_settings_title">"Einstellungen wiederherstellen"</string> @@ -1030,7 +1050,7 @@ Reiter könnten den Inhalt verlieren, wenn zu anderen gewechselt wird. Selbes Ve <string name="anonymous_front_page_no_subscriptions">"Beginne, indem du einem Subreddit beitrittst!"</string> <!-- Fuzzy --> - <string name="backup_settings_success">"Die Einstellungen wurden erfolgreich in den Zielordner exportiert"</string> + <string name="backup_settings_success">"Die Einstellungen wurden erfolgreich in den Zielordner exportiert. Das Passwort der generierten ZIP-Datei ist 123321. Die ZIP-Datei bitte nicht bearbeiten."</string> <string name="create_zip_in_destination_directory_failed">"Konnte keine ZIP-Datei im Zielordner erstellen"</string> <string name="backup_some_settings_failed">"Nicht alle Einstellungen konnten exportiert werden, aber alle anderen wurden erfolgreich in den Zielordner exportiert"</string> <string name="restore_settings_success">"Einstellungen erfolgreich wiederhergestellt. Starte die Anwendung neu, um die Änderungen zu sehen."</string> @@ -1062,4 +1082,31 @@ Reiter könnten den Inhalt verlieren, wenn zu anderen gewechselt wird. Selbes Ve <string name="exclude_domain">"Diese Domain ausschließen"</string> <string name="suggest_title">"Titel vorschlagen"</string> <string name="suggest_title_failed">"Konnte Titel nicht vorschlagen"</string> + <string name="action_delete_logs">"Logs löschen"</string> + <string name="inbox_with_count">"Posteingang (%1$d)"</string> + <string name="comment_continue_thread">"Thread fortsetzen"</string> + + <!-- Fuzzy --> + <string name="settings_swipe_vertically_to_go_back_from_media_title">"Vertikal wischen, um zurück zu den Medien zu gelangen"</string> + <string name="settings_hide_post_flair">"Beitragsflair verstecken"</string> + <string name="settings_crash_reports_title">"Absturzmeldungen"</string> + <string name="settings_nsfw_and_spoiler_dangerous_group_title">"Gefährlich"</string> + <string name="settings_disable_nsfw_forever_title">"NSFW dauerhaft deaktivieren"</string> + <string name="settings_show_only_one_comment_level_indicator">"Nur einen Indikator für die Kommentarebene anzeigen"</string> + <string name="save_comment">"Speichern"</string> + <string name="unsave_comment">"Nicht mehr speichern"</string> + <string name="copy_multi_reddit_path">"Pfad des Multireddit kopieren"</string> + <string name="copy_multi_reddit_path_failed">"Pfad des Multireddit kann nicht kopiert werden"</string> + <string name="crash_reports_deleted">"Absturzmeldungen werden gelöscht"</string> + <string name="disable_nsfw_forever_message">"Wenn du diese Option aktivierst, wird NSFW dauerhaft deaktiviert, egal ob die NSFW-Option ein- oder ausgeschaltet ist. Diese Option ist irreversibel, wenn du NSFW wieder einschalten willst, müssen die Daten der App gelöscht werden. + +Möchtest du trotzdem fortfahren?"</string> + <string name="reply">"Antworten"</string> + <string name="rpan_activity_label">"RPAN"</string> + <string name="post_gallery_activity_label">"Galeriebeitrag"</string> + <string name="action_share_rpan_link">"Teile RPAN-Link"</string> + <string name="action_share_post_link">"Teile Beitragslink"</string> + <string name="rpan">"RPAN"</string> + <string name="bottom_sheet_post_gallery">"Galerie"</string> + <string name="label_reddit">"Reddit"</string> </resources>
\ No newline at end of file diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index 963956b6..5b3d3b12 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -71,19 +71,23 @@ <string name="parse_user_info_error">"Ocurrió un error al processar la información del usuario"</string> <string name="no_system_webview_error">"Error iniciando WebView del Sistema"</string> <string name="error_loading_image_tap_to_retry">"Error cargando la imagen. Toca para reintentar."</string> - <string name="load_posts_error">"Error al cargar las publicaciones. Toca para reintentar."</string> + <string name="load_posts_error">"Error al cargar las publicaciones. +Toca para reintentar."</string> <string name="load_more_posts_error">"Error al cargar más publicaciones."</string> - <string name="load_post_error">"Error al cargar la publicación. Toca para reintentar."</string> + <string name="load_post_error">"Error al cargar la publicación. +Toca para reintentar."</string> <string name="search_subreddits_error">"Error al buscar subreddits. Toca para reintentar."</string> - <string name="search_users_error">"Error al buscar usuarios. Toca para reintentar."</string> + <string name="search_users_error">"Error al buscar usuarios. +Toca para reintentar."</string> <string name="no_posts">"No se encontraron publicaciones"</string> <string name="no_comments">"No se encontraron comentarios"</string> <string name="no_subreddits">"No se encontraron subreddits"</string> <string name="no_users">"No se encontraron usuarios"</string> <string name="no_multi_reddits">"No se encontraron Multireddits"</string> - <string name="no_storage_permission">"Se requieren permisos de almacenamiento para realizar esta acción."</string> - <string name="load_comments_failed">"Error cargando los comentarios. Toca para reintentar."</string> + <string name="no_storage_permission">"Se requieren permisos de almacenamiento para realizar esta acción"</string> + <string name="load_comments_failed">"Error cargando los comentarios. +Toca para reintentar."</string> <string name="retry">"Reintentar"</string> <string name="comments">"Comentarios"</string> <string name="no_comments_yet">"No hay comentarios aún. ¿Escribir uno?"</string> @@ -91,7 +95,8 @@ Toca para reintentar."</string> <!-- Ocurrió un error al actualizar la publicación --> <string name="refresh_post_failed">"Error al refrescar la publicación"</string> - <string name="load_messages_failed">"Error al cargar los mensajes. Toca para reintentar."</string> + <string name="load_messages_failed">"Error al cargar los mensajes. +Toca para reintentar."</string> <string name="no_messages">"Vacío"</string> <string name="nsfw">"NSFW"</string> <string name="karma_info">"Karma: %1$d"</string> @@ -106,8 +111,8 @@ Toca para reintentar."</string> <!-- Bandeja de Entrada --> <string name="inbox">"Bandeja de Entrada"</string> - <string name="upvoted">"Votado a favor"</string> - <string name="downvoted">"Votado en contra"</string> + <string name="upvoted">"Upvoted"</string> + <string name="downvoted">"Downvoted"</string> <string name="hidden">"Oculto"</string> <string name="saved">"Guardado"</string> <string name="gilded">"Premiado"</string> @@ -137,12 +142,12 @@ Toca para reintentar."</string> <string name="lazy_mode_start">"El modo automático empieza en %1$.1fs"</string> <string name="lazy_mode_stop">"Se ha detenido el modo automático"</string> <string name="write_comment_hint">"Escribe tus ideas aquí"</string> - <string name="comment_content_required">"Tu comentario requiere contenido"</string> + <string name="comment_content_required">"Dónde está tu pensamiento interesante?"</string> <string name="sending_comment">"Enviando"</string> <string name="send_comment_success">"Comentario enviado"</string> <string name="send_comment_failed">"Error al enviar el comentario"</string> <string name="send_message_username_hint">"Usuario"</string> - <string name="send_message_subject_hint">"Asunto (Max. 100 caracteres)"</string> + <string name="send_message_subject_hint">"Asunto (max 100 caracteres)"</string> <string name="send_message_content_hint">"Mensaje"</string> <string name="reply_message_failed">"Error al responder el mensaje"</string> <string name="error_getting_message">"Error al obtener el mensaje"</string> @@ -154,13 +159,13 @@ Toca para reintentar."</string> <string name="send_message_failed">"No se pudo enviar el mensaje"</string> <string name="select_a_subreddit">"Selecciona un subreddit primero"</string> <string name="title_required">"Se requiere un título"</string> - <string name="link_required">"Se requiere un enlace"</string> + <string name="link_required">"Hey where is the link?"</string> <string name="select_an_image">"Selecciona una imagen"</string> <string name="posting">"Publicando"</string> <string name="post_failed">"Error al publicar"</string> <string name="error_processing_image">"Error procesando la imagen"</string> <string name="error_processing_video">"Error procesando el vídeo"</string> - <string name="download_started">"Descargando... Mira la notificación para más detalles."</string> + <string name="download_started">"Descarga iniciada. Verifique el progreso en la notificación."</string> <string name="comment_load_more_comments">"Cargar más comentarios"</string> <string name="comment_load_more_comments_failed">"Error al cargar. Toca para reintentar."</string> <string name="loading">"Cargando"</string> @@ -188,9 +193,11 @@ Toca para reintentar."</string> <string name="flair">"Etiqueta Temática"</string> <string name="spoiler">"Spoiler"</string> <string name="no_flair">"No hay Etiqueta Temática"</string> - <string name="error_loading_flairs">"Error cargando las etiquetas temáticas. Toca para reintentar."</string> + <string name="error_loading_flairs">"Error cargando las etiquetas temáticas. +Toca para reintentar."</string> <string name="no_rule">"Sin regla"</string> - <string name="error_loading_rules">"Error cargando las reglas. Toca para reintentar."</string> + <string name="error_loading_rules">"Error cargando las reglas. +Toca para reintentar."</string> <string name="error_loading_rules_without_retry">"Error cargando las reglas"</string> <string name="search_in">"Buscar en"</string> <string name="all_subreddits">"Todos los subreddits"</string> @@ -215,8 +222,8 @@ Toca para reintentar."</string> <string name="sort_time_year">"Año"</string> <string name="sort_time_all_time">"Todo el tiempo"</string> <string name="no_activity_found_for_share">"No se encontró ninguna aplicación para compartir"</string> - <string name="archived_post_vote_unavailable">"Publicación archivada. Votar no está disponible"</string> - <string name="archived_post_comment_unavailable">"Publicación archivada. Comentar no está disponible "</string> + <string name="archived_post_vote_unavailable">"Publicación archivada. Votar no está disponible."</string> + <string name="archived_post_comment_unavailable">"Publicación archivada. Comentar no está disponible."</string> <string name="archived_post_reply_unavailable">"Publicación archivada. Responder no disponible."</string> <string name="locked_post_comment_unavailable">"Publicación bloqueada. Comentar no disponible."</string> <string name="locked_post_reply_unavailable">"Publicación bloqueada. Responder no disponible."</string> @@ -230,7 +237,9 @@ Toca para reintentar."</string> <string name="search">"Buscar"</string> <string name="posting_video">"Publicando vídeo"</string> <string name="posting_image">"Publicando imagen"</string> - <string name="please_wait">"Por favor espera."</string> + + <!-- Fuzzy --> + <string name="please_wait">"Por favor espera"</string> <string name="add_account">"Añadir cuenta"</string> <string name="anonymous_account">"Anónimo"</string> <string name="log_out">"Cerrar sesión"</string> @@ -295,7 +304,7 @@ Toca para reintentar."</string> <!-- Galardón means award Premio means prize, so it's better suited the first word instead of the second one --> <string name="notification_summary_award">"Galardón"</string> - <string name="notification_new_messages">"%1$d nuevos mensajes"</string> + <string name="notification_new_messages">"%1$d Nuevos Mensajes"</string> <string name="label_account">"Cuenta"</string> <string name="label_post">"Publicación"</string> <string name="label_preferences">"Preferencias"</string> @@ -321,7 +330,7 @@ Premio means prize, so it's better suited the first word instead of the second o <string name="settings_immersive_interface_title">"Interfaz Inmersiva"</string> <!-- Fuzzy --> - <string name="settings_immersive_interface_summary">"No Aplica a Todas las Páginas (Podría No Funcionar con Android 11)"</string> + <string name="settings_immersive_interface_summary">"No Aplica a Todas las Páginas"</string> <string name="settings_immersive_interface_ignore_nav_bar_title">"Ignorar la Barra de Navegación en la Interfaz Inmersiva"</string> <string name="settings_immersive_interface_ignore_nav_bar_summary">"Bloquear la Barra de Navegación de Tener Margen Extra"</string> <string name="settings_customize_tabs_in_main_page_title">"Personalizar las Pestañas de la Página Principal"</string> @@ -333,7 +342,9 @@ Premio means prize, so it's better suited the first word instead of the second o <string name="settings_volume_keys_navigate_posts_title">"Usar las Teclas de Volumen para Navegar Publicaciones"</string> <string name="settings_mute_video_title">"Silenciar Vídeos"</string> <string name="settings_mute_nsfw_video_title">"Silenciar Vídeos NSFW"</string> - <string name="settings_automatically_try_redgifs_title">"Abrir Vídeos en Redgifs Automáticamente Si No Están Disponibles en Gfycat."</string> + + <!-- Fuzzy --> + <string name="settings_automatically_try_redgifs_title">"Intente acceder automáticamente a Redgifs si se eliminan los videos en Gfycat"</string> <string name="settings_video_player_ignore_nav_bar_title">"Ignorar la Barra de Navegación en el Reproductor de Vídeo"</string> <string name="settings_video_player_ignore_nav_bar_summary">"Bloquear al Controlador de Vídeo Para que No Tenga Extra Margen"</string> <string name="settings_confirm_to_exit">"Confirmar para Salir"</string> @@ -416,7 +427,7 @@ Premio means prize, so it's better suited the first word instead of the second o <string name="settings_advanced_master_title">"Avanzado"</string> <string name="settings_delete_all_subreddits_data_in_database_title">"Borrar Todos los Subreddits Guardados"</string> <string name="settings_delete_all_users_data_in_database_title">"Borrar Todos los Usuarios Guardados"</string> - <string name="settings_delete_all_sort_type_data_in_database_title">"Borrar Todos los \"Ordenar por:\" Guardados"</string> + <string name="settings_delete_all_sort_type_data_in_database_title">"Borrar Todos los Ordenar por Guardados"</string> <string name="settings_delete_all_post_layout_data_in_database_title">"Borrar Todos los Diseños de Publicación de la Base de Datos"</string> <string name="settings_delete_all_themes_in_database_title">"Borrar Todos los Temas Guardados"</string> <string name="settings_delete_front_page_scrolled_positions_in_database_title">"Borrar Todas las Posiciones Guardadas de la Página Principal de la Base de Datos"</string> @@ -498,10 +509,10 @@ https://play.google.com/store/apps/details?id=ml.docilealligator.infinityforredd <string name="exit_app">"¿Salir?"</string> <string name="light_theme">"Tema Claro"</string> <string name="dark_theme">"Tema Oscuro"</string> - <string name="multi_reddit_name_hint">"Nombre (Max. 50 Caracteres)"</string> + <string name="multi_reddit_name_hint">"Nombre (Max 50 Caracteres)"</string> <string name="multi_reddit_description_hint">"Descripción"</string> <string name="private_multi_reddit">"Privado"</string> - <string name="no_multi_reddit_name">"Introduce un nombre"</string> + <string name="no_multi_reddit_name">"Donde esta el nombre?"</string> <string name="create_multi_reddit_failed">"Ocurrió un error creando este multireddit"</string> <string name="duplicate_multi_reddit">"Este multireddit ya existe"</string> <string name="edit_multi_reddit_failed">"Ocurrió un error al editar el multireddit"</string> @@ -514,9 +525,9 @@ https://play.google.com/store/apps/details?id=ml.docilealligator.infinityforredd <string name="cannot_save_image">"Ocurrió un error guardando la imagen"</string> <string name="cannot_save_gif">"Ocurrió un error guardando el gif"</string> <string name="cannot_get_storage">"Ocurrió un error al acceder al almacenamiento de la app"</string> - <string name="save_image_first">"Guardando... Por favor espera."</string> - <string name="save_gif_first">"Guardando... Por favor espera."</string> - <string name="theme_name_description">"Toca para cambiar el nombre del tema"</string> + <string name="save_image_first">"Guardando. Por favor espera."</string> + <string name="save_gif_first">"Guardando. Por favor espera."</string> + <string name="theme_name_description">"Toca para cambiar el nombre del tema."</string> <string name="theme_item_is_light_theme">"Establecer como Tema Claro"</string> <string name="theme_item_is_dark_theme">"Establecer como Tema Oscuro"</string> <string name="theme_item_is_amoled_theme">"Establecer como Tema AMOLED"</string> @@ -565,7 +576,7 @@ https://play.google.com/store/apps/details?id=ml.docilealligator.infinityforredd <string name="theme_item_bottom_app_bar_background_color">"Color de la Barra de Navegación Inferior"</string> <string name="theme_item_bottom_app_bar_background_color_detail">"Aplicado a: Barra de Navegación Inferior"</string> <string name="theme_item_primary_icon_color">"Color de Ícono Primario"</string> - <string name="theme_item_primary_icon_color_detail">"Aplicado a: Íconos en el Cajón de Navegación"</string> + <string name="theme_item_primary_icon_color_detail">"Aplicado a: Íconos en el Cajón de Navegación."</string> <string name="theme_item_bottom_app_bar_icon_color">"Color de los Íconos de la Barra de Navegación Inferior"</string> <string name="theme_item_bottom_app_bar_icon_color_detail">"Aplicado a: Íconos de la Barra de Navegación Inferior"</string> <string name="theme_item_post_icon_and_info_color">"Color de los Íconos de Información de Publicación y Comentario"</string> @@ -584,22 +595,22 @@ https://play.google.com/store/apps/details?id=ml.docilealligator.infinityforredd <string name="theme_item_toolbar_secondary_text_color_detail">"Aplicado a: Texto secundario en barras de herramienta"</string> <string name="theme_item_circular_progress_bar_background_color">"Color del Fondo de la Barra de Progreso Circular"</string> <string name="theme_item_circular_progress_bar_background_color_detail">"Aplicado a: Fondo de la Barra de Progreso Circular"</string> - <string name="theme_item_tab_layout_with_expanded_collapsing_toolbar_tab_background">"Color del Fondo del Grupo de Pestañas (Extendido)"</string> + <string name="theme_item_tab_layout_with_expanded_collapsing_toolbar_tab_background">"Color de fondo del Diseño de la Pestaña en la barra de herramientas Expandida"</string> <string name="theme_item_tab_layout_with_expanded_collapsing_toolbar_tab_background_detail">"Aplicado a: Fondo del Grupo de Pestañas (Extendido)"</string> - <string name="theme_item_tab_layout_with_expanded_collapsing_toolbar_text_color">"Color del Texto del Grupo de Pestañas (Extendido)"</string> + <string name="theme_item_tab_layout_with_expanded_collapsing_toolbar_text_color">"Color del texto del Diseño de la Pestaña en la Barra de Herramientas Expandida"</string> <string name="theme_item_tab_layout_with_expanded_collapsing_toolbar_text_color_detail">"Aplicado a: Texto del Grupo de Pestañas (Extendido)"</string> - <string name="theme_item_tab_layout_with_expanded_collapsing_toolbar_tab_indicator">"Color del Indicador del Grupo de Pestañas (Extendido)"</string> + <string name="theme_item_tab_layout_with_expanded_collapsing_toolbar_tab_indicator">"Color del Indicador de Pestaña del Diseño de Pestaña en la Barra de Herramientas Expandida"</string> <string name="theme_item_tab_layout_with_expanded_collapsing_toolbar_tab_indicator_detail">"Aplicado a: Indicador del grupo de pestañas (Extendido)"</string> - <string name="theme_item_tab_layout_with_collapsed_collapsing_toolbar_tab_background">"Color del Fondo del Grupo de Pestañas (Colapsado)"</string> + <string name="theme_item_tab_layout_with_collapsed_collapsing_toolbar_tab_background">"Color de Fondo del Diseño de la Pestaña en la Barra de Herramientas Colapsada"</string> <string name="theme_item_tab_layout_with_collapsed_collapsing_toolbar_tab_background_detail">"Aplicado a: Fondo del grupo de pestañas (Colapsado)"</string> - <string name="theme_item_tab_layout_with_collapsed_collapsing_toolbar_text_color">"Color del Texto del Grupo de Pestañas (Colapsado)"</string> + <string name="theme_item_tab_layout_with_collapsed_collapsing_toolbar_text_color">"Color del Texto del Diseño de la Pestaña en la Barra de Herramientas Colapsada"</string> <string name="theme_item_tab_layout_with_collapsed_collapsing_toolbar_text_color_detail">"Aplicado a: Texto del grupo de pestañas (Colapsado)"</string> - <string name="theme_item_tab_layout_with_collapsed_collapsing_toolbar_tab_indicator">"Color del Indicador del Grupo de Pestañas (Colapsado)"</string> + <string name="theme_item_tab_layout_with_collapsed_collapsing_toolbar_tab_indicator">"Color del Indicador de Pestaña del Diseño de Pestaña en la Barra de Herramientas Colapsada"</string> <string name="theme_item_tab_layout_with_collapsed_collapsing_toolbar_tab_indicator_detail">"Aplicado a: Indicador del Grupo de Pestañas (Colapsado)"</string> - <string name="theme_item_upvoted_color">"Color de Voto a Favor"</string> - <string name="theme_item_upvoted_color_detail">"Aplicado a: Botones de voto y puntuación (voto a favor)"</string> - <string name="theme_item_downvoted_color">"Color de Voto en Contra"</string> - <string name="theme_item_downvoted_color_detail">"Aplicado a: Botones de voto y puntuación (voto en contra)"</string> + <string name="theme_item_upvoted_color">"Color de Upvotes"</string> + <string name="theme_item_upvoted_color_detail">"Aplicado a: Botones de voto y puntuación (upvote)"</string> + <string name="theme_item_downvoted_color">"Color de Downvote"</string> + <string name="theme_item_downvoted_color_detail">"Aplicado a: Botones de voto y puntuación (downvote)"</string> <string name="theme_item_post_type_background_color">"Color de Fondo de Tipo de Publicación"</string> <string name="theme_item_post_type_background_color_detail">"Aplicado a: Fondo de Tipo de Publicación (IMAGEN, TEXTO, VÍDEO, GIF, ENLACE)"</string> <string name="theme_item_post_type_text_color">"Color de Texto de Tipo de Publicación"</string> @@ -666,32 +677,32 @@ https://play.google.com/store/apps/details?id=ml.docilealligator.infinityforredd <string name="theme_item_comment_vertical_bar_color_7_detail">"Aplicado a: Barra Vertical de Comentario (Nivel 7)"</string> <string name="theme_item_nav_bar_color">"Color de la barra de navegación"</string> <string name="theme_item_nav_bar_color_detail">"Aplicado a: Barra de navegación"</string> - <string name="theme_item_light_status_bar">"Barra de Estado Oscura: Color del Ícono"</string> - <string name="theme_item_light_nav_bar">"Barra de Navegación Oscura: Color del Ícono"</string> - <string name="theme_item_change_status_bar_icon_color_after_toolbar_collapsed_in_immersive_interface">"Cambiar Color de Barra de Estado: Color del Ícono Después de que la Barra de Herramientas Colapse en la Interfaz Inmersiva"</string> + <string name="theme_item_light_status_bar">"Color del Icono de la Barra de Estado Oscura"</string> + <string name="theme_item_light_nav_bar">"Color del Icono de la Barra de Navegación Oscura"</string> + <string name="theme_item_change_status_bar_icon_color_after_toolbar_collapsed_in_immersive_interface">"Cambiar el Color del Icono de la Barra de Estado Después de que la Barra de Herramientas se Contraiga en la Interfaz Inmersiva"</string> <string name="theme_item_available_on_android_8">"Solo para Android 8.0 o superior."</string> <string name="theme_item_available_on_android_6">"Solo para Android 6.0 o superior."</string> <string name="predefined_themes">"Temas Predefinidos"</string> <string name="user_themes">"Tus Temas"</string> - <string name="no_theme_name">"Introduce un nombre"</string> + <string name="no_theme_name">"Cual es el nombre de este tema?"</string> <string name="theme_name_hint">"Nombre del tema"</string> <string name="theme_name_indigo">"Indigo"</string> <string name="theme_name_indigo_dark">"Indigo Oscuro"</string> <string name="theme_name_indigo_amoled">"Indigo OLED"</string> <string name="theme_name_white">"Blanco"</string> <string name="theme_name_white_dark">"Blanco Oscuro"</string> - <string name="theme_name_white_amoled">"Blanco OLED"</string> + <string name="theme_name_white_amoled">"Blanco AMOLED"</string> <string name="theme_name_red">"Rojo"</string> <string name="theme_name_red_dark">"Rojo Oscuro"</string> <string name="theme_name_red_amoled">"Rojo OLED"</string> <string name="theme_name_dracula">"Dracula"</string> <string name="theme_name_calm_pastel">"Pastel Ligero"</string> - <string name="create_light_theme">"Crear un tema claro -Base: Indigo"</string> - <string name="create_dark_theme">"Crear un tema oscuro -Base: Indigo Oscuro"</string> - <string name="create_amoled_theme">"Crear un tema OLED -Base: Indigo OLED"</string> + <string name="create_light_theme">"Crear un Tema Claro +Basado en Tema Índigo"</string> + <string name="create_dark_theme">"Crear un Tema Oscuro +Basado en Tema Índigo Oscuro"</string> + <string name="create_amoled_theme">"Crear un Tema Amoled +Basado en Tema Índigo Amoled"</string> <string name="create_theme_info">"Si deseas crear un tema basado en otro predefinido, toca \"+\" en ese tema."</string> <string name="edit_theme_name">"Renombrar Tema"</string> <string name="edit_theme">"Editar Tema"</string> @@ -699,7 +710,7 @@ Base: Indigo OLED"</string> <string name="delete_theme_dialog_message">"¿Seguro que quieres borrar %1$s?"</string> <string name="share_theme">"Compartir Tema"</string> <string name="change_theme_name">"Renombrar"</string> - <string name="theme_copied">"Enlace copiado"</string> + <string name="theme_copied">"Copiado! Pégalo y compártelo con otras personas."</string> <string name="copy_theme_faied">"Ocurrió un error al copiar la configuración del tema"</string> <string name="cannot_find_theme">"No se ha encontrado el tema"</string> <string name="import_theme">"Importar Tema"</string> @@ -722,7 +733,7 @@ Base: Indigo OLED"</string> <string name="delete_all_users_success">"Se han eliminado todos los usuarios"</string> <!-- Fuzzy --> - <string name="delete_all_sort_types_success">"Se han eliminado todos los \"ordenar por\""</string> + <string name="delete_all_sort_types_success">"Se han eliminado todos los tipos de clasificación con éxito"</string> <!-- Fuzzy --> <string name="delete_all_post_layouts_success">"Se han eliminado todos los diseños de publicación"</string> @@ -745,7 +756,8 @@ Base: Indigo OLED"</string> <string name="flair_preview">"Etiqueta Temática"</string> <string name="awards_preview">"4 Premios"</string> <string name="author_flair_preview">"Etiqueta de Autor Temática"</string> - <string name="comment_content_preview">"Le dí a mi novia una tarjeta de esas que dicen \"Que te mejores\". No está enferma ni nada por el estilo, pero podría mejorar muchísimo."</string> + <string name="comment_content_preview">"Le compré a mi novia una tarjeta de \"Mejora pronto cariño\". +No está enferma ni nada, pero definitivamente podría mejorar."</string> <string name="edit_multi_reddit">"Editar MultiReddit"</string> <string name="delete_multi_reddit">"Borrar Multireddit"</string> <string name="n_awards">"%1$d Premios"</string> @@ -766,7 +778,7 @@ Base: Indigo OLED"</string> <string name="message">"Mensaje"</string> <string name="fetch_gfycat_video_failed">"Ocurrió un error obteniendo el vídeo de Gfycat"</string> <string name="fetch_redgifs_video_failed">"Ocurrió un error obteniendo el vídeo de Redgifs"</string> - <string name="fetching_video_info_please_wait">"Obteniendo información del vídeo, espera..."</string> + <string name="fetching_video_info_please_wait">"Obteniendo información del vídeo. Por favor espera."</string> <string name="error_fetching_imgur_media">"Ocurrió un error cargando las imágenes"</string> <string name="downloading_reddit_video">"Descargando Track Vídeo"</string> <string name="downloading_reddit_video_audio_track">"Descargando Track Audio"</string> @@ -789,14 +801,16 @@ Base: Indigo OLED"</string> <string name="default_font_font_preview">"Por defecto"</string> <string name="load_video_in_redgifs">"Intenta cargando el vídeo en Redgifs"</string> <string name="top_score">"%1$s puntos"</string> - <string name="login_activity_2fa_prompt">"Si cuentas con verificación en dos pasos por favor escribe tu contraseña de la siguiente manera: <contraseña>:<código-de-verificación> + <string name="login_activity_2fa_prompt">"Si tiene habilitada la autenticación de 2 factores, por favor escriba su contraseña como la siguiente: <contraseña>:<código 2FA>. Ejemplo: contraseña:123456"</string> <string name="block_user">"Bloquear usuario"</string> <string name="block_user_success">"Bloqueado"</string> <string name="block_user_failed">"Ocurrió un error al bloquear al usuario"</string> - <string name="give_award_activity_label">"Dar premio"</string> + <string name="submit_crosspost_activity_label">"Crosspost"</string> + <string name="give_award_activity_label">"Premiar"</string> + <string name="action_crosspost">"Crosspost"</string> <string name="action_select_user_flair">"Seleccione categoría de usuario"</string> - <string name="action_give_award">"Dar premio"</string> + <string name="action_give_award">"Premiar"</string> <string name="posts">"Publicaciones"</string> <string name="sidebar">"Barra lateral"</string> <string name="only_for_logged_in_user">"Solo para usuarios registrados"</string> @@ -825,10 +839,12 @@ Las pestañas pueden perder el contenido tras cambiar a otras. Es lo mismo que a <string name="settings_pull_to_refresh_title">"Jale para refrescar"</string> <string name="settings_security_title">"Seguridad"</string> <string name="settings_require_authentication_to_go_to_account_section_in_navigation_drawer_title">"Requerir autenticación al ir a la sección de cuentas en el cajón de navegación"</string> + <string name="settings_long_press_to_hide_toolbar_in_compact_layout_title">"Mantener pulsado para ocultar la barra de herramientas"</string> <string name="settings_post_compact_layout_toolbar_hidden_by_default_title">"Ocultar Barra de Herramientas por defecto"</string> <string name="settings_customize_bottom_app_bar_title">"Personalizar Barra de Navegación Inferior"</string> <string name="settings_main_activity_bottom_app_bar_group_summary">"Página principal"</string> <string name="settings_other_activities_bottom_app_bar_group_summary">"Otras páginas"</string> + <string name="settings_bottom_app_bar_option_count">"Número de opciones"</string> <string name="settings_bottom_app_bar_option_1">"Opción 1"</string> <string name="settings_bottom_app_bar_option_2">"Opción 2"</string> <string name="settings_bottom_app_bar_option_3">"Opción 3"</string> @@ -838,15 +854,24 @@ Las pestañas pueden perder el contenido tras cambiar a otras. Es lo mismo que a <!-- Fuzzy --> <string name="settings_data_saving_mode_info_summary">"En modo de ahorro de datos: -Imágenes previsualizadas están en menor resolución -Videos de Reddit están en menor resolución"</string> +Las imágenes de vista previa tienen una resolución más baja. +Los videos de Reddit tienen una resolución más baja. +La reproducción automática de video está deshabilitada."</string> <string name="settings_translation_title">"Traducción"</string> <string name="settings_translation_summary">"Traduzca esta app en POEditor. Grácias a todos los contribuyentes."</string> <string name="settings_credits_national_flags">"Banderas Nacionales"</string> <string name="settings_credits_national_flags_summary">"Icono hecho por Freepik desde www.flaticon.com"</string> <string name="copy_failed">"Copia fallida"</string> + <string name="delete_all_legacy_settings_success">"Se han borrado todos los ajustes de legado"</string> <string name="downloading_media_finished">"Descargado"</string> + <string name="downloading_image_or_gif_failed_cannot_get_destination_directory">"Descarga fallida: directorio de destino inaccesible"</string> <string name="downloading_media_failed_cannot_download_media">"Descarga fallida"</string> + <string name="downloading_media_failed_cannot_save_to_destination_directory">"Descarga fallida: no se puede guardar el archivo al directorio de destino"</string> + + <!-- Ver Markdown completo --> + <string name="view_full_comment_markdown">"Ver la reducción completa"</string> + <string name="select_user_flair_success">"Etiqueta de usuario seleccionada"</string> + <string name="select_this_user_flair">"Seleccionar esta etiqueta de usuario?"</string> <string name="select_header_size">"Seleccionar tamaño de encabezado"</string> <string name="large">"Grande"</string> <string name="small">"Pequeño"</string> @@ -859,12 +884,19 @@ Videos de Reddit están en menor resolución"</string> <string name="refresh">"Refrescar"</string> <string name="change_sort_type">"Cambiar modo de organización"</string> <string name="change_post_layout">"Cambiar organización de las publicaciones"</string> - <string name="give_award_dialog_title">"Dar premio?"</string> + <string name="give_award_dialog_title">"Premiar?"</string> <string name="anonymous">"Anónimo"</string> + + <!-- Código: %1$d/ +Mensaje: %2$s + +https://s3.eu-west-1.amazonaws.com/po-pub/i/hJAe7sMhrfJzqjhp9VkDQOVC.PNG --> + <string name="give_award_error_message">"Código: %1$d/ +Mensaje: %2$s"</string> <string name="give_award_success">"Premio entregado"</string> <string name="give_award_failed">"Falló"</string> <string name="warning">"Precaución"</string> - <string name="this_is_a_nsfw_subreddit">"Este es un Subreddit NSFW"</string> + <string name="this_is_a_nsfw_subreddit">"Este es un Subreddit NSFW."</string> <string name="this_user_has_nsfw_content">"Este usuario tiene contenido NSFW"</string> <string name="dismiss">"Descartar"</string> <string name="leave">"Salir"</string> @@ -884,17 +916,24 @@ Videos de Reddit están en menor resolución"</string> <string name="downloading">"Descargando"</string> <string name="subreddit_filter_popular_and_all_activity_label">"r/all y r/popular"</string> <string name="settings_miscellaneous_title">"Misceláneo"</string> + <string name="settings_respect_subreddit_recommended_comment_sort_type_title">"Respetar el orden de clasificación de comentario recomendado de Subreddit"</string> <string name="settings_respect_subreddit_recommended_comment_sort_type_summary">"La ordenación de los comentarios no se guardará"</string> <!-- Ocultar Subreddits --> <string name="settings_subreddit_filter_category">"Ocultar Subreddits"</string> <string name="settings_subreddit_filter_popular_and_all">"En r/popular y r/all"</string> + <string name="settings_credits_ufo_capturing_animation_title">"Animación de capturar OVNI"</string> <string name="select_video_quality">"Seleccione calidad del video"</string> <string name="settings_swipe_action_haptic_feedback_title">"Retroalimentación háptica"</string> <string name="settings_hide_subreddit_description_title">"Ocultar Descripción del Subreddit"</string> <string name="settings_disable_image_preview_title">"Deshabilitar Vista Previa de Imagen en Modo Ahorro de Datos"</string> <string name="settings_swipe_action_swipe_left_title">"Deslizar a la izquierda"</string> <string name="settings_swipe_action_swipe_right_title">"Deslizar a la derecha"</string> + <string name="settings_swipe_action_info_summary">"No se aplica a publicaciones con más de una columna o detalles de publicaciones."</string> + <string name="theme_item_no_preview_post_type_icon_tint">"Color de icono de tipo de publicación sin vista previa"</string> + <string name="theme_item_no_preview_post_type_icon_tint_detail">"Aplicado a: Icono que indica el tipo de publicación cuando no hay vista previa disponible"</string> + <string name="theme_item_no_preview_post_type_background_color">"Color de Fondo Tipo de Publicación Sin Vista Previa"</string> + <string name="theme_item_no_preview_post_type_background_color_detail">"Aplicado a: Marcador de posición que indica el tipo de publicación cuando no hay una vista previa disponible"</string> <string name="settings_language_title">"Lenguaje"</string> <string name="customize_post_filter_activity_label">"Personalizar Filtro de Publicaciones"</string> <string name="filtered_posts_activity_subtitle">"Publicaciones filtradas"</string> @@ -908,8 +947,9 @@ Videos de Reddit están en menor resolución"</string> <string name="search_only_users_hint">"Buscar usuarios"</string> <string name="post_type_gif">"Gif"</string> <string name="post_type_gallery">"Galería"</string> - <string name="settings_privacy_policy_title">"Política de privacidad -"</string> + <string name="settings_disable_immersive_interface_in_landscape_mode">"Desactivar la Interfaz Inmersiva en el Modo Horizontal"</string> + <string name="settings_privacy_policy_title">"Política de privacidad"</string> + <string name="settings_delete_read_posts_in_database_title">"Borrar Todas las Publicaciones Leídas en la Base de Datos"</string> <string name="settings_post_filter_title">"Filtro de Publicación"</string> <string name="settings_only_disable_preview_in_video_and_gif_posts_title">"Desactivar previsualización en posts de vídeos y gifs"</string> <string name="settings_enable_search_history_title">"Activar historial de búsqueda"</string> @@ -921,36 +961,110 @@ Videos de Reddit están en menor resolución"</string> <string name="settings_sort_type_title">"Tipo de ordenación"</string> <string name="settings_save_sort_type_title">"Guardar Tipo de ordenación"</string> <string name="settings_subreddit_default_sort_type_title">"Tipo de ordenación por defecto de Subreddits"</string> + <string name="settings_subreddit_default_sort_time_title">"Hora de clasificación predeterminada de subreddit"</string> + <string name="settings_user_default_sort_type_title">"Tipo de orden predeterminada del usuario"</string> + <string name="settings_user_default_sort_time_title">"Tipo de tiempo predeterminada del usuario"</string> <string name="open_link">"Abrir Link"</string> <string name="select_subreddits_and_users">"Seleccionar Subreddits y Usuarios"</string> <string name="theme_item_read_post_title_color">"Color de título de posts leídos"</string> + <string name="theme_item_read_post_title_color_detail">"Aplicado a: Leer el título de la publicación"</string> + <string name="theme_item_read_post_content_color">"Leer el color del contenido de la publicación"</string> + <string name="theme_item_read_post_content_color_detail">"Aplicado a: Leer contenido de publicaciones"</string> + <string name="theme_item_read_post_card_view_background_color">"Leer color de fondo de la vista de tarjeta"</string> + <string name="theme_item_read_post_card_view_background_color_detail">"Aplicado a: Leer Fondo de publicación"</string> + <string name="delete_all_read_posts_success">"Todas las publicaciones leídas han sido eliminadas"</string> <string name="hide_read_posts">"Ocultar posts leídos"</string> <string name="filter_posts">"Filtrar posts"</string> <string name="only_nsfw">"Solo NSFW"</string> <string name="only_spoiler">"Solo spoilers"</string> <string name="title_excludes_strings_hint">"Título: excluir palabras clave (palabra1, palabra2)"</string> + <string name="title_excludes_regex_hint">"Título: excluye regex"</string> + <string name="exclude_subreddits_hint">"Excluir subreddits (p.ej. funny,AskReddit)"</string> + <string name="exclude_users_hint">"Excluir usuarios (p.ej. Hostilenemy,random)"</string> + <string name="exclude_flairs_hint">"Excluir etiquetas de usuario (p.ej. etiqueta1,etiqueta2)"</string> + <string name="contain_flairs_hint">"Contiene etiquetas (p.ej. etiqueta1,etiqueta2)"</string> + <string name="min_vote_hint">"Votos mínimos (-1: sin restricción)"</string> + <string name="max_vote_hint">"Votos máximos (-1: sin restricción)"</string> + <string name="min_comments_hint">"Comentarios mínimos (-1: sin restricción)"</string> + <string name="max_comments_hint">"Comentarios máximos (-1: sin restricción)"</string> + <string name="min_awards_hint">"Premios mínimos (-1: sin restricción)"</string> + <string name="max_awards_hint">"Premios máximos (-1: sin restricción)"</string> + <string name="post_filter_name_hint">"Nombre de Filtro de Publicación"</string> + <string name="post_filter_requires_a_name">"¿Cuál es el nombre del filtro de esta publicación?"</string> + <string name="duplicate_post_filter_dialog_title">"'%1$s' Ya Existe"</string> <string name="duplicate_post_filter_dialog_message">"¿Sobreescribir?"</string> <string name="apply_post_filter_to">"Aplicar a"</string> <string name="post_filter_usage_home">"Inicio"</string> + <string name="post_filter_usage_subreddit">"Subreddit: %1$s"</string> <string name="post_filter_usage_subreddit_all">"Subreddit"</string> + <string name="post_filter_usage_user">"Usuario: %1$s"</string> <string name="post_filter_usage_user_all">"Usuario"</string> + <string name="post_filter_usage_multireddit">"MultiReddit: %1$s"</string> <string name="post_filter_usage_multireddit_all">"MultiReddit"</string> <string name="post_filter_usage_search">"Búsqueda"</string> <string name="subreddit">"Subreddit"</string> <string name="user">"Usuario"</string> <string name="edit_post_filter_name_of_usage_info">"Dejar vacío para aplicar este filtro de posts a todos los subreddits / usuarios / multireddits"</string> + <string name="read_all_messages_time_limit">"Estas haciendo esto muy frecuentemente. Inténtalo mas tarde. Esto es debido a el limite de tasa de la API de Reddit."</string> + <string name="read_all_messages_success">"Todos los mensajes leídos correctamente"</string> + <string name="read_all_messages_failed">"Imposible leer todos los mensajes"</string> + <string name="add_subreddit_or_user_to_multireddit_success">"%1$s ha sido añadido a MultiReddit %2$s"</string> + <string name="add_subreddit_or_user_to_multireddit_failed">"Imposible añadir %1$s a MultiReddit %2$s"</string> + <string name="choose_a_user">"Elige un usuario"</string> + <string name="settings_click_to_show_media_in_gallery_layout">"Pulsa para Mostrar los Medios en la Disposición de Galeria"</string> + <string name="settings_hide_post_type">"Ocultar el Tipo de Publicación"</string> + <string name="settings_hide_the_number_of_awards">"Ocultar el Número de Premios"</string> + <string name="settings_hide_subreddit_and_user_prefix">"Ocultar el Prefijo del Subreddit y del Usuario"</string> + <string name="settings_hide_the_number_of_votes">"Ocultar el Número de Votos"</string> + <string name="settings_hide_the_number_of_comments">"Ocultar el Número de Comentarios"</string> + <string name="post_layout_gallery">"Disposición de Galeria"</string> + <string name="post_layout_card_2">"Disposición de Tarjeta 2"</string> + <string name="have_trouble_login_title">"Problemas para Iniciar Sesión"</string> + <string name="have_trouble_login_message">"¿Quieres probar otra manera de iniciar sesión?"</string> + <string name="vote">"Votar"</string> + <string name="action_share_link">"Compartir enlace"</string> + <string name="action_copy_link">"Copiar enlace"</string> + <string name="action_add_to_post_filter">"Añadir al Filtro de Publicación"</string> + <string name="settings_do_not_blur_nsfw_in_nsfw_subreddits_title">"No difuminar Imágenes NSFW en Subreddits NSFW"</string> + + <!-- Fuzzy --> + <string name="settings_show_avatar_on_the_right">"Mostrar Avatar a la Izquierda"</string> + <string name="settings_backup_settings_title">"Respaldar ajustes"</string> + <string name="settings_restore_settings_title">"Restablecer ajustes"</string> + <string name="settings_credits_love_animation_title">"Animación de Amor"</string> <string name="settings_swipe_between_posts_title">"Deslizar entre posts"</string> <string name="settings_navigation_drawer_title">"Cajón de navegación"</string> + <string name="settings_collapse_account_section_title">"Contraer Sección de Cuentas"</string> <string name="settings_collapse_post_section_title">"Colapsar sección Posts"</string> + <string name="settings_collapse_preferences_section_title">"Contraer Sección de Ajustes"</string> + <string name="settings_collapse_favorite_subreddits_section_title">"Contraer la Sección de Subreddits Favoritos"</string> + <string name="settings_collapse_subscribed_subreddits_section_title">"Contraer la Sección de Subreddits Subscritos"</string> <string name="settings_hide_favorite_subreddits_sections_title">"Ocultar sección Subreddits favoritos"</string> + <string name="settings_hide_subscribed_subreddits_sections_title">"Ocultar la Sección de Subreddits Subscritos"</string> + <string name="settings_default_search_result_tab">"Tabla de Resultados de Búsqueda Predeterminada"</string> <string name="device_default">"Por defecto del dispositivo"</string> <string name="set_by_battery_saver">"Activado por Ahorra de batería"</string> + <string name="theme_item_upvote_ratio_icon_tint">"Color del Icono de la Proporción de Upvotes"</string> + <string name="theme_item_upvote_ratio_icon_tint_detail">"Aplicado a: Icono de la proporción de upvotes"</string> <string name="theme_item_current_user_color">"Usuario actual"</string> + <string name="theme_item_current_user_color_detail">"Aplicado a: Usuario actual en los comentarios"</string> <string name="exclude_domains_hint">"Excluir dominios"</string> - <string name="anonymous_front_page_no_subscriptions">"¡Comienza uniéndote a un sunreddit!"</string> + <string name="anonymous_front_page_no_subscriptions">"¡Comienza uniéndote a un subreddit!"</string> <!-- Fuzzy --> - <string name="backup_settings_success">"Configuración exportada a la carpeta de destino satisfactoriamente"</string> + <string name="backup_settings_success">"Configuración exportada con éxito al directorio de destino. La contraseña del archivo zip generado es 123321. Por favor no modifique el archivo zip."</string> + <string name="create_zip_in_destination_directory_failed">"No se ha podido crear el zip del respaldo en el directorio de destino"</string> + <string name="backup_some_settings_failed">"No se ha podido respaldar algunos ajustes pero otros fueron respaldados correctamente al directorio de destino"</string> + <string name="restore_settings_success">"Ajustes restaurados correctamente. Reinicia la aplicación para ver los cambios."</string> + <string name="restore_settings_partially_failed">"Algunos ajustes pueden no haber sido restaurados correctamente. Reinicia la aplicación para ver los cambios."</string> + <string name="restore_settings_failed_file_corrupted">"Imposible restaurar la configuración. El archivo puede estar corrupto."</string> + <string name="restore_settings_failed_cannot_get_file">"Imposible acceder al archivo"</string> + <string name="suicide_prevention_quote">"Si estas buscando un cartel para no suicidarte, aquí esta.\u2764"</string> + <string name="do_not_show_this_again">"No mostrar esto de nuevo"</string> + <string name="continue_suicide_prevention_activity">"Continuar"</string> + <string name="error_fetching_v_redd_it_video_cannot_get_redirect_url">"Error al recuperar el video de v.redd.it: No se puede conseguir la url de redirección"</string> + <string name="error_fetching_v_redd_it_video_cannot_get_post">"Error al recuperar el video de v.redd.it: No se puede encontrar la publicación"</string> + <string name="error_fetching_v_redd_it_video_cannot_get_post_id">"Error al recuperar el video de v.redd.it: No se puede encontrar el id de la publicación"</string> <string name="always_on">"Siempre encendido"</string> <string name="only_on_wifi">"Solo con wifi"</string> <string name="never">"Nunca"</string> @@ -960,11 +1074,80 @@ Videos de Reddit están en menor resolución"</string> <string name="default_in_array">"Por defecto"</string> <string name="off">"Apagado"</string> <string name="only_on_cellular_data">"Solo con datos móviles"</string> - <string name="upvote">"Voto a favor"</string> - <string name="downvote">"Voto en contra"</string> + <string name="upvote">"Upvote"</string> + <string name="downvote">"Downvote"</string> + <string name="select">"Seleccionar"</string> <string name="exclude_subreddit">"Excluir este subreddit"</string> <string name="exclude_user">"Excluir este usuario"</string> + <string name="exclude_flair">"Excluir esta etiqueta"</string> + <string name="contain_flair">"Contiene esta etiqueta"</string> <string name="exclude_domain">"Excluir dominio"</string> <string name="suggest_title">"Sugerir título"</string> <string name="suggest_title_failed">"Sugerencia de título fallida"</string> + <string name="action_delete_logs">"Eliminar registros"</string> + <string name="inbox_with_count">"Inbox (%1$d)"</string> + <string name="comment_continue_thread">"Continuar hilo"</string> + + <!-- Fuzzy --> + <string name="settings_swipe_vertically_to_go_back_from_media_title">"Deslizar Verticalmente para Regresar del Medio"</string> + <string name="settings_hide_post_flair">"Ocultar la Etiqueta de la Publicación"</string> + <string name="settings_crash_reports_title">"Informes de fallos"</string> + <string name="settings_nsfw_and_spoiler_dangerous_group_title">"Peligroso"</string> + <string name="settings_disable_nsfw_forever_title">"Desactivar NSFW para siempre"</string> + <string name="settings_show_only_one_comment_level_indicator">"Mostrar solo un indicador de nivel de comentario"</string> + <string name="save_comment">"Guardar"</string> + <string name="unsave_comment">"No guardar"</string> + <string name="copy_multi_reddit_path">"Copiar la Ruta de MultiReddit"</string> + <string name="copy_multi_reddit_path_failed">"Imposible copiar la ruta de MultiReddit"</string> + <string name="crash_reports_deleted">"Los informes de fallos han sido eliminados"</string> + <string name="disable_nsfw_forever_message">"Una vez activado, NSFW será permanentemente desactivado, independientemente de si la opción de NFSW esta activada o no. Esta opción es irreversible, la única manera de reactivar NSFW es borrando los datos de la aplicación. + +¿Seguro que quieres activarlo?"</string> + <string name="reply">"Responder"</string> + <string name="rpan_activity_label">"RPAN"</string> + <string name="post_gallery_activity_label">"Publicación de galería"</string> + <string name="trending_activity_label">"Tendencias"</string> + <string name="action_share_rpan_link">"Compartir Link de RPAN"</string> + <string name="action_share_post_link">"Compartir enlace de publicación"</string> + <string name="rpan">"RPAN"</string> + <string name="trending">"Tendencias"</string> + <string name="receive_post_reply_notifications">"Recibir notificaciones de respuesta a publicaciones"</string> + <string name="bottom_sheet_post_gallery">"Galería"</string> + <string name="posting_gallery">"Posteo de Galería"</string> + <string name="label_reddit">"Reddit"</string> + <string name="settings_default_link_post_layout">"Diseño predeterminado de publicación de enlace"</string> + <string name="settings_category_material_you_title">"Material You"</string> + <string name="settings_enable_material_you_warning_summary">"Asegúrate de no tener temas nombrados +\"Material You\", +\"Material You Dark\" or +\"Material You Amoled\". +De lo contrario, cambiales el nombre antes de habilitar Material You."</string> + <string name="settings_enable_material_you_title">"Habilitar Material You"</string> + <string name="settings_enable_material_you_summary">"Personalizar Infinity basado en tu fondo de pantalla"</string> + <string name="settings_apply_material_you_title">"Aplicar Material You"</string> + <string name="settings_apply_material_you_summary">"En caso que Infinity no haya cambiado el tema"</string> + <string name="settings_more_tabs_show_favorite_multireddits_title">"Mostrar Multireddits Favoritos"</string> + <string name="settings_more_tabs_show_multireddits_title">"Mostrar Multireddits"</string> + <string name="settings_collapse_reddit_section_title">"Contraer sección de Reddit"</string> + <string name="settings_video_player_automatic_landscape_orientation">"Cambiar a orientación horizontal en el reproductor de video automáticamente"</string> + <string name="settings_remember_muting_option_in_post_feed">"Recordar opción de silenciar en el feed de publicaciones"</string> + <string name="link_post_layout_auto">"Auto"</string> + <string name="uploaded_images">"Imágenes subidas"</string> + <string name="select_image">"Seleccionar una imágen"</string> + <string name="capture">"Capturar"</string> + <string name="uploading_image">"Subiendo"</string> + <string name="upload_image_success">"Imagen subida correctamente. Haga clic en el botón de imagen nuevamente para ver las imágenes cargadas."</string> + <string name="get_image_bitmap_failed">"No se puede obtener el mapa de bits de la imagen"</string> + <string name="upload_image_failed">"No se pudo subir la imagen"</string> + <string name="load_rpan_broadcasts_failed">"No se pueden cargar transmisiones RPAN"</string> + <string name="parse_rpan_broadcasts_failed">"No se pueden analizar las difusiones RPAN"</string> + <string name="parse_rpan_broadcast_failed">"No se pueden analizar transmisiones RPAN"</string> + <string name="search_comments">"Buscar comentarios"</string> + <string name="please_wait_image_is_uploading">"Aún se está cargando una imagen. Espere por favor."</string> + <string name="error_fetch_trending_search">"Falló la obtención de las búsquedas de tendencias. +Toque para volver a intentarlo."</string> + <string name="error_parse_trending_search">"Falló el análisis de las búsquedas de tendencias. +Toque para volver a intentarlo."</string> + <string name="no_trending_search">"No se encontraron búsquedas de tendencias. +Toque para volver a intentarlo."</string> </resources>
\ No newline at end of file diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index f3a8c7cf..fb2f576f 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -243,6 +243,8 @@ Appuyez pour réessayer."</string> <string name="search">"Rechercher"</string> <string name="posting_video">"Publication de la vidéo"</string> <string name="posting_image">"Publication de l'image"</string> + + <!-- Fuzzy --> <string name="please_wait">"Veuillez patienter."</string> <string name="add_account">"Ajouter un compte"</string> <string name="anonymous_account">"Anonyme"</string> @@ -360,6 +362,8 @@ peut ne pas fonctionner sur Android 11"</string> <string name="settings_volume_keys_navigate_posts_title">"Utiliser les Boutons de Volume pour Naviguer dans les Publications"</string> <string name="settings_mute_video_title">"Couper le Son des Vidéos"</string> <string name="settings_mute_nsfw_video_title">"Couper le Son des Vidéos NSFW"</string> + + <!-- Fuzzy --> <string name="settings_automatically_try_redgifs_title">"Essayez d'Accéder Automatiquement aux Redgifs si les Vidéos sur Gfycat sont Supprimées."</string> <string name="settings_video_player_ignore_nav_bar_title">"Ignorer la Barre de Navigation dans le Lecteur Vidéo"</string> <string name="settings_video_player_ignore_nav_bar_summary">"Empêcher le Contrôleur Vidéo de créer une Marge Supplémentaire"</string> @@ -950,13 +954,24 @@ Les onglets pourraient perdre tout leur contenu quand vous passez d'un onglet à <string name="filtered_posts_activity_subtitle">"Posts filtrés"</string> <string name="post_filter_preference_activity_label">"Filtre des posts"</string> <string name="search_users_result_activity_label">"Utilisateurs"</string> + <string name="action_save_to_database">"Sauvegarder dans la base de données"</string> + <string name="action_read_all_messages">"Lire tous les messages"</string> + <string name="search_only_subreddits_hint">"Chercher des subreddits"</string> + <string name="search_only_users_hint">"Chercher des utilisateurs"</string> + <string name="post_type_gif">"Gif"</string> <string name="post_type_gallery">"Gallerie"</string> <string name="settings_privacy_policy_title">"Politique de confidentialité"</string> + <string name="settings_delete_read_posts_in_database_title">"Supprimer tous les messages lus de la base de données"</string> <string name="settings_post_history_title">"Historique des posts"</string> <string name="settings_mark_posts_as_read_after_voting_title">"Marquer les posts comme lus après avoir voté"</string> <string name="settings_hide_read_posts_automatically_title">"Cacher les posts lus automatiquement"</string> <string name="open_link">"Ouvrir le lien"</string> + <string name="theme_item_read_post_title_color_detail">"Lire le Titre du Post"</string> + <string name="theme_item_read_post_content_color">"Lire la couleur du contenu du post"</string> + <string name="theme_item_read_post_content_color_detail">"Appliqué à: Lire le contenu du post"</string> + <string name="delete_all_read_posts_success">"Suppression de tous les post lus avec succès"</string> <string name="hide_read_posts">"Cacher les posts lus"</string> + <string name="filter_posts">"Filtrer les posts"</string> <string name="only_nsfw">"Seulement NSFW"</string> <string name="only_spoiler">"Seulement Spoiler"</string> <string name="exclude_subreddits_hint">"Exclure des subreddits (e.g. funny, AskReddit)"</string> @@ -968,4 +983,34 @@ Les onglets pourraient perdre tout leur contenu quand vous passez d'un onglet à <string name="post_filter_usage_user_all">"Utilisateur"</string> <string name="read_all_messages_time_limit">"You faites cela trop fréquemment. Essayez plus tard. C'est le taux limite de l'Api Reddit."</string> <string name="choose_a_user">"Choisir un utilisateur"</string> + <string name="settings_hide_the_number_of_votes">"Cacher le Nombre de Votes"</string> + <string name="settings_hide_the_number_of_comments">"Cacher le Nombre de Commentaires"</string> + <string name="have_trouble_login_message">"Voulez vous essayer un autre moyen d'identification ?"</string> + <string name="vote">"Vote"</string> + <string name="action_share_link">"Partager le Lien"</string> + <string name="action_copy_link">"Copier le Lien"</string> + <string name="action_add_to_post_filter">"Ajouter aux Filtres de Post"</string> + <string name="settings_do_not_blur_nsfw_in_nsfw_subreddits_title">"Ne pas cacher les images NSFW dans les Subreddits"</string> + <string name="settings_show_avatar_on_the_right">"Voir l'avatar à droite"</string> + <string name="settings_backup_settings_title">"Paramètres de Sauvegarde"</string> + <string name="settings_restore_settings_title">"Restaurer les Paramètres"</string> + <string name="settings_navigation_drawer_title">"Onglet de Navigation"</string> + <string name="settings_hide_favorite_subreddits_sections_title">"Cacher la section de subreddits favoris"</string> + <string name="device_default">"Appareil par defaut"</string> + <string name="theme_item_current_user_color">"Utilisateur actuel"</string> + <string name="theme_item_current_user_color_detail">"Appliqué à : Utilisateurs en commentaires"</string> + <string name="anonymous_front_page_no_subscriptions">"Commence en rejoignant un subreddit !"</string> + <string name="create_zip_in_destination_directory_failed">"Impossible de créer un zip de sauvegarde dans ce dossier"</string> + <string name="restore_settings_success">"Paramètres restaurés avec succès. Redémarre l'application pour voir les changements"</string> + <string name="do_not_show_this_again">"Ne plus voir ça"</string> + <string name="continue_suicide_prevention_activity">"Continuer"</string> + <string name="inbox_with_count">"Boîte de Réception (%1$d)"</string> + <string name="reply">"Répondre"</string> + <string name="uploaded_images">"Image uploadée"</string> + <string name="select_image">"Sélectionner une image"</string> + <string name="uploading_image">"En train d'uploader"</string> + <string name="upload_image_success">"Image uploadée avec succès. Clique sur le bouton image de nouveau pour voir les images uploadées."</string> + <string name="upload_image_failed">"Impossible d'uploader l'image"</string> + <string name="search_comments">"Chercher des commentaires"</string> + <string name="please_wait_image_is_uploading">"Une image est toujours sn train d'être uploadée. Merci d'attendre"</string> </resources>
\ No newline at end of file diff --git a/app/src/main/res/values-hi/strings.xml b/app/src/main/res/values-hi/strings.xml index eba23820..2454fe06 100644 --- a/app/src/main/res/values-hi/strings.xml +++ b/app/src/main/res/values-hi/strings.xml @@ -252,6 +252,8 @@ Behavior --> <string name="search">"खोज "</string> <string name="posting_video">"वीडियो पोस्ट हो रही है "</string> <string name="posting_image">"चित्र पोस्ट हो रहा है "</string> + + <!-- Fuzzy --> <string name="please_wait">"कृपया इंतजार करें "</string> <string name="add_account">"खाता जोड़ें "</string> <string name="anonymous_account">"अज्ञात "</string> @@ -354,6 +356,8 @@ Behavior --> <!-- Are those commands or a state? Like 'search' is a state in 'search opration' but is a command in 'search something'. Hindi has different appraoch for these two. --> <string name="settings_mute_nsfw_video_title">"मौन NSFW वीडियोज"</string> + + <!-- Fuzzy --> <string name="settings_automatically_try_redgifs_title">"स्वतः ही Redgifs खोलने का प्रयास यदि Gfycat पर वीडियोज हटा दी गयी हों "</string> <string name="settings_video_player_ignore_nav_bar_title">"वीडियो प्लेयर में नेवीगेशन बार का छिपना"</string> <string name="settings_video_player_ignore_nav_bar_summary">"वीडियो कंट्रोलर द्वारा अतिरिक्त हाशिया लेने पर रोक "</string> diff --git a/app/src/main/res/values-hr/strings.xml b/app/src/main/res/values-hr/strings.xml index 4c960a3e..b3244b35 100644 --- a/app/src/main/res/values-hr/strings.xml +++ b/app/src/main/res/values-hr/strings.xml @@ -36,9 +36,6 @@ <string name="action_refresh">"Osvježi"</string> <string name="action_add_comment">"Komentiraj"</string> <string name="action_save_post">"Spremi objavu"</string> - - <!-- Fuzzy --> - <string name="action_view_crosspost_parent">"Roditeljska objava crossposta"</string> <string name="action_search">"Pretraži"</string> <!-- Would you like Lazy mode to be translated or should it be kept in English to emphasize it is a special feature? --> @@ -227,7 +224,6 @@ <string name="search">"Pretraživanje"</string> <string name="posting_video">"Objavljivanje videozapisa"</string> <string name="posting_image">"Objavljivanje slike"</string> - <string name="please_wait">"Molim pričekajte."</string> <string name="add_account">"Dodajte račun"</string> <string name="anonymous_account">"Anonimno"</string> <string name="log_out">"Odjava"</string> @@ -255,30 +251,12 @@ <string name="show_removed_post_failed">"Nismo uspjeli pronaći uklonjenu objavu"</string> <string name="cancel">"Otkaži"</string> <string name="ok">"U redu"</string> - - <!-- Fuzzy --> - <string name="edit_success">"Uspješno uređeno"</string> <string name="delete_post_success">"Uspješno obrisano"</string> <string name="delete_post_failed">"Brisanje nije uspjelo"</string> - - <!-- Fuzzy --> - <string name="mark_nsfw_success">"Uspješno označeno kao NSFW"</string> <string name="mark_nsfw_failed">"Označavanje kao NSFW nije uspjelo"</string> - - <!-- Fuzzy --> - <string name="unmark_nsfw_success">"Uspješno odznačeno kao NSFW"</string> <string name="unmark_nsfw_failed">"Odznačavanje kao NSFW nije uspjelo"</string> - - <!-- Fuzzy --> - <string name="mark_spoiler_success">"Uspješno označeno kao Spojler"</string> <string name="mark_spoiler_failed">"Označavanje kao Spojler nije uspjelo"</string> - - <!-- Fuzzy --> - <string name="unmark_spoiler_success">"Uspješno odznačeno kao Spojler"</string> <string name="unmark_spoiler_failed">"Odznačavanje kao Spojler nije uspjelo"</string> - - <!-- Fuzzy --> - <string name="update_flair_success">"Flair uspješno ažuriran"</string> <string name="update_flair_failed">"Flair nije ažuriran"</string> <string name="edit_flair">"Uredi Flair"</string> <string name="only_allow_64_chars">"Dopusti manje od 64 znaka"</string> @@ -311,10 +289,6 @@ <string name="settings_start_autoplay_visible_area_offset_landscape_title">"Pomak vidljivog područja kod automatski pokrenutog videozapisa (Pejzažno)"</string> <string name="settings_start_autoplay_visible_area_offset_landscape_summary">"Započni automatski pokretati videozapise kada ih je %1$d%% vidljivo"</string> <string name="settings_immersive_interface_title">"Imerzivno sučelje"</string> - - <!-- Fuzzy --> - <string name="settings_immersive_interface_summary">"Ne odnosi se na sve stranice -Možda ne radi na Androidu 11"</string> <string name="settings_immersive_interface_ignore_nav_bar_title">"Ignoriraj navigacijsku traku u imerzivnom sučelju"</string> <string name="settings_immersive_interface_ignore_nav_bar_summary">"Onemogući dodatnu podlogu na donjoj navigacijskoj traci"</string> <string name="settings_customize_tabs_in_main_page_title">"Uredi kartice na Glavnoj stranici"</string> @@ -326,7 +300,6 @@ Možda ne radi na Androidu 11"</string> <string name="settings_volume_keys_navigate_posts_title">"Koristi tipke za glasnoću pri navigaciji objava"</string> <string name="settings_mute_video_title">"Isključi ton na videozapisima"</string> <string name="settings_mute_nsfw_video_title">"Isključi ton na NSFW videozapisima"</string> - <string name="settings_automatically_try_redgifs_title">"Automatski pokušaj pristupiti Redgifs ako su videozapisi na Gfycat-u uklonjeni."</string> <string name="settings_video_player_ignore_nav_bar_title">"Ignoriraj navigacijsku traku u video playeru"</string> <string name="settings_video_player_ignore_nav_bar_summary">"Onemogući dodatnu marginu na video kontroleru"</string> <string name="settings_confirm_to_exit">"Potvrdi izlaz"</string> @@ -341,12 +314,6 @@ Možda ne radi na Androidu 11"</string> <string name="settings_time_format_title">"Vremenski format"</string> <string name="settings_category_post_title">"Objava"</string> <string name="settings_default_post_layout">"Zadani raspored objave"</string> - - <!-- Fuzzy --> - <string name="settings_show_divider_in_compact_layout">"Prikaži razdjelnik u Kompaktnom rasporedu"</string> - - <!-- Fuzzy --> - <string name="settings_show_thumbnail_on_the_left_in_compact_layout">"Prikaži sličicu na lijevoj strani u Kompaktnom rasporedu"</string> <string name="settings_swap_tap_and_long_title">"Zamijeni kratki i dugi dodir u komentarima"</string> <string name="settings_swipe_to_go_back_title">"Prelazak prstom u desno za natrag"</string> <string name="settings_swipe_to_go_back_summary">"Ne primjenjuje se na sve stranice"</string> @@ -689,9 +656,6 @@ Baziraj na Indigo Amoled temi"</string> <string name="cannot_find_theme">"Nije moguće pronaći tu temu"</string> <string name="import_theme">"Uvezi temu"</string> <string name="no_data_in_clipboard">"Nije moguće pronaći podatke u međuspremniku"</string> - - <!-- Fuzzy --> - <string name="import_theme_success">"Uvoz teme uspješan"</string> <string name="parse_theme_failed">"Rasčlana teme nije uspjela"</string> <string name="duplicate_theme_name_dialog_title">"Pronađen je duplikat teme"</string> <string name="duplicate_theme_name_dialog_message">"U bazi podataka već postoji tema pod imenom %1$s. Želite li promijeniti ime uvezene teme?"</string> @@ -699,27 +663,6 @@ Baziraj na Indigo Amoled temi"</string> <string name="override">"Nadglasati"</string> <string name="color_picker">"Birać boja"</string> <string name="invalid_color">"Neispravna boja"</string> - - <!-- Fuzzy --> - <string name="delete_all_subreddits_success">"Brisanje svih podreddita uspješno"</string> - - <!-- Fuzzy --> - <string name="delete_all_users_success">"Brisanje svih korisnika uspješno"</string> - - <!-- Fuzzy --> - <string name="delete_all_sort_types_success">"Brisanje svih vrsti sortiranja uspješno"</string> - - <!-- Fuzzy --> - <string name="delete_all_post_layouts_success">"Brisanje svih rasporeda objava uspješno"</string> - - <!-- Fuzzy --> - <string name="delete_all_themes_success">"Brisanje svih tema uspješno"</string> - - <!-- Fuzzy --> - <string name="delete_all_front_page_scrolled_positions_success">"Brisanje svih pozicija na početnoj strani uspješno"</string> - - <!-- Fuzzy --> - <string name="reset_all_settings_success">"Resertiranje svih postavki uspješno"</string> <string name="username_preview">"u/Hostilenemy"</string> <string name="subreddit_preview">"r/Infinity_For_Reddit"</string> <string name="primary_text_preview">"Primarni tekst"</string> @@ -758,9 +701,6 @@ Baziraj na Indigo Amoled temi"</string> <string name="downloading_reddit_video_muxing">"Multipleksiranje videa i audija"</string> <string name="downloading_reddit_video_save_file_to_public_dir">"Spremanje videa"</string> <string name="downloading_reddit_video_finished">"Preuzeto"</string> - - <!-- Fuzzy --> - <string name="downloading_reddit_video_failed_cannot_get_cache_directory">"Preuzimanje nije uspjelo: nije moguće pristupiti predmemoriji"</string> <string name="downloading_reddit_video_failed_cannot_download_video">"Preuzimanje nije uspjelo: nije moguće preuzeti videozapis"</string> <string name="downloading_reddit_video_failed_cannot_save_video">"Preuzimanje nije uspjelo: nije moguće spremiti videozapis u predmemoriju"</string> <string name="downloading_reddit_video_failed_cannot_save_audio">"Preuzimanje nije uspjelo: nije moguće spremiti audio zapis u predmemoriju"</string> @@ -810,12 +750,6 @@ Baziraj na Indigo Amoled temi"</string> <string name="settings_pull_to_refresh_title">"Povuci za ovježavanje"</string> <string name="settings_security_title">"Sigurnost"</string> <string name="settings_require_authentication_to_go_to_account_section_in_navigation_drawer_title">"Zatraži autentikaciju pri ulasku u Račun u navigacijskoj ladici"</string> - - <!-- Fuzzy --> - <string name="settings_long_press_to_hide_toolbar_in_compact_layout_title">"Dugo pritisni za skrivanje alatne trake u Kompaktnom rasporedu"</string> - - <!-- Fuzzy --> - <string name="settings_post_compact_layout_toolbar_hidden_by_default_title">"Alatna traka u Kompaktnom rasporedu je zadano skrivena"</string> <string name="settings_customize_bottom_app_bar_title">"Uredi donju navigacijsku traku"</string> <string name="settings_main_activity_bottom_app_bar_group_summary">"Glavna stranica"</string> <string name="settings_other_activities_bottom_app_bar_group_summary">"Druge stranice"</string> @@ -826,11 +760,6 @@ Baziraj na Indigo Amoled temi"</string> <string name="settings_bottom_app_bar_option_4">"Opcija 4"</string> <string name="settings_bottom_app_bar_fab">"Plutajući akcijski gumb"</string> <string name="settings_data_saving_mode">"Način uštede podataka"</string> - - <!-- Fuzzy --> - <string name="settings_data_saving_mode_info_summary">"U načinu uštede podataka: -Slike predpregleda su niže rezolucije. -Reddit videi su niže rezolucije."</string> <string name="settings_translation_title">"Prijevod"</string> <string name="settings_translation_summary">"Prevedi ovu aplikaciju na POEditor-u. Hvala svim prinosnicima."</string> <string name="settings_credits_national_flags">"Zastave država"</string> @@ -858,10 +787,6 @@ Reddit videi su niže rezolucije."</string> <string name="change_post_layout">"Promjeni raspored objava"</string> <string name="give_award_dialog_title">"Nagraditi?"</string> <string name="anonymous">"Anonimno"</string> - - <!-- Fuzzy --> - <string name="give_award_error_message">"Kod: %1$d/ -Poruka: %2$s"</string> <string name="give_award_success">"Nagrađeno"</string> <string name="give_award_failed">"Nagrađivanje nije uspjelo"</string> <string name="warning">"Upozorenje"</string> @@ -869,12 +794,6 @@ Poruka: %2$s"</string> <string name="this_user_has_nsfw_content">"Ovaj korisnik ima NSFW sadržaj"</string> <string name="dismiss">"Odbaci"</string> <string name="leave">"Napusti"</string> - - <!-- Fuzzy --> - <string name="go_to_subreddit">"Idi na podreddit"</string> - - <!-- Fuzzy --> - <string name="go_to_user">"Idi na profil korisnika"</string> <string name="go_to_thing_hint">"Ime"</string> <string name="random">"Nasumično"</string> <string name="random_subreddit">"Nasumični podreddit"</string> @@ -896,9 +815,6 @@ Poruka: %2$s"</string> <string name="settings_disable_image_preview_title">"Onemogući predpregled slike u "</string> <string name="settings_swipe_action_swipe_left_title">"Povuci lijevo"</string> <string name="settings_swipe_action_swipe_right_title">"Prelazak prstom u desno"</string> - - <!-- Fuzzy --> - <string name="settings_swipe_action_info_summary">"Nije primjenjivo na feed sa više od 1 stupca ili pojedinosti o objavi"</string> <string name="theme_item_no_preview_post_type_icon_tint">"Boja ikone objave bez predpregleda"</string> <string name="theme_item_no_preview_post_type_icon_tint_detail">"Primjenjeno na: Ikonu koja ukazuje vrstu objave kada nema predpregleda"</string> <string name="theme_item_no_preview_post_type_background_color">"Boja pozadine objave bez predpregleda"</string> @@ -925,36 +841,193 @@ Poruka: %2$s"</string> <string name="settings_post_history_title">"Povijest objava"</string> <string name="settings_mark_posts_as_read_title">"Označi objave kao pročitano"</string> <string name="settings_mark_posts_as_read_after_voting_title">"Označi objave kao pročitano nakon glasanja"</string> + <string name="settings_mark_posts_as_read_on_scroll_title"></string> <string name="settings_hide_read_posts_automatically_title">"Sakrij pročitane objave automatski"</string> <string name="settings_sort_type_title">"Vrsta sortiranja"</string> <string name="settings_save_sort_type_title">"Spremi vrstu sortiranja"</string> <string name="settings_subreddit_default_sort_type_title">"Zadana vrsta sortiranja subreddit-a"</string> <string name="settings_subreddit_default_sort_time_title">"Zadano vrijeme sortiranja subreddit-a"</string> - - <!-- Fuzzy --> - <string name="settings_user_default_sort_type_title">"Zadana tip sortiranja korisnika"</string> <string name="settings_user_default_sort_time_title">"Zadano vrijeme sortiranja korisnika"</string> <string name="open_link">"Otvori link"</string> + <string name="select_subreddits_and_users"></string> + <string name="theme_item_read_post_title_color"></string> + <string name="theme_item_read_post_title_color_detail"></string> + <string name="theme_item_read_post_content_color"></string> + <string name="theme_item_read_post_content_color_detail"></string> + <string name="theme_item_read_post_card_view_background_color"></string> + <string name="theme_item_read_post_card_view_background_color_detail"></string> + <string name="delete_all_read_posts_success"></string> + <string name="hide_read_posts"></string> + <string name="filter_posts"></string> + <string name="only_nsfw"></string> + <string name="only_spoiler"></string> + <string name="title_excludes_strings_hint"></string> + <string name="title_excludes_regex_hint"></string> + <string name="exclude_subreddits_hint"></string> + <string name="exclude_users_hint"></string> + <string name="exclude_flairs_hint"></string> + <string name="contain_flairs_hint"></string> + <string name="min_vote_hint"></string> + <string name="max_vote_hint"></string> + <string name="min_comments_hint"></string> + <string name="max_comments_hint"></string> + <string name="min_awards_hint"></string> + <string name="max_awards_hint"></string> + <string name="post_filter_name_hint"></string> <string name="post_filter_requires_a_name">"Koje je ime filtera objave"</string> + <string name="duplicate_post_filter_dialog_title"></string> <string name="duplicate_post_filter_dialog_message">"Poništi?"</string> + <string name="apply_post_filter_to"></string> <string name="post_filter_usage_home">"Home"</string> + <string name="post_filter_usage_subreddit"></string> <string name="post_filter_usage_subreddit_all">"Subreddit"</string> + <string name="post_filter_usage_user"></string> + <string name="post_filter_usage_user_all"></string> + <string name="post_filter_usage_multireddit"></string> + <string name="post_filter_usage_multireddit_all"></string> + <string name="post_filter_usage_search"></string> <string name="subreddit">"Subreddit"</string> <string name="user">"Korisnik"</string> + <string name="edit_post_filter_name_of_usage_info"></string> + <string name="read_all_messages_time_limit"></string> + <string name="read_all_messages_success"></string> + <string name="read_all_messages_failed"></string> + <string name="add_subreddit_or_user_to_multireddit_success"></string> + <string name="add_subreddit_or_user_to_multireddit_failed"></string> <string name="choose_a_user">"Odaberi korisnika"</string> <string name="settings_click_to_show_media_in_gallery_layout">"Klikni da prikažeš medij u obliku galerije"</string> <string name="settings_hide_post_type">"Sakrij vrstu objave"</string> <string name="settings_hide_the_number_of_awards">"Sakrij broj nagrada"</string> + <string name="settings_hide_subreddit_and_user_prefix"></string> <string name="settings_hide_the_number_of_votes">"Sakrij broj glasanja"</string> <string name="settings_hide_the_number_of_comments">"Sakrij broj komentara"</string> <string name="post_layout_gallery">"Izgled galerije"</string> <string name="post_layout_card_2">"Izgled karte 2"</string> + <string name="have_trouble_login_title"></string> <string name="have_trouble_login_message">"Želite li se prijaviti na drugi način?"</string> <string name="vote">"Glasaj"</string> <string name="action_share_link">"Podjeli link"</string> <string name="action_copy_link">"Kopiraj link"</string> <string name="action_add_to_post_filter">"Dodaj u vrstu objave"</string> <string name="settings_do_not_blur_nsfw_in_nsfw_subreddits_title">"Nemoj blurati NSFW slike u NSFW Subredditima"</string> - <string name="settings_show_avatar_on_the_right">"Prikazi sliku Avatara sa lijeve strane"</string> + <string name="settings_backup_settings_title"></string> <string name="settings_restore_settings_title">"Vrati postavke"</string> + <string name="settings_credits_love_animation_title"></string> + <string name="settings_swipe_between_posts_title"></string> + <string name="settings_navigation_drawer_title"></string> + <string name="settings_collapse_account_section_title"></string> + <string name="settings_collapse_post_section_title"></string> + <string name="settings_collapse_preferences_section_title"></string> + <string name="settings_collapse_favorite_subreddits_section_title"></string> + <string name="settings_collapse_subscribed_subreddits_section_title"></string> + <string name="settings_hide_favorite_subreddits_sections_title"></string> + <string name="settings_hide_subscribed_subreddits_sections_title"></string> + <string name="settings_default_search_result_tab"></string> + <string name="device_default"></string> + <string name="set_by_battery_saver"></string> + <string name="theme_item_upvote_ratio_icon_tint"></string> + <string name="theme_item_upvote_ratio_icon_tint_detail"></string> + <string name="theme_item_current_user_color"></string> + <string name="theme_item_current_user_color_detail"></string> + <string name="exclude_domains_hint"></string> + <string name="anonymous_front_page_no_subscriptions"></string> + <string name="backup_settings_success"></string> + <string name="create_zip_in_destination_directory_failed"></string> + <string name="backup_some_settings_failed"></string> + <string name="restore_settings_success"></string> + <string name="restore_settings_partially_failed"></string> + <string name="restore_settings_failed_file_corrupted"></string> + <string name="restore_settings_failed_cannot_get_file"></string> + <string name="suicide_prevention_quote"></string> + <string name="do_not_show_this_again"></string> + <string name="continue_suicide_prevention_activity"></string> + <string name="error_fetching_v_redd_it_video_cannot_get_redirect_url"></string> + <string name="error_fetching_v_redd_it_video_cannot_get_post"></string> + <string name="error_fetching_v_redd_it_video_cannot_get_post_id"></string> + <string name="always_on"></string> + <string name="only_on_wifi"></string> + <string name="never"></string> + <string name="normal"></string> + <string name="extra_large"></string> + <string name="enormously_large"></string> + <string name="default_in_array"></string> + <string name="off"></string> + <string name="only_on_cellular_data"></string> + <string name="upvote"></string> + <string name="downvote"></string> + <string name="select"></string> + <string name="exclude_subreddit"></string> + <string name="exclude_user"></string> + <string name="exclude_flair"></string> + <string name="contain_flair"></string> + <string name="exclude_domain"></string> + <string name="suggest_title"></string> + <string name="suggest_title_failed"></string> + <string name="action_delete_logs"></string> + <string name="inbox_with_count"></string> + <string name="comment_continue_thread"></string> + <string name="settings_swipe_vertically_to_go_back_from_media_title"></string> + <string name="settings_hide_post_flair"></string> + <string name="settings_crash_reports_title"></string> + <string name="settings_nsfw_and_spoiler_dangerous_group_title"></string> + <string name="settings_disable_nsfw_forever_title"></string> + <string name="settings_show_only_one_comment_level_indicator"></string> + <string name="save_comment"></string> + <string name="unsave_comment"></string> + <string name="copy_multi_reddit_path"></string> + <string name="copy_multi_reddit_path_failed"></string> + <string name="crash_reports_deleted"></string> + <string name="disable_nsfw_forever_message"></string> + <string name="reply"></string> + <string name="rpan_activity_label"></string> + <string name="post_gallery_activity_label"></string> + <string name="trending_activity_label"></string> + <string name="action_share_rpan_link"></string> + <string name="action_share_post_link"></string> + <string name="rpan"></string> + <string name="trending"></string> + <string name="receive_post_reply_notifications"></string> + <string name="bottom_sheet_post_gallery"></string> + <string name="posting_gallery"></string> + <string name="label_reddit"></string> + <string name="settings_default_link_post_layout"></string> + <string name="settings_category_material_you_title"></string> + <string name="settings_enable_material_you_warning_summary"></string> + <string name="settings_enable_material_you_title"></string> + <string name="settings_enable_material_you_summary"></string> + <string name="settings_apply_material_you_title"></string> + <string name="settings_apply_material_you_summary"></string> + <string name="settings_more_tabs_show_favorite_multireddits_title"></string> + <string name="settings_more_tabs_show_multireddits_title"></string> + <string name="settings_collapse_reddit_section_title"></string> + <string name="settings_video_player_automatic_landscape_orientation"></string> + <string name="settings_remember_muting_option_in_post_feed"></string> + <string name="link_post_layout_auto"></string> + <string name="uploaded_images"></string> + <string name="select_image"></string> + <string name="capture"></string> + <string name="uploading_image"></string> + <string name="upload_image_success"></string> + <string name="get_image_bitmap_failed"></string> + <string name="upload_image_failed"></string> + <string name="load_rpan_broadcasts_failed"></string> + <string name="parse_rpan_broadcasts_failed"></string> + <string name="parse_rpan_broadcast_failed"></string> + <string name="search_comments"></string> + <string name="please_wait_image_is_uploading"></string> + <string name="error_fetch_trending_search"></string> + <string name="error_parse_trending_search"></string> + <string name="no_trending_search"></string> + <string name="wiki_activity_label"></string> + <string name="settings_post_details_title"></string> + <string name="settings_separate_post_and_comments_in_portrait_mode_title"></string> + <string name="settings_separate_post_and_comments_in_landscape_mode_title"></string> + <string name="settings_separate_post_and_comments_summary"></string> + <string name="settings_use_bottom_toolbar_in_media_viewer_title"></string> + <string name="settings_secure_mode_title"></string> + <string name="settings_secure_mode_summary"></string> + <string name="discard_dialog_button"></string> + <string name="error_loading_wiki"></string> + <string name="no_wiki"></string> + <string name="material_you_notification_title"></string> </resources>
\ No newline at end of file diff --git a/app/src/main/res/values-hu/strings.xml b/app/src/main/res/values-hu/strings.xml index 45e2d0ed..83b9b4c6 100644 --- a/app/src/main/res/values-hu/strings.xml +++ b/app/src/main/res/values-hu/strings.xml @@ -223,6 +223,8 @@ <string name="search">"Keresés"</string> <string name="posting_video">"Videó posztolása"</string> <string name="posting_image">"Kép posztolása"</string> + + <!-- Fuzzy --> <string name="please_wait">"Kérlek várj."</string> <string name="add_account">"Fiók hozzáadása"</string> <string name="anonymous_account">"Anoním"</string> @@ -309,6 +311,8 @@ <string name="settings_volume_keys_navigate_posts_title">"Hangerőgombok használata posztok navigálására"</string> <string name="settings_mute_video_title">"Videók némítása"</string> <string name="settings_mute_nsfw_video_title">"NSFW videók némítása"</string> + + <!-- Fuzzy --> <string name="settings_automatically_try_redgifs_title">"Próbálja autómatikusan elérni a Redgifeket, ha a videók Gfycat-en el vannak távolítva."</string> <string name="settings_video_player_ignore_nav_bar_title">"Navigációs sáv ignorálása videó lejátszóban"</string> <string name="settings_video_player_ignore_nav_bar_summary">"Annak megelőzése, hogy a videó kontrollernek extra szegélye legyen"</string> diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index db6d702f..53f31dfa 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -4,9 +4,9 @@ <string name="comment_activity_label">"Invia commento"</string> <string name="comment_activity_label_is_replying">"Rispondi"</string> <string name="post_text_activity_label">"Post testuale"</string> - <string name="subreddit_selection_activity_label">"Seleziona Subreddit"</string> - <string name="post_link_activity_label">"Post Link"</string> - <string name="post_image_activity_label">"Post di Immagine"</string> + <string name="subreddit_selection_activity_label">"Seleziona subreddit"</string> + <string name="post_link_activity_label">"Post link"</string> + <string name="post_image_activity_label">"Post immagine"</string> <string name="post_video_activity_label">"Post video"</string> <string name="rules_activity_label">"Regole"</string> <string name="search_subreddits_activity_label">"Subreddit"</string> @@ -14,10 +14,10 @@ <string name="edit_comment_activity_label">"Modifica commento"</string> <string name="view_message_activity_label">"Posta"</string> <string name="settings_activity_label">"Impostazioni"</string> - <string name="account_saved_thing_activity_label">"Salvato"</string> + <string name="account_saved_thing_activity_label">"Post salvati"</string> <string name="create_multi_reddit_activity_label">"Crea Multireddit"</string> <string name="subreddit_multiselection_activity_label">"Seleziona Subreddit"</string> - <string name="custom_theme_listing_activity_label">"Tema personalizzato"</string> + <string name="custom_theme_listing_activity_label">"Temi personalizzati"</string> <string name="customize_theme_activity_label">"Personalizza tema"</string> <string name="customize_theme_activity_create_theme_label">"Crea tema"</string> <string name="theme_preview_activity_label">"Anteprima tema"</string> @@ -26,7 +26,7 @@ <string name="report_activity_label">"Segnala"</string> <string name="view_imgur_media_activity_image_label">"Immagine %1$d/%2$d"</string> <string name="view_imgur_media_activity_video_label">"Video %1$d/%2$d"</string> - <string name="send_private_message_activity_label">"Invia PM"</string> + <string name="send_private_message_activity_label">"Invia messaggio privato"</string> <string name="view_reddit_gallery_activity_image_label">"Immagine %1$d/%2$d"</string> <string name="view_reddit_gallery_activity_gif_label">"Gif %1$d/%2$d"</string> <string name="view_reddit_gallery_activity_video_label">"Video %1$d/%2$d"</string> @@ -38,17 +38,17 @@ <string name="action_save_post">"Salva post"</string> <string name="action_view_crosspost_parent">"Mostra origine del crosspost"</string> <string name="action_search">"Cerca"</string> - <string name="action_start_lazy_mode">"Inizia Modalità pigra"</string> - <string name="action_stop_lazy_mode">"Ferma Modalità pigra"</string> + <string name="action_start_lazy_mode">"Attiva la modalità pigra"</string> + <string name="action_stop_lazy_mode">"Disattiva la modalità pigra"</string> <string name="action_send">"Invia"</string> <string name="action_sort">"Ordina"</string> - <string name="action_hide_post">"Nascondi Post"</string> - <string name="action_unhide_post">"Visualizza Post"</string> + <string name="action_hide_post">"Nascondi"</string> + <string name="action_unhide_post">"Rimuovi dai nascosti"</string> <string name="action_edit_post">"Modifica Post"</string> <string name="action_delete_post">"Elimina Post"</string> - <string name="action_mark_nsfw">"Seleziona NSFW"</string> + <string name="action_mark_nsfw">"Contrassegna NSFW"</string> <string name="action_unmark_nsfw">"Deseleziona NSFW"</string> - <string name="action_mark_spoiler">"Seleziona Spoiler"</string> + <string name="action_mark_spoiler">"Contrassegna Spoiler"</string> <string name="action_unmark_spoiler">"Deseleziona Spoiler"</string> <string name="action_edit_flair">"Modifica flair"</string> <string name="action_change_post_layout">"Cambia disposizione post"</string> @@ -60,7 +60,7 @@ <string name="action_report">"Segnala"</string> <string name="action_see_removed">"Visualizza Rimosso"</string> <string name="action_set_wallpaper">"Imposta come Sfondo"</string> - <string name="action_send_private_message">"Invia Messaggio Privato"</string> + <string name="action_send_private_message">"Invia Messaggio privato"</string> <string name="action_block_user">"Blocca utente"</string> <string name="parse_json_response_error">"Si è verificato un errore durante l'analisi della risposta JSON"</string> <string name="retrieve_token_error">"Errore durante il recupero del token"</string> @@ -68,38 +68,38 @@ <string name="access_denied">"Accesso negato"</string> <string name="parse_user_info_error">"Si è verificato un errore durante l'analisi delle informazioni dell'utente"</string> <string name="no_system_webview_error">"Errore apertura di System WebView"</string> - <string name="error_loading_image_tap_to_retry">"Errore durante il caricamento dell'immagine. Clicca per riprovare."</string> - <string name="load_posts_error">"Errore durante il caricamento dei post. Clicca per riprovare."</string> - <string name="load_more_posts_error">"Errore nel caricamento dei post."</string> + <string name="error_loading_image_tap_to_retry">"Errore durante il caricamento dell'immagine. Tocca per riprovare."</string> + <string name="load_posts_error">"Errore durante il caricamento dei post. Tocca per riprovare."</string> + <string name="load_more_posts_error">"Errore durante il caricamento dei post."</string> <string name="load_post_error">"Errore durante il caricamento di questo post. Clicca per riprovare."</string> <string name="search_subreddits_error">"Errore durante la ricerca dei subreddit. -Clicca per riprovare."</string> +Tocca per riprovare."</string> <string name="search_users_error">"Errore durante la ricerca degli utenti. -Clicca per riprovare."</string> +Tocca per riprovare."</string> <string name="no_posts">"Nessun post trovato"</string> <string name="no_comments">"Nessun commento trovato"</string> <string name="no_subreddits">"Nessun subreddit trovato"</string> <string name="no_users">"Nessun utente trovato"</string> <string name="no_multi_reddits">"Nessun Multireddit trovato"</string> - <string name="no_storage_permission">"Nessuna autorizzazione di archiviazione per salvare questo file"</string> - <string name="load_comments_failed">"Errore caricamento dei commenti. -Clicca per riprovare."</string> + <string name="no_storage_permission">"Autorizzazione allo spazio di archiviazione non consentita. Attivala per salvare questo file"</string> + <string name="load_comments_failed">"Errore nel caricamento dei commenti. +Tocca per riprovare."</string> <string name="retry">"Riprova"</string> <string name="comments">"Commenti"</string> - <string name="no_comments_yet">"Ancora nessun commento. Vuoi scriverne uno?"</string> - <string name="vote_failed">"Voto fallito"</string> + <string name="no_comments_yet">"Nessun commento presente. Vuoi scriverne uno tu?"</string> + <string name="vote_failed">"Voto non assegnato"</string> <string name="refresh_post_failed">"Errore nel ricaricamento del post"</string> - <string name="load_messages_failed">"Errore caricamento messaggi. Clicca per riprovare."</string> + <string name="load_messages_failed">"Errore durante il caricamento messaggi. Tocca per riprovare."</string> <string name="no_messages">"Vuoto"</string> <string name="nsfw">"NSFW"</string> <string name="karma_info">"Karma: %1$d"</string> <string name="karma_info_user_detail">"Karma: %1$d (%2$d + %3$d)"</string> - <string name="cakeday_info">"Compleanno: + <string name="cakeday_info">"Compleanno account: %1$s"</string> <string name="since">"Da:"</string> <string name="profile">"Profilo"</string> - <string name="subscriptions">"Sottoscrizioni"</string> + <string name="subscriptions">"Iscrizioni"</string> <string name="multi_reddit">"Multireddit"</string> <string name="inbox">"Posta"</string> <string name="upvoted">"Voto Positivo"</string> @@ -113,32 +113,32 @@ Clicca per riprovare."</string> <string name="subscribers_number_detail">"Iscritti: %1$d"</string> <string name="online_subscribers_number_detail">"Online: %1$d"</string> <string name="cannot_fetch_subreddit_info">"Impossibile recuperare le informazioni del subreddit"</string> - <string name="cannot_fetch_user_info">"Impossibile recuperare le informazioni utente"</string> - <string name="cannot_fetch_sidebar">"Impossibile recuperare la barra laterale"</string> + <string name="cannot_fetch_user_info">"Impossibile recuperare le informazioni dell'utente"</string> + <string name="cannot_fetch_sidebar">"Impossibile mostrare barra laterale"</string> <string name="cannot_fetch_multireddit">"Impossibile recuperare le informazioni multireddit"</string> <string name="subscribe">"Iscriviti"</string> <string name="unsubscribe">"Disiscriviti"</string> - <string name="subscribed">"Sottoscritto"</string> - <string name="subscribe_failed">"Sottoscrizione fallita"</string> + <string name="subscribed">"Iscritto"</string> + <string name="subscribe_failed">"Iscrizione non riuscita"</string> <string name="unsubscribed">"Disiscritto"</string> - <string name="unsubscribe_failed">"Disiscrizione fallita"</string> + <string name="unsubscribe_failed">"Disiscrizione non riuscita"</string> <string name="follow">"Segui"</string> <string name="unfollow">"Non seguire più"</string> <string name="followed">"Seguiti"</string> - <string name="follow_failed">"Errore nel seguire"</string> + <string name="follow_failed">"Errore nel seguire. Riprova"</string> <string name="unfollowed">"Smesso di seguire"</string> - <string name="unfollow_failed">"Disiscrizione Fallita"</string> - <string name="content_description_banner_imageview">"Immagine banner subreddit"</string> + <string name="unfollow_failed">"Disiscrizione non riuscita"</string> + <string name="content_description_banner_imageview">"Banner subreddit"</string> <string name="app_label">"Infinity"</string> - <string name="search_hint">"Cerca qualcosa"</string> + <string name="search_hint">"Cerca"</string> <string name="no_posts_no_lazy_mode">"Nessun post disponibile"</string> - <string name="lazy_mode_start">"Modalità Pigra parte in %1$.1fs"</string> - <string name="lazy_mode_stop">"Modalità Pigra fermata"</string> - <string name="write_comment_hint">"I tuoi pensieri interessanti qui"</string> + <string name="lazy_mode_start">"Modalità Pigra partirà tra %1$.1fs"</string> + <string name="lazy_mode_stop">"Modalità Pigra disattivata"</string> + <string name="write_comment_hint">"Commenta"</string> <string name="comment_content_required">"Dove sono i tuoi pensieri interessanti?"</string> - <string name="sending_comment">"Invio in corso"</string> + <string name="sending_comment">"Invio"</string> <string name="send_comment_success">"Commento inviato"</string> - <string name="send_comment_failed">"Impossibile inviare questo commento"</string> + <string name="send_comment_failed">"Impossibile inviare commento"</string> <string name="send_message_username_hint">"Utente"</string> <string name="send_message_subject_hint">"Oggetto (massimo 100 caratteri)"</string> <string name="send_message_content_hint">"Messaggio"</string> @@ -149,17 +149,17 @@ Clicca per riprovare."</string> <string name="message_content_required">"Devi dire qualcosa al destinatario"</string> <string name="sending_message">"Invio"</string> <string name="send_message_success">"Messaggio inviato"</string> - <string name="send_message_failed">"Impossibile inviare questo messaggio"</string> - <string name="select_a_subreddit">"Per favore prima seleziona un subreddit"</string> - <string name="title_required">"Il post ha bisogno di un buon titolo"</string> + <string name="send_message_failed">"Impossibile inviare messaggio"</string> + <string name="select_a_subreddit">"Seleziona un subreddit"</string> + <string name="title_required">"Al post manca il titolo"</string> <string name="link_required">"Hey dov'è il link?"</string> - <string name="select_an_image">"Per favore prima seleziona un'immagine"</string> + <string name="select_an_image">"Selezionare un'immagine"</string> <string name="posting">"Pubblicazione"</string> - <string name="post_failed">"Impossibile postare"</string> + <string name="post_failed">"Pubblicazione non riuscita"</string> <string name="error_processing_image">"Errore durante l'elaborazione dell'immagine"</string> <string name="error_processing_video">"Errore durante l'elaborazione del video"</string> - <string name="download_started">"Download avviato. Controlla la notifica per i progressi."</string> - <string name="comment_load_more_comments">"Carica più commenti"</string> + <string name="download_started">"Download avviato. Ulteriori dettagli nella notifica. "</string> + <string name="comment_load_more_comments">"Carica altri commenti"</string> <string name="comment_load_more_comments_failed">"Caricamento fallito. Tocca per riprovare."</string> <string name="loading">"Caricamento"</string> <string name="post_title_hint">"Titolo"</string> @@ -180,15 +180,15 @@ Clicca per riprovare."</string> <string name="error_getting_video">"Errore durante l'acquisizione del video"</string> <string name="no_camera_available">"Nessuna app disponibile per la fotocamera"</string> <string name="error_creating_temp_file">"Errore creazione file temp"</string> - <string name="video_is_processing">"Il video è in elaborazione. Attendere prego."</string> - <string name="image_is_processing">"L'immagine è in elaborazione. Attendere prego."</string> - <string name="gif_is_processing">"La gif è in elaborazione. Attendere prego."</string> + <string name="video_is_processing">"Video in elaborazione. Attendere."</string> + <string name="image_is_processing">"Immagine in elaborazione. Attendere. "</string> + <string name="gif_is_processing">"Gif in elaborazione. Attendere."</string> <string name="flair">"Flair"</string> <string name="spoiler">"Spoiler"</string> - <string name="no_flair">"Flair assente"</string> - <string name="error_loading_flairs">"Errore nel caricamento dei flair. Clicca per riprovare."</string> + <string name="no_flair">"Nessun flair"</string> + <string name="error_loading_flairs">"Errore nel caricamento dei flair. Tocca per riprovare."</string> <string name="no_rule">"Nessuna regola"</string> - <string name="error_loading_rules">"Errore caricamento regole. Clicca per riprovare."</string> + <string name="error_loading_rules">"Errore caricamento regole. Tocca per riprovare."</string> <string name="error_loading_rules_without_retry">"Errore caricamento regole"</string> <string name="search_in">"Cerca in"</string> <string name="all_subreddits">"Tutti i subreddit"</string> @@ -214,12 +214,12 @@ Clicca per riprovare."</string> <string name="sort_time_month">"Mese"</string> <string name="sort_time_year">"Anno"</string> <string name="sort_time_all_time">"Sempre"</string> - <string name="no_activity_found_for_share">"Non esiste un'app in grado di gestire l'azione di condivisione"</string> - <string name="archived_post_vote_unavailable">"Post archiviato. Non è possibile votare."</string> - <string name="archived_post_comment_unavailable">"Post archiviato. Non è possibile commentare."</string> - <string name="archived_post_reply_unavailable">"Post archiviato. Non è possibile rispondere."</string> - <string name="locked_post_comment_unavailable">"Post bloccato. Non è possibile commentare."</string> - <string name="locked_post_reply_unavailable">"Post bloccato. Non è possibile rispondere."</string> + <string name="no_activity_found_for_share">"Nessun'app in grado di condividere"</string> + <string name="archived_post_vote_unavailable">"Impossibile votare, il post è archiviato. "</string> + <string name="archived_post_comment_unavailable">"Impossibile commentare, il post è archiviato. "</string> + <string name="archived_post_reply_unavailable">"Impossibile rispondere, il post è archiviato."</string> + <string name="locked_post_comment_unavailable">"Impossibile commentare, il post è bloccato."</string> + <string name="locked_post_reply_unavailable">"Impossibile rispondere, il post è bloccato. "</string> <string name="text">"TESTO"</string> <string name="link">"LINK"</string> <string name="image">"IMMAGINE"</string> @@ -230,6 +230,8 @@ Clicca per riprovare."</string> <string name="search">"Cerca"</string> <string name="posting_video">"Pubblicazione del video"</string> <string name="posting_image">"Pubblicazione dell'immagine"</string> + + <!-- Fuzzy --> <string name="please_wait">"Attendere prego."</string> <string name="add_account">"Aggiungi account"</string> <string name="anonymous_account">"Anonimo"</string> @@ -263,27 +265,27 @@ Clicca per riprovare."</string> <string name="delete_post_failed">"Cancellazione fallita"</string> <!-- Fuzzy --> - <string name="mark_nsfw_success">"Seleziona come NSFW riuscito"</string> - <string name="mark_nsfw_failed">"Seleziona come NSFW non riuscito"</string> + <string name="mark_nsfw_success">"Contrassegnato come NSFW"</string> + <string name="mark_nsfw_failed">"Contrassegna come NSFW non riuscito"</string> <!-- Fuzzy --> - <string name="unmark_nsfw_success">"Deseleziona NSFW riuscito"</string> + <string name="unmark_nsfw_success">"Decontrassegnato come NSFW "</string> <string name="unmark_nsfw_failed">"Deselezionamento NSFW fallito"</string> - <string name="mark_spoiler_success">"Seleziona come spoiler riuscito"</string> + <string name="mark_spoiler_success">"Contrassegna come spoiler riuscito"</string> <string name="mark_spoiler_failed">"Seleziona come spoiler non riuscito"</string> <!-- Fuzzy --> - <string name="unmark_spoiler_success">"Deseleziona come spoiler riuscito"</string> + <string name="unmark_spoiler_success">"Spoiler decontrassegnato"</string> <string name="unmark_spoiler_failed">"Deselezionamento spoiler fallito"</string> <!-- Fuzzy --> - <string name="update_flair_success">"Aggiorna flair eseguito con successo"</string> + <string name="update_flair_success">"Flair aggiornato"</string> <string name="update_flair_failed">"Aggiorna flair fallito"</string> <string name="edit_flair">"Modifica flair"</string> <string name="only_allow_64_chars">"Consentire solo meno di 64 caratteri"</string> <string name="view_all_comments">"Clicca qui per sfogliare tutti i commenti"</string> <string name="notification_summary_account">"Account"</string> - <string name="notification_summary_message">"Nuovo Messaggio"</string> + <string name="notification_summary_message">"Nuovo messaggio"</string> <string name="notification_summary_subreddit">"Subreddit"</string> <string name="notification_summary_award">"Premio"</string> <string name="notification_new_messages">"%1$d Nuovi Messaggi"</string> @@ -292,8 +294,8 @@ Clicca per riprovare."</string> <string name="label_preferences">"Preferenze"</string> <string name="account_switched">"Account cambiato. Tutte le altre pagine non sono più disponibili."</string> <string name="settings_notification_master_title">"Notifiche"</string> - <string name="settings_notification_enable_notification_title">"Abilita Notifiche"</string> - <string name="settings_notification_interval_title">"Controlla Intervallo Notifiche"</string> + <string name="settings_notification_enable_notification_title">"Abilita notifiche"</string> + <string name="settings_notification_interval_title">"Controlla intervallo notifiche"</string> <string name="settings_theme_title">"Tema"</string> <string name="settings_amoled_dark_title">"Amoled (Scuro)"</string> <string name="settings_interface_title">"Interfaccia"</string> @@ -302,9 +304,9 @@ Clicca per riprovare."</string> <string name="settings_save_front_page_scrolled_position_summary">"Sfoglia i nuovi post dopo l'aggiornamento in HOME (pagina iniziale, tipo di ordinamento: migliore)"</string> <string name="settings_open_link_in_app_title">"Apri Link nell'App"</string> <string name="settigns_video_title">"Video"</string> - <string name="settings_video_autoplay_title">"Autoriproduzione Video"</string> - <string name="settings_mute_autoplaying_videos_title">"Muta Video Autoriprodotti"</string> - <string name="settings_autoplay_nsfw_videos_title">"Autoriproduzione Video NSFW"</string> + <string name="settings_video_autoplay_title">"Autoriproduzione video"</string> + <string name="settings_mute_autoplaying_videos_title">"Muta video autoriprodotti"</string> + <string name="settings_autoplay_nsfw_videos_title">"Autoriproduzione video NSFW"</string> <string name="settings_start_autoplay_visible_area_offset_portrait_title">"Offset area visibile video a riproduzione automatica (Verticale)"</string> <string name="settings_start_autoplay_visible_area_offset_portrait_summary">"Inizia autoriproduzione video quando %1$d%% di essi è visibile"</string> <string name="settings_start_autoplay_visible_area_offset_landscape_title">"Offset area visibile video a riproduzione automatica (Orizzontale)"</string> @@ -322,6 +324,8 @@ Clicca per riprovare."</string> <string name="settings_volume_keys_navigate_posts_title">"Usa i Tasti del Volume per Navigare i Post"</string> <string name="settings_mute_video_title">"Muta i video"</string> <string name="settings_mute_nsfw_video_title">"Metti in muto i video NSFW"</string> + + <!-- Fuzzy --> <string name="settings_automatically_try_redgifs_title">"Prova Automaticamente ad Accedere a Redgifs se i Video su Gfycat Vengono Rimossi."</string> <string name="settings_video_player_ignore_nav_bar_title">"Ignora la Barra di Navigazione nel Lettore Video"</string> <string name="settings_video_player_ignore_nav_bar_summary">"Impedisci ai controlli video di avere margine aggiuntivo"</string> @@ -480,7 +484,7 @@ https://play.google.com/store/apps/details?id=ml.docilealligator.infinityforredd <string name="copy_all_raw_text">"Copia tutto il testo non formattato"</string> <string name="exit_app">"Uscire?"</string> <string name="light_theme">"Tema chiaro"</string> - <string name="dark_theme">"Tema Scuro"</string> + <string name="dark_theme">"Tema scuro"</string> <string name="multi_reddit_name_hint">"Nome (massimo 50 caratteri)"</string> <string name="multi_reddit_description_hint">"Descrizione"</string> <string name="private_multi_reddit">"Privato"</string> @@ -675,7 +679,7 @@ https://play.google.com/store/apps/details?id=ml.docilealligator.infinityforredd <string name="create_theme_info">"Se vuoi creare un tema basato su un altro tema, clicca il pulsante \"+\" su un tema."</string> <string name="edit_theme_name">"Modifica il nome del tema"</string> <string name="edit_theme">"Modifica tema"</string> - <string name="delete_theme">"Cancella Tema"</string> + <string name="delete_theme">"Cancella tema"</string> <string name="delete_theme_dialog_message">"Vuoi veramente cancellare %1$s?"</string> <string name="share_theme">"Condividi il tema"</string> <string name="change_theme_name">"Cambia Nome"</string> @@ -686,13 +690,13 @@ https://play.google.com/store/apps/details?id=ml.docilealligator.infinityforredd <string name="no_data_in_clipboard">"Non sono stato trovato dati copiati nella clipboard"</string> <!-- Fuzzy --> - <string name="import_theme_success">"Importazione del tema riuscita"</string> + <string name="import_theme_success">"Tema importato"</string> <string name="parse_theme_failed">"Analisi del tema non riuscita"</string> <string name="duplicate_theme_name_dialog_title">"È stato trovato un tema duplicato"</string> <string name="duplicate_theme_name_dialog_message">"Un tema nel database è già chiamato %1$s. Vuoi cambiare il nome del tema importato?"</string> <string name="rename">"Rinomina"</string> <string name="override">"Annullare"</string> - <string name="color_picker">"Selettore Colore"</string> + <string name="color_picker">"Selettore colore"</string> <string name="invalid_color">"Colore Non Valido"</string> <string name="delete_all_subreddits_success">"Tutti i subreddit eliminati con successo"</string> <string name="delete_all_users_success">"Tutti gli utenti eliminati con successo"</string> @@ -714,15 +718,16 @@ https://play.google.com/store/apps/details?id=ml.docilealligator.infinityforredd <string name="primary_text_preview">"Testo Principale"</string> <string name="secondary_text_preview">"Testo Secondario"</string> <string name="post_title_preview">"Questo è un post"</string> - <string name="post_content_preview">"Questa battuta sulla gravità sta diventando un po' vecchia, ma mi innamoro ogni volta."</string> + + <!-- Fuzzy --> + <string name="post_content_preview">"Ci sono 10 tipi di persone al mondo: quelli che capiscono il codice binario, e quelli che non lo capiscono."</string> <string name="post_type_preview">"POST"</string> <string name="flair_preview">"Flair"</string> <string name="awards_preview">"4 Premi"</string> <string name="author_flair_preview">"Flair dell'autore"</string> <!-- Fuzzy --> - <string name="comment_content_preview">"Ho dato una cartolina alla mia ragazza con scritto \"Rimettiti presto\". -Non è malata o altro, ma potrebbe sicuramente stare meglio."</string> + <string name="comment_content_preview">"Non mi fido molto delle statistiche, perché un uomo con la testa nel forno acceso e i piedi nel congelatore statisticamente ha una temperatura media."</string> <string name="edit_multi_reddit">"Modifica multireddit"</string> <string name="delete_multi_reddit">"Cancella Multireddit"</string> <string name="n_awards">"%1$d premi"</string> @@ -768,7 +773,7 @@ Non è malata o altro, ma potrebbe sicuramente stare meglio."</string> <string name="top_score">"%1$s pts"</string> <string name="login_activity_2fa_prompt">"Se hai attivato l'autenticazione a due fattori, per favore inserisci la password come segue: <password>:<codice per l'autenticazione a due fattori>. Esempio: latuapassword:123456"</string> - <string name="block_user">"Blocca Utente"</string> + <string name="block_user">"Blocca utente"</string> <string name="block_user_success">"Bloccato"</string> <string name="block_user_failed">"Blocco utente fallito"</string> <string name="submit_crosspost_activity_label">"Crosspost"</string> @@ -992,26 +997,28 @@ La riproduzione automatica video è disabilitata"</string> <string name="action_copy_link">"Copia Link"</string> <string name="action_add_to_post_filter">"Aggiungi al filtro dei post"</string> <string name="settings_do_not_blur_nsfw_in_nsfw_subreddits_title">"Non oscurare immagini NSFW nei Subbreddits NSFW"</string> + + <!-- Fuzzy --> <string name="settings_show_avatar_on_the_right">"Mostra l'avatar a sinistra"</string> <string name="settings_backup_settings_title">"Impostazioni Backup"</string> <string name="settings_restore_settings_title">"Reimposta le impostazioni"</string> - <string name="settings_credits_love_animation_title">"Animazione d'amore"</string> + <string name="settings_credits_love_animation_title">"Animazione amore"</string> <string name="settings_swipe_between_posts_title">"Scorri tra i post"</string> <!-- I don't know how to translate this term, being a technical term I suppose it can be left as is --> <!-- Fuzzy --> <string name="settings_navigation_drawer_title">"Drawer Navigazione"</string> - <string name="settings_collapse_account_section_title">"Comprimi Sezione Account"</string> - <string name="settings_collapse_post_section_title">"Comprimi Sezione Post"</string> - <string name="settings_collapse_preferences_section_title">"Comprimi la Sezione Preferenze"</string> + <string name="settings_collapse_account_section_title">"Comprimi sezione Account"</string> + <string name="settings_collapse_post_section_title">"Comprimi sezione Post"</string> + <string name="settings_collapse_preferences_section_title">"Comprimi la sezione Preferenze"</string> <string name="settings_collapse_favorite_subreddits_section_title">"Comprimi la sezione Subreddit preferiti"</string> <string name="settings_collapse_subscribed_subreddits_section_title">"Comprimi la sezione Subreddit sottoscritti"</string> - <string name="settings_hide_favorite_subreddits_sections_title">"Nascondi Sezione Subreddit Favoriti"</string> + <string name="settings_hide_favorite_subreddits_sections_title">"Nascondi sezione Subreddit preferiti"</string> <string name="settings_hide_subscribed_subreddits_sections_title">"Nascondi la sezione Subreddit a cui sei iscritto"</string> <string name="settings_default_search_result_tab">"Scheda predefinita dei risultati di ricerca"</string> - <string name="device_default">"Dispositivo Predefinito"</string> + <string name="device_default">"Dispositivo predefinito"</string> <string name="set_by_battery_saver">"Impostato dal risparmio batteria"</string> - <string name="theme_item_upvote_ratio_icon_tint">"Colore Icona Rapporto Voti Positivi"</string> + <string name="theme_item_upvote_ratio_icon_tint">"Colore icona rapporto voti positivi"</string> <string name="theme_item_upvote_ratio_icon_tint_detail">"Applicato a: icona rapporto voti positivi"</string> <string name="theme_item_current_user_color">"Utente corrente"</string> <string name="theme_item_current_user_color_detail">"Applicato a: Utente corrente nei commenti"</string> @@ -1026,7 +1033,7 @@ La riproduzione automatica video è disabilitata"</string> <string name="restore_settings_partially_failed">"Alcune impostazioni non sono state ripristinate correttamente. Riavvia l'app per vedere i cambiamenti."</string> <string name="restore_settings_failed_file_corrupted">"Impossibile ripristinare le impostazioni. Potrebbero essere corrotte."</string> <string name="restore_settings_failed_cannot_get_file">"Impossibile accedere al file"</string> - <string name="suicide_prevention_quote">"Se stai cercando un segno per non ucciderti, eccolo.\u2764"</string> + <string name="suicide_prevention_quote">"Se stai cercando un segnale per non ucciderti, eccolo.\u2764"</string> <string name="do_not_show_this_again">"Non mostrare di nuovo"</string> <string name="continue_suicide_prevention_activity">"Continua"</string> <string name="error_fetching_v_redd_it_video_cannot_get_redirect_url">"Errore durante il recupero del video di v.redd.it: impossibile ottenere l'url di reindirizzamento"</string> @@ -1035,6 +1042,8 @@ La riproduzione automatica video è disabilitata"</string> <string name="always_on">"Sempre acceso"</string> <string name="only_on_wifi">"Solo su Wifi"</string> <string name="never">"Mai"</string> + + <!-- Fuzzy --> <string name="normal">"Normal"</string> <string name="extra_large">"Extra Grande"</string> <string name="enormously_large">"Enormemente Grande"</string> @@ -1046,9 +1055,75 @@ La riproduzione automatica video è disabilitata"</string> <string name="select">"Seleziona"</string> <string name="exclude_subreddit">"Escludi questo subreddit"</string> <string name="exclude_user">"Escludi questo utente"</string> - <string name="exclude_flair">"Escludi questa flair"</string> + <string name="exclude_flair">"Escludi questo flair"</string> <string name="contain_flair">"Contiene questa flair"</string> <string name="exclude_domain">"Escludi dominio"</string> <string name="suggest_title">"Suggerisci titolo"</string> <string name="suggest_title_failed">"Impossibile suggerire un titolo"</string> + <string name="action_delete_logs">"Cancella i log"</string> + <string name="inbox_with_count">"Posta (%1$d)"</string> + <string name="comment_continue_thread">"Continua thread"</string> + + <!-- Fuzzy --> + <string name="settings_swipe_vertically_to_go_back_from_media_title">"Scorri verticalmente per tornare indietro dai media"</string> + <string name="settings_hide_post_flair">"Nascondi i flair dei post"</string> + <string name="settings_crash_reports_title">"Rapporti sui crash"</string> + <string name="settings_nsfw_and_spoiler_dangerous_group_title">"Pericoloso"</string> + <string name="settings_disable_nsfw_forever_title">"Disabilita permanentemente NSFW"</string> + <string name="settings_show_only_one_comment_level_indicator">"Mastra indicatori di un solo livello di commenti"</string> + <string name="save_comment">"Salva"</string> + <string name="unsave_comment">"Non salvare"</string> + <string name="copy_multi_reddit_path">"Copia il percorso del Multireddit"</string> + <string name="copy_multi_reddit_path_failed">"Impossibile copiare il percorso del Multireddit"</string> + <string name="crash_reports_deleted">"Rapporti sui crash cancellati"</string> + <string name="disable_nsfw_forever_message">"Una volta abilitata l'opzione, i contenuti NSFW saranno permanentemente disabilitati, indipendentemente dal fatto che l'impostazione NSFW sia abilitata o meno. Questa opzione è irreversibile, l'unico modo per riabilitare i contenuti NSFW è cancellare i dati dell'app. + +Vuoi comunque abilitare l'opzione?"</string> + <string name="reply">"Rispondi"</string> + <string name="rpan_activity_label">"RPAN"</string> + <string name="post_gallery_activity_label">"Galleria post"</string> + <string name="trending_activity_label">"Popolari"</string> + <string name="action_share_rpan_link">"Condividi link RPAN"</string> + <string name="action_share_post_link">"Condividi post link"</string> + <string name="rpan">"RPAN"</string> + <string name="trending">"Popolari"</string> + <string name="receive_post_reply_notifications">"Ricevi notifiche per le risposte"</string> + <string name="bottom_sheet_post_gallery">"Galleria"</string> + <string name="posting_gallery">"Galleria dei post"</string> + <string name="label_reddit">"Reddit"</string> + + <!-- Fuzzy --> + <string name="settings_default_link_post_layout">"Link Post Layout Predefinito"</string> + <string name="settings_category_material_you_title">"Personalizzazione automatica"</string> + <string name="settings_enable_material_you_warning_summary">"Per il corretto funzionamento assicurarsi che i tuoi temi non siano chiamati: +\"Materiale you\" +\"Materiale you Dark\" +\"Materiale you Amoled\" +Se hai dei temi con questi nomi devi cambiarli prima di attivare la Personalizzazione automatica"</string> + <string name="settings_enable_material_you_title">"Attiva personalizzazione automatica"</string> + <string name="settings_enable_material_you_summary">"Personalizza Infinity in base al tuo sfondo"</string> + <string name="settings_apply_material_you_title">"Applica personalizzazione"</string> + <string name="settings_apply_material_you_summary">"Nel caso Infinity non abbia cambiato il tema"</string> + <string name="settings_more_tabs_show_favorite_multireddits_title">"Mostra Multireddit preferiti"</string> + <string name="settings_more_tabs_show_multireddits_title">"Mostra Multireddit"</string> + <string name="settings_collapse_reddit_section_title">"Riduci sezione Reddit"</string> + <string name="settings_video_player_automatic_landscape_orientation">"Passa automaticamente all'orientamento orizzontale nel Player Video"</string> + <string name="settings_remember_muting_option_in_post_feed">"Ricorda l'opzione di disattivazione dell'audio nel feed dei post"</string> + <string name="link_post_layout_auto">"Auto"</string> + <string name="uploaded_images">"Immagini caricate"</string> + <string name="select_image">"Seleziona un'immagine"</string> + <string name="capture">"Cattura"</string> + <string name="uploading_image">"Caricamento"</string> + <string name="upload_image_success">"Immagine caricata. Clicca sul pulsante delle immagini per vedere le altre immagini caricate"</string> + <string name="get_image_bitmap_failed">"Impossibile prendere il bitmap dell'immagine"</string> + <string name="upload_image_failed">"Impossibile caricare l'immagine"</string> + <string name="load_rpan_broadcasts_failed">"Impossibile caricare RPAN"</string> + <string name="parse_rpan_broadcasts_failed">"Impossibile analizzare i broadcast RPAN"</string> + <string name="parse_rpan_broadcast_failed">"Impossibile analizzare il broadcast RPAN"</string> + <string name="search_comments">"Cerca tra i commenti"</string> + <string name="please_wait_image_is_uploading">"Attendere prego. Immagine in caricamento"</string> + <string name="error_fetch_trending_search">"Pagina non caricata. Tocca per riprovare"</string> + <string name="error_parse_trending_search">"Pagina non caricata. Tocca per riprovare"</string> + <string name="no_trending_search">"Nessuna ricerca di tendenza trovata. +Premi per riprovare."</string> </resources>
\ No newline at end of file diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml index a7da9071..e8fcac65 100644 --- a/app/src/main/res/values-ja/strings.xml +++ b/app/src/main/res/values-ja/strings.xml @@ -252,6 +252,8 @@ <string name="search">"検索"</string> <string name="posting_video">"動画を投稿中"</string> <string name="posting_image">"画像を投稿中"</string> + + <!-- Fuzzy --> <string name="please_wait">"少々お待ちください。"</string> <string name="add_account">"アカウントを追加"</string> <string name="anonymous_account">"匿名"</string> @@ -352,6 +354,8 @@ <string name="settings_volume_keys_navigate_posts_title">"音量ボタンで投稿をナビゲート"</string> <string name="settings_mute_video_title">"動画をミュート再生"</string> <string name="settings_mute_nsfw_video_title">"NSFWの動画をミュート再生"</string> + + <!-- Fuzzy --> <string name="settings_automatically_try_redgifs_title">"Gfycatの動画が削除されていた場合、自動的にRedgifsでリトライ"</string> <string name="settings_video_player_ignore_nav_bar_title">"動画プレーヤーでナビゲーションバーを無視"</string> <string name="settings_video_player_ignore_nav_bar_summary">"動画コントローラーが余分な余白を使用することを防止します"</string> diff --git a/app/src/main/res/values-nl/strings.xml b/app/src/main/res/values-nl/strings.xml index 0f3857fd..9216310c 100644 --- a/app/src/main/res/values-nl/strings.xml +++ b/app/src/main/res/values-nl/strings.xml @@ -232,6 +232,8 @@ Tik om opnieuw te proberen."</string> <string name="search">"Zoeken"</string> <string name="posting_video">"Video is aan het posten"</string> <string name="posting_image">"Afbeelding is aan het posten"</string> + + <!-- Fuzzy --> <string name="please_wait">"Even geduld aub."</string> <string name="add_account">"Account toevoegen"</string> <string name="anonymous_account">"Anoniem"</string> @@ -292,7 +294,7 @@ Tik om opnieuw te proberen."</string> <string name="settings_amoled_dark_title">"Amoled Donker"</string> <string name="settings_interface_title">"Interface"</string> <string name="settings_gestures_and_buttons_title">"Gebaren & Knoppen"</string> - <string name="settings_save_front_page_scrolled_position_title">"Bewaar de schuifpositie in HOME"</string> + <string name="settings_save_front_page_scrolled_position_title">"Bewaar de scrollpositie in HOME"</string> <string name="settings_save_front_page_scrolled_position_summary">"Blader door nieuwe posts na het vernieuwen in HOME (voorpagina, sorteertype: Beste)"</string> <string name="settings_open_link_in_app_title">"Open Link In App"</string> <string name="settigns_video_title">"Video"</string> @@ -316,6 +318,8 @@ Tik om opnieuw te proberen."</string> <string name="settings_volume_keys_navigate_posts_title">"Gebruik Volumetoetsen om door Posts te Navigeren"</string> <string name="settings_mute_video_title">"Video's Dempen"</string> <string name="settings_mute_nsfw_video_title">"NSFW Video's Dempen"</string> + + <!-- Fuzzy --> <string name="settings_automatically_try_redgifs_title">"Probeer Automatisch Redgifs te Openen als Video's op Gfycat zijn Verwijderd."</string> <string name="settings_video_player_ignore_nav_bar_title">"Negeer de Navigatiebalk in de Videospeler"</string> <string name="settings_video_player_ignore_nav_bar_summary">"Voorkom dat de Videocontroller een Extra Marge Heeft"</string> @@ -876,4 +880,14 @@ Bericht: %2$s"</string> <string name="theme_item_no_preview_post_type_background_color">"Geen Voorbeeld Posttype Achtergrondkleur"</string> <string name="theme_item_no_preview_post_type_background_color_detail">"Toegepast op: tijdelijke aanduiding die het type post aangeeft wanneer er geen voorbeeld beschikbaar is"</string> <string name="settings_language_title">"Taal"</string> + <string name="customize_post_filter_activity_label">"Berichtenfilter aanpassen"</string> + <string name="filtered_posts_activity_subtitle">"Gefilterde Posts"</string> + <string name="search_users_result_activity_label">"Gebruikers"</string> + <string name="multireddit_selection_activity_label">"Selecteer een Multireddit"</string> + <string name="action_save_to_database">"Opslaan naar Database"</string> + <string name="action_read_all_messages">"Lees Alle Berichten"</string> + <string name="settings_mark_posts_as_read_on_scroll_title">"Markeer berichten als gelezen bij scroll"</string> + <string name="settings_sort_type_title">"Sorteertype"</string> + <string name="post_filter_usage_multireddit">"Multireddit: %1$s"</string> + <string name="post_filter_usage_multireddit_all">"Multireddit"</string> </resources>
\ No newline at end of file diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml index e4b9ec39..48a4645a 100644 --- a/app/src/main/res/values-pl/strings.xml +++ b/app/src/main/res/values-pl/strings.xml @@ -225,6 +225,8 @@ <string name="search">"Szukaj"</string> <string name="posting_video">"Tworzenie postu z wideo"</string> <string name="posting_image">"Tworzenie postu z obrazem"</string> + + <!-- Fuzzy --> <string name="please_wait">"Proszę czekać"</string> <string name="add_account">"Dodaj konto"</string> <string name="anonymous_account">"Anonim"</string> @@ -309,6 +311,8 @@ <string name="settings_volume_keys_navigate_posts_title">"Używaj przycisków głośności, aby nawigować posty"</string> <string name="settings_mute_video_title">"Wycisz filmy"</string> <string name="settings_mute_nsfw_video_title">"Wycisz wideo NSFW"</string> + + <!-- Fuzzy --> <string name="settings_automatically_try_redgifs_title">"Automatycznie próbuj uzyskać filmy z Redgifs, gdy są usunięte z Gfycat"</string> <string name="settings_video_player_ignore_nav_bar_title">"Ignoruj pasek nawigacji w odtwarzaczu wideo"</string> <string name="settings_video_player_ignore_nav_bar_summary">"Zapobiegaj posiadaniu dodatkowego marginesu przez kontroler wideo"</string> @@ -907,15 +911,21 @@ Wiadomość: %2$s"</string> <string name="settings_user_default_sort_time_title">"Domyślny typ sortowania czasu użytkowników"</string> <string name="open_link">"Otwórz link"</string> <string name="select_subreddits_and_users">"Wybierz subreddity i użytkowników"</string> + <string name="theme_item_read_post_title_color">"Kolor tytułu przeczytanego postu"</string> + <string name="theme_item_read_post_title_color_detail">"Używane do: tytuł przeczytanego postu"</string> + <string name="theme_item_read_post_content_color">"Kolor treści przeczytanego postu"</string> + <string name="theme_item_read_post_content_color_detail">"Używane do: treść przeczytanego postu"</string> <string name="hide_read_posts">"Ukryj przeczytane posty"</string> <string name="filter_posts">"Filtruj posty"</string> <string name="only_nsfw">"Tylko NSFW"</string> <string name="only_spoiler">"Tylko spoilery"</string> + <string name="title_excludes_regex_hint">"Tytuł: wyklucza regex"</string> <string name="exclude_subreddits_hint">"Bez subredditów (np. funny,AskReddit)"</string> <string name="exclude_users_hint">"Bez użytkowników"</string> <string name="post_filter_requires_a_name">"Jaka jest nazwa filtru tego posta?"</string> <string name="duplicate_post_filter_dialog_title">"'%1$s' już istnieje"</string> <string name="duplicate_post_filter_dialog_message">"Nadpisać?"</string> + <string name="apply_post_filter_to">"Zastosuj do"</string> <string name="post_filter_usage_home">"Strona główna"</string> <string name="post_filter_usage_subreddit_all">"Subreddit"</string> <string name="post_filter_usage_user">"Użytkownik: %1$s"</string> @@ -927,6 +937,7 @@ Wiadomość: %2$s"</string> <string name="user">"Użytkownik"</string> <string name="edit_post_filter_name_of_usage_info">"Zostaw puste aby zastosować ten filtr postów dla każdego subbredita / użytkownika / multireddita"</string> + <string name="read_all_messages_time_limit">"Zbyt często to robisz. Spróbuj później. To limit przesyłu API Reddita."</string> <string name="read_all_messages_success">"Odczytano wszystkie wiadomości pomyślnie"</string> <string name="read_all_messages_failed">"Nie można odczytać wiadomości"</string> <string name="add_subreddit_or_user_to_multireddit_success">"%1$s został dodany multireddita %2$s"</string> @@ -943,7 +954,10 @@ użytkownika / multireddita"</string> <string name="vote">"Zagłosuj"</string> <string name="action_share_link">"Zapisz link"</string> <string name="action_copy_link">"Skopiuj link"</string> + <string name="action_add_to_post_filter">"Dodaj do filtra postów"</string> <string name="settings_do_not_blur_nsfw_in_nsfw_subreddits_title">"Nie bluruj obrazków NSFW w NSFW subredditach"</string> + + <!-- Fuzzy --> <string name="settings_show_avatar_on_the_right">"Pokazuj awatary z lewej strony"</string> <string name="settings_backup_settings_title">"Opcje backupu"</string> <string name="settings_restore_settings_title">"Przywróć ustawienia"</string> @@ -980,4 +994,10 @@ użytkownika / multireddita"</string> Nadal chcesz ją włączyć?"</string> <string name="reply">"Odpowiedz"</string> + <string name="uploaded_images">"Przesłane obrazy"</string> + <string name="select_image">"Wybierz obraz"</string> + <string name="uploading_image">"Przesyłanie"</string> + <string name="upload_image_failed">"Błąd przesyłania obrazu"</string> + <string name="search_comments">"Szukaj w komentarzach"</string> + <string name="please_wait_image_is_uploading">"Obraz jest wciąż przesyłany. Proszę czekać."</string> </resources>
\ No newline at end of file diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml index 5bdd7a6e..5c3a26ac 100644 --- a/app/src/main/res/values-pt-rBR/strings.xml +++ b/app/src/main/res/values-pt-rBR/strings.xml @@ -98,8 +98,10 @@ Toque para tentar novamente."</string> <string name="no_messages">"Vazio"</string> <string name="nsfw">"NSFW"</string> <string name="karma_info">"Karma: %1$d"</string> - <string name="karma_info_user_detail">"Karma: %1$d (%2$d + %3$d)"</string> - <string name="cakeday_info">"Dia do bolo: %1$s"</string> + <string name="karma_info_user_detail">"Karma: +%1$d (%2$d + %3$d)"</string> + <string name="cakeday_info">"Dia do bolo: +%1$s"</string> <string name="since">"Desde:"</string> <string name="profile">"Perfil"</string> @@ -193,7 +195,7 @@ Toque para tentar novamente."</string> <string name="no_flair">"Nenhuma etiqueta"</string> <string name="error_loading_flairs">"Falha ao carregar etiquetas. Toque para tentar novamente."</string> - <string name="no_rule">"Nenhuma regra."</string> + <string name="no_rule">"Nenhuma regra"</string> <string name="error_loading_rules">"Falha ao carregar regras. Toque para tentar novamente."</string> <string name="error_loading_rules_without_retry">"Falha ao Carregar Regras"</string> @@ -235,6 +237,8 @@ Toque para tentar novamente."</string> <string name="search">"Buscar"</string> <string name="posting_video">"Postando Vídeo"</string> <string name="posting_image">"Postando Imagem"</string> + + <!-- Fuzzy --> <string name="please_wait">"Por favor aguarde."</string> <string name="add_account">"Adicionar conta"</string> <string name="anonymous_account">"Anônimo"</string> @@ -245,7 +249,7 @@ Toque para tentar novamente."</string> <string name="post_saved_failed">"Não foi possível salvar o post"</string> <string name="post_unsaved_success">"Removido dos posts salvos"</string> <string name="post_unsaved_failed">"Não foi possível remover dos posts salvos"</string> - <string name="post_hide_success">"Post oculto"</string> + <string name="post_hide_success">"Post ocultado"</string> <string name="post_hide_failed">"Não foi possível ocultar o post"</string> <string name="post_unhide_success">"Post visível"</string> <string name="thing_favorite_failed">"Falha ao adicionar aos favoritos"</string> @@ -287,12 +291,12 @@ Toque para tentar novamente."</string> <string name="label_account">"Conta"</string> <string name="label_post">"Post"</string> <string name="label_preferences">"Preferências"</string> - <string name="account_switched">"Conta alterada, por isso todas as páginas sumiram."</string> + <string name="account_switched">"Conta alterada. Por isso todas as páginas sumiram."</string> <string name="settings_notification_master_title">"Notificação"</string> <string name="settings_notification_enable_notification_title">"Ativar Notificações"</string> <string name="settings_notification_interval_title">"Intervalo de Verificação de Notificações"</string> <string name="settings_theme_title">"Tema"</string> - <string name="settings_amoled_dark_title">"Tema Escuro (Amoled)"</string> + <string name="settings_amoled_dark_title">"Tema Amoled"</string> <string name="settings_interface_title">"Interface"</string> <string name="settings_gestures_and_buttons_title">"Gestos e Botões"</string> <string name="settings_save_front_page_scrolled_position_title">"Posição de rolagem salva na tela inicial"</string> @@ -319,6 +323,8 @@ Toque para tentar novamente."</string> <string name="settings_volume_keys_navigate_posts_title">"Usar as Teclas de Volume para Navegar Entre Posts"</string> <string name="settings_mute_video_title">"Silenciar Vídeos"</string> <string name="settings_mute_nsfw_video_title">"Silenciar Vídeos NSFW"</string> + + <!-- Fuzzy --> <string name="settings_automatically_try_redgifs_title">"Tentar Acessar Automaticamente o Redgifs se os Vídeos do Gfycat Forem Removidos."</string> <string name="settings_video_player_ignore_nav_bar_title">"Ignorar Barra de Navegação no Reprodutor de Vídeos"</string> <string name="settings_video_player_ignore_nav_bar_summary">"Evitar que o Controle de Vídeo Tenha Margens Largas"</string> @@ -326,7 +332,7 @@ Toque para tentar novamente."</string> <string name="settings_category_comment_title">"Comentar"</string> <string name="settings_show_top_level_comments_first_title">"Exibir Comentários Mais Votados Primeiro"</string> <string name="settings_show_comment_divider_title">"Exibir Divisão de Comentários"</string> - <string name="settings_comment_toolbar_hide_on_click">"Clicar para Exibir/Ocultar Barra de Comentários"</string> + <string name="settings_comment_toolbar_hide_on_click">"Clicar para Exibir/Ocultar a Barra de Comentários"</string> <string name="settings_fully_collapse_comment_title">"Retrair Completamente os Comentários"</string> <string name="settings_comment_toolbar_hidden">"Barra de Comentários Oculta por Padrão"</string> <string name="settings_show_absolute_number_of_votes_title">"Exibir Número Absoluto de Votos"</string> @@ -345,7 +351,7 @@ Toque para tentar novamente."</string> <string name="settings_swipe_to_go_back_summary">"Não se Aplica a Todas as Páginas"</string> <string name="settings_lock_jump_to_next_top_level_comment_button_title">"Bloquear Botão de Avanço para Próximo Comentário Mais Votado"</string> <string name="settings_lock_bottom_app_bar_title">"Bloquear Barra de Navegação Inferior"</string> - <string name="settings_swipe_up_to_hide_jump_to_next_top_level_comment_button_title">"Deslizar para Cima para Ocultar Botão de Avanço para Próximo Comentário Mais Votado"</string> + <string name="settings_swipe_up_to_hide_jump_to_next_top_level_comment_button_title">"Deslizar para Cima para Ocultar o Botão de Avanço para Próximo Comentário Mais Votado"</string> <string name="settings_lazy_mode_interval_title">"Intervalo do Modo Preguiçoso"</string> <string name="settings_font_title">"Fonte"</string> <string name="settings_preview_font_title">"Pré-visualizar Fonte"</string> @@ -412,9 +418,9 @@ Toque para tentar novamente."</string> <string name="settings_tab_3_summary">"Aba 3"</string> <string name="settings_tab_title">"Título"</string> <string name="settings_tab_post_type">"Tipo"</string> - <string name="settings_tab_subreddit_name">"Nome do Subreddit (Sem o Prefixo \"r/\")"</string> + <string name="settings_tab_subreddit_name">"Nome do Subreddit (Sem o Prefixo ''r/'')"</string> <string name="settings_tab_multi_reddit_name">"Nome do Multireddit (/usuário/nomedoseuusuário/m/nomedoseumultireddit)"</string> - <string name="settings_tab_username">"Usuário (Sem o Prefixo \"u/\")"</string> + <string name="settings_tab_username">"Usuário (Sem o Prefixo ''u/'')"</string> <string name="no_developer_easter_egg">"Não existem opções de desenvolvedor aqui"</string> <string name="no_link_available">"Link não disponível"</string> <string name="exit_when_submit">"Sair?"</string> @@ -545,7 +551,7 @@ https://play.google.com/store/apps/details?id=ml.docilealligator.infinityforredd <string name="theme_item_bottom_app_bar_background_color">"Cor da Barra de Navegação Inferior"</string> <string name="theme_item_bottom_app_bar_background_color_detail">"Aplicado a: Barra de navegação inferior"</string> <string name="theme_item_primary_icon_color">"Cor do Ícone Primário"</string> - <string name="theme_item_primary_icon_color_detail">"Aplicado a: Ícones no menu de navegação"</string> + <string name="theme_item_primary_icon_color_detail">"Aplicado a: Ícones no menu de navegação."</string> <string name="theme_item_bottom_app_bar_icon_color">"Cor do Ícone da Barra de Navegação Inferior"</string> <string name="theme_item_bottom_app_bar_icon_color_detail">"Aplicado a: Ícones na barra de navegação inferior"</string> <string name="theme_item_post_icon_and_info_color">"Cor do Ícone de Post e Informações"</string> @@ -670,7 +676,7 @@ Baseado no tema Índigo"</string> Baseado no tema Índigo Escuro"</string> <string name="create_amoled_theme">"Criar um Tema Amoled Baseado no tema Índigo Amoled"</string> - <string name="create_theme_info">"Se você deseja criar um tema baseado em outro tema, clique no botão \"+\" localizado no tema"</string> + <string name="create_theme_info">"Se você deseja criar um tema baseado em outro tema, clique no botão \"+\" localizado no tema."</string> <string name="edit_theme_name">"Editar nome do tema"</string> <string name="edit_theme">"Editar tema"</string> <string name="delete_theme">"Excluir tema"</string> @@ -702,12 +708,13 @@ Baseado no tema Índigo Amoled"</string> <string name="primary_text_preview">"Texto primário"</string> <string name="secondary_text_preview">"Texto secundário"</string> <string name="post_title_preview">"Este é um post"</string> - <string name="post_content_preview">"Prévia de conteúdo a ser publicado"</string> + <string name="post_content_preview">"Essa piada da gravidade está ficando velha, mas eu sempre caio nessa."</string> <string name="post_type_preview">"POST"</string> <string name="flair_preview">"Etiqueta"</string> <string name="awards_preview">"4 Prêmios"</string> <string name="author_flair_preview">"Etiqueta de autor"</string> - <string name="comment_content_preview">"Prévia do comentário"</string> + <string name="comment_content_preview">"Eu dei para minha namorada um cartão “Melhore logo”. +Ela não está doente nem nada, mas definitivamente poderia melhorar."</string> <string name="edit_multi_reddit">"Editar multireddit"</string> <string name="delete_multi_reddit">"Excluir Multireddit"</string> <string name="n_awards">"%1$d Prêmios"</string> @@ -751,7 +758,7 @@ Baseado no tema Índigo Amoled"</string> <string name="default_font_font_preview">"Padrão"</string> <string name="load_video_in_redgifs">"Tente carregar o vídeo no Redgifs"</string> <string name="top_score">"%1$s pontos"</string> - <string name="login_activity_2fa_prompt">"Se você tem a Autenticação em 2 Etapas ativada, digite a senha da seguinte forma: <senha>:<códigodeautenticação>. + <string name="login_activity_2fa_prompt">"Se você tem a Autenticação em 2 Etapas ativada, digite a senha da seguinte forma: <senha>:<código de autenticação>. Exemplo: suasenha:123456"</string> <string name="block_user">"Bloquear usuário"</string> <string name="block_user_success">"Bloqueado"</string> @@ -775,8 +782,8 @@ Exemplo: suasenha:123456"</string> <string name="settings_more_tabs_summary">"Mais abas"</string> <string name="settings_more_tabs_info_summary">"Ativar as seguintes opções causará um comportamento indesejado: As abas podem perder todo o conteúdo após alternar para outras. Isso é o mesmo que atualizar a página."</string> - <string name="settings_more_tabs_show_favorite_subscribed_subreddits_title">"Mostrar subreddits favoritos que estou inscrito"</string> - <string name="settings_more_tabs_show_subscribed_subreddits_title">"Mostrar subreddits que estou inscrito"</string> + <string name="settings_more_tabs_show_favorite_subscribed_subreddits_title">"Mostrar Subreddits Favoritos Que Estou Inscrito"</string> + <string name="settings_more_tabs_show_subscribed_subreddits_title">"Mostrar Subreddits Que Estou Inscrito"</string> <string name="settings_download_location_title">"Local de download"</string> <string name="settings_image_download_location_title">"Local de download de imagem"</string> <string name="settings_gif_download_location_title">"Local de download de gif"</string> @@ -791,10 +798,10 @@ As abas podem perder todo o conteúdo após alternar para outras. Isso é o mesm <string name="settings_require_authentication_to_go_to_account_section_in_navigation_drawer_title">"Requer autenticação para ir a sessão de conta no menu de navegação"</string> <!-- Fuzzy --> - <string name="settings_long_press_to_hide_toolbar_in_compact_layout_title">"Aperte e segure para esconder a barra de ferramentas no modo compacto"</string> + <string name="settings_long_press_to_hide_toolbar_in_compact_layout_title">"Aperte e Segure Para Esconder a Barra de Ferramentas no Modo Compacto"</string> <!-- Fuzzy --> - <string name="settings_post_compact_layout_toolbar_hidden_by_default_title">"Barra de ferramentas no modo compacto oculta por padrão"</string> + <string name="settings_post_compact_layout_toolbar_hidden_by_default_title">"Barra de Ferramentas Oculta por Padrão no Modo Compacto"</string> <string name="settings_customize_bottom_app_bar_title">"Personalizar barra de navegação inferior"</string> <string name="settings_main_activity_bottom_app_bar_group_summary">"Página inicial"</string> <string name="settings_other_activities_bottom_app_bar_group_summary">"Outras páginas"</string> @@ -807,7 +814,8 @@ As abas podem perder todo o conteúdo após alternar para outras. Isso é o mesm <string name="settings_data_saving_mode">"Modo economia de dados"</string> <string name="settings_data_saving_mode_info_summary">"No modo de economia de dados: A pré-visualização de imagens fica em menor resolução. -Os vídeos do Reddit ficam em menor resolução."</string> +Os vídeos do Reddit ficam em menor resolução. + A reprodução automática de vídeos fica desativada."</string> <string name="settings_translation_title">"Tradução"</string> <string name="settings_translation_summary">"Traduza o app em POEditor. Obrigado a todos os contribuíntes."</string> <string name="settings_credits_national_flags">"Bandeiras nacionais"</string> @@ -843,7 +851,7 @@ Mensagem: %2$s"</string> <string name="give_award_failed">"Falhou"</string> <string name="warning">"Aviso"</string> <string name="this_is_a_nsfw_subreddit">"Este é um subreddit NSFW."</string> - <string name="this_user_has_nsfw_content">"Este usuário tem conteúdo NSFW."</string> + <string name="this_user_has_nsfw_content">"Este usuário tem conteúdo NSFW"</string> <string name="dismiss">"Dispensar"</string> <string name="leave">"Sair"</string> @@ -864,12 +872,12 @@ Mensagem: %2$s"</string> <string name="settings_miscellaneous_title">"Miscelânea"</string> <string name="settings_respect_subreddit_recommended_comment_sort_type_title">"Respeitar modo de classificação de comentário recomendado pelo subreddit"</string> <string name="settings_respect_subreddit_recommended_comment_sort_type_summary">"Modo de classificação de comentário não será salvo"</string> - <string name="settings_subreddit_filter_category">"Ocultar subreddits"</string> + <string name="settings_subreddit_filter_category">"Ocultar Subreddits"</string> <string name="settings_subreddit_filter_popular_and_all">"Em r/popular e r/all"</string> <string name="settings_credits_ufo_capturing_animation_title">"Animação de captura de OVNIs"</string> <string name="select_video_quality">"Selecionar qualidade do vídeo"</string> <string name="settings_swipe_action_haptic_feedback_title">"Resposta tátil"</string> - <string name="settings_hide_subreddit_description_title">"Ocultar descrição do subreddit"</string> + <string name="settings_hide_subreddit_description_title">"Ocultar Descrição do Subreddit"</string> <string name="settings_disable_image_preview_title">"Desativar pré-visualização de imagem no modo de economia de dados"</string> <string name="settings_swipe_action_swipe_left_title">"Deslizar para a esquerda"</string> <string name="settings_swipe_action_swipe_right_title">"Deslizar para a direita"</string> @@ -901,7 +909,7 @@ Mensagem: %2$s"</string> <string name="settings_mark_posts_as_read_title">"Marque Posts como Lido"</string> <string name="settings_mark_posts_as_read_after_voting_title">"Marque Posts como Lido depois de votar"</string> <string name="settings_mark_posts_as_read_on_scroll_title">"Marcar post como lido ao rolar página"</string> - <string name="settings_hide_read_posts_automatically_title">"Esconder posts lidos automaticamente"</string> + <string name="settings_hide_read_posts_automatically_title">"Ocultar Posts Lidos Automaticamente"</string> <string name="settings_sort_type_title">"Tipo de Classificação"</string> <string name="settings_save_sort_type_title">"Lembrar Classificação"</string> <string name="settings_subreddit_default_sort_type_title">"Classificação Padrão em Subreddits"</string> @@ -911,13 +919,13 @@ Mensagem: %2$s"</string> <string name="open_link">"Abrir Link"</string> <string name="select_subreddits_and_users">"Selecionar subreddits e usuários"</string> <string name="theme_item_read_post_title_color">"Cor do Título de Post Lido"</string> - <string name="theme_item_read_post_title_color_detail">"Título de Post Lido"</string> + <string name="theme_item_read_post_title_color_detail">"Aplicado a: Título de Post Lido"</string> <string name="theme_item_read_post_content_color">"Cor do Conteúdo de Post Lido"</string> - <string name="theme_item_read_post_content_color_detail">"Conteúdo de Post Lido"</string> + <string name="theme_item_read_post_content_color_detail">"Aplicado a: Conteúdo de Post Lido"</string> <string name="theme_item_read_post_card_view_background_color">"Cor de Fundo da Visualização de Posts em Cartão"</string> <string name="theme_item_read_post_card_view_background_color_detail">"Aplicado a: Fundo de Post Lido"</string> <string name="delete_all_read_posts_success">"Sucesso ao deletar todos os posts já lidos"</string> - <string name="hide_read_posts">"Esconder Posts Lidos"</string> + <string name="hide_read_posts">"Ocultar Posts Lidos"</string> <string name="filter_posts">"Filtrar Posts"</string> <string name="only_nsfw">"Apenas NSFW"</string> <string name="only_spoiler">"Apenas Spoiler"</string> @@ -955,10 +963,97 @@ Mensagem: %2$s"</string> <string name="add_subreddit_or_user_to_multireddit_success">"%1$s está adicionado a multireddit %2$s"</string> <string name="add_subreddit_or_user_to_multireddit_failed">"Não foi possível adicionar %1$s para o multireddit %2$s"</string> <string name="choose_a_user">"Escolha um usuário"</string> + <string name="settings_click_to_show_media_in_gallery_layout">"Clicar para Exibir Mídia no Modo Galeria"</string> + <string name="settings_hide_post_type">"Ocultar Tipo de Post"</string> + <string name="settings_hide_the_number_of_awards">"Ocultar o Número de Prêmios"</string> + <string name="settings_hide_subreddit_and_user_prefix">"Ocultar Prefixos do Subreddit e do Usuário"</string> + + <!-- Fuzzy --> + <string name="settings_hide_the_number_of_votes">"Ocultar o Número de Votos"</string> + <string name="settings_hide_the_number_of_comments">"Ocultar o Número de Comentários"</string> + <string name="post_layout_gallery">"Modo Galeria"</string> + <string name="post_layout_card_2">"Modo Cartão 2"</string> + <string name="have_trouble_login_title">"Tendo Problemas para Logar"</string> + <string name="have_trouble_login_message">"Você quer tentar outra forma de logar?"</string> + <string name="vote">"Votar"</string> <string name="action_share_link">"Compartilhar Link"</string> <string name="action_copy_link">"Copiar Link"</string> + <string name="action_add_to_post_filter">"Adicionar ao Filtro de Publicação"</string> + <string name="settings_do_not_blur_nsfw_in_nsfw_subreddits_title">"Não borrar imagens NSFW em Subreddits NSFW"</string> + + <!-- Fuzzy --> + <string name="settings_show_avatar_on_the_right">"Mostrar Avatar na Esquerda"</string> + <string name="settings_backup_settings_title">"Configurações de Backup"</string> + <string name="settings_restore_settings_title">"Restaurar Configurações"</string> + <string name="settings_credits_love_animation_title">"Animações de Amor"</string> + <string name="settings_swipe_between_posts_title">"Deslizar Entre Posts"</string> + <string name="settings_navigation_drawer_title">"Menu de Navegação"</string> + <string name="settings_collapse_account_section_title">"Fechar Seção de Conta"</string> + <string name="settings_collapse_post_section_title">"Retrair Seção de Post"</string> + <string name="settings_collapse_preferences_section_title">"Retrair Seção de Preferências"</string> + <string name="settings_collapse_favorite_subreddits_section_title">"Retrair Seção de Subreddits Favoritos"</string> + <string name="settings_collapse_subscribed_subreddits_section_title">"Retrair Seção de Subreddits Que Estou Inscrito"</string> + <string name="settings_hide_favorite_subreddits_sections_title">"Ocultar Seção de Subreddits Favoritos"</string> + <string name="settings_hide_subscribed_subreddits_sections_title">"Ocultar Seção de Subreddits Que Estou Inscrito"</string> + <string name="settings_default_search_result_tab">"Guia Padrão dos Resultados da Pesquisa"</string> <string name="device_default">"Dispositivo Padrão"</string> + <string name="set_by_battery_saver">"Definido Pela Economia de Bateria"</string> + <string name="theme_item_upvote_ratio_icon_tint">"Cor do Ícone de Razão de Upvote"</string> + <string name="theme_item_upvote_ratio_icon_tint_detail">"Aplicado a: Ícone de Razão de Upvote"</string> + <string name="theme_item_current_user_color">"Usuário Atual"</string> + <string name="theme_item_current_user_color_detail">"Aplicado a: Usuário atual nos comentários"</string> + <string name="exclude_domains_hint">"Excluir domínios"</string> + <string name="anonymous_front_page_no_subscriptions">"Começe se juntando em um subreddit!"</string> + <string name="backup_settings_success">"Configurações exportadas com sucesso para o diretório de destino. A senha do arquivo zip gerado é 123321. Por favor não altere este arquivo zip."</string> + <string name="create_zip_in_destination_directory_failed">"Não foi possível criar o backup zip no diretório de destino"</string> + <string name="backup_some_settings_failed">"Não foi possível realizar o backup de algumas configurações, mas outras foram exportadas com sucesso para o diretório de destino"</string> + <string name="restore_settings_success">"Configurações restauradas com sucesso. Reinicie o app para aplicar as mudanças."</string> + <string name="restore_settings_partially_failed">"Algumas configurações não foram restauradas. Reinicie o app para aplicar as mudanças."</string> + <string name="restore_settings_failed_file_corrupted">"Não foi possível restaurar as configurações. O arquivo pode estar corrompido."</string> + <string name="restore_settings_failed_cannot_get_file">"Não foi possível acessar o arquivo"</string> + <string name="suicide_prevention_quote">"Se você está procurando um sinal para não se matar é isto. \u2764"</string> + <string name="do_not_show_this_again">"Não exibir novamente"</string> + <string name="continue_suicide_prevention_activity">"Continuar"</string> + <string name="error_fetching_v_redd_it_video_cannot_get_redirect_url">"Erro ao buscar vídeo v.redd.it: Não foi possível obter o url de redirecionamento"</string> + <string name="error_fetching_v_redd_it_video_cannot_get_post">"Erro ao buscar vídeo em v.redd.it: Não foi possível obter a postagem"</string> + <string name="error_fetching_v_redd_it_video_cannot_get_post_id">"Erro ao buscar vídeo em v.redd.it: Não foi possível obter o id da postagem"</string> + <string name="always_on">"Sempre Ativo"</string> + <string name="only_on_wifi">"Somente no Wifi"</string> <string name="never">"Nunca"</string> <string name="normal">"Normal"</string> + <string name="extra_large">"Muito Grande"</string> + <string name="enormously_large">"Extremamente Grande"</string> <string name="default_in_array">"Padrão"</string> + <string name="off">"Desligado"</string> + <string name="only_on_cellular_data">"Somente nos Dados Móveis"</string> + <string name="upvote">"Upvote"</string> + <string name="downvote">"Downvote"</string> + <string name="select">"Selecionar"</string> + <string name="exclude_subreddit">"Excluir este subreddit"</string> + <string name="exclude_user">"Excluir este usuário"</string> + <string name="exclude_flair">"Excluir esta etiqueta"</string> + <string name="contain_flair">"Conter esta estiqueta"</string> + <string name="exclude_domain">"Excluir Domínio"</string> + <string name="suggest_title">"Sugerir Título"</string> + <string name="suggest_title_failed">"Falha ao sugerir título"</string> + <string name="action_delete_logs">"Apagar Registros"</string> + <string name="inbox_with_count">"Inbox (%1$d)"</string> + <string name="comment_continue_thread">"Continuar thread"</string> + + <!-- Fuzzy --> + <string name="settings_swipe_vertically_to_go_back_from_media_title">"Deslize Verticalmente Para Voltar da Mídia"</string> + <string name="settings_hide_post_flair">"Ocultar Etiqueta do Post"</string> + <string name="settings_crash_reports_title">"Relatório de Erros"</string> + <string name="settings_nsfw_and_spoiler_dangerous_group_title">"Cuidado"</string> + <string name="settings_disable_nsfw_forever_title">"Desativar NSFW Permanentemente"</string> + <string name="settings_show_only_one_comment_level_indicator">"Exibir Somente Um Nível de Comentário"</string> + <string name="save_comment">"Salvar"</string> + <string name="unsave_comment">"Não salvar"</string> + <string name="copy_multi_reddit_path">"Copiar Caminho do Multireddit"</string> + <string name="copy_multi_reddit_path_failed">"Não foi possível copiar o caminho do multireddit"</string> + <string name="crash_reports_deleted">"Relatório de erros apagado"</string> + <string name="disable_nsfw_forever_message">"Uma vez ativado, o NSFW será desativado permanentemente, independentemente da configuração do NSFW estar ativada ou não. E essa opção é irreversível, a única maneira de reativar o NSFW é limpar os dados do aplicativo. + +Ainda deseja ativá-lo?"</string> + <string name="reply">"Responder"</string> </resources>
\ No newline at end of file diff --git a/app/src/main/res/values-pt/strings.xml b/app/src/main/res/values-pt/strings.xml new file mode 100644 index 00000000..a2e8aa71 --- /dev/null +++ b/app/src/main/res/values-pt/strings.xml @@ -0,0 +1,1072 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <string name="login_activity_label">"Entrar"</string> + <string name="comment_activity_label">"Enviar Comentário"</string> + <string name="comment_activity_label_is_replying">"Responder"</string> + <string name="post_text_activity_label">"Publicação de texto"</string> + <string name="subreddit_selection_activity_label">"Selecione uma Comunidade"</string> + <string name="post_link_activity_label">"Publicação de Ligação"</string> + <string name="post_image_activity_label">"Publicação de Imagem"</string> + <string name="post_video_activity_label">"Publicação de vídeo"</string> + <string name="rules_activity_label">"Regras"</string> + <string name="search_subreddits_activity_label">"Comunidades"</string> + <string name="edit_post_activity_label">"Editar publicação"</string> + <string name="edit_comment_activity_label">"Editar Comentário"</string> + <string name="view_message_activity_label">"Caixa de Entrada"</string> + <string name="settings_activity_label">"Definições"</string> + <string name="account_saved_thing_activity_label">"Guardado"</string> + <string name="create_multi_reddit_activity_label">"Criar Multireddit"</string> + <string name="subreddit_multiselection_activity_label">"Selecionar Comunidades"</string> + <string name="custom_theme_listing_activity_label">"Temas Personalizados"</string> + <string name="customize_theme_activity_label">"Personalizar Tema"</string> + <string name="customize_theme_activity_create_theme_label">"Criar Tema"</string> + <string name="theme_preview_activity_label">"Pré-visualizar Tema"</string> + <string name="edit_multi_reddit_activity_label">"Editar Multireddit"</string> + <string name="selected_subeddits_activity_label">"Comunidades selecionadas"</string> + <string name="report_activity_label">"Denunciar"</string> + <string name="view_imgur_media_activity_image_label">"Imagem %1$d/%2$d"</string> + <string name="view_imgur_media_activity_video_label">"Vídeo %1$d/%2$d"</string> + <string name="send_private_message_activity_label">"Enviar MP"</string> + <string name="view_reddit_gallery_activity_image_label">"Imagem %1$d/%2$d"</string> + <string name="view_reddit_gallery_activity_gif_label">"Gif %1$d/%2$d"</string> + <string name="view_reddit_gallery_activity_video_label">"Vídeo %1$d/%2$d"</string> + <string name="navigation_drawer_open">"Abrir gaveta de navegação"</string> + <string name="navigation_drawer_close">"Fechar gaveta de navegação"</string> + <string name="action_download">"Transferir"</string> + <string name="action_refresh">"Atualizar"</string> + <string name="action_add_comment">"Adicionar um comentário"</string> + <string name="action_save_post">"Guardar publicação"</string> + <string name="action_view_crosspost_parent">"Ver crosspost parent"</string> + <string name="action_search">"Pesquisar"</string> + <string name="action_start_lazy_mode">"Iniciar Modo Preguiça"</string> + <string name="action_stop_lazy_mode">"Parar Modo Preguiça"</string> + <string name="action_send">"Enviar"</string> + <string name="action_sort">"Ordenar"</string> + <string name="action_hide_post">"Esconder publicação"</string> + <string name="action_unhide_post">"Revelar publicação"</string> + <string name="action_edit_post">"Editar publicação"</string> + <string name="action_delete_post">"Eliminar publicação"</string> + <string name="action_mark_nsfw">"Marcar como 18+"</string> + <string name="action_unmark_nsfw">"Desmarcar 18+"</string> + <string name="action_mark_spoiler">"Marcar como Spoiler"</string> + <string name="action_unmark_spoiler">"Desmarcar como Spoiler"</string> + <string name="action_edit_flair">"Editar Flair"</string> + <string name="action_change_post_layout">"Alterar Visualização de Publicações"</string> + <string name="action_save">"Guardar"</string> + <string name="action_edit_multi_reddit">"Editar MultiReddit"</string> + <string name="action_delete_multi_reddit">"Eliminar MultiReddit"</string> + <string name="action_share">"Partilhar"</string> + <string name="action_preview">"Pré-visualizar"</string> + <string name="action_report">"Denunciar"</string> + <string name="action_see_removed">"Ver Removido"</string> + <string name="action_set_wallpaper">"Definir como Imagem de Fundo"</string> + <string name="action_send_private_message">"Enviar Mensagem Privada"</string> + <string name="action_block_user">"Bloquear Utilizador"</string> + <string name="parse_json_response_error">"Ocorreu um erro ao analisar a resposta do JSON"</string> + <string name="retrieve_token_error">"Erro ao Recuperar token"</string> + <string name="something_went_wrong">"Algo correu mal. Tente novamente mais tarde."</string> + <string name="access_denied">"Acesso negado"</string> + <string name="parse_user_info_error">"Ocorreu um erro ao analisar as informações do utilizador"</string> + <string name="no_system_webview_error">"Ocorreu um erro ao abrir 'WebView' do Sistema"</string> + <string name="error_loading_image_tap_to_retry">"Ocorreu um erro ao carregar a imagem. Toque para tentar novamente."</string> + <string name="load_posts_error">"Erro ao carregar publicações. +Toque para tentar novamente."</string> + <string name="load_more_posts_error">"Erro ao carregar publicações."</string> + <string name="load_post_error">"Erro ao carregar publicação. +Toque para tentar novamente."</string> + <string name="search_subreddits_error">"Ocorreu um erro ao pesquisar por comunidades. +Toque para tentar novamente."</string> + <string name="search_users_error">"Ocorreu um erro ao pesquisar por utilizadores. +Toque para tentar novamente."</string> + <string name="no_posts">"Sem publicações encontradas"</string> + <string name="no_comments">"Sem comentários encontrados"</string> + <string name="no_subreddits">"Nenhuma comunidade encontrada"</string> + <string name="no_users">"Nenhum utilizador encontrado"</string> + <string name="no_multi_reddits">"Nenhum Multireddit encontrado"</string> + <string name="no_storage_permission">"Sem permissão de armazenamento para guardar este ficheiro"</string> + <string name="load_comments_failed">"Erro ao carregar comentários. +Toque para tentar novamente."</string> + <string name="retry">"Tentar novamente"</string> + <string name="comments">"Comentários"</string> + <string name="no_comments_yet">"Ainda sem comentários. Escrever um comentário?"</string> + <string name="vote_failed">"Falha ao votar"</string> + <string name="refresh_post_failed">"Erro ao recarregar publicação"</string> + <string name="load_messages_failed">"Erro ao carregar mensagens. +Toque para tentar novamente."</string> + <string name="no_messages">"Vazio"</string> + <string name="nsfw">"18+"</string> + <string name="karma_info">"Karma: %1$d"</string> + <string name="karma_info_user_detail">"Karma: +%1$d (%2$d + %3$d)"</string> + <string name="cakeday_info">"Dia de bolo: +%1$s"</string> + <string name="since">"Desde:"</string> + <string name="profile">"Perfil"</string> + <string name="subscriptions">"Subscrições"</string> + <string name="multi_reddit">"Multi-reddit"</string> + <string name="inbox">"Caixa de Entrada"</string> + <string name="upvoted">"Voto Positivo"</string> + <string name="downvoted">"Voto Negativo"</string> + <string name="hidden">"Escondido"</string> + <string name="saved">"Guardado"</string> + <string name="gilded">"Dourado"</string> + <string name="settings">"Definições"</string> + <string name="subscribers_number_detail">"Membros: %1$d"</string> + <string name="online_subscribers_number_detail">"Online: %1$d"</string> + <string name="cannot_fetch_subreddit_info">"Não é possível obter informações da comunidade"</string> + <string name="cannot_fetch_user_info">"Não é possível obter informações do utilizador"</string> + <string name="cannot_fetch_sidebar">"Não é possível obter informações da barra lateral"</string> + <string name="cannot_fetch_multireddit">"Não é possível obter informações do multireddit"</string> + <string name="subscribe">"Subscrever"</string> + <string name="unsubscribe">"Cancelar subscrição"</string> + <string name="subscribed">"Subscrito"</string> + <string name="subscribe_failed">"Adesão Falhou"</string> + <string name="unsubscribed">"Subscrição cancelada"</string> + <string name="unsubscribe_failed">"Falha ao Cancelar Subscrição"</string> + <string name="follow">"Seguir"</string> + <string name="unfollow">"Deixar de Seguir"</string> + <string name="followed">"Seguido"</string> + <string name="follow_failed">"Falhou ao Seguir"</string> + <string name="unfollowed">"Deixado de Seguir"</string> + <string name="unfollow_failed">"Falhou ao Deixar de Seguir"</string> + <string name="content_description_banner_imageview">"Imagem Estandarte da Comunidade"</string> + <string name="app_label">"Infinity"</string> + <string name="search_hint">"Pesquisar por qualquer coisa"</string> + <string name="no_posts_no_lazy_mode">"Sem publicações disponíveis"</string> + <string name="lazy_mode_start">"Modo Preguiça inicia em %1$.1fs"</string> + <string name="lazy_mode_stop">"O Modo Perguiça parou"</string> + <string name="write_comment_hint">"Os seus pensamentos interessantes aqui"</string> + <string name="comment_content_required">"Onde está o seu pensamento interessante?"</string> + <string name="sending_comment">"A enviar"</string> + <string name="send_comment_success">"Comentário enviado"</string> + <string name="send_comment_failed">"Não foi possível enviar este comentário"</string> + <string name="send_message_username_hint">"Utilizador"</string> + <string name="send_message_subject_hint">"Assunto (100 caracteres no máximo)"</string> + <string name="send_message_content_hint">"Mensagem"</string> + <string name="reply_message_failed">"Não foi possível responder a esta mensagem"</string> + <string name="error_getting_message">"Erro ao receber esta mensagem"</string> + <string name="message_username_required">"A quem deseja enviar esta mensagem?"</string> + <string name="message_subject_required">"A sua mensagem deve ter um assunto"</string> + <string name="message_content_required">"Tem de dizer algo ao destinatário"</string> + <string name="sending_message">"A enviar"</string> + <string name="send_message_success">"Mensagem enviada"</string> + <string name="send_message_failed">"Não foi possível enviar esta mensagem"</string> + <string name="select_a_subreddit">"Por favor escolha uma comunidade primeiro"</string> + <string name="title_required">"A publicação precisa de um bom título"</string> + <string name="link_required">"Onde está o endereço?"</string> + <string name="select_an_image">"Por favor selecione primeiro uma imagem"</string> + <string name="posting">"A publicar"</string> + <string name="post_failed">"Não foi possível publicar"</string> + <string name="error_processing_image">"Erro ao processar imagem"</string> + <string name="error_processing_video">"Erro ao processar vídeo"</string> + <string name="download_started">"Transferência Iniciada. Consultar a notificação para ver o progresso."</string> + <string name="comment_load_more_comments">"Carregar mais comentários"</string> + <string name="comment_load_more_comments_failed">"Erro ao carregar. Toque para tentar novamente"</string> + <string name="loading">"A carregar"</string> + <string name="post_title_hint">"Título"</string> + <string name="post_text_content_hint">"Conteúdo"</string> + <string name="choose_a_subreddit">"Escolha uma comunidade"</string> + <string name="rules">"Regras"</string> + <string name="post_link_hint">"URL"</string> + <string name="subreddits">"Comunidades"</string> + <string name="users">"Utilizadores"</string> + <string name="multi_reddits">"MultiReddits"</string> + <string name="bottom_sheet_post_text">"Texto"</string> + <string name="bottom_sheet_post_link">"Ligação"</string> + <string name="bottom_sheet_post_image">"Imagem"</string> + <string name="bottom_sheet_post_video">"Vídeo"</string> + <string name="select_from_gallery">"Enviar uma imagem"</string> + <string name="select_again">"Selecione novamente"</string> + <string name="error_getting_image">"Erro ao enviar a imagem"</string> + <string name="error_getting_video">"Erro ao enviar o vídeo"</string> + <string name="no_camera_available">"Nenhuma aplicação de câmara disponível"</string> + <string name="error_creating_temp_file">"Erro ao criar ficheiro temporário"</string> + <string name="video_is_processing">"Vídeo a ser processado. Por favor aguarde."</string> + <string name="image_is_processing">"Imagem a ser processada. Por favor aguarde."</string> + <string name="gif_is_processing">"Gif a ser processado. Por favor aguarde."</string> + <string name="flair">"Flair"</string> + <string name="spoiler">"Spoiler"</string> + <string name="no_flair">"Sem flair"</string> + <string name="error_loading_flairs">"Erro ao carregar flairs. +Toque para tentar novamente."</string> + <string name="no_rule">"Sem regra"</string> + <string name="error_loading_rules">"Erro ao carregar regras. +Toque para tentar novamente."</string> + <string name="error_loading_rules_without_retry">"Erro ao Carregar Regras"</string> + <string name="search_in">"Pesquisar em"</string> + <string name="all_subreddits">"Todas as comunidades"</string> + <string name="sort_best">"Melhor"</string> + <string name="sort_hot">"Em Destaque"</string> + <string name="sort_new">"Novos"</string> + <string name="sort_random">"Aleatório"</string> + <string name="sort_rising">"Em Ascensão"</string> + <string name="sort_top">"Top"</string> + <string name="sort_controversial">"Polémicos"</string> + <string name="sort_relevance">"Relevância"</string> + <string name="sort_comments">"Comentários"</string> + <string name="sort_activity">"Atividade"</string> + <string name="sort_confidence">"Confiança"</string> + <string name="sort_old">"Mais antigo"</string> + + <!-- Fuzzy --> + <string name="sort_qa">"PR"</string> + <string name="sort_live">"Em direto"</string> + <string name="sort_time_hour">"Hora"</string> + <string name="sort_time_day">"Dia"</string> + <string name="sort_time_week">"Semana"</string> + <string name="sort_time_month">"Mês"</string> + <string name="sort_time_year">"Ano"</string> + <string name="sort_time_all_time">"Desde sempre"</string> + <string name="no_activity_found_for_share">"Não há nenhuma aplicação que possa lidar com a ação de partilha"</string> + <string name="archived_post_vote_unavailable">"Publicação arquivada. Votos indisponíveis."</string> + <string name="archived_post_comment_unavailable">"Publicação arquivada. Comentários indisponíveis."</string> + <string name="archived_post_reply_unavailable">"Publicação arquivada. Respostas indisponíveis."</string> + <string name="locked_post_comment_unavailable">"Publicação bloqueada. Comentários indisponíveis."</string> + <string name="locked_post_reply_unavailable">"Publicação bloqueada. Respostas indisponíveis."</string> + <string name="text">"TEXTO"</string> + <string name="link">"ENDEREÇO"</string> + <string name="image">"IMAGEM"</string> + <string name="video">"VÍDEO"</string> + <string name="gif">"GIF"</string> + <string name="gallery">"GALERIA"</string> + <string name="best">"Os Melhores"</string> + <string name="search">"Pesquisar"</string> + <string name="posting_video">"A Publicar Vídeo"</string> + <string name="posting_image">"A Publicar Imagem"</string> + + <!-- Fuzzy --> + <string name="please_wait">"Por favor aguarde."</string> + <string name="add_account">"Adicionar conta"</string> + <string name="anonymous_account">"Anónimo"</string> + <string name="log_out">"Terminar sessão"</string> + <string name="press_here_to_login">"Pressione aqui para iniciar sessão"</string> + <string name="login_first">"Inicie sessão primeiro"</string> + <string name="post_saved_success">"Publicação guardada"</string> + <string name="post_saved_failed">"Incapaz de guardar publicação"</string> + <string name="post_unsaved_success">"Publicação não guardada"</string> + <string name="post_unsaved_failed">"Não foi possível esquecer publicação"</string> + <string name="post_hide_success">"Publicação escondida"</string> + <string name="post_hide_failed">"Não foi possível esconder publicação"</string> + <string name="post_unhide_success">"Publicação revelada"</string> + <string name="thing_favorite_failed">"Falha ao adicionar aos favoritos"</string> + <string name="thing_unfavorite_failed">"Falha ao remover dos favoritos"</string> + <string name="post_unhide_failed">"Não foi possível revelar publicação"</string> + <string name="delete_this_post">"Eliminar esta Publicação"</string> + <string name="delete_this_comment">"Eliminar este Comentário"</string> + <string name="are_you_sure">"Tem a certeza?"</string> + <string name="edit">"Editar"</string> + <string name="delete">"Eliminar"</string> + <string name="see_removed_comment">"Ver Comentário Removido"</string> + <string name="fetching_removed_comment">"A obter comentário removido"</string> + <string name="show_removed_comment_failed">"Comentário removido não encontrado"</string> + <string name="fetching_removed_post">"A obter publicação removido"</string> + <string name="show_removed_post_failed">"Publicação removida não encontrada"</string> + <string name="cancel">"Cancelar"</string> + <string name="ok">"OK"</string> + + <!-- Fuzzy --> + <string name="edit_success">"Editado com sucesso"</string> + <string name="delete_post_success">"Eliminada com sucesso"</string> + <string name="delete_post_failed">"Falha ao eliminar"</string> + <string name="mark_nsfw_success">"Marcado como 18+ com sucesso"</string> + <string name="mark_nsfw_failed">"Falhou ao marcar como 18+"</string> + <string name="unmark_nsfw_success">"Desmarcado como 18+ com sucesso"</string> + <string name="unmark_nsfw_failed">"Falhou ao desmarcar como 18+"</string> + <string name="mark_spoiler_success">"Marcado como spoiler com sucesso"</string> + <string name="mark_spoiler_failed">"Marcação como spoiler falhou"</string> + <string name="unmark_spoiler_success">"Desmarcado como Spoiler com sucesso"</string> + <string name="unmark_spoiler_failed">"Desmarcação de spoiler falhou"</string> + <string name="update_flair_success">"Flair atualizado com sucesso"</string> + <string name="update_flair_failed">"Falha ao atualizar flair"</string> + <string name="edit_flair">"Editar Flair"</string> + <string name="only_allow_64_chars">"Permitir apenas menos de 64 caracteres"</string> + <string name="view_all_comments">"Clique aqui para explorar todos os comentários"</string> + <string name="notification_summary_account">"Conta"</string> + <string name="notification_summary_message">"Nova Mensagem"</string> + <string name="notification_summary_subreddit">"Comunidade"</string> + <string name="notification_summary_award">"Prémio"</string> + <string name="notification_new_messages">"%1$d Mensagens Novas"</string> + <string name="label_account">"Conta"</string> + <string name="label_post">"Publicação"</string> + <string name="label_preferences">"Preferências"</string> + <string name="account_switched">"Conta trocada. Portanto todas as outras páginas desapareceram."</string> + <string name="settings_notification_master_title">"Notificação"</string> + <string name="settings_notification_enable_notification_title">"Ativar Notificações"</string> + <string name="settings_notification_interval_title">"Intervalo de Verificação de Notificações"</string> + <string name="settings_theme_title">"Tema"</string> + <string name="settings_amoled_dark_title">"Escuro Amoled"</string> + <string name="settings_interface_title">"Interface"</string> + <string name="settings_gestures_and_buttons_title">"Gestos e Botões"</string> + <string name="settings_save_front_page_scrolled_position_title">"Guardar Posição de Deslizamento em INÍCIO"</string> + <string name="settings_save_front_page_scrolled_position_summary">"Explorar novas publicações após recarregar INÍCIO (Página Principal, ordenado por: Melhor)"</string> + <string name="settings_open_link_in_app_title">"Abrir Ligação na Aplicação"</string> + <string name="settigns_video_title">"Vídeo"</string> + <string name="settings_video_autoplay_title">"Reprodução Automática de Vídeos"</string> + <string name="settings_mute_autoplaying_videos_title">"Vídeos em auto-reprodução Sem Som"</string> + <string name="settings_autoplay_nsfw_videos_title">"Reprodução Automática de Vídeos 18+"</string> + <string name="settings_start_autoplay_visible_area_offset_portrait_title">"Área Visível de Vídeos para Desencadear Reprodução (Retrato)"</string> + <string name="settings_start_autoplay_visible_area_offset_portrait_summary">"Inicia reprodução automática de vídeos quando estão %1$d%% visíveis"</string> + <string name="settings_start_autoplay_visible_area_offset_landscape_title">"Área Visível de Vídeos para Desencadear Reprodução (Paisagem)"</string> + <string name="settings_start_autoplay_visible_area_offset_landscape_summary">"Inicia reprodução automática de vídeos quando estão %1$d%% visíveis"</string> + <string name="settings_immersive_interface_title">"Interface Imersiva"</string> + <string name="settings_immersive_interface_summary">"Não é Aplicada a Todas as Páginas"</string> + <string name="settings_immersive_interface_ignore_nav_bar_title">"Ignorar Barra de Navegação na Interface Imersiva"</string> + <string name="settings_immersive_interface_ignore_nav_bar_summary">"Impede que Barra de Navegação Inferior tenha Preenchimento Extra"</string> + <string name="settings_customize_tabs_in_main_page_title">"Personalizar Separadores da Página Principal"</string> + <string name="settings_enable_bottom_app_bar_title">"Ativar Barra Navegação Inferior"</string> + <string name="settings_enable_bottom_app_bar_summary">"Não aplicável no Modo Anónimo"</string> + <string name="settings_category_post_and_comment_title">"Publicação e Comentário"</string> + <string name="settings_vote_buttons_on_the_right_title">"Botões de Voto à Direita"</string> + <string name="settings_volume_keys_navigate_comments_title">"Usar Teclas de Volume para Navegar pelos Comentários"</string> + <string name="settings_volume_keys_navigate_posts_title">"Usar Teclas de Volume para Navegar pelas Publicações"</string> + <string name="settings_mute_video_title">"Vídeos Sem Som"</string> + <string name="settings_mute_nsfw_video_title">"Vídeos 18+ Sem Som"</string> + + <!-- Fuzzy --> + <string name="settings_automatically_try_redgifs_title">"Tentar aceder ao Redgifs automaticamente caso os vídeos no Gfycat tenham sido removidos."</string> + <string name="settings_video_player_ignore_nav_bar_title">"Ignorar Barra de Navegação no Reprodutor de Vídeo"</string> + <string name="settings_video_player_ignore_nav_bar_summary">"Impedir que o Controlador de Vídeo Tenha Margem Extra"</string> + <string name="settings_confirm_to_exit">"Confirmar para Sair"</string> + <string name="settings_category_comment_title">"Comentário"</string> + <string name="settings_show_top_level_comments_first_title">"Mostrar Comentários de Topo Primeiro"</string> + <string name="settings_show_comment_divider_title">"Mostrar Separador de Comentários"</string> + <string name="settings_comment_toolbar_hide_on_click">"Clicar para Mostrar/Esconder a Barra de Ferramentas dos Comentários"</string> + <string name="settings_fully_collapse_comment_title">"Colapsar Comentário por Completo"</string> + <string name="settings_comment_toolbar_hidden">"Barra de Ferramentas dos Comentários Escondida por Defeito"</string> + <string name="settings_show_absolute_number_of_votes_title">"Mostrar Número de Votos Absolutos"</string> + <string name="settings_show_elapsed_time">"Mostrar tempo decorrido nas Publicações e Comentários"</string> + <string name="settings_time_format_title">"Formato da Hora"</string> + <string name="settings_category_post_title">"Publicação"</string> + <string name="settings_default_post_layout">"Visualização de Publicações Padrão"</string> + <string name="settings_show_divider_in_compact_layout">"Mostrar Separador"</string> + <string name="settings_show_thumbnail_on_the_left_in_compact_layout">"Mostrar Miniatura à Esquerda"</string> + <string name="settings_swipe_to_go_back_title">"Deslizar para a Direita para Voltar Atrás"</string> + <string name="settings_swipe_to_go_back_summary">"Não é Aplicado a Todas as Páginas"</string> + <string name="settings_lock_jump_to_next_top_level_comment_button_title">"Prender botão Saltar para Próximo Comentário de Topo"</string> + <string name="settings_lock_bottom_app_bar_title">"Prender Barra de Navegação na Parte Inferior"</string> + <string name="settings_swipe_up_to_hide_jump_to_next_top_level_comment_button_title">"Deslizar para Cima para Esconder o Botão de Saltar para Próximo Comentário de Topo"</string> + <string name="settings_lazy_mode_interval_title">"Intervalo do Modo Preguiça"</string> + <string name="settings_font_title">"Tipo de Letra"</string> + <string name="settings_preview_font_title">"Pré-visualizar Tipo de Letra"</string> + <string name="settings_font_summary">"Tipo de Letra"</string> + <string name="settings_title_font_summary">"Titulo"</string> + <string name="settings_content_font_summary">"Conteúdo"</string> + <string name="settings_font_family_title">"Família Tipográfica"</string> + <string name="settings_title_font_family_title">"Família Tipográfica do Título"</string> + <string name="settings_content_font_family_title">"Família Tipográfica do Conteúdo"</string> + <string name="settings_font_size_title">"Tamanho do Tipo de Letra"</string> + <string name="settings_title_font_size_title">"Tamanho de Letra do Título"</string> + <string name="settings_content_font_size_title">"Tamanho de Letra do Conteúdo"</string> + <string name="settings_enable_nsfw_title">"Ativar 18+"</string> + <string name="settings_blur_nsfw_title">"Desfocar Imagens 18+"</string> + <string name="settings_blur_spoiler_title">"Desfocar Imagens Spoiler"</string> + <string name="settings_about_master_title">"Sobre"</string> + <string name="settings_acknowledgement_master_title">"Reconhecimento"</string> + <string name="settings_credits_master_title">"Créditos"</string> + <string name="settings_credits_icon_foreground_title">"Ícone Primeiro Plano"</string> + <string name="settings_credits_icon_foreground_summary">"Vetor tecnológico criado por freepik - www.freepik.com"</string> + <string name="settings_credits_icon_background_title">"Fundo do Ícone"</string> + <string name="settings_credits_icon_background_summary">"Vetor tecnológico criado por freepik - www.freepik.com"</string> + <string name="settings_credits_error_image_title">"Imagem de Erro"</string> + <string name="settings_credits_error_image_summary">"Vetor tecnológico criado por freepik - www.freepik.com"</string> + <string name="settings_credits_gilded_icon_title">"Ícone Dourado"</string> + <string name="settings_credits_gilded_icon_summary">"Ícone criado por Freepik da www.flaticon.com"</string> + <string name="settings_credits_crosspost_icon_title">"Ícone de Republicação"</string> + <string name="settings_credits_crosspost_icon_summary">"Ícone criado por Freepik da www.flaticon.com"</string> + <string name="settings_credits_thumbtack_icon_title">"Ícone Thumbtack"</string> + <string name="settings_credits_thumbtack_icon_summary">"Ícone criado por Freepik da www.flaticon.com"</string> + <string name="settings_credits_best_rocket_icon_title">"Ícone Rocket"</string> + <string name="settings_credits_best_rocket_icon_summary">"Ícone criado por Freepik da www.flaticon.com"</string> + <string name="settings_credits_material_icons_title">"Ícones Material"</string> + <string name="settings_open_source_title">"Código-fonte"</string> + <string name="settings_open_source_summary">"Avalie no Github caso goste desta aplicação"</string> + <string name="settings_rate_title">"Avaliar no Google Play"</string> + <string name="settings_rate_summary">"Dê-me 5 estrelas que ficarei muito contente"</string> + <string name="settings_email_title">"Email"</string> + <string name="settings_email_summary">"docilealligator.app@gmail.com"</string> + <string name="settings_reddit_account_title">"Conta do Reddit"</string> + <string name="settings_reddit_account_summary">"u/Hostilenemy"</string> + <string name="settings_subreddit_title">"Comunidade"</string> + <string name="settings_subreddit_summary">"r/Infinity_For_Reddit"</string> + <string name="settings_share_title">"Partilhar"</string> + <string name="settings_share_summary">"Se aprecia esta aplicação, partilhe-a com outros"</string> + <string name="settings_version_title">"Infinity For Reddit"</string> + <string name="settings_version_summary">"Versão %s"</string> + <string name="settings_category_customization_title">"Personalização"</string> + <string name="settings_customize_light_theme_title">"Tema Claro"</string> + <string name="settings_customize_dark_theme_title">"Tema Escuro"</string> + <string name="settings_customize_amoled_theme_title">"Tema Amoled"</string> + <string name="settings_manage_themes_title">"Gerir Temas"</string> + <string name="settings_custom_theme_cannot_apply_to_settings_page_summary">"Temas personalizados não podem ser aplicados à página de definições (exceto à barra de ferramentas, barra de estado e barra de navegação)."</string> + <string name="settings_advanced_master_title">"Avançado"</string> + <string name="settings_delete_all_subreddits_data_in_database_title">"Eliminar Todas as Comunidades da BD"</string> + <string name="settings_delete_all_users_data_in_database_title">"Eliminar Todos os Utilizadores da BD"</string> + <string name="settings_delete_all_sort_type_data_in_database_title">"Eliminar Todos os Tipos de Ordenação da BD"</string> + <string name="settings_delete_all_post_layout_data_in_database_title">"Eliminar Todas as Visualizações de Publicações da BD"</string> + <string name="settings_delete_all_themes_in_database_title">"Eliminar Todos os Temas da BD"</string> + <string name="settings_delete_front_page_scrolled_positions_in_database_title">"Eliminar Todas as Posições de Deslizamento da BD"</string> + <string name="settings_reset_all_settings_title">"Repor Todas as Definições"</string> + <string name="settings_tab_1_summary">"Separador 1"</string> + <string name="settings_tab_2_summary">"Separador 2"</string> + <string name="settings_tab_3_summary">"Separador 3"</string> + <string name="settings_tab_title">"Título"</string> + <string name="settings_tab_post_type">"Tipo"</string> + <string name="settings_tab_subreddit_name">"Nome da Comunidade (sem prefixo r/)"</string> + <string name="settings_tab_multi_reddit_name">"Nome MultiReddit (/utilizador/oseunomedeutilizador/m/oseunomemultireddit)"</string> + <string name="settings_tab_username">"Nome de Utilizador (sem prefixo u/)"</string> + <string name="no_developer_easter_egg">"Aqui não existem opções de programador"</string> + <string name="no_link_available">"Não foi possível obter a ligação"</string> + <string name="exit_when_submit">"Sair?"</string> + <string name="exit_when_submit_post_detail">"A publicação será submetida mesmo que saía daqui."</string> + <string name="exit_when_edit_post_detail">"A publicação poderá ser submetida mesmo que saía daqui."</string> + <string name="exit_when_edit_comment_detail">"O comentário poderá ser enviado mesmo que saía daqui."</string> + <string name="discard">"Descartar?"</string> + <string name="discard_detail">"O rascunho NÃO será guardado."</string> + <string name="yes">"Sim"</string> + <string name="no">"Não"</string> + <string name="no_data_received">"Não foram recebidos dados"</string> + <string name="no_image_path_received">"Caminho da imagem não recebido"</string> + <string name="no_video_path_received">"Caminho do vídeo não recebido"</string> + <string name="cannot_handle_intent">"Não foi possível lidar com o pedido de partilha"</string> + <string name="share">"Partilhar"</string> + <string name="no_email_client">"Não foi encontrado nenhum cliente de email"</string> + <string name="no_app">"Nenhuma aplicação disponível"</string> + <string name="comment_saved_success">"Comentário guardado"</string> + <string name="comment_saved_failed">"Não foi possível guardar o comentário"</string> + <string name="comment_unsaved_success">"Comentário esquecido"</string> + <string name="comment_unsaved_failed">"Não foi possível esquecer o comentário"</string> + <string name="favorites">"Favoritos"</string> + <string name="all">"Todos"</string> + <string name="post_layout_card">"Cartão"</string> + <string name="post_layout_compact">"Compacta"</string> + <string name="elapsed_time_just_now">"Agora mesmo"</string> + <string name="elapsed_time_a_minute_ago">"1 Minuto"</string> + <string name="elapsed_time_minutes_ago">"%1$d Minutos"</string> + <string name="elapsed_time_an_hour_ago">"1 Hora"</string> + <string name="elapsed_time_hours_ago">"%1$d Horas"</string> + <string name="elapsed_time_yesterday">"Ontem"</string> + <string name="elapsed_time_days_ago">"%1$d Dias"</string> + <string name="elapsed_time_a_month_ago">"1 Mês"</string> + <string name="elapsed_time_months_ago">"%1$d Meses"</string> + <string name="elapsed_time_a_year_ago">"1 Ano"</string> + <string name="elapsed_time_years_ago">"%1$d Anos"</string> + <string name="error_getting_multi_reddit_data">"Erro ao obter dados do multireddit"</string> + <string name="error_loading_multi_reddit_list">"Não foi possível sincronizar multireddits"</string> + <string name="error_loading_subscriptions">"Não foi possível sincronizar as subscrições"</string> + <string name="share_this_app">"Check out Infinity for Reddit, an awesome Reddit client! +https://play.google.com/store/apps/details?id=ml.docilealligator.infinityforreddit"</string> + <string name="error_getting_subreddit_name">"Erro ao obter o nome da comunidade"</string> + <string name="share_post_link">"Partilhar Endereço da Publicação"</string> + <string name="share_image_link">"Partilhar Endereço da Imagem"</string> + <string name="share_gif_link">"Partilhar Endereço do Gif"</string> + <string name="share_video_link">"Partilhar Endereço do Vídeo"</string> + <string name="share_link">"Partilhar Endereço"</string> + <string name="copy_post_link">"Copiar Endereço da Publicação"</string> + <string name="copy_image_link">"Copiar Endereço da Imagem"</string> + <string name="copy_gif_link">"Copiar Endereço do Gif"</string> + <string name="copy_video_link">"Copiar Endereço do Vídeo"</string> + <string name="copy_link">"Copiar Endereço"</string> + <string name="copy_success">"Copiado"</string> + <string name="copy_link_failed">"Não foi possível copiar a ligação"</string> + <string name="copy_text">"Copiar"</string> + <string name="copy_all">"Copiar Tudo"</string> + <string name="copy_markdown">"Copiar Markdown"</string> + <string name="copy_raw_text">"Copiar Texto Simples"</string> + <string name="copy_all_markdown">"Copiar todo o Markdown"</string> + <string name="copy_all_raw_text">"Copiar Todo o Texto Simples"</string> + <string name="exit_app">"Sair?"</string> + <string name="light_theme">"Tema Claro"</string> + <string name="dark_theme">"Tema Escuro"</string> + <string name="multi_reddit_name_hint">"Nome (50 caracteres máx)"</string> + <string name="multi_reddit_description_hint">"Descrição"</string> + <string name="private_multi_reddit">"Privado"</string> + <string name="no_multi_reddit_name">"Onde está o nome?"</string> + <string name="create_multi_reddit_failed">"Não é possível criar este multireddit"</string> + <string name="duplicate_multi_reddit">"Este multireddit já existe"</string> + <string name="edit_multi_reddit_failed">"Não é possível editar este multireddit"</string> + <string name="logged_out">"Não tem sessão iniciada"</string> + <string name="delete_multi_reddit_success">"Eliminado com sucesso"</string> + <string name="delete_multi_reddit_failed">"Falha ao eliminar"</string> + <string name="delete_multi_reddit_dialog_message">"Tem a certeza?"</string> + <string name="enable_nsfw">"Ativar 18+"</string> + <string name="disable_nsfw">"Desativar 18+"</string> + <string name="cannot_save_image">"Não é possível guardar a imagem"</string> + <string name="cannot_save_gif">"Não é possível guardar o gif"</string> + <string name="cannot_get_storage">"Não é possível aceder ao armazenamento da aplicação"</string> + <string name="save_image_first">"A guardar imagem. Aguarde."</string> + <string name="save_gif_first">"A guardar GIF. Aguarde."</string> + <string name="theme_name_description">"Toque para alterar o nome deste tema."</string> + <string name="theme_item_is_light_theme">"Definir como Tema Claro"</string> + <string name="theme_item_is_dark_theme">"Definir como Tema Escuro"</string> + <string name="theme_item_is_amoled_theme">"Definir como Tema Amoled"</string> + <string name="theme_item_color_primary">"Cor Primária"</string> + <string name="theme_item_color_primary_detail">"Aplica-se a: Barra de ferramentas"</string> + <string name="theme_item_color_primary_dark">"Cor Primária Escura"</string> + <string name="theme_item_color_primary_dark_detail">"Aplicado a: Barra de Estado"</string> + <string name="theme_item_color_accent">"Cor Principal"</string> + <string name="theme_item_color_accent_detail">"Aplicado a: Barra de Progresso, etc"</string> + <string name="theme_item_color_primary_light_theme">"Cor Primária do Tema Claro"</string> + <string name="theme_item_color_primary_light_theme_detail">"Aplicado a: Fundo do Botão de Ação Flutuante e Botão"</string> + <string name="theme_item_primary_text_color">"Cor Texto Primário"</string> + <string name="theme_item_primary_text_color_detail">"Aplicado a: Texto Primário"</string> + <string name="theme_item_secondary_text_color">"Cor Texto Secundário"</string> + <string name="theme_item_secondary_text_color_detail">"Aplicado a: Texto Secundário"</string> + <string name="theme_item_post_title_color">"Cor Título de Publicação"</string> + <string name="theme_item_post_title_color_detail">"Aplicado a: Título de Publicação"</string> + <string name="theme_item_post_content_color">"Cor Conteúdo da Publicação"</string> + <string name="theme_item_post_content_color_detail">"Aplicado a: Conteúdo da Publicação"</string> + <string name="theme_item_comment_color">"Cor de Comentário"</string> + <string name="theme_item_comment_color_detail">"Aplicado a: Comentário"</string> + <string name="theme_item_button_text_color">"Cor Texto do Botão"</string> + <string name="theme_item_button_text_color_detail">"Aplicado a: Texto do Botão"</string> + <string name="theme_item_chip_text_color">"Cor do Texto Chip"</string> + <string name="theme_item_chip_text_color_detail">"Aplicado a: Botão Aderir"</string> + <string name="theme_item_link_color">"Cor da Ligação"</string> + <string name="theme_item_link_color_detail">"Aplicado ao: URL"</string> + <string name="theme_item_received_message_text_color">"Cor do Texto de Mensagem Recebida"</string> + <string name="theme_item_received_message_text_color_detail">"Aplicado a: Mensagens Privadas Recebidas"</string> + <string name="theme_item_sent_message_text_color">"Cor do Texto Mensagem Enviada"</string> + <string name="theme_item_sent_message_text_color_detail">"Aplicado a: Mensagens Privadas Enviadas"</string> + <string name="theme_item_background_color">"Cor de Fundo"</string> + <string name="theme_item_background_color_detail">"Aplicado a: Fundo de todas as páginas e gaveta de navegação"</string> + <string name="theme_item_card_view_background_color">"Cor de Fundo da Visualização em Cartão"</string> + <string name="theme_item_card_view_background_color_detail">"Aplicado a: Fundo de publicação e messagem"</string> + <string name="theme_item_comment_background_color">"Cor de Fundo de Comentário"</string> + <string name="theme_item_comment_background_color_detail">"Aplicado a: Fundo de Comentário"</string> + <string name="theme_item_fully_collapsed_comment_background_color">"Cor de Fundo de Comentário Totalmente Colapsado"</string> + <string name="theme_item_fully_collapsed_comment_background_color_detail">"Aplicado a: Fundo de comentários totalmente colapsados"</string> + <string name="theme_item_awarded_comment_background_color">"Cor de Fundo de Comentário Premiado"</string> + <string name="theme_item_awarded_comment_background_color_detail">"Aplicado a: Fundo de comentários premiados"</string> + <string name="theme_item_received_message_background_color">"Cor de Fundo de Mensagem Recebida"</string> + <string name="theme_item_received_message_background_color_detail">"Aplicado a: Fundo de mensagens privadas recebidas"</string> + <string name="theme_item_sent_message_background_color">"Cor de Fundo Mensagem Enviada"</string> + <string name="theme_item_sent_message_background_color_detail">"Aplicado a: Fundo das mensagens privadas enviadas"</string> + <string name="theme_item_bottom_app_bar_background_color">"Cor da Barra de Navegação Inferior"</string> + <string name="theme_item_bottom_app_bar_background_color_detail">"Aplicado a: Barra de navegação inferior"</string> + <string name="theme_item_primary_icon_color">"Cor do Ícone Principal"</string> + <string name="theme_item_primary_icon_color_detail">"Aplicado a: Ícones da gaveta de navegação."</string> + <string name="theme_item_bottom_app_bar_icon_color">"Cor dos Ícones da Barra de Navegação Inferior"</string> + <string name="theme_item_bottom_app_bar_icon_color_detail">"Aplicado a: Ícones da barra de navegação inferior"</string> + <string name="theme_item_post_icon_and_info_color">"Cor do Ícone de Publicação e das Informações"</string> + <string name="theme_item_post_icon_and_info_color_detail">"Aplicado a: Ícones, pontuação e número de comentários de publicação"</string> + <string name="theme_item_comment_icon_and_info_color">"Cor do Ícone de Comentário e das Informações"</string> + <string name="theme_item_comment_icon_and_info_color_detail">"Aplicado a: Ícones e pontuações no comentários"</string> + <string name="theme_item_fab_icon_color">"Cor do Ícone do Botão de Ação Flutuante"</string> + <string name="theme_item_fab_icon_color_detail">"Aplicado a: Botão de ação flutuante"</string> + <string name="theme_item_send_message_icon_color">"Cor do Ícone Enviar Mensagem"</string> + <string name="theme_item_send_message_icon_color_detail">"Aplicado a: Ícone enviar mensagem privada"</string> + <string name="theme_item_toolbar_primary_text_and_icon_color">"Cor do Texto e Ícone Principais da Barra de ferramentas"</string> + <string name="theme_item_toolbar_primary_text_and_icon_color_detail">"Aplicado a: Textos e Ícones principais da barra de ferramentas"</string> + <string name="theme_item_toolbar_secondary_text_color">"Cor do Texto Secundário da Barra de Tarefas"</string> + <string name="theme_item_toolbar_secondary_text_color_detail">"Aplicado a: Texto secundário na barra de ferramentas"</string> + <string name="theme_item_circular_progress_bar_background_color">"Cor de Fundo da Barra de Progresso Circular"</string> + <string name="theme_item_circular_progress_bar_background_color_detail">"Aplicado a: Fundo da barra de progresso circular"</string> + <string name="theme_item_upvoted_color">"Cor de Voto Positivo"</string> + <string name="theme_item_upvoted_color_detail">"Aplicado a: Botões de Voto e Pontuações (Voto Positivo)"</string> + <string name="theme_item_downvoted_color">"Cor do Voto Negativo"</string> + <string name="theme_item_downvoted_color_detail">"Aplicado a: Botões de Voto e Pontuações (Voto Negativo)"</string> + <string name="theme_item_post_type_background_color">"Cor de Fundo do Tipo de Publicação"</string> + <string name="theme_item_post_type_background_color_detail">"Aplicado a: Cor de fundo do tipo de publicação (IMAGEM, TEXTO, VIDEO, GIF, LIGAÇÃO)"</string> + <string name="theme_item_post_type_text_color">"Cor do Texto do Tipo de Publicação"</string> + <string name="theme_item_post_type_text_color_detail">"Aplicado a: Cor do texto do tipo de publicação (IMAGEM, TEXTO, VIDEO, GIF, LIGAÇÃO)"</string> + <string name="theme_item_spoiler_background_color">"Cor de Fundo Spoiler"</string> + <string name="theme_item_spoiler_background_color_detail">"Aplicado a: Fundo da etiqueta spoiler"</string> + <string name="theme_item_spoiler_text_color">"Cor do Texto Spoiler"</string> + <string name="theme_item_spoiler_text_color_detail">"Aplicado a: Cor do texto na etiqueta spoiler"</string> + <string name="theme_item_nsfw_background_color">"Cor de Fundo de 18+"</string> + <string name="theme_item_nsfw_background_color_detail">"Aplicado a: Cor de fundo da etiqueta 18+"</string> + <string name="theme_item_nsfw_text_color">"Cor do Texto 18+"</string> + <string name="theme_item_nsfw_text_color_detail">"Aplicado a: Cor do texto da etiqueta 18+"</string> + <string name="theme_item_flair_background_color">"Cor de Fundo Flair"</string> + <string name="theme_item_flair_background_color_detail">"Aplicado a: Fundo da etiqueta flair"</string> + <string name="theme_item_flair_text_color">"Cor do Texto Flair"</string> + <string name="theme_item_flair_text_color_detail">"Aplicado a: Cor do texto da etiqueta flair"</string> + <string name="theme_item_awards_background_color">"Cor de Fundo de Prémios"</string> + <string name="theme_item_awards_background_color_detail">"Aplicado a: Fundo da etiqueta de prémios"</string> + <string name="theme_item_awards_text_color">"Cor do Texto Prémios"</string> + <string name="theme_item_awards_text_color_detail">"Aplicado a: Cor do texto da etiqueta prémios"</string> + <string name="theme_item_archived_tint">"Cor do Ícone de Arquivo"</string> + <string name="theme_item_archived_tint_detail">"Aplicado a: Ícone de Arquivo"</string> + <string name="theme_item_locked_icon_tint">"Cor do Ícone de Bloqueio"</string> + <string name="theme_item_locked_icon_tint_detail">"Aplicado a: Ícone de Bloqueio"</string> + <string name="theme_item_crosspost_icon_tint">"Cor do Ícone de Republicação"</string> + <string name="theme_item_crosspost_icon_tint_detail">"Aplicado a: Ícone de republicação"</string> + <string name="theme_item_stickied_post_icon_tint">"Cor do Ícone de Publicação Afixada"</string> + <string name="theme_item_stickied_post_icon_tint_detail">"Aplicado a: Ícone de Publicação Afixada"</string> + <string name="theme_item_subscribed_color">"Membro"</string> + <string name="theme_item_subscribed_color_detail">"Aplicado a: Botão cancelar adesão"</string> + <string name="theme_item_unsubscribed_color">"Cancelar Adesão"</string> + <string name="theme_item_unsubscribed_color_detail">"Aplicado a: Botão aderir"</string> + <string name="theme_item_username_color">"Cor do Nome de Utilizador"</string> + <string name="theme_item_username_color_detail">"Aplicado a: Nome de Utilizador"</string> + <string name="theme_item_subreddit_color">"Cor das Comunidades"</string> + <string name="theme_item_subreddit_color_detail">"Aplicado a: Nome da Comunidade"</string> + <string name="theme_item_author_flair_text_color">"Cor de Flair de Autor"</string> + <string name="theme_item_author_flair_text_color_detail">"Aplicado a: Flair de Autor nos Comentários"</string> + <string name="theme_item_submitter_color">"Autor"</string> + <string name="theme_item_submitter_color_detail">"Autor nos comentários"</string> + <string name="theme_item_moderator_color">"Moderador"</string> + <string name="theme_item_moderator_color_detail">"Aplicado a: Moderador nos comentários"</string> + <string name="theme_item_single_comment_thread_background_color">"Cor de Fundo de Comentário Único"</string> + <string name="theme_item_single_comment_thread_background_color_detail">"Aplicado a: Comentário Único"</string> + <string name="theme_item_unread_message_background_color">"Cor de Fundo de Mensagem Não Lida"</string> + <string name="theme_item_unread_message_background_color_detail">"Aplicado a: Cor de Fundo de Mensagem Não Lida"</string> + <string name="theme_item_divider_color">"Cor do Separador"</string> + <string name="theme_item_divider_color_detail">"Aplicado a: Separador de comentários, separadores nas páginas de publicações submetidas, etc."</string> + <string name="theme_item_vote_and_reply_unavailable_button_color">"Cor dos Botões de Voto e Resposta Indisponíveis"</string> + <string name="theme_item_vote_and_reply_unavailable_button_color_detail">"Aplicado a: Botões de Voto e Resposta (Indisponível)"</string> + <string name="theme_item_comment_vertical_bar_color_1">"Cor Da Barra Vertical de Comentário 1"</string> + <string name="theme_item_comment_vertical_bar_color_1_detail">"Aplica a: Cor Da Barra Vertical de Comentário (Nível 1)"</string> + <string name="theme_item_comment_vertical_bar_color_2">"Cor Da Barra Vertical de Comentário 2"</string> + <string name="theme_item_comment_vertical_bar_color_2_detail">"Aplica a: Cor Da Barra Vertical de Comentário (Nível 2)"</string> + <string name="theme_item_comment_vertical_bar_color_3">"Cor Da Barra Vertical de Comentário 3"</string> + <string name="theme_item_comment_vertical_bar_color_3_detail">"Aplica a: Cor Da Barra Vertical de Comentário (Nível 3)"</string> + <string name="theme_item_comment_vertical_bar_color_4">"Cor Da Barra Vertical de Comentário 4"</string> + <string name="theme_item_comment_vertical_bar_color_4_detail">"Aplica a: Cor Da Barra Vertical de Comentário (Nível 6)"</string> + <string name="theme_item_comment_vertical_bar_color_5">"Cor Da Barra Vertical de Comentário 5"</string> + <string name="theme_item_comment_vertical_bar_color_5_detail">"Aplica a: Cor Da Barra Vertical de Comentário (Nível 5)"</string> + <string name="theme_item_comment_vertical_bar_color_6">"Cor Da Barra Vertical de Comentário 6"</string> + <string name="theme_item_comment_vertical_bar_color_6_detail">"Aplica a: Cor Da Barra Vertical de Comentário (Nível 6)"</string> + <string name="theme_item_comment_vertical_bar_color_7">"Cor Da Barra Vertical de Comentário 7"</string> + <string name="theme_item_comment_vertical_bar_color_7_detail">"Aplica a: Cor Da Barra Vertical de Comentário (Nível 7)"</string> + <string name="theme_item_nav_bar_color">"Cor da Barra de Ñavegação"</string> + <string name="theme_item_nav_bar_color_detail">"Aplicado a: Barra de navegação"</string> + <string name="theme_item_light_status_bar">"Cor do Ícone da Barra de Estado Escura"</string> + <string name="theme_item_light_nav_bar">"Cor do Ícone da Barra de Navegação Escura"</string> + <string name="theme_item_change_status_bar_icon_color_after_toolbar_collapsed_in_immersive_interface">"Alterar a Cor do Ícone da Barra de Estado após colapso da Barra de Ferramentas na Interface Imersiva"</string> + <string name="theme_item_available_on_android_8">"Disponível apenas para Android 8.0 ou posterior."</string> + <string name="theme_item_available_on_android_6">"Disponível apenas para Android 6.0 ou posterior."</string> + <string name="predefined_themes">"Temas Pré-definidos"</string> + <string name="user_themes">"Os Seus Temas"</string> + <string name="no_theme_name">"Qual é o nome deste tema?"</string> + <string name="theme_name_hint">"Nome do Tema"</string> + <string name="theme_name_indigo">"Indigo"</string> + <string name="theme_name_indigo_dark">"Indigo Escuro"</string> + <string name="theme_name_indigo_amoled">"Indigo Amoled"</string> + <string name="theme_name_white">"Branco"</string> + <string name="theme_name_white_dark">"Branco Escuro"</string> + <string name="theme_name_white_amoled">"Branco Amoled"</string> + <string name="theme_name_red">"Vermelho"</string> + <string name="theme_name_red_dark">"Vermelho Escuro"</string> + <string name="theme_name_red_amoled">"Vermelho Amoled"</string> + <string name="theme_name_dracula">"Drácula"</string> + <string name="theme_name_calm_pastel">"Pastel Calmo"</string> + <string name="create_light_theme">"Criar Tema Claro +com base no Tema Indigo"</string> + <string name="create_dark_theme">"Criar Tema Claro +com base no Tema Indigo Escuro"</string> + <string name="create_amoled_theme">"Criar Tema Amoled +com base no Tema Indigo Amoled"</string> + <string name="create_theme_info">"Caso deseje criar um tema baseado noutro tema, clique no botão \"+\" do tema."</string> + <string name="edit_theme_name">"Editar Nome do Tema"</string> + <string name="edit_theme">"Editar Tema"</string> + <string name="delete_theme">"Eliminar Tema"</string> + <string name="delete_theme_dialog_message">"Tem a certeza que deseja eliminar %1$s?"</string> + <string name="share_theme">"Partilhar Tema"</string> + <string name="change_theme_name">"Alterar Nome"</string> + <string name="theme_copied">"Copiado! Cole e partilhe-o com outras pessoas."</string> + <string name="copy_theme_faied">"Não foi possível copiar as configurações do tema"</string> + <string name="cannot_find_theme">"Tema não encontrado"</string> + <string name="import_theme">"Importar Tema"</string> + <string name="no_data_in_clipboard">"Não foram encontrados dados na área de transferência"</string> + <string name="import_theme_success">"Tema importado com sucesso"</string> + <string name="parse_theme_failed">"Análise ao Tema Falhou"</string> + <string name="duplicate_theme_name_dialog_title">"Encontrado Tema Duplicado"</string> + <string name="duplicate_theme_name_dialog_message">"Já existe um tema na base de dados com o nome %1$s. Deseja alterar o nome do tema importado?"</string> + <string name="rename">"Renomear"</string> + <string name="override">"Substituir"</string> + <string name="color_picker">"Seletor de Cores"</string> + <string name="invalid_color">"Cor Inválida"</string> + + <!-- Fuzzy --> + <string name="delete_all_subreddits_success">"Todas as comunidades foram eliminados com sucesso"</string> + <string name="delete_all_users_success">"Todos os utilizadores eliminados com sucesso"</string> + <string name="delete_all_sort_types_success">"Todos os tipos de ordenação eliminados com sucesso"</string> + <string name="delete_all_post_layouts_success">"Todas as visualizações eliminadas com sucesso"</string> + <string name="delete_all_themes_success">"Todos os temas eliminados com sucesso"</string> + <string name="delete_all_front_page_scrolled_positions_success">"Eliminação das posições de deslizamento com sucesso"</string> + <string name="reset_all_settings_success">"Todas as definições repostas com sucesso"</string> + <string name="username_preview">"u/Hostilenemy"</string> + <string name="subreddit_preview">"r/Infinity_For_Reddit"</string> + <string name="primary_text_preview">"Texto Principal"</string> + <string name="secondary_text_preview">"Texto Secundário"</string> + <string name="post_title_preview">"Isto é uma publicação"</string> + <string name="post_content_preview">"Esta piada da Lei da Gravida é velha, mas apanha-me sempre."</string> + <string name="post_type_preview">"PUBLICAÇÃO"</string> + <string name="flair_preview">"Flair"</string> + <string name="awards_preview">"4 Prémios"</string> + <string name="author_flair_preview">"Flair do Autor"</string> + <string name="comment_content_preview">"Arranjei um cartão a desejar as \"Melhoras\" à minha namorada. +Ela não está doente nem nada, mas certamente poderá melhorar."</string> + <string name="edit_multi_reddit">"Editar Multireddit"</string> + <string name="delete_multi_reddit">"Eliminar Multireddit"</string> + <string name="n_awards">"%1$d Prémios"</string> + <string name="one_award">"1 Prémio"</string> + <string name="report">"Denunciar"</string> + <string name="reporting">"A denunciar"</string> + <string name="report_successful">"Denunciado"</string> + <string name="report_failed">"Falhou ao denunciar"</string> + <string name="report_reason_not_selected">"Não selecionou uma razão"</string> + <string name="report_reason_general_spam">"Isto é 'Spam'"</string> + <string name="report_reason_general_copyright_issue">"Contém Problemas de Direitos de Autor"</string> + <string name="report_reason_general_child_pornography">"Contém Pornografia Infantil"</string> + <string name="report_reason_general_abusive_content">"Contém Conteúdo Abusivo"</string> + <string name="home">"Início"</string> + <string name="popular">"Popular"</string> + <string name="notifications">"Notificações"</string> + <string name="messages">"Mensagens"</string> + <string name="message">"Mensagem"</string> + <string name="fetch_gfycat_video_failed">"Falha ao obter vídeo do Gfycat"</string> + <string name="fetch_redgifs_video_failed">"Falha ao obter vídeo do Redgifs"</string> + <string name="fetching_video_info_please_wait">"A obter informações do vídeo. Aguarde."</string> + <string name="error_fetching_imgur_media">"Impossível carregar imagens"</string> + <string name="downloading_reddit_video">"A transferir faixa de vídeo"</string> + <string name="downloading_reddit_video_audio_track">"A transferir faixa de aúdio"</string> + <string name="downloading_reddit_video_muxing">"A multiplexar Vídeo e Aúdio"</string> + <string name="downloading_reddit_video_save_file_to_public_dir">"A guardar vídeo"</string> + <string name="downloading_reddit_video_finished">"Transferido"</string> + <string name="downloading_reddit_video_failed_cannot_get_cache_directory">"A transferência falhou: não é possível aceder à diretoria cache"</string> + <string name="downloading_reddit_video_failed_cannot_download_video">"A transferência falhou: não é possível transferir o vídeo"</string> + <string name="downloading_reddit_video_failed_cannot_save_video">"A transferência falhou: não é possível guardar o vídeo na diretoria cache"</string> + <string name="downloading_reddit_video_failed_cannot_save_audio">"A transferência falhou: não é possível guardar o aúdio na diretoria cache"</string> + <string name="downloading_reddit_video_failed_cannot_mux">"A transferência falhou: não foi possível multiplexar o vídeo e o áudio"</string> + <string name="downloading_reddit_video_failed_cannot_save_mux_video">"A transferência falhou: não foi possível guardar o vídeo na diretoria pública"</string> + <string name="wallpaper_set">"Definir como imagem de fundo"</string> + <string name="error_set_wallpaper">"Não foi possível definir a imagem de fundo"</string> + <string name="set_to_home_screen">"Ecrã Principal"</string> + <string name="set_to_lock_screen">"Ecrã de Bloqueio"</string> + <string name="set_to_both">"Ambos"</string> + <string name="default_font_font_preview">"Padrão"</string> + <string name="load_video_in_redgifs">"Tente carregar o vídeo no Redgifs"</string> + <string name="top_score">"%1$s pontos"</string> + <string name="login_activity_2fa_prompt">"Caso tenha autenticação de 2 fatores ativada, por favor introduza a palavra-passe da seguinte forma: <palavra-passe>:<código 2FA>. +Exemplo: asuapasse:123456"</string> + <string name="block_user">"Bloquear Utilizador"</string> + <string name="block_user_success">"Bloqueado"</string> + <string name="block_user_failed">"Falha a bloquear utilizador"</string> + <string name="submit_crosspost_activity_label">"Republicar"</string> + <string name="give_award_activity_label">"Premiar"</string> + <string name="action_crosspost">"Republicar"</string> + <string name="action_select_user_flair">"Selecionar Flair de Utilizador"</string> + <string name="action_give_award">"Premiar"</string> + <string name="posts">"Publicações"</string> + <string name="sidebar">"Barra Lateral"</string> + <string name="only_for_logged_in_user">"Apenas para Utilizadores com Sessão Iniciada"</string> + <string name="settings_number_of_columns_in_post_feed_title">"Número de Colunas no Feed de Publicações"</string> + <string name="settings_number_of_columns_in_post_feed_portrait_title">"Retrato"</string> + <string name="settings_number_of_columns_in_post_feed_landscape_title">"Paisagem"</string> + <string name="settings_nsfw_and_spoiler_title">"18+ & Spoiler"</string> + <string name="settings_delete_all_legacy_settings_title">"Eliminar Todas as Definições Datadas"</string> + <string name="restart_app_see_changes">"Reinicie a aplicação para ver as alterações"</string> + <string name="settings_tab_count">"Número de Separadores"</string> + <string name="settings_show_tab_names">"Mostrar o Nome dos Separadores"</string> + <string name="settings_more_tabs_summary">"Mais Separadores"</string> + <string name="settings_more_tabs_info_summary">"Ativar as seguintes opções poderá causar um comportamento inesperado: +Os separadores poderão perder todo o conteúdo após alternar entre outros. É o mesmo que recarregar a página."</string> + <string name="settings_more_tabs_show_favorite_subscribed_subreddits_title">"Mostrar Comunidades Subscritas Favoritas"</string> + <string name="settings_more_tabs_show_subscribed_subreddits_title">"Mostrar Comunidades Subscritas"</string> + <string name="settings_download_location_title">"Localização para Transferências"</string> + <string name="settings_image_download_location_title">"Localização de Transferência de Imagens"</string> + <string name="settings_gif_download_location_title">"Localização para Transferência de GIFs"</string> + <string name="settings_video_download_location_title">"Localização para Transferência de Vídeos"</string> + <string name="settings_separate_folder_for_each_subreddit">"Separar por Pasta de Cada Comunidade"</string> + <string name="settings_swipe_action_title">"Ação de Deslizamento"</string> + <string name="settings_disable_swiping_between_tabs_title">"Desativar Deslizar entre Separadores"</string> + <string name="settings_enable_swipe_action_title">"Ativar Ação Deslizar"</string> + <string name="settings_swipe_action_threshold">"Valor limite"</string> + <string name="settings_pull_to_refresh_title">"Puxe para Atualizar"</string> + <string name="settings_security_title">"Segurança"</string> + <string name="settings_require_authentication_to_go_to_account_section_in_navigation_drawer_title">"Requer Autenticação para Ir à Secção de Conta na Gaveta de Navegação"</string> + <string name="settings_long_press_to_hide_toolbar_in_compact_layout_title">"Pressionar longo para Esconder Barra de Ferramentas"</string> + <string name="settings_post_compact_layout_toolbar_hidden_by_default_title">"Esconder Barra de Ferramentas por Defeito"</string> + <string name="settings_customize_bottom_app_bar_title">"Personalizar Barra de Navegação Inferior"</string> + <string name="settings_main_activity_bottom_app_bar_group_summary">"Página Principal"</string> + <string name="settings_other_activities_bottom_app_bar_group_summary">"Outras Páginas"</string> + <string name="settings_bottom_app_bar_option_count">"Número de Opções"</string> + <string name="settings_bottom_app_bar_option_1">"Opção 1"</string> + <string name="settings_bottom_app_bar_option_2">"Opção 2"</string> + <string name="settings_bottom_app_bar_option_3">"Opção 3"</string> + <string name="settings_bottom_app_bar_option_4">"Opção 4"</string> + <string name="settings_bottom_app_bar_fab">"Botão de Ação Flutuante"</string> + <string name="settings_data_saving_mode">"Modo de Poupança de Dados"</string> + <string name="settings_data_saving_mode_info_summary">"No modo de poupança de dados: +Pré-visualização de imagens em baixa resolução. +Vídeos do Reddit em baixa resolução. +Reprodução automática de vídeos desativada."</string> + <string name="settings_translation_title">"Tradução"</string> + <string name="settings_translation_summary">"Traduzir esta aplicação no POEditor. Obrigado a todos os colaboradores."</string> + <string name="settings_credits_national_flags">"Bandeiras Nacionais"</string> + <string name="settings_credits_national_flags_summary">"Ícone criado por Freepik da www.flaticon.com"</string> + <string name="copy_failed">"A cópia falhou"</string> + <string name="delete_all_legacy_settings_success">"A eliminação das definições antigas foi bem sucedida"</string> + <string name="downloading_media_finished">"Transferido"</string> + <string name="downloading_image_or_gif_failed_cannot_get_destination_directory">"A transferência falhou: não é possível aceder ao diretório de destino"</string> + <string name="downloading_media_failed_cannot_download_media">"A transferência falhou"</string> + <string name="downloading_media_failed_cannot_save_to_destination_directory">"A transferência falhou: não é possível guardar o ficheiro no diretório de destino"</string> + <string name="view_full_comment_markdown">"Ver Markdown Completo"</string> + <string name="select_user_flair_success">"Flair de Utilizador Selecionado"</string> + <string name="select_this_user_flair">"Selecionar este flair de utilizador?"</string> + <string name="select_header_size">"Selecionar Tamanho do Cabeçalho"</string> + <string name="large">"Grande"</string> + <string name="small">"Pequeno"</string> + <string name="insert_link">"Inserir Ligação"</string> + <string name="text_hint">"Texto"</string> + <string name="link_hint">"Ligação"</string> + <string name="unlock_account_section">"Desbloquear Secção de Conta"</string> + <string name="unlock">"Desbloquear"</string> + <string name="submit_post">"Submeter Publicação"</string> + <string name="refresh">"Atualizar"</string> + <string name="change_sort_type">"Alterar Tipo de Ordenação"</string> + <string name="change_post_layout">"Alterar Visualização de Publicações"</string> + <string name="give_award_dialog_title">"Premiar?"</string> + <string name="anonymous">"Anónimo"</string> + <string name="give_award_error_message">"Código: %1$d/ +Mensagem: %2$s"</string> + <string name="give_award_success">"Prémio oferecido"</string> + <string name="give_award_failed">"Falhou"</string> + <string name="warning">"Aviso"</string> + <string name="this_is_a_nsfw_subreddit">"Esta é uma comunidade 18+."</string> + <string name="this_user_has_nsfw_content">"Este utilizador tem conteúdo 18+"</string> + <string name="dismiss">"Descartar"</string> + <string name="leave">"Sair"</string> + <string name="go_to_subreddit">"Ir para a Comunidade"</string> + <string name="go_to_user">"Ir para o Utilizador"</string> + <string name="go_to_thing_hint">"Nome"</string> + <string name="random">"Aleatório"</string> + <string name="random_subreddit">"Comunidade Aleatória"</string> + <string name="random_nsfw_subreddit">"Comunidade 18+ Aleatória"</string> + <string name="random_post">"Publicação Aleatória"</string> + <string name="random_nsfw_post">"Publicação 18+ Aleatória"</string> + <string name="fetch_random_thing_failed">"Tente novamente mais tarde"</string> + <string name="downloading">"A transferir"</string> + <string name="subreddit_filter_popular_and_all_activity_label">"r/all e r/popular"</string> + <string name="settings_miscellaneous_title">"Diversos"</string> + <string name="settings_respect_subreddit_recommended_comment_sort_type_title">"Respeitar Tipo de Ordenação de Comentários Recomendada pela Comunidade"</string> + <string name="settings_respect_subreddit_recommended_comment_sort_type_summary">"Tipo de ordenação de comentários não será guardada"</string> + <string name="settings_subreddit_filter_category">"Esconder Comunidades"</string> + <string name="settings_subreddit_filter_popular_and_all">"Em r/popular e r/all"</string> + <string name="settings_credits_ufo_capturing_animation_title">"Animação UFO Capturing"</string> + <string name="select_video_quality">"Escolher Qualidade de Vídeo"</string> + <string name="settings_swipe_action_haptic_feedback_title">"Feedback táctil"</string> + <string name="settings_hide_subreddit_description_title">"Esconder Descrição da Comunidade"</string> + <string name="settings_disable_image_preview_title">"Desativar Pré-visualização de Imagens no Modo de Poupança de Dados"</string> + <string name="settings_swipe_action_swipe_left_title">"Deslizar para a Esquerda"</string> + <string name="settings_swipe_action_swipe_right_title">"Deslizar para a Direita"</string> + <string name="settings_swipe_action_info_summary">"Não aplicável ao feed de publicações com mais que uma coluna ou detalhes de publicação."</string> + <string name="theme_item_no_preview_post_type_icon_tint">"Cor do Ícone do Tipo de Publicação sem Pré-visualização"</string> + <string name="theme_item_no_preview_post_type_background_color">"Cor de fundo do post de tipo sem-preview"</string> + <string name="settings_language_title">"Idioma"</string> + <string name="customize_post_filter_activity_label">"Personalizar Filtro de Publicações"</string> + <string name="filtered_posts_activity_subtitle">"Publicações Filtradas"</string> + <string name="post_filter_preference_activity_label">"Filtro de Publicações"</string> + <string name="search_users_result_activity_label">"Utilizadores"</string> + <string name="multireddit_selection_activity_label">"Escolher um Multireddit"</string> + <string name="action_save_to_database">"Guardar na Base de Dados"</string> + <string name="action_read_all_messages">"Ler Todas as Mensagens"</string> + <string name="action_add_to_multireddit">"Adicionar ao Multireddit"</string> + <string name="search_only_subreddits_hint">"Pesquisar comunidades"</string> + <string name="search_only_users_hint">"Pesquisar utilizadores"</string> + <string name="post_type_gif">"Gif"</string> + <string name="post_type_gallery">"Galeria"</string> + <string name="settings_disable_immersive_interface_in_landscape_mode">"Desativar Interface Imersiva no Modo Paisagem"</string> + <string name="settings_privacy_policy_title">"Política de Privacidade"</string> + <string name="settings_delete_read_posts_in_database_title">"Eliminar Todas as publicações lidas da BD"</string> + <string name="settings_post_filter_title">"Filtros de Publicações"</string> + <string name="settings_only_disable_preview_in_video_and_gif_posts_title">"Desativar Pré-visualização apenas a Publicações Vídeo e GIF"</string> + <string name="settings_enable_search_history_title">"Ativar Histórico de Pesquisa"</string> + <string name="settings_post_history_title">"Histórico de Pesquisa"</string> + <string name="settings_mark_posts_as_read_title">"Marcar Publicação como Lida"</string> + <string name="settings_mark_posts_as_read_after_voting_title">"Marcar Publicação como Lida após Votar"</string> + <string name="settings_mark_posts_as_read_on_scroll_title">"Marcar Publicações como Lidas ao Deslizar"</string> + <string name="settings_hide_read_posts_automatically_title">"Esconder Publicações Lidas Automaticamente"</string> + <string name="settings_sort_type_title">"Tipo de Ordenação"</string> + <string name="settings_save_sort_type_title">"Guardar Tipo de Ordenação"</string> + <string name="settings_subreddit_default_sort_type_title">"Ordenação Padrão das Comunidades"</string> + <string name="settings_subreddit_default_sort_time_title">"Ordenação Temporal Padrão das Comunidades"</string> + <string name="settings_user_default_sort_type_title">"Ordenação Padrão de Utilizador"</string> + <string name="settings_user_default_sort_time_title">"Ordenação Temporal Padrão do Utilizador"</string> + <string name="open_link">"Abrir Ligação"</string> + <string name="select_subreddits_and_users">"Selecione Comunidades e Utilizadores"</string> + <string name="theme_item_read_post_title_color">"Cor do Título de Publicação Lida"</string> + <string name="theme_item_read_post_title_color_detail">"Aplicado a: Título de publicação lida"</string> + <string name="theme_item_read_post_content_color">"Cor de Conteúdo de Publicação Lida"</string> + <string name="theme_item_read_post_content_color_detail">"Aplicado a: Conteúdo de publicação lida"</string> + <string name="theme_item_read_post_card_view_background_color">"Cor de Fundo de Publicação Lida em Cartão"</string> + <string name="theme_item_read_post_card_view_background_color_detail">"Aplicado a: Fundo de publicação lida"</string> + <string name="delete_all_read_posts_success">"Todas publicações lidas eliminadas com sucesso"</string> + <string name="hide_read_posts">"Esconder Publicações Lidas"</string> + <string name="filter_posts">"Filtrar Publicações"</string> + <string name="only_nsfw">"Apenas 18+"</string> + <string name="only_spoiler">"Apenas Spoiler"</string> + <string name="title_excludes_strings_hint">"Título: excluir palavras-chave (palavra1,palavra2)"</string> + <string name="title_excludes_regex_hint">"Título: excluir expressões regulares"</string> + <string name="exclude_subreddits_hint">"Excluir comunidades (ex.: funny,AskReddit)"</string> + <string name="exclude_users_hint">"Excluir utilizadores (ex.: Hostilenemy,random)"</string> + <string name="exclude_flairs_hint">"Excluir flairs (ex.: flair1, flair2)"</string> + <string name="contain_flairs_hint">"Contém flairs (ex.: flair1, flair2)"</string> + <string name="min_vote_hint">"Mínimo de votos (-1: sem restrição)"</string> + <string name="max_vote_hint">"Máximo de votos (-1: sem restrição)"</string> + <string name="min_comments_hint">"Mínimo de comentários (-1: sem restrição)"</string> + <string name="max_comments_hint">"Máximo de comentários (-1: sem restrição)"</string> + <string name="min_awards_hint">"Mínimo de prémios (-1: sem restrição)"</string> + <string name="max_awards_hint">"Máximo de prémios (-1: sem restrição)"</string> + <string name="post_filter_name_hint">"Nome do Filtro de Publicação"</string> + <string name="post_filter_requires_a_name">"Qual é o nome deste Filtro de Publicações?"</string> + <string name="duplicate_post_filter_dialog_title">"'%1$s' já existe"</string> + <string name="duplicate_post_filter_dialog_message">"Substituir?"</string> + <string name="apply_post_filter_to">"Aplicar a"</string> + <string name="post_filter_usage_home">"Início"</string> + <string name="post_filter_usage_subreddit">"Comunidade: %1$s"</string> + <string name="post_filter_usage_subreddit_all">"Comunidade"</string> + <string name="post_filter_usage_user">"Utilizador: %1$s"</string> + <string name="post_filter_usage_user_all">"Utilizador"</string> + <string name="post_filter_usage_multireddit">"MultiReddit: %1$s"</string> + <string name="post_filter_usage_multireddit_all">"MultiReddit"</string> + <string name="post_filter_usage_search">"Pesquisar"</string> + <string name="subreddit">"Comunidade"</string> + <string name="user">"Utilizador"</string> + <string name="edit_post_filter_name_of_usage_info">"Deixar em branco para aplicar este filtro de publicação a todos os utilizadores / comunidades / multireddit"</string> + <string name="read_all_messages_time_limit">"Está a repetir esta ação com demasiada frequência. Tente novamente mais tarde. Este é o valor limite da API do Reddit."</string> + <string name="read_all_messages_success">"Todas as mensagens lidas com sucesso"</string> + <string name="read_all_messages_failed">"Não é possível ler todas as mensagens"</string> + <string name="add_subreddit_or_user_to_multireddit_success">"%1$s foi adicionado ao multireddit %2$s"</string> + <string name="add_subreddit_or_user_to_multireddit_failed">"Não é possível adicionar %1$s ao multireddit %2$s"</string> + <string name="choose_a_user">"Escolher um utilizador"</string> + <string name="settings_click_to_show_media_in_gallery_layout">"Clicar para Mostrar Média na Visualização Galeria"</string> + <string name="settings_hide_post_type">"Esconder Tipo de Publicação"</string> + <string name="settings_hide_the_number_of_awards">"Esconder Número de Prémios"</string> + <string name="settings_hide_subreddit_and_user_prefix">"Esconder Prefixos de Comunidades e Utilizador"</string> + <string name="settings_hide_the_number_of_votes">"Esconder Número de Votos"</string> + <string name="settings_hide_the_number_of_comments">"Esconder Número de Comentários"</string> + <string name="post_layout_gallery">"Galeria"</string> + <string name="post_layout_card_2">"Cartão 2"</string> + <string name="have_trouble_login_title">"Dificuldades ao Iniciar Sessão"</string> + <string name="have_trouble_login_message">"Quer tentar iniciar sessão de outra forma?"</string> + <string name="vote">"Votar"</string> + <string name="action_share_link">"Partilhar Ligação"</string> + <string name="action_copy_link">"Copiar Ligação"</string> + <string name="action_add_to_post_filter">"Adicionar ao Filtro de Publicações"</string> + <string name="settings_do_not_blur_nsfw_in_nsfw_subreddits_title">"Não desfocar Imagens 18+ em Comunidades 18+"</string> + + <!-- Fuzzy --> + <string name="settings_show_avatar_on_the_right">"Mostrar Avatar à Esquerda"</string> + <string name="settings_backup_settings_title">"Cópia de Segurança das Definições"</string> + <string name="settings_restore_settings_title">"Restaurar Definições"</string> + <string name="settings_credits_love_animation_title">"Animação Love"</string> + <string name="settings_swipe_between_posts_title">"Deslizar entre Publicações"</string> + <string name="settings_navigation_drawer_title">"Gaveta de Navegação"</string> + <string name="settings_collapse_account_section_title">"Colapsar Secção de Conta"</string> + <string name="settings_collapse_post_section_title">"Colapsar Secção de Publicações"</string> + <string name="settings_collapse_preferences_section_title">"Colapsar Secção de Preferências"</string> + <string name="settings_collapse_favorite_subreddits_section_title">"Colapsar Secção de Comunidades Favoritas"</string> + <string name="settings_collapse_subscribed_subreddits_section_title">"Colapsar Secção de Comunidades Subscritas"</string> + <string name="settings_hide_favorite_subreddits_sections_title">"Esconder Secção de Comunidades Favoritas"</string> + <string name="settings_hide_subscribed_subreddits_sections_title">"Esconder Secção de Comunidades Subscritas"</string> + <string name="settings_default_search_result_tab">"Separador do Resultado de Pesquisas Padrão"</string> + <string name="device_default">"Padrão do dispositivo"</string> + <string name="set_by_battery_saver">"Definido por Poupança de Bateria"</string> + <string name="theme_item_upvote_ratio_icon_tint">"Cor do Ícone do Rácio de Votos Positivos"</string> + <string name="theme_item_upvote_ratio_icon_tint_detail">"Aplicado ao: Ícone do rácio de votos positivos"</string> + <string name="theme_item_current_user_color">"Utilizador Atual"</string> + <string name="theme_item_current_user_color_detail">"Aplicado a: Utilizador atual nos comentários"</string> + <string name="exclude_domains_hint">"Excluir Domínios"</string> + <string name="anonymous_front_page_no_subscriptions">"Comece por se juntar a uma comunidade!"</string> + <string name="backup_settings_success">"As definições foram exportadas para o diretório de destino com sucesso. A palavra-chave do ficheiro zip gerado é 123321. Por favor não modifique o ficheiro zip."</string> + <string name="create_zip_in_destination_directory_failed">"Não foi possível criar a cópia de segurança zip no diretório de destino"</string> + <string name="backup_some_settings_failed">"Não foi possível copiar algumas definições mas outras foram exportadas com sucesso para o diretório de destino"</string> + <string name="restore_settings_success">"Definições restauradas com sucesso. Reinicie a aplicação para ver as alterações."</string> + <string name="restore_settings_partially_failed">"Algumas definições poderão não ter sido restauradas com sucesso. Reinicie a aplicação para ver as alterações."</string> + <string name="restore_settings_failed_file_corrupted">"Não é possível restaurar as definições. O ficheiro poderá estar corrompido. "</string> + <string name="restore_settings_failed_cannot_get_file">"Não é possível aceder ao ficheiro"</string> + <string name="suicide_prevention_quote">"Se está a procura de um sinal para não se suicidar, isto é o sinal.\u2764"</string> + <string name="do_not_show_this_again">"Não mostrar novamente"</string> + <string name="continue_suicide_prevention_activity">"Continuar"</string> + <string name="error_fetching_v_redd_it_video_cannot_get_redirect_url">"Erro ao obter vídeo v.redd.it: Não é possível obter o url de redirecionamento"</string> + <string name="error_fetching_v_redd_it_video_cannot_get_post">"Erro ao obter vídeo v.redd.it: Não é possível obter a publicação"</string> + <string name="error_fetching_v_redd_it_video_cannot_get_post_id">"Erro ao obter vídeo v.redd.it: Não é possível obter o id da publicação"</string> + <string name="always_on">"Sempre ligado"</string> + <string name="only_on_wifi">"Apenas em WiFi"</string> + <string name="never">"Nunca"</string> + <string name="normal">"Normal"</string> + <string name="extra_large">"Grande"</string> + <string name="enormously_large">"Enorme"</string> + <string name="default_in_array">"Padrão"</string> + <string name="off">"Desligado"</string> + <string name="only_on_cellular_data">"Apenas em dados móveis"</string> + <string name="upvote">"Voto Positivo"</string> + <string name="downvote">"Voto Negativo"</string> + <string name="select">"Selecionar"</string> + <string name="exclude_subreddit">"Excluir esta comunidade"</string> + <string name="exclude_user">"Excluir este utilizador"</string> + <string name="exclude_flair">"Excluir esta flair"</string> + <string name="contain_flair">"Contém esta flair"</string> + <string name="exclude_domain">"Excluir Domínio"</string> + <string name="suggest_title">"Sugerir Título"</string> + <string name="suggest_title_failed">"Falha ao sugerir título"</string> + <string name="action_delete_logs">"Eliminar Logs"</string> + <string name="inbox_with_count">"Caixa de Entrada (%1$d)"</string> + <string name="comment_continue_thread">"Continuar"</string> + + <!-- Fuzzy --> + <string name="settings_swipe_vertically_to_go_back_from_media_title">"Deslize Verticalmente para Sair dos Média"</string> + <string name="settings_hide_post_flair">"Esconder Flair da Publicação"</string> + <string name="settings_crash_reports_title">"Relatório de Falhas"</string> + <string name="settings_nsfw_and_spoiler_dangerous_group_title">"Perigoso"</string> + <string name="settings_disable_nsfw_forever_title">"Desativar 18+ para Sempre"</string> + <string name="settings_show_only_one_comment_level_indicator">"Mostrar Apenas Um Indicador do Nível de Comentário"</string> + <string name="save_comment">"Guardar"</string> + <string name="unsave_comment">"Esquecer"</string> + <string name="copy_multi_reddit_path">"Copiar Caminho do Multireddit"</string> + <string name="copy_multi_reddit_path_failed">"Não é possível copiar o caminho do multireddit"</string> + <string name="crash_reports_deleted">"Os relatórios de erros eliminados"</string> + <string name="disable_nsfw_forever_message">"Uma vez ativo, todo o conteúdo impróprio será desativado permanentemente, quer a definição de conteúdo 18+ esteja ativa ou não. Esta configuração é irreversível e a única maneira de reativar conteúdo 18+ é limpando os dados da aplicação. + +Ainda deseja ativar esta opção?"</string> + <string name="reply">"Responder"</string> + <string name="rpan_activity_label">"RPAN"</string> + <string name="post_gallery_activity_label">"Publicação de Galeria"</string> + <string name="trending_activity_label">"Tendências"</string> + <string name="action_share_rpan_link">"Partilhar Endereço RPAN"</string> + <string name="action_share_post_link">"Partilhar Endereço da Publicação"</string> + <string name="rpan">"RPAN"</string> + <string name="trending">"Tendências"</string> + <string name="receive_post_reply_notifications">"Receber notificações de respostas de publicações"</string> + <string name="bottom_sheet_post_gallery">"Galeria"</string> + <string name="posting_gallery">"A Publicar Galeria"</string> + <string name="label_reddit">"Reddit"</string> + <string name="settings_default_link_post_layout">"Disposição predefinida de Publicações de Ligação"</string> + <string name="settings_category_material_you_title">"Material You"</string> + <string name="settings_enable_material_you_warning_summary">"Assegure-se de que não tem temas com nome +\"Material You\", +\"Material You Dark\" ou +\"Material You Amoled\" +Caso contrário, altere o nome antes de ativar Material You"</string> + <string name="settings_enable_material_you_title">"Ativar Material You"</string> + <string name="settings_enable_material_you_summary">"Personalizar Infinity baseado na imagem de fundo"</string> + <string name="settings_apply_material_you_title">"Aplicar Material You"</string> + <string name="settings_apply_material_you_summary">"Em caso do Infinity não alterar o tema"</string> + <string name="settings_more_tabs_show_favorite_multireddits_title">"Mostrar MultiReddit Favorito"</string> + <string name="settings_more_tabs_show_multireddits_title">"Mostrar MultiReddit"</string> + <string name="settings_collapse_reddit_section_title">"Recolher Secção do Reddit"</string> + <string name="settings_video_player_automatic_landscape_orientation">"Alterar para Orientação Paisagem automaticamente no Reprodutor de Vídeo"</string> + <string name="settings_remember_muting_option_in_post_feed">"Lembrar opção sem som no Feed de Publicações"</string> + <string name="link_post_layout_auto">"Auto"</string> + <string name="uploaded_images">"Imagens Enviadas"</string> + <string name="select_image">"Selecionar Imagem"</string> + <string name="capture">"Capturar"</string> + <string name="uploading_image">"A Enviar"</string> + <string name="upload_image_success">"Imagem enviada com sucesso. Clicar no botão da imagem para ver as imagens enviadas."</string> + <string name="get_image_bitmap_failed">"Incapaz de obter o bitmap da imagem"</string> + <string name="upload_image_failed">"Incapaz de enviar a imagem"</string> + <string name="load_rpan_broadcasts_failed">"Não é possível carregar as emissões RPAN"</string> + <string name="parse_rpan_broadcasts_failed">"Não é possível analisar as emissões de RPAN"</string> + <string name="parse_rpan_broadcast_failed">"Não é possível analisar a emissão de RPAN"</string> + <string name="search_comments">"Pesquisar Comentários"</string> + <string name="please_wait_image_is_uploading">"Uma imagem ainda a ser enviada. Por favor aguarde."</string> + <string name="error_fetch_trending_search">"A obtenção de tendências falharam. +Toque para tentar novamente."</string> + <string name="error_parse_trending_search">"Falhou ao analisar a pesquisa de tendências. +Toque para tentar novamente."</string> + <string name="no_trending_search">"Sem tendências encontradas. +Toque para tentar novamente."</string> +</resources>
\ No newline at end of file diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index 74e9adda..f27f6014 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -44,7 +44,7 @@ <string name="action_save_post">"Сохранить пост"</string> <string name="action_view_crosspost_parent">"Посмотреть родительский кросспост"</string> <string name="action_search">"Поиск"</string> - <string name="action_start_lazy_mode">"Активировать ленивый режим"</string> + <string name="action_start_lazy_mode">"Включить ленивый режим"</string> <string name="action_stop_lazy_mode">"Остановить ленивый режим"</string> <string name="action_send">"Отправить"</string> <string name="action_sort">"Сортировать"</string> @@ -64,17 +64,17 @@ <string name="action_share">"Поделиться"</string> <string name="action_preview">"Предпросмотр"</string> <string name="action_report">"Пожаловаться"</string> - <string name="action_see_removed">"Увидеть удаленное"</string> + <string name="action_see_removed">"Увидеть удалённое"</string> <string name="action_set_wallpaper">"Установить как обои"</string> <string name="action_send_private_message">"Отправить личное сообщение"</string> <string name="action_block_user">"Заблокировать пользователя"</string> - <string name="parse_json_response_error">"Произошла ошибка при анализе JSON отчёта"</string> + <string name="parse_json_response_error">"Произошла ошибка при анализе JSON-отчёта"</string> <string name="retrieve_token_error">"Ошибка получения токена"</string> <string name="something_went_wrong">"Что-то пошло не так. Попробуйте позже."</string> <string name="access_denied">"В доступе отказано"</string> <string name="parse_user_info_error">"Произошла ошибка во время обработки информации о пользователе"</string> <string name="no_system_webview_error">"Ошибка открытия системного WebView"</string> - <string name="error_loading_image_tap_to_retry">"Произошла ошибка при загрузке изображения. Нажмите чтобы повторить попытку."</string> + <string name="error_loading_image_tap_to_retry">"Произошла ошибка при загрузке изображения. Нажмите, чтобы повторить попытку."</string> <string name="load_posts_error">"Произошла ошибка при загрузке постов. Нажмите, чтобы повторить попытку."</string> <string name="load_more_posts_error">"Произошла ошибка при загрузке постов."</string> <string name="load_post_error">"Произошла ошибка при загрузке поста. @@ -109,22 +109,22 @@ <string name="subscriptions">"Подписки"</string> <string name="multi_reddit">"Мультиреддит"</string> <string name="inbox">"Входящие"</string> - <string name="upvoted">"Апвоут"</string> - <string name="downvoted">"Даунвоут"</string> + <string name="upvoted">"Голос+"</string> + <string name="downvoted">"Голос-"</string> <string name="hidden">"Скрытые"</string> - <string name="saved">"Сохраненные"</string> + <string name="saved">"Сохранённые"</string> <string name="gilded">"Позолоченные"</string> <string name="settings">"Настройки"</string> <string name="subscribers_number_detail">"Подписчики: %1$d"</string> <string name="online_subscribers_number_detail">"Онлайн: %1$d"</string> - <string name="cannot_fetch_subreddit_info">"Не удаётся получить информацию о сабреддите"</string> - <string name="cannot_fetch_user_info">"Не удаётся получить информацию о пользователе"</string> - <string name="cannot_fetch_sidebar">"Не удаётся получить боковую панель"</string> - <string name="cannot_fetch_multireddit">"Не удаётся получить информацию о мультиреддите"</string> + <string name="cannot_fetch_subreddit_info">"Не удалось получить информацию о сабреддите"</string> + <string name="cannot_fetch_user_info">"Не удалось получить информацию о пользователе"</string> + <string name="cannot_fetch_sidebar">"Не удалось получить боковую панель"</string> + <string name="cannot_fetch_multireddit">"Не удалось получить информацию о мультиреддите"</string> <string name="subscribe">"Подписаться"</string> <string name="unsubscribe">"Отписаться"</string> <string name="subscribed">"Вы подписаны"</string> - <string name="subscribe_failed">"Не удалось подписатся"</string> + <string name="subscribe_failed">"Не удалось подписаться"</string> <string name="unsubscribed">"Вы отписались"</string> <string name="unsubscribe_failed">"Ну удалось отписаться"</string> <string name="follow">"Следить"</string> @@ -133,7 +133,7 @@ <string name="follow_failed">"Не удалось начать следить"</string> <string name="unfollowed">"Вы не следите"</string> <string name="unfollow_failed">"Не удалось перестать следить"</string> - <string name="content_description_banner_imageview">"Изображение баннера сабреддита"</string> + <string name="content_description_banner_imageview">"Изображение банера сабреддита"</string> <string name="app_label">"Infinity"</string> <string name="search_hint">"Ищите что угодно"</string> <string name="no_posts_no_lazy_mode">"Нет доступных постов"</string> @@ -148,7 +148,7 @@ <string name="send_message_subject_hint">"Тема (до 100 знаков)"</string> <string name="send_message_content_hint">"Сообщение"</string> <string name="reply_message_failed">"Не удалось ответить на это сообщение"</string> - <string name="error_getting_message">"Не удалось получить cообщение"</string> + <string name="error_getting_message">"Не удалось получить сообщение"</string> <string name="message_username_required">"А кому вы хотите отправить это сообщение?"</string> <string name="message_subject_required">"Сообщение должно содержать тему"</string> <string name="message_content_required">"А написать содержимое?"</string> @@ -159,13 +159,13 @@ <string name="title_required">"Посту требуется заголовок"</string> <string name="link_required">"А ссылка где?"</string> <string name="select_an_image">"Пожалуйста, сначала выберите изображение"</string> - <string name="posting">"Постим"</string> + <string name="posting">"Публикация"</string> <string name="post_failed">"Не удалось опубликовать пост"</string> <string name="error_processing_image">"Ошибка при обработке изображения"</string> <string name="error_processing_video">"Ошибка при обработке видео"</string> - <string name="download_started">"Загрузка началась. Проверьте уведомления для отслеживания прогресса"</string> + <string name="download_started">"Загрузка началась. Проверьте уведомления для отслеживания прогресса."</string> <string name="comment_load_more_comments">"Загрузить больше комментариев"</string> - <string name="comment_load_more_comments_failed">"Загрузка не удалась. Нажмите для повторной загрузки."</string> + <string name="comment_load_more_comments_failed">"Загрузка не выполнена. Нажмите для повторной загрузки."</string> <string name="loading">"Загрузка"</string> <string name="post_title_hint">"Заголовок"</string> <string name="post_text_content_hint">"Контент"</string> @@ -174,7 +174,7 @@ <string name="post_link_hint">"Ссылка"</string> <string name="subreddits">"Сабреддиты"</string> <string name="users">"Пользователи"</string> - <string name="multi_reddits">"МультиРеддиты"</string> + <string name="multi_reddits">"Мультиреддиты"</string> <string name="bottom_sheet_post_text">"Текст"</string> <string name="bottom_sheet_post_link">"Ссылка"</string> <string name="bottom_sheet_post_image">"Изображение"</string> @@ -185,17 +185,17 @@ <string name="error_getting_video">"Не удалось получить видео"</string> <string name="no_camera_available">"Нет доступных приложений камеры"</string> <string name="error_creating_temp_file">"Не удалось создать временный файл"</string> - <string name="video_is_processing">"Видео обрабатывается. Пожалуйста подождите."</string> - <string name="image_is_processing">"Изображение обрабатывается. Пожалуйста подождите."</string> - <string name="gif_is_processing">"GIF обрабатывается. Пожалуйста подождите."</string> + <string name="video_is_processing">"Видео обрабатывается. Пожалуйста, подождите."</string> + <string name="image_is_processing">"Изображение обрабатывается. Пожалуйста, подождите."</string> + <string name="gif_is_processing">"GIF обрабатывается. Пожалуйста, подождите."</string> <string name="flair">"Стиль"</string> <string name="spoiler">"Спойлер"</string> <string name="no_flair">"Нет стиля"</string> <string name="error_loading_flairs">"Ошибка загрузки стилей. -Тапните, чтобы перезагрузить."</string> +Нажмите, чтобы перезагрузить."</string> <string name="no_rule">"Правил нет"</string> <string name="error_loading_rules">"Ошибка загрузки правил. -Тапните, чтобы перезагрузить."</string> +Нажмите, чтобы перезагрузить."</string> <string name="error_loading_rules_without_retry">"Ошибка загрузки правил"</string> <string name="search_in">"Искать в"</string> <string name="all_subreddits">"Все сабреддиты"</string> @@ -211,7 +211,7 @@ <string name="sort_activity">"Активность"</string> <string name="sort_confidence">"Доверенное"</string> <string name="sort_old">"Старый"</string> - <string name="sort_qa">"ЧАВО"</string> + <string name="sort_qa">"ЧаВО"</string> <string name="sort_live">"Live"</string> <string name="sort_time_hour">"Час"</string> <string name="sort_time_day">"День"</string> @@ -219,10 +219,10 @@ <string name="sort_time_month">"Месяц"</string> <string name="sort_time_year">"Год"</string> <string name="sort_time_all_time">"За всё время"</string> - <string name="no_activity_found_for_share">"Нечем обработать действие Поделиться"</string> + <string name="no_activity_found_for_share">"Нечем обработать действие «Поделиться»."</string> <string name="archived_post_vote_unavailable">"Архивный пост. Голосование недоступно."</string> <string name="archived_post_comment_unavailable">"Архивный пост. Комментирование недоступно."</string> - <string name="archived_post_reply_unavailable">"Архивный пост. "</string> + <string name="archived_post_reply_unavailable">"Архивный пост."</string> <string name="locked_post_comment_unavailable">"Заблокированный пост. Коммент недоступен."</string> <string name="locked_post_reply_unavailable">"Заблокированный пост. Ответ недоступен."</string> <string name="text">"ТЕКСТ"</string> @@ -235,18 +235,20 @@ <string name="search">"Поиск"</string> <string name="posting_video">"Видео публикуется"</string> <string name="posting_image">"Изображение публикуется"</string> - <string name="please_wait">"Пожалуйста подождите."</string> + + <!-- Fuzzy --> + <string name="please_wait">"Пожалуйста, подождите."</string> <string name="add_account">"Добавить аккаунт"</string> <string name="anonymous_account">"Аноним"</string> <string name="log_out">"Выйти"</string> <string name="press_here_to_login">"Нажмите, чтобы войти"</string> <string name="login_first">"Сначала нужно войти"</string> - <string name="post_saved_success">"Пост сохранен"</string> + <string name="post_saved_success">"Пост сохранён"</string> <string name="post_saved_failed">"Невозможно сохранить пост"</string> <string name="post_unsaved_success">"Пост удалён из сохранённых"</string> <string name="post_unsaved_failed">"Не удалось удалить пост из сохранённых"</string> <string name="post_hide_success">"Пост скрыт"</string> - <string name="post_hide_failed">"Не удалось спрятать пост"</string> + <string name="post_hide_failed">"Не удалось скрыть пост"</string> <string name="post_unhide_success">"Пост раскрыт"</string> <string name="thing_favorite_failed">"Не удалось добавить в избранное"</string> <string name="thing_unfavorite_failed">"Не удалось удалить из избранного"</string> @@ -254,13 +256,13 @@ <string name="delete_this_post">"Удалить этот пост"</string> <string name="delete_this_comment">"Удалить этот комментарий"</string> <string name="are_you_sure">"Вы уверены?"</string> - <string name="edit">"Изменить "</string> + <string name="edit">"Изменить"</string> <string name="delete">"Удалить"</string> <string name="see_removed_comment">"Посмотреть удалённый комментарий"</string> - <string name="fetching_removed_comment">"Получение удаленного комментария"</string> - <string name="show_removed_comment_failed">"Не удалось найти удаленный комментарий"</string> - <string name="fetching_removed_post">"Получение удаленного сообщения"</string> - <string name="show_removed_post_failed">"Не удалось найти удаленную запись"</string> + <string name="fetching_removed_comment">"Получение удалённого комментария"</string> + <string name="show_removed_comment_failed">"Не удалось найти удалённый комментарий"</string> + <string name="fetching_removed_post">"Получение удалённого сообщения"</string> + <string name="show_removed_post_failed">"Не удалось найти удалённую запись"</string> <string name="cancel">"Отменить"</string> <string name="ok">"ОК"</string> <string name="edit_success">"Редактирование успешно"</string> @@ -272,8 +274,8 @@ <string name="unmark_nsfw_failed">"Снять отметку NSFW не удалось"</string> <string name="mark_spoiler_success">"Помечено как спойлер успешно"</string> <string name="mark_spoiler_failed">"Отметить как спойлер не удалось"</string> - <string name="unmark_spoiler_success">"Пометка спойлера снята успешно"</string> - <string name="unmark_spoiler_failed">"Не удалось снять пометку спойлера"</string> + <string name="unmark_spoiler_success">"Отметка спойлера снята успешно"</string> + <string name="unmark_spoiler_failed">"Не удалось снять отметку спойлера"</string> <string name="update_flair_success">"Флейр успешно обновлён"</string> <string name="update_flair_failed">"Ошибка обновления флейра"</string> <string name="edit_flair">"Изменить флейр"</string> @@ -283,65 +285,67 @@ <string name="notification_summary_message">"Новое сообщение"</string> <string name="notification_summary_subreddit">"Сабреддит"</string> <string name="notification_summary_award">"Награда"</string> - <string name="notification_new_messages">"%1$d Новых сообщений"</string> + <string name="notification_new_messages">"%1$d новых сообщений"</string> <string name="label_account">"Аккаунт"</string> <string name="label_post">"Пост"</string> <string name="label_preferences">"Настройки"</string> - <string name="account_switched">"Аккаунт переключен. Поэтому все страницы исчезли."</string> + <string name="account_switched">"Аккаунт переключён, поэтому все страницы исчезли."</string> <string name="settings_notification_master_title">"Уведомление"</string> <string name="settings_notification_enable_notification_title">"Включить уведомления"</string> <string name="settings_notification_interval_title">"Интервал проверки уведомлений"</string> <string name="settings_theme_title">"Тема"</string> - <string name="settings_amoled_dark_title">"AMOLED Черная"</string> + <string name="settings_amoled_dark_title">"Чёрная AMOLED"</string> <string name="settings_interface_title">"Интерфейс"</string> <string name="settings_gestures_and_buttons_title">"Жесты и кнопки"</string> - <string name="settings_save_front_page_scrolled_position_title">"Сохранять прокрученную позицию на Главной"</string> - <string name="settings_save_front_page_scrolled_position_summary">"Просмотр новых постов после обновления на Главной (Заглавная стр, сортировка: Лучшее)"</string> + <string name="settings_save_front_page_scrolled_position_title">"Сохранять прокрученную позицию на «Главной»"</string> + <string name="settings_save_front_page_scrolled_position_summary">"Просмотр новых постов после обновления на «Главной» (Заглавная страница, сортировка: лучшее)"</string> <string name="settings_open_link_in_app_title">"Открыть ссылку в приложении"</string> <string name="settigns_video_title">"Видео"</string> <string name="settings_video_autoplay_title">"Автовоспроизведение видео"</string> <string name="settings_mute_autoplaying_videos_title">"Отключать звук у автовоспроизводящихся видео"</string> - <string name="settings_autoplay_nsfw_videos_title">"Автовоспроизведение NSFW видео"</string> - <string name="settings_start_autoplay_visible_area_offset_portrait_title">"Автоматическое воспроизведение видео (Портрет)"</string> + <string name="settings_autoplay_nsfw_videos_title">"Автовоспроизведение NSFW-видео"</string> + <string name="settings_start_autoplay_visible_area_offset_portrait_title">"Автоматическое воспроизведение видео (портрет)"</string> <string name="settings_start_autoplay_visible_area_offset_portrait_summary">"Начать автовоспроизведение, когда станет доступно %1$d%% видео"</string> - <string name="settings_start_autoplay_visible_area_offset_landscape_title">"Автоматическое воспроизведение видео (Пейзаж)"</string> + <string name="settings_start_autoplay_visible_area_offset_landscape_title">"Автоматическое воспроизведение видео (пейзаж)"</string> <string name="settings_start_autoplay_visible_area_offset_landscape_summary">"Начать автовоспроизведение, когда станет доступно %1$d%% видео"</string> - <string name="settings_immersive_interface_title">"Иммерсивный интерфейс"</string> + <string name="settings_immersive_interface_title">"Режим погружения"</string> <string name="settings_immersive_interface_summary">"Применимо не ко всем страницам"</string> - <string name="settings_immersive_interface_ignore_nav_bar_title">"Игнорировать панель навигации в иммерсивном интерфейсе"</string> + <string name="settings_immersive_interface_ignore_nav_bar_title">"Не использовать панель навигации в режиме погружения"</string> <string name="settings_immersive_interface_ignore_nav_bar_summary">"Предотвратить лишнее заполнения нижней панели навигации"</string> - <string name="settings_customize_tabs_in_main_page_title">"Кастомизация вкладок на Главном экране"</string> + <string name="settings_customize_tabs_in_main_page_title">"Настройка вкладок на главном экране"</string> <string name="settings_enable_bottom_app_bar_title">"Включить нижнюю навигацию"</string> - <string name="settings_enable_bottom_app_bar_summary">"Не работает в Анонимном режиме"</string> + <string name="settings_enable_bottom_app_bar_summary">"Не работает в анонимном режиме"</string> <string name="settings_category_post_and_comment_title">"Посты и комментарии"</string> <string name="settings_vote_buttons_on_the_right_title">"Кнопка голосования справа"</string> <string name="settings_volume_keys_navigate_comments_title">"Навигация кнопками громкости между комментариями в постах"</string> <string name="settings_volume_keys_navigate_posts_title">"Навигация кнопками громкости в постах"</string> <string name="settings_mute_video_title">"Видео без звука"</string> - <string name="settings_mute_nsfw_video_title">"NSFW видео без звука"</string> + <string name="settings_mute_nsfw_video_title">"NSFW-видео без звука"</string> + + <!-- Fuzzy --> <string name="settings_automatically_try_redgifs_title">"Автопопытка доступа к Redgifs, если видео на Gfycat удалены"</string> - <string name="settings_video_player_ignore_nav_bar_title">"Игнорировать панель навигации в видео плеере"</string> + <string name="settings_video_player_ignore_nav_bar_title">"Не использовать панель навигации в видеоплеере"</string> <string name="settings_video_player_ignore_nav_bar_summary">"Предотвратить случайные нажатия"</string> <string name="settings_confirm_to_exit">"Подтверждать выход"</string> <string name="settings_category_comment_title">"Комментарий"</string> <string name="settings_show_top_level_comments_first_title">"Сначала показывать комментарии верхнего уровня"</string> <string name="settings_show_comment_divider_title">"Показывать разделитель комментариев"</string> - <string name="settings_comment_toolbar_hide_on_click">"Нажмите, чтобы отобразить/скрыть панель инструментов комментов"</string> - <string name="settings_fully_collapse_comment_title">"Полностью свернуть коммент"</string> - <string name="settings_comment_toolbar_hidden">"Скрыть панель инструментов комментов по умолчанию"</string> + <string name="settings_comment_toolbar_hide_on_click">"Нажмите, чтобы отобразить/скрыть панель инструментов комментариев"</string> + <string name="settings_fully_collapse_comment_title">"Полностью свернуть комментарий"</string> + <string name="settings_comment_toolbar_hidden">"Скрыть панель инструментов комментариев по умолчанию"</string> <string name="settings_show_absolute_number_of_votes_title">"Показывать абсолютное количество голосов"</string> - <string name="settings_show_elapsed_time">"Показывать прошедшее время в постах и комментах"</string> + <string name="settings_show_elapsed_time">"Показывать прошедшее время в постах и комментариях"</string> <string name="settings_time_format_title">"Формат времени"</string> <string name="settings_category_post_title">"Пост"</string> <string name="settings_default_post_layout">"Вид поста по умолчанию"</string> <string name="settings_show_divider_in_compact_layout">"Показывать разделитель"</string> <string name="settings_show_thumbnail_on_the_left_in_compact_layout">"Показывать миниатюры слева"</string> - <string name="settings_swap_tap_and_long_title">"Поменять местами касание и долгое нажатие в комментах"</string> - <string name="settings_swipe_to_go_back_title">"Правый свайп для возврата"</string> + <string name="settings_swap_tap_and_long_title">"Поменять местами касание и долгое нажатие в комментариях"</string> + <string name="settings_swipe_to_go_back_title">"Правый жест для возврата"</string> <string name="settings_swipe_to_go_back_summary">"Не применяется ко всем страницам"</string> <string name="settings_lock_jump_to_next_top_level_comment_button_title">"Блокировать переход к следующей кнопке комментариев верхнего уровня"</string> <string name="settings_lock_bottom_app_bar_title">"Заблокировать нижнюю панель навигации"</string> - <string name="settings_swipe_up_to_hide_jump_to_next_top_level_comment_button_title">"Проведите пальцем вверх, чтобы скрыть кнопку перехода к следующему верхнему уровню коммента"</string> + <string name="settings_swipe_up_to_hide_jump_to_next_top_level_comment_button_title">"Жест вверх, чтобы скрыть кнопку перехода к следующему верхнему уровню комментария"</string> <string name="settings_lazy_mode_interval_title">"Интервал ленивого режима"</string> <string name="settings_font_title">"Шрифт"</string> <string name="settings_preview_font_title">"Предпросмотр шрифтов"</string> @@ -359,27 +363,27 @@ <string name="settings_blur_spoiler_title">"Размывать изображения под спойлером"</string> <string name="settings_about_master_title">"Обо всём"</string> <string name="settings_acknowledgement_master_title">"Признательность"</string> - <string name="settings_credits_master_title">"Кредиты"</string> + <string name="settings_credits_master_title">"Благодарности"</string> <string name="settings_credits_icon_foreground_title">"Значок переднего плана"</string> - <string name="settings_credits_icon_foreground_summary">"Технологический вектор, созданный freepik - www.freepik.com"</string> + <string name="settings_credits_icon_foreground_summary">"Технологический вектор, созданный freepik – www.freepik.com"</string> <string name="settings_credits_icon_background_title">"Фон значка"</string> - <string name="settings_credits_icon_background_summary">"Фоновый вектор, созданный freepik - www.freepik.com"</string> + <string name="settings_credits_icon_background_summary">"Фоновый вектор, созданный freepik – www.freepik.com"</string> <string name="settings_credits_error_image_title">"Ошибка изображения"</string> - <string name="settings_credits_error_image_summary">"Технологический вектор, созданный freepik - www.freepik.com"</string> - <string name="settings_credits_gilded_icon_title">"Иконка золота"</string> - <string name="settings_credits_gilded_icon_summary">"Иконка создана Freepik из from www.flaticon.com"</string> - <string name="settings_credits_crosspost_icon_title">"Иконка кросспоста"</string> - <string name="settings_credits_crosspost_icon_summary">"Иконка создана Freepik из www.flaticon.com"</string> + <string name="settings_credits_error_image_summary">"Технологический вектор, созданный freepik – www.freepik.com"</string> + <string name="settings_credits_gilded_icon_title">"Значок золота"</string> + <string name="settings_credits_gilded_icon_summary">"Значок создан Freepik из from www.flaticon.com"</string> + <string name="settings_credits_crosspost_icon_title">"Значок кросспоста"</string> + <string name="settings_credits_crosspost_icon_summary">"Значок создан Freepik из www.flaticon.com"</string> <string name="settings_credits_thumbtack_icon_title">"Значок канцелярской кнопки"</string> - <string name="settings_credits_thumbtack_icon_summary">"Иконка создана Freepik из from www.flaticon.com"</string> + <string name="settings_credits_thumbtack_icon_summary">"Значок создан Freepik из from www.flaticon.com"</string> <string name="settings_credits_best_rocket_icon_title">"Значок ракеты"</string> - <string name="settings_credits_best_rocket_icon_summary">"Иконка создана Freepik из from www.flaticon.com"</string> - <string name="settings_credits_material_icons_title">"Иконки Material"</string> + <string name="settings_credits_best_rocket_icon_summary">"Значок создан Freepik из from www.flaticon.com"</string> + <string name="settings_credits_material_icons_title">"Значки Material"</string> <string name="settings_open_source_title">"Открытый источник"</string> <string name="settings_open_source_summary">"Посетите его на Github, если вам нравится это приложение"</string> <string name="settings_rate_title">"Оцените на Google Play"</string> - <string name="settings_rate_summary">"Поставьте мне оценку 5 звезд, и я буду очень счастлив"</string> - <string name="settings_email_title">"Email"</string> + <string name="settings_rate_summary">"Поставьте мне оценку 5 звёзд, и я буду очень счастлив"</string> + <string name="settings_email_title">"Эл. почта"</string> <string name="settings_email_summary">"docilealligator.app@gmail.com"</string> <string name="settings_reddit_account_title">"Аккаунт Reddit"</string> <string name="settings_reddit_account_summary">"u/Hostilenemy"</string> @@ -387,12 +391,12 @@ <string name="settings_subreddit_summary">"r/Infinity_For_Reddit"</string> <string name="settings_share_title">"Поделиться"</string> <string name="settings_share_summary">"Поделитесь этим приложением с другими людьми, если оно вам нравится"</string> - <string name="settings_version_title">"Infinity For Reddit"</string> + <string name="settings_version_title">"Infinity для Reddit"</string> <string name="settings_version_summary">"Версия %s"</string> <string name="settings_category_customization_title">"Персонализация"</string> <string name="settings_customize_light_theme_title">"Светлая тема"</string> <string name="settings_customize_dark_theme_title">"Тёмная тема"</string> - <string name="settings_customize_amoled_theme_title">"Amoled тема"</string> + <string name="settings_customize_amoled_theme_title">"Тема AMOLED"</string> <string name="settings_manage_themes_title">"Менеджер тем"</string> <string name="settings_custom_theme_cannot_apply_to_settings_page_summary">"Пользовательские темы не применяются к странице настроек (кроме панели инструментов, строки состояния и панели навигации)."</string> <string name="settings_advanced_master_title">"Дополнительные"</string> @@ -409,14 +413,14 @@ <string name="settings_tab_title">"Название"</string> <string name="settings_tab_post_type">"Тип"</string> <string name="settings_tab_subreddit_name">"Название сабреддита (без префикса r/)"</string> - <string name="settings_tab_multi_reddit_name">"Название МультиРеддита (/user/yourusername/m/yourmultiredditname)"</string> + <string name="settings_tab_multi_reddit_name">"Название мультиреддита (/user/yourusername/m/yourmultiredditname)"</string> <string name="settings_tab_username">"Имя пользователя (без префикса u/)"</string> <string name="no_developer_easter_egg">"Здесь нет вариантов разработчика"</string> <string name="no_link_available">"Не могу получить ссылку"</string> <string name="exit_when_submit">"Выйти?"</string> - <string name="exit_when_submit_post_detail">"Пост всё равно будет отправлен, даже если вы уйдете отсюда."</string> - <string name="exit_when_edit_post_detail">"Пост может быть отправлено, даже если вы уйдете отсюда."</string> - <string name="exit_when_edit_comment_detail">"Комментарий всё еще может быть отправлен, даже если вы уйдете отсюда."</string> + <string name="exit_when_submit_post_detail">"Пост всё равно будет отправлен, даже если вы уйдёте отсюда."</string> + <string name="exit_when_edit_post_detail">"Пост может быть отправлено, даже если вы уйдёте отсюда."</string> + <string name="exit_when_edit_comment_detail">"Комментарий всё ещё может быть отправлен, даже если вы уйдёте отсюда."</string> <string name="discard">"Отменить?"</string> <string name="discard_detail">"Все черновики НЕ будут сохранены."</string> <string name="yes">"Да"</string> @@ -424,45 +428,45 @@ <string name="no_data_received">"Данные не получены"</string> <string name="no_image_path_received">"Путь к изображению не получен"</string> <string name="no_video_path_received">"Путь к видео не получен"</string> - <string name="cannot_handle_intent">"Не удалось обработать запрос Поделиться"</string> + <string name="cannot_handle_intent">"Не удалось обработать запрос «Поделиться»"</string> <string name="share">"Поделиться"</string> - <string name="no_email_client">"Email клиент не найден"</string> + <string name="no_email_client">"Клиент эл. почты не найден"</string> <string name="no_app">"Приложение недоступно"</string> - <string name="comment_saved_success">"Коммент сохранён"</string> - <string name="comment_saved_failed">"Не удалось сохранить коммент"</string> - <string name="comment_unsaved_success">"Коммент не сохранён"</string> - <string name="comment_unsaved_failed">"Невозможно удалить коммент"</string> + <string name="comment_saved_success">"Комментарий сохранён"</string> + <string name="comment_saved_failed">"Не удалось сохранить комментарий"</string> + <string name="comment_unsaved_success">"Комментарий не сохранён"</string> + <string name="comment_unsaved_failed">"Невозможно удалить комментарий"</string> <string name="favorites">"Избранное"</string> <string name="all">"Все"</string> <string name="post_layout_card">"Карточный стиль"</string> <string name="post_layout_compact">"Компактный стиль"</string> <string name="elapsed_time_just_now">"Только что"</string> <string name="elapsed_time_a_minute_ago">"1 минута"</string> - <string name="elapsed_time_minutes_ago">"%1$d минут"</string> + <string name="elapsed_time_minutes_ago">"%1$d мин."</string> <string name="elapsed_time_an_hour_ago">"1 час"</string> - <string name="elapsed_time_hours_ago">"%1$d часа"</string> + <string name="elapsed_time_hours_ago">"%1$d час."</string> <string name="elapsed_time_yesterday">"Вчера"</string> <!-- I am not sure how to unify this one. Plural form differs depending on numerals. --> - <string name="elapsed_time_days_ago">"%1$d Дня(ей)"</string> + <string name="elapsed_time_days_ago">"%1$d дн."</string> <string name="elapsed_time_a_month_ago">"1 месяц"</string> - <string name="elapsed_time_months_ago">"%1$d месяцев"</string> + <string name="elapsed_time_months_ago">"%1$d мес."</string> <string name="elapsed_time_a_year_ago">"1 год"</string> <string name="elapsed_time_years_ago">"%1$d лет"</string> - <string name="error_getting_multi_reddit_data">"Ошибка при получении данных о МультиРеддите"</string> - <string name="error_loading_multi_reddit_list">"Не удалось синхронизировать МультиРеддиты"</string> - <string name="error_loading_subscriptions">"Не могу синхронизировать подписки"</string> - <string name="share_this_app">"Попробуйте Infinity for Reddit, отличный клиент для Реддита! + <string name="error_getting_multi_reddit_data">"Ошибка при получении данных о мультиреддите"</string> + <string name="error_loading_multi_reddit_list">"Не удалось синхронизировать мультиреддиты"</string> + <string name="error_loading_subscriptions">"Не удалось синхронизировать подписки"</string> + <string name="share_this_app">"Попробуйте Infinity для Reddit, отличный клиент для Реддита! https://play.google.com/store/apps/details?id=ml.docilealligator.infinityforreddit"</string> - <string name="error_getting_subreddit_name">"Ошибка при получении имени сабреддита"</string> + <string name="error_getting_subreddit_name">"Ошибка при получении названия сабреддита"</string> <string name="share_post_link">"Поделиться ссылкой на пост"</string> <string name="share_image_link">"Поделиться ссылкой на изображение"</string> - <string name="share_gif_link">"Поделиться ссылкой на Gif"</string> + <string name="share_gif_link">"Поделиться ссылкой на GIF"</string> <string name="share_video_link">"Поделиться ссылкой на видео"</string> <string name="share_link">"Поделиться ссылкой"</string> <string name="copy_post_link">"Скопировать ссылку на пост"</string> <string name="copy_image_link">"Скопировать ссылку изображения"</string> - <string name="copy_gif_link">"Скопировать ссылку на Gif"</string> + <string name="copy_gif_link">"Скопировать ссылку на GIF"</string> <string name="copy_video_link">"Скопировать ссылку на видео"</string> <string name="copy_link">"Скопировать ссылку"</string> <string name="copy_success">"Скопировано"</string> @@ -476,175 +480,175 @@ https://play.google.com/store/apps/details?id=ml.docilealligator.infinityforredd <string name="exit_app">"Выйти?"</string> <string name="light_theme">"Светлая тема"</string> <string name="dark_theme">"Тёмная тема"</string> - <string name="multi_reddit_name_hint">"Имя (Максимум 50 символов)"</string> + <string name="multi_reddit_name_hint">"Название (максимум 50 символов)"</string> <string name="multi_reddit_description_hint">"Описание"</string> <string name="private_multi_reddit">"Приватный"</string> - <string name="no_multi_reddit_name">"Где имя?"</string> - <string name="create_multi_reddit_failed">"Невозможно создать МультиРеддит"</string> - <string name="duplicate_multi_reddit">"МультиРеддит уже существует"</string> - <string name="edit_multi_reddit_failed">"Не удаётся изменить МультиРеддит"</string> + <string name="no_multi_reddit_name">"Где название?"</string> + <string name="create_multi_reddit_failed">"Невозможно создать мультиреддит"</string> + <string name="duplicate_multi_reddit">"Мультиреддит уже существует"</string> + <string name="edit_multi_reddit_failed">"Не удалось изменить мультиреддит"</string> <string name="logged_out">"Вы вышли из системы"</string> <string name="delete_multi_reddit_success">"Успешно удалено"</string> <string name="delete_multi_reddit_failed">"Ошибка удаления"</string> <string name="delete_multi_reddit_dialog_message">"Вы уверены?"</string> <string name="enable_nsfw">"Включить NSFW"</string> <string name="disable_nsfw">"Отключить NSFW"</string> - <string name="cannot_save_image">"Не удаётся сохранить изображение"</string> - <string name="cannot_save_gif">"Не удалось сохранить Gif"</string> + <string name="cannot_save_image">"Не удалось сохранить изображение"</string> + <string name="cannot_save_gif">"Не удалось сохранить GIF"</string> <string name="cannot_get_storage">"Нет доступа к хранилищу"</string> - <string name="save_image_first">"Изображение сохраняется. Пожалуйста подождите."</string> - <string name="save_gif_first">"Gif сохраняется. Пожалуйста подождите."</string> + <string name="save_image_first">"Изображение сохраняется. Пожалуйста, подождите."</string> + <string name="save_gif_first">"GIF сохраняется. Пожалуйста, подождите."</string> <string name="theme_name_description">"Нажмите, чтобы поменять название темы"</string> <string name="theme_item_is_light_theme">"Установить как светлую тему"</string> <string name="theme_item_is_dark_theme">"Установить как тёмную тему"</string> - <string name="theme_item_is_amoled_theme">"Установить как amoled тему"</string> + <string name="theme_item_is_amoled_theme">"Установить как тему AMOLED"</string> <string name="theme_item_color_primary">"Основной цвет"</string> - <string name="theme_item_color_primary_detail">"Применяется к: Панель инструментов"</string> + <string name="theme_item_color_primary_detail">"Применяется к: панель инструментов"</string> <string name="theme_item_color_primary_dark">"Основной тёмный цвет"</string> - <string name="theme_item_color_primary_dark_detail">"Применяется к: Статус бар"</string> + <string name="theme_item_color_primary_dark_detail">"Применяется к: панель статуса"</string> <string name="theme_item_color_accent">"Акцент цвета"</string> - <string name="theme_item_color_accent_detail">"Применяется к: Прогресс бар, и т.д."</string> - <string name="theme_item_color_primary_light_theme">"Основной цвет Светлой темы"</string> - <string name="theme_item_color_primary_light_theme_detail">"Применяется к: Фон плавающей кнопки действия"</string> + <string name="theme_item_color_accent_detail">"Применяется к: панель выполнения и т.д."</string> + <string name="theme_item_color_primary_light_theme">"Основной цвет светлой темы"</string> + <string name="theme_item_color_primary_light_theme_detail">"Применяется к: фон плавающей кнопки действия"</string> <string name="theme_item_primary_text_color">"Цвет основного текста"</string> - <string name="theme_item_primary_text_color_detail">"Применяется к: Основной текст"</string> + <string name="theme_item_primary_text_color_detail">"Применяется к: основной текст"</string> <string name="theme_item_secondary_text_color">"Цвет дополнительного текста"</string> - <string name="theme_item_secondary_text_color_detail">"Применяется к: Дополнительный текст"</string> + <string name="theme_item_secondary_text_color_detail">"Применяется к: дополнительный текст"</string> <string name="theme_item_post_title_color">"Цвет заголовка поста"</string> - <string name="theme_item_post_title_color_detail">"Применимо к: Заголовок поста"</string> - <string name="theme_item_post_content_color">"Применяется к: Заголовок поста"</string> - <string name="theme_item_post_content_color_detail">"Применяется к: Содержимое поста"</string> - <string name="theme_item_comment_color">"Цвет коммента"</string> - <string name="theme_item_comment_color_detail">"Применяется к: Коммент"</string> + <string name="theme_item_post_title_color_detail">"Применяется к: заголовок поста"</string> + <string name="theme_item_post_content_color">"Применяется к: заголовок поста"</string> + <string name="theme_item_post_content_color_detail">"Применяется к: содержимое поста"</string> + <string name="theme_item_comment_color">"Цвет комментария"</string> + <string name="theme_item_comment_color_detail">"Применяется к: комментарий"</string> <string name="theme_item_button_text_color">"Цвет текста кнопки"</string> - <string name="theme_item_button_text_color_detail">"Применяется к: Текст на кнопке"</string> + <string name="theme_item_button_text_color_detail">"Применяется к: текст на кнопке"</string> <string name="theme_item_chip_text_color">"Цвет чип текста"</string> - <string name="theme_item_chip_text_color_detail">"Применяется к: Кнопка Подписаться"</string> + <string name="theme_item_chip_text_color_detail">"Применяется к: кнопка «Подписаться»"</string> <string name="theme_item_link_color">"Цвет ссылки"</string> <string name="theme_item_link_color_detail">"Применяется к: URL"</string> <string name="theme_item_received_message_text_color">"Цвет текста полученного сообщения"</string> - <string name="theme_item_received_message_text_color_detail">"Применяется к: Полученные личные сообщения"</string> + <string name="theme_item_received_message_text_color_detail">"Применяется к: полученные личные сообщения"</string> <string name="theme_item_sent_message_text_color">"Цвет текста отправленного сообщения"</string> - <string name="theme_item_sent_message_text_color_detail">"Применяется к: Отправленное личное сообщение"</string> + <string name="theme_item_sent_message_text_color_detail">"Применяется к: отправленное личное сообщение"</string> <string name="theme_item_background_color">"Цвет фона"</string> - <string name="theme_item_background_color_detail">"Применяется к: Фон каждой страницы и панели навигации"</string> + <string name="theme_item_background_color_detail">"Применяется к: фон каждой страницы и панели навигации"</string> <string name="theme_item_card_view_background_color">"Цвет фона карточки"</string> - <string name="theme_item_card_view_background_color_detail">"Применяется к: Фон поста и фон сообщения"</string> - <string name="theme_item_comment_background_color">"Цвет фона коммента"</string> - <string name="theme_item_comment_background_color_detail">"Применяется к: Фон коммента"</string> - <string name="theme_item_fully_collapsed_comment_background_color">"Цвет фона полностью свернутого коммента"</string> - <string name="theme_item_fully_collapsed_comment_background_color_detail">"Применяется к: Фон свёрнутых комментов"</string> - <string name="theme_item_awarded_comment_background_color">"Цвет фона награждённого коммента"</string> - <string name="theme_item_awarded_comment_background_color_detail">"Применяется к: Фон награждённых комментов"</string> + <string name="theme_item_card_view_background_color_detail">"Применяется к: фон поста и фон сообщения"</string> + <string name="theme_item_comment_background_color">"Цвет фона комментария"</string> + <string name="theme_item_comment_background_color_detail">"Применяется к: фон комментария"</string> + <string name="theme_item_fully_collapsed_comment_background_color">"Цвет фона полностью свёрнутого комментария"</string> + <string name="theme_item_fully_collapsed_comment_background_color_detail">"Применяется к: фон свёрнутых комментариев"</string> + <string name="theme_item_awarded_comment_background_color">"Цвет фона награждённого комментария"</string> + <string name="theme_item_awarded_comment_background_color_detail">"Применяется к: фон награждённых комментариев"</string> <string name="theme_item_received_message_background_color">"Цвет фона полученного сообщения"</string> - <string name="theme_item_received_message_background_color_detail">"Применяется к: Фон полученного личного сообщения"</string> + <string name="theme_item_received_message_background_color_detail">"Применяется к: фон полученного личного сообщения"</string> <string name="theme_item_sent_message_background_color">"Цвет фона отправленного сообщения"</string> - <string name="theme_item_sent_message_background_color_detail">"Применяется к: Фон отправленного личного сообщения"</string> + <string name="theme_item_sent_message_background_color_detail">"Применяется к: фон отправленного личного сообщения"</string> <string name="theme_item_bottom_app_bar_background_color">"Цвет нижней панели навигации"</string> - <string name="theme_item_bottom_app_bar_background_color_detail">"Применяется к: Кнопки панели навигации"</string> + <string name="theme_item_bottom_app_bar_background_color_detail">"Применяется к: кнопки панели навигации"</string> <string name="theme_item_primary_icon_color">"Цвет основного значка"</string> - <string name="theme_item_primary_icon_color_detail">"Применяется к: Значки в панели навигации"</string> + <string name="theme_item_primary_icon_color_detail">"Применяется к: значки в панели навигации"</string> <string name="theme_item_bottom_app_bar_icon_color">"Цвет значка нижней панели"</string> - <string name="theme_item_bottom_app_bar_icon_color_detail">"Применяется к: Значки на нижней панели навигации"</string> + <string name="theme_item_bottom_app_bar_icon_color_detail">"Применяется к: значки на нижней панели навигации"</string> <string name="theme_item_post_icon_and_info_color">"Значок поста и цвет информации"</string> - <string name="theme_item_post_icon_and_info_color_detail">"Применяется к: Иконки, оценка и количество комментов в постах"</string> - <string name="theme_item_comment_icon_and_info_color">"Значок коммента и цвет информации"</string> - <string name="theme_item_comment_icon_and_info_color_detail">"Применяется к: Иконки и оценка в комментах"</string> + <string name="theme_item_post_icon_and_info_color_detail">"Применяется к: значки, оценка и количество комментариев в постах"</string> + <string name="theme_item_comment_icon_and_info_color">"Значок комментария и цвет информации"</string> + <string name="theme_item_comment_icon_and_info_color_detail">"Применяется к: значки и оценка в комментариях"</string> <string name="theme_item_fab_icon_color">"Цвет плавающей кнопки действий"</string> - <string name="theme_item_fab_icon_color_detail">"Применяется к: Значок плавающей кнопки действий"</string> - <string name="theme_item_send_message_icon_color">"Цвет иконки отправленного сообщения"</string> - <string name="theme_item_send_message_icon_color_detail">"Применяется к: Иконка отправленного личного сообщения"</string> + <string name="theme_item_fab_icon_color_detail">"Применяется к: значок плавающей кнопки действий"</string> + <string name="theme_item_send_message_icon_color">"Цвет значка отправленного сообщения"</string> + <string name="theme_item_send_message_icon_color_detail">"Применяется к: значок отправленного личного сообщения"</string> <string name="theme_item_toolbar_primary_text_and_icon_color">"Основные тексты и значки на панели инструментов"</string> - <string name="theme_item_toolbar_primary_text_and_icon_color_detail">"Применяется к: Основные тексты и значки на панелях инструментов"</string> + <string name="theme_item_toolbar_primary_text_and_icon_color_detail">"Применяется к: основные тексты и значки на панелях инструментов"</string> <string name="theme_item_toolbar_secondary_text_color">"Цвет дополнительного текста на панели инструментов"</string> - <string name="theme_item_toolbar_secondary_text_color_detail">"Применяется к: Дополнительные тексты на панелях инструментов"</string> + <string name="theme_item_toolbar_secondary_text_color_detail">"Применяется к: дополнительные тексты на панелях инструментов"</string> <string name="theme_item_circular_progress_bar_background_color">"Цвет фона кругового индикатора выполнения"</string> - <string name="theme_item_circular_progress_bar_background_color_detail">"Применяется к: Фон кругового индикатора выполнения"</string> + <string name="theme_item_circular_progress_bar_background_color_detail">"Применяется к: фон кругового индикатора выполнения"</string> <string name="theme_item_tab_layout_with_expanded_collapsing_toolbar_tab_background">"Цвет фона макета вкладки свёрнутой панели инструментов"</string> - <string name="theme_item_tab_layout_with_expanded_collapsing_toolbar_tab_background_detail">"Применяется к: Фон макета вкладки (свёрнутая панель инструментов)"</string> + <string name="theme_item_tab_layout_with_expanded_collapsing_toolbar_tab_background_detail">"Применяется к: фон макета вкладки (свёрнутая панель инструментов)"</string> <string name="theme_item_tab_layout_with_expanded_collapsing_toolbar_text_color">"Цвет текста макета вкладки свёрнутой панели инструментов"</string> - <string name="theme_item_tab_layout_with_expanded_collapsing_toolbar_text_color_detail">"Применяется к: Цвет текста макета вкладки (свёрнутая панель инструментов)"</string> + <string name="theme_item_tab_layout_with_expanded_collapsing_toolbar_text_color_detail">"Применяется к: цвет текста макета вкладки (свёрнутая панель инструментов)"</string> <string name="theme_item_tab_layout_with_expanded_collapsing_toolbar_tab_indicator">"Цвет индикатора вкладки в макете вкладки свёрнутой панели инструментов"</string> - <string name="theme_item_tab_layout_with_expanded_collapsing_toolbar_tab_indicator_detail">"Применяется к: Цвет индикатора вкладки в макете вкладки (свёрнутая панель инструментов)"</string> + <string name="theme_item_tab_layout_with_expanded_collapsing_toolbar_tab_indicator_detail">"Применяется к: цвет индикатора вкладки в макете вкладки (свёрнутая панель инструментов)"</string> <string name="theme_item_tab_layout_with_collapsed_collapsing_toolbar_tab_background">"Цвет фона вкладки макета свёрнутой панели инструментов"</string> - <string name="theme_item_tab_layout_with_collapsed_collapsing_toolbar_tab_background_detail">"Применяется к: Фон макета вкладки (свёрнутая панель инструментов)"</string> + <string name="theme_item_tab_layout_with_collapsed_collapsing_toolbar_tab_background_detail">"Применяется к: фон макета вкладки (свёрнутая панель инструментов)"</string> <string name="theme_item_tab_layout_with_collapsed_collapsing_toolbar_text_color">"Цвет текста макета вкладки свёрнутой панели инструментов"</string> - <string name="theme_item_tab_layout_with_collapsed_collapsing_toolbar_text_color_detail">"Применяется к: Цвет текста макета вкладки (свёрнутая панель инструментов)"</string> + <string name="theme_item_tab_layout_with_collapsed_collapsing_toolbar_text_color_detail">"Применяется к: цвет текста макета вкладки (свёрнутая панель инструментов)"</string> <string name="theme_item_tab_layout_with_collapsed_collapsing_toolbar_tab_indicator">"Цвет индикатора вкладки в макете вкладки свёрнутой панели инструментов"</string> - <string name="theme_item_tab_layout_with_collapsed_collapsing_toolbar_tab_indicator_detail">"Применяется к: Цвет индикатора вкладки в макете вкладки (свёрнутая панель инструментов)"</string> - <string name="theme_item_upvoted_color">"Цвет апвоута"</string> - <string name="theme_item_upvoted_color_detail">"Применяется к: Кнопки голосования и баллы (апвоут)"</string> - <string name="theme_item_downvoted_color">"Цвет даунвоута"</string> - <string name="theme_item_downvoted_color_detail">"Применяется к: Кнопки голосования и баллы (даунвоут)"</string> + <string name="theme_item_tab_layout_with_collapsed_collapsing_toolbar_tab_indicator_detail">"Применяется к: цвет индикатора вкладки в макете вкладки (свёрнутая панель инструментов)"</string> + <string name="theme_item_upvoted_color">"Цвет голоса+"</string> + <string name="theme_item_upvoted_color_detail">"Применяется к: кнопки голосования и баллы (голос+)"</string> + <string name="theme_item_downvoted_color">"Цвет голоса-"</string> + <string name="theme_item_downvoted_color_detail">"Применяется к: кнопки голосования и баллы (голос-)"</string> <string name="theme_item_post_type_background_color">"Цвет фона типа поста"</string> - <string name="theme_item_post_type_background_color_detail">"Применяется к: Фон типа сообщения (ИЗОБРАЖЕНИЕ, ТЕКСТ, ВИДЕО, GIF, ССЫЛКА)"</string> + <string name="theme_item_post_type_background_color_detail">"Применяется к: фон типа сообщения (ИЗОБРАЖЕНИЕ, ТЕКСТ, ВИДЕО, GIF, ССЫЛКА)"</string> <string name="theme_item_post_type_text_color">"Цвет текста типа поста"</string> - <string name="theme_item_post_type_text_color_detail">"Применяется к: Цвет текста типа поста (ИЗОБРАЖЕНИЕ, ТЕКСТ, ВИДЕО, GIF-ССЫЛКА)"</string> + <string name="theme_item_post_type_text_color_detail">"Применяется к: цвет текста типа поста (ИЗОБРАЖЕНИЕ, ТЕКСТ, ВИДЕО, GIF, ССЫЛКА)"</string> <string name="theme_item_spoiler_background_color">"Цвет фона спойлера"</string> - <string name="theme_item_spoiler_background_color_detail">"Применяется к: Фон тега спойлер"</string> + <string name="theme_item_spoiler_background_color_detail">"Применяется к: фон отметки спойлера"</string> <string name="theme_item_spoiler_text_color">"Цвет текста спойлера"</string> - <string name="theme_item_spoiler_text_color_detail">"Применяется к: Цвет текста тега спойлер"</string> + <string name="theme_item_spoiler_text_color_detail">"Применяется к: цвет текста отметки спойлера"</string> <string name="theme_item_nsfw_background_color">"Цвет фона NSFW"</string> - <string name="theme_item_nsfw_background_color_detail">"Применяется к: Цвет фона тега NSFW"</string> + <string name="theme_item_nsfw_background_color_detail">"Применяется к: цвет фона отметки NSFW"</string> <string name="theme_item_nsfw_text_color">"Цвет текста NSFW"</string> - <string name="theme_item_nsfw_text_color_detail">"Применяется к: Цвет текста тега NSFW"</string> + <string name="theme_item_nsfw_text_color_detail">"Применяется к: цвет текста отметки NSFW"</string> <string name="theme_item_flair_background_color">"Цвет фона флейра"</string> - <string name="theme_item_flair_background_color_detail">"Применяется к: Фон флейра"</string> + <string name="theme_item_flair_background_color_detail">"Применяется к: фон флейра"</string> <string name="theme_item_flair_text_color">"Цвет флейра"</string> - <string name="theme_item_flair_text_color_detail">"Применяется к: Цвет текста флейра"</string> + <string name="theme_item_flair_text_color_detail">"Применяется к: цвет текста флейра"</string> <string name="theme_item_awards_background_color">"Цвет фона наград"</string> - <string name="theme_item_awards_background_color_detail">"Применяется к: Фон награды"</string> + <string name="theme_item_awards_background_color_detail">"Применяется к: фон награды"</string> <string name="theme_item_awards_text_color">"Цвет текста награды"</string> - <string name="theme_item_awards_text_color_detail">"Применяется к: Цвет текста награды"</string> - <string name="theme_item_archived_tint">"Цвет иконки архивного поста"</string> - <string name="theme_item_archived_tint_detail">"Применяется к: Иконки архивного поста"</string> - <string name="theme_item_locked_icon_tint">"Цвет иконки блокировки"</string> - <string name="theme_item_locked_icon_tint_detail">"Применяется к: Иконка блокировки"</string> - <string name="theme_item_crosspost_icon_tint">"Цвет иконки кросспоста"</string> - <string name="theme_item_crosspost_icon_tint_detail">"Применяется к: Иконка кросспоста"</string> + <string name="theme_item_awards_text_color_detail">"Применяется к: цвет текста награды"</string> + <string name="theme_item_archived_tint">"Цвет значка архивного поста"</string> + <string name="theme_item_archived_tint_detail">"Применяется к: значок архивного поста"</string> + <string name="theme_item_locked_icon_tint">"Цвет значка блокировки"</string> + <string name="theme_item_locked_icon_tint_detail">"Применяется к: значок блокировки"</string> + <string name="theme_item_crosspost_icon_tint">"Цвет значка кросспоста"</string> + <string name="theme_item_crosspost_icon_tint_detail">"Применяется к: значок кросспоста"</string> <string name="theme_item_stickied_post_icon_tint">"Цвет значка прикреплённого сообщения"</string> - <string name="theme_item_stickied_post_icon_tint_detail">"Применяется к: Иконка прикреплённого сообщения"</string> + <string name="theme_item_stickied_post_icon_tint_detail">"Применяется к: значок прикреплённого сообщения"</string> <string name="theme_item_subscribed_color">"Подписаться"</string> - <string name="theme_item_subscribed_color_detail">"Применяется к: Кнопка Отписаться"</string> + <string name="theme_item_subscribed_color_detail">"Применяется к: кнопка «Отписаться»"</string> <string name="theme_item_unsubscribed_color">"Отписаться"</string> - <string name="theme_item_unsubscribed_color_detail">"Применяется к: Кнопка Подписаться"</string> + <string name="theme_item_unsubscribed_color_detail">"Применяется к: кнопка «Подписаться»"</string> <string name="theme_item_username_color">"Цвет имени пользователя"</string> - <string name="theme_item_username_color_detail">"Применяется к: Имя пользователя"</string> + <string name="theme_item_username_color_detail">"Применяется к: имя пользователя"</string> <string name="theme_item_subreddit_color">"Цвет сабреддита"</string> - <string name="theme_item_subreddit_color_detail">"Применяется к: Имя сабреддита"</string> + <string name="theme_item_subreddit_color_detail">"Применяется к: название сабреддита"</string> <string name="theme_item_author_flair_text_color">"Цвет автора флейра"</string> - <string name="theme_item_author_flair_text_color_detail">"Применяется к: Автор флейра в комментариях"</string> + <string name="theme_item_author_flair_text_color_detail">"Применяется к: автор флейра в комментариях"</string> <string name="theme_item_submitter_color">"Отправитель"</string> - <string name="theme_item_submitter_color_detail">"Применяется к: Отправитель в комментариях"</string> + <string name="theme_item_submitter_color_detail">"Применяется к: отправитель в комментариях"</string> <string name="theme_item_moderator_color">"Модератор"</string> - <string name="theme_item_moderator_color_detail">"Применяется к: Модератор в комментах"</string> - <string name="theme_item_single_comment_thread_background_color">"Цвет фона цепочки отдельного коммента"</string> - <string name="theme_item_single_comment_thread_background_color_detail">"Применяется к: Отдельный коммент"</string> + <string name="theme_item_moderator_color_detail">"Применяется к: модератор в комментариях"</string> + <string name="theme_item_single_comment_thread_background_color">"Цвет фона цепочки отдельного комментария"</string> + <string name="theme_item_single_comment_thread_background_color_detail">"Применяется к: отдельный комментарий"</string> <string name="theme_item_unread_message_background_color">"Цвет фона непрочитанного сообщения"</string> - <string name="theme_item_unread_message_background_color_detail">"Применяется к: Цвет фона непрочитанного сообщения"</string> + <string name="theme_item_unread_message_background_color_detail">"Применяется к: цвет фона непрочитанного сообщения"</string> <string name="theme_item_divider_color">"Цвет разделителя"</string> - <string name="theme_item_divider_color_detail">"Применяется к: Разделитель комментариев, разделители на страницах для отправки постов и т.д."</string> + <string name="theme_item_divider_color_detail">"Применяется к: разделитель комментариев, разделители на страницах для отправки постов и т.д."</string> <string name="theme_item_vote_and_reply_unavailable_button_color">"Цвет недоступной кнопки голосования и ответа"</string> - <string name="theme_item_vote_and_reply_unavailable_button_color_detail">"Применяется к: Кнопки голосования и ответа (Недоступные)"</string> - <string name="theme_item_comment_vertical_bar_color_1">"Цвет вертикальной полосы коммента 1"</string> - <string name="theme_item_comment_vertical_bar_color_1_detail">"Применяется к: Вертикальная полоса комментов (Уровень 1)"</string> - <string name="theme_item_comment_vertical_bar_color_2">"Цвет вертикальной полосы коммента 2"</string> - <string name="theme_item_comment_vertical_bar_color_2_detail">"Применяется к: Вертикальная полоса комментов (Уровень 2)"</string> - <string name="theme_item_comment_vertical_bar_color_3">"Цвет вертикальной полосы коммента 3"</string> - <string name="theme_item_comment_vertical_bar_color_3_detail">"Применяется к: Вертикальная полоса комментов (Уровень 3)"</string> - <string name="theme_item_comment_vertical_bar_color_4">"Цвет вертикальной полосы коммента 4"</string> - <string name="theme_item_comment_vertical_bar_color_4_detail">"Применяется к: Вертикальная полоса комментов (Уровень 4)"</string> - <string name="theme_item_comment_vertical_bar_color_5">"Цвет вертикальной полосы коммента 5"</string> - <string name="theme_item_comment_vertical_bar_color_5_detail">"Применяется к: Вертикальная полоса комментов (Уровень 5)"</string> - <string name="theme_item_comment_vertical_bar_color_6">"Цвет вертикальной полосы коммента 6"</string> - <string name="theme_item_comment_vertical_bar_color_6_detail">"Применяется к: Вертикальная полоса комментов (Уровень 6)"</string> - <string name="theme_item_comment_vertical_bar_color_7">"Цвет вертикальной полосы коммента 7"</string> - <string name="theme_item_comment_vertical_bar_color_7_detail">"Применяется к: Вертикальная полоса комментов (Уровень 7)"</string> + <string name="theme_item_vote_and_reply_unavailable_button_color_detail">"Применяется к: кнопки голосования и ответа (недоступные)"</string> + <string name="theme_item_comment_vertical_bar_color_1">"Цвет вертикальной полосы комментария 1"</string> + <string name="theme_item_comment_vertical_bar_color_1_detail">"Применяется к: вертикальная полоса комментариев (уровень 1)"</string> + <string name="theme_item_comment_vertical_bar_color_2">"Цвет вертикальной полосы комментария 2"</string> + <string name="theme_item_comment_vertical_bar_color_2_detail">"Применяется к: вертикальная полоса комментариев (уровень 2)"</string> + <string name="theme_item_comment_vertical_bar_color_3">"Цвет вертикальной полосы комментария 3"</string> + <string name="theme_item_comment_vertical_bar_color_3_detail">"Применяется к: вертикальная полоса комментариев (уровень 3)"</string> + <string name="theme_item_comment_vertical_bar_color_4">"Цвет вертикальной полосы комментария 4"</string> + <string name="theme_item_comment_vertical_bar_color_4_detail">"Применяется к: вертикальная полоса комментариев (уровень 4)"</string> + <string name="theme_item_comment_vertical_bar_color_5">"Цвет вертикальной полосы комментария 5"</string> + <string name="theme_item_comment_vertical_bar_color_5_detail">"Применяется к: вертикальная полоса комментариев (уровень 5)"</string> + <string name="theme_item_comment_vertical_bar_color_6">"Цвет вертикальной полосы комментария 6"</string> + <string name="theme_item_comment_vertical_bar_color_6_detail">"Применяется к: вертикальная полоса комментариев (уровень 6)"</string> + <string name="theme_item_comment_vertical_bar_color_7">"Цвет вертикальной полосы комментария 7"</string> + <string name="theme_item_comment_vertical_bar_color_7_detail">"Применяется к: вертикальная полоса комментариев (уровень 7)"</string> <string name="theme_item_nav_bar_color">"Цвет панели навигации"</string> - <string name="theme_item_nav_bar_color_detail">"Применяется к: Панель навигации"</string> + <string name="theme_item_nav_bar_color_detail">"Применяется к: панель навигации"</string> <string name="theme_item_light_status_bar">"Цвет значка тёмной строки состояния"</string> <string name="theme_item_light_nav_bar">"Цвет значка тёмной панели навигации"</string> - <string name="theme_item_change_status_bar_icon_color_after_toolbar_collapsed_in_immersive_interface">"Изменить цвет значка строки состояния после свертывания панели инструментов в иммерсивном интерфейсе"</string> + <string name="theme_item_change_status_bar_icon_color_after_toolbar_collapsed_in_immersive_interface">"Изменить цвет значка строки состояния после свёртывания панели инструментов в режиме погружения"</string> <string name="theme_item_available_on_android_8">"Доступно только для Android 8.0 или более поздних версий."</string> <string name="theme_item_available_on_android_6">"Доступно только для Android 6.0 или более поздних версий."</string> <string name="predefined_themes">"Предопределённые темы"</string> @@ -652,38 +656,38 @@ https://play.google.com/store/apps/details?id=ml.docilealligator.infinityforredd <string name="no_theme_name">"Как называется эта тема?"</string> <string name="theme_name_hint">"Название темы"</string> <string name="theme_name_indigo">"Индиго"</string> - <string name="theme_name_indigo_dark">"Тёмный Индиго"</string> - <string name="theme_name_indigo_amoled">"Индиго Amoled"</string> + <string name="theme_name_indigo_dark">"Тёмный индиго"</string> + <string name="theme_name_indigo_amoled">"Индиго AMOLED"</string> <string name="theme_name_white">"Белая"</string> - <string name="theme_name_white_dark">"Тёмный белый"</string> - <string name="theme_name_white_amoled">"Белый Amoled"</string> + <string name="theme_name_white_dark">"Тёмно-белая"</string> + <string name="theme_name_white_amoled">"Белая AMOLED"</string> <string name="theme_name_red">"Красная"</string> <string name="theme_name_red_dark">"Тёмный красный"</string> - <string name="theme_name_red_amoled">"Красный Amoled"</string> + <string name="theme_name_red_amoled">"Красная AMOLED"</string> <string name="theme_name_dracula">"Дракула"</string> <string name="theme_name_calm_pastel">"Спокойная пастель"</string> <string name="create_light_theme">"Создать светлую тему -Основа на теме индиго"</string> +На основе темы «Индиго»"</string> <string name="create_dark_theme">"Создать тёмную тему -Основа на тёмной теме индиго"</string> - <string name="create_amoled_theme">"Создать тему Amoled -Основа на теме индиго Amoled"</string> - <string name="create_theme_info">"Если вы хотите создать тему на основе другой темы, нажмите \\"+\\" на теме."</string> +На основе темы «Тёмный индиго»"</string> + <string name="create_amoled_theme">"Создать тему AMOLED +На основе темы «Индиго AMOLED»"</string> + <string name="create_theme_info">"Если вы хотите создать тему на основе другой темы, нажмите на той теме «+»."</string> <string name="edit_theme_name">"Изменить название темы"</string> <string name="edit_theme">"Изменить тему"</string> <string name="delete_theme">"Удалить тему"</string> - <string name="delete_theme_dialog_message">"Вы действительно хотите удалить тему %1$s?"</string> + <string name="delete_theme_dialog_message">"Удалить тему %1$s?"</string> <string name="share_theme">"Поделиться темой"</string> - <string name="change_theme_name">"Сменить имя"</string> + <string name="change_theme_name">"Сменить название"</string> <string name="theme_copied">"Скопировано! Вставьте и поделитесь с другими людьми."</string> <string name="copy_theme_faied">"Невозможно скопировать конфигурацию темы"</string> <string name="cannot_find_theme">"Не могу найти эту тему"</string> <string name="import_theme">"Импортировать тему"</string> - <string name="no_data_in_clipboard">"Не удаётся найти данные в буфере обмена"</string> + <string name="no_data_in_clipboard">"Не удалось найти данные в буфере обмена"</string> <string name="import_theme_success">"Тема успешно импортирована"</string> <string name="parse_theme_failed">"Ошибка синтаксического анализа темы"</string> <string name="duplicate_theme_name_dialog_title">"Обнаружен дубликат темы"</string> - <string name="duplicate_theme_name_dialog_message">"Тема в базе данных также называется %1$s. Вы хотите изменить название этой импортированной темы?"</string> + <string name="duplicate_theme_name_dialog_message">"Тема в базе данных также называется %1$s. Изменить название этой импортированной темы?"</string> <string name="rename">"Переименовать"</string> <string name="override">"Переопределить"</string> <string name="color_picker">"Палитра цветов"</string> @@ -703,13 +707,13 @@ https://play.google.com/store/apps/details?id=ml.docilealligator.infinityforredd <string name="post_content_preview">"Эта шутка о гравитации уже устарела, но я каждый раз попадаюсь на неё."</string> <string name="post_type_preview">"ПОСТ"</string> <string name="flair_preview">"Флейр"</string> - <string name="awards_preview">"Награды"</string> + <string name="awards_preview">"4 награды"</string> <string name="author_flair_preview">"Флейр автора"</string> <string name="comment_content_preview">"Я подарил своей девушке карточку «Поправляйся скорее». Она не больна или что-то вроде того, но определённо может поправиться."</string> - <string name="edit_multi_reddit">"Изменить МультиРеддит"</string> + <string name="edit_multi_reddit">"Изменить мультиреддит"</string> <string name="delete_multi_reddit">"Удалить мультиреддит"</string> - <string name="n_awards">%1$d наград</string> + <string name="n_awards">"%1$d наград"</string> <string name="one_award">"1 награда"</string> <string name="report">"Отчёт"</string> <string name="reporting">"Отчёт отправляется"</string> @@ -729,17 +733,17 @@ https://play.google.com/store/apps/details?id=ml.docilealligator.infinityforredd <string name="fetch_redgifs_video_failed">"Не удалось получить видео Redgifs"</string> <string name="fetching_video_info_please_wait">"Получение информации о видео. Пожалуйста, подождите."</string> <string name="error_fetching_imgur_media">"Невозможно загрузить изображения"</string> - <string name="downloading_reddit_video">"Загрузка Видеодорожки"</string> - <string name="downloading_reddit_video_audio_track">"Загрузка Аудиодорожки"</string> + <string name="downloading_reddit_video">"Загрузка видео"</string> + <string name="downloading_reddit_video_audio_track">"Загрузка аудио"</string> <string name="downloading_reddit_video_muxing">"Микширование видео и аудио"</string> <string name="downloading_reddit_video_save_file_to_public_dir">"Сохранение видео"</string> <string name="downloading_reddit_video_finished">"Загружено"</string> - <string name="downloading_reddit_video_failed_cannot_get_cache_directory">"Ошибка загрузки: не удаётся получить доступ к каталогу кэша"</string> - <string name="downloading_reddit_video_failed_cannot_download_video">"Ошибка загрузки: не удаётся загрузить видео"</string> - <string name="downloading_reddit_video_failed_cannot_save_video">"Ошибка загрузки: не удаётся сохранить видео в каталог кэша"</string> - <string name="downloading_reddit_video_failed_cannot_save_audio">"Ошибка загрузки: не удаётся сохранить аудио в каталог кэша"</string> - <string name="downloading_reddit_video_failed_cannot_mux">"Ошибка загрузки: не удаётся смикшировать видео и аудио"</string> - <string name="downloading_reddit_video_failed_cannot_save_mux_video">"Ошибка загрузки: не удаётся сохранить видео в общий каталог"</string> + <string name="downloading_reddit_video_failed_cannot_get_cache_directory">"Ошибка загрузки: не удалось получить доступ к папке кэша"</string> + <string name="downloading_reddit_video_failed_cannot_download_video">"Ошибка загрузки: не удалось загрузить видео"</string> + <string name="downloading_reddit_video_failed_cannot_save_video">"Ошибка загрузки: не удалось сохранить видео в папку кэша"</string> + <string name="downloading_reddit_video_failed_cannot_save_audio">"Ошибка загрузки: не удалось сохранить аудио в папку кэша"</string> + <string name="downloading_reddit_video_failed_cannot_mux">"Ошибка загрузки: не удалось смикшировать видео и аудио"</string> + <string name="downloading_reddit_video_failed_cannot_save_mux_video">"Ошибка загрузки: не удалось сохранить видео в общую папку"</string> <string name="wallpaper_set">"Установить обои"</string> <string name="error_set_wallpaper">"Установить как обои"</string> <string name="set_to_home_screen">"Закрепить на домашнем экране"</string> @@ -748,15 +752,15 @@ https://play.google.com/store/apps/details?id=ml.docilealligator.infinityforredd <string name="default_font_font_preview">"По умолчанию"</string> <string name="load_video_in_redgifs">"Попробуйте загрузить видео на Redgifs"</string> <string name="top_score">"%1$s пойнтов"</string> - <string name="login_activity_2fa_prompt">"Если у вас включена двухфакторная аутентификация, введите свой пароль, как показано ниже.: &lt;password&gt;:&lt;2FA code&gt;. + <string name="login_activity_2fa_prompt">"Если у вас включена двухфакторная аутентификация, введите пароль, как показано ниже: &lt;password&gt;:&lt;2FA code&gt;. Пример: yourpass:123456"</string> - <string name="block_user">"Заблокировать Пользователя"</string> + <string name="block_user">"Заблокировать пользователя"</string> <string name="block_user_success">"Заблокирован"</string> <string name="block_user_failed">"Ошибка блокировки пользователя"</string> <string name="submit_crosspost_activity_label">"Кросспост"</string> <string name="give_award_activity_label">"Наградить"</string> <string name="action_crosspost">"Кросспост"</string> - <string name="action_select_user_flair">"Установить флейр пользователя"</string> + <string name="action_select_user_flair">"Установить флaйр пользователя"</string> <string name="action_give_award">"Выдать награду"</string> <string name="posts">"Посты"</string> <string name="sidebar">"Боковая панель"</string> @@ -776,42 +780,42 @@ https://play.google.com/store/apps/details?id=ml.docilealligator.infinityforredd <string name="settings_more_tabs_show_subscribed_subreddits_title">"Показывать сабреддиты из подписок"</string> <string name="settings_download_location_title">"Папка для загрузок"</string> <string name="settings_image_download_location_title">"Папка для изображений"</string> - <string name="settings_gif_download_location_title">"Папка для гифок"</string> + <string name="settings_gif_download_location_title">"Папка для GIF"</string> <string name="settings_video_download_location_title">"Папка для видео"</string> <string name="settings_separate_folder_for_each_subreddit">"Отдельная папка для каждого сабреддита"</string> - <string name="settings_swipe_action_title">"Свайп"</string> + <string name="settings_swipe_action_title">"Жест"</string> <string name="settings_disable_swiping_between_tabs_title">"Отключить перелистывание вкладок"</string> - <string name="settings_enable_swipe_action_title">"Включить свайпы"</string> + <string name="settings_enable_swipe_action_title">"Включить жест"</string> <string name="settings_swipe_action_threshold">"Предел"</string> - <string name="settings_pull_to_refresh_title">"Потяните чтобы обновить"</string> + <string name="settings_pull_to_refresh_title">"Потяните, чтобы обновить"</string> <string name="settings_security_title">"Безопасность"</string> - <string name="settings_require_authentication_to_go_to_account_section_in_navigation_drawer_title">"Запрашивать аутентификацию для перехода в раздел \"Аккаунт\" в панели навигации"</string> - <string name="settings_long_press_to_hide_toolbar_in_compact_layout_title">"Удерживать - скрытие панели инструментов в компакте"</string> + <string name="settings_require_authentication_to_go_to_account_section_in_navigation_drawer_title">"Запрашивать аутентификацию для перехода в раздел «Аккаунт» в панели навигации"</string> + <string name="settings_long_press_to_hide_toolbar_in_compact_layout_title">"Удерживать – скрытие панели инструментов в компакте"</string> <string name="settings_post_compact_layout_toolbar_hidden_by_default_title">"Панель инструментов в компактом макете скрыта по умолчанию"</string> <string name="settings_customize_bottom_app_bar_title">"Настроить нижнюю панель навигации"</string> <string name="settings_main_activity_bottom_app_bar_group_summary">"Главная страница"</string> <string name="settings_other_activities_bottom_app_bar_group_summary">"Другие страницы"</string> <string name="settings_bottom_app_bar_option_count">"Количество вариантов"</string> - <string name="settings_bottom_app_bar_option_1">"Опция 1"</string> - <string name="settings_bottom_app_bar_option_2">"Опция 2"</string> - <string name="settings_bottom_app_bar_option_3">"Опция 3"</string> - <string name="settings_bottom_app_bar_option_4">"Опция 4"</string> + <string name="settings_bottom_app_bar_option_1">"Действие 1"</string> + <string name="settings_bottom_app_bar_option_2">"Действие 2"</string> + <string name="settings_bottom_app_bar_option_3">"Действие 3"</string> + <string name="settings_bottom_app_bar_option_4">"Действие 4"</string> <string name="settings_bottom_app_bar_fab">"Плавающая кнопка действий"</string> <string name="settings_data_saving_mode">"Режим экономии трафика"</string> <string name="settings_data_saving_mode_info_summary">"В режиме экономии трафика: -Превью изображений - уменьшенное разрешение. -Reddit видео - уменьшенное разрешение. +Просмотр изображений – уменьшенное разрешение. +Видео Reddit – уменьшенное разрешение. Автовоспроизведение видео отключено."</string> <string name="settings_translation_title">"Перевод"</string> <string name="settings_translation_summary">"Переводите это приложение на POEditor. Благодарю всех за ваш вклад."</string> <string name="settings_credits_national_flags">"Национальные флаги"</string> - <string name="settings_credits_national_flags_summary">"Иконка создана Freepik из www.flaticon.com"</string> + <string name="settings_credits_national_flags_summary">"Значок создан Freepik из www.flaticon.com"</string> <string name="copy_failed">"Не удалось скопировать"</string> <string name="delete_all_legacy_settings_success">"Все старые настройки успешно удалены"</string> <string name="downloading_media_finished">"Скачано"</string> - <string name="downloading_image_or_gif_failed_cannot_get_destination_directory">"Ошибка при скачивании: не удалось получить доступ к каталогу"</string> + <string name="downloading_image_or_gif_failed_cannot_get_destination_directory">"Ошибка при скачивании: не удалось получить доступ к папке"</string> <string name="downloading_media_failed_cannot_download_media">"Ошибка при скачивании"</string> - <string name="downloading_media_failed_cannot_save_to_destination_directory">"Ошибка при скачивании: Не удалось сохранить файл в конечный каталог"</string> + <string name="downloading_media_failed_cannot_save_to_destination_directory">"Ошибка при скачивании: не удалось сохранить файл в целевую папку"</string> <string name="view_full_comment_markdown">"Посмотреть полный Markdown"</string> <string name="select_user_flair_success">"Флейр пользователя выбран"</string> <string name="select_this_user_flair">"Выбрать флейр пользователя?"</string> @@ -834,8 +838,8 @@ Reddit видео - уменьшенное разрешение. <string name="give_award_success">"Награда выдана"</string> <string name="give_award_failed">"Ошибка"</string> <string name="warning">"Предупреждение"</string> - <string name="this_is_a_nsfw_subreddit">"Это NSFW сабреддит"</string> - <string name="this_user_has_nsfw_content">"У пользователь есть NSFW контент"</string> + <string name="this_is_a_nsfw_subreddit">"Это NSFW-сабреддит"</string> + <string name="this_user_has_nsfw_content">"У пользователь есть NSFW-контент"</string> <string name="dismiss">"Отклонить"</string> <string name="leave">"Покинуть"</string> <string name="go_to_subreddit">"Перейти к сабреддиту"</string> @@ -843,9 +847,9 @@ Reddit видео - уменьшенное разрешение. <string name="go_to_thing_hint">"Имя"</string> <string name="random">"Случайно"</string> <string name="random_subreddit">"Случайный сабреддит"</string> - <string name="random_nsfw_subreddit">"Случайный NSFW сабреддит"</string> + <string name="random_nsfw_subreddit">"Случайный NSFW-сабреддит"</string> <string name="random_post">"Случайный пост"</string> - <string name="random_nsfw_post">"Случайный NSFW пост"</string> + <string name="random_nsfw_post">"Случайный NSFW-пост"</string> <string name="fetch_random_thing_failed">"Попробуйте позже"</string> <string name="downloading">"Скачивание"</string> <string name="subreddit_filter_popular_and_all_activity_label">"r/all и r/popular"</string> @@ -859,31 +863,31 @@ Reddit видео - уменьшенное разрешение. <string name="settings_swipe_action_haptic_feedback_title">"Тактильная отдача"</string> <string name="settings_hide_subreddit_description_title">"Скрыть описание сабреддитов"</string> <string name="settings_disable_image_preview_title">"Отключить предпросмотр изображения в режиме экономии трафика"</string> - <string name="settings_swipe_action_swipe_left_title">"Свайп влево"</string> - <string name="settings_swipe_action_swipe_right_title">"Свайп вправо"</string> + <string name="settings_swipe_action_swipe_left_title">"Жест влево"</string> + <string name="settings_swipe_action_swipe_right_title">"Жест вправо"</string> <string name="settings_swipe_action_info_summary">"Не для ленты новостей > 1 столбца или деталей поста."</string> - <string name="theme_item_no_preview_post_type_icon_tint">"Цвет иконки типа поста без превью"</string> - <string name="theme_item_no_preview_post_type_icon_tint_detail">"Применяется к: Иконка, показывающая тип поста без доступного превью"</string> - <string name="theme_item_no_preview_post_type_background_color">"Цвет заднего фона поста без превью"</string> - <string name="theme_item_no_preview_post_type_background_color_detail">"Применяется к: Заплатка, показывающая тип поста без доступного превью"</string> + <string name="theme_item_no_preview_post_type_icon_tint">"Цвет значка типа поста без предпросмотра"</string> + <string name="theme_item_no_preview_post_type_icon_tint_detail">"Применяется к: значок, показывающий тип поста без доступного предпросмотра"</string> + <string name="theme_item_no_preview_post_type_background_color">"Цвет заднего фона поста без предпросмотра"</string> + <string name="theme_item_no_preview_post_type_background_color_detail">"Применяется к: заплатка, показывающая тип поста без доступного предпросмотра"</string> <string name="settings_language_title">"Язык"</string> <string name="customize_post_filter_activity_label">"Настроить фильтр постов"</string> <string name="filtered_posts_activity_subtitle">"Фильтрованные посты"</string> <string name="post_filter_preference_activity_label">"Фильтр постов"</string> <string name="search_users_result_activity_label">"Пользователи"</string> - <string name="multireddit_selection_activity_label">"Выберите МультиРеддит"</string> + <string name="multireddit_selection_activity_label">"Выберите мультиреддит"</string> <string name="action_save_to_database">"Сохранить в базе данных"</string> <string name="action_read_all_messages">"Читать все сообщения"</string> - <string name="action_add_to_multireddit">"Добавить в МультиРеддит"</string> + <string name="action_add_to_multireddit">"Добавить в мультиреддит"</string> <string name="search_only_subreddits_hint">"Искать сабреддиты"</string> <string name="search_only_users_hint">"Искать пользователя"</string> <string name="post_type_gif">"GIF"</string> <string name="post_type_gallery">"Галерея"</string> - <string name="settings_disable_immersive_interface_in_landscape_mode">"Отключить иммерсивный режим в ландшафтном режиме"</string> + <string name="settings_disable_immersive_interface_in_landscape_mode">"Отключить режим погружения в ландшафтном режиме"</string> <string name="settings_privacy_policy_title">"Политика конфиденциальности"</string> <string name="settings_delete_read_posts_in_database_title">"Удалить все прочтённые посты из базы данных"</string> <string name="settings_post_filter_title">"Фильтр постов"</string> - <string name="settings_only_disable_preview_in_video_and_gif_posts_title">"Отключить превью только в постах с видео и GIF"</string> + <string name="settings_only_disable_preview_in_video_and_gif_posts_title">"Отключить предпросмотр только в постах с видео и GIF"</string> <string name="settings_enable_search_history_title">"Включить историю поиска"</string> <string name="settings_post_history_title">"История поста"</string> <string name="settings_mark_posts_as_read_title">"Отметить посты как прочтённые"</string> @@ -899,11 +903,11 @@ Reddit видео - уменьшенное разрешение. <string name="open_link">"Открыть ссылку"</string> <string name="select_subreddits_and_users">"Выбрать сабреддиты и пользователей"</string> <string name="theme_item_read_post_title_color">"Цвет заголовка прочтённого поста"</string> - <string name="theme_item_read_post_title_color_detail">"Применяется к: Заголовок прочтённого поста"</string> + <string name="theme_item_read_post_title_color_detail">"Применяется к: заголовок прочтённого поста"</string> <string name="theme_item_read_post_content_color">"Цвет содержимого прочтённого поста"</string> - <string name="theme_item_read_post_content_color_detail">"Применяется к: Содержимое прочтённого поста"</string> + <string name="theme_item_read_post_content_color_detail">"Применяется к: содержимое прочтённого поста"</string> <string name="theme_item_read_post_card_view_background_color">"Цвет фона карточки прочтённого поста"</string> - <string name="theme_item_read_post_card_view_background_color_detail">"Применяется к: Фон прочтённого поста"</string> + <string name="theme_item_read_post_card_view_background_color_detail">"Применяется к: фон прочтённого поста"</string> <string name="delete_all_read_posts_success">"Все прочтённые посты успешно удалены"</string> <string name="hide_read_posts">"Скрыть прочтённые посты"</string> <string name="filter_posts">"Фильтр постов"</string> @@ -911,19 +915,19 @@ Reddit видео - уменьшенное разрешение. <string name="only_spoiler">"Только спойлер"</string> <string name="title_excludes_strings_hint">"Заголовок: исключая ключевые слова (key1,key2)"</string> <string name="title_excludes_regex_hint">"Заголовок: исключая регулярное выражение"</string> - <string name="exclude_subreddits_hint">"Исключить сабреддиты (e.g. funny,AskReddit)"</string> - <string name="exclude_users_hint">"Исключить пользователей (e.g. Hostilenemy,random)"</string> - <string name="exclude_flairs_hint">"Исключить флейры (e.g. flair1,flair2)"</string> - <string name="contain_flairs_hint">"Содержит флейры (e.g. flair1,flair2)"</string> + <string name="exclude_subreddits_hint">"Исключить сабреддиты (например: funny,AskReddit)"</string> + <string name="exclude_users_hint">"Исключить пользователей (например: Hostilenemy,random)"</string> + <string name="exclude_flairs_hint">"Исключить флейры (например: flair1,flair2)"</string> + <string name="contain_flairs_hint">"Содержит флейры (например: flair1,flair2)"</string> <string name="min_vote_hint">"Минимум голосов (-1: без ограничений)"</string> <string name="max_vote_hint">"Максимум голосов (-1: без ограничений)"</string> - <string name="min_comments_hint">"Минимум комментов (-1: без ограничений)"</string> - <string name="max_comments_hint">"Максимум комментов (-1: без ограничений)"</string> + <string name="min_comments_hint">"Минимум комментариев (-1: без ограничений)"</string> + <string name="max_comments_hint">"Максимум комментариев (-1: без ограничений)"</string> <string name="min_awards_hint">"Минимум наград (-1: без ограничений)"</string> <string name="max_awards_hint">"Максимум наград (-1: без ограничений)"</string> - <string name="post_filter_name_hint">"Имя фильтра постов"</string> + <string name="post_filter_name_hint">"Название фильтра постов"</string> <string name="post_filter_requires_a_name">"Как называется этот фильтр постов?"</string> - <string name="duplicate_post_filter_dialog_title">"\'%1$s\' уже существует"</string> + <string name="duplicate_post_filter_dialog_title">"«%1$s» уже существует"</string> <string name="duplicate_post_filter_dialog_message">"Переопределить это?"</string> <string name="apply_post_filter_to">"Применить к"</string> <string name="post_filter_usage_home">"Домашняя"</string> @@ -931,12 +935,12 @@ Reddit видео - уменьшенное разрешение. <string name="post_filter_usage_subreddit_all">"Сабреддит"</string> <string name="post_filter_usage_user">"Пользователь: %1$s"</string> <string name="post_filter_usage_user_all">"Пользователь"</string> - <string name="post_filter_usage_multireddit">"МультиРеддит: %1$s"</string> - <string name="post_filter_usage_multireddit_all">"МультиРеддит"</string> + <string name="post_filter_usage_multireddit">"Мультиреддит: %1$s"</string> + <string name="post_filter_usage_multireddit_all">"Мультиреддит"</string> <string name="post_filter_usage_search">"Поиск"</string> <string name="subreddit">"Сабреддит"</string> <string name="user">"Пользователь"</string> - <string name="edit_post_filter_name_of_usage_info">"Оставьте его пустым, чтобы применить этот фильтр постов ко всем сабреддитам / пользователям / мультиреддитам"</string> + <string name="edit_post_filter_name_of_usage_info">"Оставьте пустым, чтобы применить этот фильтр постов ко всем сабреддитам / пользователям / мультиреддитам"</string> <string name="read_all_messages_time_limit">"Вы делаете это слишком часто. Попробуйте позже. Это ограничение скорости Reddit API."</string> <string name="read_all_messages_success">"Все сообщения успешно прочтены"</string> <string name="read_all_messages_failed">"Невозможно прочитать все сообщения"</string> @@ -948,62 +952,64 @@ Reddit видео - уменьшенное разрешение. <string name="settings_hide_the_number_of_awards">"Скрыть количество наград"</string> <string name="settings_hide_subreddit_and_user_prefix">"Скрыть префикс сабреддита и пользователя"</string> <string name="settings_hide_the_number_of_votes">"Скрыть количество голосов"</string> - <string name="settings_hide_the_number_of_comments">"Скрыть количество комментов"</string> + <string name="settings_hide_the_number_of_comments">"Скрыть количество комментариев"</string> <string name="post_layout_gallery">"Галерея"</string> - <string name="post_layout_card_2">"Карточки 2"</string> + <string name="post_layout_card_2">"Карточный стиль 2"</string> <string name="have_trouble_login_title">"Проблемы со входом"</string> <string name="have_trouble_login_message">"Хотите попробовать другой способ авторизации?"</string> <string name="vote">"Голос"</string> <string name="action_share_link">"Поделиться ссылкой"</string> <string name="action_copy_link">"Копировать ссылку"</string> <string name="action_add_to_post_filter">"Добавить пост в фильтр"</string> - <string name="settings_do_not_blur_nsfw_in_nsfw_subreddits_title">"NSFW посты в NSFW сабреддитах без размытия"</string> + <string name="settings_do_not_blur_nsfw_in_nsfw_subreddits_title">"NSFW-посты в NSFW-сабреддитах без размытия"</string> + + <!-- Fuzzy --> <string name="settings_show_avatar_on_the_right">"Показывать аватар слева"</string> - <string name="settings_backup_settings_title">"Настройки резервного копирования"</string> + <string name="settings_backup_settings_title">"Резервное копирование настроек"</string> <string name="settings_restore_settings_title">"Восстановить настройки"</string> <string name="settings_credits_love_animation_title">"Анимация любви"</string> - <string name="settings_swipe_between_posts_title">"Свайп между постами"</string> + <string name="settings_swipe_between_posts_title">"Жест между постами"</string> <string name="settings_navigation_drawer_title">"Боковая панель"</string> - <string name="settings_collapse_account_section_title">"Свернуть секцию аккаунта"</string> - <string name="settings_collapse_post_section_title">"Свернуть секцию поста"</string> + <string name="settings_collapse_account_section_title">"Свернуть раздел аккаунта"</string> + <string name="settings_collapse_post_section_title">"Свернуть раздел поста"</string> <string name="settings_collapse_preferences_section_title">"Свернуть раздел настроек"</string> - <string name="settings_collapse_favorite_subreddits_section_title">"Свернуть секцию избранных сабреддитов"</string> - <string name="settings_collapse_subscribed_subreddits_section_title">"Свернуть секцию сабреддитов в подписках"</string> + <string name="settings_collapse_favorite_subreddits_section_title">"Свернуть раздел избранных сабреддитов"</string> + <string name="settings_collapse_subscribed_subreddits_section_title">"Свернуть раздел сабреддитов в подписках"</string> <string name="settings_hide_favorite_subreddits_sections_title">"Скрыть раздел избранных сабреддитов"</string> <string name="settings_hide_subscribed_subreddits_sections_title">"Скрыть раздел сабреддитов с подпиской"</string> <string name="settings_default_search_result_tab">"Вкладка результатов поиска"</string> <string name="device_default">"По умолчанию устройства"</string> <string name="set_by_battery_saver">"Устанавливается функцией экономии заряда батареи"</string> <string name="theme_item_upvote_ratio_icon_tint">"Цвет значка соотношения голосов"</string> - <string name="theme_item_upvote_ratio_icon_tint_detail">"Применяется к: Значок соотношения голосов"</string> + <string name="theme_item_upvote_ratio_icon_tint_detail">"Применяется к: значок соотношения голосов"</string> <string name="theme_item_current_user_color">"Текущий пользователь"</string> - <string name="theme_item_current_user_color_detail">"Применяется к: Текущий пользователь в комментариях"</string> + <string name="theme_item_current_user_color_detail">"Применяется к: текущий пользователь в комментариях"</string> <string name="exclude_domains_hint">"Исключить домены"</string> <string name="anonymous_front_page_no_subscriptions">"Начните с присоединения к сабреддиту!"</string> - <string name="backup_settings_success">"Настройки успешно экспортированы в выбранный каталог. Пароль сгенерированного zip-файла - 123321. Пожалуйста, не изменяйте zip-файл."</string> - <string name="create_zip_in_destination_directory_failed">"Не удалось создать резервную копию zip-архива в целевом каталоге"</string> - <string name="backup_some_settings_failed">"Не удалось создать резервную копию некоторых настроек, но другие были успешно экспортированы в целевой каталог."</string> + <string name="backup_settings_success">"Настройки успешно экспортированы в выбранную папку. Пароль созданного zip-файла – 123321. Пожалуйста, не изменяйте zip-файл."</string> + <string name="create_zip_in_destination_directory_failed">"Не удалось создать zip-архив с резервной копией настроек в выбранной папке."</string> + <string name="backup_some_settings_failed">"Не удалось создать резервную копию некоторых настроек, но другие были успешно экспортированы в выбранную папку."</string> <string name="restore_settings_success">"Настройки успешно восстановлены. Перезапустите приложение, чтобы увидеть изменения."</string> <string name="restore_settings_partially_failed">"Некоторые настройки не могут быть восстановлены. Перезапустите приложение, чтобы увидеть изменения."</string> <string name="restore_settings_failed_file_corrupted">"Невозможно восстановить настройки. Возможно, файл повреждён."</string> <string name="restore_settings_failed_cannot_get_file">"Нет доступа к файлу"</string> - <string name="suicide_prevention_quote">"Если вы ищете знак, чтобы не убивать себя, то вот он.❤"</string> + <string name="suicide_prevention_quote">"Если вы ищете знак, чтобы не убивать себя, то вот он: ❤"</string> <string name="do_not_show_this_again">"Больше не показывать"</string> <string name="continue_suicide_prevention_activity">"Продолжить"</string> - <string name="error_fetching_v_redd_it_video_cannot_get_redirect_url">"Ошибка при получении видео v.redd.it: не удаётся получить URL-адрес перенаправления"</string> - <string name="error_fetching_v_redd_it_video_cannot_get_post">"Ошибка при загрузке видео v.redd.it: не удаётся получить пост"</string> - <string name="error_fetching_v_redd_it_video_cannot_get_post_id">"Ошибка при загрузке видео v.redd.it: не удаётся получить идентификатор поста"</string> + <string name="error_fetching_v_redd_it_video_cannot_get_redirect_url">"Ошибка при получении видео v.redd.it: не удалось получить URL-адрес перенаправления"</string> + <string name="error_fetching_v_redd_it_video_cannot_get_post">"Ошибка при загрузке видео v.redd.it: не удалось получить пост"</string> + <string name="error_fetching_v_redd_it_video_cannot_get_post_id">"Ошибка при загрузке видео v.redd.it: не удалось получить идентификатор поста"</string> <string name="always_on">"Всегда включено"</string> - <string name="only_on_wifi">"Только через WI-FI"</string> + <string name="only_on_wifi">"Только через Wi-Fi"</string> <string name="never">"Никогда"</string> - <string name="normal">"Нормально"</string> + <string name="normal">"Нормальный"</string> <string name="extra_large">"Очень большой"</string> <string name="enormously_large">"Невероятно большой"</string> <string name="default_in_array">"По умолчанию"</string> <string name="off">"Выкл."</string> <string name="only_on_cellular_data">"Только через мобильные данные"</string> - <string name="upvote">"Апвоут"</string> - <string name="downvote">"Даунвоут"</string> + <string name="upvote">"Голос+"</string> + <string name="downvote">"Голос-"</string> <string name="select">"Выбрать"</string> <string name="exclude_subreddit">"Исключить этот сабреддит"</string> <string name="exclude_user">"Исключить этого пользователя"</string> @@ -1012,22 +1018,70 @@ Reddit видео - уменьшенное разрешение. <string name="exclude_domain">"Исключить домен"</string> <string name="suggest_title">"Предложить название"</string> <string name="suggest_title_failed">"Не удалось предложить название"</string> - <string name="action_delete_logs">"Удалить лог"</string> + <string name="action_delete_logs">"Удалить журнал"</string> <string name="inbox_with_count">"Входящие (%1$d)"</string> <string name="comment_continue_thread">"Продолжить обсуждение"</string> - <string name="settings_swipe_vertically_to_go_back_from_media_title">"Вертикальный свайп для закрытия мультимедии"</string> + + <!-- Fuzzy --> + <string name="settings_swipe_vertically_to_go_back_from_media_title">"Вертикальный жест для закрытия мультимедиа"</string> <string name="settings_hide_post_flair">"Скрыть флейр поста"</string> <string name="settings_crash_reports_title">"Отчёты о сбоях"</string> <string name="settings_nsfw_and_spoiler_dangerous_group_title">"Опасные"</string> <string name="settings_disable_nsfw_forever_title">"Отключить NSFW навсегда"</string> - <string name="settings_show_only_one_comment_level_indicator">"Показывать только один индикатор уровня коммента"</string> + <string name="settings_show_only_one_comment_level_indicator">"Показывать только один индикатор уровня комментария"</string> <string name="save_comment">"Сохранить"</string> <string name="unsave_comment">"Удалить"</string> - <string name="copy_multi_reddit_path">"Копировать путь МультиРеддита"</string> - <string name="copy_multi_reddit_path_failed">"Невозможно скопировать путь МультиРеддита"</string> + <string name="copy_multi_reddit_path">"Копировать путь мультиреддита"</string> + <string name="copy_multi_reddit_path_failed">"Невозможно скопировать путь мультиреддита"</string> <string name="crash_reports_deleted">"Отчёты о сбоях удаляются"</string> - <string name="disable_nsfw_forever_message">"После включения, NSFW будет навсегда отключено, независимо от того, включен параметр NSFW или нет. И эта опция необратима, единственный способ снова включить NSFW - это очистить данные приложения. + <string name="disable_nsfw_forever_message">"После включения NSFW будет навсегда отключено, независимо от того, включён параметр NSFW или нет. И эта функция необратима, единственный способ снова включить NSFW – это очистить данные приложения. Всё ещё хотите включить его?"</string> <string name="reply">"Ответ"</string> + <string name="rpan_activity_label">"RPAN"</string> + <string name="post_gallery_activity_label">"Пост в галерее"</string> + <string name="trending_activity_label">"Популярное"</string> + <string name="action_share_rpan_link">"Поделиться ссылкой RPAN"</string> + <string name="action_share_post_link">"Поделиться ссылкой на пост"</string> + <string name="rpan">"RPAN"</string> + <string name="trending">"Популярное"</string> + <string name="receive_post_reply_notifications">"Получать уведомления об ответах на пост"</string> + <string name="bottom_sheet_post_gallery">"Галерея"</string> + <string name="posting_gallery">"Галерея постов"</string> + <string name="label_reddit">"Reddit"</string> + <string name="settings_default_link_post_layout">"Вид поста со ссылками по умолчанию"</string> + <string name="settings_category_material_you_title">"Material You"</string> + <string name="settings_enable_material_you_warning_summary">"Убедитесь, что у вас нет тем с именами +«Material You», +«Material You Dark» или +«Material You Amoled». +В противном случае переименуйте их перед включением «Material You»."</string> + <string name="settings_enable_material_you_title">"Включить «Material You»"</string> + <string name="settings_enable_material_you_summary">"Персонализация Infinity на основе фонового изображения рабочего экрана"</string> + <string name="settings_apply_material_you_title">"Применить «Material You»"</string> + <string name="settings_apply_material_you_summary">"В случае, если приложение Infinity не изменило тему"</string> + <string name="settings_more_tabs_show_favorite_multireddits_title">"Показывать избранные мультиреддиты"</string> + <string name="settings_more_tabs_show_multireddits_title">"Показывать мультиреддиты"</string> + <string name="settings_collapse_reddit_section_title">"Свернуть раздел Reddit"</string> + <string name="settings_video_player_automatic_landscape_orientation">"Автоматически переключаться на альбомную ориентацию в видеопроигрывателе"</string> + <string name="settings_remember_muting_option_in_post_feed">"Запоминать отключение звука в ленте постов"</string> + <string name="link_post_layout_auto">"Автовыбор"</string> + <string name="uploaded_images">"Загруженные изображения"</string> + <string name="select_image">"Выберите изображение"</string> + <string name="capture">"Захват"</string> + <string name="uploading_image">"Загрузка"</string> + <string name="upload_image_success">"Изображение успешно загружено. Нажмите кнопку «Изображение» ещё раз, чтобы просмотреть загруженные изображения."</string> + <string name="get_image_bitmap_failed">"Невозможно получить растровое изображение"</string> + <string name="upload_image_failed">"Невозможно загрузить изображение"</string> + <string name="load_rpan_broadcasts_failed">"Невозможно загрузить широковещательные сообщения RPAN"</string> + <string name="parse_rpan_broadcasts_failed">"Невозможно разобрать широковещательные сообщения RPAN"</string> + <string name="parse_rpan_broadcast_failed">"Невозможно разобрать широковещательную передачу RPAN"</string> + <string name="search_comments">"Поиск комментариев"</string> + <string name="please_wait_image_is_uploading">"Изображение загружается, подождите."</string> + <string name="error_fetch_trending_search">"Не удалось получить популярные поисковые запросы. +Нажмите, чтобы повторить попытку."</string> + <string name="error_parse_trending_search">"Не удалось разобрать популярные поисковые запросы. +Нажмите, чтобы повторить попытку."</string> + <string name="no_trending_search">"Не удалось найти популярные поисковые запросы. +Нажмите, чтобы повторить попытку."</string> </resources>
\ No newline at end of file diff --git a/app/src/main/res/values-so/strings.xml b/app/src/main/res/values-so/strings.xml new file mode 100644 index 00000000..eadb8ed1 --- /dev/null +++ b/app/src/main/res/values-so/strings.xml @@ -0,0 +1,37 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <string name="login_activity_label">"Gal"</string> + <string name="comment_activity_label">"Dir Faallada"</string> + <string name="comment_activity_label_is_replying">"Ujawaab"</string> + <string name="post_text_activity_label">"Bandhig Qoraal"</string> + <string name="subreddit_selection_activity_label">"Dooro Bulsho"</string> + <string name="post_link_activity_label">"Bandhig Tixraac"</string> + <string name="post_image_activity_label">"Bandhig Sawir"</string> + <string name="post_video_activity_label">"Bandhig Muuqaal"</string> + <string name="rules_activity_label">"Sharciyada"</string> + <string name="search_subreddits_activity_label">"Bulshooyin"</string> + <string name="edit_post_activity_label">"Tifatir Bandhiga"</string> + <string name="edit_comment_activity_label">"Tifatir Faallada"</string> + <string name="view_message_activity_label">"Fariimaha"</string> + <string name="settings_activity_label">"Fadhiga"</string> + <string name="account_saved_thing_activity_label">"Lakaydiyay"</string> + <string name="create_multi_reddit_activity_label">"Samee Reddit-badane"</string> + <string name="subreddit_multiselection_activity_label">"Dooro Qaybaha"</string> + <string name="custom_theme_listing_activity_label">"Nashqado Gaar ah"</string> + <string name="customize_theme_activity_label">"Nashqadee"</string> + <string name="customize_theme_activity_create_theme_label">"Samee Nashqad"</string> + <string name="edit_multi_reddit_activity_label">"Tifatir Reddit-badane"</string> + <string name="selected_subeddits_activity_label">"Qaybaha Ladoortay"</string> + <string name="report_activity_label">"Wari"</string> + <string name="view_imgur_media_activity_image_label">"Sawirka %1$d/%2$d"</string> + <string name="view_imgur_media_activity_video_label">"Muuqaalka %1$d/%2$d"</string> + <string name="send_private_message_activity_label">"Dir farriin gaar ah"</string> + <string name="view_reddit_gallery_activity_image_label">"Sawirka %1$d/%2$d"</string> + <string name="view_reddit_gallery_activity_gif_label">"Gif %1$d/%2$d"</string> + <string name="view_reddit_gallery_activity_video_label">"Muuqaalka %1$d/%2$d"</string> + <string name="navigation_drawer_open">"Fur khaanada dhexsocodka"</string> + <string name="navigation_drawer_close">"Xidh khaanada dhexsocodka"</string> + <string name="action_download">"Daji"</string> + <string name="action_refresh">"Cusboonaysii"</string> + <string name="action_add_comment">"Ku dar faallo"</string> +</resources>
\ No newline at end of file diff --git a/app/src/main/res/values-tr-rTR/strings.xml b/app/src/main/res/values-tr-rTR/strings.xml index db64fe86..2656381c 100644 --- a/app/src/main/res/values-tr-rTR/strings.xml +++ b/app/src/main/res/values-tr-rTR/strings.xml @@ -236,6 +236,8 @@ Tekrar denemek için tıklayın."</string> <string name="search">"Arama"</string> <string name="posting_video">"Video Paylaşılıyor"</string> <string name="posting_image">"Fotoğraf Paylaşılıyor"</string> + + <!-- Fuzzy --> <string name="please_wait">"Lütfen bekleyin."</string> <string name="add_account">"Hesap ekle"</string> <string name="anonymous_account">"Anonim"</string> @@ -320,6 +322,8 @@ Tekrar denemek için tıklayın."</string> <string name="settings_volume_keys_navigate_posts_title">"Gönderilerde Gezinmek İçin Ses Tuşlarını Kullan"</string> <string name="settings_mute_video_title">"Videoları Sessize Al"</string> <string name="settings_mute_nsfw_video_title">"NSFW Videolarını Sessize Al"</string> + + <!-- Fuzzy --> <string name="settings_automatically_try_redgifs_title">"Gfycat'taki Videolar Kaldırılırsa Redgif'lere Erişmeyi Otomatik Olarak Dene"</string> <string name="settings_video_player_ignore_nav_bar_title">"Video Oynatıcısındaki Navigasyon Çubuğunu Yoksay"</string> <string name="settings_video_player_ignore_nav_bar_summary">"Video Denetleyicisinde Fazladan Kenar Olmasını Önle"</string> @@ -670,11 +674,11 @@ https://play.google.com/store/apps/details?id=ml.docilealligator.infinityforredd <string name="theme_name_dracula">"Drakula"</string> <string name="theme_name_calm_pastel">"Pastel Rengi"</string> <string name="create_light_theme">"Çivit Mavisi Renginde -Açık Tema Tabanı Oluştur"</string> +Açık Tema Şablonu Oluştur"</string> <string name="create_dark_theme">"Çivit Mavisi Renginde -Koyu Tema Tabanı Oluştur"</string> +Koyu Tema Şablonu Oluştur"</string> <string name="create_amoled_theme">"Çivit Mavisi Renginde -Amoled Tema Tabanı Oluştur"</string> +Amoled Tema Şablonu Oluştur"</string> <string name="create_theme_info">"Başka bir temaya dayalı tema oluşturmak istiyorsanız, bunun yerine bir temadaki \"+\" düğmesine tıklayın."</string> <string name="edit_theme_name">"Tema Adını Düzenle"</string> <string name="edit_theme">"Temayı Düzenle"</string> @@ -863,7 +867,7 @@ Sekmeler, diğerlerine geçtikten sonra tüm içeriği kaybedebilir. Bu, sayfay <string name="random_subreddit">"Rastgele Subreddit"</string> <string name="random_nsfw_subreddit">"Rastgele NSFW Subreddit'i"</string> <string name="random_post">"Rastgele Gönderi"</string> - <string name="random_nsfw_post">"Rastgele NSFW gönderisi"</string> + <string name="random_nsfw_post">"Rastgele NSFW Gönderisi"</string> <string name="fetch_random_thing_failed">"Daha sonra tekrar deneyin"</string> <string name="downloading">"İndiriliyor"</string> <string name="subreddit_filter_popular_and_all_activity_label">"r/all ve r/popular"</string> @@ -980,6 +984,8 @@ Sekmeler, diğerlerine geçtikten sonra tüm içeriği kaybedebilir. Bu, sayfay <string name="action_copy_link">"Bağlantıyı Kopyala"</string> <string name="action_add_to_post_filter">"Gönderi Filtresine Ekle"</string> <string name="settings_do_not_blur_nsfw_in_nsfw_subreddits_title">"NSFW Subredditlerindeki NSFW Görüntülerini bulanıklaştırma"</string> + + <!-- Fuzzy --> <string name="settings_show_avatar_on_the_right">"Avatarı Solda Göster"</string> <string name="settings_backup_settings_title">"Yedekleme Ayarları"</string> <string name="settings_restore_settings_title">"Ayarları Eski Haline Getir"</string> @@ -1039,6 +1045,8 @@ Sekmeler, diğerlerine geçtikten sonra tüm içeriği kaybedebilir. Bu, sayfay <string name="action_delete_logs">"Seyir Defterini Sil"</string> <string name="inbox_with_count">"Gelen Kutusu (%1$d)"</string> <string name="comment_continue_thread">"Konuya devam et"</string> + + <!-- Fuzzy --> <string name="settings_swipe_vertically_to_go_back_from_media_title">"Medyadan Geri Dönmek İçin Dikey Kaydır"</string> <string name="settings_hide_post_flair">"Gönderi Etiketini Gizle"</string> <string name="settings_crash_reports_title">"Kilitlenme Raporları"</string> @@ -1054,4 +1062,52 @@ Sekmeler, diğerlerine geçtikten sonra tüm içeriği kaybedebilir. Bu, sayfay Yine de etkinleştirmek istiyor musunuz?"</string> <string name="reply">"Yanıtla"</string> + + <!-- What is RPAN? --> + <string name="rpan_activity_label">"Canlı Yayın"</string> + <string name="post_gallery_activity_label">"Galeri Gönderisi"</string> + <string name="trending_activity_label">"Trendler"</string> + <string name="action_share_rpan_link">"Canlı Yayın Bağlantısını Paylaş"</string> + <string name="action_share_post_link">"Gönderi Bağlantısını Paylaş"</string> + <string name="rpan">"Canlı Yayın"</string> + <string name="trending">"Trendler"</string> + <string name="receive_post_reply_notifications">"Gönderi yanıtlanınca bildirimlerini al"</string> + <string name="bottom_sheet_post_gallery">"Galeri"</string> + <string name="posting_gallery">"Galeri Paylaşma"</string> + <string name="label_reddit">"Reddit"</string> + <string name="settings_default_link_post_layout">"Varsayılan Bağlantı Gönderisi Düzeni"</string> + <string name="settings_category_material_you_title">"Material You"</string> + <string name="settings_enable_material_you_warning_summary">"Şu adda temalarınız olmadığından emin olun; +\"Material You\", +\"Material You Dark\" veya +\"Material You Amoled\". +Yoksa, Material You'u etkinleştirmeden önce bunları yeniden adlandırın."</string> + <string name="settings_enable_material_you_title">"Material You'u Etkinleştir"</string> + <string name="settings_enable_material_you_summary">"Infinity'yi Duvar Kağıdına Göre Kişiselleştir"</string> + <string name="settings_apply_material_you_title">"Material You'u Uygula"</string> + <string name="settings_apply_material_you_summary">"Infinity'nin temayı değiştirmemesi durumunda"</string> + <string name="settings_more_tabs_show_favorite_multireddits_title">"Favori Multiredditleri Göster"</string> + <string name="settings_more_tabs_show_multireddits_title">"Multiredditleri Göster"</string> + <string name="settings_collapse_reddit_section_title">"Reddit Bölümünü Daralt"</string> + <string name="settings_video_player_automatic_landscape_orientation">"Video Oynatırken Otomatik Olarak Yatay Ekrana Geç"</string> + <string name="settings_remember_muting_option_in_post_feed">"Gönderi Akışında Sessize Alma Seçeneğini Hatırla"</string> + <string name="link_post_layout_auto">"Otomatik"</string> + <string name="uploaded_images">"Foroğraf Yüklemesi"</string> + <string name="select_image">"Bir Fotoğraf Seç"</string> + <string name="capture">"Bir Fotoğraf Çek"</string> + <string name="uploading_image">"Yükleniyor"</string> + <string name="upload_image_success">"Fotoğraf başarıyla yüklendi. Yüklenen fotoğrafları görmek için fotoğraf düğmesine tekrar tıklayın."</string> + <string name="get_image_bitmap_failed">"Fotoğrafın bitmap'i alınamıyor"</string> + <string name="upload_image_failed">"Fotoğraf yüklenemiyor"</string> + <string name="load_rpan_broadcasts_failed">"Canlı Yayınlar yüklenemiyor"</string> + <string name="parse_rpan_broadcasts_failed">"Canlı Yayınlar ayrıştırılamıyor"</string> + <string name="parse_rpan_broadcast_failed">"Canlı Yayın ayrıştırılamıyor"</string> + <string name="search_comments">"Yorumları Ara"</string> + <string name="please_wait_image_is_uploading">"Hâlâ bir fotoğraf yükleniyor. Lütfen bekleyin."</string> + <string name="error_fetch_trending_search">"Trend aramalar getirilemedi. +Tekrar denemek için tıklayın."</string> + <string name="error_parse_trending_search">"Trend aramalar ayrıştırılamadı. +Tekrar denemek için tıklayın."</string> + <string name="no_trending_search">"Trend aramalar bulunamadı. +Tekrar denemek için tıklayın."</string> </resources>
\ No newline at end of file diff --git a/app/src/main/res/values-vi/strings.xml b/app/src/main/res/values-vi/strings.xml index 10f23c53..6931c715 100644 --- a/app/src/main/res/values-vi/strings.xml +++ b/app/src/main/res/values-vi/strings.xml @@ -226,6 +226,8 @@ Nhấn để thử lại."</string> <string name="search">"Tìm kiếm"</string> <string name="posting_video">"Đang đăng video"</string> <string name="posting_image">"Đang đăng hình ảnh"</string> + + <!-- Fuzzy --> <string name="please_wait">"Vui lòng đợi."</string> <string name="add_account">"Thêm tài khoản"</string> <string name="anonymous_account">"Vô danh"</string> @@ -320,6 +322,8 @@ Nhấn để thử lại."</string> <string name="settings_volume_keys_navigate_posts_title">"Dùng nút âm lượng để di chuyển bài đăng"</string> <string name="settings_mute_video_title">"Tắt tiếng Video"</string> <string name="settings_mute_nsfw_video_title">"Tắt tiếng video NSFW"</string> + + <!-- Fuzzy --> <string name="settings_automatically_try_redgifs_title">"Tự động thử truy cập Redgifs nếu Video trên Gfycat bị xóa."</string> <string name="settings_video_player_ignore_nav_bar_title">"Bỏ qua thanh điều hướng trong trình phát video"</string> <string name="settings_video_player_ignore_nav_bar_summary">"Ngăn trình điều khiển video có thêm lề"</string> @@ -957,6 +961,8 @@ Thông báo: %2$s"</string> <string name="action_copy_link">"Sao chép liên kết"</string> <string name="action_add_to_post_filter">"Thêm vào bộ lọc bài đăng"</string> <string name="settings_do_not_blur_nsfw_in_nsfw_subreddits_title">"Không làm mờ các hình ảnh NSFW trong các subreddit NSFW"</string> + + <!-- Fuzzy --> <string name="settings_show_avatar_on_the_right">"Hiện ảnh đại diện ở bên trái"</string> <string name="settings_backup_settings_title">"Sao lưu cài đặt"</string> <string name="settings_restore_settings_title">"Khôi phục cài đặt"</string> @@ -1014,6 +1020,8 @@ Thông báo: %2$s"</string> <string name="action_delete_logs">"Xoá nhật ký"</string> <string name="inbox_with_count">"Hộp thư đến (%1$d)"</string> <string name="comment_continue_thread">"Tiếp tục thread"</string> + + <!-- Fuzzy --> <string name="settings_swipe_vertically_to_go_back_from_media_title">"Vuốt dọc để quay lại từ phương tiện"</string> <string name="settings_hide_post_flair">"Ẩn tư cách bài đăng"</string> <string name="settings_crash_reports_title">"Báo cáo dừng đột ngột"</string> diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index 6301761c..d6cc39dd 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -153,7 +153,7 @@ <string name="title_required">"帖子需要有标题"</string> <string name="link_required">"嘿!链接在哪呢?"</string> <string name="select_an_image">"请先选择一张图片"</string> - <string name="posting">"发表中"</string> + <string name="posting">"发布中"</string> <string name="post_failed">"无法发表"</string> <string name="error_processing_image">"处理图片错误"</string> <string name="error_processing_video">"处理视频错误"</string> @@ -227,8 +227,10 @@ <string name="gallery">"相册"</string> <string name="best">"精选"</string> <string name="search">"搜索"</string> - <string name="posting_video">"视频发送中"</string> - <string name="posting_image">"图片发送中"</string> + <string name="posting_video">"视频发布中"</string> + <string name="posting_image">"图片发布中"</string> + + <!-- Fuzzy --> <string name="please_wait">"请稍等。"</string> <string name="add_account">"添加帐户"</string> <string name="anonymous_account">"匿名"</string> @@ -315,6 +317,8 @@ <string name="settings_volume_keys_navigate_posts_title">"使用音量键浏览帖子"</string> <string name="settings_mute_video_title">"静音视频"</string> <string name="settings_mute_nsfw_video_title">"静音 NSFW 视频"</string> + + <!-- Fuzzy --> <string name="settings_automatically_try_redgifs_title">"如果 Gfycat 上的视频已被删除,则自动尝试访问 Redgifs。"</string> <string name="settings_video_player_ignore_nav_bar_title">"视频播放器中忽略导航栏"</string> @@ -1023,6 +1027,8 @@ https://play.google.com/store/apps/details?id=ml.docilealligator.infinityforredd <string name="action_copy_link">"复制链接"</string> <string name="action_add_to_post_filter">"添加到帖子过滤器"</string> <string name="settings_do_not_blur_nsfw_in_nsfw_subreddits_title">"在 NSFW 版块中不模糊 NSFW 图片"</string> + + <!-- Fuzzy --> <string name="settings_show_avatar_on_the_right">"在左侧显示头像"</string> <string name="settings_backup_settings_title">"备份设置"</string> <string name="settings_restore_settings_title">"恢复设置"</string> @@ -1082,6 +1088,8 @@ https://play.google.com/store/apps/details?id=ml.docilealligator.infinityforredd <string name="action_delete_logs">"删除日志"</string> <string name="inbox_with_count">"收件箱 (%1$d)"</string> <string name="comment_continue_thread">"继续帖子"</string> + + <!-- Fuzzy --> <string name="settings_swipe_vertically_to_go_back_from_media_title">"垂直滑动离开媒体界面"</string> <string name="settings_hide_post_flair">"隐藏帖子头衔"</string> <string name="settings_crash_reports_title">"崩溃报告"</string> @@ -1097,4 +1105,50 @@ https://play.google.com/store/apps/details?id=ml.docilealligator.infinityforredd 仍然要继续吗?"</string> <string name="reply">"回复"</string> + <string name="rpan_activity_label">"直播"</string> + <string name="post_gallery_activity_label">"相册帖"</string> + <string name="trending_activity_label">"热门"</string> + <string name="action_share_rpan_link">"分享直播链接"</string> + <string name="action_share_post_link">"分享帖子链接"</string> + <string name="rpan">"直播"</string> + <string name="trending">"热门"</string> + <string name="receive_post_reply_notifications">"接收帖子回复提醒"</string> + <string name="bottom_sheet_post_gallery">"相册"</string> + <string name="posting_gallery">"相册发布中"</string> + <string name="label_reddit">"Reddit"</string> + <string name="settings_default_link_post_layout">"默认链接帖布局"</string> + <string name="settings_category_material_you_title">"Material You"</string> + <string name="settings_enable_material_you_warning_summary">"请确保您没有以下名称的主题: +“Material You”、 +“Material You Dark”、 +“Material You Amoled”。 +否则,您需要在启用 Material You 之前先为它们重命名。"</string> + <string name="settings_enable_material_you_title">"启用 Material You"</string> + <string name="settings_enable_material_you_summary">"根据 Your Wallpaper 个性化 Infinity"</string> + <string name="settings_apply_material_you_title">"应用 Material You"</string> + <string name="settings_apply_material_you_summary">"如果 Infinity 未更改主题"</string> + <string name="settings_more_tabs_show_favorite_multireddits_title">"显示收藏的聚合版块"</string> + <string name="settings_more_tabs_show_multireddits_title">"显示聚合版块"</string> + <string name="settings_collapse_reddit_section_title">"折叠 Reddit 区域"</string> + <string name="settings_video_player_automatic_landscape_orientation">"播放视频时自动切换到横屏"</string> + <string name="settings_remember_muting_option_in_post_feed">"在帖子列表中记住静音"</string> + <string name="link_post_layout_auto">"自动"</string> + <string name="uploaded_images">"已上传图片"</string> + <string name="select_image">"选择一张图片"</string> + <string name="capture">"拍摄"</string> + <string name="uploading_image">"正在上传"</string> + <string name="upload_image_success">"上传图片成功。再次点击图片按钮查看已上传的图片。"</string> + <string name="get_image_bitmap_failed">"无法获取图片位图"</string> + <string name="upload_image_failed">"无法上传图片"</string> + <string name="load_rpan_broadcasts_failed">"无法加载 RPAN 直播"</string> + <string name="parse_rpan_broadcasts_failed">"无法解析 RPAN 直播"</string> + <string name="parse_rpan_broadcast_failed">"无法解析 RPAN 直播"</string> + <string name="search_comments">"搜索评论"</string> + <string name="please_wait_image_is_uploading">"仍有图片正在上传,请稍候。"</string> + <string name="error_fetch_trending_search">"获取热搜失败。 +点击重试。"</string> + <string name="error_parse_trending_search">"解析热搜失败。 +点击重试。"</string> + <string name="no_trending_search">"未找到热搜。 +点击重试。"</string> </resources>
\ No newline at end of file diff --git a/app/src/main/res/values/arrays.xml b/app/src/main/res/values/arrays.xml index 38370d05..a2d77399 100644 --- a/app/src/main/res/values/arrays.xml +++ b/app/src/main/res/values/arrays.xml @@ -55,6 +55,22 @@ <item>2</item> </string-array> + <string-array name="settings_default_link_post_layout"> + <item>@string/link_post_layout_auto</item> + <item>@string/post_layout_card</item> + <item>@string/post_layout_card_2</item> + <item>@string/post_layout_compact</item> + <item>@string/post_layout_gallery</item> + </string-array> + + <string-array name="settings_default_link_post_layout_values"> + <item>-1</item> + <item>0</item> + <item>3</item> + <item>1</item> + <item>2</item> + </string-array> + <string-array name="settings_video_autoplay"> <item>@string/always_on</item> <item>@string/only_on_wifi</item> @@ -180,28 +196,29 @@ </string-array> <string-array name="settings_time_format"> - <item>Jan 2, 2020, 01:00</item> - <item>Jan 2, 2020, 01:00 PM</item> - <item>2 Jan, 2020, 01:00</item> - <item>2 Jan, 2020, 01:00 PM</item> - <item>1/2/2020 01:00 (Month first)</item> - <item>1/2/2020 01:00 PM (Month first)</item> - <item>2/1/2020 01:00 (Day first)</item> - <item>2/1/2020 01:00 PM (Day first)</item> - <item>2020/1/2 01:00 (Month first)</item> - <item>2020/1/2 01:00 PM (Month first)</item> - <item>1-2-2020 01:00 (Month first)</item> - <item>1-2-2020 01:00 PM (Month first)</item> - <item>2-1-2020 01:00 (Day first)</item> - <item>2-1-2020 01:00 PM (Day first)</item> - <item>2020-1-2 01:00 (Month first)</item> - <item>2020-1-2 01:00 PM (Month first)</item> - <item>1.2.2020 01:00 (Month first)</item> - <item>1.2.2020 01:00 PM (Month first)</item> - <item>2.1.2020 01:00 (Day first)</item> - <item>2.1.2020 01:00 PM (Day first)</item> - <item>2020.1.2 01:00 (Month first)</item> - <item>2020.1.2 01:00 PM (Month first)</item> + <!-- 2020/01/23 23:45 --> + <item>Jan 23, 2020, 23:45</item> + <item>Jan 23, 2020, 11:45 PM</item> + <item>23 Jan, 2020, 23:45</item> + <item>23 Jan, 2020, 11:45 PM</item> + <item>1/23/2020 23:45</item> + <item>1/23/2020 11:45 PM</item> + <item>23/1/2020 23:45</item> + <item>23/1/2020 11:45 PM</item> + <item>2020/1/23 23:45</item> + <item>2020/1/23 11:45 PM</item> + <item>1-23-2020 23:45</item> + <item>1-23-2020 11:45 PM</item> + <item>23-1-2020 23:45</item> + <item>23-1-2020 11:45 PM</item> + <item>2020-1-23 23:45</item> + <item>2020-1-23 11:45 PM</item> + <item>1.23.2020 23:45</item> + <item>1.23.2020 11:45 PM</item> + <item>23.1.2020 23:45</item> + <item>23.1.2020 11:45 PM</item> + <item>2020.1.23 23:45</item> + <item>2020.1.23 11:45 PM</item> </string-array> <string-array name="settings_time_format_values"> @@ -350,8 +367,10 @@ <item>Italiana</item> <item>日本語</item> <item>Polskie</item> + <item>Português</item> <item>Português (BR)</item> <item>русский</item> + <item>Soomaali</item> <item>Español</item> <item>Türkçe</item> <item>Tiếng Việt</item> @@ -370,8 +389,10 @@ <item>it</item> <item>ja</item> <item>pl</item> + <item>pt</item> <item>pt-rBR</item> <item>ru</item> + <item>so</item> <item>es</item> <item>tr-rTR</item> <item>vi</item> diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 1d6753ba..a286248c 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -40,6 +40,9 @@ <string name="search_users_result_activity_label">Users</string> <string name="multireddit_selection_activity_label">Select a Multireddit</string> <string name="rpan_activity_label">RPAN</string> + <string name="post_gallery_activity_label">Gallery Post</string> + <string name="trending_activity_label">Trending</string> + <string name="wiki_activity_label">Wiki</string> <string name="navigation_drawer_open">Open navigation drawer</string> <string name="navigation_drawer_close">Close navigation drawer</string> @@ -84,6 +87,8 @@ <string name="action_copy_link">Copy Link</string> <string name="action_add_to_post_filter">Add to Post Filter</string> <string name="action_delete_logs">Delete Logs</string> + <string name="action_share_rpan_link">Share RPAN Link</string> + <string name="action_share_post_link">Share Post Link</string> <string name="parse_json_response_error">Error occurred when parsing the JSON response</string> <string name="retrieve_token_error">Error Retrieving the token</string> @@ -125,6 +130,8 @@ <string name="multi_reddit">Multireddit</string> <string name="inbox">Inbox</string> <string name="inbox_with_count">Inbox (%1$d)</string> + <string name="rpan">RPAN</string> + <string name="trending">Trending</string> <string name="upvoted">Upvoted</string> <string name="downvoted">Downvoted</string> <string name="hidden">Hidden</string> @@ -203,6 +210,7 @@ <string name="choose_a_subreddit">Choose a subreddit</string> <string name="rules">Rules</string> <string name="post_link_hint">URL</string> + <string name="receive_post_reply_notifications">Receive post reply notifications</string> <string name="subreddits">Subreddits</string> <string name="users">Users</string> @@ -215,6 +223,7 @@ <string name="bottom_sheet_post_link">Link</string> <string name="bottom_sheet_post_image">Image</string> <string name="bottom_sheet_post_video">Video</string> + <string name="bottom_sheet_post_gallery">Gallery</string> <string name="post_type_gif">Gif</string> <string name="post_type_gallery">Gallery</string> @@ -282,7 +291,8 @@ <string name="posting_video">Posting Video</string> <string name="posting_image">Posting Image</string> - <string name="please_wait">Please wait.</string> + <string name="posting_gallery">Posting Gallery</string> + <string name="please_wait">Please wait</string> <string name="add_account">Add account</string> <string name="anonymous_account">Anonymous</string> @@ -338,6 +348,7 @@ <string name="notification_new_messages">%1$d New Messages</string> <string name="label_account">Account</string> + <string name="label_reddit">Reddit</string> <string name="label_post">Post</string> <string name="label_preferences">Preferences</string> @@ -391,6 +402,7 @@ <string name="settings_time_format_title">Time Format</string> <string name="settings_category_post_title">Post</string> <string name="settings_default_post_layout">Default Post Layout</string> + <string name="settings_default_link_post_layout">Default Link Post Layout</string> <string name="settings_show_divider_in_compact_layout">Show Divider</string> <string name="settings_show_thumbnail_on_the_left_in_compact_layout">Show Thumbnail on the Left</string> <string name="settings_number_of_columns_in_post_feed_title">The Number of Columns in Post Feed</string> @@ -563,6 +575,7 @@ <string name="settings_swipe_between_posts_title">Swipe Between Posts</string> <string name="settings_navigation_drawer_title">Navigation Drawer</string> <string name="settings_collapse_account_section_title">Collapse Account Section</string> + <string name="settings_collapse_reddit_section_title">Collapse Reddit Section</string> <string name="settings_collapse_post_section_title">Collapse Post Section</string> <string name="settings_collapse_preferences_section_title">Collapse Preferences Section</string> <string name="settings_collapse_favorite_subreddits_section_title">Collapse Favorite Subreddits Section</string> @@ -574,6 +587,15 @@ <string name="settings_nsfw_and_spoiler_dangerous_group_title">Dangerous</string> <string name="settings_disable_nsfw_forever_title">Disable NSFW Forever</string> <string name="settings_show_only_one_comment_level_indicator">Show Only One Comment Level Indicator</string> + <string name="settings_video_player_automatic_landscape_orientation">Switch to Landscape Orientation in Video Player Automatically</string> + <string name="settings_remember_muting_option_in_post_feed">Remember Muting Option in Post Feed</string> + <string name="settings_post_details_title">Post Details</string> + <string name="settings_separate_post_and_comments_in_portrait_mode_title">Separate Post And Comments in Portrait Mode</string> + <string name="settings_separate_post_and_comments_in_landscape_mode_title">Separate Post And Comments in Landscape Mode</string> + <string name="settings_separate_post_and_comments_summary">Video autoplay will be disabled in the post detail page</string> + <string name="settings_use_bottom_toolbar_in_media_viewer_title">Use Bottom Toolbar in Media Viewer</string> + <string name="settings_secure_mode_title">Secure Mode</string> + <string name="settings_secure_mode_summary">Screenshot and video recording are not allowed. No preview in recent app screen.</string> <string name="no_link_available">Cannot get the link</string> @@ -585,6 +607,7 @@ <string name="discard_detail">All the draft will NOT be saved.</string> <string name="yes">Yes</string> <string name="no">No</string> + <string name="discard_dialog_button">Discard</string> <string name="no_data_received">No data received</string> <string name="no_image_path_received">No image path received</string> @@ -606,6 +629,7 @@ <string name="favorites">Favorites</string> <string name="all">All</string> + <string name="link_post_layout_auto">Auto</string> <string name="post_layout_card">Card Layout</string> <string name="post_layout_compact">Compact Layout</string> <string name="post_layout_gallery">Gallery Layout</string> @@ -1120,7 +1144,7 @@ <string name="reply">Reply</string> <string name="uploaded_images">Uploaded Images</string> - <string name="upload">Upload</string> + <string name="select_image">Select an Image</string> <string name="capture">Capture</string> <string name="uploading_image">Uploading</string> <string name="upload_image_success">Upload image successfully. Click the image button again to see the uploaded images.</string> @@ -1129,5 +1153,19 @@ <string name="load_rpan_broadcasts_failed">Cannot load RPAN broadcasts</string> <string name="parse_rpan_broadcasts_failed">Cannot parse RPAN broadcasts</string> + <string name="parse_rpan_broadcast_failed">Cannot parse RPAN broadcast</string> + + <string name="search_comments">Search Comments</string> + + <string name="please_wait_image_is_uploading">An image is still being uploaded. Please wait.</string> + + <string name="error_fetch_trending_search">Fetch trending searches failed.\nTap to retry.</string> + <string name="error_parse_trending_search">Parse trending searches failed.\nTap to retry.</string> + <string name="no_trending_search">No trending searches found.\nTap to retry.</string> + + <string name="error_loading_wiki">Error loading wiki</string> + <string name="no_wiki">This subreddit has no wiki page</string> + + <string name="material_you_notification_title">Applying Material You</string> </resources> diff --git a/app/src/main/res/xml-sw600dp/post_details_preferences.xml b/app/src/main/res/xml-sw600dp/post_details_preferences.xml new file mode 100644 index 00000000..0a8cf2c9 --- /dev/null +++ b/app/src/main/res/xml-sw600dp/post_details_preferences.xml @@ -0,0 +1,47 @@ +<?xml version="1.0" encoding="utf-8"?> +<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto"> + + <SwitchPreference + app:defaultValue="true" + app:key="separate_post_and_comments_in_portrait_mode" + app:title="@string/settings_separate_post_and_comments_in_portrait_mode_title" + app:summary="@string/settings_separate_post_and_comments_summary" /> + + <SwitchPreference + app:defaultValue="true" + app:key="separate_post_and_comments_in_landscape_mode" + app:title="@string/settings_separate_post_and_comments_in_landscape_mode_title" + app:summary="@string/settings_separate_post_and_comments_summary" /> + + <SwitchPreference + app:defaultValue="false" + app:key="hide_post_type" + app:title="@string/settings_hide_post_type" /> + + <SwitchPreference + app:defaultValue="false" + app:key="hide_post_flair" + app:title="@string/settings_hide_post_flair" /> + + <SwitchPreference + app:defaultValue="false" + app:key="hide_the_number_of_awards" + app:title="@string/settings_hide_the_number_of_awards" /> + + <SwitchPreference + app:defaultValue="false" + app:key="hide_subreddit_and_user_prefix" + app:title="@string/settings_hide_subreddit_and_user_prefix" /> + + <SwitchPreference + app:defaultValue="false" + app:key="hide_the_number_of_votes" + app:title="@string/settings_hide_the_number_of_votes" /> + + <SwitchPreference + app:defaultValue="false" + app:key="hide_the_number_of_comments" + app:title="@string/settings_hide_the_number_of_comments" /> + +</PreferenceScreen>
\ No newline at end of file diff --git a/app/src/main/res/xml/interface_preferences.xml b/app/src/main/res/xml/interface_preferences.xml index 201b13cd..1a4e0f86 100644 --- a/app/src/main/res/xml/interface_preferences.xml +++ b/app/src/main/res/xml/interface_preferences.xml @@ -37,6 +37,11 @@ app:key="hide_subreddit_description" app:title="@string/settings_hide_subreddit_description_title" /> + <SwitchPreference + app:defaultValue="false" + app:key="use_bottom_toolbar_in_media_viewer" + app:title="@string/settings_use_bottom_toolbar_in_media_viewer_title" /> + <ListPreference app:defaultValue="0" app:entries="@array/settings_default_search_result_tab" @@ -54,6 +59,10 @@ app:fragment="ml.docilealligator.infinityforreddit.settings.PostPreferenceFragment" /> <Preference + app:title="@string/settings_post_details_title" + app:fragment="ml.docilealligator.infinityforreddit.settings.PostDetailsPreferenceFragment" /> + + <Preference app:title="@string/settings_category_comment_title" app:fragment="ml.docilealligator.infinityforreddit.settings.CommentPreferenceFragment" /> diff --git a/app/src/main/res/xml/navigation_drawer_preferences.xml b/app/src/main/res/xml/navigation_drawer_preferences.xml index 3fb31b88..b34a32e7 100644 --- a/app/src/main/res/xml/navigation_drawer_preferences.xml +++ b/app/src/main/res/xml/navigation_drawer_preferences.xml @@ -18,6 +18,11 @@ <SwitchPreference app:defaultValue="false" + app:key="collapse_reddit_section" + app:title="@string/settings_collapse_reddit_section_title" /> + + <SwitchPreference + app:defaultValue="false" app:key="collapse_post_section" app:title="@string/settings_collapse_post_section_title" /> diff --git a/app/src/main/res/xml/post_details_preferences.xml b/app/src/main/res/xml/post_details_preferences.xml new file mode 100644 index 00000000..e549cb42 --- /dev/null +++ b/app/src/main/res/xml/post_details_preferences.xml @@ -0,0 +1,41 @@ +<?xml version="1.0" encoding="utf-8"?> +<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto"> + + <SwitchPreference + app:defaultValue="true" + app:key="separate_post_and_comments_in_landscape_mode" + app:title="@string/settings_separate_post_and_comments_in_landscape_mode_title" + app:summary="@string/settings_separate_post_and_comments_summary" /> + + <SwitchPreference + app:defaultValue="false" + app:key="hide_post_type" + app:title="@string/settings_hide_post_type" /> + + <SwitchPreference + app:defaultValue="false" + app:key="hide_post_flair" + app:title="@string/settings_hide_post_flair" /> + + <SwitchPreference + app:defaultValue="false" + app:key="hide_the_number_of_awards" + app:title="@string/settings_hide_the_number_of_awards" /> + + <SwitchPreference + app:defaultValue="false" + app:key="hide_subreddit_and_user_prefix" + app:title="@string/settings_hide_subreddit_and_user_prefix" /> + + <SwitchPreference + app:defaultValue="false" + app:key="hide_the_number_of_votes" + app:title="@string/settings_hide_the_number_of_votes" /> + + <SwitchPreference + app:defaultValue="false" + app:key="hide_the_number_of_comments" + app:title="@string/settings_hide_the_number_of_comments" /> + +</PreferenceScreen>
\ No newline at end of file diff --git a/app/src/main/res/xml/post_preferences.xml b/app/src/main/res/xml/post_preferences.xml index 7ea526a5..55f9f5c2 100644 --- a/app/src/main/res/xml/post_preferences.xml +++ b/app/src/main/res/xml/post_preferences.xml @@ -10,6 +10,14 @@ app:title="@string/settings_default_post_layout" app:useSimpleSummaryProvider="true" /> + <ListPreference + app:defaultValue="-1" + android:entries="@array/settings_default_link_post_layout" + app:entryValues="@array/settings_default_link_post_layout_values" + app:key="default_link_post_layout" + app:title="@string/settings_default_link_post_layout" + app:useSimpleSummaryProvider="true" /> + <Preference app:title="@string/settings_number_of_columns_in_post_feed_title" app:fragment="ml.docilealligator.infinityforreddit.settings.NumberOfColumnsInPostFeedPreferenceFragment" /> diff --git a/app/src/main/res/xml/security_preferences.xml b/app/src/main/res/xml/security_preferences.xml index d43c2384..636f1798 100644 --- a/app/src/main/res/xml/security_preferences.xml +++ b/app/src/main/res/xml/security_preferences.xml @@ -5,4 +5,10 @@ app:key="require_auth_to_account_section" app:title="@string/settings_require_authentication_to_go_to_account_section_in_navigation_drawer_title" /> + <SwitchPreference + app:defaultValue="false" + app:key="secure_mode" + app:title="@string/settings_secure_mode_title" + app:summary="@string/settings_secure_mode_summary" /> + </PreferenceScreen>
\ No newline at end of file diff --git a/app/src/main/res/xml/video_preferences.xml b/app/src/main/res/xml/video_preferences.xml index a0924140..decf2674 100644 --- a/app/src/main/res/xml/video_preferences.xml +++ b/app/src/main/res/xml/video_preferences.xml @@ -25,6 +25,11 @@ app:title="@string/settings_video_player_ignore_nav_bar_title" app:summary="@string/settings_video_player_ignore_nav_bar_summary" /> + <SwitchPreference + app:defaultValue="false" + app:key="video_player_automatic_landscape_orientation" + app:title="@string/settings_video_player_automatic_landscape_orientation" /> + <PreferenceCategory app:title="@string/settings_video_autoplay_title" /> @@ -43,6 +48,11 @@ app:title="@string/settings_mute_autoplaying_videos_title" /> <SwitchPreference + app:defaultValue="false" + app:key="remember_muting_option_in_post_feed" + app:title="@string/settings_remember_muting_option_in_post_feed" /> + + <SwitchPreference app:defaultValue="true" app:key="autoplay_nsfw_videos" app:title="@string/settings_autoplay_nsfw_videos_title" /> |