Fix #1887 Notifications shown to user where ever needed

This commit is contained in:
Yash Khare 2020-03-13 11:36:05 +05:30
parent 8d142a70b8
commit 8b68c80a65
3 changed files with 11 additions and 3 deletions

View File

@ -1447,8 +1447,9 @@ public abstract class CoreMainActivity extends BaseActivity
} else {
searchForTitle(title);
}
} else { //TODO: Inform the User
} else {
Log.w(TAG_KIWIX, "Unhandled search failure");
Toast.makeText(this, R.string.search_error, Toast.LENGTH_SHORT).show();
}
break;
case REQUEST_PREFERENCES:

View File

@ -87,7 +87,9 @@ public class KiwixTextToSpeech {
onInitSucceedListener.onInitSucceed();
} else {
Log.e(TAG_KIWIX, "Initialization of TextToSpeech Failed!");
//TODO: Surface to user
Toast.makeText(context,
context.getResources().getString(R.string.texttospeech_initialization_failed),
Toast.LENGTH_SHORT).show();
}
});
}
@ -301,7 +303,9 @@ public class KiwixTextToSpeech {
@Override
public void onError(String s) {
Log.e(TAG_KIWIX, "TextToSpeech Error: " + s);
//TODO: Surface to user
Toast.makeText(context,
context.getResources().getString(R.string.texttospeech_error),
Toast.LENGTH_SHORT).show();
}
});
}

View File

@ -134,6 +134,9 @@
<string name="confirm_stop_download_msg">Are you sure you want to stop this download?</string>
<string name="download_change_storage" tools:keep="@string/download_change_storage">Storage device selector</string>
<string name="tts_not_enabled">Text to speech is not enabled for this ZIM file</string>
<string name="texttospeech_initialization_failed">Initialization of Text to Speech failed. Please try again</string>
<string name="texttospeech_error">Unexpected error in Text to Speech. Please try again</string>
<string name="search_error">Unexpected error while searching. Please try again</string>
<string name="next">Next</string>
<string name="previous">Previous</string>
<string name="wifi_only_title">Allow downloading content via mobile network?</string>