diff --git a/CHANGELOG.md b/CHANGELOG.md index ef40cc9..9e688b5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ - When writing a comment the parent text is now selectable - Text of a post is now selectable +- Account actions in settings are more obvious to access: long press an account/instance to see possible actions such as setting as default or removal ## v0.4.1 - 2021-04-06 diff --git a/README.md b/README.md index 6388bae..4dc2df8 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,11 @@ # lemmur -A mobile client for [lemmy](https://github.com/LemmyNet/lemmy) - a federated reddit alternative +[Get it on F-Droid](https://f-droid.org/packages/com.krawieck.lemmur) +[](https://play.google.com/store/apps/details?id=com.krawieck.lemmur) +[](https://github.com/krawieck/lemmur/releases/latest) + +A mobile client for [Lemmy](https://github.com/LemmyNet/lemmy) - a federated reddit alternative Buy Me A Coffee @@ -18,6 +22,9 @@ A mobile client for [lemmy](https://github.com/LemmyNet/lemmy) - a federated red - [Android](#android) - [Linux](#linux) - [Windows](#windows) + - [FAQ](#faq) + - [Version x.x.x was released, why is it not yet on F-droid?](#version-xxx-was-released-why-is-it-not-yet-on-f-droid) + - ["App not installed" - what to do?](#app-not-installed---what-to-do) ## Build from source @@ -36,10 +43,8 @@ The apk will be in `build/app/outputs/flutter-apk/app-release.apk` ### Linux 1. Make sure you have the additional [linux requirements](https://flutter.dev/desktop#additional-linux-requirements) (verify with `flutter doctor`) -2. Switch to dev channel of flutter: +2. Enable linux desktop: ```sh - flutter channel dev - flutter upgrade flutter config --enable-linux-desktop ``` 3. Build: `flutter build linux` @@ -49,12 +54,20 @@ The executable will be in `build/linux/release/bundle/lemmur` (be aware, however ### Windows 1. Make sure you have the additional [windows requirements](https://flutter.dev/desktop#additional-windows-requirements) (verify with `flutter doctor`) -2. Switch to dev channel of flutter: +2. Enable windows desktop: ```sh - flutter channel dev - flutter upgrade flutter config --enable-windows-desktop ``` 3. Build: `flutter build windows` The executable will be in `build\windows\runner\Release\lemmur.exe` (be aware, however, that this executable is not standalone) + +## FAQ + +### Version x.x.x was released, why is it not yet on F-droid? + +We have no control over F-droid's build process. This process is automatic and not always predictable in terms of time it takes. If a new version does not appear in F-droid a week after its release, then feel free to open an issue about it and we will look into it. + +### "App not installed" - what to do? + +When installing the APK directly you might get this message. This happens when you are trying to update lemmur from a different source than where you originally got it from. To fix it simply uninstall the previous version (you will lose all local data) and then install the new one. Always make sure to install lemmur APKs only from verified sources. diff --git a/lib/pages/settings.dart b/lib/pages/settings.dart index 58646dd..10e3835 100644 --- a/lib/pages/settings.dart +++ b/lib/pages/settings.dart @@ -2,13 +2,13 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter_hooks/flutter_hooks.dart'; -import 'package:flutter_slidable/flutter_slidable.dart'; import 'package:flutter_speed_dial/flutter_speed_dial.dart'; import '../hooks/stores.dart'; import '../l10n/l10n.dart'; import '../util/goto.dart'; import '../widgets/about_tile.dart'; +import '../widgets/bottom_modal.dart'; import '../widgets/radio_picker.dart'; import 'add_account.dart'; import 'add_instance.dart'; @@ -128,6 +128,7 @@ class AccountsConfigPage extends HookWidget { ) ?? false) { await accountsStore.removeInstance(instanceHost); + Navigator.of(context).pop(); } } @@ -151,10 +152,50 @@ class AccountsConfigPage extends HookWidget { ), ) ?? false) { - return accountsStore.removeAccount(instanceHost, username); + await accountsStore.removeAccount(instanceHost, username); + Navigator.of(context).pop(); } } + void accountActions(String instanceHost, String username) { + showBottomModal( + context: context, + builder: (context) => Column( + children: [ + if (accountsStore.defaultUsernameFor(instanceHost) != username) + ListTile( + leading: const Icon(Icons.check_circle_outline), + title: const Text('Set as default'), + onTap: () { + accountsStore.setDefaultAccountFor(instanceHost, username); + Navigator.of(context).pop(); + }, + ), + ListTile( + leading: const Icon(Icons.delete), + title: const Text('Remove account'), + onTap: () => removeUserDialog(instanceHost, username), + ), + ], + ), + ); + } + + void instanceActions(String instanceHost) { + showBottomModal( + context: context, + builder: (context) => Column( + children: [ + ListTile( + leading: const Icon(Icons.delete), + title: const Text('Remove instance'), + onTap: () => removeInstanceDialog(instanceHost), + ), + ], + ), + ); + } + return Scaffold( key: _scaffoldKey, appBar: AppBar( @@ -206,62 +247,30 @@ class AccountsConfigPage extends HookWidget { ), for (final instance in accountsStore.instances) ...[ const SizedBox(height: 40), - Slidable( - actionPane: const SlidableBehindActionPane(), - secondaryActions: [ - IconSlideAction( - onTap: () => removeInstanceDialog(instance), - icon: Icons.delete_sweep, - color: Colors.red, - ), - ], - key: Key(instance), - // TODO: missing ripple effect - child: Container( - color: theme.scaffoldBackgroundColor, - child: ListTile( - dense: true, - contentPadding: EdgeInsets.zero, - title: _SectionHeading(instance), - ), - ), + ListTile( + dense: true, + contentPadding: EdgeInsets.zero, + onLongPress: () => instanceActions(instance), + title: _SectionHeading(instance), ), for (final username in accountsStore.usernamesFor(instance)) ...[ - Slidable( - actionPane: const SlidableBehindActionPane(), - key: Key('$username@$instance'), - secondaryActions: [ - IconSlideAction( - onTap: () => removeUserDialog(instance, username), - icon: Icons.delete_sweep, - color: Colors.red, - ), - ], - // TODO: missing ripple effect - child: Container( - color: theme.scaffoldBackgroundColor, - child: ListTile( - trailing: - username == accountsStore.defaultUsernameFor(instance) - ? Icon( - Icons.check_circle_outline, - color: theme.accentColor, - ) - : null, - title: Text(username), - onLongPress: () { - accountsStore.setDefaultAccountFor(instance, username); - }, - onTap: () { - goTo( - context, - (_) => ManageAccountPage( - instanceHost: instance, - username: username, - )); - }, - ), - ), + ListTile( + trailing: username == accountsStore.defaultUsernameFor(instance) + ? Icon( + Icons.check_circle_outline, + color: theme.accentColor, + ) + : null, + title: Text(username), + onLongPress: () => accountActions(instance, username), + onTap: () { + goTo( + context, + (_) => ManageAccountPage( + instanceHost: instance, + username: username, + )); + }, ), ], if (accountsStore.usernamesFor(instance).isEmpty) diff --git a/pubspec.lock b/pubspec.lock index 5c24b4b..4cb7bb5 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -263,13 +263,6 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.0.0" - flutter_slidable: - dependency: "direct main" - description: - name: flutter_slidable - url: "https://pub.dartlang.org" - source: hosted - version: "0.5.7" flutter_speed_dial: dependency: "direct main" description: diff --git a/pubspec.yaml b/pubspec.yaml index 2c82992..f912715 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -23,7 +23,6 @@ environment: dependencies: # widgets flutter_speed_dial: ^1.2.5 - flutter_slidable: ^0.5.7 photo_view: ^0.10.2 markdown: ^4.0.0 flutter_markdown: ^0.6.1