Merge branch 'master' into master

This commit is contained in:
TacoTheDank 2020-05-19 16:39:37 -04:00 committed by GitHub
commit 6126df39a5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
32 changed files with 3571 additions and 1248 deletions

View File

@ -6,8 +6,9 @@ android {
applicationId "ml.docilealligator.infinityforreddit"
minSdkVersion 21
targetSdkVersion 29
versionCode 33
versionName "3.0.3"
versionCode 34
versionName "3.1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {

View File

@ -30,14 +30,14 @@ public class LinkResolverActivity extends AppCompatActivity {
public static final String EXTRA_MESSAGE_FULLNAME = "ENF";
public static final String EXTRA_NEW_ACCOUNT_NAME = "ENAN";
private static final String POST_PATTERN = "/r/\\w+/comments/\\w+/{0,1}\\w+/{0,1}";
private static final String COMMENT_PATTERN = "/r/\\w+/comments/\\w+/{0,1}\\w+/\\w+/{0,1}";
private static final String SUBREDDIT_PATTERN = "/[rR]/\\w+/{0,1}";
private static final String USER_PATTERN_1 = "/user/\\w+/{0,1}";
private static final String USER_PATTERN_2 = "/[uU]/\\w+/{0,1}";
private static final String POST_PATTERN = "/r/\\w+/comments/\\w+/?\\w+/?";
private static final String COMMENT_PATTERN = "/(r|u|U|user)/\\w+/comments/\\w+/?\\w+/\\w+/?";
private static final String SUBREDDIT_PATTERN = "/[rR]/\\w+/?";
private static final String USER_PATTERN = "/(u|U|user)/\\w+/?";
private static final String SIDEBAR_PATTERN = "/[rR]/\\w+/about/sidebar";
private static final String MULTIREDDIT_PATTERN = "/user/\\w+/m/\\w+/{0,1}";
private static final String REDD_IT_POST_PATTERN = "/\\w+/{0,1}";
private static final String MULTIREDDIT_PATTERN = "/user/\\w+/m/\\w+/?";
private static final String MULTIREDDIT_PATTERN_2 = "/[rR]/(\\w+\\+?)+/?";
private static final String REDD_IT_POST_PATTERN = "/\\w+/?";
@Inject
@Named("default")
@ -56,6 +56,10 @@ public class LinkResolverActivity extends AppCompatActivity {
((Infinity) getApplication()).getAppComponent().inject(this);
Uri uri = getIntent().getData();
handleUri(uri);
}
private void handleUri(Uri uri) {
if (uri == null) {
Toast.makeText(this, R.string.no_link_available, Toast.LENGTH_SHORT).show();
finish();
@ -72,9 +76,16 @@ public class LinkResolverActivity extends AppCompatActivity {
String newAccountName = getIntent().getStringExtra(EXTRA_NEW_ACCOUNT_NAME);
String authority = uri.getAuthority();
List<String> segments = uri.getPathSegments();
if (authority != null && (authority.contains("reddit.com") || authority.contains("redd.it") || authority.contains("reddit.app"))) {
if (path.matches(POST_PATTERN)) {
List<String> segments = uri.getPathSegments();
if (authority.equals("reddit.app.link") && path.isEmpty()) {
String redirect = uri.getQueryParameter("$og_redirect");
handleUri(Uri.parse(redirect));
} else if (path.isEmpty()) {
Intent intent = new Intent(this, MainActivity.class);
startActivity(intent);
} else if (path.matches(POST_PATTERN)) {
int commentsIndex = segments.lastIndexOf("comments");
if (commentsIndex >= 0 && commentsIndex < segments.size() - 1) {
Intent intent = new Intent(this, ViewPostDetailActivity.class);
@ -86,7 +97,6 @@ public class LinkResolverActivity extends AppCompatActivity {
deepLinkError(uri);
}
} else if (path.matches(COMMENT_PATTERN)) {
List<String> segments = uri.getPathSegments();
int commentsIndex = segments.lastIndexOf("comments");
if (commentsIndex >= 0 && commentsIndex < segments.size() - 1) {
Intent intent = new Intent(this, ViewPostDetailActivity.class);
@ -113,15 +123,9 @@ public class LinkResolverActivity extends AppCompatActivity {
intent.putExtra(ViewSubredditDetailActivity.EXTRA_NEW_ACCOUNT_NAME, newAccountName);
startActivity(intent);
}
} else if (path.matches(USER_PATTERN_1)) {
} else if (path.matches(USER_PATTERN)) {
Intent intent = new Intent(this, ViewUserDetailActivity.class);
intent.putExtra(ViewUserDetailActivity.EXTRA_USER_NAME_KEY, path.substring(6));
intent.putExtra(ViewUserDetailActivity.EXTRA_MESSAGE_FULLNAME, messageFullname);
intent.putExtra(ViewUserDetailActivity.EXTRA_NEW_ACCOUNT_NAME, newAccountName);
startActivity(intent);
} else if (path.matches(USER_PATTERN_2)) {
Intent intent = new Intent(this, ViewUserDetailActivity.class);
intent.putExtra(ViewUserDetailActivity.EXTRA_USER_NAME_KEY, path.substring(3));
intent.putExtra(ViewUserDetailActivity.EXTRA_USER_NAME_KEY, segments.get(1));
intent.putExtra(ViewUserDetailActivity.EXTRA_MESSAGE_FULLNAME, messageFullname);
intent.putExtra(ViewUserDetailActivity.EXTRA_NEW_ACCOUNT_NAME, newAccountName);
startActivity(intent);
@ -133,6 +137,13 @@ public class LinkResolverActivity extends AppCompatActivity {
Intent intent = new Intent(this, ViewMultiRedditDetailActivity.class);
intent.putExtra(ViewMultiRedditDetailActivity.EXTRA_MULTIREDDIT_PATH, path);
startActivity(intent);
} else if (path.matches(MULTIREDDIT_PATTERN_2)) {
String subredditName = path.substring(3);
Intent intent = new Intent(this, ViewSubredditDetailActivity.class);
intent.putExtra(ViewSubredditDetailActivity.EXTRA_SUBREDDIT_NAME_KEY, subredditName);
intent.putExtra(ViewSubredditDetailActivity.EXTRA_MESSAGE_FULLNAME, messageFullname);
intent.putExtra(ViewSubredditDetailActivity.EXTRA_NEW_ACCOUNT_NAME, newAccountName);
startActivity(intent);
} else if (authority.equals("redd.it") && path.matches(REDD_IT_POST_PATTERN)) {
Intent intent = new Intent(this, ViewPostDetailActivity.class);
intent.putExtra(ViewPostDetailActivity.EXTRA_POST_ID, path.substring(1));

View File

@ -922,9 +922,9 @@ public class MainActivity extends BaseActivity implements SortTypeSelectionCallb
}
private class SectionsPagerAdapter extends FragmentPagerAdapter {
private PostFragment frontPagePostFragment;
private PostFragment popularPostFragment;
private PostFragment allPostFragment;
private PostFragment tab1;
private PostFragment tab2;
private PostFragment tab3;
SectionsPagerAdapter(FragmentManager fm) {
super(fm, BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT);
@ -956,6 +956,22 @@ public class MainActivity extends BaseActivity implements SortTypeSelectionCallb
}
if (position == 0) {
String postType = mSharedPreferences.getString(SharedPreferencesUtils.MAIN_PAGE_TAB_1_POST_TYPE, SharedPreferencesUtils.MAIN_PAGE_TAB_POST_TYPE_HOME);
String name = mSharedPreferences.getString(SharedPreferencesUtils.MAIN_PAGE_TAB_1_NAME, "");
return generatePostFragment(postType, name);
} else if (position == 1) {
String postType = mSharedPreferences.getString(SharedPreferencesUtils.MAIN_PAGE_TAB_2_POST_TYPE, SharedPreferencesUtils.MAIN_PAGE_TAB_POST_TYPE_POPULAR);
String name = mSharedPreferences.getString(SharedPreferencesUtils.MAIN_PAGE_TAB_2_NAME, "");
return generatePostFragment(postType, name);
} else {
String postType = mSharedPreferences.getString(SharedPreferencesUtils.MAIN_PAGE_TAB_3_POST_TYPE, SharedPreferencesUtils.MAIN_PAGE_TAB_POST_TYPE_ALL);
String name = mSharedPreferences.getString(SharedPreferencesUtils.MAIN_PAGE_TAB_3_NAME, "");
return generatePostFragment(postType, name);
}
}
private Fragment generatePostFragment(String postType, String name) {
if (postType.equals(SharedPreferencesUtils.MAIN_PAGE_TAB_POST_TYPE_HOME)) {
PostFragment fragment = new PostFragment();
Bundle bundle = new Bundle();
bundle.putInt(PostFragment.EXTRA_POST_TYPE, PostDataSource.TYPE_FRONT_PAGE);
@ -963,11 +979,39 @@ public class MainActivity extends BaseActivity implements SortTypeSelectionCallb
bundle.putString(PostFragment.EXTRA_ACCESS_TOKEN, mAccessToken);
fragment.setArguments(bundle);
return fragment;
} else if (position == 1) {
} else if (postType.equals(SharedPreferencesUtils.MAIN_PAGE_TAB_POST_TYPE_ALL)) {
PostFragment fragment = new PostFragment();
Bundle bundle = new Bundle();
bundle.putInt(PostFragment.EXTRA_POST_TYPE, PostDataSource.TYPE_SUBREDDIT);
bundle.putString(PostFragment.EXTRA_NAME, "popular");
bundle.putString(PostFragment.EXTRA_NAME, "all");
bundle.putInt(PostFragment.EXTRA_FILTER, PostFragment.EXTRA_NO_FILTER);
bundle.putString(PostFragment.EXTRA_ACCESS_TOKEN, mAccessToken);
fragment.setArguments(bundle);
return fragment;
} else if (postType.equals(SharedPreferencesUtils.MAIN_PAGE_TAB_POST_TYPE_SUBREDDIT)) {
PostFragment fragment = new PostFragment();
Bundle bundle = new Bundle();
bundle.putInt(PostFragment.EXTRA_POST_TYPE, PostDataSource.TYPE_SUBREDDIT);
bundle.putString(PostFragment.EXTRA_NAME, name);
bundle.putInt(PostFragment.EXTRA_FILTER, PostFragment.EXTRA_NO_FILTER);
bundle.putString(PostFragment.EXTRA_ACCESS_TOKEN, mAccessToken);
fragment.setArguments(bundle);
return fragment;
} else if (postType.equals(SharedPreferencesUtils.MAIN_PAGE_TAB_POST_TYPE_MULTIREDDIT)) {
PostFragment fragment = new PostFragment();
Bundle bundle = new Bundle();
bundle.putString(PostFragment.EXTRA_NAME, name);
bundle.putInt(PostFragment.EXTRA_POST_TYPE, PostDataSource.TYPE_MULTI_REDDIT);
bundle.putInt(PostFragment.EXTRA_FILTER, PostFragment.EXTRA_NO_FILTER);
bundle.putString(PostFragment.EXTRA_ACCESS_TOKEN, mAccessToken);
fragment.setArguments(bundle);
return fragment;
} else if (postType.equals(SharedPreferencesUtils.MAIN_PAGE_TAB_POST_TYPE_USER)) {
PostFragment fragment = new PostFragment();
Bundle bundle = new Bundle();
bundle.putInt(PostFragment.EXTRA_POST_TYPE, PostDataSource.TYPE_USER);
bundle.putString(PostFragment.EXTRA_USER_NAME, name);
bundle.putString(PostFragment.EXTRA_USER_WHERE, PostDataSource.USER_WHERE_SUBMITTED);
bundle.putInt(PostFragment.EXTRA_FILTER, PostFragment.EXTRA_NO_FILTER);
bundle.putString(PostFragment.EXTRA_ACCESS_TOKEN, mAccessToken);
fragment.setArguments(bundle);
@ -976,7 +1020,7 @@ public class MainActivity extends BaseActivity implements SortTypeSelectionCallb
PostFragment fragment = new PostFragment();
Bundle bundle = new Bundle();
bundle.putInt(PostFragment.EXTRA_POST_TYPE, PostDataSource.TYPE_SUBREDDIT);
bundle.putString(PostFragment.EXTRA_NAME, "all");
bundle.putString(PostFragment.EXTRA_NAME, "popular");
bundle.putInt(PostFragment.EXTRA_FILTER, PostFragment.EXTRA_NO_FILTER);
bundle.putString(PostFragment.EXTRA_ACCESS_TOKEN, mAccessToken);
fragment.setArguments(bundle);
@ -1004,11 +1048,11 @@ public class MainActivity extends BaseActivity implements SortTypeSelectionCallb
} else {
switch (position) {
case 0:
return "Home";
return mSharedPreferences.getString(SharedPreferencesUtils.MAIN_PAGE_TAB_1_TITLE, getString(R.string.home));
case 1:
return "Popular";
return mSharedPreferences.getString(SharedPreferencesUtils.MAIN_PAGE_TAB_2_TITLE, getString(R.string.popular));
case 2:
return "All";
return mSharedPreferences.getString(SharedPreferencesUtils.MAIN_PAGE_TAB_3_TITLE, getString(R.string.all));
}
}
return null;
@ -1021,21 +1065,21 @@ public class MainActivity extends BaseActivity implements SortTypeSelectionCallb
if (mAccessToken == null) {
switch (position) {
case 0:
popularPostFragment = (PostFragment) fragment;
tab2 = (PostFragment) fragment;
break;
case 1:
allPostFragment = (PostFragment) fragment;
tab3 = (PostFragment) fragment;
}
} else {
switch (position) {
case 0:
frontPagePostFragment = (PostFragment) fragment;
tab1 = (PostFragment) fragment;
break;
case 1:
popularPostFragment = (PostFragment) fragment;
tab2 = (PostFragment) fragment;
break;
case 2:
allPostFragment = (PostFragment) fragment;
tab3 = (PostFragment) fragment;
}
}
return fragment;
@ -1045,18 +1089,18 @@ public class MainActivity extends BaseActivity implements SortTypeSelectionCallb
if (mAccessToken == null) {
switch (viewPager.getCurrentItem()) {
case 0:
return popularPostFragment.handleKeyDown(keyCode);
return tab2.handleKeyDown(keyCode);
case 1:
return allPostFragment.handleKeyDown(keyCode);
return tab3.handleKeyDown(keyCode);
}
} else {
switch (viewPager.getCurrentItem()) {
case 0:
return frontPagePostFragment.handleKeyDown(keyCode);
return tab1.handleKeyDown(keyCode);
case 1:
return popularPostFragment.handleKeyDown(keyCode);
return tab2.handleKeyDown(keyCode);
case 2:
return allPostFragment.handleKeyDown(keyCode);
return tab3.handleKeyDown(keyCode);
}
}
return false;
@ -1066,18 +1110,18 @@ public class MainActivity extends BaseActivity implements SortTypeSelectionCallb
if (mAccessToken == null) {
switch (viewPager.getCurrentItem()) {
case 0:
return popularPostFragment.startLazyMode();
return tab2.startLazyMode();
case 1:
return allPostFragment.startLazyMode();
return tab3.startLazyMode();
}
} else {
switch (viewPager.getCurrentItem()) {
case 0:
return frontPagePostFragment.startLazyMode();
return tab1.startLazyMode();
case 1:
return popularPostFragment.startLazyMode();
return tab2.startLazyMode();
case 2:
return allPostFragment.startLazyMode();
return tab3.startLazyMode();
}
}
@ -1088,22 +1132,22 @@ public class MainActivity extends BaseActivity implements SortTypeSelectionCallb
if (mAccessToken == null) {
switch (getCurrentLazyModeFragmentPosition()) {
case 0:
popularPostFragment.stopLazyMode();
tab2.stopLazyMode();
break;
case 1:
allPostFragment.stopLazyMode();
tab3.stopLazyMode();
break;
}
} else {
switch (getCurrentLazyModeFragmentPosition()) {
case 0:
frontPagePostFragment.stopLazyMode();
tab1.stopLazyMode();
break;
case 1:
popularPostFragment.stopLazyMode();
tab2.stopLazyMode();
break;
case 2:
allPostFragment.stopLazyMode();
tab3.stopLazyMode();
break;
}
}
@ -1113,22 +1157,22 @@ public class MainActivity extends BaseActivity implements SortTypeSelectionCallb
if (mAccessToken == null) {
switch (getCurrentLazyModeFragmentPosition()) {
case 0:
popularPostFragment.resumeLazyMode(false);
tab2.resumeLazyMode(false);
break;
case 1:
allPostFragment.resumeLazyMode(false);
tab3.resumeLazyMode(false);
break;
}
} else {
switch (getCurrentLazyModeFragmentPosition()) {
case 0:
frontPagePostFragment.resumeLazyMode(false);
tab1.resumeLazyMode(false);
break;
case 1:
popularPostFragment.resumeLazyMode(false);
tab2.resumeLazyMode(false);
break;
case 2:
allPostFragment.resumeLazyMode(false);
tab3.resumeLazyMode(false);
break;
}
}
@ -1138,21 +1182,21 @@ public class MainActivity extends BaseActivity implements SortTypeSelectionCallb
if (mAccessToken == null) {
switch (getCurrentLazyModeFragmentPosition()) {
case 0:
popularPostFragment.pauseLazyMode(false);
tab2.pauseLazyMode(false);
break;
case 1:
allPostFragment.pauseLazyMode(false);
tab3.pauseLazyMode(false);
}
} else {
switch (getCurrentLazyModeFragmentPosition()) {
case 0:
frontPagePostFragment.pauseLazyMode(false);
tab1.pauseLazyMode(false);
break;
case 1:
popularPostFragment.pauseLazyMode(false);
tab2.pauseLazyMode(false);
break;
case 2:
allPostFragment.pauseLazyMode(false);
tab3.pauseLazyMode(false);
}
}
}
@ -1161,9 +1205,9 @@ public class MainActivity extends BaseActivity implements SortTypeSelectionCallb
if (mAccessToken == null) {
if (!isInLazyMode) {
return -1;
} else if (popularPostFragment != null && popularPostFragment.isInLazyMode()) {
} else if (tab2 != null && tab2.isInLazyMode()) {
return 0;
} else if (allPostFragment != null && allPostFragment.isInLazyMode()) {
} else if (tab3 != null && tab3.isInLazyMode()) {
return 1;
} else {
return -1;
@ -1171,11 +1215,11 @@ public class MainActivity extends BaseActivity implements SortTypeSelectionCallb
} else {
if (!isInLazyMode) {
return -1;
} else if (frontPagePostFragment != null && frontPagePostFragment.isInLazyMode()) {
} else if (tab1 != null && tab1.isInLazyMode()) {
return 0;
} else if (popularPostFragment != null && popularPostFragment.isInLazyMode()) {
} else if (tab2 != null && tab2.isInLazyMode()) {
return 1;
} else if (allPostFragment != null && allPostFragment.isInLazyMode()) {
} else if (tab3 != null && tab3.isInLazyMode()) {
return 2;
} else {
return -1;
@ -1186,9 +1230,9 @@ public class MainActivity extends BaseActivity implements SortTypeSelectionCallb
void changeSortType(SortType sortType) {
if (mAccessToken == null) {
if (viewPager.getCurrentItem() == 0) {
popularPostFragment.changeSortType(sortType);
tab2.changeSortType(sortType);
} else {
allPostFragment.changeSortType(sortType);
tab3.changeSortType(sortType);
}
} else {
switch (viewPager.getCurrentItem()) {
@ -1198,7 +1242,7 @@ public class MainActivity extends BaseActivity implements SortTypeSelectionCallb
mSortTypeSharedPreferences.edit().putString(SharedPreferencesUtils.SORT_TIME_BEST_POST, sortType.getTime().name()).apply();
}
frontPagePostFragment.changeSortType(sortType);
tab1.changeSortType(sortType);
break;
case 1:
mSortTypeSharedPreferences.edit().putString(SharedPreferencesUtils.SORT_TYPE_POPULAR_POST, sortType.getType().name()).apply();
@ -1206,7 +1250,7 @@ public class MainActivity extends BaseActivity implements SortTypeSelectionCallb
mSortTypeSharedPreferences.edit().putString(SharedPreferencesUtils.SORT_TIME_POPULAR_POST, sortType.getTime().name()).apply();
}
popularPostFragment.changeSortType(sortType);
tab2.changeSortType(sortType);
break;
case 2:
mSortTypeSharedPreferences.edit().putString(SharedPreferencesUtils.SORT_TYPE_ALL_POST, sortType.getType().name()).apply();
@ -1214,7 +1258,7 @@ public class MainActivity extends BaseActivity implements SortTypeSelectionCallb
mSortTypeSharedPreferences.edit().putString(SharedPreferencesUtils.SORT_TIME_ALL_POST, sortType.getTime().name()).apply();
}
allPostFragment.changeSortType(sortType);
tab3.changeSortType(sortType);
}
}
}
@ -1222,77 +1266,77 @@ public class MainActivity extends BaseActivity implements SortTypeSelectionCallb
public void refresh() {
if (mAccessToken == null) {
if (viewPager.getCurrentItem() == 0) {
if (popularPostFragment != null) {
popularPostFragment.refresh();
if (tab2 != null) {
tab2.refresh();
}
} else {
if (allPostFragment != null) {
allPostFragment.refresh();
if (tab3 != null) {
tab3.refresh();
}
}
} else {
switch (viewPager.getCurrentItem()) {
case 0:
if (frontPagePostFragment != null) {
frontPagePostFragment.refresh();
if (tab1 != null) {
tab1.refresh();
}
break;
case 1:
if (popularPostFragment != null) {
popularPostFragment.refresh();
if (tab2 != null) {
tab2.refresh();
}
break;
case 2:
if (allPostFragment != null) {
allPostFragment.refresh();
if (tab3 != null) {
tab3.refresh();
}
}
}
}
void changeNSFW(boolean nsfw) {
if (frontPagePostFragment != null) {
frontPagePostFragment.changeNSFW(nsfw);
if (tab1 != null) {
tab1.changeNSFW(nsfw);
}
if (popularPostFragment != null) {
popularPostFragment.changeNSFW(nsfw);
if (tab2 != null) {
tab2.changeNSFW(nsfw);
}
if (allPostFragment != null) {
allPostFragment.changeNSFW(nsfw);
if (tab3 != null) {
tab3.changeNSFW(nsfw);
}
}
void changePostLayout(int postLayout) {
if (mAccessToken == null) {
if (viewPager.getCurrentItem() == 0) {
if (popularPostFragment != null) {
if (tab2 != null) {
mPostLayoutSharedPreferences.edit().putInt(SharedPreferencesUtils.POST_LAYOUT_POPULAR_POST, postLayout).apply();
popularPostFragment.changePostLayout(postLayout);
tab2.changePostLayout(postLayout);
}
} else {
if (allPostFragment != null) {
if (tab3 != null) {
mPostLayoutSharedPreferences.edit().putInt(SharedPreferencesUtils.POST_LAYOUT_ALL_POST, postLayout).apply();
allPostFragment.changePostLayout(postLayout);
tab3.changePostLayout(postLayout);
}
}
} else {
switch (viewPager.getCurrentItem()) {
case 0:
if (frontPagePostFragment != null) {
if (tab1 != null) {
mPostLayoutSharedPreferences.edit().putInt(SharedPreferencesUtils.POST_LAYOUT_FRONT_PAGE_POST, postLayout).apply();
frontPagePostFragment.changePostLayout(postLayout);
tab1.changePostLayout(postLayout);
}
break;
case 1:
if (popularPostFragment != null) {
if (tab2 != null) {
mPostLayoutSharedPreferences.edit().putInt(SharedPreferencesUtils.POST_LAYOUT_POPULAR_POST, postLayout).apply();
popularPostFragment.changePostLayout(postLayout);
tab2.changePostLayout(postLayout);
}
break;
case 2:
if (allPostFragment != null) {
if (tab3 != null) {
mPostLayoutSharedPreferences.edit().putInt(SharedPreferencesUtils.POST_LAYOUT_ALL_POST, postLayout).apply();
allPostFragment.changePostLayout(postLayout);
tab3.changePostLayout(postLayout);
}
}
}

View File

@ -91,6 +91,7 @@ public class ViewImageActivity extends AppCompatActivity {
private String mImageFileName;
private float totalLengthY = 0.0f;
private float touchY = -1.0f;
private float initialZoom = 1.0f;
private float zoom = 1.0f;
private boolean isSwiping = false;
private RequestManager glide;
@ -327,7 +328,7 @@ public class ViewImageActivity extends AppCompatActivity {
@Override
public void onStateReset(State oldState, State newState) {
initialZoom = newState.getZoom();
}
});
@ -367,7 +368,7 @@ public class ViewImageActivity extends AppCompatActivity {
mProgressBar.setVisibility(View.GONE);
return false;
}
}).apply(new RequestOptions().fitCenter()).into(mImageView);
}).into(mImageView);
}
@Override
@ -455,7 +456,7 @@ public class ViewImageActivity extends AppCompatActivity {
@Override
public boolean dispatchTouchEvent(MotionEvent ev) {
if (zoom == 1.0) {
if (Math.abs(zoom - initialZoom) <= 0.000001) {
swipe.dispatchTouchEvent(ev);
}
return super.dispatchTouchEvent(ev);

View File

@ -52,25 +52,30 @@ import javax.inject.Named;
import butterknife.BindView;
import butterknife.ButterKnife;
import im.ene.toro.exoplayer.ExoCreator;
import im.ene.toro.media.PlaybackInfo;
import im.ene.toro.media.VolumeInfo;
import ml.docilealligator.infinityforreddit.Adapter.CommentAndPostRecyclerViewAdapter;
import ml.docilealligator.infinityforreddit.AsyncTask.GetCurrentAccountAsyncTask;
import ml.docilealligator.infinityforreddit.AsyncTask.SwitchAccountAsyncTask;
import ml.docilealligator.infinityforreddit.CommentData;
import ml.docilealligator.infinityforreddit.CustomTheme.CustomThemeWrapper;
import ml.docilealligator.infinityforreddit.CustomView.CustomToroContainer;
import ml.docilealligator.infinityforreddit.DeleteThing;
import ml.docilealligator.infinityforreddit.Event.ChangeNSFWBlurEvent;
import ml.docilealligator.infinityforreddit.Event.ChangeSpoilerBlurEvent;
import ml.docilealligator.infinityforreddit.Event.ChangeWifiStatusEvent;
import ml.docilealligator.infinityforreddit.Event.PostUpdateEventToDetailActivity;
import ml.docilealligator.infinityforreddit.Event.PostUpdateEventToPostList;
import ml.docilealligator.infinityforreddit.Event.SwitchAccountEvent;
import ml.docilealligator.infinityforreddit.FetchComment;
import ml.docilealligator.infinityforreddit.Post.FetchPost;
import ml.docilealligator.infinityforreddit.Flair;
import ml.docilealligator.infinityforreddit.Fragment.FlairBottomSheetFragment;
import ml.docilealligator.infinityforreddit.Fragment.PostCommentSortTypeBottomSheetFragment;
import ml.docilealligator.infinityforreddit.Post.HidePost;
import ml.docilealligator.infinityforreddit.Infinity;
import ml.docilealligator.infinityforreddit.ParseComment;
import ml.docilealligator.infinityforreddit.Post.FetchPost;
import ml.docilealligator.infinityforreddit.Post.HidePost;
import ml.docilealligator.infinityforreddit.Post.ParsePost;
import ml.docilealligator.infinityforreddit.Post.Post;
import ml.docilealligator.infinityforreddit.R;
@ -87,6 +92,8 @@ import retrofit2.Callback;
import retrofit2.Response;
import retrofit2.Retrofit;
import static im.ene.toro.media.PlaybackInfo.INDEX_UNSET;
import static im.ene.toro.media.PlaybackInfo.TIME_UNSET;
import static ml.docilealligator.infinityforreddit.Activity.CommentActivity.RETURN_EXTRA_COMMENT_DATA_KEY;
import static ml.docilealligator.infinityforreddit.Activity.CommentActivity.WRITE_COMMENT_REQUEST_CODE;
@ -140,7 +147,7 @@ public class ViewPostDetailActivity extends BaseActivity implements FlairBottomS
@BindView(R.id.swipe_refresh_layout_view_post_detail_activity)
SwipeRefreshLayout mSwipeRefreshLayout;
@BindView(R.id.recycler_view_view_post_detail)
RecyclerView mRecyclerView;
CustomToroContainer mRecyclerView;
@BindView(R.id.fetch_post_info_linear_layout_view_post_detail_activity)
LinearLayout mFetchPostInfoLinearLayout;
@BindView(R.id.fetch_post_info_image_view_view_post_detail_activity)
@ -165,16 +172,14 @@ public class ViewPostDetailActivity extends BaseActivity implements FlairBottomS
SharedPreferences mSortTypeSharedPreferences;
@Inject
CustomThemeWrapper mCustomThemeWrapper;
@Inject
ExoCreator mExoCreator;
private RequestManager mGlide;
private Locale mLocale;
private Menu mMenu;
private int orientation;
private int postListPosition = -1;
private String mSingleCommentId;
private boolean mNeedBlurNsfw;
private boolean mNeedBlurSpoiler;
private boolean mVoteButtonsOnTheRight;
private boolean mShowElapsedTime;
private boolean showToast = false;
private boolean isSortingComments = false;
private boolean mVolumeKeysNavigateComments;
@ -182,10 +187,6 @@ public class ViewPostDetailActivity extends BaseActivity implements FlairBottomS
private boolean mLockFab;
private boolean mSwipeUpToHideFab;
private boolean mExpandChildren;
private boolean mCommentToolbarHidden;
private boolean mCommentToolbarHideOnClick;
private boolean mShowCommentDivider;
private boolean mShowAbsoluteNumberOfVotes;
private LinearLayoutManager mLinearLayoutManager;
private CommentAndPostRecyclerViewAdapter mAdapter;
private RecyclerView.SmoothScroller mSmoothScroller;
@ -242,18 +243,10 @@ public class ViewPostDetailActivity extends BaseActivity implements FlairBottomS
mToolbar.setTitle("");
setSupportActionBar(mToolbar);
mNeedBlurNsfw = mSharedPreferences.getBoolean(SharedPreferencesUtils.BLUR_NSFW_KEY, true);
mNeedBlurSpoiler = mSharedPreferences.getBoolean(SharedPreferencesUtils.BLUR_SPOILER_KEY, false);
mVoteButtonsOnTheRight = mSharedPreferences.getBoolean(SharedPreferencesUtils.VOTE_BUTTONS_ON_THE_RIGHT_KEY, false);
mShowElapsedTime = mSharedPreferences.getBoolean(SharedPreferencesUtils.SHOW_ELAPSED_TIME_KEY, false);
mVolumeKeysNavigateComments = mSharedPreferences.getBoolean(SharedPreferencesUtils.VOLUME_KEYS_NAVIGATE_COMMENTS, false);
mLockFab = mSharedPreferences.getBoolean(SharedPreferencesUtils.LOCK_JUMP_TO_NEXT_TOP_LEVEL_COMMENT_BUTTON, false);
mSwipeUpToHideFab = mSharedPreferences.getBoolean(SharedPreferencesUtils.SWIPE_UP_TO_HIDE_JUMP_TO_NEXT_TOP_LEVEL_COMMENT_BUTTON, false);
mExpandChildren = !mSharedPreferences.getBoolean(SharedPreferencesUtils.SHOW_TOP_LEVEL_COMMENTS_FIRST, false);
mCommentToolbarHidden = mSharedPreferences.getBoolean(SharedPreferencesUtils.COMMENT_TOOLBAR_HIDDEN, false);
mCommentToolbarHideOnClick= mSharedPreferences.getBoolean(SharedPreferencesUtils.COMMENT_TOOLBAR_HIDE_ON_CLICK, true);
mShowCommentDivider = mSharedPreferences.getBoolean(SharedPreferencesUtils.SHOW_COMMENT_DIVIDER, false);
mShowAbsoluteNumberOfVotes = mSharedPreferences.getBoolean(SharedPreferencesUtils.SHOW_ABSOLUTE_NUMBER_OF_VOTES, true);
mGlide = Glide.with(this);
mLocale = getResources().getConfiguration().locale;
@ -511,8 +504,7 @@ public class ViewPostDetailActivity extends BaseActivity implements FlairBottomS
mAdapter = new CommentAndPostRecyclerViewAdapter(ViewPostDetailActivity.this,
mCustomThemeWrapper, mRetrofit, mOauthRetrofit, mRedditDataRoomDatabase, mGlide,
mAccessToken, mAccountName, mPost, mLocale, mSingleCommentId, isSingleCommentThreadMode,
mNeedBlurNsfw, mNeedBlurSpoiler, mVoteButtonsOnTheRight, mShowElapsedTime, mExpandChildren,
mCommentToolbarHidden, mCommentToolbarHideOnClick, mShowCommentDivider,mShowAbsoluteNumberOfVotes,
mSharedPreferences, mExoCreator,
new CommentAndPostRecyclerViewAdapter.CommentRecyclerViewAdapterCallback() {
@Override
public void updatePost(Post post) {
@ -552,6 +544,12 @@ public class ViewPostDetailActivity extends BaseActivity implements FlairBottomS
}
}
mRecyclerView.setCacheManager(mAdapter);
mRecyclerView.setPlayerInitializer(order -> {
VolumeInfo volumeInfo = new VolumeInfo(true, 0f);
return new PlaybackInfo(INDEX_UNSET, TIME_UNSET, volumeInfo);
});
fab.setOnClickListener(view -> scrollToNextParentComment());
}
@ -644,8 +642,7 @@ public class ViewPostDetailActivity extends BaseActivity implements FlairBottomS
mAdapter = new CommentAndPostRecyclerViewAdapter(ViewPostDetailActivity.this,
mCustomThemeWrapper, mRetrofit, mOauthRetrofit, mRedditDataRoomDatabase, mGlide,
mAccessToken, mAccountName, mPost, mLocale, mSingleCommentId, isSingleCommentThreadMode,
mNeedBlurNsfw, mNeedBlurSpoiler, mVoteButtonsOnTheRight, mShowElapsedTime, mExpandChildren,
mCommentToolbarHidden, mCommentToolbarHideOnClick, mShowCommentDivider, mShowAbsoluteNumberOfVotes,
mSharedPreferences, mExoCreator,
new CommentAndPostRecyclerViewAdapter.CommentRecyclerViewAdapterCallback() {
@Override
public void updatePost(Post post) {
@ -1242,6 +1239,17 @@ public class ViewPostDetailActivity extends BaseActivity implements FlairBottomS
}
}
@Subscribe
public void onChangeWifiStatusEvent(ChangeWifiStatusEvent changeWifiStatusEvent) {
if (mAdapter != null) {
String autoplay = mSharedPreferences.getString(SharedPreferencesUtils.VIDEO_AUTOPLAY, SharedPreferencesUtils.VIDEO_AUTOPLAY_VALUE_NEVER);
if (autoplay.equals(SharedPreferencesUtils.VIDEO_AUTOPLAY_VALUE_ON_WIFI)) {
mAdapter.setAutoplay(changeWifiStatusEvent.isConnectedToWifi);
refreshAdapter();
}
}
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.view_post_detail_activity, menu);

View File

@ -69,6 +69,7 @@ public class ViewVideoActivity extends AppCompatActivity {
public static final String EXTRA_SUBREDDIT = "ES";
public static final String EXTRA_ID = "EI";
public static final String EXTRA_POST_TITLE = "EPT";
public static final String EXTRA_PROGRESS_SECONDS = "EPS";
private static final int PERMISSION_REQUEST_WRITE_EXTERNAL_STORAGE = 0;
private static final String IS_MUTE_STATE = "IMS";
@BindView(R.id.relative_layout_view_video_activity)
@ -93,6 +94,7 @@ public class ViewVideoActivity extends AppCompatActivity {
private float totalLengthY = 0.0f;
private float touchY = -1.0f;
private String postTitle;
private long resumePosition = -1;
@Inject
@Named("default")
@ -134,6 +136,9 @@ public class ViewVideoActivity extends AppCompatActivity {
videoDownloadUrl = intent.getStringExtra(EXTRA_VIDEO_DOWNLOAD_URL);
videoFileName = intent.getStringExtra(EXTRA_SUBREDDIT) + "-" + intent.getStringExtra(EXTRA_ID) + ".mp4";
postTitle = intent.getStringExtra(EXTRA_POST_TITLE);
if (savedInstanceState == null) {
resumePosition = intent.getLongExtra(EXTRA_PROGRESS_SECONDS, -1);
}
if (postTitle != null) {
setTitle(Html.fromHtml(String.format("<small>%s</small>", postTitle)));
@ -320,6 +325,9 @@ public class ViewVideoActivity extends AppCompatActivity {
player.prepare(new HlsMediaSource.Factory(dataSourceFactory).createMediaSource(mVideoUri));
player.setRepeatMode(Player.REPEAT_MODE_ALL);
if (resumePosition > 0) {
player.seekTo(resumePosition);
}
player.setPlayWhenReady(true);
wasPlaying = true;

View File

@ -127,6 +127,7 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView
private int mColorPrimaryLightTheme;
private int mColorAccent;
private int mCardViewBackgroundColor;
private int mPrimaryTextColor;
private int mSecondaryTextColor;
private int mPostTitleColor;
private int mPostContentColor;
@ -198,6 +199,7 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView
mColorPrimaryLightTheme = customThemeWrapper.getColorPrimaryLightTheme();
mColorAccent = customThemeWrapper.getColorAccent();
mCardViewBackgroundColor = customThemeWrapper.getCardViewBackgroundColor();
mPrimaryTextColor = customThemeWrapper.getPrimaryTextColor();
mSecondaryTextColor = customThemeWrapper.getSecondaryTextColor();
mPostTitleColor = customThemeWrapper.getPostTitleColor();
mPostContentColor = customThemeWrapper.getPostContentColor();
@ -289,15 +291,15 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView
if (viewType == VIEW_TYPE_POST_CARD_VIDEO_TYPE_AUTOPLAY) {
return new PostVideoAutoplayViewHolder(LayoutInflater.from(parent.getContext()).inflate(R.layout.item_post_video_type_autoplay, parent, false));
} else if (viewType == VIEW_TYPE_POST_CARD_VIDEO_AND_GIF_PREVIEW_TYPE) {
return new PostGifAndVideoPreviewViewHolder(LayoutInflater.from(parent.getContext()).inflate(R.layout.item_post_video_and_gif_preview_type, parent, false));
return new PostVideoAndGifPreviewViewHolder(LayoutInflater.from(parent.getContext()).inflate(R.layout.item_post_video_and_gif_preview, parent, false));
} else if (viewType == VIEW_TYPE_POST_CARD_IMAGE_AND_GIF_AUTOPLAY_TYPE) {
return new PostImageAndGifAutoplayTypeViewHolder(LayoutInflater.from(parent.getContext()).inflate(R.layout.item_post_image_and_gif_autoplay_type, parent, false));
return new PostImageAndGifAutoplayViewHolder(LayoutInflater.from(parent.getContext()).inflate(R.layout.item_post_image_and_gif_autoplay, parent, false));
} else if (viewType == VIEW_TYPE_POST_CARD_LINK_TYPE) {
return new PostLinkTypeViewHolder(LayoutInflater.from(parent.getContext()).inflate(R.layout.item_post_link_type, parent, false));
return new PostLinkTypeViewHolder(LayoutInflater.from(parent.getContext()).inflate(R.layout.item_post_link, parent, false));
} else if (viewType == VIEW_TYPE_POST_CARD_NO_PREVIEW_LINK_TYPE) {
return new PostNoPreviewLinkTypeViewHolder(LayoutInflater.from(parent.getContext()).inflate(R.layout.item_post_no_preview_link_type, parent, false));
return new PostNoPreviewLinkTypeViewHolder(LayoutInflater.from(parent.getContext()).inflate(R.layout.item_post_no_preview_link, parent, false));
} else if (viewType == VIEW_TYPE_POST_CARD_TEXT_TYPE) {
return new PostTextTypeViewHolder(LayoutInflater.from(parent.getContext()).inflate(R.layout.item_post_text_type, parent, false));
return new PostTextTypeViewHolder(LayoutInflater.from(parent.getContext()).inflate(R.layout.item_post_text, parent, false));
} else if (viewType == VIEW_TYPE_POST_COMPACT) {
return new PostCompactViewHolder(LayoutInflater.from(parent.getContext()).inflate(R.layout.item_post_compact, parent, false));
} else if (viewType == VIEW_TYPE_ERROR) {
@ -500,35 +502,35 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView
if (holder instanceof PostVideoAutoplayViewHolder) {
((PostVideoAutoplayViewHolder) holder).aspectRatioFrameLayout.setAspectRatio((float) post.getPreviewWidth() / post.getPreviewHeight());
((PostVideoAutoplayViewHolder) holder).bindVideoUri(Uri.parse(post.getVideoUrl()));
} else if (holder instanceof PostGifAndVideoPreviewViewHolder) {
} else if (holder instanceof PostVideoAndGifPreviewViewHolder) {
if (post.getPostType() == Post.VIDEO_TYPE) {
((PostGifAndVideoPreviewViewHolder) holder).typeTextView.setText(mActivity.getString(R.string.video));
((PostVideoAndGifPreviewViewHolder) holder).typeTextView.setText(mActivity.getString(R.string.video));
} else {
((PostGifAndVideoPreviewViewHolder) holder).typeTextView.setText(mActivity.getString(R.string.gif));
((PostVideoAndGifPreviewViewHolder) holder).typeTextView.setText(mActivity.getString(R.string.gif));
}
((PostGifAndVideoPreviewViewHolder) holder).progressBar.setVisibility(View.VISIBLE);
((PostGifAndVideoPreviewViewHolder) holder).imageView
((PostVideoAndGifPreviewViewHolder) holder).progressBar.setVisibility(View.VISIBLE);
((PostVideoAndGifPreviewViewHolder) holder).imageView
.setRatio((float) post.getPreviewHeight() / post.getPreviewWidth());
loadImage(holder, post);
if (post.getPreviewWidth() <= 0 || post.getPreviewHeight() <= 0) {
((PostGifAndVideoPreviewViewHolder) holder).imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
((PostGifAndVideoPreviewViewHolder) holder).imageView.getLayoutParams().height = (int) (400 * mScale);
((PostVideoAndGifPreviewViewHolder) holder).imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
((PostVideoAndGifPreviewViewHolder) holder).imageView.getLayoutParams().height = (int) (400 * mScale);
}
} else if (holder instanceof PostImageAndGifAutoplayTypeViewHolder) {
} else if (holder instanceof PostImageAndGifAutoplayViewHolder) {
if (post.getPostType() == Post.GIF_TYPE) {
((PostImageAndGifAutoplayTypeViewHolder) holder).typeTextView.setText(mActivity.getString(R.string.gif));
((PostImageAndGifAutoplayViewHolder) holder).typeTextView.setText(mActivity.getString(R.string.gif));
} else {
((PostImageAndGifAutoplayTypeViewHolder) holder).typeTextView.setText(mActivity.getString(R.string.image));
((PostImageAndGifAutoplayViewHolder) holder).typeTextView.setText(mActivity.getString(R.string.image));
}
((PostImageAndGifAutoplayTypeViewHolder) holder).progressBar.setVisibility(View.VISIBLE);
((PostImageAndGifAutoplayTypeViewHolder) holder).imageView
((PostImageAndGifAutoplayViewHolder) holder).progressBar.setVisibility(View.VISIBLE);
((PostImageAndGifAutoplayViewHolder) holder).imageView
.setRatio((float) post.getPreviewHeight() / post.getPreviewWidth());
loadImage(holder, post);
if (post.getPreviewWidth() <= 0 || post.getPreviewHeight() <= 0) {
((PostImageAndGifAutoplayTypeViewHolder) holder).imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
((PostImageAndGifAutoplayTypeViewHolder) holder).imageView.getLayoutParams().height = (int) (400 * mScale);
((PostImageAndGifAutoplayViewHolder) holder).imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
((PostImageAndGifAutoplayViewHolder) holder).imageView.getLayoutParams().height = (int) (400 * mScale);
}
} else if (holder instanceof PostLinkTypeViewHolder) {
((PostLinkTypeViewHolder) holder).progressBar.setVisibility(View.VISIBLE);
@ -536,13 +538,12 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView
.setRatio((float) post.getPreviewHeight() / post.getPreviewWidth());
loadImage(holder, post);
((PostLinkTypeViewHolder) holder).linkTextView.setVisibility(View.VISIBLE);
String domain = Uri.parse(post.getUrl()).getHost();
((PostLinkTypeViewHolder) holder).linkTextView.setVisibility(View.VISIBLE);
((PostLinkTypeViewHolder) holder).linkTextView.setText(domain);
} else if (holder instanceof PostNoPreviewLinkTypeViewHolder) {
String noPreviewLinkUrl = post.getUrl();
String noPreviewLinkDomain = Uri.parse(post.getUrl()).getHost();
((PostNoPreviewLinkTypeViewHolder) holder).linkTextView.setVisibility(View.VISIBLE);
String noPreviewLinkDomain = Uri.parse(noPreviewLinkUrl).getHost();
((PostNoPreviewLinkTypeViewHolder) holder).linkTextView.setText(noPreviewLinkDomain);
} else if (holder instanceof PostTextTypeViewHolder) {
if (post.getSelfTextPlainTrimmed() != null && !post.getSelfTextPlainTrimmed().equals("")) {
@ -1104,16 +1105,16 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView
}
private void loadImage(final RecyclerView.ViewHolder holder, final Post post) {
if (holder instanceof PostImageAndGifAutoplayTypeViewHolder) {
if (holder instanceof PostImageAndGifAutoplayViewHolder) {
String url = mAutoplay && post.getPostType() == Post.GIF_TYPE ? post.getUrl() : post.getPreviewUrl();
RequestBuilder<Drawable> imageRequestBuilder = mGlide.load(url).listener(new RequestListener<Drawable>() {
@Override
public boolean onLoadFailed(@Nullable GlideException e, Object model, Target<Drawable> target, boolean isFirstResource) {
((PostImageAndGifAutoplayTypeViewHolder) holder).progressBar.setVisibility(View.GONE);
((PostImageAndGifAutoplayTypeViewHolder) holder).errorRelativeLayout.setVisibility(View.VISIBLE);
((PostImageAndGifAutoplayTypeViewHolder) holder).errorRelativeLayout.setOnClickListener(view -> {
((PostImageAndGifAutoplayTypeViewHolder) holder).progressBar.setVisibility(View.VISIBLE);
((PostImageAndGifAutoplayTypeViewHolder) holder).errorRelativeLayout.setVisibility(View.GONE);
((PostImageAndGifAutoplayViewHolder) holder).progressBar.setVisibility(View.GONE);
((PostImageAndGifAutoplayViewHolder) holder).errorRelativeLayout.setVisibility(View.VISIBLE);
((PostImageAndGifAutoplayViewHolder) holder).errorRelativeLayout.setOnClickListener(view -> {
((PostImageAndGifAutoplayViewHolder) holder).progressBar.setVisibility(View.VISIBLE);
((PostImageAndGifAutoplayViewHolder) holder).errorRelativeLayout.setVisibility(View.GONE);
loadImage(holder, post);
});
return false;
@ -1121,27 +1122,27 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView
@Override
public boolean onResourceReady(Drawable resource, Object model, Target<Drawable> target, DataSource dataSource, boolean isFirstResource) {
((PostImageAndGifAutoplayTypeViewHolder) holder).errorRelativeLayout.setVisibility(View.GONE);
((PostImageAndGifAutoplayTypeViewHolder) holder).progressBar.setVisibility(View.GONE);
((PostImageAndGifAutoplayViewHolder) holder).errorRelativeLayout.setVisibility(View.GONE);
((PostImageAndGifAutoplayViewHolder) holder).progressBar.setVisibility(View.GONE);
return false;
}
});
if ((post.isNSFW() && mNeedBlurNSFW) || post.isSpoiler() && mNeedBlurSpoiler) {
imageRequestBuilder.apply(RequestOptions.bitmapTransform(new BlurTransformation(50, 10)))
.into(((PostImageAndGifAutoplayTypeViewHolder) holder).imageView);
.into(((PostImageAndGifAutoplayViewHolder) holder).imageView);
} else {
imageRequestBuilder.into(((PostImageAndGifAutoplayTypeViewHolder) holder).imageView);
imageRequestBuilder.into(((PostImageAndGifAutoplayViewHolder) holder).imageView);
}
} else if (holder instanceof PostGifAndVideoPreviewViewHolder) {
} else if (holder instanceof PostVideoAndGifPreviewViewHolder) {
RequestBuilder<Drawable> imageRequestBuilder = mGlide.load(post.getPreviewUrl()).listener(new RequestListener<Drawable>() {
@Override
public boolean onLoadFailed(@Nullable GlideException e, Object model, Target<Drawable> target, boolean isFirstResource) {
((PostGifAndVideoPreviewViewHolder) holder).progressBar.setVisibility(View.GONE);
((PostGifAndVideoPreviewViewHolder) holder).errorRelativeLayout.setVisibility(View.VISIBLE);
((PostGifAndVideoPreviewViewHolder) holder).errorRelativeLayout.setOnClickListener(view -> {
((PostGifAndVideoPreviewViewHolder) holder).progressBar.setVisibility(View.VISIBLE);
((PostGifAndVideoPreviewViewHolder) holder).errorRelativeLayout.setVisibility(View.GONE);
((PostVideoAndGifPreviewViewHolder) holder).progressBar.setVisibility(View.GONE);
((PostVideoAndGifPreviewViewHolder) holder).errorRelativeLayout.setVisibility(View.VISIBLE);
((PostVideoAndGifPreviewViewHolder) holder).errorRelativeLayout.setOnClickListener(view -> {
((PostVideoAndGifPreviewViewHolder) holder).progressBar.setVisibility(View.VISIBLE);
((PostVideoAndGifPreviewViewHolder) holder).errorRelativeLayout.setVisibility(View.GONE);
loadImage(holder, post);
});
return false;
@ -1149,17 +1150,17 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView
@Override
public boolean onResourceReady(Drawable resource, Object model, Target<Drawable> target, DataSource dataSource, boolean isFirstResource) {
((PostGifAndVideoPreviewViewHolder) holder).errorRelativeLayout.setVisibility(View.GONE);
((PostGifAndVideoPreviewViewHolder) holder).progressBar.setVisibility(View.GONE);
((PostVideoAndGifPreviewViewHolder) holder).errorRelativeLayout.setVisibility(View.GONE);
((PostVideoAndGifPreviewViewHolder) holder).progressBar.setVisibility(View.GONE);
return false;
}
});
if ((post.isNSFW() && mNeedBlurNSFW) || post.isSpoiler() && mNeedBlurSpoiler) {
imageRequestBuilder.apply(RequestOptions.bitmapTransform(new BlurTransformation(50, 10)))
.into(((PostGifAndVideoPreviewViewHolder) holder).imageView);
.into(((PostVideoAndGifPreviewViewHolder) holder).imageView);
} else {
imageRequestBuilder.into(((PostGifAndVideoPreviewViewHolder) holder).imageView);
imageRequestBuilder.into(((PostVideoAndGifPreviewViewHolder) holder).imageView);
}
} else if (holder instanceof PostLinkTypeViewHolder) {
RequestBuilder<Drawable> imageRequestBuilder = mGlide.load(post.getPreviewUrl()).listener(new RequestListener<Drawable>() {
@ -1304,18 +1305,22 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView
mAutoplay = autoplay;
}
public boolean isAutoplay() {
return mAutoplay;
}
@Override
public void onViewRecycled(@NonNull RecyclerView.ViewHolder holder) {
super.onViewRecycled(holder);
if (holder instanceof PostBaseViewHolder) {
if (holder instanceof PostVideoAutoplayViewHolder) {
((PostVideoAutoplayViewHolder) holder).muteButton.setImageDrawable(mActivity.getDrawable(R.drawable.ic_mute_24dp));
((PostVideoAutoplayViewHolder) holder).muteButton.setVisibility(View.GONE);
} else if (holder instanceof PostImageAndGifAutoplayTypeViewHolder) {
mGlide.clear(((PostImageAndGifAutoplayTypeViewHolder) holder).imageView);
((PostImageAndGifAutoplayTypeViewHolder) holder).imageView.setScaleType(ImageView.ScaleType.FIT_START);
((PostImageAndGifAutoplayTypeViewHolder) holder).imageView.getLayoutParams().height = FrameLayout.LayoutParams.WRAP_CONTENT;
((PostImageAndGifAutoplayTypeViewHolder) holder).errorRelativeLayout.setVisibility(View.GONE);
((PostVideoAutoplayViewHolder) holder).resetVolume();
} else if (holder instanceof PostImageAndGifAutoplayViewHolder) {
mGlide.clear(((PostImageAndGifAutoplayViewHolder) holder).imageView);
((PostImageAndGifAutoplayViewHolder) holder).imageView.setScaleType(ImageView.ScaleType.FIT_START);
((PostImageAndGifAutoplayViewHolder) holder).imageView.getLayoutParams().height = FrameLayout.LayoutParams.WRAP_CONTENT;
((PostImageAndGifAutoplayViewHolder) holder).errorRelativeLayout.setVisibility(View.GONE);
} else if (holder instanceof PostLinkTypeViewHolder) {
mGlide.clear(((PostLinkTypeViewHolder) holder).imageView);
((PostLinkTypeViewHolder) holder).imageView.setScaleType(ImageView.ScaleType.FIT_START);
@ -1822,9 +1827,9 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView
TextView userTextView;
@BindView(R.id.stickied_post_image_view_item_post_video_type_autoplay)
ImageView stickiedPostImageView;
@BindView(R.id.post_time_text_view_best_item_post_video_type_autoplay)
@BindView(R.id.post_time_text_view_item_post_video_type_autoplay)
TextView postTimeTextView;
@BindView(R.id.title_text_view_best_item_post_video_type_autoplay)
@BindView(R.id.title_text_view_item_post_video_type_autoplay)
TextView titleTextView;
@BindView(R.id.type_text_view_item_post_video_type_autoplay)
CustomTextView typeTextView;
@ -1842,7 +1847,7 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView
CustomTextView flairTextView;
@BindView(R.id.awards_text_view_item_post_video_type_autoplay)
CustomTextView awardsTextView;
@BindView(R.id.aspect)
@BindView(R.id.aspect_ratio_frame_layout_item_post_video_type_autoplay)
AspectRatioFrameLayout aspectRatioFrameLayout;
@BindView(R.id.player_view_item_post_video_type_autoplay)
PlayerView videoPlayer;
@ -1921,6 +1926,7 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView
intent.putExtra(ViewVideoActivity.EXTRA_SUBREDDIT, post.getSubredditName());
intent.putExtra(ViewVideoActivity.EXTRA_ID, post.getId());
intent.putExtra(ViewVideoActivity.EXTRA_POST_TITLE, post.getTitle());
intent.putExtra(ViewVideoActivity.EXTRA_PROGRESS_SECONDS, helper.getLatestPlaybackInfo().getResumePosition());
mActivity.startActivity(intent);
}
});
@ -1930,6 +1936,10 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView
mediaUri = videoUri;
}
void resetVolume() {
volume = 0f;
}
@NonNull
@Override
public View getPlayerView() {
@ -2016,61 +2026,61 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView
}
}
class PostGifAndVideoPreviewViewHolder extends PostBaseViewHolder {
@BindView(R.id.card_view_item_post_gif_type_autoplay)
class PostVideoAndGifPreviewViewHolder extends PostBaseViewHolder {
@BindView(R.id.card_view_item_post_video_and_gif_preview)
MaterialCardView cardView;
@BindView(R.id.icon_gif_image_view_item_post_gif_type_autoplay)
@BindView(R.id.icon_gif_image_view_item_post_video_and_gif_preview)
AspectRatioGifImageView iconGifImageView;
@BindView(R.id.subreddit_name_text_view_item_post_gif_type_autoplay)
@BindView(R.id.subreddit_name_text_view_item_post_video_and_gif_preview)
TextView subredditTextView;
@BindView(R.id.user_text_view_item_post_gif_type_autoplay)
@BindView(R.id.user_text_view_item_post_video_and_gif_preview)
TextView userTextView;
@BindView(R.id.stickied_post_image_view_item_post_gif_type_autoplay)
@BindView(R.id.stickied_post_image_view_item_post_video_and_gif_preview)
ImageView stickiedPostImageView;
@BindView(R.id.post_time_text_view_best_item_post_gif_type_autoplay)
@BindView(R.id.post_time_text_view_item_post_video_and_gif_preview)
TextView postTimeTextView;
@BindView(R.id.title_text_view_best_item_post_gif_type_autoplay)
@BindView(R.id.title_text_view_item_post_video_and_gif_preview)
TextView titleTextView;
@BindView(R.id.type_text_view_item_post_gif_type_autoplay)
@BindView(R.id.type_text_view_item_post_video_and_gif_preview)
CustomTextView typeTextView;
@BindView(R.id.archived_image_view_item_post_gif_type_autoplay)
@BindView(R.id.archived_image_view_item_post_video_and_gif_preview)
ImageView archivedImageView;
@BindView(R.id.locked_image_view_item_post_gif_type_autoplay)
@BindView(R.id.locked_image_view_item_post_video_and_gif_preview)
ImageView lockedImageView;
@BindView(R.id.crosspost_image_view_item_post_gif_type_autoplay)
@BindView(R.id.crosspost_image_view_item_post_video_and_gif_preview)
ImageView crosspostImageView;
@BindView(R.id.nsfw_text_view_item_post_gif_type_autoplay)
@BindView(R.id.nsfw_text_view_item_post_video_and_gif_preview)
CustomTextView nsfwTextView;
@BindView(R.id.spoiler_custom_text_view_item_post_gif_type_autoplay)
@BindView(R.id.spoiler_custom_text_view_item_post_video_and_gif_preview)
CustomTextView spoilerTextView;
@BindView(R.id.flair_custom_text_view_item_post_gif_type_autoplay)
@BindView(R.id.flair_custom_text_view_item_post_video_and_gif_preview)
CustomTextView flairTextView;
@BindView(R.id.awards_text_view_item_post_gif_type_autoplay)
@BindView(R.id.awards_text_view_item_post_video_and_gif_preview)
CustomTextView awardsTextView;
@BindView(R.id.image_view_wrapper_item_post_gif_type_autoplay)
RelativeLayout relativeLayout;
@BindView(R.id.progress_bar_item_post_gif_type_autoplay)
@BindView(R.id.progress_bar_item_post_video_and_gif_preview)
ProgressBar progressBar;
@BindView(R.id.image_view_item_post_gif_type_autoplay)
@BindView(R.id.image_view_item_post_video_and_gif_preview)
AspectRatioGifImageView imageView;
@BindView(R.id.load_image_error_relative_layout_item_post_gif_type_autoplay)
@BindView(R.id.load_image_error_relative_layout_item_post_video_and_gif_preview)
RelativeLayout errorRelativeLayout;
@BindView(R.id.bottom_constraint_layout_item_post_gif_type_autoplay)
@BindView(R.id.load_image_error_text_view_item_post_video_and_gif_preview)
TextView errorTextView;
@BindView(R.id.bottom_constraint_layout_item_post_video_and_gif_preview)
ConstraintLayout bottomConstraintLayout;
@BindView(R.id.plus_button_item_post_gif_type_autoplay)
@BindView(R.id.plus_button_item_post_video_and_gif_preview)
ImageView upvoteButton;
@BindView(R.id.score_text_view_item_post_gif_type_autoplay)
@BindView(R.id.score_text_view_item_post_video_and_gif_preview)
TextView scoreTextView;
@BindView(R.id.minus_button_item_post_gif_type_autoplay)
@BindView(R.id.minus_button_item_post_video_and_gif_preview)
ImageView downvoteButton;
@BindView(R.id.comments_count_item_post_gif_type_autoplay)
@BindView(R.id.comments_count_item_post_video_and_gif_preview)
TextView commentsCountTextView;
@BindView(R.id.save_button_item_post_gif_type_autoplay)
@BindView(R.id.save_button_item_post_video_and_gif_preview)
ImageView saveButton;
@BindView(R.id.share_button_item_post_gif_type_autoplay)
@BindView(R.id.share_button_item_post_video_and_gif_preview)
ImageView shareButton;
PostGifAndVideoPreviewViewHolder(View itemView) {
PostVideoAndGifPreviewViewHolder(View itemView) {
super(itemView);
ButterKnife.bind(this, itemView);
setBaseView(cardView,
@ -2097,6 +2107,7 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView
shareButton);
progressBar.setIndeterminateTintList(ColorStateList.valueOf(mColorAccent));
errorTextView.setTextColor(mPrimaryTextColor);
imageView.setOnClickListener(view -> {
Post post = getItem(getAdapterPosition());
@ -2123,61 +2134,61 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView
}
}
class PostImageAndGifAutoplayTypeViewHolder extends PostBaseViewHolder {
@BindView(R.id.card_view_item_post_image_type)
class PostImageAndGifAutoplayViewHolder extends PostBaseViewHolder {
@BindView(R.id.card_view_item_post_image_and_gif_autoplay)
MaterialCardView cardView;
@BindView(R.id.icon_gif_image_view_item_post_image_type)
@BindView(R.id.icon_gif_image_view_item_post_image_and_gif_autoplay)
AspectRatioGifImageView iconGifImageView;
@BindView(R.id.subreddit_name_text_view_item_post_image_type)
@BindView(R.id.subreddit_name_text_view_item_post_image_and_gif_autoplay)
TextView subredditTextView;
@BindView(R.id.user_text_view_item_post_image_type)
@BindView(R.id.user_text_view_item_post_image_and_gif_autoplay)
TextView userTextView;
@BindView(R.id.stickied_post_image_view_item_post_image_type)
@BindView(R.id.stickied_post_image_view_item_post_image_and_gif_autoplay)
ImageView stickiedPostImageView;
@BindView(R.id.post_time_text_view_best_item_post_image_type)
@BindView(R.id.post_time_text_view_item_post_image_and_gif_autoplay)
TextView postTimeTextView;
@BindView(R.id.title_text_view_best_item_post_image_type)
@BindView(R.id.title_text_view_item_post_image_and_gif_autoplay)
TextView titleTextView;
@BindView(R.id.type_text_view_item_post_image_type)
@BindView(R.id.type_text_view_item_post_image_and_gif_autoplay)
CustomTextView typeTextView;
@BindView(R.id.archived_image_view_item_post_image_type)
@BindView(R.id.archived_image_view_item_post_image_and_gif_autoplay)
ImageView archivedImageView;
@BindView(R.id.locked_image_view_item_post_image_type)
@BindView(R.id.locked_image_view_item_post_image_and_gif_autoplay)
ImageView lockedImageView;
@BindView(R.id.crosspost_image_view_item_post_image_type)
@BindView(R.id.crosspost_image_view_item_post_image_and_gif_autoplay)
ImageView crosspostImageView;
@BindView(R.id.nsfw_text_view_item_post_image_type)
@BindView(R.id.nsfw_text_view_item_post_image_and_gif_autoplay)
CustomTextView nsfwTextView;
@BindView(R.id.spoiler_custom_text_view_item_post_image_type)
@BindView(R.id.spoiler_custom_text_view_item_post_image_and_gif_autoplay)
CustomTextView spoilerTextView;
@BindView(R.id.flair_custom_text_view_item_post_image_type)
@BindView(R.id.flair_custom_text_view_item_post_image_and_gif_autoplay)
CustomTextView flairTextView;
@BindView(R.id.awards_text_view_item_post_image_type)
@BindView(R.id.awards_text_view_item_post_image_and_gif_autoplay)
CustomTextView awardsTextView;
@BindView(R.id.image_view_wrapper_item_post_image_type)
RelativeLayout relativeLayout;
@BindView(R.id.progress_bar_item_post_image_type)
@BindView(R.id.progress_bar_item_post_image_and_gif_autoplay)
ProgressBar progressBar;
@BindView(R.id.image_view_best_post_item)
@BindView(R.id.image_view_item_post_image_and_gif_autoplay)
AspectRatioGifImageView imageView;
@BindView(R.id.load_image_error_relative_layout_item_post_image_type)
@BindView(R.id.load_image_error_relative_layout_item_post_image_and_gif_autoplay)
RelativeLayout errorRelativeLayout;
@BindView(R.id.bottom_constraint_layout_item_post_image_type)
@BindView(R.id.load_image_error_text_view_item_post_image_and_gif_autoplay)
TextView errorTextView;
@BindView(R.id.bottom_constraint_layout_item_post_image_and_gif_autoplay)
ConstraintLayout bottomConstraintLayout;
@BindView(R.id.plus_button_item_post_image_type)
@BindView(R.id.plus_button_item_post_image_and_gif_autoplay)
ImageView upvoteButton;
@BindView(R.id.score_text_view_item_post_image_type)
@BindView(R.id.score_text_view_item_post_image_and_gif_autoplay)
TextView scoreTextView;
@BindView(R.id.minus_button_item_post_image_type)
@BindView(R.id.minus_button_item_post_image_and_gif_autoplay)
ImageView downvoteButton;
@BindView(R.id.comments_count_item_post_image_type)
@BindView(R.id.comments_count_item_post_image_and_gif_autoplay)
TextView commentsCountTextView;
@BindView(R.id.save_button_item_post_image_type)
@BindView(R.id.save_button_item_post_image_and_gif_autoplay)
ImageView saveButton;
@BindView(R.id.share_button_item_post_image_type)
@BindView(R.id.share_button_item_post_image_and_gif_autoplay)
ImageView shareButton;
PostImageAndGifAutoplayTypeViewHolder(View itemView) {
PostImageAndGifAutoplayViewHolder(View itemView) {
super(itemView);
ButterKnife.bind(this, itemView);
setBaseView(cardView,
@ -2204,6 +2215,7 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView
shareButton);
progressBar.setIndeterminateTintList(ColorStateList.valueOf(mColorAccent));
errorTextView.setTextColor(mPrimaryTextColor);
imageView.setOnClickListener(view -> {
Post post = getItem(getAdapterPosition());
@ -2220,59 +2232,59 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView
}
class PostLinkTypeViewHolder extends PostBaseViewHolder {
@BindView(R.id.card_view_item_post_link_type)
@BindView(R.id.card_view_item_post_link)
MaterialCardView cardView;
@BindView(R.id.icon_gif_image_view_item_post_link_type)
@BindView(R.id.icon_gif_image_view_item_post_link)
AspectRatioGifImageView iconGifImageView;
@BindView(R.id.subreddit_name_text_view_item_post_link_type)
@BindView(R.id.subreddit_name_text_view_item_post_link)
TextView subredditTextView;
@BindView(R.id.user_text_view_item_post_link_type)
@BindView(R.id.user_text_view_item_post_link)
TextView userTextView;
@BindView(R.id.stickied_post_image_view_item_post_link_type)
@BindView(R.id.stickied_post_image_view_item_post_link)
ImageView stickiedPostImageView;
@BindView(R.id.post_time_text_view_best_item_post_link_type)
@BindView(R.id.post_time_text_view_item_post_link)
TextView postTimeTextView;
@BindView(R.id.title_text_view_best_item_post_link_type)
@BindView(R.id.title_text_view_item_post_link)
TextView titleTextView;
@BindView(R.id.type_text_view_item_post_link_type)
@BindView(R.id.type_text_view_item_post_link)
CustomTextView typeTextView;
@BindView(R.id.archived_image_view_item_post_link_type)
@BindView(R.id.archived_image_view_item_post_link)
ImageView archivedImageView;
@BindView(R.id.locked_image_view_item_post_link_type)
@BindView(R.id.locked_image_view_item_post_link)
ImageView lockedImageView;
@BindView(R.id.crosspost_image_view_item_post_link_type)
@BindView(R.id.crosspost_image_view_item_post_link)
ImageView crosspostImageView;
@BindView(R.id.nsfw_text_view_item_post_link_type)
@BindView(R.id.nsfw_text_view_item_post_link)
CustomTextView nsfwTextView;
@BindView(R.id.spoiler_custom_text_view_item_post_link_type)
@BindView(R.id.spoiler_custom_text_view_item_post_link)
CustomTextView spoilerTextView;
@BindView(R.id.flair_custom_text_view_item_post_link_type)
@BindView(R.id.flair_custom_text_view_item_post_link)
CustomTextView flairTextView;
@BindView(R.id.awards_text_view_item_post_link_type)
@BindView(R.id.awards_text_view_item_post_link)
CustomTextView awardsTextView;
@BindView(R.id.link_text_view_item_post_link_type)
@BindView(R.id.link_text_view_item_post_link)
TextView linkTextView;
@BindView(R.id.image_view_wrapper_item_post_link_type)
RelativeLayout relativeLayout;
@BindView(R.id.progress_bar_item_post_link_type)
@BindView(R.id.progress_bar_item_post_link)
ProgressBar progressBar;
@BindView(R.id.image_view_best_post_item)
@BindView(R.id.image_view_item_post_link)
AspectRatioGifImageView imageView;
@BindView(R.id.load_image_error_relative_layout_item_post_link_type)
@BindView(R.id.load_image_error_relative_layout_item_post_link)
RelativeLayout errorRelativeLayout;
@BindView(R.id.bottom_constraint_layout_item_post_link_type)
@BindView(R.id.load_image_error_text_view_item_post_link)
TextView errorTextView;
@BindView(R.id.bottom_constraint_layout_item_post_link)
ConstraintLayout bottomConstraintLayout;
@BindView(R.id.plus_button_item_post_link_type)
@BindView(R.id.plus_button_item_post_link)
ImageView upvoteButton;
@BindView(R.id.score_text_view_item_post_link_type)
@BindView(R.id.score_text_view_item_post_link)
TextView scoreTextView;
@BindView(R.id.minus_button_item_post_link_type)
@BindView(R.id.minus_button_item_post_link)
ImageView downvoteButton;
@BindView(R.id.comments_count_item_post_link_type)
@BindView(R.id.comments_count_item_post_link)
TextView commentsCountTextView;
@BindView(R.id.save_button_item_post_link_type)
@BindView(R.id.save_button_item_post_link)
ImageView saveButton;
@BindView(R.id.share_button_item_post_link_type)
@BindView(R.id.share_button_item_post_link)
ImageView shareButton;
PostLinkTypeViewHolder(View itemView) {
@ -2303,6 +2315,7 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView
linkTextView.setTextColor(mSecondaryTextColor);
progressBar.setIndeterminateTintList(ColorStateList.valueOf(mColorAccent));
errorTextView.setTextColor(mPrimaryTextColor);
imageView.setOnClickListener(view -> {
Post post = getItem(getAdapterPosition());
@ -2331,9 +2344,9 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView
TextView userTextView;
@BindView(R.id.stickied_post_image_view_item_post_no_preview_link_type)
ImageView stickiedPostImageView;
@BindView(R.id.post_time_text_view_best_item_post_no_preview_link_type)
@BindView(R.id.post_time_text_view_item_post_no_preview_link_type)
TextView postTimeTextView;
@BindView(R.id.title_text_view_best_item_post_no_preview_link_type)
@BindView(R.id.title_text_view_item_post_no_preview_link_type)
TextView titleTextView;
@BindView(R.id.type_text_view_item_post_no_preview_link_type)
CustomTextView typeTextView;
@ -2426,9 +2439,9 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView
TextView userTextView;
@BindView(R.id.stickied_post_image_view_item_post_text_type)
ImageView stickiedPostImageView;
@BindView(R.id.post_time_text_view_best_item_post_text_type)
@BindView(R.id.post_time_text_view_item_post_text_type)
TextView postTimeTextView;
@BindView(R.id.title_text_view_best_item_post_text_type)
@BindView(R.id.title_text_view_item_post_text_type)
TextView titleTextView;
@BindView(R.id.type_text_view_item_post_text_type)
CustomTextView typeTextView;
@ -2500,9 +2513,9 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView
TextView nameTextView;
@BindView(R.id.stickied_post_image_view_item_post_compact)
ImageView stickiedPostImageView;
@BindView(R.id.post_time_text_view_best_item_post_compact)
@BindView(R.id.post_time_text_view_item_post_compact)
TextView postTimeTextView;
@BindView(R.id.title_text_view_best_item_post_compact)
@BindView(R.id.title_text_view_item_post_compact)
TextView titleTextView;
@BindView(R.id.type_text_view_item_post_compact)
CustomTextView typeTextView;
@ -2526,7 +2539,7 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView
RelativeLayout relativeLayout;
@BindView(R.id.progress_bar_item_post_compact)
ProgressBar progressBar;
@BindView(R.id.image_view_best_post_item)
@BindView(R.id.image_view_item_post_compact)
ImageView imageView;
@BindView(R.id.play_button_image_view_item_post_compact)
ImageView playButtonImageView;

View File

@ -51,6 +51,7 @@ import ml.docilealligator.infinityforreddit.Fragment.SubscribedSubredditsListing
import ml.docilealligator.infinityforreddit.Fragment.UserListingFragment;
import ml.docilealligator.infinityforreddit.Service.SubmitPostService;
import ml.docilealligator.infinityforreddit.Settings.AdvancedPreferenceFragment;
import ml.docilealligator.infinityforreddit.Settings.CustomizeMainPageTabsFragment;
import ml.docilealligator.infinityforreddit.Settings.GesturesAndButtonsPreferenceFragment;
import ml.docilealligator.infinityforreddit.Settings.MainPreferenceFragment;
import ml.docilealligator.infinityforreddit.Settings.NotificationPreferenceFragment;
@ -164,4 +165,6 @@ public interface AppComponent {
void inject(SelectedSubredditsActivity selectedSubredditsActivity);
void inject(ReportActivity reportActivity);
void inject(CustomizeMainPageTabsFragment customizeMainPageTabsFragment);
}

View File

@ -674,6 +674,11 @@ public class PostFragment extends Fragment implements FragmentCommunicator {
return false;
}
if (mAdapter != null && mAdapter.isAutoplay()) {
mAdapter.setAutoplay(false);
refreshAdapter();
}
isInLazyMode = true;
isLazyModePaused = false;
@ -688,6 +693,14 @@ public class PostFragment extends Fragment implements FragmentCommunicator {
@Override
public void stopLazyMode() {
if (mAdapter != null) {
String autoplayString = mSharedPreferences.getString(SharedPreferencesUtils.VIDEO_AUTOPLAY, SharedPreferencesUtils.VIDEO_AUTOPLAY_VALUE_NEVER);
if (autoplayString.equals(SharedPreferencesUtils.VIDEO_AUTOPLAY_VALUE_ALWAYS_ON) ||
(autoplayString.equals(SharedPreferencesUtils.VIDEO_AUTOPLAY_VALUE_ON_WIFI) && Utils.isConnectedToWifi(activity))) {
mAdapter.setAutoplay(true);
refreshAdapter();
}
}
isInLazyMode = false;
isLazyModePaused = false;
lazyModeRunnable.resetOldPosition();
@ -700,6 +713,10 @@ public class PostFragment extends Fragment implements FragmentCommunicator {
@Override
public void resumeLazyMode(boolean resumeNow) {
if (isInLazyMode) {
if (mAdapter != null && mAdapter.isAutoplay()) {
mAdapter.setAutoplay(false);
refreshAdapter();
}
isLazyModePaused = false;
window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);

View File

@ -0,0 +1,174 @@
package ml.docilealligator.infinityforreddit.Settings;
import android.content.Context;
import android.content.SharedPreferences;
import android.os.Bundle;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.preference.EditTextPreference;
import androidx.preference.ListPreference;
import androidx.preference.PreferenceFragmentCompat;
import javax.inject.Inject;
import javax.inject.Named;
import ml.docilealligator.infinityforreddit.Activity.SettingsActivity;
import ml.docilealligator.infinityforreddit.CustomTheme.CustomThemeWrapper;
import ml.docilealligator.infinityforreddit.Infinity;
import ml.docilealligator.infinityforreddit.R;
import ml.docilealligator.infinityforreddit.Utils.SharedPreferencesUtils;
/**
* A simple {@link Fragment} subclass.
*/
public class CustomizeMainPageTabsFragment extends PreferenceFragmentCompat {
@Inject
@Named("default")
SharedPreferences mSharedPreferences;
@Inject
CustomThemeWrapper customThemeWrapper;
private SettingsActivity activity;
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}
@Override
public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
setPreferencesFromResource(R.xml.customize_main_page_tabs_preferences, rootKey);
((Infinity) activity.getApplication()).getAppComponent().inject(this);
EditTextPreference tab1TitlePreference = findPreference(SharedPreferencesUtils.MAIN_PAGE_TAB_1_TITLE);
EditTextPreference tab2TitlePreference = findPreference(SharedPreferencesUtils.MAIN_PAGE_TAB_2_TITLE);
EditTextPreference tab3TitlePreference = findPreference(SharedPreferencesUtils.MAIN_PAGE_TAB_3_TITLE);
ListPreference tab1PostTypePreference = findPreference(SharedPreferencesUtils.MAIN_PAGE_TAB_1_POST_TYPE);
ListPreference tab2PostTypePreference = findPreference(SharedPreferencesUtils.MAIN_PAGE_TAB_2_POST_TYPE);
ListPreference tab3PostTypePreference = findPreference(SharedPreferencesUtils.MAIN_PAGE_TAB_3_POST_TYPE);
EditTextPreference tab1NamePreference = findPreference(SharedPreferencesUtils.MAIN_PAGE_TAB_1_NAME);
EditTextPreference tab2NamePreference = findPreference(SharedPreferencesUtils.MAIN_PAGE_TAB_2_NAME);
EditTextPreference tab3NamePreference = findPreference(SharedPreferencesUtils.MAIN_PAGE_TAB_3_NAME);
if (tab1TitlePreference != null && tab1PostTypePreference != null && tab1NamePreference != null) {
String postType = mSharedPreferences.getString(SharedPreferencesUtils.MAIN_PAGE_TAB_1_POST_TYPE,
SharedPreferencesUtils.MAIN_PAGE_TAB_POST_TYPE_HOME);
if (SharedPreferencesUtils.MAIN_PAGE_TAB_POST_TYPE_SUBREDDIT.equals(postType)) {
tab1NamePreference.setVisible(true);
tab1NamePreference.setTitle(R.string.settings_tab_subreddit_name);
} else if (SharedPreferencesUtils.MAIN_PAGE_TAB_POST_TYPE_MULTIREDDIT.equals(postType)) {
tab1NamePreference.setVisible(true);
tab1NamePreference.setTitle(R.string.settings_tab_multi_reddit_name);
} else if (SharedPreferencesUtils.MAIN_PAGE_TAB_POST_TYPE_USER.equals(postType)) {
tab1NamePreference.setVisible(true);
tab1NamePreference.setTitle(R.string.settings_tab_username);
}
tab1PostTypePreference.setOnPreferenceChangeListener((preference, newValue) -> {
switch ((String) newValue) {
case SharedPreferencesUtils.MAIN_PAGE_TAB_POST_TYPE_HOME:
case SharedPreferencesUtils.MAIN_PAGE_TAB_POST_TYPE_POPULAR:
case SharedPreferencesUtils.MAIN_PAGE_TAB_POST_TYPE_ALL:
tab1NamePreference.setVisible(false);
break;
case SharedPreferencesUtils.MAIN_PAGE_TAB_POST_TYPE_SUBREDDIT:
tab1NamePreference.setVisible(true);
tab1NamePreference.setTitle(R.string.settings_tab_subreddit_name);
break;
case SharedPreferencesUtils.MAIN_PAGE_TAB_POST_TYPE_MULTIREDDIT:
tab1NamePreference.setVisible(true);
tab1NamePreference.setTitle(R.string.settings_tab_multi_reddit_name);
break;
case SharedPreferencesUtils.MAIN_PAGE_TAB_POST_TYPE_USER:
tab1NamePreference.setVisible(true);
tab1NamePreference.setTitle(R.string.settings_tab_username);
}
return true;
});
}
if (tab2TitlePreference != null && tab2PostTypePreference != null && tab2NamePreference != null) {
String postType = mSharedPreferences.getString(SharedPreferencesUtils.MAIN_PAGE_TAB_2_POST_TYPE,
SharedPreferencesUtils.MAIN_PAGE_TAB_POST_TYPE_POPULAR);
if (SharedPreferencesUtils.MAIN_PAGE_TAB_POST_TYPE_SUBREDDIT.equals(postType)) {
tab2NamePreference.setVisible(true);
tab2NamePreference.setTitle(R.string.settings_tab_subreddit_name);
} else if (SharedPreferencesUtils.MAIN_PAGE_TAB_POST_TYPE_MULTIREDDIT.equals(postType)) {
tab2NamePreference.setVisible(true);
tab2NamePreference.setTitle(R.string.settings_tab_multi_reddit_name);
} else if (SharedPreferencesUtils.MAIN_PAGE_TAB_POST_TYPE_USER.equals(postType)) {
tab2NamePreference.setVisible(true);
tab2NamePreference.setTitle(R.string.settings_tab_username);
}
tab2PostTypePreference.setOnPreferenceChangeListener((preference, newValue) -> {
switch ((String) newValue) {
case SharedPreferencesUtils.MAIN_PAGE_TAB_POST_TYPE_HOME:
case SharedPreferencesUtils.MAIN_PAGE_TAB_POST_TYPE_POPULAR:
case SharedPreferencesUtils.MAIN_PAGE_TAB_POST_TYPE_ALL:
tab2NamePreference.setVisible(false);
break;
case SharedPreferencesUtils.MAIN_PAGE_TAB_POST_TYPE_SUBREDDIT:
tab2NamePreference.setVisible(true);
tab2NamePreference.setTitle(R.string.settings_tab_subreddit_name);
break;
case SharedPreferencesUtils.MAIN_PAGE_TAB_POST_TYPE_MULTIREDDIT:
tab2NamePreference.setVisible(true);
tab2NamePreference.setTitle(R.string.settings_tab_multi_reddit_name);
break;
case SharedPreferencesUtils.MAIN_PAGE_TAB_POST_TYPE_USER:
tab2NamePreference.setVisible(true);
tab2NamePreference.setTitle(R.string.settings_tab_username);
}
return true;
});
}
if (tab3TitlePreference != null && tab3PostTypePreference != null && tab3NamePreference != null) {
String postType = mSharedPreferences.getString(SharedPreferencesUtils.MAIN_PAGE_TAB_3_POST_TYPE,
SharedPreferencesUtils.MAIN_PAGE_TAB_POST_TYPE_ALL);
if (SharedPreferencesUtils.MAIN_PAGE_TAB_POST_TYPE_SUBREDDIT.equals(postType)) {
tab3NamePreference.setVisible(true);
tab3NamePreference.setTitle(R.string.settings_tab_subreddit_name);
} else if (SharedPreferencesUtils.MAIN_PAGE_TAB_POST_TYPE_MULTIREDDIT.equals(postType)) {
tab3NamePreference.setVisible(true);
tab3NamePreference.setTitle(R.string.settings_tab_multi_reddit_name);
} else if (SharedPreferencesUtils.MAIN_PAGE_TAB_POST_TYPE_USER.equals(postType)) {
tab3NamePreference.setVisible(true);
tab3NamePreference.setTitle(R.string.settings_tab_username);
}
tab3PostTypePreference.setOnPreferenceChangeListener((preference, newValue) -> {
switch ((String) newValue) {
case SharedPreferencesUtils.MAIN_PAGE_TAB_POST_TYPE_HOME:
case SharedPreferencesUtils.MAIN_PAGE_TAB_POST_TYPE_POPULAR:
case SharedPreferencesUtils.MAIN_PAGE_TAB_POST_TYPE_ALL:
tab3NamePreference.setVisible(false);
break;
case SharedPreferencesUtils.MAIN_PAGE_TAB_POST_TYPE_SUBREDDIT:
tab3NamePreference.setVisible(true);
tab3NamePreference.setTitle(R.string.settings_tab_subreddit_name);
break;
case SharedPreferencesUtils.MAIN_PAGE_TAB_POST_TYPE_MULTIREDDIT:
tab3NamePreference.setVisible(true);
tab3NamePreference.setTitle(R.string.settings_tab_multi_reddit_name);
break;
case SharedPreferencesUtils.MAIN_PAGE_TAB_POST_TYPE_USER:
tab3NamePreference.setVisible(true);
tab3NamePreference.setTitle(R.string.settings_tab_username);
}
return true;
});
}
}
@Override
public void onAttach(@NonNull Context context) {
super.onAttach(context);
activity = (SettingsActivity) context;
}
}

View File

@ -81,6 +81,7 @@ public class SharedPreferencesUtils {
public static final String VIDEO_AUTOPLAY_VALUE_ON_WIFI = "1";
public static final String VIDEO_AUTOPLAY_VALUE_NEVER = "0";
public static final String LOCK_JUMP_TO_NEXT_TOP_LEVEL_COMMENT_BUTTON = "lock_jump_to_next_top_level_comment_button";
public static final String SWAP_TAP_AND_LONG_COMMENTS = "swap_tap_and_long_in_comments";
public static final String SWIPE_UP_TO_HIDE_JUMP_TO_NEXT_TOP_LEVEL_COMMENT_BUTTON = "swipe_up_to_hide_jump_to_next_top_level_comments_button";
public static final String SHOW_TOP_LEVEL_COMMENTS_FIRST = "show_top_level_comments_first";
public static final String CONFIRM_TO_EXIT = "confirm_to_exit";
@ -99,4 +100,19 @@ public class SharedPreferencesUtils {
public static final String DELETE_ALL_POST_LAYOUT_DATA_IN_DATABASE = "delete_all_post_layout_data_in_database";
public static final String DELETE_ALL_THEMES_IN_DATABASE = "delete_all_themes_in_database";
public static final String RESET_ALL_SETTINGS = "reset_all_settings";
public static final String MAIN_PAGE_TAB_1_TITLE = "main_page_tab_1_title";
public static final String MAIN_PAGE_TAB_2_TITLE = "main_page_tab_2_title";
public static final String MAIN_PAGE_TAB_3_TITLE = "main_page_tab_3_title";
public static final String MAIN_PAGE_TAB_1_POST_TYPE = "main_page_tab_1_post_type";
public static final String MAIN_PAGE_TAB_2_POST_TYPE = "main_page_tab_2_post_type";
public static final String MAIN_PAGE_TAB_3_POST_TYPE = "main_page_tab_3_post_type";
public static final String MAIN_PAGE_TAB_1_NAME = "main_page_tab_1_name";
public static final String MAIN_PAGE_TAB_2_NAME = "main_page_tab_2_name";
public static final String MAIN_PAGE_TAB_3_NAME = "main_page_tab_3_name";
public static final String MAIN_PAGE_TAB_POST_TYPE_HOME = "0";
public static final String MAIN_PAGE_TAB_POST_TYPE_POPULAR = "1";
public static final String MAIN_PAGE_TAB_POST_TYPE_ALL = "2";
public static final String MAIN_PAGE_TAB_POST_TYPE_SUBREDDIT = "3";
public static final String MAIN_PAGE_TAB_POST_TYPE_MULTIREDDIT = "4";
public static final String MAIN_PAGE_TAB_POST_TYPE_USER = "5";
}

View File

@ -37,7 +37,7 @@
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<androidx.recyclerview.widget.RecyclerView
<ml.docilealligator.infinityforreddit.CustomView.CustomToroContainer
android:id="@+id/recycler_view_view_post_detail"
android:layout_width="match_parent"
android:layout_height="wrap_content"

View File

@ -1,361 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<com.google.android.material.card.MaterialCardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp"
android:id="@+id/card_view_item_post"
app:cardBackgroundColor="?attr/cardViewBackgroundColor"
app:cardElevation="2dp"
app:cardCornerRadius="16dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="16dp">
<ml.docilealligator.infinityforreddit.CustomView.AspectRatioGifImageView
android:id="@+id/icon_gif_image_view_item_post"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_gravity="center"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"/>
<TextView
android:id="@+id/subreddit_name_text_view_item_post"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginStart="16dp"
android:layout_marginEnd="8dp"
android:textSize="?attr/font_default"
app:layout_constraintBottom_toTopOf="@id/user_text_view_item_post"
app:layout_constraintStart_toEndOf="@id/icon_gif_image_view_item_post"
app:layout_constraintEnd_toStartOf="@id/stickied_post_image_view_item_post"
app:layout_constraintTop_toTopOf="parent"/>
<TextView
android:id="@+id/user_text_view_item_post"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginEnd="8dp"
android:textSize="?attr/font_default"
android:maxLines="2"
android:ellipsize="end"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@+id/icon_gif_image_view_item_post"
app:layout_constraintEnd_toStartOf="@id/stickied_post_image_view_item_post"
app:layout_constraintTop_toBottomOf="@+id/subreddit_name_text_view_item_post"
app:layout_constraintHorizontal_bias="0" />
<ImageView
android:id="@+id/stickied_post_image_view_item_post"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginEnd="8dp"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/subreddit_name_text_view_item_post"
app:layout_constraintEnd_toStartOf="@+id/guideline2"
app:layout_constraintTop_toTopOf="parent"/>
<TextView
android:id="@+id/post_time_text_view_best_item_post"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:gravity="end"
android:textSize="?attr/font_default"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/guideline2"
app:layout_constraintTop_toTopOf="parent" />
<androidx.constraintlayout.widget.Guideline
android:id="@+id/guideline2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.6" />
</androidx.constraintlayout.widget.ConstraintLayout>
<TextView
android:id="@+id/title_text_view_best_item_post"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingStart="16dp"
android:paddingEnd="16dp"
android:textSize="?attr/title_font_18" />
<TextView
android:id="@+id/content_text_view_item_post"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:paddingStart="16dp"
android:paddingEnd="16dp"
android:maxLines="4"
android:visibility="gone"
android:textSize="?attr/content_font_default"
android:ellipsize="end" />
<com.nex3z.flowlayout.FlowLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="16dp"
app:flChildSpacing="16dp"
app:flChildSpacingForLastRow="align"
app:flRowSpacing="8dp">
<com.libRG.CustomTextView
android:id="@+id/type_text_view_item_post"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="4dp"
android:textSize="?attr/font_12"
app:lib_setRadius="3dp"
app:lib_setRoundedView="true"
app:lib_setShape="rectangle" />
<com.libRG.CustomTextView
android:id="@+id/spoiler_custom_text_view_item_post"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="@string/spoiler"
android:textSize="?attr/font_12"
android:padding="4dp"
android:visibility="gone"
app:lib_setRadius="3dp"
app:lib_setRoundedView="true"
app:lib_setShape="rectangle" />
<com.libRG.CustomTextView
android:id="@+id/nsfw_text_view_item_post"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="4dp"
android:text="@string/nsfw"
android:textSize="?attr/font_12"
android:visibility="gone"
app:lib_setRadius="3dp"
app:lib_setRoundedView="true"
app:lib_setShape="rectangle" />
<com.libRG.CustomTextView
android:id="@+id/flair_custom_text_view_item_post"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:textSize="?attr/font_12"
android:padding="4dp"
android:visibility="gone"
app:lib_setRadius="3dp"
app:lib_setRoundedView="true"
app:lib_setShape="rectangle" />
<com.libRG.CustomTextView
android:id="@+id/awards_text_view_item_post"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="4dp"
android:textSize="?attr/font_12"
android:visibility="gone"
app:lib_setRadius="3dp"
app:lib_setRoundedView="true"
app:lib_setShape="rectangle" />
<ImageView
android:id="@+id/archived_image_view_item_post"
android:layout_width="24dp"
android:layout_height="24dp"
android:src="@drawable/ic_archive_outline"
android:visibility="gone" />
<ImageView
android:id="@+id/locked_image_view_item_post"
android:layout_width="24dp"
android:layout_height="24dp"
android:src="@drawable/ic_outline_lock_24dp"
android:visibility="gone" />
<ImageView
android:id="@+id/crosspost_image_view_item_post"
android:layout_width="24dp"
android:layout_height="24dp"
android:src="@drawable/crosspost"
android:visibility="gone" />
</com.nex3z.flowlayout.FlowLayout>
<TextView
android:id="@+id/link_text_view_item_post"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="16dp"
android:paddingStart="16dp"
android:paddingEnd="16dp"
android:textSize="?attr/font_12"
android:visibility="gone" />
<RelativeLayout
android:id="@+id/image_view_wrapper_item_post"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ml.docilealligator.infinityforreddit.CustomView.AspectRatioGifImageView
android:id="@+id/image_view_best_post_item"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:scaleType="fitStart" />
<ImageView
android:id="@+id/play_button_image_view_item_post"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="16dp"
android:layout_gravity="start"
android:background="@drawable/play_button_round_background"
android:src="@drawable/ic_play_circle_36dp"
android:visibility="gone" />
</FrameLayout>
<ProgressBar
android:id="@+id/progress_bar_item_post"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true" />
<RelativeLayout
android:id="@+id/load_image_error_relative_layout_item_post"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerInParent="true"
android:visibility="gone">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawableTop="@drawable/ic_error_outline_black_24dp"
android:layout_gravity="center"
android:gravity="center"
android:text="@string/error_loading_image_tap_to_retry"
android:textSize="?attr/font_default" />
</RelativeLayout>
</RelativeLayout>
<ImageView
android:id="@+id/image_view_no_preview_link_item_post"
android:layout_width="match_parent"
android:layout_height="150dp"
android:scaleType="center"
android:src="@drawable/ic_link"
android:tint="@android:color/tab_indicator_text"
android:visibility="gone"/>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/bottom_constraint_layout_item_post"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/plus_button_item_post"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="12dp"
android:src="@drawable/ic_arrow_upward_grey_24dp"
android:background="?actionBarItemBackground"
android:clickable="true"
android:focusable="true"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent" />
<TextView
android:id="@+id/score_text_view_item_post"
android:layout_width="64dp"
android:layout_height="wrap_content"
android:gravity="center"
android:textSize="?attr/font_12"
android:textStyle="bold"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/plus_button_item_post" />
<ImageView
android:id="@+id/minus_button_item_post"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="12dp"
android:src="@drawable/ic_arrow_downward_grey_24dp"
android:background="?actionBarItemBackground"
android:clickable="true"
android:focusable="true"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/score_text_view_item_post" />
<TextView
android:id="@+id/comments_count_item_post"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="12dp"
android:gravity="center_vertical"
android:textSize="?attr/font_12"
android:textStyle="bold"
android:drawableStart="@drawable/ic_comment_grey_24dp"
android:drawablePadding="12dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/minus_button_item_post" />
<ImageView
android:id="@+id/save_button_item_post"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="12dp"
android:background="?actionBarItemBackground"
android:clickable="true"
android:focusable="true"
app:layout_constraintHorizontal_bias="1"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/comments_count_item_post"
app:layout_constraintEnd_toStartOf="@id/share_button_item_post" />
<ImageView
android:id="@+id/share_button_item_post"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="12dp"
android:src="@drawable/ic_share_grey_24dp"
android:background="?actionBarItemBackground"
android:clickable="true"
android:focusable="true"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>
</com.google.android.material.card.MaterialCardView>

View File

@ -54,7 +54,7 @@
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/post_time_text_view_best_item_post_compact"
android:id="@+id/post_time_text_view_item_post_compact"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:gravity="end"
@ -78,7 +78,7 @@
android:layout_height="wrap_content">
<TextView
android:id="@+id/title_text_view_best_item_post_compact"
android:id="@+id/title_text_view_item_post_compact"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:paddingStart="16dp"
@ -98,7 +98,7 @@
android:paddingBottom="8dp"
android:paddingStart="16dp"
android:paddingEnd="16dp"
app:layout_constraintTop_toBottomOf="@id/title_text_view_best_item_post_compact"
app:layout_constraintTop_toBottomOf="@id/title_text_view_item_post_compact"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toStartOf="@id/barrier2"
app:layout_constraintBottom_toTopOf="@id/link_text_view_item_post_compact"
@ -220,7 +220,7 @@
android:layout_height="match_parent">
<ImageView
android:id="@+id/image_view_best_post_item"
android:id="@+id/image_view_item_post_compact"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="center" />

View File

@ -0,0 +1,317 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="?attr/cardViewBackgroundColor">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/constraint_layout_item_post_detail_image_and_gif_autoplay"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="16dp">
<ml.docilealligator.infinityforreddit.CustomView.AspectRatioGifImageView
android:id="@+id/icon_gif_image_view_item_post_detail_image_and_gif_autoplay"
android:layout_width="24dp"
android:layout_height="24dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/subreddit_text_view_item_post_detail_image_and_gif_autoplay"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginEnd="8dp"
android:textSize="?attr/font_default"
android:maxLines="2"
android:ellipsize="end"
app:layout_constraintStart_toEndOf="@+id/icon_gif_image_view_item_post_detail_image_and_gif_autoplay"
app:layout_constraintEnd_toStartOf="@id/guideline"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintHorizontal_bias="0" />
<TextView
android:id="@+id/user_text_view_item_post_detail_image_and_gif_autoplay"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginEnd="8dp"
android:textSize="?attr/font_default"
android:maxLines="2"
android:ellipsize="end"
app:layout_constraintBottom_toTopOf="@+id/author_flair_text_view_item_post_detail_image_and_gif_autoplay"
app:layout_constraintStart_toEndOf="@+id/icon_gif_image_view_item_post_detail_image_and_gif_autoplay"
app:layout_constraintEnd_toStartOf="@id/guideline"
app:layout_constraintTop_toBottomOf="@+id/subreddit_text_view_item_post_detail_image_and_gif_autoplay"
app:layout_constraintHorizontal_bias="0" />
<TextView
android:id="@+id/author_flair_text_view_item_post_detail_image_and_gif_autoplay"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginEnd="8dp"
android:textSize="?attr/font_12"
android:maxLines="2"
android:ellipsize="end"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@+id/icon_gif_image_view_item_post_detail_image_and_gif_autoplay"
app:layout_constraintEnd_toStartOf="@id/guideline"
app:layout_constraintTop_toBottomOf="@+id/user_text_view_item_post_detail_image_and_gif_autoplay"
app:layout_constraintHorizontal_bias="0" />
<TextView
android:id="@+id/post_time_text_view_item_post_detail_image_and_gif_autoplay"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:gravity="end"
android:textSize="?attr/font_default"
app:layout_constraintHorizontal_bias="1"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/guideline"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<androidx.constraintlayout.widget.Guideline
android:id="@+id/guideline"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.6" />
</androidx.constraintlayout.widget.ConstraintLayout>
<TextView
android:id="@+id/title_text_view_item_post_detail_image_and_gif_autoplay"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingStart="16dp"
android:paddingEnd="16dp"
android:textColor="?attr/primaryTextColor"
android:textSize="?attr/title_font_18"
android:textIsSelectable="true"
android:enabled="true"
android:focusable="true"
android:longClickable="true" />
<com.nex3z.flowlayout.FlowLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="16dp"
app:flChildSpacing="16dp"
app:flChildSpacingForLastRow="align"
app:flRowSpacing="8dp">
<com.libRG.CustomTextView
android:id="@+id/type_text_view_item_post_detail_image_and_gif_autoplay"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="4dp"
android:textSize="?attr/font_12"
android:textColor="@android:color/white"
app:lib_setRadius="3dp"
app:lib_setRoundedView="true"
app:lib_setShape="rectangle" />
<com.libRG.CustomTextView
android:id="@+id/spoiler_custom_text_view_item_post_detail_image_and_gif_autoplay"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="@string/spoiler"
android:textSize="?attr/font_12"
android:textColor="@android:color/white"
android:padding="4dp"
android:visibility="gone"
app:lib_setRadius="3dp"
app:lib_setRoundedView="true"
app:lib_setShape="rectangle" />
<com.libRG.CustomTextView
android:id="@+id/nsfw_text_view_item_post_detail_image_and_gif_autoplay"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="4dp"
android:text="@string/nsfw"
android:textSize="?attr/font_12"
android:textColor="@android:color/white"
android:visibility="gone"
app:lib_setRadius="3dp"
app:lib_setRoundedView="true"
app:lib_setShape="rectangle" />
<com.libRG.CustomTextView
android:id="@+id/flair_custom_text_view_item_post_detail_image_and_gif_autoplay"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:padding="4dp"
android:textSize="?attr/font_12"
android:textColor="@android:color/white"
android:visibility="gone"
app:lib_setRadius="3dp"
app:lib_setRoundedView="true"
app:lib_setShape="rectangle" />
<ImageView
android:id="@+id/archived_image_view_item_post_detail_image_and_gif_autoplay"
android:layout_width="20dp"
android:layout_height="20dp"
android:src="@drawable/ic_archive_outline"
android:visibility="gone" />
<ImageView
android:id="@+id/locked_image_view_item_post_detail_image_and_gif_autoplay"
android:layout_width="20dp"
android:layout_height="20dp"
android:src="@drawable/ic_outline_lock_24dp"
android:visibility="gone" />
<ImageView
android:id="@+id/crosspost_image_view_item_post_detail_image_and_gif_autoplay"
android:layout_width="20dp"
android:layout_height="20dp"
android:src="@drawable/crosspost"
android:visibility="gone" />
<TextView
android:id="@+id/awards_text_view_item_post_detail_image_and_gif_autoplay"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone" />
</com.nex3z.flowlayout.FlowLayout>
<RelativeLayout
android:id="@+id/image_view_wrapper_item_post_detail_image_and_gif_autoplay"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.santalu.aspectratioimageview.AspectRatioImageView
android:id="@+id/image_view_item_post_detail_image_and_gif_autoplay"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:scaleType="fitStart"/>
<RelativeLayout
android:id="@+id/load_wrapper_item_post_detail_image_and_gif_autoplay"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerInParent="true">
<ProgressBar
android:id="@+id/progress_bar_item_post_detail_image_and_gif_autoplay"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true" />
<TextView
android:id="@+id/load_image_error_text_view_item_post_detail_image_and_gif_autoplay"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawableTop="@drawable/ic_error_outline_black_24dp"
android:layout_centerInParent="true"
android:gravity="center"
android:text="@string/error_loading_image_tap_to_retry"
android:textSize="?attr/font_default"
android:visibility="gone" />
</RelativeLayout>
</RelativeLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/bottom_constraint_layout_item_post_detail_image_and_gif_autoplay">
<ImageView
android:id="@+id/plus_button_item_post_detail_image_and_gif_autoplay"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="12dp"
android:src="@drawable/ic_arrow_upward_grey_24dp"
android:tint="@android:color/tab_indicator_text"
android:background="?actionBarItemBackground"
android:clickable="true"
android:focusable="true"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent" />
<TextView
android:id="@+id/score_text_view_item_post_detail_image_and_gif_autoplay"
android:layout_width="64dp"
android:layout_height="wrap_content"
android:gravity="center"
android:textSize="?attr/font_12"
android:textStyle="bold"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/plus_button_item_post_detail_image_and_gif_autoplay" />
<ImageView
android:id="@+id/minus_button_item_post_detail_image_and_gif_autoplay"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="12dp"
android:src="@drawable/ic_arrow_downward_grey_24dp"
android:tint="@android:color/tab_indicator_text"
android:background="?actionBarItemBackground"
android:clickable="true"
android:focusable="true"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/score_text_view_item_post_detail_image_and_gif_autoplay" />
<TextView
android:id="@+id/comments_count_item_post_detail_image_and_gif_autoplay"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="12dp"
android:gravity="center_vertical"
android:textSize="?attr/font_12"
android:textStyle="bold"
android:drawableStart="@drawable/ic_comment_grey_24dp"
android:drawablePadding="12dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/minus_button_item_post_detail_image_and_gif_autoplay" />
<ImageView
android:id="@+id/save_button_item_post_detail_image_and_gif_autoplay"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="12dp"
android:tint="@android:color/tab_indicator_text"
android:background="?actionBarItemBackground"
android:clickable="true"
android:focusable="true"
app:layout_constraintHorizontal_bias="1"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/comments_count_item_post_detail_image_and_gif_autoplay"
app:layout_constraintEnd_toStartOf="@id/share_button_item_post_detail_image_and_gif_autoplay" />
<ImageView
android:id="@+id/share_button_item_post_detail_image_and_gif_autoplay"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="12dp"
android:src="@drawable/ic_share_grey_24dp"
android:background="?actionBarItemBackground"
android:clickable="true"
android:focusable="true"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>

View File

@ -0,0 +1,327 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="?attr/cardViewBackgroundColor">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/constraint_layout_item_post_detail_link"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="16dp">
<ml.docilealligator.infinityforreddit.CustomView.AspectRatioGifImageView
android:id="@+id/icon_gif_image_view_item_post_detail_link"
android:layout_width="24dp"
android:layout_height="24dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/subreddit_text_view_item_post_detail_link"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginEnd="8dp"
android:textSize="?attr/font_default"
android:maxLines="2"
android:ellipsize="end"
app:layout_constraintStart_toEndOf="@+id/icon_gif_image_view_item_post_detail_link"
app:layout_constraintEnd_toStartOf="@id/guideline"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintHorizontal_bias="0" />
<TextView
android:id="@+id/user_text_view_item_post_detail_link"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginEnd="8dp"
android:textSize="?attr/font_default"
android:maxLines="2"
android:ellipsize="end"
app:layout_constraintBottom_toTopOf="@+id/author_flair_text_view_item_post_detail_link"
app:layout_constraintStart_toEndOf="@+id/icon_gif_image_view_item_post_detail_link"
app:layout_constraintEnd_toStartOf="@id/guideline"
app:layout_constraintTop_toBottomOf="@+id/subreddit_text_view_item_post_detail_link"
app:layout_constraintHorizontal_bias="0" />
<TextView
android:id="@+id/author_flair_text_view_item_post_detail_link"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginEnd="8dp"
android:textSize="?attr/font_12"
android:maxLines="2"
android:ellipsize="end"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@+id/icon_gif_image_view_item_post_detail_link"
app:layout_constraintEnd_toStartOf="@id/guideline"
app:layout_constraintTop_toBottomOf="@+id/user_text_view_item_post_detail_link"
app:layout_constraintHorizontal_bias="0" />
<TextView
android:id="@+id/post_time_text_view_item_post_detail_link"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:gravity="end"
android:textSize="?attr/font_default"
app:layout_constraintHorizontal_bias="1"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/guideline"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<androidx.constraintlayout.widget.Guideline
android:id="@+id/guideline"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.6" />
</androidx.constraintlayout.widget.ConstraintLayout>
<TextView
android:id="@+id/title_text_view_item_post_detail_link"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingStart="16dp"
android:paddingEnd="16dp"
android:textColor="?attr/primaryTextColor"
android:textSize="?attr/title_font_18"
android:textIsSelectable="true"
android:enabled="true"
android:focusable="true"
android:longClickable="true" />
<com.nex3z.flowlayout.FlowLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="16dp"
app:flChildSpacing="16dp"
app:flChildSpacingForLastRow="align"
app:flRowSpacing="8dp">
<com.libRG.CustomTextView
android:id="@+id/type_text_view_item_post_detail_link"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="4dp"
android:text="@string/link"
android:textSize="?attr/font_12"
android:textColor="@android:color/white"
app:lib_setRadius="3dp"
app:lib_setRoundedView="true"
app:lib_setShape="rectangle" />
<com.libRG.CustomTextView
android:id="@+id/spoiler_custom_text_view_item_post_detail_link"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="@string/spoiler"
android:textSize="?attr/font_12"
android:textColor="@android:color/white"
android:padding="4dp"
android:visibility="gone"
app:lib_setRadius="3dp"
app:lib_setRoundedView="true"
app:lib_setShape="rectangle" />
<com.libRG.CustomTextView
android:id="@+id/nsfw_text_view_item_post_detail_link"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="4dp"
android:text="@string/nsfw"
android:textSize="?attr/font_12"
android:textColor="@android:color/white"
android:visibility="gone"
app:lib_setRadius="3dp"
app:lib_setRoundedView="true"
app:lib_setShape="rectangle" />
<com.libRG.CustomTextView
android:id="@+id/flair_custom_text_view_item_post_detail_link"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:padding="4dp"
android:textSize="?attr/font_12"
android:textColor="@android:color/white"
android:visibility="gone"
app:lib_setRadius="3dp"
app:lib_setRoundedView="true"
app:lib_setShape="rectangle" />
<ImageView
android:id="@+id/archived_image_view_item_post_detail_link"
android:layout_width="20dp"
android:layout_height="20dp"
android:src="@drawable/ic_archive_outline"
android:visibility="gone" />
<ImageView
android:id="@+id/locked_image_view_item_post_detail_link"
android:layout_width="20dp"
android:layout_height="20dp"
android:src="@drawable/ic_outline_lock_24dp"
android:visibility="gone" />
<ImageView
android:id="@+id/crosspost_image_view_item_post_detail_link"
android:layout_width="20dp"
android:layout_height="20dp"
android:src="@drawable/crosspost"
android:visibility="gone" />
<TextView
android:id="@+id/awards_text_view_item_post_detail_link"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone" />
</com.nex3z.flowlayout.FlowLayout>
<TextView
android:id="@+id/link_text_view_item_post_detail_link"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="16dp"
android:paddingStart="16dp"
android:paddingEnd="16dp"
android:textSize="?attr/font_12" />
<RelativeLayout
android:id="@+id/image_view_wrapper_item_post_detail_link"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.santalu.aspectratioimageview.AspectRatioImageView
android:id="@+id/image_view_item_post_detail_link"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:scaleType="fitStart"/>
<RelativeLayout
android:id="@+id/load_wrapper_item_post_detail_link"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerInParent="true">
<ProgressBar
android:id="@+id/progress_bar_item_post_detail_link"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true" />
<TextView
android:id="@+id/load_image_error_text_view_item_post_detail_link"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawableTop="@drawable/ic_error_outline_black_24dp"
android:layout_centerInParent="true"
android:gravity="center"
android:text="@string/error_loading_image_tap_to_retry"
android:textSize="?attr/font_default"
android:visibility="gone" />
</RelativeLayout>
</RelativeLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/bottom_constraint_layout_item_post_detail_link">
<ImageView
android:id="@+id/plus_button_item_post_detail_link"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="12dp"
android:src="@drawable/ic_arrow_upward_grey_24dp"
android:tint="@android:color/tab_indicator_text"
android:background="?actionBarItemBackground"
android:clickable="true"
android:focusable="true"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent" />
<TextView
android:id="@+id/score_text_view_item_post_detail_link"
android:layout_width="64dp"
android:layout_height="wrap_content"
android:gravity="center"
android:textSize="?attr/font_12"
android:textStyle="bold"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/plus_button_item_post_detail_link" />
<ImageView
android:id="@+id/minus_button_item_post_detail_link"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="12dp"
android:src="@drawable/ic_arrow_downward_grey_24dp"
android:tint="@android:color/tab_indicator_text"
android:background="?actionBarItemBackground"
android:clickable="true"
android:focusable="true"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/score_text_view_item_post_detail_link" />
<TextView
android:id="@+id/comments_count_item_post_detail_link"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="12dp"
android:gravity="center_vertical"
android:textSize="?attr/font_12"
android:textStyle="bold"
android:drawableStart="@drawable/ic_comment_grey_24dp"
android:drawablePadding="12dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/minus_button_item_post_detail_link" />
<ImageView
android:id="@+id/save_button_item_post_detail_link"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="12dp"
android:tint="@android:color/tab_indicator_text"
android:background="?actionBarItemBackground"
android:clickable="true"
android:focusable="true"
app:layout_constraintHorizontal_bias="1"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/comments_count_item_post_detail_link"
app:layout_constraintEnd_toStartOf="@id/share_button_item_post_detail_link" />
<ImageView
android:id="@+id/share_button_item_post_detail_link"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="12dp"
android:src="@drawable/ic_share_grey_24dp"
android:background="?actionBarItemBackground"
android:clickable="true"
android:focusable="true"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>

View File

@ -0,0 +1,305 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="?attr/cardViewBackgroundColor">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/constraint_layout_item_post_detail_no_preview_link"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="16dp">
<ml.docilealligator.infinityforreddit.CustomView.AspectRatioGifImageView
android:id="@+id/icon_gif_image_view_item_post_detail_no_preview_link"
android:layout_width="24dp"
android:layout_height="24dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/subreddit_text_view_item_post_detail_no_preview_link"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginEnd="8dp"
android:textSize="?attr/font_default"
android:maxLines="2"
android:ellipsize="end"
app:layout_constraintStart_toEndOf="@+id/icon_gif_image_view_item_post_detail_no_preview_link"
app:layout_constraintEnd_toStartOf="@id/guideline"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintHorizontal_bias="0" />
<TextView
android:id="@+id/user_text_view_item_post_detail_no_preview_link"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginEnd="8dp"
android:textSize="?attr/font_default"
android:maxLines="2"
android:ellipsize="end"
app:layout_constraintBottom_toTopOf="@+id/author_flair_text_view_item_post_detail_no_preview_link"
app:layout_constraintStart_toEndOf="@+id/icon_gif_image_view_item_post_detail_no_preview_link"
app:layout_constraintEnd_toStartOf="@id/guideline"
app:layout_constraintTop_toBottomOf="@+id/subreddit_text_view_item_post_detail_no_preview_link"
app:layout_constraintHorizontal_bias="0" />
<TextView
android:id="@+id/author_flair_text_view_item_post_detail_no_preview_link"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginEnd="8dp"
android:textSize="?attr/font_12"
android:maxLines="2"
android:ellipsize="end"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@+id/icon_gif_image_view_item_post_detail_no_preview_link"
app:layout_constraintEnd_toStartOf="@id/guideline"
app:layout_constraintTop_toBottomOf="@+id/user_text_view_item_post_detail_no_preview_link"
app:layout_constraintHorizontal_bias="0" />
<TextView
android:id="@+id/post_time_text_view_item_post_detail_no_preview_link"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:gravity="end"
android:textSize="?attr/font_default"
app:layout_constraintHorizontal_bias="1"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/guideline"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<androidx.constraintlayout.widget.Guideline
android:id="@+id/guideline"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.6" />
</androidx.constraintlayout.widget.ConstraintLayout>
<TextView
android:id="@+id/title_text_view_item_post_detail_no_preview_link"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingStart="16dp"
android:paddingEnd="16dp"
android:textColor="?attr/primaryTextColor"
android:textSize="?attr/title_font_18"
android:textIsSelectable="true"
android:enabled="true"
android:focusable="true"
android:longClickable="true" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/content_markdown_view_item_post_detail_no_preview_link"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="16dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:visibility="gone" />
<com.nex3z.flowlayout.FlowLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="16dp"
app:flChildSpacing="16dp"
app:flChildSpacingForLastRow="align"
app:flRowSpacing="8dp">
<com.libRG.CustomTextView
android:id="@+id/type_text_view_item_post_detail_no_preview_link"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="4dp"
android:text="@string/link"
android:textSize="?attr/font_12"
android:textColor="@android:color/white"
app:lib_setRadius="3dp"
app:lib_setRoundedView="true"
app:lib_setShape="rectangle" />
<com.libRG.CustomTextView
android:id="@+id/spoiler_custom_text_view_item_post_detail_no_preview_link"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="@string/spoiler"
android:textSize="?attr/font_12"
android:textColor="@android:color/white"
android:padding="4dp"
android:visibility="gone"
app:lib_setRadius="3dp"
app:lib_setRoundedView="true"
app:lib_setShape="rectangle" />
<com.libRG.CustomTextView
android:id="@+id/nsfw_text_view_item_post_detail_no_preview_link"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="4dp"
android:text="@string/nsfw"
android:textSize="?attr/font_12"
android:textColor="@android:color/white"
android:visibility="gone"
app:lib_setRadius="3dp"
app:lib_setRoundedView="true"
app:lib_setShape="rectangle" />
<com.libRG.CustomTextView
android:id="@+id/flair_custom_text_view_item_post_detail_no_preview_link"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:padding="4dp"
android:textSize="?attr/font_12"
android:textColor="@android:color/white"
android:visibility="gone"
app:lib_setRadius="3dp"
app:lib_setRoundedView="true"
app:lib_setShape="rectangle" />
<ImageView
android:id="@+id/archived_image_view_item_post_detail_no_preview_link"
android:layout_width="20dp"
android:layout_height="20dp"
android:src="@drawable/ic_archive_outline"
android:visibility="gone" />
<ImageView
android:id="@+id/locked_image_view_item_post_detail_no_preview_link"
android:layout_width="20dp"
android:layout_height="20dp"
android:src="@drawable/ic_outline_lock_24dp"
android:visibility="gone" />
<ImageView
android:id="@+id/crosspost_image_view_item_post_detail_no_preview_link"
android:layout_width="20dp"
android:layout_height="20dp"
android:src="@drawable/crosspost"
android:visibility="gone" />
<TextView
android:id="@+id/awards_text_view_item_post_detail_no_preview_link"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone" />
</com.nex3z.flowlayout.FlowLayout>
<TextView
android:id="@+id/link_text_view_item_post_detail_no_preview_link"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="16dp"
android:paddingStart="16dp"
android:paddingEnd="16dp"
android:textSize="?attr/font_12" />
<ImageView
android:id="@+id/image_view_no_preview_link_item_post_detail_no_preview_link"
android:layout_width="match_parent"
android:layout_height="150dp"
android:scaleType="center"
android:src="@drawable/ic_link"
android:tint="@android:color/tab_indicator_text" />
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/bottom_constraint_layout_item_post_detail_no_preview_link">
<ImageView
android:id="@+id/plus_button_item_post_detail_no_preview_link"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="12dp"
android:src="@drawable/ic_arrow_upward_grey_24dp"
android:tint="@android:color/tab_indicator_text"
android:background="?actionBarItemBackground"
android:clickable="true"
android:focusable="true"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent" />
<TextView
android:id="@+id/score_text_view_item_post_detail_no_preview_link"
android:layout_width="64dp"
android:layout_height="wrap_content"
android:gravity="center"
android:textSize="?attr/font_12"
android:textStyle="bold"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/plus_button_item_post_detail_no_preview_link" />
<ImageView
android:id="@+id/minus_button_item_post_detail_no_preview_link"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="12dp"
android:src="@drawable/ic_arrow_downward_grey_24dp"
android:tint="@android:color/tab_indicator_text"
android:background="?actionBarItemBackground"
android:clickable="true"
android:focusable="true"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/score_text_view_item_post_detail_no_preview_link" />
<TextView
android:id="@+id/comments_count_item_post_detail_no_preview_link"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="12dp"
android:gravity="center_vertical"
android:textSize="?attr/font_12"
android:textStyle="bold"
android:drawableStart="@drawable/ic_comment_grey_24dp"
android:drawablePadding="12dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/minus_button_item_post_detail_no_preview_link" />
<ImageView
android:id="@+id/save_button_item_post_detail_no_preview_link"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="12dp"
android:tint="@android:color/tab_indicator_text"
android:background="?actionBarItemBackground"
android:clickable="true"
android:focusable="true"
app:layout_constraintHorizontal_bias="1"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/comments_count_item_post_detail_no_preview_link"
app:layout_constraintEnd_toStartOf="@id/share_button_item_post_detail_no_preview_link" />
<ImageView
android:id="@+id/share_button_item_post_detail_no_preview_link"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="12dp"
android:src="@drawable/ic_share_grey_24dp"
android:background="?actionBarItemBackground"
android:clickable="true"
android:focusable="true"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>

View File

@ -0,0 +1,288 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="?attr/cardViewBackgroundColor">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/constraint_layout_item_post_detail_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="16dp">
<ml.docilealligator.infinityforreddit.CustomView.AspectRatioGifImageView
android:id="@+id/icon_gif_image_view_item_post_detail_text"
android:layout_width="24dp"
android:layout_height="24dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/subreddit_text_view_item_post_detail_text"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginEnd="8dp"
android:textSize="?attr/font_default"
android:maxLines="2"
android:ellipsize="end"
app:layout_constraintStart_toEndOf="@+id/icon_gif_image_view_item_post_detail_text"
app:layout_constraintEnd_toStartOf="@id/guideline"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintHorizontal_bias="0" />
<TextView
android:id="@+id/user_text_view_item_post_detail_text"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginEnd="8dp"
android:textSize="?attr/font_default"
android:maxLines="2"
android:ellipsize="end"
app:layout_constraintBottom_toTopOf="@+id/author_flair_text_view_item_post_detail_text"
app:layout_constraintStart_toEndOf="@+id/icon_gif_image_view_item_post_detail_text"
app:layout_constraintEnd_toStartOf="@id/guideline"
app:layout_constraintTop_toBottomOf="@+id/subreddit_text_view_item_post_detail_text"
app:layout_constraintHorizontal_bias="0" />
<TextView
android:id="@+id/author_flair_text_view_item_post_detail_text"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginEnd="8dp"
android:textSize="?attr/font_12"
android:maxLines="2"
android:ellipsize="end"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@+id/icon_gif_image_view_item_post_detail_text"
app:layout_constraintEnd_toStartOf="@id/guideline"
app:layout_constraintTop_toBottomOf="@+id/user_text_view_item_post_detail_text"
app:layout_constraintHorizontal_bias="0" />
<TextView
android:id="@+id/post_time_text_view_item_post_detail_text"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:gravity="end"
android:textSize="?attr/font_default"
app:layout_constraintHorizontal_bias="1"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/guideline"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<androidx.constraintlayout.widget.Guideline
android:id="@+id/guideline"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.6" />
</androidx.constraintlayout.widget.ConstraintLayout>
<TextView
android:id="@+id/title_text_view_item_post_detail_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingStart="16dp"
android:paddingEnd="16dp"
android:textColor="?attr/primaryTextColor"
android:textSize="?attr/title_font_18"
android:textIsSelectable="true"
android:enabled="true"
android:focusable="true"
android:longClickable="true" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/content_markdown_view_item_post_detail_text"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="16dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:visibility="gone" />
<com.nex3z.flowlayout.FlowLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="16dp"
app:flChildSpacing="16dp"
app:flChildSpacingForLastRow="align"
app:flRowSpacing="8dp">
<com.libRG.CustomTextView
android:id="@+id/type_text_view_item_post_detail_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="4dp"
android:text="@string/text"
android:textSize="?attr/font_12"
android:textColor="@android:color/white"
app:lib_setRadius="3dp"
app:lib_setRoundedView="true"
app:lib_setShape="rectangle" />
<com.libRG.CustomTextView
android:id="@+id/spoiler_custom_text_view_item_post_detail_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="@string/spoiler"
android:textSize="?attr/font_12"
android:textColor="@android:color/white"
android:padding="4dp"
android:visibility="gone"
app:lib_setRadius="3dp"
app:lib_setRoundedView="true"
app:lib_setShape="rectangle" />
<com.libRG.CustomTextView
android:id="@+id/nsfw_text_view_item_post_detail_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="4dp"
android:text="@string/nsfw"
android:textSize="?attr/font_12"
android:textColor="@android:color/white"
android:visibility="gone"
app:lib_setRadius="3dp"
app:lib_setRoundedView="true"
app:lib_setShape="rectangle" />
<com.libRG.CustomTextView
android:id="@+id/flair_custom_text_view_item_post_detail_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:padding="4dp"
android:textSize="?attr/font_12"
android:textColor="@android:color/white"
android:visibility="gone"
app:lib_setRadius="3dp"
app:lib_setRoundedView="true"
app:lib_setShape="rectangle" />
<ImageView
android:id="@+id/archived_image_view_item_post_detail_text"
android:layout_width="20dp"
android:layout_height="20dp"
android:src="@drawable/ic_archive_outline"
android:visibility="gone" />
<ImageView
android:id="@+id/locked_image_view_item_post_detail_text"
android:layout_width="20dp"
android:layout_height="20dp"
android:src="@drawable/ic_outline_lock_24dp"
android:visibility="gone" />
<ImageView
android:id="@+id/crosspost_image_view_item_post_detail_text"
android:layout_width="20dp"
android:layout_height="20dp"
android:src="@drawable/crosspost"
android:visibility="gone" />
<TextView
android:id="@+id/awards_text_view_item_post_detail_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone" />
</com.nex3z.flowlayout.FlowLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/bottom_constraint_layout_item_post_detail_text">
<ImageView
android:id="@+id/plus_button_item_post_detail_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="12dp"
android:src="@drawable/ic_arrow_upward_grey_24dp"
android:tint="@android:color/tab_indicator_text"
android:background="?actionBarItemBackground"
android:clickable="true"
android:focusable="true"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent" />
<TextView
android:id="@+id/score_text_view_item_post_detail_text"
android:layout_width="64dp"
android:layout_height="wrap_content"
android:gravity="center"
android:textSize="?attr/font_12"
android:textStyle="bold"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/plus_button_item_post_detail_text" />
<ImageView
android:id="@+id/minus_button_item_post_detail_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="12dp"
android:src="@drawable/ic_arrow_downward_grey_24dp"
android:tint="@android:color/tab_indicator_text"
android:background="?actionBarItemBackground"
android:clickable="true"
android:focusable="true"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/score_text_view_item_post_detail_text" />
<TextView
android:id="@+id/comments_count_item_post_detail_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="12dp"
android:gravity="center_vertical"
android:textSize="?attr/font_12"
android:textStyle="bold"
android:drawableStart="@drawable/ic_comment_grey_24dp"
android:drawablePadding="12dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/minus_button_item_post_detail_text" />
<ImageView
android:id="@+id/save_button_item_post_detail_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="12dp"
android:tint="@android:color/tab_indicator_text"
android:background="?actionBarItemBackground"
android:clickable="true"
android:focusable="true"
app:layout_constraintHorizontal_bias="1"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/comments_count_item_post_detail_text"
app:layout_constraintEnd_toStartOf="@id/share_button_item_post_detail_text" />
<ImageView
android:id="@+id/share_button_item_post_detail_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="12dp"
android:src="@drawable/ic_share_grey_24dp"
android:background="?actionBarItemBackground"
android:clickable="true"
android:focusable="true"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>

View File

@ -7,13 +7,13 @@
android:background="?attr/cardViewBackgroundColor">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/constraint_layout_item_post_detail"
android:id="@+id/constraint_layout_item_post_detail_video_and_gif_preview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="16dp">
<ml.docilealligator.infinityforreddit.CustomView.AspectRatioGifImageView
android:id="@+id/icon_gif_image_view_item_post_detail"
android:id="@+id/icon_gif_image_view_item_post_detail_video_and_gif_preview"
android:layout_width="24dp"
android:layout_height="24dp"
app:layout_constraintBottom_toBottomOf="parent"
@ -21,7 +21,7 @@
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/subreddit_text_view_item_post_detail"
android:id="@+id/subreddit_text_view_item_post_detail_video_and_gif_preview"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
@ -29,13 +29,13 @@
android:textSize="?attr/font_default"
android:maxLines="2"
android:ellipsize="end"
app:layout_constraintStart_toEndOf="@+id/icon_gif_image_view_item_post_detail"
app:layout_constraintStart_toEndOf="@+id/icon_gif_image_view_item_post_detail_video_and_gif_preview"
app:layout_constraintEnd_toStartOf="@id/guideline"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintHorizontal_bias="0" />
<TextView
android:id="@+id/user_text_view_item_post_detail"
android:id="@+id/user_text_view_item_post_detail_video_and_gif_preview"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
@ -43,14 +43,14 @@
android:textSize="?attr/font_default"
android:maxLines="2"
android:ellipsize="end"
app:layout_constraintBottom_toTopOf="@+id/author_flair_text_view_item_post_detail"
app:layout_constraintStart_toEndOf="@+id/icon_gif_image_view_item_post_detail"
app:layout_constraintBottom_toTopOf="@+id/author_flair_text_view_item_post_detail_video_and_gif_preview"
app:layout_constraintStart_toEndOf="@+id/icon_gif_image_view_item_post_detail_video_and_gif_preview"
app:layout_constraintEnd_toStartOf="@id/guideline"
app:layout_constraintTop_toBottomOf="@+id/subreddit_text_view_item_post_detail"
app:layout_constraintTop_toBottomOf="@+id/subreddit_text_view_item_post_detail_video_and_gif_preview"
app:layout_constraintHorizontal_bias="0" />
<TextView
android:id="@+id/author_flair_text_view_item_post_detail"
android:id="@+id/author_flair_text_view_item_post_detail_video_and_gif_preview"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
@ -60,13 +60,13 @@
android:ellipsize="end"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@+id/icon_gif_image_view_item_post_detail"
app:layout_constraintStart_toEndOf="@+id/icon_gif_image_view_item_post_detail_video_and_gif_preview"
app:layout_constraintEnd_toStartOf="@id/guideline"
app:layout_constraintTop_toBottomOf="@+id/user_text_view_item_post_detail"
app:layout_constraintTop_toBottomOf="@+id/user_text_view_item_post_detail_video_and_gif_preview"
app:layout_constraintHorizontal_bias="0" />
<TextView
android:id="@+id/post_time_text_view_item_post_detail"
android:id="@+id/post_time_text_view_item_post_detail_video_and_gif_preview"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:gravity="end"
@ -87,7 +87,7 @@
</androidx.constraintlayout.widget.ConstraintLayout>
<TextView
android:id="@+id/title_text_view_item_post_detail"
android:id="@+id/title_text_view_item_post_detail_video_and_gif_preview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingStart="16dp"
@ -99,15 +99,6 @@
android:focusable="true"
android:longClickable="true" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/content_markdown_view_item_post_detail"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="16dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:visibility="gone" />
<com.nex3z.flowlayout.FlowLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
@ -117,7 +108,7 @@
app:flRowSpacing="8dp">
<com.libRG.CustomTextView
android:id="@+id/type_text_view_item_post_detail"
android:id="@+id/type_text_view_item_post_detail_video_and_gif_preview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="4dp"
@ -128,7 +119,7 @@
app:lib_setShape="rectangle" />
<com.libRG.CustomTextView
android:id="@+id/spoiler_custom_text_view_item_post_detail"
android:id="@+id/spoiler_custom_text_view_item_post_detail_video_and_gif_preview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
@ -142,7 +133,7 @@
app:lib_setShape="rectangle" />
<com.libRG.CustomTextView
android:id="@+id/nsfw_text_view_item_post_detail"
android:id="@+id/nsfw_text_view_item_post_detail_video_and_gif_preview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="4dp"
@ -155,7 +146,7 @@
app:lib_setShape="rectangle" />
<com.libRG.CustomTextView
android:id="@+id/flair_custom_text_view_item_post_detail"
android:id="@+id/flair_custom_text_view_item_post_detail_video_and_gif_preview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
@ -168,87 +159,73 @@
app:lib_setShape="rectangle" />
<ImageView
android:id="@+id/archived_image_view_item_post_detail"
android:id="@+id/archived_image_view_item_post_detail_video_and_gif_preview"
android:layout_width="20dp"
android:layout_height="20dp"
android:src="@drawable/ic_archive_outline"
android:visibility="gone" />
<ImageView
android:id="@+id/locked_image_view_item_post_detail"
android:id="@+id/locked_image_view_item_post_detail_video_and_gif_preview"
android:layout_width="20dp"
android:layout_height="20dp"
android:src="@drawable/ic_outline_lock_24dp"
android:visibility="gone" />
<ImageView
android:id="@+id/crosspost_image_view_item_post_detail"
android:id="@+id/crosspost_image_view_item_post_detail_video_and_gif_preview"
android:layout_width="20dp"
android:layout_height="20dp"
android:src="@drawable/crosspost"
android:visibility="gone" />
<TextView
android:id="@+id/awards_text_view_item_post_detail"
android:id="@+id/awards_text_view_item_post_detail_video_and_gif_preview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone" />
</com.nex3z.flowlayout.FlowLayout>
<TextView
android:id="@+id/link_text_view_item_post_detail"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="16dp"
android:paddingStart="16dp"
android:paddingEnd="16dp"
android:textSize="?attr/font_12"
android:visibility="gone"/>
<RelativeLayout
android:id="@+id/image_view_wrapper_item_post_detail"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone">
android:layout_height="wrap_content">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.santalu.aspectratioimageview.AspectRatioImageView
android:id="@+id/image_view_item_post_detail"
android:id="@+id/image_view_item_post_detail_video_and_gif_preview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:scaleType="fitStart"/>
<ImageView
android:id="@+id/play_button_image_view_item_post_detail"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="16dp"
android:layout_gravity="start"
android:background="@drawable/play_button_round_background"
android:src="@drawable/ic_play_circle_36dp"
android:visibility="gone" />
android:src="@drawable/ic_play_circle_36dp" />
</FrameLayout>
<RelativeLayout
android:id="@+id/load_wrapper_item_post_detail"
android:id="@+id/load_wrapper_item_post_detail_video_and_gif_preview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerInParent="true">
<ProgressBar
android:id="@+id/progress_bar_item_post_detail"
android:id="@+id/progress_bar_item_post_detail_video_and_gif_preview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true" />
<TextView
android:id="@+id/load_image_error_text_view_item_post_detail"
android:id="@+id/load_image_error_text_view_item_post_detail_video_and_gif_preview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawableTop="@drawable/ic_error_outline_black_24dp"
@ -262,22 +239,13 @@
</RelativeLayout>
<ImageView
android:id="@+id/image_view_no_preview_link_item_post_detail"
android:layout_width="match_parent"
android:layout_height="150dp"
android:scaleType="center"
android:src="@drawable/ic_link"
android:tint="@android:color/tab_indicator_text"
android:visibility="gone" />
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/bottom_constraint_layout_item_post_detail">
android:id="@+id/bottom_constraint_layout_item_post_detail_video_and_gif_preview">
<ImageView
android:id="@+id/plus_button_item_post_detail"
android:id="@+id/plus_button_item_post_detail_video_and_gif_preview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="12dp"
@ -291,7 +259,7 @@
app:layout_constraintStart_toStartOf="parent" />
<TextView
android:id="@+id/score_text_view_item_post_detail"
android:id="@+id/score_text_view_item_post_detail_video_and_gif_preview"
android:layout_width="64dp"
android:layout_height="wrap_content"
android:gravity="center"
@ -299,10 +267,10 @@
android:textStyle="bold"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/plus_button_item_post_detail" />
app:layout_constraintStart_toEndOf="@id/plus_button_item_post_detail_video_and_gif_preview" />
<ImageView
android:id="@+id/minus_button_item_post_detail"
android:id="@+id/minus_button_item_post_detail_video_and_gif_preview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="12dp"
@ -313,10 +281,10 @@
android:focusable="true"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/score_text_view_item_post_detail" />
app:layout_constraintStart_toEndOf="@id/score_text_view_item_post_detail_video_and_gif_preview" />
<TextView
android:id="@+id/comments_count_item_post_detail"
android:id="@+id/comments_count_item_post_detail_video_and_gif_preview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="12dp"
@ -327,10 +295,10 @@
android:drawablePadding="12dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/minus_button_item_post_detail" />
app:layout_constraintStart_toEndOf="@id/minus_button_item_post_detail_video_and_gif_preview" />
<ImageView
android:id="@+id/save_button_item_post_detail"
android:id="@+id/save_button_item_post_detail_video_and_gif_preview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="12dp"
@ -341,11 +309,11 @@
app:layout_constraintHorizontal_bias="1"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/comments_count_item_post_detail"
app:layout_constraintEnd_toStartOf="@id/share_button_item_post_detail" />
app:layout_constraintStart_toEndOf="@id/comments_count_item_post_detail_video_and_gif_preview"
app:layout_constraintEnd_toStartOf="@id/share_button_item_post_detail_video_and_gif_preview" />
<ImageView
android:id="@+id/share_button_item_post_detail"
android:id="@+id/share_button_item_post_detail_video_and_gif_preview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="12dp"

View File

@ -0,0 +1,294 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="?attr/cardViewBackgroundColor">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/constraint_layout_item_post_detail_video_autoplay"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="16dp">
<ml.docilealligator.infinityforreddit.CustomView.AspectRatioGifImageView
android:id="@+id/icon_gif_image_view_item_post_detail_video_autoplay"
android:layout_width="24dp"
android:layout_height="24dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/subreddit_text_view_item_post_detail_video_autoplay"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginEnd="8dp"
android:textSize="?attr/font_default"
android:maxLines="2"
android:ellipsize="end"
app:layout_constraintStart_toEndOf="@+id/icon_gif_image_view_item_post_detail_video_autoplay"
app:layout_constraintEnd_toStartOf="@id/guideline"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintHorizontal_bias="0" />
<TextView
android:id="@+id/user_text_view_item_post_detail_video_autoplay"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginEnd="8dp"
android:textSize="?attr/font_default"
android:maxLines="2"
android:ellipsize="end"
app:layout_constraintBottom_toTopOf="@+id/author_flair_text_view_item_post_detail_video_autoplay"
app:layout_constraintStart_toEndOf="@+id/icon_gif_image_view_item_post_detail_video_autoplay"
app:layout_constraintEnd_toStartOf="@id/guideline"
app:layout_constraintTop_toBottomOf="@+id/subreddit_text_view_item_post_detail_video_autoplay"
app:layout_constraintHorizontal_bias="0" />
<TextView
android:id="@+id/author_flair_text_view_item_post_detail_video_autoplay"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginEnd="8dp"
android:textSize="?attr/font_12"
android:maxLines="2"
android:ellipsize="end"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@+id/icon_gif_image_view_item_post_detail_video_autoplay"
app:layout_constraintEnd_toStartOf="@id/guideline"
app:layout_constraintTop_toBottomOf="@+id/user_text_view_item_post_detail_video_autoplay"
app:layout_constraintHorizontal_bias="0" />
<TextView
android:id="@+id/post_time_text_view_item_post_detail_video_autoplay"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:gravity="end"
android:textSize="?attr/font_default"
app:layout_constraintHorizontal_bias="1"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/guideline"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<androidx.constraintlayout.widget.Guideline
android:id="@+id/guideline"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.6" />
</androidx.constraintlayout.widget.ConstraintLayout>
<TextView
android:id="@+id/title_text_view_item_post_detail_video_autoplay"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingStart="16dp"
android:paddingEnd="16dp"
android:textColor="?attr/primaryTextColor"
android:textSize="?attr/title_font_18"
android:textIsSelectable="true"
android:enabled="true"
android:focusable="true"
android:longClickable="true" />
<com.nex3z.flowlayout.FlowLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="16dp"
app:flChildSpacing="16dp"
app:flChildSpacingForLastRow="align"
app:flRowSpacing="8dp">
<com.libRG.CustomTextView
android:id="@+id/type_text_view_item_post_detail_video_autoplay"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="4dp"
android:text="@string/video"
android:textSize="?attr/font_12"
android:textColor="@android:color/white"
app:lib_setRadius="3dp"
app:lib_setRoundedView="true"
app:lib_setShape="rectangle" />
<com.libRG.CustomTextView
android:id="@+id/spoiler_custom_text_view_item_post_detail_video_autoplay"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="@string/spoiler"
android:textSize="?attr/font_12"
android:textColor="@android:color/white"
android:padding="4dp"
android:visibility="gone"
app:lib_setRadius="3dp"
app:lib_setRoundedView="true"
app:lib_setShape="rectangle" />
<com.libRG.CustomTextView
android:id="@+id/nsfw_text_view_item_post_detail_video_autoplay"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="4dp"
android:text="@string/nsfw"
android:textSize="?attr/font_12"
android:textColor="@android:color/white"
android:visibility="gone"
app:lib_setRadius="3dp"
app:lib_setRoundedView="true"
app:lib_setShape="rectangle" />
<com.libRG.CustomTextView
android:id="@+id/flair_custom_text_view_item_post_detail_video_autoplay"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:padding="4dp"
android:textSize="?attr/font_12"
android:textColor="@android:color/white"
android:visibility="gone"
app:lib_setRadius="3dp"
app:lib_setRoundedView="true"
app:lib_setShape="rectangle" />
<ImageView
android:id="@+id/archived_image_view_item_post_detail_video_autoplay"
android:layout_width="20dp"
android:layout_height="20dp"
android:src="@drawable/ic_archive_outline"
android:visibility="gone" />
<ImageView
android:id="@+id/locked_image_view_item_post_detail_video_autoplay"
android:layout_width="20dp"
android:layout_height="20dp"
android:src="@drawable/ic_outline_lock_24dp"
android:visibility="gone" />
<ImageView
android:id="@+id/crosspost_image_view_item_post_detail_video_autoplay"
android:layout_width="20dp"
android:layout_height="20dp"
android:src="@drawable/crosspost"
android:visibility="gone" />
<TextView
android:id="@+id/awards_text_view_item_post_detail_video_autoplay"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone" />
</com.nex3z.flowlayout.FlowLayout>
<com.google.android.exoplayer2.ui.AspectRatioFrameLayout
android:id="@+id/aspect_ratio_frame_layout_item_post_detail_video_autoplay"
android:layout_width="match_parent"
android:layout_height="0dp"
android:background="#000000"
app:resize_mode="fixed_width">
<com.google.android.exoplayer2.ui.PlayerView
android:id="@+id/player_view_item_post_detail_video_autoplay"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:controller_layout_id="@layout/exo_autoplay_playback_control_view"/>
</com.google.android.exoplayer2.ui.AspectRatioFrameLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/bottom_constraint_layout_item_post_detail_video_autoplay">
<ImageView
android:id="@+id/plus_button_item_post_detail_video_autoplay"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="12dp"
android:src="@drawable/ic_arrow_upward_grey_24dp"
android:tint="@android:color/tab_indicator_text"
android:background="?actionBarItemBackground"
android:clickable="true"
android:focusable="true"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent" />
<TextView
android:id="@+id/score_text_view_item_post_detail_video_autoplay"
android:layout_width="64dp"
android:layout_height="wrap_content"
android:gravity="center"
android:textSize="?attr/font_12"
android:textStyle="bold"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/plus_button_item_post_detail_video_autoplay" />
<ImageView
android:id="@+id/minus_button_item_post_detail_video_autoplay"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="12dp"
android:src="@drawable/ic_arrow_downward_grey_24dp"
android:tint="@android:color/tab_indicator_text"
android:background="?actionBarItemBackground"
android:clickable="true"
android:focusable="true"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/score_text_view_item_post_detail_video_autoplay" />
<TextView
android:id="@+id/comments_count_item_post_detail_video_autoplay"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="12dp"
android:gravity="center_vertical"
android:textSize="?attr/font_12"
android:textStyle="bold"
android:drawableStart="@drawable/ic_comment_grey_24dp"
android:drawablePadding="12dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/minus_button_item_post_detail_video_autoplay" />
<ImageView
android:id="@+id/save_button_item_post_detail_video_autoplay"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="12dp"
android:tint="@android:color/tab_indicator_text"
android:background="?actionBarItemBackground"
android:clickable="true"
android:focusable="true"
app:layout_constraintHorizontal_bias="1"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/comments_count_item_post_detail_video_autoplay"
app:layout_constraintEnd_toStartOf="@id/share_button_item_post_detail_video_autoplay" />
<ImageView
android:id="@+id/share_button_item_post_detail_video_autoplay"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="12dp"
android:src="@drawable/ic_share_grey_24dp"
android:background="?actionBarItemBackground"
android:clickable="true"
android:focusable="true"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>

View File

@ -5,7 +5,7 @@
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp"
android:id="@+id/card_view_item_post_image_type"
android:id="@+id/card_view_item_post_image_and_gif_autoplay"
app:cardBackgroundColor="?attr/cardViewBackgroundColor"
app:cardElevation="2dp"
app:cardCornerRadius="16dp">
@ -21,7 +21,7 @@
android:padding="16dp">
<ml.docilealligator.infinityforreddit.CustomView.AspectRatioGifImageView
android:id="@+id/icon_gif_image_view_item_post_image_type"
android:id="@+id/icon_gif_image_view_item_post_image_and_gif_autoplay"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_gravity="center"
@ -30,20 +30,20 @@
app:layout_constraintTop_toTopOf="parent"/>
<TextView
android:id="@+id/subreddit_name_text_view_item_post_image_type"
android:id="@+id/subreddit_name_text_view_item_post_image_and_gif_autoplay"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginStart="16dp"
android:layout_marginEnd="8dp"
android:textSize="?attr/font_default"
app:layout_constraintBottom_toTopOf="@id/user_text_view_item_post_image_type"
app:layout_constraintStart_toEndOf="@id/icon_gif_image_view_item_post_image_type"
app:layout_constraintEnd_toStartOf="@id/stickied_post_image_view_item_post_image_type"
app:layout_constraintBottom_toTopOf="@id/user_text_view_item_post_image_and_gif_autoplay"
app:layout_constraintStart_toEndOf="@id/icon_gif_image_view_item_post_image_and_gif_autoplay"
app:layout_constraintEnd_toStartOf="@id/stickied_post_image_view_item_post_image_and_gif_autoplay"
app:layout_constraintTop_toTopOf="parent"/>
<TextView
android:id="@+id/user_text_view_item_post_image_type"
android:id="@+id/user_text_view_item_post_image_and_gif_autoplay"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
@ -52,24 +52,24 @@
android:maxLines="2"
android:ellipsize="end"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@+id/icon_gif_image_view_item_post_image_type"
app:layout_constraintEnd_toStartOf="@id/stickied_post_image_view_item_post_image_type"
app:layout_constraintTop_toBottomOf="@+id/subreddit_name_text_view_item_post_image_type"
app:layout_constraintStart_toEndOf="@+id/icon_gif_image_view_item_post_image_and_gif_autoplay"
app:layout_constraintEnd_toStartOf="@id/stickied_post_image_view_item_post_image_and_gif_autoplay"
app:layout_constraintTop_toBottomOf="@+id/subreddit_name_text_view_item_post_image_and_gif_autoplay"
app:layout_constraintHorizontal_bias="0" />
<ImageView
android:id="@+id/stickied_post_image_view_item_post_image_type"
android:id="@+id/stickied_post_image_view_item_post_image_and_gif_autoplay"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginEnd="8dp"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/subreddit_name_text_view_item_post_image_type"
app:layout_constraintStart_toEndOf="@id/subreddit_name_text_view_item_post_image_and_gif_autoplay"
app:layout_constraintEnd_toStartOf="@+id/guideline2"
app:layout_constraintTop_toTopOf="parent"/>
<TextView
android:id="@+id/post_time_text_view_best_item_post_image_type"
android:id="@+id/post_time_text_view_item_post_image_and_gif_autoplay"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:gravity="end"
@ -89,7 +89,7 @@
</androidx.constraintlayout.widget.ConstraintLayout>
<TextView
android:id="@+id/title_text_view_best_item_post_image_type"
android:id="@+id/title_text_view_item_post_image_and_gif_autoplay"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingStart="16dp"
@ -105,7 +105,7 @@
app:flRowSpacing="8dp">
<com.libRG.CustomTextView
android:id="@+id/type_text_view_item_post_image_type"
android:id="@+id/type_text_view_item_post_image_and_gif_autoplay"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="4dp"
@ -115,7 +115,7 @@
app:lib_setShape="rectangle" />
<com.libRG.CustomTextView
android:id="@+id/spoiler_custom_text_view_item_post_image_type"
android:id="@+id/spoiler_custom_text_view_item_post_image_and_gif_autoplay"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
@ -128,7 +128,7 @@
app:lib_setShape="rectangle" />
<com.libRG.CustomTextView
android:id="@+id/nsfw_text_view_item_post_image_type"
android:id="@+id/nsfw_text_view_item_post_image_and_gif_autoplay"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="4dp"
@ -140,7 +140,7 @@
app:lib_setShape="rectangle" />
<com.libRG.CustomTextView
android:id="@+id/flair_custom_text_view_item_post_image_type"
android:id="@+id/flair_custom_text_view_item_post_image_and_gif_autoplay"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
@ -152,7 +152,7 @@
app:lib_setShape="rectangle" />
<com.libRG.CustomTextView
android:id="@+id/awards_text_view_item_post_image_type"
android:id="@+id/awards_text_view_item_post_image_and_gif_autoplay"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="4dp"
@ -163,21 +163,21 @@
app:lib_setShape="rectangle" />
<ImageView
android:id="@+id/archived_image_view_item_post_image_type"
android:id="@+id/archived_image_view_item_post_image_and_gif_autoplay"
android:layout_width="24dp"
android:layout_height="24dp"
android:src="@drawable/ic_archive_outline"
android:visibility="gone" />
<ImageView
android:id="@+id/locked_image_view_item_post_image_type"
android:id="@+id/locked_image_view_item_post_image_and_gif_autoplay"
android:layout_width="24dp"
android:layout_height="24dp"
android:src="@drawable/ic_outline_lock_24dp"
android:visibility="gone" />
<ImageView
android:id="@+id/crosspost_image_view_item_post_image_type"
android:id="@+id/crosspost_image_view_item_post_image_and_gif_autoplay"
android:layout_width="24dp"
android:layout_height="24dp"
android:src="@drawable/crosspost"
@ -186,31 +186,31 @@
</com.nex3z.flowlayout.FlowLayout>
<RelativeLayout
android:id="@+id/image_view_wrapper_item_post_image_type"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ml.docilealligator.infinityforreddit.CustomView.AspectRatioGifImageView
android:id="@+id/image_view_best_post_item"
android:id="@+id/image_view_item_post_image_and_gif_autoplay"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:scaleType="fitStart" />
<ProgressBar
android:id="@+id/progress_bar_item_post_image_type"
android:id="@+id/progress_bar_item_post_image_and_gif_autoplay"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true" />
<RelativeLayout
android:id="@+id/load_image_error_relative_layout_item_post_image_type"
android:id="@+id/load_image_error_relative_layout_item_post_image_and_gif_autoplay"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerInParent="true"
android:visibility="gone">
<TextView
android:id="@+id/load_image_error_text_view_item_post_image_and_gif_autoplay"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawableTop="@drawable/ic_error_outline_black_24dp"
@ -224,12 +224,12 @@
</RelativeLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/bottom_constraint_layout_item_post_image_type"
android:id="@+id/bottom_constraint_layout_item_post_image_and_gif_autoplay"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/plus_button_item_post_image_type"
android:id="@+id/plus_button_item_post_image_and_gif_autoplay"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="12dp"
@ -242,7 +242,7 @@
app:layout_constraintStart_toStartOf="parent" />
<TextView
android:id="@+id/score_text_view_item_post_image_type"
android:id="@+id/score_text_view_item_post_image_and_gif_autoplay"
android:layout_width="64dp"
android:layout_height="wrap_content"
android:gravity="center"
@ -250,10 +250,10 @@
android:textStyle="bold"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/plus_button_item_post_image_type" />
app:layout_constraintStart_toEndOf="@id/plus_button_item_post_image_and_gif_autoplay" />
<ImageView
android:id="@+id/minus_button_item_post_image_type"
android:id="@+id/minus_button_item_post_image_and_gif_autoplay"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="12dp"
@ -263,10 +263,10 @@
android:focusable="true"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/score_text_view_item_post_image_type" />
app:layout_constraintStart_toEndOf="@id/score_text_view_item_post_image_and_gif_autoplay" />
<TextView
android:id="@+id/comments_count_item_post_image_type"
android:id="@+id/comments_count_item_post_image_and_gif_autoplay"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="12dp"
@ -277,10 +277,10 @@
android:drawablePadding="12dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/minus_button_item_post_image_type" />
app:layout_constraintStart_toEndOf="@id/minus_button_item_post_image_and_gif_autoplay" />
<ImageView
android:id="@+id/save_button_item_post_image_type"
android:id="@+id/save_button_item_post_image_and_gif_autoplay"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="12dp"
@ -290,11 +290,11 @@
app:layout_constraintHorizontal_bias="1"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/comments_count_item_post_image_type"
app:layout_constraintEnd_toStartOf="@id/share_button_item_post_image_type" />
app:layout_constraintStart_toEndOf="@id/comments_count_item_post_image_and_gif_autoplay"
app:layout_constraintEnd_toStartOf="@id/share_button_item_post_image_and_gif_autoplay" />
<ImageView
android:id="@+id/share_button_item_post_image_type"
android:id="@+id/share_button_item_post_image_and_gif_autoplay"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="12dp"

View File

@ -5,7 +5,7 @@
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp"
android:id="@+id/card_view_item_post_link_type"
android:id="@+id/card_view_item_post_link"
app:cardBackgroundColor="?attr/cardViewBackgroundColor"
app:cardElevation="2dp"
app:cardCornerRadius="16dp">
@ -21,7 +21,7 @@
android:padding="16dp">
<ml.docilealligator.infinityforreddit.CustomView.AspectRatioGifImageView
android:id="@+id/icon_gif_image_view_item_post_link_type"
android:id="@+id/icon_gif_image_view_item_post_link"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_gravity="center"
@ -30,20 +30,20 @@
app:layout_constraintTop_toTopOf="parent"/>
<TextView
android:id="@+id/subreddit_name_text_view_item_post_link_type"
android:id="@+id/subreddit_name_text_view_item_post_link"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginStart="16dp"
android:layout_marginEnd="8dp"
android:textSize="?attr/font_default"
app:layout_constraintBottom_toTopOf="@id/user_text_view_item_post_link_type"
app:layout_constraintStart_toEndOf="@id/icon_gif_image_view_item_post_link_type"
app:layout_constraintEnd_toStartOf="@id/stickied_post_image_view_item_post_link_type"
app:layout_constraintBottom_toTopOf="@id/user_text_view_item_post_link"
app:layout_constraintStart_toEndOf="@id/icon_gif_image_view_item_post_link"
app:layout_constraintEnd_toStartOf="@id/stickied_post_image_view_item_post_link"
app:layout_constraintTop_toTopOf="parent"/>
<TextView
android:id="@+id/user_text_view_item_post_link_type"
android:id="@+id/user_text_view_item_post_link"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
@ -52,24 +52,24 @@
android:maxLines="2"
android:ellipsize="end"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@+id/icon_gif_image_view_item_post_link_type"
app:layout_constraintEnd_toStartOf="@id/stickied_post_image_view_item_post_link_type"
app:layout_constraintTop_toBottomOf="@+id/subreddit_name_text_view_item_post_link_type"
app:layout_constraintStart_toEndOf="@+id/icon_gif_image_view_item_post_link"
app:layout_constraintEnd_toStartOf="@id/stickied_post_image_view_item_post_link"
app:layout_constraintTop_toBottomOf="@+id/subreddit_name_text_view_item_post_link"
app:layout_constraintHorizontal_bias="0" />
<ImageView
android:id="@+id/stickied_post_image_view_item_post_link_type"
android:id="@+id/stickied_post_image_view_item_post_link"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginEnd="8dp"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/subreddit_name_text_view_item_post_link_type"
app:layout_constraintStart_toEndOf="@id/subreddit_name_text_view_item_post_link"
app:layout_constraintEnd_toStartOf="@+id/guideline2"
app:layout_constraintTop_toTopOf="parent"/>
<TextView
android:id="@+id/post_time_text_view_best_item_post_link_type"
android:id="@+id/post_time_text_view_item_post_link"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:gravity="end"
@ -89,7 +89,7 @@
</androidx.constraintlayout.widget.ConstraintLayout>
<TextView
android:id="@+id/title_text_view_best_item_post_link_type"
android:id="@+id/title_text_view_item_post_link"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingStart="16dp"
@ -105,7 +105,7 @@
app:flRowSpacing="8dp">
<com.libRG.CustomTextView
android:id="@+id/type_text_view_item_post_link_type"
android:id="@+id/type_text_view_item_post_link"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="4dp"
@ -116,7 +116,7 @@
app:lib_setShape="rectangle" />
<com.libRG.CustomTextView
android:id="@+id/spoiler_custom_text_view_item_post_link_type"
android:id="@+id/spoiler_custom_text_view_item_post_link"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
@ -129,7 +129,7 @@
app:lib_setShape="rectangle" />
<com.libRG.CustomTextView
android:id="@+id/nsfw_text_view_item_post_link_type"
android:id="@+id/nsfw_text_view_item_post_link"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="4dp"
@ -141,7 +141,7 @@
app:lib_setShape="rectangle" />
<com.libRG.CustomTextView
android:id="@+id/flair_custom_text_view_item_post_link_type"
android:id="@+id/flair_custom_text_view_item_post_link"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
@ -153,7 +153,7 @@
app:lib_setShape="rectangle" />
<com.libRG.CustomTextView
android:id="@+id/awards_text_view_item_post_link_type"
android:id="@+id/awards_text_view_item_post_link"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="4dp"
@ -164,21 +164,21 @@
app:lib_setShape="rectangle" />
<ImageView
android:id="@+id/archived_image_view_item_post_link_type"
android:id="@+id/archived_image_view_item_post_link"
android:layout_width="24dp"
android:layout_height="24dp"
android:src="@drawable/ic_archive_outline"
android:visibility="gone" />
<ImageView
android:id="@+id/locked_image_view_item_post_link_type"
android:id="@+id/locked_image_view_item_post_link"
android:layout_width="24dp"
android:layout_height="24dp"
android:src="@drawable/ic_outline_lock_24dp"
android:visibility="gone" />
<ImageView
android:id="@+id/crosspost_image_view_item_post_link_type"
android:id="@+id/crosspost_image_view_item_post_link"
android:layout_width="24dp"
android:layout_height="24dp"
android:src="@drawable/crosspost"
@ -187,7 +187,7 @@
</com.nex3z.flowlayout.FlowLayout>
<TextView
android:id="@+id/link_text_view_item_post_link_type"
android:id="@+id/link_text_view_item_post_link"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="16dp"
@ -197,31 +197,31 @@
android:visibility="gone" />
<RelativeLayout
android:id="@+id/image_view_wrapper_item_post_link_type"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ml.docilealligator.infinityforreddit.CustomView.AspectRatioGifImageView
android:id="@+id/image_view_best_post_item"
android:id="@+id/image_view_item_post_link"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:scaleType="fitStart" />
<ProgressBar
android:id="@+id/progress_bar_item_post_link_type"
android:id="@+id/progress_bar_item_post_link"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true" />
<RelativeLayout
android:id="@+id/load_image_error_relative_layout_item_post_link_type"
android:id="@+id/load_image_error_relative_layout_item_post_link"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerInParent="true"
android:visibility="gone">
<TextView
android:id="@+id/load_image_error_text_view_item_post_link"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawableTop="@drawable/ic_error_outline_black_24dp"
@ -235,12 +235,12 @@
</RelativeLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/bottom_constraint_layout_item_post_link_type"
android:id="@+id/bottom_constraint_layout_item_post_link"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/plus_button_item_post_link_type"
android:id="@+id/plus_button_item_post_link"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="12dp"
@ -253,7 +253,7 @@
app:layout_constraintStart_toStartOf="parent" />
<TextView
android:id="@+id/score_text_view_item_post_link_type"
android:id="@+id/score_text_view_item_post_link"
android:layout_width="64dp"
android:layout_height="wrap_content"
android:gravity="center"
@ -261,10 +261,10 @@
android:textStyle="bold"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/plus_button_item_post_link_type" />
app:layout_constraintStart_toEndOf="@id/plus_button_item_post_link" />
<ImageView
android:id="@+id/minus_button_item_post_link_type"
android:id="@+id/minus_button_item_post_link"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="12dp"
@ -274,10 +274,10 @@
android:focusable="true"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/score_text_view_item_post_link_type" />
app:layout_constraintStart_toEndOf="@id/score_text_view_item_post_link" />
<TextView
android:id="@+id/comments_count_item_post_link_type"
android:id="@+id/comments_count_item_post_link"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="12dp"
@ -288,10 +288,10 @@
android:drawablePadding="12dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/minus_button_item_post_link_type" />
app:layout_constraintStart_toEndOf="@id/minus_button_item_post_link" />
<ImageView
android:id="@+id/save_button_item_post_link_type"
android:id="@+id/save_button_item_post_link"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="12dp"
@ -301,11 +301,11 @@
app:layout_constraintHorizontal_bias="1"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/comments_count_item_post_link_type"
app:layout_constraintEnd_toStartOf="@id/share_button_item_post_link_type" />
app:layout_constraintStart_toEndOf="@id/comments_count_item_post_link"
app:layout_constraintEnd_toStartOf="@id/share_button_item_post_link" />
<ImageView
android:id="@+id/share_button_item_post_link_type"
android:id="@+id/share_button_item_post_link"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="12dp"

View File

@ -69,7 +69,7 @@
app:layout_constraintTop_toTopOf="parent"/>
<TextView
android:id="@+id/post_time_text_view_best_item_post_no_preview_link_type"
android:id="@+id/post_time_text_view_item_post_no_preview_link_type"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:gravity="end"
@ -89,7 +89,7 @@
</androidx.constraintlayout.widget.ConstraintLayout>
<TextView
android:id="@+id/title_text_view_best_item_post_no_preview_link_type"
android:id="@+id/title_text_view_item_post_no_preview_link_type"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingStart="16dp"

View File

@ -69,7 +69,7 @@
app:layout_constraintTop_toTopOf="parent"/>
<TextView
android:id="@+id/post_time_text_view_best_item_post_text_type"
android:id="@+id/post_time_text_view_item_post_text_type"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:gravity="end"
@ -89,7 +89,7 @@
</androidx.constraintlayout.widget.ConstraintLayout>
<TextView
android:id="@+id/title_text_view_best_item_post_text_type"
android:id="@+id/title_text_view_item_post_text_type"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingStart="16dp"

View File

@ -5,7 +5,7 @@
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp"
android:id="@+id/card_view_item_post_gif_type_autoplay"
android:id="@+id/card_view_item_post_video_and_gif_preview"
app:cardBackgroundColor="?attr/cardViewBackgroundColor"
app:cardElevation="2dp"
app:cardCornerRadius="16dp">
@ -21,7 +21,7 @@
android:padding="16dp">
<ml.docilealligator.infinityforreddit.CustomView.AspectRatioGifImageView
android:id="@+id/icon_gif_image_view_item_post_gif_type_autoplay"
android:id="@+id/icon_gif_image_view_item_post_video_and_gif_preview"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_gravity="center"
@ -30,20 +30,20 @@
app:layout_constraintTop_toTopOf="parent"/>
<TextView
android:id="@+id/subreddit_name_text_view_item_post_gif_type_autoplay"
android:id="@+id/subreddit_name_text_view_item_post_video_and_gif_preview"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginStart="16dp"
android:layout_marginEnd="8dp"
android:textSize="?attr/font_default"
app:layout_constraintBottom_toTopOf="@id/user_text_view_item_post_gif_type_autoplay"
app:layout_constraintStart_toEndOf="@id/icon_gif_image_view_item_post_gif_type_autoplay"
app:layout_constraintEnd_toStartOf="@id/stickied_post_image_view_item_post_gif_type_autoplay"
app:layout_constraintBottom_toTopOf="@id/user_text_view_item_post_video_and_gif_preview"
app:layout_constraintStart_toEndOf="@id/icon_gif_image_view_item_post_video_and_gif_preview"
app:layout_constraintEnd_toStartOf="@id/stickied_post_image_view_item_post_video_and_gif_preview"
app:layout_constraintTop_toTopOf="parent"/>
<TextView
android:id="@+id/user_text_view_item_post_gif_type_autoplay"
android:id="@+id/user_text_view_item_post_video_and_gif_preview"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
@ -52,24 +52,24 @@
android:maxLines="2"
android:ellipsize="end"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@+id/icon_gif_image_view_item_post_gif_type_autoplay"
app:layout_constraintEnd_toStartOf="@id/stickied_post_image_view_item_post_gif_type_autoplay"
app:layout_constraintTop_toBottomOf="@+id/subreddit_name_text_view_item_post_gif_type_autoplay"
app:layout_constraintStart_toEndOf="@+id/icon_gif_image_view_item_post_video_and_gif_preview"
app:layout_constraintEnd_toStartOf="@id/stickied_post_image_view_item_post_video_and_gif_preview"
app:layout_constraintTop_toBottomOf="@+id/subreddit_name_text_view_item_post_video_and_gif_preview"
app:layout_constraintHorizontal_bias="0" />
<ImageView
android:id="@+id/stickied_post_image_view_item_post_gif_type_autoplay"
android:id="@+id/stickied_post_image_view_item_post_video_and_gif_preview"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginEnd="8dp"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/subreddit_name_text_view_item_post_gif_type_autoplay"
app:layout_constraintStart_toEndOf="@id/subreddit_name_text_view_item_post_video_and_gif_preview"
app:layout_constraintEnd_toStartOf="@+id/guideline2"
app:layout_constraintTop_toTopOf="parent"/>
<TextView
android:id="@+id/post_time_text_view_best_item_post_gif_type_autoplay"
android:id="@+id/post_time_text_view_item_post_video_and_gif_preview"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:gravity="end"
@ -89,7 +89,7 @@
</androidx.constraintlayout.widget.ConstraintLayout>
<TextView
android:id="@+id/title_text_view_best_item_post_gif_type_autoplay"
android:id="@+id/title_text_view_item_post_video_and_gif_preview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingStart="16dp"
@ -105,7 +105,7 @@
app:flRowSpacing="8dp">
<com.libRG.CustomTextView
android:id="@+id/type_text_view_item_post_gif_type_autoplay"
android:id="@+id/type_text_view_item_post_video_and_gif_preview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="4dp"
@ -116,7 +116,7 @@
app:lib_setShape="rectangle" />
<com.libRG.CustomTextView
android:id="@+id/spoiler_custom_text_view_item_post_gif_type_autoplay"
android:id="@+id/spoiler_custom_text_view_item_post_video_and_gif_preview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
@ -129,7 +129,7 @@
app:lib_setShape="rectangle" />
<com.libRG.CustomTextView
android:id="@+id/nsfw_text_view_item_post_gif_type_autoplay"
android:id="@+id/nsfw_text_view_item_post_video_and_gif_preview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="4dp"
@ -141,7 +141,7 @@
app:lib_setShape="rectangle" />
<com.libRG.CustomTextView
android:id="@+id/flair_custom_text_view_item_post_gif_type_autoplay"
android:id="@+id/flair_custom_text_view_item_post_video_and_gif_preview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
@ -153,7 +153,7 @@
app:lib_setShape="rectangle" />
<com.libRG.CustomTextView
android:id="@+id/awards_text_view_item_post_gif_type_autoplay"
android:id="@+id/awards_text_view_item_post_video_and_gif_preview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="4dp"
@ -164,21 +164,21 @@
app:lib_setShape="rectangle" />
<ImageView
android:id="@+id/archived_image_view_item_post_gif_type_autoplay"
android:id="@+id/archived_image_view_item_post_video_and_gif_preview"
android:layout_width="24dp"
android:layout_height="24dp"
android:src="@drawable/ic_archive_outline"
android:visibility="gone" />
<ImageView
android:id="@+id/locked_image_view_item_post_gif_type_autoplay"
android:id="@+id/locked_image_view_item_post_video_and_gif_preview"
android:layout_width="24dp"
android:layout_height="24dp"
android:src="@drawable/ic_outline_lock_24dp"
android:visibility="gone" />
<ImageView
android:id="@+id/crosspost_image_view_item_post_gif_type_autoplay"
android:id="@+id/crosspost_image_view_item_post_video_and_gif_preview"
android:layout_width="24dp"
android:layout_height="24dp"
android:src="@drawable/crosspost"
@ -187,7 +187,6 @@
</com.nex3z.flowlayout.FlowLayout>
<RelativeLayout
android:id="@+id/image_view_wrapper_item_post_gif_type_autoplay"
android:layout_width="match_parent"
android:layout_height="wrap_content">
@ -196,7 +195,7 @@
android:layout_height="wrap_content">
<ml.docilealligator.infinityforreddit.CustomView.AspectRatioGifImageView
android:id="@+id/image_view_item_post_gif_type_autoplay"
android:id="@+id/image_view_item_post_video_and_gif_preview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
@ -213,19 +212,20 @@
</FrameLayout>
<ProgressBar
android:id="@+id/progress_bar_item_post_gif_type_autoplay"
android:id="@+id/progress_bar_item_post_video_and_gif_preview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true" />
<RelativeLayout
android:id="@+id/load_image_error_relative_layout_item_post_gif_type_autoplay"
android:id="@+id/load_image_error_relative_layout_item_post_video_and_gif_preview"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerInParent="true"
android:visibility="gone">
<TextView
android:id="@+id/load_image_error_text_view_item_post_video_and_gif_preview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawableTop="@drawable/ic_error_outline_black_24dp"
@ -239,12 +239,12 @@
</RelativeLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/bottom_constraint_layout_item_post_gif_type_autoplay"
android:id="@+id/bottom_constraint_layout_item_post_video_and_gif_preview"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/plus_button_item_post_gif_type_autoplay"
android:id="@+id/plus_button_item_post_video_and_gif_preview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="12dp"
@ -257,7 +257,7 @@
app:layout_constraintStart_toStartOf="parent" />
<TextView
android:id="@+id/score_text_view_item_post_gif_type_autoplay"
android:id="@+id/score_text_view_item_post_video_and_gif_preview"
android:layout_width="64dp"
android:layout_height="wrap_content"
android:gravity="center"
@ -265,10 +265,10 @@
android:textStyle="bold"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/plus_button_item_post_gif_type_autoplay" />
app:layout_constraintStart_toEndOf="@id/plus_button_item_post_video_and_gif_preview" />
<ImageView
android:id="@+id/minus_button_item_post_gif_type_autoplay"
android:id="@+id/minus_button_item_post_video_and_gif_preview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="12dp"
@ -278,10 +278,10 @@
android:focusable="true"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/score_text_view_item_post_gif_type_autoplay" />
app:layout_constraintStart_toEndOf="@id/score_text_view_item_post_video_and_gif_preview" />
<TextView
android:id="@+id/comments_count_item_post_gif_type_autoplay"
android:id="@+id/comments_count_item_post_video_and_gif_preview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="12dp"
@ -292,10 +292,10 @@
android:drawablePadding="12dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/minus_button_item_post_gif_type_autoplay" />
app:layout_constraintStart_toEndOf="@id/minus_button_item_post_video_and_gif_preview" />
<ImageView
android:id="@+id/save_button_item_post_gif_type_autoplay"
android:id="@+id/save_button_item_post_video_and_gif_preview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="12dp"
@ -305,11 +305,11 @@
app:layout_constraintHorizontal_bias="1"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/comments_count_item_post_gif_type_autoplay"
app:layout_constraintEnd_toStartOf="@id/share_button_item_post_gif_type_autoplay" />
app:layout_constraintStart_toEndOf="@id/comments_count_item_post_video_and_gif_preview"
app:layout_constraintEnd_toStartOf="@id/share_button_item_post_video_and_gif_preview" />
<ImageView
android:id="@+id/share_button_item_post_gif_type_autoplay"
android:id="@+id/share_button_item_post_video_and_gif_preview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="12dp"

View File

@ -69,7 +69,7 @@
app:layout_constraintTop_toTopOf="parent"/>
<TextView
android:id="@+id/post_time_text_view_best_item_post_video_type_autoplay"
android:id="@+id/post_time_text_view_item_post_video_type_autoplay"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:gravity="end"
@ -89,7 +89,7 @@
</androidx.constraintlayout.widget.ConstraintLayout>
<TextView
android:id="@+id/title_text_view_best_item_post_video_type_autoplay"
android:id="@+id/title_text_view_item_post_video_type_autoplay"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingStart="16dp"
@ -187,7 +187,7 @@
</com.nex3z.flowlayout.FlowLayout>
<com.google.android.exoplayer2.ui.AspectRatioFrameLayout
android:id="@+id/aspect"
android:id="@+id/aspect_ratio_frame_layout_item_post_video_type_autoplay"
android:layout_width="match_parent"
android:layout_height="0dp"
android:background="#000000"

View File

@ -122,4 +122,22 @@
<item>XLarge</item>
<item>XXLarge</item>
</string-array>
<string-array name="settings_tab_post_type">
<item>Home</item>
<item>Popular</item>
<item>All</item>
<item>Subreddit</item>
<item>MultiReddit</item>
<item>User</item>
</string-array>
<string-array name="settings_tab_post_type_values">
<item>0</item>
<item>1</item>
<item>2</item>
<item>3</item>
<item>4</item>
<item>5</item>
</string-array>
</resources>

View File

@ -321,6 +321,8 @@
<string name="settings_immersive_interface_title">Immersive Interface</string>
<string name="settings_immersive_interface_ignore_nav_bar_title">Ignore Navigation Bar in Immersive Interface</string>
<string name="settings_immersive_interface_ignore_nav_bar_summary">Prevent the Bottom Navigation Bar Having Extra Padding</string>
<string name="settings_customize_tabs_in_main_page_title">Customize Tabs in Main Page</string>
<string name="settings_customize_tabs_in_main_page_summary">Only for Logged-in User</string>
<string name="settings_enable_bottom_app_bar_title">Enable Bottom Navigation</string>
<string name="settings_enable_bottom_app_bar_summary">Has No Effect in Anonymous Mode</string>
<string name="settings_vote_buttons_on_the_right_title">Vote Buttons on the Right</string>
@ -336,6 +338,7 @@
<string name="settings_show_elapsed_time">Show Elapsed Time in Posts and Comments</string>
<string name="settings_default_post_layout">Default Post Layout</string>
<string name="settings_show_divider_in_compact_layout">Show Divider in Compact Layout</string>
<string name="settings_swap_tap_and_long_title">Swap Tap and Long Press in Comments</string>
<string name="settings_swipe_to_go_back_from_post_detail_title">Swipe Right to Go Back From Comments</string>
<string name="settings_lock_jump_to_next_top_level_comment_button_title">Lock Jump to Next Top-level Comment Button</string>
<string name="settings_lock_bottom_app_bar_title">Lock Bottom Navigation Bar</string>
@ -392,6 +395,15 @@
<string name="settings_delete_all_themes_in_database_title">Delete All Themes in Database</string>
<string name="settings_reset_all_settings_title">Reset All Settings</string>
<string name="settings_advanced_settings_summary">Clean the database and shared preferences</string>
<string name="settings_tab_info">Restart the app to see the changes</string>
<string name="settings_tab_1_summary">Tab 1</string>
<string name="settings_tab_2_summary">Tab 2</string>
<string name="settings_tab_3_summary">Tab 3</string>
<string name="settings_tab_title">Title</string>
<string name="settings_tab_post_type">Type</string>
<string name="settings_tab_subreddit_name">Subreddit Name (Without r/ prefix)</string>
<string name="settings_tab_multi_reddit_name">MultiReddit Name (/user/yourusername/m/yourmultiredditname)</string>
<string name="settings_tab_username">Username (Without u/ prefix)</string>
<string name="no_link_available">Cannot get the link</string>
@ -710,10 +722,13 @@
<string name="report_successful">Reported</string>
<string name="report_failed">Report failed</string>
<string name="report_reason_not_selected">You haven\'t selected a reason</string>
<string name="report_reason_general_spam">It Is Spam</string>
<string name="report_reason_general_copyright_issue">It Contains Copyright Issue</string>
<string name="report_reason_general_child_pornography">It Contains Child Pornography</string>
<string name="report_reason_general_abusive_content">It Contains Abusive Content</string>
<string name="home">Home</string>
<string name="popular">Popular</string>
</resources>

View File

@ -0,0 +1,76 @@
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<Preference
android:icon="@drawable/ic_info_preference_24dp"
app:summary="@string/settings_tab_info"
app:enabled="false" />
<PreferenceCategory
app:title="@string/settings_tab_1_summary" />
<EditTextPreference
app:defaultValue="@string/home"
app:key="main_page_tab_1_title"
app:title="@string/settings_tab_title"
app:useSimpleSummaryProvider="true" />
<ListPreference
app:defaultValue="0"
android:entries="@array/settings_tab_post_type"
app:entryValues="@array/settings_tab_post_type_values"
app:key="main_page_tab_1_post_type"
app:title="@string/settings_tab_post_type"
app:useSimpleSummaryProvider="true" />
<EditTextPreference
app:key="main_page_tab_1_name"
app:isPreferenceVisible="false"
app:useSimpleSummaryProvider="true" />
<PreferenceCategory
app:title="@string/settings_tab_2_summary" />
<EditTextPreference
app:defaultValue="@string/popular"
app:key="main_page_tab_2_title"
app:title="@string/settings_tab_title"
app:useSimpleSummaryProvider="true" />
<ListPreference
app:defaultValue="1"
android:entries="@array/settings_tab_post_type"
app:entryValues="@array/settings_tab_post_type_values"
app:key="main_page_tab_2_post_type"
app:title="@string/settings_tab_post_type"
app:useSimpleSummaryProvider="true" />
<EditTextPreference
app:key="main_page_tab_2_name"
app:isPreferenceVisible="false"
app:useSimpleSummaryProvider="true" />
<PreferenceCategory
app:title="@string/settings_tab_3_summary" />
<EditTextPreference
app:defaultValue="@string/all"
app:key="main_page_tab_3_title"
app:title="@string/settings_tab_title"
app:useSimpleSummaryProvider="true" />
<ListPreference
app:defaultValue="2"
android:entries="@array/settings_tab_post_type"
app:entryValues="@array/settings_tab_post_type_values"
app:key="main_page_tab_3_post_type"
app:title="@string/settings_tab_post_type"
app:useSimpleSummaryProvider="true" />
<EditTextPreference
app:key="main_page_tab_3_name"
app:isPreferenceVisible="false"
app:useSimpleSummaryProvider="true" />
</PreferenceScreen>

View File

@ -33,4 +33,9 @@
app:key="volume_keys_navigate_posts"
app:title="@string/settings_volume_keys_navigate_posts_title" />
<SwitchPreference
app:defaultValue="false"
app:key="swap_tap_and_long_in_comments"
app:title="@string/settings_swap_tap_and_long_title" />
</PreferenceScreen>

View File

@ -20,6 +20,11 @@
app:summary="@string/settings_immersive_interface_ignore_nav_bar_summary"
app:isPreferenceVisible="false" />
<Preference
app:title="@string/settings_customize_tabs_in_main_page_title"
app:summary="@string/settings_customize_tabs_in_main_page_summary"
app:fragment="ml.docilealligator.infinityforreddit.Settings.CustomizeMainPageTabsFragment" />
<SwitchPreference
app:defaultValue="false"
app:key="bottom_app_bar"