Google发布了更新版本的Android Studio 3.5。更新到此版本后,我在下面收到此警告:
This project uses Gradle KTS build files which are not fully supported.
Some functions may be affected.
Run Code Online (Sandbox Code Playgroud)
但是,我相信此警告仅限于使用Gradle的Kotlin DSL管理其依赖项的开发人员。而不是使用常规脚本
我正在尝试将 PNG 图像文件转换为 webP 图像文件。但即使我的应用程序 minSdkVersion>19 也给我一个错误,但我不知道为什么它给我这样的错误
0 files were converted
1 files were skipped because there was no net space savings
Run Code Online (Sandbox Code Playgroud) 在更新我的android studio之前,我的代码使用重新排列/重新格式化(command + ALT + L)看起来像这样
许多用户在这里报告了此问题
https://issuetracker.google.com/issues?q=Ctrl%2BAlt%2BL
https://issuetracker.google.com/issues/139769915
重新格式化代码的快捷方式
Windows:Ctrl + Alt + L
Linux:Ctrl + Shift + Alt + L
macOS:Option + Command + L
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:fitsSystemWindows="true"
tools:context=".view.activity.UserFollowingActivity">
<data>
<variable
name="viewModel"
type="com.socket.chat.viewmodel.ConversionListVM" />
</data>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>
Run Code Online (Sandbox Code Playgroud)
但是在更新android studio之后,我的代码顺序改变了,而重新排列/重新格式化(command + ALT + L)代码
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:fitsSystemWindows="true"
tools:context=".view.activity.UserFollowingActivity">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
</androidx.constraintlayout.widget.ConstraintLayout>
<data>
<variable
name="viewModel"
type="com.socket.chat.viewmodel.ConversionListVM" />
</data>
</layout>
Run Code Online (Sandbox Code Playgroud)
在每个设计XML文件和AndroidManifest.xml文件中均对其进行了更改。
那么如何用旧方法做到这一点呢?
内联类:内联类
我想知道内联与 kotlin 中其他类的确切区别是什么?我想知道确切的内联类是做什么的以及我们什么时候使用它?