Skip to content

Commit

Permalink
摆烂了
Browse files Browse the repository at this point in the history
  • Loading branch information
iris1598 committed Aug 31, 2024
1 parent 7336a02 commit d71d6df
Show file tree
Hide file tree
Showing 23 changed files with 133 additions and 32 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/prbuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
- run: flutter pub get
# 打包apk
- name: Collect Apks
run: flutter build apk --release --split-per-abi
run: flutter build apk --debug --split-per-abi
env:
KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
KEY_ALIAS: ${{ secrets.KEY_ALIAS }}
Expand Down
2 changes: 1 addition & 1 deletion android/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ gradle-wrapper.jar
GeneratedPluginRegistrant.java

# Remember to never publicly share your keystore.
# See https://flutter.dev/to/reference-keystore
# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
key.properties
**/*.keystore
**/*.jks
53 changes: 38 additions & 15 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,44 +1,67 @@
plugins {
id "com.android.application"
id "kotlin-android"
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
id "dev.flutter.flutter-gradle-plugin"
}

def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}

def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}

android {
namespace = "com.example.ss"
compileSdk = flutter.compileSdkVersion
ndkVersion = flutter.ndkVersion
namespace "com.example.kazumi"
compileSdk flutter.compileSdkVersion
ndkVersion flutter.ndkVersion

compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8
jvmTarget = '1.8'
}

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}

defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId = "com.example.ss"
applicationId "com.predidit.kazumi"
// You can update the following values to match your application needs.
// For more information, see: https://flutter.dev/to/review-gradle-config.
minSdk = flutter.minSdkVersion
targetSdk = flutter.targetSdkVersion
versionCode = flutter.versionCode
versionName = flutter.versionName
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
minSdkVersion flutter.minSdkVersion
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}

buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig = signingConfigs.debug
signingConfig signingConfigs.debug
}
}
}

flutter {
source = "../.."
source '../..'
}

dependencies {}
16 changes: 13 additions & 3 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application
android:label="ss"
android:label="Miru"
android:name="${applicationName}"
android:usesCleartextTraffic="true"
android:icon="@mipmap/ic_launcher">
<activity
android:name=".MainActivity"
android:exported="true"
android:launchMode="singleTop"
android:taskAffinity=""
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
Expand All @@ -31,8 +31,18 @@
android:name="flutterEmbedding"
android:value="2" />
</application>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
<uses-permission android:name="android.permission.READ_MEDIA_AUDIO" />
<uses-permission android:name="android.permission.READ_MEDIA_VIDEO" />
<!-- Required to query activities that can process text, see:
https://developer.android.com/training/package-visibility and
https://developer.android.com/training/package-visibility?hl=en and
https://developer.android.com/reference/android/content/Intent#ACTION_PROCESS_TEXT.
In particular, this is used by the Flutter engine in io.flutter.plugin.text.ProcessTextPlugin. -->
Expand Down
38 changes: 38 additions & 0 deletions android/app/src/main/kotlin/com/example/kazumi/MainActivity.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package com.example.kazumi

import android.content.Intent
import android.net.Uri
import android.os.Bundle
import androidx.annotation.NonNull
import io.flutter.embedding.engine.FlutterEngine
import io.flutter.plugin.common.MethodChannel
import io.flutter.embedding.android.FlutterActivity

class MainActivity: FlutterActivity() {
private val CHANNEL = "com.predidit.kazumi/intent"

override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) {
super.configureFlutterEngine(flutterEngine)
MethodChannel(flutterEngine.dartExecutor.binaryMessenger, CHANNEL).setMethodCallHandler { call, result ->
if (call.method == "openWithMime") {
val url = call.argument<String>("url")
val mimeType = call.argument<String>("mimeType")
if (url != null && mimeType != null) {
openWithMime(url, mimeType)
result.success(null)
} else {
result.error("INVALID_ARGUMENT", "URL and MIME type required", null)
}
} else {
result.notImplemented()
}
}
}

private fun openWithMime(url: String, mimeType: String) {
val intent = Intent()
intent.action = Intent.ACTION_VIEW
intent.setDataAndType(Uri.parse(url), mimeType)
startActivity(intent)
}
}
5 changes: 0 additions & 5 deletions android/app/src/main/kotlin/com/example/ss/MainActivity.kt

This file was deleted.

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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_launcher_background"/>
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
</adaptive-icon>
Binary file modified android/app/src/main/res/mipmap-hdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-mdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions android/app/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="ic_launcher_background">#ffffff</color>
</resources>
4 changes: 2 additions & 2 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ allprojects {
}
}

rootProject.buildDir = "../build"
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(":app")
project.evaluationDependsOn(':app')
}

tasks.register("clean", Delete) {
Expand Down
2 changes: 1 addition & 1 deletion android/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
org.gradle.jvmargs=-Xmx4G -XX:MaxMetaspaceSize=2G -XX:+HeapDumpOnOutOfMemoryError
org.gradle.jvmargs=-Xmx4G
android.useAndroidX=true
android.enableJetifier=true
7 changes: 4 additions & 3 deletions android/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ pluginManagement {
def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
return flutterSdkPath
}()
}
settings.ext.flutterSdkPath = flutterSdkPath()

includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")
includeBuild("${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle")

repositories {
google()
Expand All @@ -19,7 +20,7 @@ pluginManagement {
plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version "7.3.0" apply false
id "org.jetbrains.kotlin.android" version "1.7.10" apply true
id "org.jetbrains.kotlin.android" version "1.7.10" apply false
}

include ":app"
25 changes: 25 additions & 0 deletions lib/views/pages/watch/video/video_player_content.dart
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,31 @@ PopupMenuButton(
];
},
),
PopupMenuButton(
tooltip: "Toggle Danmaku",
icon: const Icon(
Icons.comment,
color: Colors.white,
),
itemBuilder: (context) {
return [
PopupMenuItem(
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 0),
child: Obx(() {
return CheckboxListTile(
value: _c.danmakuOn.value,
onChanged: (bool? value) {
if (value != null) {
_c.toggleDanmaku();
}
},
title: Text('Toggle Danmaku'),
);
}),
),
];
},
),
Obx(() {
if (_c.currentQality.value.isEmpty) {
return const SizedBox.shrink();
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ dependencies:
flutter_code_editor: ^0.3.0
flutter_highlight: ^0.7.0
flutter_i18n: ^0.35.1
flutter_js: ^0.8.0
flutter_js: ^0.8.1
flutter_markdown: ^0.6.23
get: ^4.6.5
canvas_danmaku: ^0.1.8
Expand Down

0 comments on commit d71d6df

Please sign in to comment.