Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@ migrate_working_dir/
# VS Code which you may wish to be included in version control, so this line
# is commented out by default.
#.vscode/
.vscode/ # Ensuring .vscode is ignored

# Flutter/Dart/Pub related
# Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock.
pubspec.lock
pubspec.lock # For a library, pubspec.lock should be ignored

**/doc/api/
.dart_tool/
Expand All @@ -32,3 +33,7 @@ build/

example/android/app/src/main/res/values/mapbox_access_token.xml
example/android/app/src/main/res/values/strings.xml

# FVM Version Cache
.fvm/
.fvmrc
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"dart.flutterSdkPath": ".fvm/versions/3.29.3"
}
16 changes: 8 additions & 8 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ group 'com.eopeter.fluttermapboxnavigation'
version '1.0-SNAPSHOT'

buildscript {
ext.kotlin_version = '1.7.10'
ext.android_gradle_version = '7.4.2'
ext.kotlin_version = '1.7.22' // Updated Kotlin version
ext.android_gradle_version = '8.3.1'
repositories {
google()
mavenCentral()
Expand Down Expand Up @@ -55,14 +55,14 @@ apply plugin: 'kotlin-android'

android {
namespace 'com.eopeter.fluttermapboxnavigation'
compileSdkVersion 33
compileSdkVersion 34 // Updated compileSdkVersion

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
defaultConfig {
minSdkVersion 21
targetSdkVersion 33
targetSdkVersion 34 // Updated targetSdkVersion
multiDexEnabled true
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
Expand All @@ -73,12 +73,12 @@ android {
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_17 // Updated Java version
targetCompatibility JavaVersion.VERSION_17 // Updated Java version
}

kotlinOptions {
jvmTarget = '1.8'
jvmTarget = '17' // Updated Kotlin JVM target
}

buildFeatures{
Expand All @@ -91,7 +91,7 @@ dependencies {
implementation "com.mapbox.navigation:copilot:2.16.0"
implementation "com.mapbox.navigation:ui-app:2.16.0"
implementation "com.mapbox.navigation:ui-dropin:2.16.0"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'com.jakewharton.timber:timber:4.7.1'
implementation 'com.google.code.gson:gson:2.8.9'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class NavigationActivity : AppCompatActivity() {

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setTheme(R.style.Theme_AppCompat_NoActionBar)
setTheme(R.style.NavigationActivityTheme)
binding = NavigationActivityBinding.inflate(layoutInflater)
setContentView(binding.root)
binding.navigationView.addListener(navigationStateListener)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class EmbeddedNavigationViewFactory(

view.initialize()

activity.setTheme(R.style.Theme_AppCompat_NoActionBar)
activity.setTheme(R.style.NavigationActivityTheme)

return view
}
Expand Down
4 changes: 4 additions & 0 deletions android/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
<item name="colorAccent">@color/colorAccent</item>
</style>

<style name="NavigationActivityTheme" parent="Theme.AppCompat.NoActionBar">
<!-- You can add item overrides here if needed -->
</style>

<style name="MapboxCustomTripProgressStyle" parent="MapboxStyleTripProgressView">
<item name="tripProgressTextColor">#7B3CEA</item>
<item name="tripProgressViewBackgroundColor">#EEEEEE</item>
Expand Down
3 changes: 3 additions & 0 deletions example/.fvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"flutter": "3.29.3"
}
5 changes: 4 additions & 1 deletion example/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ migrate_working_dir/
# The .vscode folder contains launch configuration and tasks you configure in
# VS Code which you may wish to be included in version control, so this line
# is commented out by default.
#.vscode/
.vscode/

# Flutter/Dart/Pub related
**/doc/api/
Expand All @@ -42,3 +42,6 @@ app.*.map.json
/android/app/debug
/android/app/profile
/android/app/release

# FVM Version Cache
.fvm/
1 change: 1 addition & 0 deletions example/android/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ gradle-wrapper.jar
/gradlew.bat
/local.properties
GeneratedPluginRegistrant.java
/app/.cxx

# Remember to never publicly share your keystore.
# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
Expand Down
31 changes: 16 additions & 15 deletions example/android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
plugins {
id "com.android.application"
id "kotlin-android"
id "dev.flutter.flutter-gradle-plugin"
}

def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
Expand All @@ -6,11 +12,6 @@ if (localPropertiesFile.exists()) {
}
}

def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
Expand All @@ -21,12 +22,12 @@ if (flutterVersionName == null) {
flutterVersionName = '1.0'
}

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
// apply plugin: 'com.android.application'
// apply plugin: 'kotlin-android'
// apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
compileSdkVersion 33
compileSdkVersion 35 // Updated compileSdkVersion
ndkVersion flutter.ndkVersion

sourceSets {
Expand All @@ -35,12 +36,12 @@ android {


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

kotlinOptions {
jvmTarget = '1.8'
jvmTarget = '17'
}

defaultConfig {
Expand All @@ -49,7 +50,7 @@ android {
// You can update the following values to match your application needs.
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
minSdkVersion 21
targetSdkVersion 33
targetSdkVersion 35 // Updated targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
Expand All @@ -72,6 +73,6 @@ flutter {
}

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation platform("org.jetbrains.kotlin:kotlin-bom:1.8.0")
// implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation platform("org.jetbrains.kotlin:kotlin-bom:1.9.0") // Updated Kotlin BOM
}
14 changes: 0 additions & 14 deletions example/android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,17 +1,3 @@
buildscript {
ext.kotlin_version = '1.7.10'
ext.android_gradle_version = '7.4.2'
repositories {
google()
mavenCentral()
}

dependencies {
classpath "com.android.tools.build:gradle:$android_gradle_version"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}

allprojects {
repositories {
google()
Expand Down
2 changes: 1 addition & 1 deletion example/android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
30 changes: 22 additions & 8 deletions example/android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,25 @@
include ':app'
pluginManagement {
def flutterSdkPath = {
def properties = new Properties()
file("local.properties").withInputStream { properties.load(it) }
def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
return flutterSdkPath
}()

def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
def properties = new Properties()
includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")

assert localPropertiesFile.exists()
localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}

def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0" // apply true
id "com.android.application" version "8.3.1" apply false
id "org.jetbrains.kotlin.android" version "1.9.0" apply false
}

include ":app"
Loading