diff --git a/client/android/app/build.gradle b/client/android/app/build.gradle index 7aaae889..2a0d8ec6 100644 --- a/client/android/app/build.gradle +++ b/client/android/app/build.gradle @@ -35,7 +35,7 @@ android { defaultConfig { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "com.github.codingpot.pr12er" - minSdkVersion 16 + minSdkVersion 17 targetSdkVersion 30 versionCode flutterVersionCode.toInteger() versionName flutterVersionName diff --git a/client/ios/Flutter/Debug.xcconfig b/client/ios/Flutter/Debug.xcconfig index 592ceee8..ec97fc6f 100644 --- a/client/ios/Flutter/Debug.xcconfig +++ b/client/ios/Flutter/Debug.xcconfig @@ -1 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" #include "Generated.xcconfig" diff --git a/client/ios/Flutter/Release.xcconfig b/client/ios/Flutter/Release.xcconfig index 592ceee8..c4855bfe 100644 --- a/client/ios/Flutter/Release.xcconfig +++ b/client/ios/Flutter/Release.xcconfig @@ -1 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" #include "Generated.xcconfig" diff --git a/client/ios/Podfile b/client/ios/Podfile new file mode 100644 index 00000000..1e8c3c90 --- /dev/null +++ b/client/ios/Podfile @@ -0,0 +1,41 @@ +# Uncomment this line to define a global platform for your project +# platform :ios, '9.0' + +# CocoaPods analytics sends network stats synchronously affecting flutter build latency. +ENV['COCOAPODS_DISABLE_STATS'] = 'true' + +project 'Runner', { + 'Debug' => :debug, + 'Profile' => :release, + 'Release' => :release, +} + +def flutter_root + generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) + unless File.exist?(generated_xcode_build_settings_path) + raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" + end + + File.foreach(generated_xcode_build_settings_path) do |line| + matches = line.match(/FLUTTER_ROOT\=(.*)/) + return matches[1].strip if matches + end + raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" +end + +require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) + +flutter_ios_podfile_setup + +target 'Runner' do + use_frameworks! + use_modular_headers! + + flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) +end + +post_install do |installer| + installer.pods_project.targets.each do |target| + flutter_additional_ios_build_settings(target) + end +end diff --git a/client/ios/Podfile.lock b/client/ios/Podfile.lock new file mode 100644 index 00000000..aedb1a88 --- /dev/null +++ b/client/ios/Podfile.lock @@ -0,0 +1,33 @@ +PODS: + - Flutter (1.0.0) + - flutter_inappwebview (0.0.1): + - Flutter + - flutter_inappwebview/Core (= 0.0.1) + - OrderedSet (~> 5.0) + - flutter_inappwebview/Core (0.0.1): + - Flutter + - OrderedSet (~> 5.0) + - OrderedSet (5.0.0) + +DEPENDENCIES: + - Flutter (from `Flutter`) + - flutter_inappwebview (from `.symlinks/plugins/flutter_inappwebview/ios`) + +SPEC REPOS: + trunk: + - OrderedSet + +EXTERNAL SOURCES: + Flutter: + :path: Flutter + flutter_inappwebview: + :path: ".symlinks/plugins/flutter_inappwebview/ios" + +SPEC CHECKSUMS: + Flutter: 434fef37c0980e73bb6479ef766c45957d4b510c + flutter_inappwebview: bfd58618f49dc62f2676de690fc6dcda1d6c3721 + OrderedSet: aaeb196f7fef5a9edf55d89760da9176ad40b93c + +PODFILE CHECKSUM: aafe91acc616949ddb318b77800a7f51bffa2a4c + +COCOAPODS: 1.10.0 diff --git a/client/ios/Runner.xcodeproj/project.pbxproj b/client/ios/Runner.xcodeproj/project.pbxproj index 75cb1aeb..d223de01 100644 --- a/client/ios/Runner.xcodeproj/project.pbxproj +++ b/client/ios/Runner.xcodeproj/project.pbxproj @@ -8,6 +8,7 @@ /* Begin PBXBuildFile section */ 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; + 31D63AA4C4900749C7391231 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 66F25E4AC40E3622D7F0B165 /* Pods_Runner.framework */; }; 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; @@ -31,7 +32,10 @@ /* Begin PBXFileReference section */ 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; + 159BBEEA4A616A3BBF451A22 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; + 66F25E4AC40E3622D7F0B165 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 685482DD8707E3FCDF6CD11C /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; @@ -42,6 +46,7 @@ 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + A2FDA7AADBB20FE69705EB95 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -49,12 +54,24 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 31D63AA4C4900749C7391231 /* Pods_Runner.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 42B9C245395BD127A334661B /* Pods */ = { + isa = PBXGroup; + children = ( + 685482DD8707E3FCDF6CD11C /* Pods-Runner.debug.xcconfig */, + A2FDA7AADBB20FE69705EB95 /* Pods-Runner.release.xcconfig */, + 159BBEEA4A616A3BBF451A22 /* Pods-Runner.profile.xcconfig */, + ); + name = Pods; + path = Pods; + sourceTree = ""; + }; 9740EEB11CF90186004384FC /* Flutter */ = { isa = PBXGroup; children = ( @@ -72,6 +89,8 @@ 9740EEB11CF90186004384FC /* Flutter */, 97C146F01CF9000F007C117D /* Runner */, 97C146EF1CF9000F007C117D /* Products */, + 42B9C245395BD127A334661B /* Pods */, + D2373942A5573E2CE56B216E /* Frameworks */, ); sourceTree = ""; }; @@ -98,6 +117,14 @@ path = Runner; sourceTree = ""; }; + D2373942A5573E2CE56B216E /* Frameworks */ = { + isa = PBXGroup; + children = ( + 66F25E4AC40E3622D7F0B165 /* Pods_Runner.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -105,12 +132,14 @@ isa = PBXNativeTarget; buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; buildPhases = ( + 375EB4BC7B32A2A6D5D2756E /* [CP] Check Pods Manifest.lock */, 9740EEB61CF901F6004384FC /* Run Script */, 97C146EA1CF9000F007C117D /* Sources */, 97C146EB1CF9000F007C117D /* Frameworks */, 97C146EC1CF9000F007C117D /* Resources */, 9705A1C41CF9048500538489 /* Embed Frameworks */, 3B06AD1E1E4923F5004D2608 /* Thin Binary */, + 00D7A2478E99940B5D3C22A8 /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -169,6 +198,45 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ + 00D7A2478E99940B5D3C22A8 /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", + ); + name = "[CP] Embed Pods Frameworks"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; + 375EB4BC7B32A2A6D5D2756E /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; diff --git a/client/ios/Runner.xcworkspace/contents.xcworkspacedata b/client/ios/Runner.xcworkspace/contents.xcworkspacedata index 1d526a16..21a3cc14 100644 --- a/client/ios/Runner.xcworkspace/contents.xcworkspacedata +++ b/client/ios/Runner.xcworkspace/contents.xcworkspacedata @@ -4,4 +4,7 @@ + + diff --git a/client/lib/detail.dart b/client/lib/detail.dart new file mode 100644 index 00000000..f0490502 --- /dev/null +++ b/client/lib/detail.dart @@ -0,0 +1,107 @@ +import 'package:flutter/material.dart'; +import 'package:youtube_player_flutter/youtube_player_flutter.dart'; +import 'package:pr12er/utils/extractor.dart'; + +class DetailApp extends StatelessWidget { + late String url; + + DetailApp(String url) { + this.url = Extractor.extractYoutubeId(url); + } + + @override + Widget build(BuildContext context) { + return MaterialApp( + title: 'Welcome to Flutter', + home: Scaffold( + appBar: AppBar( + automaticallyImplyLeading: true, + leading: IconButton( + icon: Icon(Icons.arrow_back), + onPressed: () { + Navigator.pop(context); + }, + ), + title: Text('Detail View'), + ), + body: Detail(this.url)), + ); + } +} + +class Detail extends StatefulWidget { + late String url; + + Detail(String url) { + this.url = url; + } + @override + _DetailState createState() => _DetailState(this.url); +} + +class _DetailState extends State { + late String url; + late YoutubePlayerController _controller; + + _DetailState(String url) { + this.url = url; + } + + @override + void initState() { + super.initState(); + + _controller = YoutubePlayerController( + initialVideoId: this.url, + flags: YoutubePlayerFlags( + mute: false, + autoPlay: true, + ), + ); + } + + @override + Widget build(BuildContext context) { + return YoutubePlayer( + aspectRatio: 16 / 9, + controller: _controller, + showVideoProgressIndicator: false, + progressIndicatorColor: Colors.redAccent, + progressColors: ProgressBarColors( + playedColor: Colors.transparent, + handleColor: Colors.transparent, + ), + onEnded: (data) { + _controller.pause(); + }, + topActions: [ + const SizedBox(width: 8.0), + Expanded( + child: Text( + _controller.metadata.title, + style: const TextStyle( + color: Colors.white, + fontSize: 18.0, + ), + overflow: TextOverflow.ellipsis, + maxLines: 1, + ), + ), + ], + bottomActions: [ + const SizedBox(width: 14.0), + CurrentPosition(), + const SizedBox(width: 8.0), + ProgressBar( + isExpanded: true, + colors: ProgressBarColors( + playedColor: Colors.red, + handleColor: Colors.red, + backgroundColor: Colors.white, + bufferedColor: Colors.grey), + ), + RemainingDuration(), + ], + ); + } +} diff --git a/client/lib/main.dart b/client/lib/main.dart index e2f5a8e7..78b8adf0 100644 --- a/client/lib/main.dart +++ b/client/lib/main.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'detail.dart'; import 'service.dart'; import 'package:pr12er/protos/pkg/pr12er/messages.pb.dart'; @@ -59,23 +60,26 @@ class _ClientState extends State { if (!snapshot.hasData) { return Center(child: CircularProgressIndicator()); } - return ListView.builder( - padding: const EdgeInsets.all(8), - itemCount: snapshot.data.length, - itemBuilder: (BuildContext context, int index) { - return getTile( - index, - snapshot.data[index].title, - snapshot.data[index].presenter, - "현재 키워드 지원(X)", - snapshot.data[index].category); - }); - + return ListView.builder( + padding: const EdgeInsets.all(8), + itemCount: snapshot.data.length, + itemBuilder: (BuildContext context, int index) { + return getTile(index, + title: snapshot.data[index].title, + presenter: snapshot.data[index].presenter, + keyword: "현재 키워드 지원(X)", + category: snapshot.data[index].category, + url: snapshot.data[index].link); + }); }); } - Widget getTile(int index, String title, String presenter, String keyword, - Category category) { + Widget getTile(int index, + {String title = "", + String presenter = "", + String keyword = "", + Category category = Category.CATEGORY_UNSPECIFIED, + String url = ""}) { return Card( child: ListTile( leading: Column( @@ -98,6 +102,14 @@ class _ClientState extends State { trailing: Column( mainAxisAlignment: MainAxisAlignment.center, children: [Icon(Icons.favorite_border_outlined)]), + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => DetailApp(url), + ), + ); + }, ), ); } diff --git a/client/lib/protos/pkg/pr12er/messages.pb.dart b/client/lib/protos/pkg/pr12er/messages.pb.dart index 4a62f6ef..24b73815 100644 --- a/client/lib/protos/pkg/pr12er/messages.pb.dart +++ b/client/lib/protos/pkg/pr12er/messages.pb.dart @@ -21,6 +21,7 @@ class Video extends $pb.GeneratedMessage { ..aOS(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'presenter') ..e(5, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'category', $pb.PbFieldType.OE, defaultOrMaker: Category.CATEGORY_UNSPECIFIED, valueOf: Category.valueOf, enumValues: Category.values) ..a<$core.int>(6, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'numberOfLike', $pb.PbFieldType.O3) + ..pPS(7, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'keywords') ..hasRequiredFields = false ; @@ -32,6 +33,7 @@ class Video extends $pb.GeneratedMessage { $core.String? presenter, Category? category, $core.int? numberOfLike, + $core.Iterable<$core.String>? keywords, }) { final _result = create(); if (id != null) { @@ -52,6 +54,9 @@ class Video extends $pb.GeneratedMessage { if (numberOfLike != null) { _result.numberOfLike = numberOfLike; } + if (keywords != null) { + _result.keywords.addAll(keywords); + } return _result; } factory Video.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); @@ -128,5 +133,8 @@ class Video extends $pb.GeneratedMessage { $core.bool hasNumberOfLike() => $_has(5); @$pb.TagNumber(6) void clearNumberOfLike() => clearField(6); + + @$pb.TagNumber(7) + $core.List<$core.String> get keywords => $_getList(6); } diff --git a/client/lib/protos/pkg/pr12er/messages.pbjson.dart b/client/lib/protos/pkg/pr12er/messages.pbjson.dart index 3160e6b2..6d556018 100644 --- a/client/lib/protos/pkg/pr12er/messages.pbjson.dart +++ b/client/lib/protos/pkg/pr12er/messages.pbjson.dart @@ -33,8 +33,9 @@ const Video$json = const { const {'1': 'presenter', '3': 4, '4': 1, '5': 9, '10': 'presenter'}, const {'1': 'category', '3': 5, '4': 1, '5': 14, '6': '.pkg.pr12er.Category', '10': 'category'}, const {'1': 'number_of_like', '3': 6, '4': 1, '5': 5, '10': 'numberOfLike'}, + const {'1': 'keywords', '3': 7, '4': 3, '5': 9, '10': 'keywords'}, ], }; /// Descriptor for `Video`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List videoDescriptor = $convert.base64Decode('CgVWaWRlbxIOCgJpZBgBIAEoBVICaWQSFAoFdGl0bGUYAiABKAlSBXRpdGxlEhIKBGxpbmsYAyABKAlSBGxpbmsSHAoJcHJlc2VudGVyGAQgASgJUglwcmVzZW50ZXISMAoIY2F0ZWdvcnkYBSABKA4yFC5wa2cucHIxMmVyLkNhdGVnb3J5UghjYXRlZ29yeRIkCg5udW1iZXJfb2ZfbGlrZRgGIAEoBVIMbnVtYmVyT2ZMaWtl'); +final $typed_data.Uint8List videoDescriptor = $convert.base64Decode('CgVWaWRlbxIOCgJpZBgBIAEoBVICaWQSFAoFdGl0bGUYAiABKAlSBXRpdGxlEhIKBGxpbmsYAyABKAlSBGxpbmsSHAoJcHJlc2VudGVyGAQgASgJUglwcmVzZW50ZXISMAoIY2F0ZWdvcnkYBSABKA4yFC5wa2cucHIxMmVyLkNhdGVnb3J5UghjYXRlZ29yeRIkCg5udW1iZXJfb2ZfbGlrZRgGIAEoBVIMbnVtYmVyT2ZMaWtlEhoKCGtleXdvcmRzGAcgAygJUghrZXl3b3Jkcw=='); diff --git a/client/lib/test-server.dart b/client/lib/test-server.dart index 31a0577c..6bc52f9b 100644 --- a/client/lib/test-server.dart +++ b/client/lib/test-server.dart @@ -15,21 +15,21 @@ class GreeterService extends Pr12erServiceBase { List