Screenshots for square/leakcanary#2856
LeakCanary's Heap Dumps screen with the overflow menu open, on API 29, before and after moving the LeakCanary UI off the window decor action bar and onto a Toolbar.
Screenshots for square/leakcanary#2856
LeakCanary's Heap Dumps screen with the overflow menu open, on API 29, before and after moving the LeakCanary UI off the window decor action bar and onto a Toolbar.
| #!/usr/bin/env kotlin -language-version 1.9 | |
| // Make sure you run "brew install kotlin graphviz" first. | |
| @file:Repository("https://repo.maven.apache.org/maven2/") | |
| @file:Repository("https://dl.google.com/dl/android/maven2/") | |
| @file:DependsOn("com.squareup.leakcanary:shark-android:3.0-alpha-8") | |
| @file:DependsOn("androidx.collection:collection-jvm:1.4.0") | |
| import androidx.collection.IntList |
| #!/usr/bin/env kotlin -language-version 1.9 | |
| // Make sure you run "brew install kotlin graphviz" first. | |
| @file:Repository("https://repo.maven.apache.org/maven2/") | |
| @file:Repository("https://dl.google.com/dl/android/maven2/") | |
| @file:DependsOn("com.squareup.leakcanary:shark-android:3.0-alpha-8") | |
| @file:DependsOn("androidx.collection:collection-jvm:1.4.0") | |
| import androidx.collection.IntList |
| #!/usr/bin/env kotlin -language-version 1.9 | |
| // Make sure you run "brew install kotlin graphviz" first. | |
| @file:Repository("https://repo.maven.apache.org/maven2/") | |
| @file:Repository("https://dl.google.com/dl/android/maven2/") | |
| @file:DependsOn("com.squareup.leakcanary:shark-android:3.0-alpha-8") | |
| import java.io.File | |
| import shark.ActualMatchingReferenceReaderFactory |
| #!/usr/bin/env kotlin | |
| // Before running this script, install Kotlin with `brew install kotlin` | |
| // Then run this with `kotlin shark-custom-script.main.kts` | |
| // Edit this script in the latest Android Studio or IntelliJ IDEA releases to get dependency import and auto completion. | |
| @file:Repository("https://repo.maven.apache.org/maven2/") | |
| @file:DependsOn("com.squareup.leakcanary:shark-android:2.13") | |
| import java.io.File |
| class CoffeeLogger { | |
| fun log(msg: String) { | |
| println(msg) | |
| } | |
| } | |
| interface Heater { | |
| fun on() | |
| fun off() | |
| val isHot: Boolean |
| #!/usr/bin/env kotlin | |
| @file:Repository("https://repo.maven.apache.org/maven2/") | |
| @file:DependsOn("com.datumbox:datumbox-framework-lib:0.8.2") | |
| @file:DependsOn("com.squareup.okio:okio:3.3.0") | |
| @file:DependsOn("com.squareup.moshi:moshi:1.13.0") | |
| @file:DependsOn("com.squareup.moshi:moshi-adapters:1.13.0") | |
| @file:DependsOn("com.squareup.moshi:moshi-kotlin:1.13.0") | |
| import com.squareup.moshi.Moshi |
| import android.content.Context; | |
| import android.os.Debug; | |
| import android.os.Handler; | |
| import android.os.Looper; | |
| import android.util.Log; | |
| import android.widget.Toast; | |
| import com.squareup.haha.perflib.ClassObj; | |
| import com.squareup.haha.perflib.HprofParser; | |
| import com.squareup.haha.perflib.Snapshot; | |
| import com.squareup.haha.perflib.io.HprofBuffer; |
| // Here's an example based on a test that was meant to reproduce a race condition, | |
| // where we were launching several coroutines in a specific order without realizing | |
| // that a different order would introduce race conditions. The test code here was used to | |
| // reproduce the exact bad order. | |
| // Note: there are probably better approaches to doing this. | |
| val dispatcher = QueueDelegatingTestDispatcher() | |
| // ... TODO pass in the dispatcher to the tested code launching coroutines |
| import android.os.Build.VERSION.SDK_INT | |
| import android.os.Bundle | |
| import android.os.Parcel | |
| import android.util.Base64 | |
| /** | |
| * This class implements a fix for https://issuetracker.google.com/issues/147246567 | |
| * Investigation: https://twitter.com/Piwai/status/1374129312153038849 | |
| * | |
| * Usage: |