mirror of
https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy.git
synced 2025-11-01 17:38:12 +01:00
Compare commits
31 Commits
reddit_rem
...
v0.0.8
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ffc2d669e5 | ||
|
|
926e1162f0 | ||
|
|
6cf69ee26d | ||
|
|
279820c1be | ||
|
|
1d7031f3d4 | ||
|
|
252e00b67a | ||
|
|
a8d63c7480 | ||
|
|
2020172b56 | ||
|
|
2d55a4c8ec | ||
|
|
20a3e0220b | ||
|
|
feeeefa2d2 | ||
|
|
d25137020f | ||
|
|
3c4fb4162e | ||
|
|
28e9ae950e | ||
|
|
888e741aa9 | ||
|
|
9f7a6e1738 | ||
|
|
76f4a0738f | ||
|
|
63327946be | ||
|
|
84d90adc54 | ||
|
|
cf15732a39 | ||
|
|
2eee73753f | ||
|
|
62d097357a | ||
|
|
c35a690335 | ||
|
|
18af76ce92 | ||
|
|
6e7256d9a5 | ||
|
|
2af6c5a742 | ||
|
|
5c39fddbc6 | ||
|
|
a708853199 | ||
|
|
acb651cf92 | ||
|
|
49ff90aad1 | ||
|
|
6adaaf1965 |
49
.gitea/issue_template/bug_report.md
Normal file
49
.gitea/issue_template/bug_report.md
Normal file
@@ -0,0 +1,49 @@
|
||||
---
|
||||
|
||||
name: "Bug Report"
|
||||
about: "Report a Bug!"
|
||||
title: " [Bug] "
|
||||
ref: "master"
|
||||
labels:
|
||||
|
||||
- Kind/Bug
|
||||
|
||||
---
|
||||
### Description of the Issue:
|
||||
|
||||
<!-- Provide a clear and concise description of what the issue is about. -->
|
||||
|
||||
### Steps to Reproduce:
|
||||
|
||||
<!-- Explain the steps to reproduce the issue, if applicable. -->
|
||||
|
||||
1.
|
||||
2.
|
||||
3.
|
||||
|
||||
### Expected Behavior:
|
||||
|
||||
<!-- Describe what you expected to happen. -->
|
||||
|
||||
### Actual Behavior:
|
||||
|
||||
<!-- Describe what actually happened. Include screenshots if applicable. -->
|
||||
|
||||
### App Information:
|
||||
|
||||
- **Version:** <!-- e.g. 1.0.0 -->
|
||||
- **Device:** <!-- e.g. Samsung Galaxy S10 -->
|
||||
- **Android Version:** <!-- e.g. Android 11 -->
|
||||
- **Installation Source:** <!-- e.g. Google Play Store, APK -->
|
||||
|
||||
### Log Files:
|
||||
|
||||
<!-- If applicable, include log files or error messages related to this issue. -->
|
||||
|
||||
### Additional Context:
|
||||
|
||||
<!-- Add any other context about the problem here, such as relevant system configuration or screenshots. -->
|
||||
|
||||
### Potential Solutions or Workarounds:
|
||||
|
||||
<!-- If you know of any potential solutions or workarounds for this issue, please describe them here. -->
|
||||
@@ -16,6 +16,7 @@ A Lemmy client for Android written in Java. It's a fork of the [Infinity for Red
|
||||
<div align="center">
|
||||
|
||||
[](https://ci.codeberg.org/12474)
|
||||
[](https://liberapay.com/Bazsalanszky)
|
||||
|
||||
<a href="https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy/issues">Report a Bug</a>
|
||||
|
||||
@@ -41,11 +42,14 @@ Infinity for Lemmy is currently in the early stages of development. Expect many
|
||||
- [x] Support for multiple account handling
|
||||
- [x] Functionality for post upvotes/downvotes
|
||||
- [x] Functionality to browse comments
|
||||
- [ ] Capability for creating a new post
|
||||
- [x] Capability for creating a new post
|
||||
- [x] Ability to create comments
|
||||
- [x] Edit/Delete posts and comments
|
||||
- [x] Basic inbox
|
||||
- [ ] Elimination of code/string references specific to Reddit
|
||||
- [ ] Incorporation of private messaging feature
|
||||
- [ ] Feature for saving posts
|
||||
- [x] Feature for saving posts/comments
|
||||
- [x] Resolving links
|
||||
- [ ] Account editing function
|
||||
- [ ] Multi community view?
|
||||
|
||||
|
||||
@@ -8,8 +8,8 @@ android {
|
||||
applicationId "eu.toldi.infinityforlemmy"
|
||||
minSdk 21
|
||||
targetSdk 33
|
||||
versionCode 126
|
||||
versionName "0.0.6"
|
||||
versionCode 128
|
||||
versionName "0.0.8"
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
javaCompileOptions {
|
||||
annotationProcessorOptions {
|
||||
@@ -169,6 +169,7 @@ dependencies {
|
||||
implementation "io.noties.markwon:recycler-table:$markwonVersion"
|
||||
implementation "io.noties.markwon:simple-ext:$markwonVersion"
|
||||
implementation "io.noties.markwon:inline-parser:$markwonVersion"
|
||||
implementation "io.noties.markwon:image-glide:$markwonVersion"
|
||||
implementation 'com.atlassian.commonmark:commonmark-ext-gfm-tables:0.14.0'
|
||||
implementation 'me.saket:better-link-movement-method:2.2.0'
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ import eu.toldi.infinityforlemmy.user.UserData;
|
||||
|
||||
@Database(entities = {Account.class, SubredditData.class, SubscribedSubredditData.class, UserData.class,
|
||||
SubscribedUserData.class, MultiReddit.class, CustomTheme.class, RecentSearchQuery.class,
|
||||
ReadPost.class, PostFilter.class, PostFilterUsage.class, AnonymousMultiredditSubreddit.class}, version = 23)
|
||||
ReadPost.class, PostFilter.class, PostFilterUsage.class, AnonymousMultiredditSubreddit.class}, version = 24)
|
||||
public abstract class RedditDataRoomDatabase extends RoomDatabase {
|
||||
|
||||
public static RedditDataRoomDatabase create(final Context context) {
|
||||
@@ -49,7 +49,7 @@ public abstract class RedditDataRoomDatabase extends RoomDatabase {
|
||||
MIGRATION_9_10, MIGRATION_10_11, MIGRATION_11_12, MIGRATION_12_13,
|
||||
MIGRATION_13_14, MIGRATION_14_15, MIGRATION_15_16, MIGRATION_16_17,
|
||||
MIGRATION_17_18, MIGRATION_18_19, MIGRATION_19_20, MIGRATION_20_21,
|
||||
MIGRATION_21_22, MIGRATION_22_23)
|
||||
MIGRATION_21_22, MIGRATION_22_23, MIGRATION_23_24)
|
||||
.build();
|
||||
}
|
||||
|
||||
@@ -383,4 +383,11 @@ public abstract class RedditDataRoomDatabase extends RoomDatabase {
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
private static final Migration MIGRATION_23_24 = new Migration(23, 24) {
|
||||
@Override
|
||||
public void migrate(@NonNull SupportSQLiteDatabase database) {
|
||||
database.execSQL("ALTER TABLE accounts ADD COLUMN can_downvote INTEGER DEFAULT 1 NOT NULL");
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -32,6 +32,9 @@ public class Account implements Parcelable {
|
||||
@ColumnInfo(name = "instance_url")
|
||||
private String instance_url;
|
||||
|
||||
@ColumnInfo(name = "can_downvote")
|
||||
private boolean canDownvote = true;
|
||||
|
||||
@Ignore
|
||||
protected Account(Parcel in) {
|
||||
accountName = in.readString();
|
||||
@@ -42,6 +45,7 @@ public class Account implements Parcelable {
|
||||
code = in.readString();
|
||||
isCurrentUser = in.readByte() != 0;
|
||||
instance_url = in.readString();
|
||||
canDownvote = in.readByte() != 0;
|
||||
}
|
||||
|
||||
public static final Creator<Account> CREATOR = new Creator<Account>() {
|
||||
@@ -58,11 +62,11 @@ public class Account implements Parcelable {
|
||||
|
||||
@Ignore
|
||||
public static Account getAnonymousAccount() {
|
||||
return new Account("-",null, null, null, null, null, false,null);
|
||||
return new Account("-",null, null, null, null, null, false,null,true);
|
||||
}
|
||||
|
||||
public Account(@NonNull String accountName, String display_name, String accessToken, String code,
|
||||
String profileImageUrl, String bannerImageUrl, boolean isCurrentUser,String instance_url) {
|
||||
String profileImageUrl, String bannerImageUrl, boolean isCurrentUser,String instance_url, boolean canDownvote) {
|
||||
this.accountName = accountName;
|
||||
this.display_name = display_name;
|
||||
this.accessToken = accessToken;
|
||||
@@ -71,6 +75,7 @@ public class Account implements Parcelable {
|
||||
this.bannerImageUrl = bannerImageUrl;
|
||||
this.isCurrentUser = isCurrentUser;
|
||||
this.instance_url = instance_url;
|
||||
this.canDownvote = canDownvote;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@@ -116,6 +121,10 @@ public class Account implements Parcelable {
|
||||
return instance_url;
|
||||
}
|
||||
|
||||
public boolean canDownvote() {
|
||||
return canDownvote;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
dest.writeString(accountName);
|
||||
@@ -126,5 +135,6 @@ public class Account implements Parcelable {
|
||||
dest.writeString(code);
|
||||
dest.writeByte((byte) (isCurrentUser ? 1 : 0));
|
||||
dest.writeString(instance_url);
|
||||
dest.writeByte((byte) (canDownvote ? 1 : 0));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -513,8 +513,8 @@ public class CommentActivity extends BaseActivity implements UploadImageEnabledA
|
||||
int start = Math.max(binding.commentCommentEditText.getSelectionStart(), 0);
|
||||
int end = Math.max(binding.commentCommentEditText.getSelectionEnd(), 0);
|
||||
binding.commentCommentEditText.getText().replace(Math.min(start, end), Math.max(start, end),
|
||||
"[" + uploadedImage.imageName + "](" + uploadedImage.imageUrl + ")",
|
||||
0, "[]()".length() + uploadedImage.imageName.length() + uploadedImage.imageUrl.length());
|
||||
"",
|
||||
0, "![]()".length() + uploadedImage.imageName.length() + uploadedImage.imageUrl.length());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -345,7 +345,7 @@ public class EditCommentActivity extends BaseActivity implements UploadImageEnab
|
||||
int start = Math.max(contentEditText.getSelectionStart(), 0);
|
||||
int end = Math.max(contentEditText.getSelectionEnd(), 0);
|
||||
contentEditText.getText().replace(Math.min(start, end), Math.max(start, end),
|
||||
"[" + uploadedImage.imageName + "](" + uploadedImage.imageUrl + ")",
|
||||
0, "[]()".length() + uploadedImage.imageName.length() + uploadedImage.imageUrl.length());
|
||||
"",
|
||||
0, "![]()".length() + uploadedImage.imageName.length() + uploadedImage.imageUrl.length());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -456,7 +456,7 @@ public class EditPostActivity extends BaseActivity implements UploadImageEnabled
|
||||
int start = Math.max(contentEditText.getSelectionStart(), 0);
|
||||
int end = Math.max(contentEditText.getSelectionEnd(), 0);
|
||||
contentEditText.getText().replace(Math.min(start, end), Math.max(start, end),
|
||||
"[" + uploadedImage.imageName + "](" + uploadedImage.imageUrl + ")",
|
||||
0, "[]()".length() + uploadedImage.imageName.length() + uploadedImage.imageUrl.length());
|
||||
"",
|
||||
0, "![]()".length() + uploadedImage.imageName.length() + uploadedImage.imageUrl.length());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -227,6 +227,7 @@ public class LinkResolverActivity extends AppCompatActivity {
|
||||
intent.putExtra(ViewPostDetailActivity.EXTRA_MESSAGE_FULLNAME, messageFullname);
|
||||
intent.putExtra(ViewPostDetailActivity.EXTRA_NEW_ACCOUNT_NAME, newAccountName);
|
||||
intent.putExtra(ViewPostDetailActivity.EXTRA_SINGLE_COMMENT_ID, comment.getId());
|
||||
intent.putExtra(ViewPostDetailActivity.EXTRA_SINGLE_COMMENT_PARENT_ID, comment.getParentId());
|
||||
startActivity(intent);
|
||||
}
|
||||
|
||||
@@ -246,6 +247,7 @@ public class LinkResolverActivity extends AppCompatActivity {
|
||||
intent.putExtra(ViewPostDetailActivity.EXTRA_MESSAGE_FULLNAME, messageFullname);
|
||||
intent.putExtra(ViewPostDetailActivity.EXTRA_NEW_ACCOUNT_NAME, newAccountName);
|
||||
intent.putExtra(ViewPostDetailActivity.EXTRA_SINGLE_COMMENT_ID, comment.getId());
|
||||
intent.putExtra(ViewPostDetailActivity.EXTRA_SINGLE_COMMENT_PARENT_ID, comment.getParentId());
|
||||
startActivity(intent);
|
||||
}
|
||||
|
||||
|
||||
@@ -43,6 +43,8 @@ import eu.toldi.infinityforlemmy.asynctasks.ParseAndInsertNewAccount;
|
||||
import eu.toldi.infinityforlemmy.customtheme.CustomThemeWrapper;
|
||||
import eu.toldi.infinityforlemmy.customviews.slidr.Slidr;
|
||||
import eu.toldi.infinityforlemmy.dto.AccountLoginDTO;
|
||||
import eu.toldi.infinityforlemmy.site.FetchSiteInfo;
|
||||
import eu.toldi.infinityforlemmy.site.SiteInfo;
|
||||
import eu.toldi.infinityforlemmy.utils.SharedPreferencesUtils;
|
||||
import eu.toldi.infinityforlemmy.utils.Utils;
|
||||
import retrofit2.Call;
|
||||
@@ -176,17 +178,35 @@ public class LoginActivity extends BaseActivity {
|
||||
accessToken, new FetchMyInfo.FetchMyInfoListener() {
|
||||
@Override
|
||||
public void onFetchMyInfoSuccess(String name, String display_name, String profileImageUrl, String bannerImageUrl) {
|
||||
FetchSiteInfo.fetchSiteInfo(mRetrofit.getRetrofit(), accessToken, new FetchSiteInfo.FetchSiteInfoListener() {
|
||||
@Override
|
||||
public void onFetchSiteInfoSuccess(SiteInfo siteInfo) {
|
||||
boolean canDownvote = siteInfo.isEnable_downvotes();
|
||||
ParseAndInsertNewAccount.parseAndInsertNewAccount(mExecutor, new Handler(), name,display_name, accessToken, profileImageUrl, bannerImageUrl, authCode,instance,canDownvote, mRedditDataRoomDatabase.accountDao(),
|
||||
() -> {
|
||||
Intent resultIntent = new Intent();
|
||||
setResult(Activity.RESULT_OK, resultIntent);
|
||||
finish();
|
||||
});
|
||||
mCurrentAccountSharedPreferences.edit().putBoolean(SharedPreferencesUtils.CAN_DOWNVOTE, canDownvote).apply();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFetchSiteInfoFailed() {
|
||||
ParseAndInsertNewAccount.parseAndInsertNewAccount(mExecutor, new Handler(), name,display_name, accessToken, profileImageUrl, bannerImageUrl, authCode,instance,true, mRedditDataRoomDatabase.accountDao(),
|
||||
() -> {
|
||||
Intent resultIntent = new Intent();
|
||||
setResult(Activity.RESULT_OK, resultIntent);
|
||||
finish();
|
||||
});
|
||||
mCurrentAccountSharedPreferences.edit().putBoolean(SharedPreferencesUtils.CAN_DOWNVOTE, true).apply();
|
||||
}
|
||||
});
|
||||
mCurrentAccountSharedPreferences.edit().putString(SharedPreferencesUtils.ACCESS_TOKEN, accessToken)
|
||||
.putString(SharedPreferencesUtils.ACCOUNT_NAME, display_name)
|
||||
.putString(SharedPreferencesUtils.ACCOUNT_QUALIFIED_NAME, name)
|
||||
.putString(SharedPreferencesUtils.ACCOUNT_INSTANCE,instance)
|
||||
.putString(SharedPreferencesUtils.ACCOUNT_IMAGE_URL, profileImageUrl).apply();
|
||||
ParseAndInsertNewAccount.parseAndInsertNewAccount(mExecutor, new Handler(), name,display_name, accessToken, profileImageUrl, bannerImageUrl, authCode,instance, mRedditDataRoomDatabase.accountDao(),
|
||||
() -> {
|
||||
Intent resultIntent = new Intent();
|
||||
setResult(Activity.RESULT_OK, resultIntent);
|
||||
finish();
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -792,7 +792,7 @@ public class PostImageActivity extends BaseActivity implements FlairBottomSheetF
|
||||
int start = Math.max(contentEditText.getSelectionStart(), 0);
|
||||
int end = Math.max(contentEditText.getSelectionEnd(), 0);
|
||||
contentEditText.getText().replace(Math.min(start, end), Math.max(start, end),
|
||||
"[" + uploadedImage.imageName + "](" + uploadedImage.imageUrl + ")",
|
||||
0, "[]()".length() + uploadedImage.imageName.length() + uploadedImage.imageUrl.length());
|
||||
"",
|
||||
0, "![]()".length() + uploadedImage.imageName.length() + uploadedImage.imageUrl.length());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -722,7 +722,7 @@ public class PostLinkActivity extends BaseActivity implements FlairBottomSheetFr
|
||||
int start = Math.max(contentEditText.getSelectionStart(), 0);
|
||||
int end = Math.max(contentEditText.getSelectionEnd(), 0);
|
||||
contentEditText.getText().replace(Math.min(start, end), Math.max(start, end),
|
||||
"[" + uploadedImage.imageName + "](" + uploadedImage.imageUrl + ")",
|
||||
0, "[]()".length() + uploadedImage.imageName.length() + uploadedImage.imageUrl.length());
|
||||
"",
|
||||
0, "![]()".length() + uploadedImage.imageName.length() + uploadedImage.imageUrl.length());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -673,8 +673,8 @@ public class PostTextActivity extends BaseActivity implements FlairBottomSheetFr
|
||||
int start = Math.max(contentEditText.getSelectionStart(), 0);
|
||||
int end = Math.max(contentEditText.getSelectionEnd(), 0);
|
||||
contentEditText.getText().replace(Math.min(start, end), Math.max(start, end),
|
||||
"[" + uploadedImage.imageName + "](" + uploadedImage.imageUrl + ")",
|
||||
0, "[]()".length() + uploadedImage.imageName.length() + uploadedImage.imageUrl.length());
|
||||
"",
|
||||
0, "![]()".length() + uploadedImage.imageName.length() + uploadedImage.imageUrl.length());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -95,6 +95,7 @@ public class ViewPostDetailActivity extends BaseActivity implements SortTypeSele
|
||||
public static final String EXTRA_POST_ID = "EPI";
|
||||
public static final String EXTRA_POST_LIST_POSITION = "EPLP";
|
||||
public static final String EXTRA_SINGLE_COMMENT_ID = "ESCI";
|
||||
public static final String EXTRA_SINGLE_COMMENT_PARENT_ID = "ESCPI";
|
||||
public static final String EXTRA_CONTEXT_NUMBER = "ECN";
|
||||
public static final String EXTRA_MESSAGE_FULLNAME = "ENI";
|
||||
public static final String EXTRA_NEW_ACCOUNT_NAME = "ENAN";
|
||||
@@ -870,6 +871,7 @@ public class ViewPostDetailActivity extends BaseActivity implements SortTypeSele
|
||||
bundle.putParcelable(ViewPostDetailFragment.EXTRA_POST_DATA, post);
|
||||
bundle.putInt(ViewPostDetailFragment.EXTRA_POST_LIST_POSITION, position);
|
||||
bundle.putInt(ViewPostDetailFragment.EXTRA_SINGLE_COMMENT_ID, getIntent().getIntExtra(EXTRA_SINGLE_COMMENT_ID, 0));
|
||||
bundle.putInt(ViewPostDetailFragment.EXTRA_SINGLE_COMMENT_PARENT_ID, getIntent().getIntExtra(EXTRA_SINGLE_COMMENT_PARENT_ID, 0));
|
||||
bundle.putString(ViewPostDetailFragment.EXTRA_CONTEXT_NUMBER, getIntent().getStringExtra(EXTRA_CONTEXT_NUMBER));
|
||||
bundle.putString(ViewPostDetailFragment.EXTRA_MESSAGE_FULLNAME, getIntent().getStringExtra(EXTRA_MESSAGE_FULLNAME));
|
||||
} else {
|
||||
@@ -891,6 +893,7 @@ public class ViewPostDetailActivity extends BaseActivity implements SortTypeSele
|
||||
bundle.putInt(ViewPostDetailFragment.EXTRA_POST_LIST_POSITION, postListPosition);
|
||||
}
|
||||
bundle.putInt(ViewPostDetailFragment.EXTRA_SINGLE_COMMENT_ID, getIntent().getIntExtra(EXTRA_SINGLE_COMMENT_ID, 0));
|
||||
bundle.putInt(ViewPostDetailFragment.EXTRA_SINGLE_COMMENT_PARENT_ID, getIntent().getIntExtra(EXTRA_SINGLE_COMMENT_PARENT_ID, 0));
|
||||
bundle.putString(ViewPostDetailFragment.EXTRA_CONTEXT_NUMBER, getIntent().getStringExtra(EXTRA_CONTEXT_NUMBER));
|
||||
bundle.putString(ViewPostDetailFragment.EXTRA_MESSAGE_FULLNAME, getIntent().getStringExtra(EXTRA_MESSAGE_FULLNAME));
|
||||
}
|
||||
|
||||
@@ -472,6 +472,7 @@ public class CommentsListingRecyclerViewAdapter extends PagedListAdapter<Comment
|
||||
Intent intent = new Intent(mActivity, ViewPostDetailActivity.class);
|
||||
intent.putExtra(ViewPostDetailActivity.EXTRA_POST_ID, comment.getPostId());
|
||||
intent.putExtra(ViewPostDetailActivity.EXTRA_SINGLE_COMMENT_ID, comment.getId());
|
||||
intent.putExtra(ViewPostDetailActivity.EXTRA_SINGLE_COMMENT_PARENT_ID, comment.getParentId());
|
||||
mActivity.startActivity(intent);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -392,12 +392,12 @@ public class CommentsRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerVi
|
||||
|
||||
if (comment.getAuthorIconUrl() == null) {
|
||||
mFragment.loadIcon(comment.getAuthorQualifiedName(), (authorName, iconUrl) -> {
|
||||
if (authorName.equals(comment.getAuthor())) {
|
||||
if (authorName.equals(comment.getAuthorQualifiedName())) {
|
||||
comment.setAuthorIconUrl(iconUrl);
|
||||
}
|
||||
|
||||
Comment currentComment = getCurrentComment(holder);
|
||||
if (currentComment != null && authorName.equals(currentComment.getAuthor())) {
|
||||
if (currentComment != null && authorName.equals(currentComment.getAuthorQualifiedName())) {
|
||||
mGlide.load(iconUrl)
|
||||
.apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(72, 0)))
|
||||
.error(mGlide.load(R.drawable.subreddit_default_icon)
|
||||
@@ -537,12 +537,12 @@ public class CommentsRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerVi
|
||||
|
||||
if (comment.getAuthorIconUrl() == null) {
|
||||
mFragment.loadIcon(comment.getAuthorQualifiedName(), (authorName, iconUrl) -> {
|
||||
if (authorName.equals(comment.getAuthor())) {
|
||||
if (authorName.equals(comment.getAuthorQualifiedName())) {
|
||||
comment.setAuthorIconUrl(iconUrl);
|
||||
}
|
||||
|
||||
Comment currentComment = getCurrentComment(holder);
|
||||
if (currentComment != null && authorName.equals(currentComment.getAuthor())) {
|
||||
if (currentComment != null && authorName.equals(currentComment.getAuthorQualifiedName())) {
|
||||
mGlide.load(iconUrl)
|
||||
.apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(72, 0)))
|
||||
.error(mGlide.load(R.drawable.subreddit_default_icon)
|
||||
@@ -1548,7 +1548,7 @@ public class CommentsRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerVi
|
||||
SaveComment saveComment = new SaveComment();
|
||||
if (comment.isSaved()) {
|
||||
comment.setSaved(false);
|
||||
saveComment.unsaveThing(mOauthRetrofit, mAccessToken, comment.getId(), new SaveThing.SaveThingListener() {
|
||||
saveComment.unsaveThing(mRetrofit, mAccessToken, comment.getId(), new SaveThing.SaveThingListener() {
|
||||
@Override
|
||||
public void success() {
|
||||
comment.setSaved(false);
|
||||
@@ -1924,6 +1924,7 @@ public class CommentsRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerVi
|
||||
if (mActivity != null && mActivity instanceof ViewPostDetailActivity) {
|
||||
mIsSingleCommentThreadMode = false;
|
||||
mSingleCommentId = null;
|
||||
loadedComments.clear();
|
||||
notifyItemRemoved(0);
|
||||
mFragment.changeToNormalThreadMode();
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ 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.inlineparser.BangInlineProcessor;
|
||||
import io.noties.markwon.image.glide.GlideImagesPlugin;
|
||||
import io.noties.markwon.inlineparser.HtmlInlineProcessor;
|
||||
import io.noties.markwon.inlineparser.MarkwonInlineParserPlugin;
|
||||
import io.noties.markwon.linkify.LinkifyPlugin;
|
||||
@@ -105,7 +105,6 @@ public class MessageRecyclerViewAdapter extends PagedListAdapter<CommentInteract
|
||||
mMarkwon = Markwon.builder(mActivity)
|
||||
.usePlugin(MarkwonInlineParserPlugin.create(plugin -> {
|
||||
plugin.excludeInlineProcessor(HtmlInlineProcessor.class);
|
||||
plugin.excludeInlineProcessor(BangInlineProcessor.class);
|
||||
}))
|
||||
.usePlugin(new AbstractMarkwonPlugin() {
|
||||
@Override
|
||||
@@ -129,6 +128,7 @@ public class MessageRecyclerViewAdapter extends PagedListAdapter<CommentInteract
|
||||
.usePlugin(StrikethroughPlugin.create())
|
||||
.usePlugin(MovementMethodPlugin.create(new SpoilerAwareMovementMethod()))
|
||||
.usePlugin(LinkifyPlugin.create(Linkify.WEB_URLS))
|
||||
.usePlugin(GlideImagesPlugin.create(mActivity))
|
||||
.build();
|
||||
mAccessToken = accessToken;
|
||||
if (where.equals(FetchMessage.WHERE_MESSAGES)) {
|
||||
@@ -182,6 +182,9 @@ public class MessageRecyclerViewAdapter extends PagedListAdapter<CommentInteract
|
||||
|
||||
intent.putExtra(ViewPostDetailActivity.EXTRA_POST_ID, message.getComment().getPostId());
|
||||
intent.putExtra(ViewPostDetailActivity.EXTRA_SINGLE_COMMENT_ID, message.getComment().getId());
|
||||
if(message.getComment().getDepth() > 0) {
|
||||
intent.putExtra(ViewPostDetailActivity.EXTRA_SINGLE_COMMENT_PARENT_ID, message.getComment().getParentId());
|
||||
}
|
||||
mActivity.startActivity(intent);
|
||||
} else if (mMessageType == FetchMessage.MESSAGE_TYPE_PRIVATE_MESSAGE) {
|
||||
Intent intent = new Intent(mActivity, ViewPrivateMessagesActivity.class);
|
||||
|
||||
@@ -98,6 +98,7 @@ import eu.toldi.infinityforlemmy.markdown.MarkdownUtils;
|
||||
import eu.toldi.infinityforlemmy.post.Post;
|
||||
import eu.toldi.infinityforlemmy.post.PostPagingSource;
|
||||
import eu.toldi.infinityforlemmy.utils.APIUtils;
|
||||
import eu.toldi.infinityforlemmy.utils.LemmyUtils;
|
||||
import eu.toldi.infinityforlemmy.utils.SharedPreferencesUtils;
|
||||
import eu.toldi.infinityforlemmy.utils.Utils;
|
||||
import eu.toldi.infinityforlemmy.videoautoplay.CacheManager;
|
||||
@@ -438,7 +439,7 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler
|
||||
}
|
||||
return new PostDetailVideoAutoplayViewHolder(LayoutInflater.from(parent.getContext()).inflate(mLegacyAutoplayVideoControllerUI ? R.layout.item_post_detail_video_autoplay_legacy_controller : R.layout.item_post_detail_video_autoplay, parent, false));
|
||||
case VIEW_TYPE_POST_DETAIL_VIDEO_AND_GIF_PREVIEW:
|
||||
if (mDataSavingMode && (mDisableImagePreview || mOnlyDisablePreviewInVideoAndGifPosts)) {
|
||||
if (mDataSavingMode && (mDisableImagePreview || mOnlyDisablePreviewInVideoAndGifPosts) || mPost.getPreviews().isEmpty()) {
|
||||
return new PostDetailNoPreviewViewHolder(LayoutInflater.from(parent.getContext()).inflate(R.layout.item_post_detail_no_preview, parent, false));
|
||||
}
|
||||
return new PostDetailVideoAndGifPreviewHolder(LayoutInflater.from(parent.getContext()).inflate(R.layout.item_post_detail_video_and_gif_preview, parent, false));
|
||||
@@ -475,8 +476,7 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler
|
||||
((PostDetailBaseViewHolder) holder).mTitleTextView.setText(mPost.getTitle());
|
||||
if (mPost.getSubredditNamePrefixed().startsWith("u/")) {
|
||||
if (mPost.getAuthorIconUrl() == null) {
|
||||
String authorName = mPost.isAuthorDeleted() ? mPost.getSubredditNamePrefixed().substring(2) : mPost.getAuthor();
|
||||
LoadUserData.loadUserData(mExecutor, new Handler(), mRedditDataRoomDatabase, authorName, mOauthRetrofit, iconImageUrl -> {
|
||||
LoadUserData.loadUserData(mExecutor, new Handler(), mRedditDataRoomDatabase,mPost.getAuthorNamePrefixed(), mOauthRetrofit, iconImageUrl -> {
|
||||
if (mActivity != null && getItemCount() > 0) {
|
||||
if (iconImageUrl == null || iconImageUrl.equals("")) {
|
||||
mGlide.load(R.drawable.subreddit_default_icon)
|
||||
@@ -1219,6 +1219,10 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler
|
||||
this.mSaveButton = mSaveButton;
|
||||
this.mShareButton = mShareButton;
|
||||
|
||||
if(!mCurrentAccountSharedPreferences.getBoolean(SharedPreferencesUtils.CAN_DOWNVOTE,true)){
|
||||
mDownvoteButton.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
mIconGifImageView.setOnClickListener(view -> mSubredditTextView.performClick());
|
||||
|
||||
mSubredditTextView.setOnClickListener(view -> {
|
||||
@@ -1765,8 +1769,8 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler
|
||||
} else {
|
||||
intent.setData(Uri.parse(mPost.getVideoUrl()));
|
||||
intent.putExtra(ViewVideoActivity.EXTRA_VIDEO_DOWNLOAD_URL, mPost.getVideoDownloadUrl());
|
||||
intent.putExtra(ViewVideoActivity.EXTRA_SUBREDDIT, mPost.getSubredditName());
|
||||
intent.putExtra(ViewVideoActivity.EXTRA_ID, mPost.getId());
|
||||
intent.putExtra(ViewVideoActivity.EXTRA_VIDEO_TYPE, ViewVideoActivity.VIDEO_TYPE_DIRECT);
|
||||
|
||||
}
|
||||
intent.putExtra(ViewVideoActivity.EXTRA_POST_TITLE, mPost.getTitle());
|
||||
if (helper != null) {
|
||||
@@ -2038,8 +2042,7 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler
|
||||
intent.putExtra(ViewVideoActivity.EXTRA_STREAMABLE_SHORT_CODE, mPost.getStreamableShortCode());
|
||||
} else {
|
||||
intent.setData(Uri.parse(mPost.getVideoUrl()));
|
||||
intent.putExtra(ViewVideoActivity.EXTRA_SUBREDDIT, mPost.getSubredditName());
|
||||
intent.putExtra(ViewVideoActivity.EXTRA_ID, mPost.getId());
|
||||
intent.putExtra(ViewVideoActivity.EXTRA_VIDEO_TYPE, ViewVideoActivity.VIDEO_TYPE_DIRECT);
|
||||
intent.putExtra(ViewVideoActivity.EXTRA_VIDEO_DOWNLOAD_URL, mPost.getVideoDownloadUrl());
|
||||
}
|
||||
intent.putExtra(ViewVideoActivity.EXTRA_POST_TITLE, mPost.getTitle());
|
||||
@@ -2377,7 +2380,7 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler
|
||||
intent.putExtra(ViewVideoActivity.EXTRA_STREAMABLE_SHORT_CODE, mPost.getStreamableShortCode());
|
||||
} else {
|
||||
intent.setData(Uri.parse(mPost.getVideoUrl()));
|
||||
intent.putExtra(ViewVideoActivity.EXTRA_SUBREDDIT, mPost.getSubredditName());
|
||||
intent.putExtra(ViewVideoActivity.EXTRA_VIDEO_TYPE, ViewVideoActivity.VIDEO_TYPE_DIRECT);
|
||||
intent.putExtra(ViewVideoActivity.EXTRA_ID, mPost.getId());
|
||||
intent.putExtra(ViewVideoActivity.EXTRA_VIDEO_DOWNLOAD_URL, mPost.getVideoDownloadUrl());
|
||||
}
|
||||
|
||||
@@ -542,7 +542,7 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie
|
||||
if (mDisplaySubredditName) {
|
||||
if (authorPrefixed.equals(post.getSubredditNamePrefixed())) {
|
||||
if (post.getAuthorIconUrl() == null) {
|
||||
mFragment.loadIcon(post.getAuthor(), false, (subredditOrUserName, iconUrl) -> {
|
||||
mFragment.loadIcon(post.getAuthorNamePrefixed(), false, (subredditOrUserName, iconUrl) -> {
|
||||
if (mActivity != null && getItemCount() > 0 && post.getAuthor().equals(subredditOrUserName)) {
|
||||
if (iconUrl == null || iconUrl.equals("")) {
|
||||
mGlide.load(R.drawable.subreddit_default_icon)
|
||||
@@ -574,7 +574,7 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie
|
||||
}
|
||||
} else {
|
||||
if (post.getSubredditIconUrl() == null) {
|
||||
mFragment.loadIcon(post.getSubredditName(), true, (subredditOrUserName, iconUrl) -> {
|
||||
mFragment.loadIcon(post.getSubredditNamePrefixed(), true, (subredditOrUserName, iconUrl) -> {
|
||||
if (mActivity != null && getItemCount() > 0 && post.getSubredditName().equals(subredditOrUserName)) {
|
||||
if (iconUrl == null || iconUrl.equals("")) {
|
||||
mGlide.load(R.drawable.subreddit_default_icon)
|
||||
@@ -608,7 +608,7 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie
|
||||
} else {
|
||||
if (post.getAuthorIconUrl() == null) {
|
||||
String authorName = post.isAuthorDeleted() ? post.getSubredditName() : post.getAuthor();
|
||||
mFragment.loadIcon(authorName, post.isAuthorDeleted(), (subredditOrUserName, iconUrl) -> {
|
||||
mFragment.loadIcon(post.getSubredditNamePrefixed(), post.isAuthorDeleted(), (subredditOrUserName, iconUrl) -> {
|
||||
if (mActivity != null && getItemCount() > 0) {
|
||||
if (iconUrl == null || iconUrl.equals("") && authorName.equals(subredditOrUserName)) {
|
||||
mGlide.load(R.drawable.subreddit_default_icon)
|
||||
@@ -913,15 +913,15 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie
|
||||
public void onResourceReady(@NonNull Drawable resource, @Nullable Transition<? super Drawable> transition) {
|
||||
int width = resource.getIntrinsicWidth();
|
||||
int height = resource.getIntrinsicHeight();
|
||||
((PostVideoAutoplayViewHolder) holder).previewImageView.setImageDrawable(resource);
|
||||
((PostCard2VideoAutoplayViewHolder) holder).previewImageView.setImageDrawable(resource);
|
||||
if (preview.getPreviewHeight() <= 0 || preview.getPreviewWidth() <= 0) {
|
||||
((PostVideoAutoplayViewHolder) holder).aspectRatioFrameLayout.setAspectRatio((float) height / width);
|
||||
((PostVideoAutoplayViewHolder) holder).previewImageView.getLayoutParams().height = height;
|
||||
((PostCard2VideoAutoplayViewHolder) holder).aspectRatioFrameLayout.setAspectRatio((float) height / width);
|
||||
((PostCard2VideoAutoplayViewHolder) holder).previewImageView.getLayoutParams().height = height;
|
||||
preview.setPreviewHeight(height);
|
||||
preview.setPreviewWidth(width);
|
||||
} else {
|
||||
((PostVideoAutoplayViewHolder) holder).aspectRatioFrameLayout.setAspectRatio((float) preview.getPreviewHeight() / preview.getPreviewWidth());
|
||||
((PostVideoAutoplayViewHolder) holder).previewImageView.getLayoutParams().height = height;
|
||||
((PostCard2VideoAutoplayViewHolder) holder).aspectRatioFrameLayout.setAspectRatio((float) preview.getPreviewHeight() / preview.getPreviewWidth());
|
||||
((PostCard2VideoAutoplayViewHolder) holder).previewImageView.getLayoutParams().height = height;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1099,7 +1099,7 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie
|
||||
((PostCompactBaseViewHolder) holder).titleTextView.setTextColor(mReadPostTitleColor);
|
||||
}
|
||||
final String subredditNamePrefixed = post.getSubredditNamePrefixed();
|
||||
String subredditName = subredditNamePrefixed.substring(2);
|
||||
String subredditName = subredditNamePrefixed;
|
||||
String authorPrefixed = post.getAuthorNamePrefixed();
|
||||
final String title = post.getTitle();
|
||||
int voteType = post.getVoteType();
|
||||
@@ -1109,8 +1109,8 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie
|
||||
if (mDisplaySubredditName) {
|
||||
if (authorPrefixed.equals(subredditNamePrefixed)) {
|
||||
if (post.getAuthorIconUrl() == null) {
|
||||
mFragment.loadIcon(post.getAuthor(), false, (subredditOrUserName, iconUrl) -> {
|
||||
if (mActivity != null && getItemCount() > 0 && post.getAuthor().equals(subredditOrUserName)) {
|
||||
mFragment.loadIcon(post.getAuthorNamePrefixed(), false, (subredditOrUserName, iconUrl) -> {
|
||||
if (mActivity != null && getItemCount() > 0 && post.getAuthorNamePrefixed().equals(subredditOrUserName)) {
|
||||
if (iconUrl == null || iconUrl.equals("")) {
|
||||
mGlide.load(R.drawable.subreddit_default_icon)
|
||||
.apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(72, 0)))
|
||||
@@ -1141,7 +1141,7 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie
|
||||
}
|
||||
} else {
|
||||
if (post.getSubredditIconUrl() == null) {
|
||||
mFragment.loadIcon(subredditName, true, (subredditOrUserName, iconUrl) -> {
|
||||
mFragment.loadIcon(subredditNamePrefixed, true, (subredditOrUserName, iconUrl) -> {
|
||||
if (mActivity != null && getItemCount() > 0 && subredditName.equals(subredditOrUserName)) {
|
||||
if (iconUrl == null || iconUrl.equals("")) {
|
||||
mGlide.load(R.drawable.subreddit_default_icon)
|
||||
@@ -1181,8 +1181,8 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie
|
||||
}
|
||||
} else {
|
||||
if (post.getAuthorIconUrl() == null) {
|
||||
String authorName = post.isAuthorDeleted() ? post.getSubredditName() : post.getAuthor();
|
||||
mFragment.loadIcon(authorName, post.isAuthorDeleted(), (subredditOrUserName, iconUrl) -> {
|
||||
String authorName = post.getAuthorNamePrefixed();
|
||||
mFragment.loadIcon(post.getAuthorNamePrefixed(), false, (subredditOrUserName, iconUrl) -> {
|
||||
if (mActivity != null && getItemCount() > 0 && authorName.equals(subredditOrUserName)) {
|
||||
if (iconUrl == null || iconUrl.equals("")) {
|
||||
mGlide.load(R.drawable.subreddit_default_icon)
|
||||
@@ -2249,8 +2249,7 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie
|
||||
intent.putExtra(ViewVideoActivity.EXTRA_STREAMABLE_SHORT_CODE, post.getStreamableShortCode());
|
||||
} else {
|
||||
intent.setData(Uri.parse(post.getVideoUrl()));
|
||||
intent.putExtra(ViewVideoActivity.EXTRA_SUBREDDIT, post.getSubredditName());
|
||||
intent.putExtra(ViewVideoActivity.EXTRA_ID, post.getId());
|
||||
intent.putExtra(ViewVideoActivity.EXTRA_VIDEO_TYPE, ViewVideoActivity.VIDEO_TYPE_DIRECT);
|
||||
intent.putExtra(ViewVideoActivity.EXTRA_VIDEO_DOWNLOAD_URL, post.getVideoDownloadUrl());
|
||||
}
|
||||
intent.putExtra(ViewVideoActivity.EXTRA_POST_TITLE, post.getTitle());
|
||||
@@ -2371,6 +2370,9 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie
|
||||
this.shareButton = shareButton;
|
||||
|
||||
scoreTextView.setOnClickListener(null);
|
||||
if(!mCurrentAccountSharedPreferences.getBoolean(SharedPreferencesUtils.CAN_DOWNVOTE,true)){
|
||||
downvoteButton.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
if (mVoteButtonsOnTheRight) {
|
||||
ConstraintSet constraintSet = new ConstraintSet();
|
||||
@@ -3728,6 +3730,10 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie
|
||||
|
||||
scoreTextView.setOnClickListener(null);
|
||||
|
||||
if(!mCurrentAccountSharedPreferences.getBoolean(SharedPreferencesUtils.CAN_DOWNVOTE,true)){
|
||||
downvoteButton.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
if (mVoteButtonsOnTheRight) {
|
||||
ConstraintSet constraintSet = new ConstraintSet();
|
||||
constraintSet.clone(bottomConstraintLayout);
|
||||
|
||||
@@ -221,4 +221,9 @@ public interface LemmyAPI {
|
||||
@Query("id") int commentId,
|
||||
@Query("auth") String auth
|
||||
);
|
||||
|
||||
@GET("api/v3/site")
|
||||
Call<String> getSiteInfo(
|
||||
@Query("auth") String auth
|
||||
);
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import eu.toldi.infinityforlemmy.RedditDataRoomDatabase;
|
||||
import eu.toldi.infinityforlemmy.subreddit.FetchSubredditData;
|
||||
import eu.toldi.infinityforlemmy.subreddit.SubredditDao;
|
||||
import eu.toldi.infinityforlemmy.subreddit.SubredditData;
|
||||
import eu.toldi.infinityforlemmy.utils.LemmyUtils;
|
||||
import retrofit2.Retrofit;
|
||||
|
||||
public class LoadSubredditIcon {
|
||||
@@ -18,9 +19,9 @@ public class LoadSubredditIcon {
|
||||
LoadSubredditIconAsyncTaskListener loadSubredditIconAsyncTaskListener) {
|
||||
executor.execute(() -> {
|
||||
SubredditDao subredditDao = redditDataRoomDatabase.subredditDao();
|
||||
SubredditData subredditData = subredditDao.getSubredditData(subredditName);
|
||||
SubredditData subredditData = subredditDao.getSubredditDataByActorId(LemmyUtils.qualifiedCommunityName2ActorId(subredditName));
|
||||
if (subredditData != null) {
|
||||
String iconImageUrl = subredditDao.getSubredditData(subredditName).getIconUrl();
|
||||
String iconImageUrl = subredditDao.getSubredditDataByActorId(LemmyUtils.qualifiedCommunityName2ActorId(subredditName)).getIconUrl();
|
||||
handler.post(() -> loadSubredditIconAsyncTaskListener.loadIconSuccess(iconImageUrl));
|
||||
} else {
|
||||
handler.post(() -> FetchSubredditData.fetchSubredditData(retrofit, subredditName, accessToken, new FetchSubredditData.FetchSubredditDataListener() {
|
||||
|
||||
@@ -8,6 +8,7 @@ import eu.toldi.infinityforlemmy.RedditDataRoomDatabase;
|
||||
import eu.toldi.infinityforlemmy.user.FetchUserData;
|
||||
import eu.toldi.infinityforlemmy.user.UserDao;
|
||||
import eu.toldi.infinityforlemmy.user.UserData;
|
||||
import eu.toldi.infinityforlemmy.utils.LemmyUtils;
|
||||
import retrofit2.Retrofit;
|
||||
|
||||
public class LoadUserData {
|
||||
@@ -16,8 +17,9 @@ public class LoadUserData {
|
||||
Retrofit retrofit, LoadUserDataAsyncTaskListener loadUserDataAsyncTaskListener) {
|
||||
executor.execute(() -> {
|
||||
UserDao userDao = redditDataRoomDatabase.userDao();
|
||||
if (userDao.getUserData(userName) != null) {
|
||||
String iconImageUrl = userDao.getUserData(userName).getIconUrl();
|
||||
UserData userData= userDao.getUserDataByActorId(LemmyUtils.qualifiedUserName2ActorId(userName));
|
||||
if (userData != null) {
|
||||
String iconImageUrl = userData.getIconUrl();
|
||||
handler.post(() -> loadUserDataAsyncTaskListener.loadUserDataSuccess(iconImageUrl));
|
||||
} else {
|
||||
handler.post(() -> FetchUserData.fetchUserData(retrofit, userName, new FetchUserData.FetchUserDataListener() {
|
||||
|
||||
@@ -11,11 +11,11 @@ public class ParseAndInsertNewAccount {
|
||||
|
||||
public static void parseAndInsertNewAccount(Executor executor, Handler handler, String username,
|
||||
String display_name,String accessToken, String profileImageUrl,
|
||||
String bannerImageUrl, String code,String instance, AccountDao accountDao,
|
||||
String bannerImageUrl, String code,String instance,boolean can_downvote, AccountDao accountDao,
|
||||
ParseAndInsertAccountListener parseAndInsertAccountListener) {
|
||||
executor.execute(() -> {
|
||||
Account account = new Account(username,display_name, accessToken, code, profileImageUrl,
|
||||
bannerImageUrl, true,instance);
|
||||
bannerImageUrl, true,instance,true);
|
||||
accountDao.markAllAccountsNonCurrent();
|
||||
accountDao.insert(account);
|
||||
|
||||
|
||||
@@ -8,6 +8,8 @@ import java.util.concurrent.Executor;
|
||||
import eu.toldi.infinityforlemmy.RedditDataRoomDatabase;
|
||||
import eu.toldi.infinityforlemmy.RetrofitHolder;
|
||||
import eu.toldi.infinityforlemmy.account.Account;
|
||||
import eu.toldi.infinityforlemmy.site.FetchSiteInfo;
|
||||
import eu.toldi.infinityforlemmy.site.SiteInfo;
|
||||
import eu.toldi.infinityforlemmy.utils.SharedPreferencesUtils;
|
||||
|
||||
public class SwitchAccount {
|
||||
@@ -26,6 +28,18 @@ public class SwitchAccount {
|
||||
.putString(SharedPreferencesUtils.ACCOUNT_INSTANCE,account.getInstance_url())
|
||||
.putString(SharedPreferencesUtils.ACCOUNT_IMAGE_URL, account.getProfileImageUrl()).apply();
|
||||
retrofitHolder.setBaseURL(account.getInstance_url());
|
||||
FetchSiteInfo.fetchSiteInfo(retrofitHolder.getRetrofit(), account.getAccessToken(), new FetchSiteInfo.FetchSiteInfoListener() {
|
||||
@Override
|
||||
public void onFetchSiteInfoSuccess(SiteInfo siteInfo) {
|
||||
boolean canDownvote = siteInfo.isEnable_downvotes();
|
||||
currentAccountSharedPreferences.edit().putBoolean(SharedPreferencesUtils.CAN_DOWNVOTE, canDownvote).apply();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFetchSiteInfoFailed() {
|
||||
currentAccountSharedPreferences.edit().putBoolean(SharedPreferencesUtils.CAN_DOWNVOTE, true).apply();
|
||||
}
|
||||
});
|
||||
handler.post(() -> switchAccountListener.switched(account));
|
||||
});
|
||||
|
||||
|
||||
@@ -55,12 +55,8 @@ public class CommentMoreBottomSheetFragment extends LandscapeExpandedRoundedBott
|
||||
TextView shareTextView;
|
||||
@BindView(R.id.copy_text_view_comment_more_bottom_sheet_fragment)
|
||||
TextView copyTextView;
|
||||
@BindView(R.id.give_award_text_view_comment_more_bottom_sheet_fragment)
|
||||
TextView giveAwardTextView;
|
||||
@BindView(R.id.report_view_comment_more_bottom_sheet_fragment)
|
||||
TextView reportTextView;
|
||||
@BindView(R.id.see_removed_view_comment_more_bottom_sheet_fragment)
|
||||
TextView seeRemovedTextView;
|
||||
private BaseActivity activity;
|
||||
|
||||
public CommentMoreBottomSheetFragment() {
|
||||
@@ -93,18 +89,6 @@ public class CommentMoreBottomSheetFragment extends LandscapeExpandedRoundedBott
|
||||
boolean showReplyAndSaveOption = bundle.getBoolean(EXTRA_SHOW_REPLY_AND_SAVE_OPTION, false);
|
||||
|
||||
if (accessToken != null && !accessToken.equals("")) {
|
||||
giveAwardTextView.setVisibility(View.VISIBLE);
|
||||
giveAwardTextView.setOnClickListener(view -> {
|
||||
Intent intent = new Intent(activity, GiveAwardActivity.class);
|
||||
intent.putExtra(GiveAwardActivity.EXTRA_THING_FULLNAME, comment.getFullName());
|
||||
intent.putExtra(GiveAwardActivity.EXTRA_ITEM_POSITION, bundle.getInt(EXTRA_POSITION));
|
||||
if (activity instanceof ViewPostDetailActivity) {
|
||||
activity.startActivityForResult(intent, ViewPostDetailActivity.GIVE_AWARD_REQUEST_CODE);
|
||||
} else if (activity instanceof ViewUserDetailActivity) {
|
||||
activity.startActivityForResult(intent, ViewUserDetailActivity.GIVE_AWARD_REQUEST_CODE);
|
||||
}
|
||||
dismiss();
|
||||
});
|
||||
|
||||
if (editAndDeleteAvailable) {
|
||||
editTextView.setVisibility(View.VISIBLE);
|
||||
@@ -193,27 +177,14 @@ public class CommentMoreBottomSheetFragment extends LandscapeExpandedRoundedBott
|
||||
});
|
||||
|
||||
reportTextView.setOnClickListener(view -> {
|
||||
Intent intent = new Intent(activity, ReportActivity.class);
|
||||
/*Intent intent = new Intent(activity, ReportActivity.class);
|
||||
intent.putExtra(ReportActivity.EXTRA_SUBREDDIT_NAME, comment.getCommunityName());
|
||||
intent.putExtra(ReportActivity.EXTRA_THING_FULLNAME, comment.getFullName());
|
||||
activity.startActivity(intent);
|
||||
|
||||
activity.startActivity(intent);*/
|
||||
Toast.makeText(activity, R.string.not_implemented, Toast.LENGTH_SHORT).show();
|
||||
dismiss();
|
||||
});
|
||||
|
||||
if ("[deleted]".equals(comment.getAuthor()) ||
|
||||
"[deleted]".equals(comment.getCommentRawText()) ||
|
||||
"[removed]".equals(comment.getCommentRawText())
|
||||
) {
|
||||
seeRemovedTextView.setVisibility(View.VISIBLE);
|
||||
|
||||
seeRemovedTextView.setOnClickListener(view -> {
|
||||
dismiss();
|
||||
if (activity instanceof ViewPostDetailActivity) {
|
||||
((ViewPostDetailActivity) activity).showRemovedComment(comment, bundle.getInt(EXTRA_POSITION));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (activity.typeface != null) {
|
||||
Utils.setFontToAllTextViews(rootView, activity.typeface);
|
||||
|
||||
@@ -24,7 +24,6 @@ import java.util.TimeZone;
|
||||
import java.util.concurrent.Executor;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import eu.toldi.infinityforlemmy.markdown.MarkdownUtils;
|
||||
import eu.toldi.infinityforlemmy.utils.JSONUtils;
|
||||
import eu.toldi.infinityforlemmy.utils.LemmyUtils;
|
||||
|
||||
@@ -285,6 +284,12 @@ public class ParseComment {
|
||||
String author = creatorObj.getString("name");
|
||||
String authorQualifiedName = LemmyUtils.actorID2FullName(creatorObj.getString("actor_id"));
|
||||
String linkAuthor = creatorObj.getString("actor_id");
|
||||
|
||||
|
||||
String authorAvatar = null;
|
||||
if(creatorObj.has("avatar")){
|
||||
authorAvatar = creatorObj.getString("avatar");
|
||||
}
|
||||
long commentTimeMillis = 0;
|
||||
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
|
||||
commentTimeMillis = ZonedDateTime.parse(commentObj.getString("published"),
|
||||
@@ -304,7 +309,7 @@ public class ParseComment {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
String content = MarkdownUtils.processImageCaptions(commentObj.getString("content"), "Image");
|
||||
String content = commentObj.getString("content");
|
||||
String commentMarkdown = content;
|
||||
String commentRawText = content;
|
||||
String linkId = postObj.getString("id");
|
||||
@@ -335,6 +340,7 @@ public class ParseComment {
|
||||
score, voteType, isSubmitter, distinguished, permalink, depth, collapsed, hasReply, saved, deleted, edited, path);
|
||||
int child_count = countsObj.getInt("child_count");
|
||||
comment.setChildCount(child_count);
|
||||
comment.setAuthorIconUrl(authorAvatar);
|
||||
return comment;
|
||||
}
|
||||
|
||||
|
||||
@@ -137,6 +137,7 @@ import eu.toldi.infinityforlemmy.post.PostPagingSource;
|
||||
import eu.toldi.infinityforlemmy.post.PostViewModel;
|
||||
import eu.toldi.infinityforlemmy.postfilter.PostFilter;
|
||||
import eu.toldi.infinityforlemmy.postfilter.PostFilterUsage;
|
||||
import eu.toldi.infinityforlemmy.utils.LemmyUtils;
|
||||
import eu.toldi.infinityforlemmy.utils.SharedPreferencesUtils;
|
||||
import eu.toldi.infinityforlemmy.utils.Utils;
|
||||
import eu.toldi.infinityforlemmy.videoautoplay.ExoCreator;
|
||||
|
||||
@@ -78,7 +78,6 @@ import eu.toldi.infinityforlemmy.SaveThing;
|
||||
import eu.toldi.infinityforlemmy.SortType;
|
||||
import eu.toldi.infinityforlemmy.activities.CommentActivity;
|
||||
import eu.toldi.infinityforlemmy.activities.EditPostActivity;
|
||||
import eu.toldi.infinityforlemmy.activities.GiveAwardActivity;
|
||||
import eu.toldi.infinityforlemmy.activities.PostFilterPreferenceActivity;
|
||||
import eu.toldi.infinityforlemmy.activities.ReportActivity;
|
||||
import eu.toldi.infinityforlemmy.activities.SubmitCrosspostActivity;
|
||||
@@ -129,6 +128,8 @@ public class ViewPostDetailFragment extends Fragment implements FragmentCommunic
|
||||
public static final String EXTRA_POST_DATA = "EPD";
|
||||
public static final String EXTRA_POST_ID = "EPI";
|
||||
public static final String EXTRA_SINGLE_COMMENT_ID = "ESCI";
|
||||
|
||||
public static final String EXTRA_SINGLE_COMMENT_PARENT_ID = "ESCPID";
|
||||
public static final String EXTRA_CONTEXT_NUMBER = "ECN";
|
||||
public static final String EXTRA_MESSAGE_FULLNAME = "EMF";
|
||||
public static final String EXTRA_POST_LIST_POSITION = "EPLP";
|
||||
@@ -229,6 +230,7 @@ public class ViewPostDetailFragment extends Fragment implements FragmentCommunic
|
||||
private String mAccountQualifiedName;
|
||||
private int postListPosition = -1;
|
||||
private Integer mSingleCommentId;
|
||||
private Integer mSingleCommentParentId;
|
||||
private String mContextNumber;
|
||||
private boolean showToast = false;
|
||||
private boolean mIsSmoothScrolling = false;
|
||||
@@ -547,6 +549,7 @@ public class ViewPostDetailFragment extends Fragment implements FragmentCommunic
|
||||
};
|
||||
|
||||
mSingleCommentId = getArguments().getInt(EXTRA_SINGLE_COMMENT_ID, 0);
|
||||
mSingleCommentParentId = getArguments().getInt(EXTRA_SINGLE_COMMENT_PARENT_ID, 0);
|
||||
mContextNumber = getArguments().getString(EXTRA_CONTEXT_NUMBER, "8");
|
||||
|
||||
if (savedInstanceState == null) {
|
||||
@@ -606,8 +609,8 @@ public class ViewPostDetailFragment extends Fragment implements FragmentCommunic
|
||||
mExoCreator, post -> EventBus.getDefault().post(new PostUpdateEventToPostList(mPost, postListPosition)));
|
||||
mCommentsAdapter = new CommentsRecyclerViewAdapter(activity,
|
||||
this, mCustomThemeWrapper, mExecutor, mRetrofit.getRetrofit(),
|
||||
mAccessToken, mAccountName, mPost, mLocale, mSingleCommentId,
|
||||
isSingleCommentThreadMode, mSharedPreferences,
|
||||
mAccessToken, mAccountName, mPost, mLocale, mSingleCommentId
|
||||
, isSingleCommentThreadMode, mSharedPreferences,
|
||||
new CommentsRecyclerViewAdapter.CommentRecyclerViewAdapterCallback() {
|
||||
@Override
|
||||
public void retryFetchingComments() {
|
||||
@@ -626,7 +629,7 @@ public class ViewPostDetailFragment extends Fragment implements FragmentCommunic
|
||||
public SortType.Type getSortType() {
|
||||
return sortType;
|
||||
}
|
||||
});
|
||||
} );
|
||||
if (mCommentsRecyclerView != null) {
|
||||
mRecyclerView.setAdapter(mPostAdapter);
|
||||
mCommentsRecyclerView.setAdapter(mCommentsAdapter);
|
||||
@@ -704,7 +707,7 @@ public class ViewPostDetailFragment extends Fragment implements FragmentCommunic
|
||||
MenuItem spoilerItem = mMenu.findItem(R.id.action_spoiler_view_post_detail_fragment);
|
||||
spoilerItem.setVisible(true);
|
||||
|
||||
mMenu.findItem(R.id.action_edit_flair_view_post_detail_fragment).setVisible(true);
|
||||
mMenu.findItem(R.id.action_block_user_view_post_detail_fragment).setVisible(false);
|
||||
}
|
||||
|
||||
mMenu.findItem(R.id.action_view_crosspost_parent_view_post_detail_fragment).setVisible(mPost.getCrosspostParentId() != null);
|
||||
@@ -1067,35 +1070,18 @@ public class ViewPostDetailFragment extends Fragment implements FragmentCommunic
|
||||
return true;
|
||||
} else if (itemId == R.id.action_spoiler_view_post_detail_fragment) {
|
||||
return true;
|
||||
} else if (itemId == R.id.action_edit_flair_view_post_detail_fragment) {
|
||||
FlairBottomSheetFragment flairBottomSheetFragment = new FlairBottomSheetFragment();
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString(FlairBottomSheetFragment.EXTRA_ACCESS_TOKEN, mAccessToken);
|
||||
bundle.putString(FlairBottomSheetFragment.EXTRA_SUBREDDIT_NAME, mPost.getSubredditName());
|
||||
bundle.putLong(FlairBottomSheetFragment.EXTRA_VIEW_POST_DETAIL_FRAGMENT_ID, viewPostDetailFragmentId);
|
||||
flairBottomSheetFragment.setArguments(bundle);
|
||||
flairBottomSheetFragment.show(activity.getSupportFragmentManager(), flairBottomSheetFragment.getTag());
|
||||
} else if (itemId == R.id.action_block_user_view_post_detail_fragment) {
|
||||
Toast.makeText(activity, R.string.not_implemented, Toast.LENGTH_SHORT).show();
|
||||
return true;
|
||||
} else if (itemId == R.id.action_give_award_view_post_detail_fragment) {
|
||||
if (mAccessToken == null) {
|
||||
Toast.makeText(activity, R.string.login_first, Toast.LENGTH_SHORT).show();
|
||||
return true;
|
||||
}
|
||||
|
||||
Intent giveAwardIntent = new Intent(activity, GiveAwardActivity.class);
|
||||
giveAwardIntent.putExtra(GiveAwardActivity.EXTRA_THING_FULLNAME, mPost.getFullName());
|
||||
giveAwardIntent.putExtra(GiveAwardActivity.EXTRA_ITEM_POSITION, 0);
|
||||
activity.startActivityForResult(giveAwardIntent, ViewPostDetailActivity.GIVE_AWARD_REQUEST_CODE);
|
||||
} else if (itemId == R.id.action_block_community_view_post_detail_fragment) {
|
||||
Toast.makeText(activity, R.string.not_implemented, Toast.LENGTH_SHORT).show();
|
||||
return true;
|
||||
} else if (itemId == R.id.action_report_view_post_detail_fragment) {
|
||||
if (mAccessToken == null) {
|
||||
Toast.makeText(activity, R.string.login_first, Toast.LENGTH_SHORT).show();
|
||||
return true;
|
||||
}
|
||||
Intent intent = new Intent(activity, ReportActivity.class);
|
||||
intent.putExtra(ReportActivity.EXTRA_SUBREDDIT_NAME, mPost.getSubredditName());
|
||||
intent.putExtra(ReportActivity.EXTRA_THING_FULLNAME, mPost.getFullName());
|
||||
startActivity(intent);
|
||||
Toast.makeText(activity, R.string.not_implemented, Toast.LENGTH_SHORT).show();
|
||||
return true;
|
||||
} else if (itemId == R.id.action_see_removed_view_post_detail_fragment) {
|
||||
showRemovedPost();
|
||||
@@ -1185,7 +1171,7 @@ public class ViewPostDetailFragment extends Fragment implements FragmentCommunic
|
||||
if (mCommentsRecyclerView != null) {
|
||||
LinearLayoutManager myLayoutManager = (LinearLayoutManager) mCommentsRecyclerView.getLayoutManager();
|
||||
scrollPosition = myLayoutManager != null ? myLayoutManager.findFirstVisibleItemPosition() : 0;
|
||||
|
||||
|
||||
} else {
|
||||
LinearLayoutManager myLayoutManager = (LinearLayoutManager) mRecyclerView.getLayoutManager();
|
||||
scrollPosition = myLayoutManager != null ? myLayoutManager.findFirstVisibleItemPosition() : 0;
|
||||
@@ -1245,7 +1231,7 @@ public class ViewPostDetailFragment extends Fragment implements FragmentCommunic
|
||||
mPostDetailsSharedPreferences, mExoCreator,
|
||||
post1 -> EventBus.getDefault().post(new PostUpdateEventToPostList(mPost, postListPosition)));
|
||||
mSwipeRefreshLayout.setRefreshing(false);
|
||||
FetchComment.fetchComments(mExecutor, new Handler(), mRetrofit.getRetrofit(), mAccessToken, post.getId(), mSingleCommentId == 0 ? null : mSingleCommentId, sortType, mExpandChildren, 1, new FetchComment.FetchCommentListener() {
|
||||
FetchComment.fetchComments(mExecutor, new Handler(), mRetrofit.getRetrofit(), mAccessToken, post.getId(), mSingleCommentId == 0 ? null : mSingleCommentParentId == 0 ? mSingleCommentId : mSingleCommentParentId, sortType, mExpandChildren, 1, new FetchComment.FetchCommentListener() {
|
||||
@Override
|
||||
public void onFetchCommentSuccess(ArrayList<Comment> expandedComments, Integer parentId, ArrayList<Integer> children) {
|
||||
pages_loaded++;
|
||||
@@ -1364,7 +1350,7 @@ public class ViewPostDetailFragment extends Fragment implements FragmentCommunic
|
||||
}
|
||||
|
||||
|
||||
FetchComment.fetchComments(mExecutor, new Handler(), mRetrofit.getRetrofit(), mAccessToken, mPost.getId(), commentId, sortType, mExpandChildren, pages_loaded + 1,
|
||||
FetchComment.fetchComments(mExecutor, new Handler(), mRetrofit.getRetrofit(), mAccessToken, mPost.getId(), mSingleCommentId == 0 ? null : mSingleCommentParentId == 0 ? mSingleCommentId : mSingleCommentParentId, sortType, mExpandChildren, pages_loaded + 1,
|
||||
new FetchComment.FetchCommentListener() {
|
||||
@Override
|
||||
public void onFetchCommentSuccess(ArrayList<Comment> expandedComments,
|
||||
@@ -1433,8 +1419,8 @@ public class ViewPostDetailFragment extends Fragment implements FragmentCommunic
|
||||
@Override
|
||||
public void onFetchCommentFailed() {
|
||||
isFetchingComments = false;
|
||||
|
||||
mCommentsAdapter.initiallyLoadCommentsFailed();
|
||||
if(pages_loaded == 0)
|
||||
mCommentsAdapter.initiallyLoadCommentsFailed();
|
||||
if (changeRefreshState) {
|
||||
isRefreshing = false;
|
||||
}
|
||||
@@ -1454,7 +1440,7 @@ public class ViewPostDetailFragment extends Fragment implements FragmentCommunic
|
||||
isLoadingMoreChildren = true;
|
||||
|
||||
FetchComment.fetchComments(mExecutor, new Handler(), mRetrofit.getRetrofit(), mAccessToken,
|
||||
mPost.getId(), null, sortType, mExpandChildren, pages_loaded + 1, new FetchComment.FetchCommentListener() {
|
||||
mPost.getId(), mSingleCommentId == 0 ? null : mSingleCommentParentId == 0 ? mSingleCommentId : mSingleCommentParentId, sortType, mExpandChildren, pages_loaded + 1, new FetchComment.FetchCommentListener() {
|
||||
@Override
|
||||
public void onFetchCommentSuccess(ArrayList<Comment> expandedComments, Integer parentId, ArrayList<Integer> children) {
|
||||
pages_loaded++;
|
||||
@@ -1666,6 +1652,7 @@ public class ViewPostDetailFragment extends Fragment implements FragmentCommunic
|
||||
public void changeToNormalThreadMode() {
|
||||
isSingleCommentThreadMode = false;
|
||||
mSingleCommentId = null;
|
||||
mSingleCommentParentId = null;
|
||||
mRespectSubredditRecommendedSortType = mSharedPreferences.getBoolean(SharedPreferencesUtils.RESPECT_SUBREDDIT_RECOMMENDED_COMMENT_SORT_TYPE, false);
|
||||
refresh(false, true);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
package eu.toldi.infinityforlemmy.markdown;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.text.style.ClickableSpan;
|
||||
import android.view.View;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import org.commonmark.node.Image;
|
||||
|
||||
import eu.toldi.infinityforlemmy.activities.ViewImageOrGifActivity;
|
||||
import io.noties.markwon.AbstractMarkwonPlugin;
|
||||
import io.noties.markwon.MarkwonConfiguration;
|
||||
import io.noties.markwon.MarkwonSpansFactory;
|
||||
import io.noties.markwon.RenderProps;
|
||||
import io.noties.markwon.image.AsyncDrawableSpan;
|
||||
import io.noties.markwon.image.ImageSpanFactory;
|
||||
|
||||
public class ClickableGlideImagesPlugin extends AbstractMarkwonPlugin {
|
||||
|
||||
public static Context context;
|
||||
|
||||
public ClickableGlideImagesPlugin(Context context) {
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
public static ClickableGlideImagesPlugin create(Context context) {
|
||||
return new ClickableGlideImagesPlugin(context);
|
||||
}
|
||||
@Override
|
||||
public void configureSpansFactory(@NonNull MarkwonSpansFactory.Builder builder) {
|
||||
builder.setFactory(Image.class, new ClickableImageFactory());
|
||||
}
|
||||
|
||||
class ClickableImageFactory extends ImageSpanFactory {
|
||||
@Override
|
||||
public Object getSpans(@NonNull MarkwonConfiguration configuration, @NonNull RenderProps props) {
|
||||
AsyncDrawableSpan image = (AsyncDrawableSpan) super.getSpans(configuration, props);
|
||||
ClickableSpan clickableSpan = new ClickableSpan() {
|
||||
@Override
|
||||
public void onClick(@NonNull View widget) {
|
||||
Intent intent = new Intent(context, ViewImageOrGifActivity.class);
|
||||
intent.putExtra(ViewImageOrGifActivity.EXTRA_IMAGE_URL_KEY, image.getDrawable().getDestination());
|
||||
intent.putExtra(ViewImageOrGifActivity.EXTRA_FILE_NAME_KEY, image.getDrawable().getDestination());
|
||||
context.startActivity(intent);
|
||||
}
|
||||
};
|
||||
Object[] objects = new Object[2];
|
||||
objects[0] = image;
|
||||
objects[1] = clickableSpan;
|
||||
return objects;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -8,7 +8,6 @@ import androidx.annotation.Nullable;
|
||||
|
||||
import org.commonmark.ext.gfm.tables.TableBlock;
|
||||
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import eu.toldi.infinityforlemmy.R;
|
||||
@@ -16,6 +15,7 @@ import eu.toldi.infinityforlemmy.customviews.CustomMarkwonAdapter;
|
||||
import io.noties.markwon.Markwon;
|
||||
import io.noties.markwon.MarkwonPlugin;
|
||||
import io.noties.markwon.ext.strikethrough.StrikethroughPlugin;
|
||||
import io.noties.markwon.image.glide.GlideImagesPlugin;
|
||||
import io.noties.markwon.inlineparser.BangInlineProcessor;
|
||||
import io.noties.markwon.inlineparser.HtmlInlineProcessor;
|
||||
import io.noties.markwon.inlineparser.MarkwonInlineParserPlugin;
|
||||
@@ -38,9 +38,9 @@ public class MarkdownUtils {
|
||||
int spoilerBackgroundColor,
|
||||
@Nullable BetterLinkMovementMethod.OnLinkLongClickListener onLinkLongClickListener) {
|
||||
return Markwon.builder(context)
|
||||
.usePlugin(GlideImagesPlugin.create(context))
|
||||
.usePlugin(MarkwonInlineParserPlugin.create(plugin -> {
|
||||
plugin.excludeInlineProcessor(HtmlInlineProcessor.class);
|
||||
plugin.excludeInlineProcessor(BangInlineProcessor.class);
|
||||
}))
|
||||
.usePlugin(miscPlugin)
|
||||
.usePlugin(SuperscriptPlugin.create())
|
||||
@@ -51,6 +51,7 @@ public class MarkdownUtils {
|
||||
.setOnLinkLongClickListener(onLinkLongClickListener)))
|
||||
.usePlugin(LinkifyPlugin.create(Linkify.WEB_URLS))
|
||||
.usePlugin(TableEntryPlugin.create(context))
|
||||
.usePlugin(ClickableGlideImagesPlugin.create(context))
|
||||
.build();
|
||||
}
|
||||
|
||||
@@ -60,7 +61,6 @@ public class MarkdownUtils {
|
||||
return Markwon.builder(context)
|
||||
.usePlugin(MarkwonInlineParserPlugin.create(plugin -> {
|
||||
plugin.excludeInlineProcessor(HtmlInlineProcessor.class);
|
||||
plugin.excludeInlineProcessor(BangInlineProcessor.class);
|
||||
}))
|
||||
.usePlugin(miscPlugin)
|
||||
.usePlugin(SuperscriptPlugin.create())
|
||||
@@ -70,6 +70,7 @@ public class MarkdownUtils {
|
||||
.setOnLinkLongClickListener(onLinkLongClickListener)))
|
||||
.usePlugin(LinkifyPlugin.create(Linkify.WEB_URLS))
|
||||
.usePlugin(TableEntryPlugin.create(context))
|
||||
.usePlugin(GlideImagesPlugin.create(context))
|
||||
.build();
|
||||
}
|
||||
|
||||
@@ -104,6 +105,15 @@ public class MarkdownUtils {
|
||||
.build();
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public static MarkwonAdapter createTablesAndImagesAdapter(@NonNull Context context) {
|
||||
return 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();
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a CustomMarkwonAdapter configured with support for tables.
|
||||
*/
|
||||
@@ -119,35 +129,4 @@ public class MarkdownUtils {
|
||||
private static final Pattern emptyPattern = Pattern.compile("!\\[\\]\\((.*?)\\)");
|
||||
private static final Pattern nonEmptyPattern = Pattern.compile("!\\[(.*?)\\]\\((.*?)\\)");
|
||||
|
||||
public static String processImageCaptions(String markdown, String replacementCaption) {
|
||||
// Pattern for Markdown images with empty captions
|
||||
|
||||
// Pattern for Markdown images with non-empty captions
|
||||
|
||||
|
||||
Matcher emptyMatcher = emptyPattern.matcher(markdown);
|
||||
StringBuffer sb = new StringBuffer();
|
||||
|
||||
while (emptyMatcher.find()) {
|
||||
// Replace the matched pattern with the same URL, but with a caption
|
||||
emptyMatcher.appendReplacement(sb, "[" + replacementCaption + "](" + emptyMatcher.group(1) + ")");
|
||||
}
|
||||
|
||||
// Append the rest of the content
|
||||
emptyMatcher.appendTail(sb);
|
||||
|
||||
// Now process non-empty captions
|
||||
Matcher nonEmptyMatcher = nonEmptyPattern.matcher(sb.toString());
|
||||
StringBuffer finalSb = new StringBuffer();
|
||||
|
||||
while (nonEmptyMatcher.find()) {
|
||||
// Replace the matched pattern with the same URL and caption, but without the "!"
|
||||
nonEmptyMatcher.appendReplacement(finalSb, "[" + nonEmptyMatcher.group(1) + "](" + nonEmptyMatcher.group(2) + ")");
|
||||
}
|
||||
|
||||
// Append the rest of the content
|
||||
nonEmptyMatcher.appendTail(finalSb);
|
||||
|
||||
return finalSb.toString();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -211,10 +211,14 @@ public class ParsePost {
|
||||
String distinguished, String suggestedSort) throws JSONException {
|
||||
Post post;
|
||||
|
||||
boolean isVideo = false;
|
||||
|
||||
String url = (!data.getJSONObject("post").isNull("url")) ? data.getJSONObject("post").getString("url") : "";
|
||||
String communityURL = (!data.getJSONObject("community").isNull("icon")) ? data.getJSONObject("community").getString("icon") : "";
|
||||
String authorAvatar = (!data.getJSONObject("creator").isNull("avatar")) ? data.getJSONObject("creator").getString("avatar") : null;
|
||||
|
||||
Uri uri = Uri.parse(url);
|
||||
String path = uri.getPath();
|
||||
boolean isVideo = path.endsWith(".mp4") || path.endsWith(".webm") || path.endsWith(".gifv");
|
||||
|
||||
if (!data.getJSONObject("post").has("thumbnail_url") && previews.isEmpty()) {
|
||||
if (!data.getJSONObject("post").isNull("body") && url.equals("")) {
|
||||
@@ -244,16 +248,13 @@ public class ParsePost {
|
||||
} else {
|
||||
if (isVideo) {
|
||||
//No preview video post
|
||||
JSONObject redditVideoObject = data.getJSONObject(JSONUtils.MEDIA_KEY).getJSONObject(JSONUtils.REDDIT_VIDEO_KEY);
|
||||
int postType = Post.VIDEO_TYPE;
|
||||
String videoUrl = Html.fromHtml(redditVideoObject.getString(JSONUtils.HLS_URL_KEY)).toString();
|
||||
String videoDownloadUrl = redditVideoObject.getString(JSONUtils.FALLBACK_URL_KEY);
|
||||
|
||||
post = new Post(id, fullName, subredditName, subredditNamePrefixed, author, authorFull, postTimeMillis, title, permalink, score, postType, voteType,
|
||||
nComments, upvoteRatio, nsfw, locked, saved, distinguished, suggestedSort);
|
||||
|
||||
post.setVideoUrl(videoUrl);
|
||||
post.setVideoDownloadUrl(videoDownloadUrl);
|
||||
post.setVideoUrl(url);
|
||||
post.setVideoDownloadUrl(url);
|
||||
} else if (!url.equals("")) {
|
||||
//No preview link post
|
||||
int postType = Post.NO_PREVIEW_LINK_TYPE;
|
||||
@@ -654,14 +655,15 @@ public class ParsePost {
|
||||
post.setVoteType(data.getInt("my_vote"));
|
||||
post.setScore(post.getScore() - 1);
|
||||
}
|
||||
|
||||
|
||||
if (!data.getJSONObject("post").isNull("body")) {
|
||||
String body = MarkdownUtils.processImageCaptions(data.getJSONObject("post").getString("body"), "Image");
|
||||
String body = data.getJSONObject("post").getString("body");
|
||||
post.setSelfText(body);
|
||||
post.setSelfTextPlain(body);
|
||||
post.setSelfTextPlainTrimmed(body.trim());
|
||||
}
|
||||
|
||||
post.setAuthorIconUrl(authorAvatar);
|
||||
post.setSubredditIconUrl(communityURL);
|
||||
return post;
|
||||
}
|
||||
|
||||
|
||||
@@ -251,7 +251,7 @@ public class PostPagingSource extends ListenableFuturePagingSource<Integer, Post
|
||||
private ListenableFuture<LoadResult<Integer, Post>> loadSubredditPosts(@NonNull LoadParams<Integer> loadParams, LemmyAPI api) {
|
||||
ListenableFuture<Response<String>> subredditPost;
|
||||
|
||||
subredditPost = api.getPosts(null,sortType.getType().value,loadParams.getKey(),25,null,subredditOrUserName,false,null);
|
||||
subredditPost = api.getPosts(null,sortType.getType().value,loadParams.getKey(),25,null,subredditOrUserName,false,accessToken);
|
||||
|
||||
|
||||
ListenableFuture<LoadResult<Integer, Post>> pageFuture = Futures.transform(subredditPost, this::transformData, executor);
|
||||
|
||||
@@ -105,7 +105,7 @@ public class CrashReportsFragment extends Fragment {
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
return false;
|
||||
}
|
||||
Uri githubIssueUri = Uri.parse(String.format("https://github.com/Docile-Alligator/Infinity-For-Reddit/issues/new?labels=possible-bug&device=%s&version=%s&android_version=%s&logs=%s&&template=BUG_REPORT.yml", model, appVersion, androidVersion, logs));
|
||||
Uri githubIssueUri = Uri.parse(String.format("https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy/issues/new?template=.gitea%2fissue_template%2fbug_report.md", model, appVersion, androidVersion, logs));
|
||||
intent.setData(githubIssueUri);
|
||||
startActivity(intent);
|
||||
return true;
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
package eu.toldi.infinityforlemmy.site;
|
||||
|
||||
import eu.toldi.infinityforlemmy.apis.LemmyAPI;
|
||||
import retrofit2.Retrofit;
|
||||
|
||||
public class FetchSiteInfo {
|
||||
|
||||
public static void fetchSiteInfo(Retrofit retrofit, String accesToken, FetchSiteInfoListener fetchSiteInfoListener) {
|
||||
retrofit.create(LemmyAPI.class).getSiteInfo(accesToken).enqueue(
|
||||
new retrofit2.Callback<String>() {
|
||||
@Override
|
||||
public void onResponse(retrofit2.Call<String> call, retrofit2.Response<String> response) {
|
||||
if (response.isSuccessful()) {
|
||||
String siteInfoJson = response.body();
|
||||
SiteInfo siteInfo = SiteInfo.parseSiteInfo(siteInfoJson);
|
||||
fetchSiteInfoListener.onFetchSiteInfoSuccess(siteInfo);
|
||||
} else {
|
||||
fetchSiteInfoListener.onFetchSiteInfoFailed();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(retrofit2.Call<String> call, Throwable t) {
|
||||
fetchSiteInfoListener.onFetchSiteInfoFailed();
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
public interface FetchSiteInfoListener {
|
||||
void onFetchSiteInfoSuccess(SiteInfo siteInfo);
|
||||
void onFetchSiteInfoFailed();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
package eu.toldi.infinityforlemmy.site;
|
||||
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
public class SiteInfo {
|
||||
|
||||
private int id;
|
||||
private String name;
|
||||
private String sidebar;
|
||||
private String description;
|
||||
private boolean enable_downvotes;
|
||||
private boolean enable_nsfw;
|
||||
private boolean community_creation_admin_only;
|
||||
|
||||
public SiteInfo(int id, String name, String sidebar, String description, boolean enable_downvotes, boolean enable_nsfw, boolean community_creation_admin_only) {
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
this.sidebar = sidebar;
|
||||
this.description = description;
|
||||
this.enable_downvotes = enable_downvotes;
|
||||
this.enable_nsfw = enable_nsfw;
|
||||
this.community_creation_admin_only = community_creation_admin_only;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public String getSidebar() {
|
||||
return sidebar;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public boolean isEnable_downvotes() {
|
||||
return enable_downvotes;
|
||||
}
|
||||
|
||||
public boolean isEnable_nsfw() {
|
||||
return enable_nsfw;
|
||||
}
|
||||
|
||||
public boolean isCommunity_creation_admin_only() {
|
||||
return community_creation_admin_only;
|
||||
}
|
||||
|
||||
public static SiteInfo parseSiteInfo(String siteInfoJson) {
|
||||
try {
|
||||
JSONObject siteInfo = new JSONObject(siteInfoJson);
|
||||
JSONObject siteView = siteInfo.getJSONObject("site_view");
|
||||
JSONObject site = siteView.getJSONObject("site");
|
||||
JSONObject localSite = siteView.getJSONObject("local_site");
|
||||
|
||||
int id = site.getInt("id");
|
||||
String name = site.getString("name");
|
||||
String sidebar = null;
|
||||
if (site.has("sidebar"))
|
||||
sidebar = site.getString("sidebar");
|
||||
|
||||
String description = null;
|
||||
if (site.has("description"))
|
||||
description = site.getString("description");
|
||||
|
||||
boolean enable_downvotes = localSite.getBoolean("enable_downvotes");
|
||||
boolean enable_nsfw = localSite.getBoolean("enable_nsfw");
|
||||
boolean community_creation_admin_only = localSite.getBoolean("community_creation_admin_only");
|
||||
|
||||
SiteInfo si = new SiteInfo(id, name, sidebar, description, enable_downvotes, enable_nsfw, community_creation_admin_only);
|
||||
|
||||
return si;
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -182,13 +182,13 @@ public class ParseSubredditData {
|
||||
|
||||
public static String formatISOTime(String isoTime) {
|
||||
// Truncate the time to millisecond precision
|
||||
String truncatedTime = isoTime.substring(0, 23);
|
||||
//String truncatedTime = isoTime.substring(0, 23);
|
||||
|
||||
SimpleDateFormat isoFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS", Locale.US);
|
||||
isoFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
|
||||
|
||||
try {
|
||||
Date date = isoFormat.parse(truncatedTime);
|
||||
Date date = isoFormat.parse(isoTime);
|
||||
|
||||
// Set your desired output format here
|
||||
SimpleDateFormat outputFormat = new SimpleDateFormat("MMM dd, yyyy HH:mm:ss", Locale.US);
|
||||
|
||||
@@ -22,4 +22,7 @@ public interface SubredditDao {
|
||||
|
||||
@Query("SELECT * from subreddits WHERE name = :namePrefixed COLLATE NOCASE LIMIT 1")
|
||||
SubredditData getSubredditData(String namePrefixed);
|
||||
|
||||
@Query("SELECT * from subreddits WHERE actor_id = :actorId COLLATE NOCASE LIMIT 1")
|
||||
SubredditData getSubredditDataByActorId(String actorId);
|
||||
}
|
||||
|
||||
@@ -46,6 +46,7 @@ public class ParseUserData {
|
||||
int instance_id = personJson.getInt("instance_id");
|
||||
|
||||
String cakeday = personJson.getString(JSONUtils.PUBLISHED);
|
||||
cakeday = cakeday.substring(0, cakeday.indexOf("T"));
|
||||
boolean isBot = personJson.getBoolean("bot_account");
|
||||
boolean isBanned = personJson.getBoolean("banned");
|
||||
boolean isLocal = personJson.getBoolean("local");
|
||||
|
||||
@@ -25,4 +25,7 @@ public interface UserDao {
|
||||
|
||||
@Query("SELECT * FROM users WHERE name = :userName COLLATE NOCASE LIMIT 1")
|
||||
UserData getUserData(String userName);
|
||||
|
||||
@Query("SELECT * FROM users WHERE actor_id = :actorId COLLATE NOCASE LIMIT 1")
|
||||
UserData getUserDataByActorId(String actorId);
|
||||
}
|
||||
|
||||
@@ -400,4 +400,5 @@ public class SharedPreferencesUtils {
|
||||
public static final String OPEN_LINK_IN_APP_LEGACY = "open_link_in_app";
|
||||
public static final String ACCOUNT_INSTANCE = "account_instance";
|
||||
public static final String ACCOUNT_QUALIFIED_NAME = "account_qualified_name";
|
||||
public static final String CAN_DOWNVOTE = "can_downvote";
|
||||
}
|
||||
|
||||
@@ -382,8 +382,8 @@ public final class Utils {
|
||||
int start = Math.max(editText.getSelectionStart(), 0);
|
||||
int end = Math.max(editText.getSelectionEnd(), 0);
|
||||
editText.getText().replace(Math.min(start, end), Math.max(start, end),
|
||||
"[" + fileName + "](" + imageUrlOrError + ")",
|
||||
0, "[]()".length() + fileName.length() + imageUrlOrError.length());
|
||||
"",
|
||||
0, "![]()".length() + fileName.length() + imageUrlOrError.length());
|
||||
Snackbar.make(coordinatorLayout, R.string.upload_image_success, Snackbar.LENGTH_LONG).show();
|
||||
} else {
|
||||
Toast.makeText(context, R.string.upload_image_failed, Toast.LENGTH_LONG).show();
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 17 KiB |
@@ -124,25 +124,6 @@
|
||||
android:fontFamily="?attr/font_family"
|
||||
app:drawableStartCompat="@drawable/ic_copy_24dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/give_award_text_view_comment_more_bottom_sheet_fragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:clickable="true"
|
||||
android:drawablePadding="48dp"
|
||||
android:focusable="true"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingStart="32dp"
|
||||
android:paddingTop="16dp"
|
||||
android:paddingEnd="32dp"
|
||||
android:paddingBottom="16dp"
|
||||
android:text="@string/action_give_award"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="?attr/font_default"
|
||||
android:fontFamily="?attr/font_family"
|
||||
android:visibility="gone"
|
||||
app:drawableStartCompat="@drawable/ic_give_award_24dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/report_view_comment_more_bottom_sheet_fragment"
|
||||
@@ -163,25 +144,6 @@
|
||||
android:fontFamily="?attr/font_family"
|
||||
app:drawableStartCompat="@drawable/ic_report_24dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/see_removed_view_comment_more_bottom_sheet_fragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:clickable="true"
|
||||
android:drawablePadding="48dp"
|
||||
android:focusable="true"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingStart="32dp"
|
||||
android:paddingTop="16dp"
|
||||
android:paddingEnd="32dp"
|
||||
android:paddingBottom="16dp"
|
||||
android:text="@string/see_removed_comment"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="?attr/font_default"
|
||||
android:fontFamily="?attr/font_family"
|
||||
android:visibility="gone"
|
||||
app:drawableStartCompat="@drawable/ic_preview_24dp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
@@ -76,16 +76,16 @@
|
||||
android:visible="false" />
|
||||
|
||||
<item
|
||||
android:id="@+id/action_edit_flair_view_post_detail_fragment"
|
||||
android:id="@+id/action_block_user_view_post_detail_fragment"
|
||||
android:orderInCategory="12"
|
||||
android:title="@string/action_edit_flair"
|
||||
android:title="@string/block_user"
|
||||
app:showAsAction="never"
|
||||
android:visible="false" />
|
||||
android:visible="true" />
|
||||
|
||||
<item
|
||||
android:id="@+id/action_give_award_view_post_detail_fragment"
|
||||
android:id="@+id/action_block_community_view_post_detail_fragment"
|
||||
android:orderInCategory="13"
|
||||
android:title="@string/action_give_award"
|
||||
android:title="@string/block_community"
|
||||
app:showAsAction="never" />
|
||||
|
||||
<item
|
||||
|
||||
@@ -15,13 +15,13 @@
|
||||
<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="create_multi_reddit_activity_label">"Criar Multicomunidade"</string>
|
||||
<string name="community_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="edit_multi_reddit_activity_label">"Editar Multicomunidade"</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>
|
||||
@@ -53,8 +53,8 @@
|
||||
<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_edit_multi_reddit">"Editar MultiComunidade"</string>
|
||||
<string name="action_delete_multi_reddit">"Eliminar MultiComunidade"</string>
|
||||
<string name="action_share">"Partilhar"</string>
|
||||
<string name="action_preview">"Pré-visualizar"</string>
|
||||
<string name="action_report">"Denunciar"</string>
|
||||
@@ -81,7 +81,7 @@ Toque para tentar novamente."</string>
|
||||
<string name="no_comments">"Sem comentários encontrados"</string>
|
||||
<string name="no_communities">"Nenhuma comunidade encontrada"</string>
|
||||
<string name="no_users">"Nenhum utilizador encontrado"</string>
|
||||
<string name="no_multi_reddits">"Nenhum Multireddit encontrado"</string>
|
||||
<string name="no_multi_reddits">"Nenhuma Multicomunidade encontrada"</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>
|
||||
@@ -102,7 +102,7 @@ Toque para tentar novamente."</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="multi_reddit">"Multi-comunidade"</string>
|
||||
<string name="inbox">"Caixa de Entrada"</string>
|
||||
<string name="upvoted">"Voto Positivo"</string>
|
||||
<string name="downvoted">"Voto Negativo"</string>
|
||||
@@ -115,7 +115,7 @@ Toque para tentar novamente."</string>
|
||||
<string name="cannot_fetch_community_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="cannot_fetch_multireddit">"Não é possível obter informações da multicomunidade"</string>
|
||||
<string name="subscribe">"Subscrever"</string>
|
||||
<string name="unsubscribe">"Cancelar subscrição"</string>
|
||||
<string name="subscribed">"Subscrito"</string>
|
||||
@@ -385,13 +385,13 @@ Toque para tentar novamente."</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_title">"Conta do Lemmy"</string>
|
||||
<string name="settings_reddit_account_summary">"u/Hostilenemy"</string>
|
||||
<string name="settings_community_title">"Comunidade"</string>
|
||||
<string name="settings_community_summary">!infinityforlemmy@lemdro.id</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_title">"Infinity For Lemmy"</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>
|
||||
@@ -414,7 +414,7 @@ Toque para tentar novamente."</string>
|
||||
<string name="settings_tab_community_name">"Nome da Comunidade (sem prefixo r/)"</string>
|
||||
|
||||
<!-- Fuzzy -->
|
||||
<string name="settings_tab_multi_reddit_name">"Nome MultiReddit (/utilizador/oseunomedeutilizador/m/oseunomemultireddit)"</string>
|
||||
<string name="settings_tab_multi_reddit_name">"Nome MultiComunidade (/utilizador/oseunomedeutilizador/m/oseunomemulticomunidade)"</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>
|
||||
@@ -452,10 +452,10 @@ Toque para tentar novamente."</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_getting_multi_reddit_data">"Erro ao obter dados da multicomunidade"</string>
|
||||
<string name="error_loading_multi_reddit_list">"Não foi possível sincronizar multicomunidades"</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!
|
||||
<string name="share_this_app">"Check out Infinity for Lemmy, an awesome Lemmy client!
|
||||
https://play.google.com/store/apps/details?id=eu.toldi.infinityforlemmy"</string>
|
||||
<string name="error_getting_community_name">"Erro ao obter o nome da comunidade"</string>
|
||||
<string name="share_post_link">"Partilhar Endereço da Publicação"</string>
|
||||
@@ -483,9 +483,9 @@ https://play.google.com/store/apps/details?id=eu.toldi.infinityforlemmy"</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="create_multi_reddit_failed">"Não é possível criar esta multicomunidade"</string>
|
||||
<string name="duplicate_multi_reddit">"Esta multicomunidade já existe"</string>
|
||||
<string name="edit_multi_reddit_failed">"Não é possível editar esta multicomunidade"</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>
|
||||
@@ -688,7 +688,7 @@ com base no Tema Indigo Amoled"</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="community_preview">"r/Infinity_For_Reddit"</string>
|
||||
<string name="community_preview">"c/infinityforlemmy"</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>
|
||||
@@ -699,8 +699,8 @@ com base no Tema Indigo Amoled"</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="edit_multi_reddit">"Editar Multicomunidade"</string>
|
||||
<string name="delete_multi_reddit">"Eliminar Multicomunidade"</string>
|
||||
<string name="n_awards">"%1$d Prémios"</string>
|
||||
<string name="one_award">"1 Prémio"</string>
|
||||
<string name="report">"Denunciar"</string>
|
||||
@@ -713,7 +713,7 @@ Ela não está doente nem nada, mas certamente poderá melhorar."</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="local">"Popular"</string>
|
||||
<string name="local">"Local"</string>
|
||||
<string name="notifications">"Notificações"</string>
|
||||
<string name="messages">"Mensagens"</string>
|
||||
<string name="message">"Mensagem"</string>
|
||||
@@ -787,7 +787,7 @@ Os separadores poderão perder todo o conteúdo após alternar entre outros. É
|
||||
<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.
|
||||
Vídeos do Lemmy 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>
|
||||
@@ -855,10 +855,10 @@ Mensagem: %2$s"</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="multireddit_selection_activity_label">"Escolher uma Multicomunidade"</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="action_add_to_multireddit">"Adicionar à Multicomunidade"</string>
|
||||
<string name="search_only_communities_hint">"Pesquisar comunidades"</string>
|
||||
<string name="search_only_users_hint">"Pesquisar utilizadores"</string>
|
||||
<string name="post_type_gif">"Gif"</string>
|
||||
@@ -895,7 +895,7 @@ Mensagem: %2$s"</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_communities_hint">"Excluir comunidades (ex.: funny,AskReddit)"</string>
|
||||
<string name="exclude_communities_hint">"Excluir comunidades (ex.: funny,Asklemmy)"</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>
|
||||
@@ -915,17 +915,17 @@ Mensagem: %2$s"</string>
|
||||
<string name="post_filter_usage_community_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_multireddit">"MultiComunidade: %1$s"</string>
|
||||
<string name="post_filter_usage_multireddit_all">"MultiComunidade"</string>
|
||||
<string name="post_filter_usage_search">"Pesquisar"</string>
|
||||
<string name="community">"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="edit_post_filter_name_of_usage_info">"Deixar em branco para aplicar este filtro de publicação a todos os utilizadores / comunidades / multilemmy"</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 Lemmy."</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_community_or_user_to_multireddit_success">"%1$s foi adicionado ao multireddit %2$s"</string>
|
||||
<string name="add_community_or_user_to_multireddit_failed">"Não é possível adicionar %1$s ao multireddit %2$s"</string>
|
||||
<string name="add_community_or_user_to_multireddit_success">"%1$s foi adicionado à multicomunidade %2$s"</string>
|
||||
<string name="add_community_or_user_to_multireddit_failed">"Não é possível adicionar %1$s à multicomunidade %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>
|
||||
@@ -1013,8 +1013,8 @@ Mensagem: %2$s"</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="copy_multi_reddit_path">"Copiar Caminho da Multicomunidade"</string>
|
||||
<string name="copy_multi_reddit_path_failed">"Não é possível copiar o caminho da multicomunidade"</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.
|
||||
|
||||
@@ -1027,7 +1027,7 @@ Ainda deseja ativar esta opção?"</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="label_reddit">"Lemmy"</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
|
||||
@@ -1039,9 +1039,9 @@ Caso contrário, altere o nome antes de 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_more_tabs_show_favorite_multireddits_title">"Mostrar MultiComunidade Favorita"</string>
|
||||
<string name="settings_more_tabs_show_multireddits_title">"Mostrar MultiComunidade"</string>
|
||||
<string name="settings_collapse_reddit_section_title">"Recolher Secção do Lemmy"</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>
|
||||
@@ -1064,7 +1064,7 @@ Toque para tentar novamente."</string>
|
||||
<string name="settings_post_details_title">"Detalhes do Post"</string>
|
||||
<string name="settings_secure_mode_title">"Modo Seguro"</string>
|
||||
<string name="error_loading_wiki">"Erro a carregar a Wiki"</string>
|
||||
<string name="no_wiki">"Este subreddit não tem wiki"</string>
|
||||
<string name="no_wiki">"Esta comunidade não tem wiki"</string>
|
||||
<string name="material_you_notification_title">"Aplicando Material You"</string>
|
||||
<string name="action_go_to_wiki">"Ir para a Wiki"</string>
|
||||
<string name="about">"Sobre"</string>
|
||||
@@ -1074,7 +1074,7 @@ Toque para tentar novamente."</string>
|
||||
<string name="go_to_top">"Ir para Cima"</string>
|
||||
<string name="title_contains_regex_hint">"Título: contém regex"</string>
|
||||
<string name="contain_domains_hint">"Contém domínios"</string>
|
||||
<string name="anonymous_multireddit_no_community">"Este multireddit não tem nenhum subreddit!"</string>
|
||||
<string name="anonymous_multireddit_no_community">"Esta multicomunidade não tem nenhuma comunidade!"</string>
|
||||
<string name="contain_domain">"Contém este domínio"</string>
|
||||
<string name="app_lock_timeout_immediately">"Imediatamente"</string>
|
||||
<string name="app_lock_timeout_1_min">"1 minuto"</string>
|
||||
@@ -1092,4 +1092,4 @@ Toque para tentar novamente."</string>
|
||||
<string name="app_lock_timeout_6_hours">"6 horas"</string>
|
||||
<string name="app_lock_timeout_12_hours">"12 horas"</string>
|
||||
<string name="app_lock_timeout_24_hours">"24 horas"</string>
|
||||
</resources>
|
||||
</resources>
|
||||
|
||||
@@ -1347,4 +1347,6 @@
|
||||
<string name="mentions">Mentions</string>
|
||||
<string name="replies">Replies</string>
|
||||
<string name="use_circular_fab">Use Circular FAB</string>
|
||||
<string name="block_community">Block Community\n</string>
|
||||
<string name="not_implemented">Feature not implemented yet :(</string>
|
||||
</resources>
|
||||
|
||||
@@ -46,11 +46,6 @@
|
||||
app:key="show_author_avatar"
|
||||
android:title="@string/settings_show_author_avatar_title" />
|
||||
|
||||
<eu.toldi.infinityforlemmy.customviews.CustomFontSwitchPreference
|
||||
app:defaultValue="false"
|
||||
app:key="hide_comment_awards"
|
||||
android:title="@string/settings_hide_comment_awards_title" />
|
||||
|
||||
<eu.toldi.infinityforlemmy.customviews.CustomFontSwitchPreference
|
||||
app:defaultValue="false"
|
||||
app:key="always_show_child_comment_count"
|
||||
|
||||
@@ -27,15 +27,6 @@
|
||||
app:key="hide_post_type"
|
||||
app:title="@string/settings_hide_post_type" />
|
||||
|
||||
<eu.toldi.infinityforlemmy.customviews.CustomFontSwitchPreference
|
||||
app:defaultValue="false"
|
||||
app:key="hide_post_flair"
|
||||
app:title="@string/settings_hide_post_flair" />
|
||||
|
||||
<eu.toldi.infinityforlemmy.customviews.CustomFontSwitchPreference
|
||||
app:defaultValue="false"
|
||||
app:key="hide_the_number_of_awards"
|
||||
app:title="@string/settings_hide_the_number_of_awards" />
|
||||
|
||||
<eu.toldi.infinityforlemmy.customviews.CustomFontSwitchPreference
|
||||
app:defaultValue="false"
|
||||
|
||||
@@ -1 +1 @@
|
||||
A Lemmy client for Android written in Java. It's a fork of the Infinity for Reddit project, currenty in early development.
|
||||
An Lemmy client for Android, forked from the Infinity for Reddit project.
|
||||
Reference in New Issue
Block a user