-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from MaikuB/dev
Add inbox notification style for Android
- Loading branch information
Showing
15 changed files
with
173 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,5 +2,6 @@ | |
|
||
public enum NotificationStyle{ | ||
Default, | ||
BigText | ||
BigText, | ||
Inbox | ||
} |
4 changes: 0 additions & 4 deletions
4
android/src/main/java/com/dexterous/flutterlocalnotifications/StyleInformation.java
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
...otifications/BigTextStyleInformation.java → ...odels/styles/BigTextStyleInformation.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...otifications/DefaultStyleInformation.java → ...odels/styles/DefaultStyleInformation.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
...ain/java/com/dexterous/flutterlocalnotifications/models/styles/InboxStyleInformation.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package com.dexterous.flutterlocalnotifications.models.styles; | ||
|
||
import java.util.ArrayList; | ||
|
||
public class InboxStyleInformation extends DefaultStyleInformation { | ||
public Boolean htmlFormatLines; | ||
public ArrayList<String> lines; | ||
public String contentTitle; | ||
public Boolean htmlFormatContentTitle; | ||
public String summaryText; | ||
public Boolean htmlFormatSummaryText; | ||
|
||
public InboxStyleInformation(Boolean htmlFormatTitle, Boolean htmlFormatBody, String contentTitle, Boolean htmlFormatContentTitle, String summaryText, Boolean htmlFormatSummaryText, ArrayList<String> lines, Boolean htmlFormatLines) { | ||
super(htmlFormatTitle, htmlFormatBody); | ||
this.contentTitle = contentTitle; | ||
this.htmlFormatContentTitle = htmlFormatContentTitle; | ||
this.summaryText = summaryText; | ||
this.htmlFormatSummaryText = htmlFormatSummaryText; | ||
this.lines = lines; | ||
this.htmlFormatLines = htmlFormatLines; | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
...src/main/java/com/dexterous/flutterlocalnotifications/models/styles/StyleInformation.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package com.dexterous.flutterlocalnotifications.models.styles; | ||
|
||
public abstract class StyleInformation { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
lib/platform_specifics/android_styles/inbox_style_information.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import 'package:flutter_local_notifications/platform_specifics/android_styles/default_style_information.dart'; | ||
|
||
class InboxStyleInformation extends DefaultStyleInformation { | ||
/// Overrides ContentTitle in the big form of the template. | ||
final String contentTitle; | ||
|
||
/// Set the first line of text after the detail section in the big form of the template. | ||
final String summaryText; | ||
|
||
/// The lines that form part of the digest section for inbox-style notifications | ||
List<String> lines; | ||
|
||
/// Specifies if the lines should have formatting applied through HTML markup | ||
final bool htmlFormatLines; | ||
|
||
/// Specifies if the overridden ContentTitle should have formatting applied through HTML markup | ||
final bool htmlFormatContentTitle; | ||
|
||
/// Specifies if formatting should be applied to the first line of text after the detail section in the big form of the template. | ||
final bool htmlFormatSummaryText; | ||
|
||
InboxStyleInformation(this.lines, | ||
{this.htmlFormatLines = false, | ||
this.contentTitle, | ||
this.htmlFormatContentTitle = false, | ||
this.summaryText, | ||
this.htmlFormatSummaryText = false, | ||
bool htmlFormatContent = false, | ||
bool htmlFormatTitle = false}) | ||
: super(htmlFormatContent, htmlFormatTitle); | ||
|
||
Map<String, dynamic> toJson() { | ||
var styleJson = super.toJson(); | ||
|
||
var bigTextStyleJson = <String, dynamic>{ | ||
'contentTitle': contentTitle, | ||
'htmlFormatContentTitle': htmlFormatContentTitle, | ||
'summaryText': summaryText, | ||
'htmlFormatSummaryText': htmlFormatSummaryText, | ||
'lines': lines ?? new List<String>(), | ||
'htmlFormatLines': htmlFormatLines | ||
}; | ||
styleJson.addAll(bigTextStyleJson); | ||
return styleJson; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
name: flutter_local_notifications | ||
description: A cross platform plugin for displaying and scheduling local notifications for Flutter applications with the ability to customise for each platform. | ||
version: 0.1.3 | ||
version: 0.1.4 | ||
author: Michael Bui <[email protected]> | ||
homepage: https://github.com/MaikuB/flutter_local_notifications | ||
|
||
|