diff --git a/app/build.gradle b/app/build.gradle index 2801a68..93ecaac 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -5,14 +5,14 @@ plugins { android { namespace 'com.example.appuva' - compileSdk 33 + compileSdk 34 defaultConfig { applicationId "com.example.appuva" minSdk 28 - targetSdk 33 + targetSdk 34 versionCode 1 - versionName "1.0.85" + versionName "1.0.86" vectorDrawables { useSupportLibrary true @@ -49,20 +49,19 @@ android { dependencies { implementation 'androidx.appcompat:appcompat:1.6.1' - implementation 'com.google.android.material:material:1.9.0' + implementation 'com.google.android.material:material:1.10.0' implementation 'androidx.constraintlayout:constraintlayout:2.1.4' - implementation 'androidx.webkit:webkit:1.7.0' + implementation 'androidx.webkit:webkit:1.8.0' implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.6.2' - implementation 'androidx.activity:activity-compose:1.7.2' + implementation 'androidx.activity:activity-compose:1.8.0' implementation platform('androidx.compose:compose-bom:2022.10.00') implementation 'androidx.compose.ui:ui' implementation 'androidx.compose.ui:ui-graphics' implementation 'androidx.compose.ui:ui-tooling-preview' implementation 'androidx.compose.material3:material3' - implementation 'androidx.navigation:navigation-fragment:2.6.0' - implementation 'androidx.navigation:navigation-ui:2.6.0' + implementation 'androidx.navigation:navigation-fragment-ktx:2.7.4' + implementation 'androidx.navigation:navigation-ui-ktx:2.7.4' androidTestImplementation platform('androidx.compose:compose-bom:2022.10.00') - androidTestImplementation 'androidx.compose.ui:ui-test-junit4' debugImplementation 'androidx.compose.ui:ui-tooling' debugImplementation 'androidx.compose.ui:ui-test-manifest' } diff --git a/app/src/main/java/com/example/appuva/MainActivity.java b/app/src/main/java/com/example/appuva/MainActivity.java index d79e7ce..9767e5e 100644 --- a/app/src/main/java/com/example/appuva/MainActivity.java +++ b/app/src/main/java/com/example/appuva/MainActivity.java @@ -73,10 +73,14 @@ public void onPageFinished(WebView view, String url) { // Classe com injeção do JS para estética usando Thread do Java JavaScriptInjectionService javaScriptInjectionService = new JavaScriptInjectionService(); - javaScriptInjectionService.pseudoDarkTheme(view); - javaScriptInjectionService.beautyTools(view); - javaScriptInjectionService.removeElement(view); - javaScriptInjectionService.carterinhaAluno(view); + // This method allows you to post a Runnable object to the main UI thread's message queue, + // ensuring that the code inside the Runnable is executed on the main UI thread. + webView.post(() -> { + javaScriptInjectionService.pseudoDarkTheme(view); + javaScriptInjectionService.beautyTools(view); + javaScriptInjectionService.removeElement(view); + javaScriptInjectionService.carterinhaAluno(view); + }); // Aplica um pouco de delay para que minimize o efeito gráfico da injeção de tema via JS try { @@ -92,7 +96,7 @@ public void onPageFinished(WebView view, String url) { NetworkInfo activeNetwork = connectivityManager.getActiveNetworkInfo(); boolean isConnected = activeNetwork != null && activeNetwork.isConnectedOrConnecting(); - if(isConnected) + if (isConnected) view.setVisibility(View.VISIBLE); } diff --git a/build.gradle b/build.gradle index 7bfbd2b..9de7d04 100644 --- a/build.gradle +++ b/build.gradle @@ -1,6 +1,6 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. plugins { - id 'com.android.application' version '8.1.1' apply false - id 'com.android.library' version '8.1.1' apply false + id 'com.android.application' version '8.1.2' apply false + id 'com.android.library' version '8.1.2' apply false id 'org.jetbrains.kotlin.android' version '1.7.20' apply false } \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 3a131ca..d73fd44 100644 --- a/gradle.properties +++ b/gradle.properties @@ -20,4 +20,4 @@ android.useAndroidX=true # thereby reducing the size of the R class for that library android.nonTransitiveRClass=true android.defaults.buildfeatures.buildconfig=true -android.nonFinalResIds=false \ No newline at end of file +android.nonFinalResIds=true \ No newline at end of file diff --git a/settings.gradle b/settings.gradle index a93c775..7b1aead 100644 --- a/settings.gradle +++ b/settings.gradle @@ -14,3 +14,4 @@ dependencyResolutionManagement { } rootProject.name = "AppUVA" include ':app' +