aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAkshay Nair <phenax5@gmail.com>2020-06-04 13:30:26 +0530
committerAkshay Nair <phenax5@gmail.com>2020-06-04 13:30:26 +0530
commit1d6fbb644e6c4f877cbcb1e1d02cb840086884dc (patch)
treea310b4f03bc551f5be2e5bba6de2ba41b550ca2c
parenta9550c3a5088b8e25257480fb86ff5c9a2fed6d7 (diff)
downloaddaft-launcher-1d6fbb644e6c4f877cbcb1e1d02cb840086884dc.tar.gz
daft-launcher-1d6fbb644e6c4f877cbcb1e1d02cb840086884dc.zip
Adds icons in context menu
Diffstat (limited to '')
-rw-r--r--TODO.md12
-rw-r--r--lib/components/AppContextMenu.dart50
2 files changed, 39 insertions, 23 deletions
diff --git a/TODO.md b/TODO.md
index 46c151c..494a938 100644
--- a/TODO.md
+++ b/TODO.md
@@ -1,28 +1,31 @@
# TODO
## Global
+ - [ ] Add icons in context menu
- [X] Start writing tests
- [X] Transision between pages between pages
- [X] Find a way to preload both pages and stop from "loading"
- [X] Dark/List themes
- - [ ] Add icons in context menu
## Issues
- - [ ] Fix uninstall action issue
- [ ] Fix scroll/fling conflict (snap)
+ - [X] Fix uninstall action issue
- [X] Disable back button
- [X] Fix build issue
## HomePage
+ - [ ] Allow changing the order of favorites (dragndrop)?
- [X] Create statusbar
- [X] Get rid of defaultTime and loading
- [X] Create favorites list
- [X] Get favorites list from a persistent store
- [X] Add actions to favorite items
- [X] Remove from favorites
- - [ ] Change the order of favorites?
## Applications list
+ - [ ] Sort the list according to frequently used
+ - [ ] Make app list load faster
+ - [ ] Make keyboard close on swipe
- [X] Create app list
- [X] Make app list searchable
- [X] Create options menu on long press
@@ -30,7 +33,4 @@
- [X] Add goto app settings action
- [X] Add "add to favorites" action
- [X] Use getStringList for favorites list
- - [ ] Sort the list according to frequently used
- - [ ] Make app list load faster
- - [ ] Make keyboard close on swipe
diff --git a/lib/components/AppContextMenu.dart b/lib/components/AppContextMenu.dart
index ae42bd4..72d67aa 100644
--- a/lib/components/AppContextMenu.dart
+++ b/lib/components/AppContextMenu.dart
@@ -8,9 +8,10 @@ import '../data/favorites.dart';
class Option extends StatelessWidget {
void Function() onTap;
+ Widget icon;
Widget child;
- Option({ this.child, this.onTap }): super();
+ Option({ this.child, this.icon, this.onTap }): super();
@override
build(BuildContext ctx) {
@@ -18,7 +19,10 @@ class Option extends StatelessWidget {
children: [
ListTile(
contentPadding: const EdgeInsets.symmetric(vertical: 0.0, horizontal: 16.0),
- title: child,
+ title: Row(children: [
+ Container(width: 36.0, padding: EdgeInsets.only(right: 16.0), child: icon),
+ child,
+ ]),
onTap: () {
onTap();
Navigator.pop(ctx);
@@ -48,21 +52,33 @@ class AppContextMenu extends StatelessWidget {
height: 170.0,
child: ListView(
children: [
- Option(child: Text(isFavorite ? 'Remove from favorites' : 'Add to favorites'), onTap: () async {
- await isFavorite ? removeFromFavorites(app) : addToFavorites(app);
- }),
- Option(child: Text('App Settings'), onTap: () async {
- await AndroidIntent(
- action: 'action_application_details_settings',
- data: 'package:${app.packageName}',
- ).launch();
- }),
- Option(child: Text('Uninstall'), onTap: () async {
- await AndroidIntent(
- action: 'android.intent.action.DELETE',
- data: 'package:${app.packageName}',
- ).launch();
- }),
+ Option(
+ icon: Icon(Icons.star, size: 22.0, color: theme.primaryColor),
+ child: Text(isFavorite ? 'Remove from favorites' : 'Add to favorites'),
+ onTap: () async {
+ await isFavorite ? removeFromFavorites(app) : addToFavorites(app);
+ },
+ ),
+ Option(
+ child: Text('App Settings'),
+ icon: Icon(Icons.settings, size: 22.0, color: theme.primaryColor),
+ onTap: () async {
+ await AndroidIntent(
+ action: 'action_application_details_settings',
+ data: 'package:${app.packageName}',
+ ).launch();
+ },
+ ),
+ Option(
+ child: Text('Uninstall'),
+ icon: Icon(Icons.delete_forever, size: 22.0, color: theme.primaryColor),
+ onTap: () async {
+ await AndroidIntent(
+ action: 'android.intent.action.DELETE',
+ data: 'package:${app.packageName}',
+ ).launch();
+ },
+ ),
],
),
),