Skip to content

Commit

Permalink
Set Android category as camera, add GitHub repo link and add url_laun…
Browse files Browse the repository at this point in the history
…cher package
  • Loading branch information
iakdis committed Oct 3, 2022
1 parent 6daa148 commit 3bc3e2e
Show file tree
Hide file tree
Showing 6 changed files with 110 additions and 4 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ The packages used for this app, also listed in the pubspec.yaml file. See their
- [provider](https://pub.dev/packages/provider): Used for state management, specifically localization and theme support
- [shared_preferences](https://pub.dev/packages/shared_preferences): Used for saving app data, including settings
- [smooth_page_indicator](https://pub.dev/packages/smooth_page_indicator): Used for the page indicator in the onboarding screen
- [url_launcher](https://pub.dev/packages/url_launcher): Used for opening the GitHub repository link inside the About menu
- [video_player](https://pub.dev/packages/video_player): Used for displaying a captured video inside the thumbnail

# License
Expand Down
29 changes: 29 additions & 0 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,35 @@
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
<intent-filter>
<action android:name="android.media.action.IMAGE_CAPTURE" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>

<intent-filter>
<action android:name="android.media.action.IMAGE_CAPTURE_SECURE" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>

<intent-filter>
<action android:name="android.media.action.STILL_IMAGE_CAMERA" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>

<intent-filter>
<action android:name="android.media.action.STILL_IMAGE_CAMERA_SECURE" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>

<intent-filter>
<action android:name="android.media.action.VIDEO_CAMERA" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>

<intent-filter>
<action android:name="android.media.action.VIDEO_CAPTURE" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<!-- Don't delete the meta-data below.
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
Expand Down
25 changes: 22 additions & 3 deletions lib/src/pages/settings_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import 'package:librecamera/src/widgets/resolution.dart';

import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:provider/provider.dart';
import 'package:url_launcher/url_launcher.dart';

class SettingsButton extends StatelessWidget {
const SettingsButton({
Expand Down Expand Up @@ -165,8 +166,8 @@ class _SettingsPageState extends State<SettingsPage> {
return AboutListTile(
icon: const Icon(Icons.info),
applicationName: 'Libre Camera',
applicationVersion:
AppLocalizations.of(context)!.version('1.0.0'), //TODO change versions
applicationVersion: AppLocalizations.of(context)!.version(
'1.0.0'), //TODO change versions HERE AND app/build.gradle 1. versionCode and 2. versionName
applicationIcon: const Image(
image: AssetImage('assets/images/icon.png'),
width: 50,
Expand All @@ -175,6 +176,24 @@ class _SettingsPageState extends State<SettingsPage> {
applicationLegalese: 'GNU Public License v3',
aboutBoxChildren: [
Text(AppLocalizations.of(context)!.license),
const Divider(),
TextButton.icon(
icon: const Icon(Icons.open_in_new),
onPressed: () async {
var url = Uri.parse('https://github.com/iakmds/librecamera');
if (await canLaunchUrl(url)) {
await launchUrl(url, mode: LaunchMode.externalApplication);
} else {
throw 'Could not launch $url';
}
},
label: const SelectableText(
'https://github.com/iakmds/librecamera',
style: TextStyle(
color: Colors.blue,
),
),
),
],
);
}
Expand Down Expand Up @@ -240,7 +259,7 @@ class _SettingsPageState extends State<SettingsPage> {
trailing: Padding(
padding: const EdgeInsets.all(8.0),
child: Icon(
isMoreOptions ? Icons.arrow_upward : Icons.arrow_downward,
isMoreOptions ? Icons.expand_less : Icons.expand_more,
size: 35,
),
),
Expand Down
2 changes: 1 addition & 1 deletion lib/src/utils/preferences.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class Preferences {
await _preferences!.setString(prefLanguage, locale);
static String getLanguage() => _preferences!.getString(prefLanguage) ?? '';

//Flash Mode
//Theme Mode
static Future setThemeMode(String theme) async =>
await _preferences!.setString(prefThemeMode, theme);
static String getThemeMode() =>
Expand Down
56 changes: 56 additions & 0 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,62 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.4"
url_launcher:
dependency: "direct main"
description:
name: url_launcher
url: "https://pub.dartlang.org"
source: hosted
version: "6.1.6"
url_launcher_android:
dependency: transitive
description:
name: url_launcher_android
url: "https://pub.dartlang.org"
source: hosted
version: "6.0.19"
url_launcher_ios:
dependency: transitive
description:
name: url_launcher_ios
url: "https://pub.dartlang.org"
source: hosted
version: "6.0.17"
url_launcher_linux:
dependency: transitive
description:
name: url_launcher_linux
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.1"
url_launcher_macos:
dependency: transitive
description:
name: url_launcher_macos
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.1"
url_launcher_platform_interface:
dependency: transitive
description:
name: url_launcher_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.1"
url_launcher_web:
dependency: transitive
description:
name: url_launcher_web
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.13"
url_launcher_windows:
dependency: transitive
description:
name: url_launcher_windows
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.1"
vector_math:
dependency: transitive
description:
Expand Down
1 change: 1 addition & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ dependencies:
provider: ^6.0.3
shared_preferences: ^2.0.15
smooth_page_indicator: ^1.0.0+2
url_launcher: ^6.1.6
video_player: ^2.4.7

dev_dependencies:
Expand Down

0 comments on commit 3bc3e2e

Please sign in to comment.