Fix additional Play Store crash bugs.

This commit is contained in:
Akinwale Ariwodola 2020-05-26 16:25:37 +01:00
parent 4c50ffac19
commit 94b0c7bc01
3 changed files with 9 additions and 3 deletions

View file

@ -255,6 +255,7 @@ public class MainActivity extends AppCompatActivity implements SdkStatusListener
public static final String ACTION_USER_AUTHENTICATION_FAILED = "io.lbry.browser.Broadcast.UserAuthenticationFailed";
public static final String ACTION_NOW_PLAYING_CLAIM_UPDATED = "io.lbry.browser.Broadcast.NowPlayingClaimUpdated";
public static final String ACTION_NOW_PLAYING_CLAIM_CLEARED = "io.lbry.browser.Broadcast.NowPlayingClaimCleared";
public static final String ACTION_PUBLISH_SUCCESSFUL = "io.lbry.browser.Broadcast.PublishSuccessful";
public static final String ACTION_OPEN_ALL_CONTENT_TAG = "io.lbry.browser.Broadcast.OpenAllContentTag";
public static final String ACTION_WALLET_BALANCE_UPDATED = "io.lbry.browser.Broadcast.WalletBalanceUpdated";
public static final String ACTION_OPEN_CHANNEL_URL = "io.lbry.browser.Broadcast.OpenChannelUrl";
@ -1842,6 +1843,7 @@ public class MainActivity extends AppCompatActivity implements SdkStatusListener
intentFilter.addAction(ACTION_OPEN_CHANNEL_URL);
intentFilter.addAction(ACTION_OPEN_WALLET_PAGE);
intentFilter.addAction(ACTION_OPEN_REWARDS_PAGE);
intentFilter.addAction(ACTION_PUBLISH_SUCCESSFUL);
intentFilter.addAction(ACTION_SAVE_SHARED_USER_STATE);
requestsReceiver = new BroadcastReceiver() {
@Override
@ -1861,6 +1863,8 @@ public class MainActivity extends AppCompatActivity implements SdkStatusListener
pendingOpenRewardsPage = true;
} else if (ACTION_SAVE_SHARED_USER_STATE.equalsIgnoreCase(action)) {
saveSharedUserState();
} else if (ACTION_PUBLISH_SUCCESSFUL.equalsIgnoreCase(action)) {
openPublishesOnSuccessfulPublish();
}
}

View file

@ -1102,7 +1102,7 @@ public class PublishFormFragment extends BaseFragment implements
if (context instanceof MainActivity) {
MainActivity activity = (MainActivity) context;
activity.showMessage(R.string.publish_successful);
activity.openPublishesOnSuccessfulPublish();
activity.sendBroadcast(new Intent(MainActivity.ACTION_PUBLISH_SUCCESSFUL));
}
}

View file

@ -286,8 +286,10 @@ public class RewardsFragment extends BaseFragment implements RewardListAdapter.R
@Override
public void onError(Exception error) {
Snackbar.make(getView(), error.getMessage(), Snackbar.LENGTH_LONG).
setBackgroundTint(Color.RED).setTextColor(Color.WHITE).show();
View view = getView();
if (view != null && error != null && !Helper.isNullOrEmpty(error.getMessage())) {
Snackbar.make(view, error.getMessage(), Snackbar.LENGTH_LONG).setBackgroundTint(Color.RED).setTextColor(Color.WHITE).show();
}
Helper.setViewEnabled(buttonClaim, true);
Helper.setViewEnabled(inputClaimCode, true);
rewardClaimInProgress = false;