Use string values in HotspotService

This commit is contained in:
Adeel Zafar 2019-08-16 03:24:25 +05:00
parent 414a667564
commit b812fec0cb
2 changed files with 5 additions and 2 deletions

View File

@ -123,7 +123,8 @@ public class HotspotService extends Service {
private Notification buildForegroundNotification(String status) {
Log.v(TAG, "Building notification " + status);
builder = new NotificationCompat.Builder(this);
builder.setContentTitle("Kiwix Hotspot").setContentText(status);
builder.setContentTitle(getString(R.string.hotspot_notification_content_title))
.setContentText(status);
Intent targetIntent = new Intent(this, ZimHostActivity.class);
targetIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
PendingIntent contentIntent =
@ -167,7 +168,7 @@ public class HotspotService extends Service {
NotificationChannel hotspotServiceChannel = new NotificationChannel(
Constants.HOTSPOT_SERVICE_CHANNEL_ID, getString(R.string.hotspot_service_channel_name),
NotificationManager.IMPORTANCE_DEFAULT);
hotspotServiceChannel.setDescription("Sample hotspot description");
hotspotServiceChannel.setDescription(getString(R.string.hotspot_channel_description));
hotspotServiceChannel.setSound(null, null);
builder.setChannelId(Constants.HOTSPOT_SERVICE_CHANNEL_ID);
notificationManager.createNotificationChannel(hotspotServiceChannel);

View File

@ -50,6 +50,8 @@
<string name="hotspot_dialog_title">Turn on your WIFI hotspot</string>
<string name="hotspot_dialog_message">In order for this feature to work you need to first turn on your WIFI hotspot manually.</string>
<string name="hotspot_dialog_neutral_button">YES, IVE TURNED IT ON</string>
<string name="hotspot_channel_description">Updates about the state of your hotspot/server.</string>
<string name="hotspot_notification_content_title">Kiwix Hotspot</string>
<string name="sample_ip_address">http://000.000.000.000</string>
<string name="start_server_label">Start server</string>
<string name="stop_server_label">Stop server</string>