Don't start lazy mode when refreshing posts in PostFragment. Minor bugs fixed.

This commit is contained in:
Alex Ning 2019-08-26 20:16:40 +08:00
parent 2a356aa12e
commit 9469ecc611
6 changed files with 16 additions and 7 deletions

View File

@ -406,6 +406,8 @@ public class PostFragment extends Fragment implements FragmentCommunicator {
if(isInLazyMode) { if(isInLazyMode) {
stopLazyMode(); stopLazyMode();
} }
hasPost = false;
mPostViewModel.refresh(); mPostViewModel.refresh();
} }

View File

@ -227,7 +227,9 @@ public class PostImageActivity extends AppCompatActivity implements FlairBottomS
isPosting = false; isPosting = false;
if(getIntent().hasExtra(EXTRA_SUBREDDIT_NAME)) { if(getIntent().hasExtra(EXTRA_SUBREDDIT_NAME)) {
subredditName = getIntent().getExtras().getString(EXTRA_SUBREDDIT_NAME); loadSubredditIconSuccessful = false;
subredditName = getIntent().getStringExtra(EXTRA_SUBREDDIT_NAME);
subredditSelected = true;
subredditNameTextView.setTextColor(getResources().getColor(R.color.primaryTextColor)); subredditNameTextView.setTextColor(getResources().getColor(R.color.primaryTextColor));
subredditNameTextView.setText(subredditName); subredditNameTextView.setText(subredditName);
loadSubredditIcon(); loadSubredditIcon();

View File

@ -197,7 +197,9 @@ public class PostLinkActivity extends AppCompatActivity implements FlairBottomSh
isPosting = false; isPosting = false;
if(getIntent().hasExtra(EXTRA_SUBREDDIT_NAME)) { if(getIntent().hasExtra(EXTRA_SUBREDDIT_NAME)) {
subredditName = getIntent().getExtras().getString(EXTRA_SUBREDDIT_NAME); loadSubredditIconSuccessful = false;
subredditName = getIntent().getStringExtra(EXTRA_SUBREDDIT_NAME);
subredditSelected = true;
subredditNameTextView.setTextColor(getResources().getColor(R.color.primaryTextColor)); subredditNameTextView.setTextColor(getResources().getColor(R.color.primaryTextColor));
subredditNameTextView.setText(subredditName); subredditNameTextView.setText(subredditName);
flairTextView.setVisibility(View.VISIBLE); flairTextView.setVisibility(View.VISIBLE);

View File

@ -198,7 +198,8 @@ public class PostTextActivity extends AppCompatActivity implements FlairBottomSh
if(getIntent().hasExtra(EXTRA_SUBREDDIT_NAME)) { if(getIntent().hasExtra(EXTRA_SUBREDDIT_NAME)) {
loadSubredditIconSuccessful = false; loadSubredditIconSuccessful = false;
subredditName = getIntent().getExtras().getString(EXTRA_SUBREDDIT_NAME); subredditName = getIntent().getStringExtra(EXTRA_SUBREDDIT_NAME);
subredditSelected = true;
subredditNameTextView.setTextColor(getResources().getColor(R.color.primaryTextColor)); subredditNameTextView.setTextColor(getResources().getColor(R.color.primaryTextColor));
subredditNameTextView.setText(subredditName); subredditNameTextView.setText(subredditName);
flairTextView.setVisibility(View.VISIBLE); flairTextView.setVisibility(View.VISIBLE);

View File

@ -225,7 +225,9 @@ public class PostVideoActivity extends AppCompatActivity implements FlairBottomS
isPosting = false; isPosting = false;
if(getIntent().hasExtra(EXTRA_SUBREDDIT_NAME)) { if(getIntent().hasExtra(EXTRA_SUBREDDIT_NAME)) {
subredditName = getIntent().getExtras().getString(EXTRA_SUBREDDIT_NAME); loadSubredditIconSuccessful = false;
subredditName = getIntent().getStringExtra(EXTRA_SUBREDDIT_NAME);
subredditSelected = true;
subredditNameTextView.setTextColor(getResources().getColor(R.color.primaryTextColor)); subredditNameTextView.setTextColor(getResources().getColor(R.color.primaryTextColor));
subredditNameTextView.setText(subredditName); subredditNameTextView.setText(subredditName);
loadSubredditIcon(); loadSubredditIcon();

View File

@ -554,17 +554,17 @@ public class ViewSubredditDetailActivity extends AppCompatActivity implements So
break; break;
case PostTypeBottomSheetFragment.TYPE_LINK: case PostTypeBottomSheetFragment.TYPE_LINK:
intent = new Intent(this, PostLinkActivity.class); intent = new Intent(this, PostLinkActivity.class);
intent.putExtra(PostTextActivity.EXTRA_SUBREDDIT_NAME, subredditName); intent.putExtra(PostLinkActivity.EXTRA_SUBREDDIT_NAME, subredditName);
startActivity(intent); startActivity(intent);
break; break;
case PostTypeBottomSheetFragment.TYPE_IMAGE: case PostTypeBottomSheetFragment.TYPE_IMAGE:
intent = new Intent(this, PostImageActivity.class); intent = new Intent(this, PostImageActivity.class);
intent.putExtra(PostTextActivity.EXTRA_SUBREDDIT_NAME, subredditName); intent.putExtra(PostImageActivity.EXTRA_SUBREDDIT_NAME, subredditName);
startActivity(intent); startActivity(intent);
break; break;
case PostTypeBottomSheetFragment.TYPE_VIDEO: case PostTypeBottomSheetFragment.TYPE_VIDEO:
intent = new Intent(this, PostVideoActivity.class); intent = new Intent(this, PostVideoActivity.class);
intent.putExtra(PostTextActivity.EXTRA_SUBREDDIT_NAME, subredditName); intent.putExtra(PostVideoActivity.EXTRA_SUBREDDIT_NAME, subredditName);
startActivity(intent); startActivity(intent);
} }
} }