Skip to content

Commit

Permalink
repeat fix, notification click open
Browse files Browse the repository at this point in the history
  • Loading branch information
deep-gaurav committed Jun 9, 2019
1 parent b12f667 commit c914bee
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ android {
applicationId "deep.ryd.rydplayer"
minSdkVersion 21
targetSdkVersion 28
versionCode 52
versionName "2.0.2"
versionCode 53
versionName "2.0.3"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
signingConfigs {
Expand Down
6 changes: 6 additions & 0 deletions android/app/src/main/java/deep/ryd/PlayerService.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ public Notification.Builder notifBuilder(String title, String author, MediaSessi
PendingIntent.FLAG_UPDATE_CURRENT
);

Intent actionIntent = new Intent(this,MainActivity.class);

PendingIntent actionpendingIntent = PendingIntent.getActivity(this,5,actionIntent,PendingIntent.FLAG_UPDATE_CURRENT);

Notification.Action playpauseAction;
if(playing){
playpauseAction = new Notification.Action(
Expand All @@ -84,6 +88,7 @@ public Notification.Builder notifBuilder(String title, String author, MediaSessi
}



Notification.Builder builder;
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.O){
builder = new Notification.Builder(this,MainActivity.CHANNEL_ID);
Expand All @@ -104,6 +109,7 @@ public Notification.Builder notifBuilder(String title, String author, MediaSessi
)
.setContentTitle(title)
.setContentText(author)
.setContentIntent(actionpendingIntent)
.setLargeIcon(thumbnail);

}
Expand Down
2 changes: 1 addition & 1 deletion lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ class MyHomePageState extends State<MyHomePage>
void onEnd() {
if (repeat.value == 2) {
//IF repeatSingle
player.play();
playCurrent();
} else {
if (currentIndex.value == queue.value.length - 1) {
if (repeat.value == 3) {
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ description: A Materialistic Music Player.
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 2.0.2
version: 2.0.3

environment:
sdk: ">=2.1.0 <3.0.0"
Expand Down

0 comments on commit c914bee

Please sign in to comment.