Miha-x64 / Mikes_IDEA_extensions

IntelliJ IDEA: missing parts.
Apache License 2.0
34 stars 7 forks source link

Bug: when ObjectAnimator is created outside of current code block, there are false-positive warnings of not starting it #38

Closed AndroidDeveloperLB closed 2 years ago

AndroidDeveloperLB commented 2 years ago

V0.26 Example:


class MainActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
        val view = findViewById<View>(android.R.id.content)!!
        ObjectAnimatorEx.ofFloat(view, View.ALPHA, 1f).setDuration(500).start()
    }

    object ObjectAnimatorEx {
        @JvmStatic
        fun <T> ofFloat(target: T, property: Property<T, Float>, vararg values: Float): ObjectAnimator {
            return ObjectAnimator.ofFloat(target, property, *values)
        }
    }
}

image

My Application.zip

Android Studio Flamingo | 2022.2.1 Canary 4 Build #AI-222.4167.29.2221.9153536, built on October 8, 2022 Runtime version: 17.0.4.1+0-b2043.56-9127311 amd64 VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o. Windows 11 10.0 GC: G1 Young Generation, G1 Old Generation Memory: 9048M Cores: 12 Registry: external.system.auto.import.disabled=true debugger.watches.in.variables=false ide.text.editor.with.preview.show.floating.toolbar=false ide.images.show.chessboard=true

Non-Bundled Plugins: idea.plugin.protoeditor (222.4167.21) com.intellij.marketplace (222.4167.37) com.dubreuia (2.3.0) com.dethlex.numberconverter (1.5.0) String Manipulation (9.5.1) Show As ... (1.0.3) GenerateSerializationHelpers (1.0.6) GenerateSerialVersionUID (3.0.3) com.google.mad-scorecard (1.2) net.aquadc.mike.plugin (0.26) izhangzhihao.rainbow.brackets (6.26) com.ppismerov.ksvu (0.0.1)

AndroidDeveloperLB commented 2 years ago

Using this doesn't help, BTW:

object ObjectAnimatorEx {
    @JvmStatic
    fun <T> ofFloat(target: T?, property: Property<T?, Float?>, vararg values: Float): ObjectAnimator {
...
Miha-x64 commented 2 years ago

It's ain't mine, it's Android Lint.

AndroidDeveloperLB commented 2 years ago

Sorry about that. I searched "This animation should be started with #start()" and found only yours, but now that I read it, it doesn't mean that it's yours. Just no idea what is the inspection name...

image

Anyway, I've reported it on the issue tracker now: https://issuetracker.google.com/issues/254222461

I'm sorry for wasting your time.