Skip to content
This repository has been archived by the owner on Feb 1, 2025. It is now read-only.

Commit

Permalink
fixed a bug with notification update when renaming a station
Browse files Browse the repository at this point in the history
  • Loading branch information
y20k committed Nov 10, 2015
1 parent a19b9f2 commit 3c55145
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 15 deletions.
7 changes: 4 additions & 3 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="org.y20k.transistor">
<!-- android:versionCode="4"
package="org.y20k.transistor"
android:versionCode="4"
android:versionName="0.9.3 (Young Americans)">

<uses-sdk android:minSdkVersion="19" android:targetSdkVersion="23" /> -->
<uses-sdk android:minSdkVersion="19" android:targetSdkVersion="23" />

<uses-permission android:name="android.permission.INTERNET" />

<application
android:allowBackup="true"
android:fullBackupContent="@xml/backupscheme"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/TransistorAppTheme">
Expand Down
19 changes: 14 additions & 5 deletions app/src/main/java/org/y20k/transistor/helpers/DialogRename.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.EditText;
Expand All @@ -31,11 +33,13 @@
*/
public class DialogRename {


/* Define log tag */
private static final String LOG_TAG = DialogRename.class.getSimpleName();


/* Keys */
private static final String PLAYBACK = "playback";


/* Main class variables */
private final Context mContext;
Expand Down Expand Up @@ -88,11 +92,16 @@ public void onClick(DialogInterface arg0, int arg1) {
mStationRenamedListener.stationRenamed();
}

// // put up changed notification (if playback)
// NotificationHelper notificationHelper = new NotificationHelper(context);
// notificationHelper.setStationName(mStationName);
// notificationHelper.createNotification();
// check for playback
SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(mContext);
boolean playback = settings.getBoolean(PLAYBACK, false);

if (playback) {
// put up changed notification
NotificationHelper notificationHelper = new NotificationHelper(mContext);
notificationHelper.setStationName(mStationName);
notificationHelper.createNotification();
}

}
}
Expand Down
5 changes: 0 additions & 5 deletions app/src/main/res/drawable/background_actionbar.xml

This file was deleted.

2 changes: 1 addition & 1 deletion app/src/main/res/values-de/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
<body>
<h1>Wie Transistor funktioniert</h1>
<h2>Wie füge ich eine neue Radiostation hinzu?</h2>
<p>Die einfachste Variante eine neue Station hinzuzufügen ist: Im Web nach Streaminglinks (M§U und PLS) suchen und diese dann mit Transistor öffnen. Man kann zudem auch auf das (+)-Symbol tippen und M3U-Links via Copy und Paste direkt eingeben.</p>
<p>Die einfachste Variante eine neue Station hinzuzufügen ist: Im Web nach Streaminglinks (M3U und PLS) suchen und diese dann mit Transistor zu öffnen. Man kann zudem auch auf das (+)-Symbol tippen und Streaminglinks via Copy und Paste direkt eingeben.</p>
<h2>Wie schalte ich das Radio ein?</h2>
<p>Den großen Play-Knopf drücken ;).</p>
<h2>Wie schalte ich das Radio wieder aus?</h2>
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
<string name="notification_swipe_to_stop">Swipe to stop</string>
<string name="notification_playing">Playing</string>


<!-- misc -->
<string name="title_activity_infosheet">Info Sheet</string>

Expand Down
5 changes: 5 additions & 0 deletions app/src/main/res/xml/backupscheme.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<full-backup-content>
<!-- backup files from external storage -->
<include domain="external" />
</full-backup-content>

0 comments on commit 3c55145

Please sign in to comment.