Commit 5e5233c8 by Karl Mathuthu Committed by GitHub

Removed some deprecated code. (#429)

parent 9eb0b5e6
<component name="libraryTable"> <component name="libraryTable">
<library name="Dart SDK"> <library name="Dart SDK">
<CLASSES> <CLASSES>
<root url="file:///usr/local/Caskroom/flutter/2.2.2/flutter/bin/cache/dart-sdk/lib/async" /> <root url="file://$PROJECT_DIR$/../../../../src/flutter/bin/cache/dart-sdk/lib/async" />
<root url="file:///usr/local/Caskroom/flutter/2.2.2/flutter/bin/cache/dart-sdk/lib/cli" /> <root url="file://$PROJECT_DIR$/../../../../src/flutter/bin/cache/dart-sdk/lib/cli" />
<root url="file:///usr/local/Caskroom/flutter/2.2.2/flutter/bin/cache/dart-sdk/lib/collection" /> <root url="file://$PROJECT_DIR$/../../../../src/flutter/bin/cache/dart-sdk/lib/collection" />
<root url="file:///usr/local/Caskroom/flutter/2.2.2/flutter/bin/cache/dart-sdk/lib/convert" /> <root url="file://$PROJECT_DIR$/../../../../src/flutter/bin/cache/dart-sdk/lib/convert" />
<root url="file:///usr/local/Caskroom/flutter/2.2.2/flutter/bin/cache/dart-sdk/lib/core" /> <root url="file://$PROJECT_DIR$/../../../../src/flutter/bin/cache/dart-sdk/lib/core" />
<root url="file:///usr/local/Caskroom/flutter/2.2.2/flutter/bin/cache/dart-sdk/lib/developer" /> <root url="file://$PROJECT_DIR$/../../../../src/flutter/bin/cache/dart-sdk/lib/developer" />
<root url="file:///usr/local/Caskroom/flutter/2.2.2/flutter/bin/cache/dart-sdk/lib/ffi" /> <root url="file://$PROJECT_DIR$/../../../../src/flutter/bin/cache/dart-sdk/lib/ffi" />
<root url="file:///usr/local/Caskroom/flutter/2.2.2/flutter/bin/cache/dart-sdk/lib/html" /> <root url="file://$PROJECT_DIR$/../../../../src/flutter/bin/cache/dart-sdk/lib/html" />
<root url="file:///usr/local/Caskroom/flutter/2.2.2/flutter/bin/cache/dart-sdk/lib/indexed_db" /> <root url="file://$PROJECT_DIR$/../../../../src/flutter/bin/cache/dart-sdk/lib/indexed_db" />
<root url="file:///usr/local/Caskroom/flutter/2.2.2/flutter/bin/cache/dart-sdk/lib/io" /> <root url="file://$PROJECT_DIR$/../../../../src/flutter/bin/cache/dart-sdk/lib/io" />
<root url="file:///usr/local/Caskroom/flutter/2.2.2/flutter/bin/cache/dart-sdk/lib/isolate" /> <root url="file://$PROJECT_DIR$/../../../../src/flutter/bin/cache/dart-sdk/lib/isolate" />
<root url="file:///usr/local/Caskroom/flutter/2.2.2/flutter/bin/cache/dart-sdk/lib/js" /> <root url="file://$PROJECT_DIR$/../../../../src/flutter/bin/cache/dart-sdk/lib/js" />
<root url="file:///usr/local/Caskroom/flutter/2.2.2/flutter/bin/cache/dart-sdk/lib/js_util" /> <root url="file://$PROJECT_DIR$/../../../../src/flutter/bin/cache/dart-sdk/lib/js_util" />
<root url="file:///usr/local/Caskroom/flutter/2.2.2/flutter/bin/cache/dart-sdk/lib/math" /> <root url="file://$PROJECT_DIR$/../../../../src/flutter/bin/cache/dart-sdk/lib/math" />
<root url="file:///usr/local/Caskroom/flutter/2.2.2/flutter/bin/cache/dart-sdk/lib/mirrors" /> <root url="file://$PROJECT_DIR$/../../../../src/flutter/bin/cache/dart-sdk/lib/mirrors" />
<root url="file:///usr/local/Caskroom/flutter/2.2.2/flutter/bin/cache/dart-sdk/lib/svg" /> <root url="file://$PROJECT_DIR$/../../../../src/flutter/bin/cache/dart-sdk/lib/svg" />
<root url="file:///usr/local/Caskroom/flutter/2.2.2/flutter/bin/cache/dart-sdk/lib/typed_data" /> <root url="file://$PROJECT_DIR$/../../../../src/flutter/bin/cache/dart-sdk/lib/typed_data" />
<root url="file:///usr/local/Caskroom/flutter/2.2.2/flutter/bin/cache/dart-sdk/lib/web_audio" /> <root url="file://$PROJECT_DIR$/../../../../src/flutter/bin/cache/dart-sdk/lib/web_audio" />
<root url="file:///usr/local/Caskroom/flutter/2.2.2/flutter/bin/cache/dart-sdk/lib/web_gl" /> <root url="file://$PROJECT_DIR$/../../../../src/flutter/bin/cache/dart-sdk/lib/web_gl" />
<root url="file:///usr/local/Caskroom/flutter/2.2.2/flutter/bin/cache/dart-sdk/lib/web_sql" />
</CLASSES> </CLASSES>
<JAVADOC /> <JAVADOC />
<SOURCES /> <SOURCES />
......
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RunConfigurationProducerService">
<option name="ignoredProducers">
<set>
<option value="com.android.tools.idea.compose.preview.runconfiguration.ComposePreviewRunConfigurationProducer" />
</set>
</option>
</component>
</project>
\ No newline at end of file
...@@ -2,14 +2,14 @@ group 'com.example.FlutterToast' ...@@ -2,14 +2,14 @@ group 'com.example.FlutterToast'
version '1.0-SNAPSHOT' version '1.0-SNAPSHOT'
buildscript { buildscript {
ext.kotlin_version = '1.6.10' ext.kotlin_version = '1.7.0'
repositories { repositories {
google() google()
mavenCentral() mavenCentral()
} }
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:7.1.2' classpath 'com.android.tools.build:gradle:7.4.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
} }
} }
......
...@@ -5,21 +5,17 @@ import android.content.Context ...@@ -5,21 +5,17 @@ import android.content.Context
import android.graphics.PorterDuff import android.graphics.PorterDuff
import android.graphics.drawable.Drawable import android.graphics.drawable.Drawable
import android.os.Build import android.os.Build
import android.os.Handler
import android.view.Gravity import android.view.Gravity
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.View
import android.view.WindowInsets
import android.view.inputmethod.InputMethodManager
import android.widget.TextView import android.widget.TextView
import android.widget.Toast import android.widget.Toast
import androidx.annotation.RequiresApi import androidx.core.content.ContextCompat
import io.flutter.plugin.common.MethodCall import io.flutter.plugin.common.MethodCall
import io.flutter.plugin.common.MethodChannel import io.flutter.plugin.common.MethodChannel
import io.flutter.plugin.common.MethodChannel.MethodCallHandler import io.flutter.plugin.common.MethodChannel.MethodCallHandler
import kotlin.Exception import kotlin.Exception
internal class MethodCallHandlerImpl(var context: Context) : MethodCallHandler { internal class MethodCallHandlerImpl(private var context: Context) : MethodCallHandler {
private var mToast: Toast? = null private var mToast: Toast? = null
...@@ -50,12 +46,14 @@ internal class MethodCallHandlerImpl(var context: Context) : MethodCallHandler { ...@@ -50,12 +46,14 @@ internal class MethodCallHandlerImpl(var context: Context) : MethodCallHandler {
val text = layout.findViewById<TextView>(R.id.text) val text = layout.findViewById<TextView>(R.id.text)
text.text = mMessage text.text = mMessage
val gradientDrawable: Drawable = if (Build.VERSION.SDK_INT >= 21) { val gradientDrawable: Drawable? = if (Build.VERSION.SDK_INT >= 21) {
context.getDrawable(R.drawable.corner)!! context.getDrawable(R.drawable.corner)!!
} else { } else {
context.resources.getDrawable(R.drawable.corner) // context.resources.getDrawable(R.drawable.corner)
ContextCompat.getDrawable(context, R.drawable.corner)
} }
gradientDrawable.setColorFilter(bgcolor.toInt(), PorterDuff.Mode.SRC_IN) gradientDrawable!!.setColorFilter(bgcolor.toInt(), PorterDuff.Mode.SRC_IN)
text.background = gradientDrawable text.background = gradientDrawable
if (textSize != null) { if (textSize != null) {
text.textSize = textSize.toFloat() text.textSize = textSize.toFloat()
...@@ -71,13 +69,14 @@ internal class MethodCallHandlerImpl(var context: Context) : MethodCallHandler { ...@@ -71,13 +69,14 @@ internal class MethodCallHandlerImpl(var context: Context) : MethodCallHandler {
if (Build.VERSION.SDK_INT <= 31) { if (Build.VERSION.SDK_INT <= 31) {
try { try {
val textView: TextView = mToast?.view!!.findViewById(android.R.id.message) val textView: TextView = mToast?.view!!.findViewById(android.R.id.message)
if (textSize != null) { if (textSize != null) {
textView.textSize = textSize.toFloat() textView.textSize = textSize.toFloat()
} }
if (textcolor != null) { if (textcolor != null) {
textView.setTextColor(textcolor.toInt()) textView.setTextColor(textcolor.toInt())
} }
} catch (e: Exception) { } catch (_: Exception) {
} }
} }
......
buildscript { buildscript {
ext.kotlin_version = '1.6.10' ext.kotlin_version = '1.7.0'
repositories { repositories {
google() google()
mavenCentral() mavenCentral()
} }
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:7.1.2' classpath 'com.android.tools.build:gradle:7.4.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
} }
} }
......
...@@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME ...@@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment