diff --git a/app/src/main/java/com/kabouzeid/gramophone/service/MusicService.java b/app/src/main/java/com/kabouzeid/gramophone/service/MusicService.java
index 1b8a5e1f..9c6fd13f 100644
--- a/app/src/main/java/com/kabouzeid/gramophone/service/MusicService.java
+++ b/app/src/main/java/com/kabouzeid/gramophone/service/MusicService.java
@@ -201,12 +201,7 @@ public class MusicService extends Service implements SharedPreferences.OnSharedP
registerReceiver(widgetIntentReceiver, new IntentFilter(APP_WIDGET_UPDATE));
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
- playingNotification = new PlayingNotificationImpl24();
- } else {
- playingNotification = new PlayingNotificationImpl();
- }
- playingNotification.init(this);
+ initNotification();
mediaStoreObserver = new MediaStoreObserver(playerHandler);
throttledSeekHandler = new ThrottledSeekHandler(playerHandler);
@@ -557,8 +552,17 @@ public class MusicService extends Service implements SharedPreferences.OnSharedP
return (getAudioManager().requestAudioFocus(audioFocusListener, AudioManager.STREAM_MUSIC, AudioManager.AUDIOFOCUS_GAIN) == AudioManager.AUDIOFOCUS_REQUEST_GRANTED);
}
- private void updateNotification() {
- if (getCurrentSong().id != -1) {
+ public void initNotification() {
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N && !PreferenceUtil.getInstance(this).classicNotification()) {
+ playingNotification = new PlayingNotificationImpl24();
+ } else {
+ playingNotification = new PlayingNotificationImpl();
+ }
+ playingNotification.init(this);
+ }
+
+ public void updateNotification() {
+ if (playingNotification != null && getCurrentSong().id != -1) {
playingNotification.update();
}
}
diff --git a/app/src/main/java/com/kabouzeid/gramophone/ui/activities/AboutActivity.java b/app/src/main/java/com/kabouzeid/gramophone/ui/activities/AboutActivity.java
index 71ddbe33..c5963878 100644
--- a/app/src/main/java/com/kabouzeid/gramophone/ui/activities/AboutActivity.java
+++ b/app/src/main/java/com/kabouzeid/gramophone/ui/activities/AboutActivity.java
@@ -32,10 +32,11 @@ import de.psdev.licensesdialog.LicensesDialog;
@SuppressWarnings("FieldCanBeLocal")
public class AboutActivity extends AbsBaseActivity implements View.OnClickListener {
+ private static String GITHUB = "https://github.com/kabouzeid/Phonograph";
+
private static String GOOGLE_PLUS = "https://google.com/+KarimAbouZeid23697";
private static String TWITTER = "https://twitter.com/karim23697";
- private static String GITHUB = "https://github.com/kabouzeid";
- private static String WEBSITE = "http://kabouzeid.com/";
+ private static String WEBSITE = "https://kabouzeid.com/";
private static String GOOGLE_PLUS_COMMUNITY = "https://plus.google.com/u/0/communities/106227738496107108513";
private static String TRANSLATE = "https://phonograph.oneskyapp.com/collaboration/project?id=26521";
@@ -61,6 +62,8 @@ public class AboutActivity extends AbsBaseActivity implements View.OnClickListen
LinearLayout intro;
@BindView(R.id.licenses)
LinearLayout licenses;
+ @BindView(R.id.write_an_email)
+ LinearLayout writeAnEmail;
@BindView(R.id.add_to_google_plus_circles)
LinearLayout addToGooglePlusCircles;
@BindView(R.id.follow_on_twitter)
@@ -132,6 +135,7 @@ public class AboutActivity extends AbsBaseActivity implements View.OnClickListen
forkOnGitHub.setOnClickListener(this);
visitWebsite.setOnClickListener(this);
reportBugs.setOnClickListener(this);
+ writeAnEmail.setOnClickListener(this);
joinGooglePlusCommunity.setOnClickListener(this);
translate.setOnClickListener(this);
rateOnGooglePlay.setOnClickListener(this);
@@ -180,6 +184,12 @@ public class AboutActivity extends AbsBaseActivity implements View.OnClickListen
openUrl(WEBSITE);
} else if (v == reportBugs) {
startActivity(new Intent(this, BugReportActivity.class));
+ } else if (v == writeAnEmail) {
+ Intent intent = new Intent(Intent.ACTION_SENDTO);
+ intent.setData(Uri.parse("mailto:contact@kabouzeid.com"));
+ intent.putExtra(Intent.EXTRA_EMAIL, "contact@kabouzeid.com");
+ intent.putExtra(Intent.EXTRA_SUBJECT, "Phonograph");
+ startActivity(Intent.createChooser(intent, "E-Mail"));
} else if (v == joinGooglePlusCommunity) {
openUrl(GOOGLE_PLUS_COMMUNITY);
} else if (v == translate) {
diff --git a/app/src/main/java/com/kabouzeid/gramophone/ui/activities/SettingsActivity.java b/app/src/main/java/com/kabouzeid/gramophone/ui/activities/SettingsActivity.java
index b88af31d..659766ea 100644
--- a/app/src/main/java/com/kabouzeid/gramophone/ui/activities/SettingsActivity.java
+++ b/app/src/main/java/com/kabouzeid/gramophone/ui/activities/SettingsActivity.java
@@ -26,8 +26,10 @@ import com.kabouzeid.appthemehelper.common.prefs.supportv7.ATEPreferenceFragment
import com.kabouzeid.appthemehelper.util.ColorUtil;
import com.kabouzeid.gramophone.R;
import com.kabouzeid.gramophone.appshortcuts.DynamicShortcutManager;
+import com.kabouzeid.gramophone.helper.MusicPlayerRemote;
import com.kabouzeid.gramophone.preferences.NowPlayingScreenPreference;
import com.kabouzeid.gramophone.preferences.NowPlayingScreenPreferenceDialog;
+import com.kabouzeid.gramophone.service.MusicService;
import com.kabouzeid.gramophone.ui.activities.base.AbsBaseActivity;
import com.kabouzeid.gramophone.util.NavigationUtil;
import com.kabouzeid.gramophone.util.PreferenceUtil;
@@ -127,6 +129,7 @@ public class SettingsActivity extends AbsBaseActivity implements ColorChooserDia
public void onCreatePreferences(Bundle bundle, String s) {
addPreferencesFromResource(R.xml.pref_general);
addPreferencesFromResource(R.xml.pref_colors);
+ addPreferencesFromResource(R.xml.pref_notification);
addPreferencesFromResource(R.xml.pref_now_playing_screen);
addPreferencesFromResource(R.xml.pref_images);
addPreferencesFromResource(R.xml.pref_lockscreen);
@@ -199,7 +202,7 @@ public class SettingsActivity extends AbsBaseActivity implements ColorChooserDia
}
});
- ATEColorPreference primaryColorPref = (ATEColorPreference) findPreference("primary_color");
+ final ATEColorPreference primaryColorPref = (ATEColorPreference) findPreference("primary_color");
final int primaryColor = ThemeStore.primaryColor(getActivity());
primaryColorPref.setColor(primaryColor, ColorUtil.darkenColor(primaryColor));
primaryColorPref.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
@@ -215,7 +218,7 @@ public class SettingsActivity extends AbsBaseActivity implements ColorChooserDia
}
});
- ATEColorPreference accentColorPref = (ATEColorPreference) findPreference("accent_color");
+ final ATEColorPreference accentColorPref = (ATEColorPreference) findPreference("accent_color");
final int accentColor = ThemeStore.accentColor(getActivity());
accentColorPref.setColor(accentColor, ColorUtil.darkenColor(accentColor));
accentColorPref.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
@@ -249,7 +252,30 @@ public class SettingsActivity extends AbsBaseActivity implements ColorChooserDia
});
}
- TwoStatePreference colorAppShortcuts = (TwoStatePreference) findPreference("should_color_app_shortcuts");
+ final TwoStatePreference classicNotification = (TwoStatePreference) findPreference("classic_notification");
+ if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N_MR1) {
+ classicNotification.setEnabled(false);
+ classicNotification.setSummary(R.string.pref_only_nougat);
+ } else {
+ classicNotification.setChecked(PreferenceUtil.getInstance(getActivity()).classicNotification());
+ classicNotification.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
+ @Override
+ public boolean onPreferenceChange(Preference preference, Object newValue) {
+ //Save preference
+ PreferenceUtil.getInstance(getActivity()).setClassicNotification((Boolean)newValue);
+
+ final MusicService service = MusicPlayerRemote.musicService;
+ if (service != null) {
+ service.initNotification();
+ service.updateNotification();
+ }
+
+ return true;
+ }
+ });
+ }
+
+ final TwoStatePreference colorAppShortcuts = (TwoStatePreference) findPreference("should_color_app_shortcuts");
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N_MR1) {
colorAppShortcuts.setEnabled(false);
colorAppShortcuts.setSummary(R.string.pref_only_nougat_mr1);
@@ -262,16 +288,14 @@ public class SettingsActivity extends AbsBaseActivity implements ColorChooserDia
PreferenceUtil.getInstance(getActivity()).setColoredAppShortcuts((Boolean)newValue);
//Update app shortcuts
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N_MR1) {
- new DynamicShortcutManager(getActivity()).updateDynamicShortcuts();
- }
+ new DynamicShortcutManager(getActivity()).updateDynamicShortcuts();
return true;
}
});
}
- Preference equalizer = findPreference("equalizer");
+ final Preference equalizer = findPreference("equalizer");
if (!hasEqualizer()) {
equalizer.setEnabled(false);
equalizer.setSummary(getResources().getString(R.string.no_equalizer));
diff --git a/app/src/main/java/com/kabouzeid/gramophone/ui/activities/bugreport/BugReportActivity.java b/app/src/main/java/com/kabouzeid/gramophone/ui/activities/bugreport/BugReportActivity.java
index cf1332e4..b68f4140 100644
--- a/app/src/main/java/com/kabouzeid/gramophone/ui/activities/bugreport/BugReportActivity.java
+++ b/app/src/main/java/com/kabouzeid/gramophone/ui/activities/bugreport/BugReportActivity.java
@@ -91,7 +91,7 @@ public class BugReportActivity extends AbsThemeActivity {
@BindView(R.id.button_send)
FloatingActionButton sendFab;
- private static final String ISSUE_TRACKER_LINK = "https://github.com/kabouzeid/phonograph-issue-tracker";
+ private static final String ISSUE_TRACKER_LINK = "https://github.com/kabouzeid/Phonograph";
@Override
protected void onCreate(Bundle savedInstanceState) {
@@ -274,7 +274,7 @@ public class BugReportActivity extends AbsThemeActivity {
onSaveExtraInfo(extraInfo);
Report report = new Report(bugTitle, bugDescription, deviceInfo, extraInfo);
- GithubTarget target = new GithubTarget("kabouzeid", "phonograph-issue-tracker");
+ GithubTarget target = new GithubTarget("kabouzeid", "Phonograph");
ReportIssueAsyncTask.report(this, report, target, login);
}
diff --git a/app/src/main/java/com/kabouzeid/gramophone/util/PreferenceUtil.java b/app/src/main/java/com/kabouzeid/gramophone/util/PreferenceUtil.java
index ac251027..61e71660 100644
--- a/app/src/main/java/com/kabouzeid/gramophone/util/PreferenceUtil.java
+++ b/app/src/main/java/com/kabouzeid/gramophone/util/PreferenceUtil.java
@@ -44,6 +44,8 @@ public final class PreferenceUtil {
public static final String FORCE_SQUARE_ALBUM_COVER = "force_square_album_art";
public static final String COLORED_NOTIFICATION = "colored_notification";
+ public static final String CLASSIC_NOTIFICATION = "classic_notification";
+
public static final String COLORED_APP_SHORTCUTS = "colored_app_shortcuts";
public static final String AUDIO_DUCKING = "audio_ducking";
@@ -149,6 +151,16 @@ public final class PreferenceUtil {
return mPreferences.getBoolean(COLORED_NOTIFICATION, true);
}
+ public final boolean classicNotification() {
+ return mPreferences.getBoolean(CLASSIC_NOTIFICATION, false);
+ }
+
+ public void setClassicNotification(final boolean value) {
+ final SharedPreferences.Editor editor = mPreferences.edit();
+ editor.putBoolean(CLASSIC_NOTIFICATION, value);
+ editor.apply();
+ }
+
public void setColoredAppShortcuts(final boolean value) {
final SharedPreferences.Editor editor = mPreferences.edit();
editor.putBoolean(COLORED_APP_SHORTCUTS, value);
diff --git a/app/src/main/res/drawable/ic_email_white_24dp.xml b/app/src/main/res/drawable/ic_email_white_24dp.xml
new file mode 100644
index 00000000..86700b9c
--- /dev/null
+++ b/app/src/main/res/drawable/ic_email_white_24dp.xml
@@ -0,0 +1,10 @@
+
+
+
+
diff --git a/app/src/main/res/layout/card_about_app.xml b/app/src/main/res/layout/card_about_app.xml
index 9b6d0936..32d92e9c 100644
--- a/app/src/main/res/layout/card_about_app.xml
+++ b/app/src/main/res/layout/card_about_app.xml
@@ -144,6 +144,37 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
Images
Lockscreen
Playlists
+ Notification
Colored navigation bar
Colored app shortcuts
Start page
@@ -131,6 +132,7 @@
Auto download artist images
Blur album cover
Colored notification
+ Classic notification design
Ignore Media Store covers
Gapless playback
Square album cover
@@ -165,10 +167,12 @@
Empty
Playlist name
Song
- "Only available on Lollipop."
- "Only available on Nougat 7.1."
+ "Only available on Lollipop or above."
+ "Only available on Nougat 7.0 or above."
+ "Only available on Nougat 7.1 or above."
Uses the current songs album cover as lockscreen wallpaper.
Blurs the album cover on the lockscreen. Can cause problems with third party apps and widgets.
+ Use the classic notification design.
"Colors the notification in the album cover\u2019s vibrant color."
"Can cause playback issues on some devices."
Album covers in the now playing view are always squared.
@@ -222,6 +226,7 @@
Version
Application
Author
+ Write an email
Add to Google Plus circles
Follow on Twitter
Fork on GitHub
diff --git a/app/src/main/res/xml/pref_colors.xml b/app/src/main/res/xml/pref_colors.xml
index 4ec32d77..e7701f96 100644
--- a/app/src/main/res/xml/pref_colors.xml
+++ b/app/src/main/res/xml/pref_colors.xml
@@ -14,12 +14,6 @@
android:summary="@string/accent_color_desc"
android:title="@string/accent_color" />
-
-
+
+
+
+
+
+
+
+
+
+
diff --git a/build.gradle b/build.gradle
index 8ccd9c97..a9d3b18d 100644
--- a/build.gradle
+++ b/build.gradle
@@ -3,7 +3,7 @@ buildscript {
jcenter()
}
dependencies {
- classpath 'com.android.tools.build:gradle:2.3.1'
+ classpath 'com.android.tools.build:gradle:3.0.0-alpha1'
}
}
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index 4c8eae3c..1946024c 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,6 @@
-#Tue Apr 11 17:46:33 SGT 2017
+#Sun May 21 22:51:02 CEST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-3.5-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-4.0-milestone-1-all.zip