diff options
| -rw-r--r-- | .flutter-plugins-dependencies | 2 | ||||
| -rw-r--r-- | TODO.md | 7 | ||||
| -rw-r--r-- | android/app/src/main/AndroidManifest.xml | 14 | ||||
| -rw-r--r-- | android/settings_aar.gradle | 1 | ||||
| -rw-r--r-- | lib/pages/Apps.dart | 16 | ||||
| -rw-r--r-- | pubspec.lock | 16 | ||||
| -rw-r--r-- | pubspec.yaml | 1 |
7 files changed, 45 insertions, 12 deletions
diff --git a/.flutter-plugins-dependencies b/.flutter-plugins-dependencies index 2412e34..4e3c929 100644 --- a/.flutter-plugins-dependencies +++ b/.flutter-plugins-dependencies @@ -1 +1 @@ -{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[],"android":[{"name":"device_apps","path":"/home/akshayn/.pub-cache/hosted/pub.dartlang.org/device_apps-1.0.9/","dependencies":[]}],"macos":[],"linux":[],"windows":[],"web":[]},"dependencyGraph":[{"name":"device_apps","dependencies":[]}],"date_created":"2020-06-02 22:12:46.920929","version":"1.19.0-2.0.pre.214"}
\ No newline at end of file +{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[],"android":[{"name":"android_intent","path":"/home/akshayn/.pub-cache/hosted/pub.dartlang.org/android_intent-0.3.7+2/","dependencies":[]},{"name":"device_apps","path":"/home/akshayn/.pub-cache/hosted/pub.dartlang.org/device_apps-1.0.9/","dependencies":[]}],"macos":[],"linux":[],"windows":[],"web":[]},"dependencyGraph":[{"name":"android_intent","dependencies":[]},{"name":"device_apps","dependencies":[]}],"date_created":"2020-06-02 23:56:41.767586","version":"1.19.0-2.0.pre.214"}
\ No newline at end of file @@ -16,9 +16,10 @@ ## Applications list - [X] Create app list - [X] Make app list searchable - - [ ] Create options menu on long press + - [X] Create options menu on long press - [ ] Add "add to favorites" action - - [ ] Add uninstall action - - [ ] Add goto app settings action + - [X] Add uninstall action + - [X] Add goto app settings action + - [ ] Fix uninstall action issue - [ ] Make app list load faster - [ ] Make keyboard close on swipe diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index f47f73c..3d9998a 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -4,7 +4,8 @@ calls FlutterMain.startInitialization(this); in its onCreate method. In most cases you can leave this as-is, but you if you want to provide additional functionality it is fine to subclass or reimplement - FlutterApplication and put your custom class here. --> + FlutterApplication and put your custom class here. --> + <uses-permission android:name="android.permission.REQUEST_DELETE_PACKAGES" /> <application android:name="io.flutter.app.FlutterApplication" android:label="owyn" @@ -34,10 +35,13 @@ android:resource="@drawable/launch_background" /> <intent-filter> - <action android:name="android.intent.action.MAIN"/> - <category android:name="android.intent.category.LAUNCHER"/> - <category android:name="android.intent.category.HOME" /> - <category android:name="android.intent.category.DEFAULT" /> + <action android:name="android.intent.action.MAIN"/> + <action android:name="android.intent.action.DELETE" /> + <action android:name="android.intent.action.UNINSTALL_PACKAGE" /> + <category android:name="android.intent.category.LAUNCHER"/> + <category android:name="android.intent.category.HOME" /> + <category android:name="android.intent.category.DEFAULT" /> + <data android:scheme="package" /> </intent-filter> </activity> <!-- Don't delete the meta-data below. diff --git a/android/settings_aar.gradle b/android/settings_aar.gradle new file mode 100644 index 0000000..e7b4def --- /dev/null +++ b/android/settings_aar.gradle @@ -0,0 +1 @@ +include ':app' diff --git a/lib/pages/Apps.dart b/lib/pages/Apps.dart index d267f10..3bf54c5 100644 --- a/lib/pages/Apps.dart +++ b/lib/pages/Apps.dart @@ -1,5 +1,6 @@ import 'package:flutter/material.dart'; import 'package:device_apps/device_apps.dart'; +import 'package:android_intent/android_intent.dart'; import '../components/FixedContainer.dart'; import '../components/SearchableAppList.dart'; @@ -55,8 +56,19 @@ class AppsView extends StatelessWidget { width: 300.0, child: ListView( children: [ - Option(child: Text('Cool'), onTap: () { debugPrint('Cool'); }), - Option(child: Text('Wow'), onTap: () { debugPrint('Wow'); }), + 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 { + // FIXME: Doesn't work + await AndroidIntent( + action: 'action_delete', + data: 'package:${app.packageName}', + ).launch(); + }), ], ), ), diff --git a/pubspec.lock b/pubspec.lock index 575cf93..abf58a0 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1,6 +1,13 @@ # Generated by pub # See https://dart.dev/tools/pub/glossary#lockfile packages: + android_intent: + dependency: "direct main" + description: + name: android_intent + url: "https://pub.dartlang.org" + source: hosted + version: "0.3.7+2" async: dependency: transitive description: @@ -95,6 +102,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.7.0" + platform: + dependency: transitive + description: + name: platform + url: "https://pub.dartlang.org" + source: hosted + version: "2.2.1" sky_engine: dependency: transitive description: flutter @@ -158,4 +172,4 @@ packages: version: "2.0.8" sdks: dart: ">=2.7.0 <3.0.0" - flutter: ">=1.10.0 <2.0.0" + flutter: ">=1.12.13+hotfix.5 <2.0.0" diff --git a/pubspec.yaml b/pubspec.yaml index 8c8f88f..3577670 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -25,6 +25,7 @@ dependencies: sdk: flutter intl: ^0.16.1 device_apps: ^1.0.9 + android_intent: ^0.3.7 |
