Fixed collapsed notification not getting colored.
This commit is contained in:
parent
75fd241ab8
commit
4017815711
3 changed files with 26 additions and 3 deletions
|
|
@ -26,8 +26,8 @@ android {
|
||||||
applicationId "com.kabouzeid.gramophone"
|
applicationId "com.kabouzeid.gramophone"
|
||||||
minSdkVersion 16
|
minSdkVersion 16
|
||||||
targetSdkVersion 22
|
targetSdkVersion 22
|
||||||
versionCode 42
|
versionCode 43
|
||||||
versionName "0.9.26b dev-1"
|
versionName "0.9.27b dev-1"
|
||||||
}
|
}
|
||||||
|
|
||||||
buildTypes {
|
buildTypes {
|
||||||
|
|
|
||||||
|
|
@ -242,6 +242,7 @@ public class PlayingNotificationHelper {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setBackgroundColor(int color) {
|
private void setBackgroundColor(int color) {
|
||||||
|
notificationLayout.setInt(R.id.root, "setBackgroundColor", color);
|
||||||
notificationLayoutExpanded.setInt(R.id.root, "setBackgroundColor", color);
|
notificationLayoutExpanded.setInt(R.id.root, "setBackgroundColor", color);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,20 +11,38 @@ import java.io.ObjectOutputStream;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Karim Abou Zeid (kabouzeid)
|
* @author Karim Abou Zeid (kabouzeid)
|
||||||
|
* <p/>
|
||||||
|
* A simple helper class for Android to read and write
|
||||||
|
* any serializeable object to the internal storage
|
||||||
*/
|
*/
|
||||||
public final class InternalStorageUtil {
|
public final class InternalStorageUtil {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param context a valid {@link Context}
|
||||||
|
* @param key the filename
|
||||||
|
* @param object any {@link java.io.Serializable} object which will be written to the internal storage
|
||||||
|
*/
|
||||||
public static synchronized void writeObject(final Context context, final String key, final Object object) throws IOException {
|
public static synchronized void writeObject(final Context context, final String key, final Object object) throws IOException {
|
||||||
String tempFileName = "TEMP_" + key;
|
// First write the object to a file with ".tmp" postfix,
|
||||||
|
// so when an error occurs, we do not overwrite the original
|
||||||
|
// file (if exists) with a corrupted file.
|
||||||
|
String tempFileName = key + ".tmp";
|
||||||
FileOutputStream fos;
|
FileOutputStream fos;
|
||||||
fos = context.openFileOutput(tempFileName, Context.MODE_PRIVATE);
|
fos = context.openFileOutput(tempFileName, Context.MODE_PRIVATE);
|
||||||
ObjectOutputStream oos = new ObjectOutputStream(fos);
|
ObjectOutputStream oos = new ObjectOutputStream(fos);
|
||||||
oos.writeObject(object);
|
oos.writeObject(object);
|
||||||
oos.close();
|
oos.close();
|
||||||
fos.close();
|
fos.close();
|
||||||
|
// after writing was successful we overwrite the original
|
||||||
|
// file (if exists) with the new file
|
||||||
renameAppFile(context, tempFileName, key);
|
renameAppFile(context, tempFileName, key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param context a valid {@link Context}
|
||||||
|
* @param originalFileName the original filename
|
||||||
|
* @param newFileName the new filename
|
||||||
|
*/
|
||||||
public static synchronized void renameAppFile(final Context context, String originalFileName, String newFileName) {
|
public static synchronized void renameAppFile(final Context context, String originalFileName, String newFileName) {
|
||||||
File originalFile = context.getFileStreamPath(originalFileName);
|
File originalFile = context.getFileStreamPath(originalFileName);
|
||||||
File newFile = new File(originalFile.getParent(), newFileName);
|
File newFile = new File(originalFile.getParent(), newFileName);
|
||||||
|
|
@ -35,6 +53,10 @@ public final class InternalStorageUtil {
|
||||||
originalFile.renameTo(newFile);
|
originalFile.renameTo(newFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param context a valid {@link Context}
|
||||||
|
* @param key the filename
|
||||||
|
*/
|
||||||
public static synchronized Object readObject(final Context context, String key) throws IOException,
|
public static synchronized Object readObject(final Context context, String key) throws IOException,
|
||||||
ClassNotFoundException {
|
ClassNotFoundException {
|
||||||
FileInputStream fis = context.openFileInput(key);
|
FileInputStream fis = context.openFileInput(key);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue