Skip to content

Commit

Permalink
upgrades for android
Browse files Browse the repository at this point in the history
  • Loading branch information
krjw-eyev committed Oct 8, 2024
1 parent 24636a1 commit d0b2bce
Show file tree
Hide file tree
Showing 14 changed files with 73 additions and 82 deletions.
29 changes: 7 additions & 22 deletions .metadata
Original file line number Diff line number Diff line change
@@ -1,38 +1,23 @@
# This file tracks properties of this Flutter project.
# Used by Flutter tool to assess capabilities and perform upgrades etc.
#
# This file should be version controlled.
# This file should be version controlled and should not be manually edited.

version:
revision: ffccd96b62ee8cec7740dab303538c5fc26ac543
channel: stable
revision: "5dcb86f68f239346676ceb1ed1ea385bd215fba1"
channel: "stable"

project_type: app

# Tracks metadata for the flutter migrate command
migration:
platforms:
- platform: root
create_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543
base_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543
create_revision: 5dcb86f68f239346676ceb1ed1ea385bd215fba1
base_revision: 5dcb86f68f239346676ceb1ed1ea385bd215fba1
- platform: android
create_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543
base_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543
- platform: ios
create_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543
base_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543
- platform: linux
create_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543
base_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543
- platform: macos
create_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543
base_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543
- platform: web
create_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543
base_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543
- platform: windows
create_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543
base_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543
create_revision: 5dcb86f68f239346676ceb1ed1ea385bd215fba1
base_revision: 5dcb86f68f239346676ceb1ed1ea385bd215fba1

# User provided section

Expand Down
49 changes: 20 additions & 29 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,67 +1,58 @@
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')
def localPropertiesFile = rootProject.file("local.properties")
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localPropertiesFile.withReader("UTF-8") { reader ->
localProperties.load(reader)
}
}

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

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

android {
namespace "com.example.skyle_ik"
compileSdkVersion flutter.compileSdkVersion
ndkVersion flutter.ndkVersion
namespace = "de.eyev.skyle_ik"
compileSdk = flutter.compileSdkVersion
ndkVersion = flutter.ndkVersion

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

kotlinOptions {
jvmTarget = '1.8'
}

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}

defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.skyle_ik"
applicationId = "de.eyev.skyle_ik"
// You can update the following values to match your application needs.
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration.
minSdkVersion flutter.minSdkVersion
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
minSdk = flutter.minSdkVersion
targetSdk = 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 { }
3 changes: 1 addition & 2 deletions android/app/src/debug/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.skyle_ik">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<!-- The INTERNET permission is required for development. Specifically,
the Flutter tool needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
Expand Down
15 changes: 13 additions & 2 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.skyle_ik">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
Expand All @@ -13,6 +12,7 @@
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 @@ -36,4 +36,15 @@
android:name="flutterEmbedding"
android:value="2" />
</application>
<!-- Required to query activities that can process text, see:
https://developer.android.com/training/package-visibility 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. -->
<queries>
<intent>
<action android:name="android.intent.action.PROCESS_TEXT"/>
<data android:mimeType="text/plain"/>
</intent>
</queries>
</manifest>

This file was deleted.

5 changes: 5 additions & 0 deletions android/app/src/main/kotlin/de/eyev/skyle_ik/MainActivity.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package de.eyev.skyle_ik

import io.flutter.embedding.android.FlutterActivity

class MainActivity: FlutterActivity()
3 changes: 1 addition & 2 deletions android/app/src/profile/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.skyle_ik">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<!-- The INTERNET permission is required for development. Specifically,
the Flutter tool needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
Expand Down
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,4 +1,4 @@
org.gradle.jvmargs=-Xmx1536M
org.gradle.jvmargs=-Xmx4G -XX:+HeapDumpOnOutOfMemoryError
android.useAndroidX=true
android.enableJetifier=true
android.ndk.suppressMinSdkVersionError=21
2 changes: 1 addition & 1 deletion android/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ plugins {
id "org.jetbrains.kotlin.android" version "2.0.20" apply false
}

include ":app"
include ":app"
5 changes: 5 additions & 0 deletions lib/app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import 'package:device_info_plus/device_info_plus.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/scheduler.dart';
import 'package:flutter/services.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:gaze_interactive/api.dart';
import 'package:millimeters/millimeters.dart';
Expand Down Expand Up @@ -64,6 +65,10 @@ class _SkyleAppState extends ConsumerState<SkyleApp> with WidgetsBindingObserver

@override
void initState() {
if (UniversalPlatform.isAndroid) {
SystemChrome.setEnabledSystemUIMode(SystemUiMode.edgeToEdge, overlays: []);
}

super.initState();
Routes.widgetRef = ref;

Expand Down
20 changes: 12 additions & 8 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import 'package:gaze_interactive/api.dart';
import 'package:millimeters/millimeters.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:skyle_api/api.dart' as skyle;
import 'package:universal_platform/universal_platform.dart';
import 'package:window_manager/window_manager.dart';

import 'app.dart';
Expand All @@ -23,15 +24,18 @@ Future<void> main() async {
AppState().sharedPreferences = await SharedPreferences.getInstance();
skyle.ET.logger = Logger();

await windowManager.ensureInitialized();
const windowOptions = WindowOptions(center: true, minimumSize: Size(1440, 900), titleBarStyle: TitleBarStyle.hidden);
await windowManager.waitUntilReadyToShow(windowOptions, () async {
await windowManager.show();
await windowManager.focus();
await windowManager.setSize(const Size(1440, 900));
});
if (UniversalPlatform.isDesktop) {
await windowManager.ensureInitialized();
const windowOptions = WindowOptions(center: true,
minimumSize: Size(1440, 900),
titleBarStyle: TitleBarStyle.hidden);
await windowManager.waitUntilReadyToShow(windowOptions, () async {
await windowManager.show();
await windowManager.focus();
await windowManager.setSize(const Size(1440, 900));
});

print(windowManager.getDevicePixelRatio());
}

runApp(
Millimeters.fromView(
Expand Down
8 changes: 3 additions & 5 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -524,11 +524,9 @@ packages:
minimize_app:
dependency: "direct main"
description:
path: "."
ref: HEAD
resolved-ref: "81b13e6cf3826943b061624e9090bc35d1b3501f"
url: "https://github.com/krjw-eyev/minimize_app_plugin.git"
source: git
path: "../minimize_app_plugin"
relative: true
source: path
version: "1.0.0"
package_config:
dependency: transitive
Expand Down
4 changes: 2 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ dependency_overrides:
# path: ../flutter_gaze_interactive
# skyle_api:
# path: ../dart_skyle_api
# minimize_app:
# path: ../minimize_app_plugin
minimize_app:
path: ../minimize_app_plugin

dev_dependencies:
flutter_test:
Expand Down

0 comments on commit d0b2bce

Please sign in to comment.