mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-09-24 05:04:50 -04:00
Merge pull request #1733 from kiwix/feature/macgills/1732-npe-tts
#1732 3.1.3 Crash Report: NPE CoreMainActivity.setupTTS - guard mainM…
This commit is contained in:
commit
237c4aa3d5
@ -493,8 +493,10 @@ public abstract class CoreMainActivity extends BaseActivity
|
|||||||
tabRecyclerView.getLayoutManager() != null) {
|
tabRecyclerView.getLayoutManager() != null) {
|
||||||
tabRecyclerView.getLayoutManager().scrollToPosition(tabsAdapter.getSelected());
|
tabRecyclerView.getLayoutManager().scrollToPosition(tabsAdapter.getSelected());
|
||||||
}
|
}
|
||||||
|
if (mainMenu != null) {
|
||||||
mainMenu.showTabSwitcherOptions();
|
mainMenu.showTabSwitcherOptions();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void startAnimation(View view, @AnimRes int anim) {
|
private void startAnimation(View view, @AnimRes int anim) {
|
||||||
view.startAnimation(AnimationUtils.loadAnimation(view.getContext(), anim));
|
view.startAnimation(AnimationUtils.loadAnimation(view.getContext(), anim));
|
||||||
@ -662,7 +664,9 @@ public abstract class CoreMainActivity extends BaseActivity
|
|||||||
@Override
|
@Override
|
||||||
public void onSpeakingStarted() {
|
public void onSpeakingStarted() {
|
||||||
runOnUiThread(() -> {
|
runOnUiThread(() -> {
|
||||||
|
if (mainMenu != null) {
|
||||||
mainMenu.onTextToSpeechStartedTalking();
|
mainMenu.onTextToSpeechStartedTalking();
|
||||||
|
}
|
||||||
TTSControls.setVisibility(View.VISIBLE);
|
TTSControls.setVisibility(View.VISIBLE);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -670,7 +674,9 @@ public abstract class CoreMainActivity extends BaseActivity
|
|||||||
@Override
|
@Override
|
||||||
public void onSpeakingEnded() {
|
public void onSpeakingEnded() {
|
||||||
runOnUiThread(() -> {
|
runOnUiThread(() -> {
|
||||||
|
if (mainMenu != null) {
|
||||||
mainMenu.onTextToSpeechStoppedTalking();
|
mainMenu.onTextToSpeechStoppedTalking();
|
||||||
|
}
|
||||||
TTSControls.setVisibility(View.GONE);
|
TTSControls.setVisibility(View.GONE);
|
||||||
pauseTTSButton.setText(R.string.tts_pause);
|
pauseTTSButton.setText(R.string.tts_pause);
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user