Skip to content

Commit

Permalink
feat: android splashcreen
Browse files Browse the repository at this point in the history
- implemented android splashscreen and notification icon
- adjusted pricetile coloring when available again
  • Loading branch information
lucafluri committed Jul 16, 2020
1 parent fb78048 commit 38a1983
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 14 deletions.
7 changes: 7 additions & 0 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,13 @@
<data android:mimeType="text/*" />
</intent-filter>
</activity>
<receiver android:name="com.dexterous.flutterlocalnotifications.ScheduledNotificationReceiver" />
<receiver android:name="com.dexterous.flutterlocalnotifications.ScheduledNotificationBootReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED"/>
<action android:name="android.intent.action.MY_PACKAGE_REPLACED"/>
</intent-filter>
</receiver>
<!-- Don't delete the meta-data below.
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
<meta-data
Expand Down
Binary file modified android/app/src/main/res/drawable/app_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added android/app/src/main/res/drawable/app_icon_og.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions android/app/src/main/res/drawable/launch_background.xml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Modify this file to customize your launch splash screen -->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@android:color/white" />
<item android:drawable="@color/lightBlue" />

<!-- You can insert your own image assets here -->
<!-- <item>
<item>
<bitmap
android:gravity="center"
android:src="@mipmap/launch_image" />
</item> -->
android:src="@drawable/ic_launcher_foreground" />
</item>
</layer-list>
3 changes: 2 additions & 1 deletion android/app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="lightBlue">#FF5B9DC1</color>
<!-- Theme applied to the Android Window while the process is starting -->
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
<!-- Show a splash screen on the activity. Automatically removed when
Expand All @@ -13,6 +14,6 @@
This Theme is only used starting with V2 of Flutter's Android embedding. -->
<style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar">
<item name="android:windowBackground">@android:color/white</item>
<item name="android:windowBackground">@android:color/black</item>
</style>
</resources>
Binary file modified assets/notifications_icon/app_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 3 additions & 9 deletions lib/screens/home/components/product_list_tile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,10 @@ class ProductListTile extends StatelessWidget {
@override
Widget build(BuildContext context) {
//Price Difference since last day => used for coloring
double _priceDifference = (product.prices.length > 1 &&
product.prices[product.prices.length - 1] >= 0)
? product.prices[product.prices.length - 1] -
product.prices[product.prices.length - 2]
: 0.0;
double _priceDifference = product.priceDifferenceToYesterday();
bool _underTarget = product.underTarget();

bool _underTarget = product.prices[product.prices.length - 1] >= 0 &&
product.prices[product.prices.length - 1] <= product.targetPrice;

Color _chosenColor = _priceDifference == 0
Color _chosenColor = _priceDifference == 0 || product.availableAgain()
? Colors.transparent
: _priceDifference < 0 ? Colors.green[800] : Colors.red[900];

Expand Down

0 comments on commit 38a1983

Please sign in to comment.