Skip to content

Commit

Permalink
Add a class for collapsing menu actions (#433)
Browse files Browse the repository at this point in the history
Co-authored-by: Dirk Doesburg <dirk.doesburg@gmail.com>
  • Loading branch information
JAicewizard and DeD1rk committed Sep 20, 2023
1 parent a0404ab commit 36349e1
Show file tree
Hide file tree
Showing 15 changed files with 323 additions and 260 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -202,4 +202,5 @@ jobs:
TOSTI_API_HOST: ${{ vars.TOSTI_API_HOST }}
TOSTI_OAUTH_APP_ID: ${{ secrets.TOSTI_OAUTH_APP_ID }}
TOSTI_OAUTH_APP_SECRET: ${{ secrets.TOSTI_OAUTH_APP_SECRET }}
SUPPLY_UPLOAD_MAX_RETRIES: ${{ vars.SUPPLY_UPLOAD_MAX_RETRIES }}
run: bundle exec fastlane android deploy_internal
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
source "https://rubygems.org"

gem "fastlane", "~> 2.205"
gem "fastlane", "~> 2.215.1"
gem "dotenv"

gem "cocoapods", "~> 1.11"
79 changes: 39 additions & 40 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,20 @@ GEM
artifactory (3.0.15)
atomos (0.1.3)
aws-eventstream (1.2.0)
aws-partitions (1.651.0)
aws-sdk-core (3.166.0)
aws-partitions (1.825.0)
aws-sdk-core (3.182.0)
aws-eventstream (~> 1, >= 1.0.2)
aws-partitions (~> 1, >= 1.651.0)
aws-sigv4 (~> 1.5)
jmespath (~> 1, >= 1.6.1)
aws-sdk-kms (1.59.0)
aws-sdk-core (~> 3, >= 3.165.0)
aws-sdk-kms (1.71.0)
aws-sdk-core (~> 3, >= 3.177.0)
aws-sigv4 (~> 1.1)
aws-sdk-s3 (1.117.1)
aws-sdk-core (~> 3, >= 3.165.0)
aws-sdk-s3 (1.134.0)
aws-sdk-core (~> 3, >= 3.181.0)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.4)
aws-sigv4 (1.5.2)
aws-sigv4 (~> 1.6)
aws-sigv4 (1.6.0)
aws-eventstream (~> 1, >= 1.0.2)
babosa (1.0.4)
claide (1.1.0)
Expand Down Expand Up @@ -77,7 +77,7 @@ GEM
highline (~> 2.0.0)
concurrent-ruby (1.2.2)
declarative (0.0.20)
digest-crc (0.6.4)
digest-crc (0.6.5)
rake (>= 12.0.0, < 14.0.0)
domain_name (0.5.20190701)
unf (>= 0.0.5, < 1.0.0)
Expand All @@ -86,8 +86,8 @@ GEM
escape (0.0.4)
ethon (0.15.0)
ffi (>= 1.15.0)
excon (0.93.1)
faraday (1.10.2)
excon (0.103.0)
faraday (1.10.3)
faraday-em_http (~> 1.0)
faraday-em_synchrony (~> 1.0)
faraday-excon (~> 1.1)
Expand Down Expand Up @@ -115,8 +115,8 @@ GEM
faraday-retry (1.0.3)
faraday_middleware (1.2.0)
faraday (~> 1.0)
fastimage (2.2.6)
fastlane (2.210.1)
fastimage (2.2.7)
fastlane (2.215.1)
CFPropertyList (>= 2.3, < 4.0.0)
addressable (>= 2.8, < 3.0.0)
artifactory (~> 3.0)
Expand All @@ -137,18 +137,19 @@ GEM
google-apis-playcustomapp_v1 (~> 0.1)
google-cloud-storage (~> 1.31)
highline (~> 2.0)
http-cookie (~> 1.0.5)
json (< 3.0.0)
jwt (>= 2.1.0, < 3)
mini_magick (>= 4.9.4, < 5.0.0)
multipart-post (~> 2.0.0)
multipart-post (>= 2.0.0, < 3.0.0)
naturally (~> 2.2)
optparse (~> 0.1.1)
plist (>= 3.1.0, < 4.0.0)
rubyzip (>= 2.0.0, < 3.0.0)
security (= 0.1.3)
simctl (~> 1.6.3)
terminal-notifier (>= 2.0.0, < 3.0.0)
terminal-table (>= 1.4.5, < 2.0.0)
terminal-table (~> 3)
tty-screen (>= 0.6.3, < 1.0.0)
tty-spinner (>= 0.8.0, < 1.0.0)
word_wrap (~> 1.0.0)
Expand All @@ -159,9 +160,9 @@ GEM
fourflusher (2.3.1)
fuzzy_match (2.0.4)
gh_inspector (1.1.3)
google-apis-androidpublisher_v3 (0.29.0)
google-apis-core (>= 0.9.0, < 2.a)
google-apis-core (0.9.1)
google-apis-androidpublisher_v3 (0.49.0)
google-apis-core (>= 0.11.0, < 2.a)
google-apis-core (0.11.1)
addressable (~> 2.5, >= 2.5.1)
googleauth (>= 0.16.2, < 2.a)
httpclient (>= 2.8.1, < 3.a)
Expand All @@ -170,30 +171,29 @@ GEM
retriable (>= 2.0, < 4.a)
rexml
webrick
google-apis-iamcredentials_v1 (0.15.0)
google-apis-core (>= 0.9.0, < 2.a)
google-apis-playcustomapp_v1 (0.12.0)
google-apis-core (>= 0.9.1, < 2.a)
google-apis-iamcredentials_v1 (0.17.0)
google-apis-core (>= 0.11.0, < 2.a)
google-apis-playcustomapp_v1 (0.13.0)
google-apis-core (>= 0.11.0, < 2.a)
google-apis-storage_v1 (0.19.0)
google-apis-core (>= 0.9.0, < 2.a)
google-cloud-core (1.6.0)
google-cloud-env (~> 1.0)
google-cloud-errors (~> 1.0)
google-cloud-env (1.6.0)
faraday (>= 0.17.3, < 3.0)
google-cloud-errors (1.3.0)
google-cloud-storage (1.43.0)
google-cloud-errors (1.3.1)
google-cloud-storage (1.44.0)
addressable (~> 2.8)
digest-crc (~> 0.4)
google-apis-iamcredentials_v1 (~> 0.1)
google-apis-storage_v1 (~> 0.19.0)
google-cloud-core (~> 1.6)
googleauth (>= 0.16.2, < 2.a)
mini_mime (~> 1.0)
googleauth (1.3.0)
googleauth (1.8.1)
faraday (>= 0.17.3, < 3.a)
jwt (>= 1.4, < 3.0)
memoist (~> 0.16)
multi_json (~> 1.11)
os (>= 0.9, < 2.0)
signet (>= 0.16, < 2.a)
Expand All @@ -203,23 +203,22 @@ GEM
httpclient (2.8.3)
i18n (1.14.1)
concurrent-ruby (~> 1.0)
jmespath (1.6.1)
jmespath (1.6.2)
json (2.6.2)
jwt (2.5.0)
memoist (0.16.2)
mini_magick (4.11.0)
mini_mime (1.1.2)
jwt (2.7.1)
mini_magick (4.12.0)
mini_mime (1.1.5)
minitest (5.19.0)
molinillo (0.8.0)
multi_json (1.15.0)
multipart-post (2.0.0)
multipart-post (2.3.0)
nanaimo (0.3.0)
nap (1.1.0)
naturally (2.2.1)
netrc (0.11.0)
optparse (0.1.1)
os (1.1.4)
plist (3.6.0)
plist (3.7.0)
public_suffix (4.0.7)
rake (13.0.6)
representable (3.2.0)
Expand All @@ -233,17 +232,17 @@ GEM
ruby2_keywords (0.0.5)
rubyzip (2.3.2)
security (0.1.3)
signet (0.17.0)
signet (0.18.0)
addressable (~> 2.8)
faraday (>= 0.17.5, < 3.a)
jwt (>= 1.5, < 3.0)
multi_json (~> 1.10)
simctl (1.6.8)
simctl (1.6.10)
CFPropertyList
naturally
terminal-notifier (2.0.0)
terminal-table (1.8.0)
unicode-display_width (~> 1.1, >= 1.1.1)
terminal-table (3.0.2)
unicode-display_width (>= 1.1.1, < 3)
trailblazer-option (0.1.2)
tty-cursor (0.7.1)
tty-screen (0.8.1)
Expand All @@ -257,8 +256,8 @@ GEM
unf (0.1.4)
unf_ext
unf_ext (0.0.8.2)
unicode-display_width (1.8.0)
webrick (1.7.0)
unicode-display_width (2.4.2)
webrick (1.8.1)
word_wrap (1.0.0)
xcodeproj (1.22.0)
CFPropertyList (>= 2.3.3, < 4.0)
Expand All @@ -279,7 +278,7 @@ PLATFORMS
DEPENDENCIES
cocoapods (~> 1.11)
dotenv
fastlane (~> 2.205)
fastlane (~> 2.215.1)

BUNDLED WITH
2.3.21
1 change: 1 addition & 0 deletions fastlane/Fastfile-Android
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ platform :android do
build
changelog_from_git_commits
upload_to_play_store(
root_url: "https://androidpublisher.googleapis.com/",
track: options[:track],
skip_upload_metadata: true,
skip_upload_images: true,
Expand Down
11 changes: 6 additions & 5 deletions lib/tosti/tosti_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@ class TostiScreen extends StatelessWidget {
return Scaffold(
appBar: ThaliaAppBar(
title: const Text('T.O.S.T.I.'),
actions: [
IconButton(
icon: const Icon(Icons.logout),
onPressed: () => BlocProvider.of<TostiAuthCubit>(context).logOut(),
),
collapsingActions: [
IconAppbarAction(
'logout',
Icons.logout,
() => BlocProvider.of<TostiAuthCubit>(context).logOut(),
)
],
),
drawer: MenuDrawer(),
Expand Down
16 changes: 8 additions & 8 deletions lib/ui/screens/album_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,6 @@ class _AlbumScreenState extends State<AlbumScreen> {
}
}

Widget _shareAlbumButton(BuildContext context) => IconButton(
padding: const EdgeInsets.all(16),
color: Theme.of(context).primaryIconTheme.color,
icon: Icon(Icons.adaptive.share),
onPressed: () => _shareAlbum(context),
);

@override
Widget build(BuildContext context) {
return BlocProvider.value(
Expand All @@ -74,7 +67,14 @@ class _AlbumScreenState extends State<AlbumScreen> {
return Scaffold(
appBar: ThaliaAppBar(
title: Text(state.result?.title.toUpperCase() ?? title),
actions: [_shareAlbumButton(context)],
collapsingActions: [
IconAppbarAction(
'SHARE',
Icons.adaptive.share,
() => _shareAlbum(context),
tooltip: 'share album',
)
],
),
body: body,
);
Expand Down
20 changes: 10 additions & 10 deletions lib/ui/screens/albums_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,16 @@ class _AlbumsScreenState extends State<AlbumsScreen> {
return Scaffold(
appBar: ThaliaAppBar(
title: const Text('ALBUMS'),
actions: [
IconButton(
onPressed: () => context.pushNamed(
'liked-photos',
),
icon: const Icon(Icons.favorite_border)),
IconButton(
padding: const EdgeInsets.all(16),
icon: const Icon(Icons.search),
onPressed: () async {
collapsingActions: [
IconAppbarAction(
'LIKED PHOTOS',
Icons.favorite_border,
() => context.pushNamed('liked-photos'),
),
IconAppbarAction(
'SEARCH',
Icons.search,
() async {
final searchCubit = AlbumListCubit(
RepositoryProvider.of<ApiRepository>(context),
);
Expand Down
12 changes: 6 additions & 6 deletions lib/ui/screens/calendar_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,12 @@ class _CalendarScreenState extends State<CalendarScreen> {
return Scaffold(
appBar: ThaliaAppBar(
title: const Text('CALENDAR'),
actions: [
IconButton(
padding: const EdgeInsets.all(16),
icon: const Icon(Icons.search),
onPressed: openSearch,
),
collapsingActions: [
IconAppbarAction(
'SEARCH',
Icons.search,
openSearch,
)
],
),
drawer: MenuDrawer(),
Expand Down
Loading

0 comments on commit 36349e1

Please sign in to comment.