Skip to content

Commit

Permalink
Merge pull request #106 from VocaDB/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
up2code authored Jan 31, 2020
2 parents 34a4719 + e7b069a commit 577b303
Show file tree
Hide file tree
Showing 30 changed files with 589 additions and 19 deletions.
1 change: 1 addition & 0 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ android {
signingConfig signingConfigs.release

minifyEnabled true
shrinkResources false
useProguard true

proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions android/fastlane/Appfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
json_key_file("./google-play-service-account.json") # Path to the json secret file - Follow https://docs.fastlane.tools/actions/supply/#setup to get one
package_name("com.coolappz.Vocadb") # e.g. com.krausefx.app
29 changes: 29 additions & 0 deletions android/fastlane/Fastfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# This file contains the fastlane.tools configuration
# You can find the documentation at https://docs.fastlane.tools
#
# For a list of all available actions, check out
#
# https://docs.fastlane.tools/actions
#
# For a list of all available plugins, check out
#
# https://docs.fastlane.tools/plugins/available-plugins
#

# Uncomment the line if you want fastlane to automatically update itself
# update_fastlane

default_platform(:android)

platform :android do
desc "Submit to Beta"
lane :beta do
upload_to_play_store(track: 'internal',
skip_upload_apk: true,
skip_upload_metadata: true,
skip_upload_changelogs: true,
skip_upload_images: true,
skip_upload_screenshots: true,
aab: './../build/app/outputs/bundle/release/app.aab')
end
end
29 changes: 29 additions & 0 deletions android/fastlane/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
fastlane documentation
================
# Installation

Make sure you have the latest version of the Xcode command line tools installed:

```
xcode-select --install
```

Install _fastlane_ using
```
[sudo] gem install fastlane -NV
```
or alternatively using `brew cask install fastlane`

# Available Actions
## Android
### android beta
```
fastlane android beta
```
Submit to Beta

----

This README.md is auto-generated and will be re-generated every time [fastlane](https://fastlane.tools) is run.
More information about fastlane can be found on [fastlane.tools](https://fastlane.tools).
The documentation of fastlane can be found on [docs.fastlane.tools](https://docs.fastlane.tools).
3 changes: 2 additions & 1 deletion assets/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,8 @@
"topArtists": "Top artists",
"version": "Version",
"search": "Search",
"parentTag": "Parent"
"parentTag": "Parent",
"map": "Map"
},
"error": {
"emptyFavoriteSongs": "No favorite songs",
Expand Down
3 changes: 2 additions & 1 deletion assets/i18n/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@
"topArtists": "トップアーティスト",
"version": "バージョン",
"search": "サーチ",
"parentTag": "Parent"
"parentTag": "Parent",
"map": "会場"
},
"error": {
"emptyFavoriteSongs": "何もないです(´・д・`)…",
Expand Down
3 changes: 2 additions & 1 deletion assets/i18n/ms.json
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@
"topArtists": "Top artists",
"version": "Version",
"search": "Search",
"parentTag": "Parent"
"parentTag": "Parent",
"map": "Map"
},
"error": {
"emptyFavoriteSongs": "No favorite songs",
Expand Down
3 changes: 2 additions & 1 deletion assets/i18n/th.json
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@
"topArtists": "ศิลปินยอดนิยม",
"version": "เวอร์ชัน",
"search": "ค้นหา",
"parentTag": "Parent"
"parentTag": "Parent",
"map": "แผนที่"
},
"error": {
"emptyFavoriteSongs": "ยังไม่มีเพลงที่ชอบ",
Expand Down
9 changes: 9 additions & 0 deletions ios/fastlane/Appfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# app_identifier("[[APP_IDENTIFIER]]") # The bundle identifier of your app
# apple_id("[[APPLE_ID]]") # Your Apple email address
app_identifier("com.up2up.vocadb")
apple_id("apple_id")
team_name("team_name")
team_id("team_id")

# For more information about the Appfile, see:
# https://docs.fastlane.tools/advanced/#appfile
25 changes: 25 additions & 0 deletions ios/fastlane/Fastfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# This file contains the fastlane.tools configuration
# You can find the documentation at https://docs.fastlane.tools
#
# For a list of all available actions, check out
#
# https://docs.fastlane.tools/actions
#
# For a list of all available plugins, check out
#
# https://docs.fastlane.tools/plugins/available-plugins
#

# Uncomment the line if you want fastlane to automatically update itself
# update_fastlane

default_platform(:ios)

platform :ios do
desc "Build and submit app to testflight"
lane :beta do
build_ios_app(export_method: "app-store")
upload_to_testflight
# add actions here: https://docs.fastlane.tools/actions
end
end
29 changes: 29 additions & 0 deletions ios/fastlane/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
fastlane documentation
================
# Installation

Make sure you have the latest version of the Xcode command line tools installed:

```
xcode-select --install
```

Install _fastlane_ using
```
[sudo] gem install fastlane -NV
```
or alternatively using `brew cask install fastlane`

# Available Actions
## iOS
### ios beta
```
fastlane ios beta
```
Build and submit app to testflight

----

This README.md is auto-generated and will be re-generated every time [fastlane](https://fastlane.tools) is run.
More information about fastlane can be found on [fastlane.tools](https://fastlane.tools).
The documentation of fastlane can be found on [docs.fastlane.tools](https://docs.fastlane.tools).
36 changes: 36 additions & 0 deletions lib/blocs/event_series_bloc.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import 'dart:async';

import 'package:rxdart/rxdart.dart';
import 'package:vocadb/blocs/config_bloc.dart';
import 'package:vocadb/models/release_event_series_model.dart';
import 'package:vocadb/services/release_event_series_rest_service.dart';

class EventSeriesBloc {
final _eventSeriesDetail = BehaviorSubject<ReleaseEventSeriesModel>();

Observable get eventSeriesDetail$ => _eventSeriesDetail.stream;

final int id;

ReleaseEventSeriesRestService releaseEventSeriesService;

ConfigBloc configBloc;

EventSeriesBloc(this.id,
{ReleaseEventSeriesRestService releaseEventSeriesService, this.configBloc}) {
this.releaseEventSeriesService ??=
releaseEventSeriesService ?? ReleaseEventSeriesRestService();

fetchEventSeriesDetail();
}

Future<void> fetchEventSeriesDetail() async {
return releaseEventSeriesService
.byId(this.id, lang: configBloc.contentLang)
.then(_eventSeriesDetail.add);
}

void dispose() {
_eventSeriesDetail?.close();
}
}
6 changes: 5 additions & 1 deletion lib/blocs/home_bloc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,12 @@ class HomeBloc {
_albumService.top(lang: configBloc.contentLang).then(_topAlbums.add);
}



Future<void> updateRecentEvents() async {
_releaseEventService.recently(lang: configBloc.contentLang).then(_recentEvents.add);
_releaseEventService.recently(lang: configBloc.contentLang)
.then((result) => result.reversed.toList())
.then(_recentEvents.add);
}

void dispose() {
Expand Down
3 changes: 3 additions & 0 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import 'package:vocadb/pages/album_detail/album_detail_page.dart';
import 'package:vocadb/pages/artist/artist_page.dart';
import 'package:vocadb/pages/artist_detail/artist_detail_page.dart';
import 'package:vocadb/pages/event_detail/event_detail_page.dart';
import 'package:vocadb/pages/event_seiries/event_series_page.dart';
import 'package:vocadb/pages/main/ranking_filter_page.dart';
import 'package:vocadb/pages/release_event/release_event_page.dart';
import 'package:vocadb/pages/search/more_album_page.dart';
Expand All @@ -50,6 +51,7 @@ import 'pages/main/home_tab.dart';
import 'pages/main/ranking_tab.dart';

void main() async {
WidgetsFlutterBinding.ensureInitialized();
var dir = await getApplicationDocumentsDirectory();
Hive.init(dir.path);

Expand Down Expand Up @@ -195,6 +197,7 @@ class RootApp extends StatelessWidget {
YoutubePlaylistScreen.routeName: (context) =>
YoutubePlaylistScreen(),
TagCategoryScreen.routeName: (context) => TagCategoryScreen(),
EventSeriesScreen.routeName: (context) => EventSeriesScreen(),
},
);
},
Expand Down
2 changes: 1 addition & 1 deletion lib/models/entry_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class EntryModel extends BaseModel {

String get imageUrl {
if (mainPicture != null) {
return (entryType == EntryType.ReleaseEvent)
return (entryType == EntryType.ReleaseEvent || entryType == EntryType.ReleaseEventSeries)
? mainPicture.urlThumb.replaceAll('mainThumb', 'mainOrig')
: mainPicture.urlThumb;
}
Expand Down
9 changes: 6 additions & 3 deletions lib/models/release_event_series_model.dart
Original file line number Diff line number Diff line change
@@ -1,22 +1,25 @@
import 'package:intl/intl.dart';
import 'package:vocadb/models/artist_event_model.dart';
import 'package:vocadb/models/base_model.dart';
import 'package:vocadb/models/entry_model.dart';
import 'package:vocadb/models/release_event_model.dart';
import 'package:vocadb/utils/json_utils.dart';

class ReleaseEventSeriesModel extends EntryModel {
EntryType entryType = EntryType.ReleaseEventSeries;
String description;
String category;
String pictureMime;
List<ReleaseEventModel> events;

ReleaseEventSeriesModel();

ReleaseEventSeriesModel.fromJson(Map<String, dynamic> json)
: description = json['description'],
category = json['category'],
events = JSONUtils.mapJsonArray<ReleaseEventModel>(
json['events'], (v) => ReleaseEventModel.fromJson(v)),
super.fromJson(json);

static List<ReleaseEventSeriesModel> jsonToList(List items) {
return items.map((i) => ReleaseEventSeriesModel.fromJson(i)).toList();
}
}

46 changes: 42 additions & 4 deletions lib/pages/event_detail/event_detail_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@ import 'package:vocadb/constants.dart';
import 'package:vocadb/models/album_model.dart';
import 'package:vocadb/models/release_event_model.dart';
import 'package:vocadb/models/song_model.dart';
import 'package:vocadb/pages/event_seiries/event_series_page.dart';
import 'package:vocadb/pages/search/search_page.dart';
import 'package:vocadb/utils/analytic_constant.dart';
import 'package:vocadb/widgets/album_section.dart';
import 'package:vocadb/widgets/artist_section.dart';
import 'package:vocadb/widgets/result.dart';
import 'package:vocadb/widgets/section.dart';
import 'package:vocadb/widgets/song_list_section.dart';
import 'package:vocadb/widgets/space_divider.dart';
import 'package:vocadb/widgets/text_info_section.dart';
Expand Down Expand Up @@ -73,6 +75,15 @@ class EventDetailPage extends StatelessWidget {
return [Text('Expansion panel')];
}

void navigateToPlace(String query) async {
String uri = Uri.encodeFull('geo:0,0?q=$query');
if (await canLaunch(uri)) {
await launch(uri);
} else {
await launch(Uri.encodeFull('https://maps.apple.com/?q=$query'));
}
}

buildData(BuildContext context, ReleaseEventModel releaseEvent) {
return CustomScrollView(
slivers: <Widget>[
Expand Down Expand Up @@ -100,8 +111,8 @@ class EventDetailPage extends StatelessWidget {
: Hero(
tag: this.tag,
child: CachedNetworkImage(
imageUrl: this.imageUrl,
fit: BoxFit.cover,
imageUrl: releaseEvent.imageUrl,
fit: BoxFit.contain,
placeholder: (context, url) =>
Container(color: Colors.grey),
errorWidget: (context, url, error) =>
Expand All @@ -125,7 +136,22 @@ class EventDetailPage extends StatelessWidget {
Icon(
Icons.share,
),
Text('Share', style: TextStyle(fontSize: 12))
Text(FlutterI18n.translate(context, 'label.share'), style: TextStyle(fontSize: 12))
],
)),
),
(releaseEvent.venueName == null)? Container() : Expanded(
child: FlatButton(
onPressed: () {
navigateToPlace(releaseEvent.venueName);
},
child: Column(
children: <Widget>[
Icon(
Icons.place,
),
Text(FlutterI18n.translate(context, 'label.map'),
style: TextStyle(fontSize: 12))
],
)),
),
Expand Down Expand Up @@ -214,6 +240,18 @@ class EventDetailPage extends StatelessWidget {
);
},
),
(releaseEvent.series == null)? Container() : Section(
title: FlutterI18n.translate(context, 'label.series'),
children: [
ListTile(
leading: Icon(Icons.event_note),
title: Text(releaseEvent.series.name),
onTap: () {
EventSeriesScreen.navigate(context, releaseEvent.series);
},
)
],
),
WebLinkSection(
webLinks: releaseEvent.webLinks,
title: FlutterI18n.translate(context, 'label.references'))
Expand Down Expand Up @@ -281,7 +319,7 @@ class EventDetailPage extends StatelessWidget {
tag: this.tag,
child: CachedNetworkImage(
imageUrl: this.imageUrl,
fit: BoxFit.cover,
fit: BoxFit.contain,
placeholder: (context, url) =>
Container(color: Colors.grey),
errorWidget: (context, url, error) =>
Expand Down
Loading

0 comments on commit 577b303

Please sign in to comment.