diff --git a/leakcanary-android-core/src/main/java/leakcanary/internal/Notifications.kt b/leakcanary-android-core/src/main/java/leakcanary/internal/Notifications.kt index a636bea29e..2c0b12af5d 100644 --- a/leakcanary-android-core/src/main/java/leakcanary/internal/Notifications.kt +++ b/leakcanary-android-core/src/main/java/leakcanary/internal/Notifications.kt @@ -66,7 +66,7 @@ internal object Notifications { builder: Notification.Builder, type: NotificationType ): Notification { - builder.setSmallIcon(R.drawable.leak_canary_notification) + builder.setSmallIcon(R.drawable.leak_canary_leak) .setWhen(System.currentTimeMillis()) if (SDK_INT >= O) { diff --git a/leakcanary-android-core/src/main/java/leakcanary/internal/activity/LeakActivity.kt b/leakcanary-android-core/src/main/java/leakcanary/internal/activity/LeakActivity.kt index d90e958ee5..fd3842104d 100644 --- a/leakcanary-android-core/src/main/java/leakcanary/internal/activity/LeakActivity.kt +++ b/leakcanary-android-core/src/main/java/leakcanary/internal/activity/LeakActivity.kt @@ -3,19 +3,17 @@ package leakcanary.internal.activity import android.app.PendingIntent import android.content.Context import android.content.Intent -import android.graphics.Typeface import android.net.Uri import android.os.AsyncTask import android.os.Bundle import android.view.View -import android.widget.TextView import com.squareup.leakcanary.core.R import leakcanary.internal.HeapAnalyzerService import leakcanary.internal.InternalLeakCanary import leakcanary.internal.activity.db.Db import leakcanary.internal.activity.screen.AboutScreen -import leakcanary.internal.activity.screen.LeaksScreen import leakcanary.internal.activity.screen.HeapDumpsScreen +import leakcanary.internal.activity.screen.LeaksScreen import leakcanary.internal.navigation.NavigatingActivity import leakcanary.internal.navigation.Screen import shark.SharkLog @@ -25,15 +23,27 @@ import java.io.IOException internal class LeakActivity : NavigatingActivity() { private val leaksButton by lazy { - findViewById(R.id.leak_canary_navigation_button_leaks) + findViewById(R.id.leak_canary_navigation_button_leaks) + } + + private val leaksButtonIconView by lazy { + findViewById(R.id.leak_canary_navigation_button_leaks_icon) } private val heapDumpsButton by lazy { - findViewById(R.id.leak_canary_navigation_button_heap_dumps) + findViewById(R.id.leak_canary_navigation_button_heap_dumps) + } + + private val heapDumpsButtonIconView by lazy { + findViewById(R.id.leak_canary_navigation_button_heap_dumps_icon) } private val aboutButton by lazy { - findViewById(R.id.leak_canary_navigation_button_about) + findViewById(R.id.leak_canary_navigation_button_about) + } + + private val aboutButtonIconView by lazy { + findViewById(R.id.leak_canary_navigation_button_about_icon) } private val bottomNavigationBar by lazy { @@ -52,33 +62,33 @@ internal class LeakActivity : NavigatingActivity() { } override fun onNewScreen(screen: Screen) { - when(screen) { + when (screen) { is LeaksScreen -> { bottomNavigationBar.visibility = View.VISIBLE leaksButton.isSelected = true - leaksButton.setTypeface(null, Typeface.BOLD) + leaksButtonIconView.alpha = 1.0f heapDumpsButton.isSelected = false - heapDumpsButton.setTypeface(null, Typeface.NORMAL) + heapDumpsButtonIconView.alpha = 0.4f aboutButton.isSelected = false - aboutButton.setTypeface(null, Typeface.NORMAL) + aboutButtonIconView.alpha = 0.4f } is HeapDumpsScreen -> { bottomNavigationBar.visibility = View.VISIBLE leaksButton.isSelected = false - leaksButton.setTypeface(null, Typeface.NORMAL) + leaksButtonIconView.alpha = 0.4f heapDumpsButton.isSelected = true - heapDumpsButton.setTypeface(null, Typeface.BOLD) + heapDumpsButtonIconView.alpha = 1.0f aboutButton.isSelected = false - aboutButton.setTypeface(null, Typeface.NORMAL) + aboutButtonIconView.alpha = 0.4f } is AboutScreen -> { bottomNavigationBar.visibility = View.VISIBLE leaksButton.isSelected = false - leaksButton.setTypeface(null, Typeface.NORMAL) + leaksButtonIconView.alpha = 0.4f heapDumpsButton.isSelected = false - heapDumpsButton.setTypeface(null, Typeface.NORMAL) + heapDumpsButtonIconView.alpha = 0.4f aboutButton.isSelected = true - aboutButton.setTypeface(null, Typeface.BOLD) + aboutButtonIconView.alpha = 1.0f } else -> { bottomNavigationBar.visibility = View.GONE @@ -108,7 +118,7 @@ internal class LeakActivity : NavigatingActivity() { returnIntent: Intent? ) { SharkLog.d { - "Got activity result with requestCode=$requestCode resultCode=$resultCode returnIntent=$returnIntent" + "Got activity result with requestCode=$requestCode resultCode=$resultCode returnIntent=$returnIntent" } if (requestCode == FILE_REQUEST_CODE && resultCode == RESULT_OK && returnIntent != null) { returnIntent.data?.let { fileUri -> diff --git a/leakcanary-android-core/src/main/res/color/leak_canary_bottom_menu.xml b/leakcanary-android-core/src/main/res/color/leak_canary_bottom_menu.xml index 9e5d7ba3fe..65197a4eb3 100644 --- a/leakcanary-android-core/src/main/res/color/leak_canary_bottom_menu.xml +++ b/leakcanary-android-core/src/main/res/color/leak_canary_bottom_menu.xml @@ -1,5 +1,5 @@ - + diff --git a/leakcanary-android-core/src/main/res/drawable-anydpi-v24/leak_canary_notification.xml b/leakcanary-android-core/src/main/res/drawable-anydpi-v24/leak_canary_notification.xml deleted file mode 100644 index f5f88aa7a5..0000000000 --- a/leakcanary-android-core/src/main/res/drawable-anydpi-v24/leak_canary_notification.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - - - - - diff --git a/leakcanary-android-core/src/main/res/drawable-hdpi/leak_canary_notification.png b/leakcanary-android-core/src/main/res/drawable-hdpi/leak_canary_notification.png deleted file mode 100644 index b3fe4bcc09..0000000000 Binary files a/leakcanary-android-core/src/main/res/drawable-hdpi/leak_canary_notification.png and /dev/null differ diff --git a/leakcanary-android-core/src/main/res/drawable-mdpi/leak_canary_notification.png b/leakcanary-android-core/src/main/res/drawable-mdpi/leak_canary_notification.png deleted file mode 100644 index 9843dc0439..0000000000 Binary files a/leakcanary-android-core/src/main/res/drawable-mdpi/leak_canary_notification.png and /dev/null differ diff --git a/leakcanary-android-core/src/main/res/drawable-xhdpi/leak_canary_notification.png b/leakcanary-android-core/src/main/res/drawable-xhdpi/leak_canary_notification.png deleted file mode 100644 index 18b6aead97..0000000000 Binary files a/leakcanary-android-core/src/main/res/drawable-xhdpi/leak_canary_notification.png and /dev/null differ diff --git a/leakcanary-android-core/src/main/res/drawable-xxhdpi/leak_canary_notification.png b/leakcanary-android-core/src/main/res/drawable-xxhdpi/leak_canary_notification.png deleted file mode 100644 index e27d8a1817..0000000000 Binary files a/leakcanary-android-core/src/main/res/drawable-xxhdpi/leak_canary_notification.png and /dev/null differ diff --git a/leakcanary-android-core/src/main/res/drawable/leak_canary_dump.xml b/leakcanary-android-core/src/main/res/drawable/leak_canary_dump.xml new file mode 100644 index 0000000000..48897d5f0b --- /dev/null +++ b/leakcanary-android-core/src/main/res/drawable/leak_canary_dump.xml @@ -0,0 +1,22 @@ + + + + + diff --git a/leakcanary-android-core/src/main/res/drawable/leak_canary_info.xml b/leakcanary-android-core/src/main/res/drawable/leak_canary_info.xml new file mode 100644 index 0000000000..694aa9abd6 --- /dev/null +++ b/leakcanary-android-core/src/main/res/drawable/leak_canary_info.xml @@ -0,0 +1,5 @@ + + + diff --git a/leakcanary-android-core/src/main/res/drawable/leak_canary_leak.xml b/leakcanary-android-core/src/main/res/drawable/leak_canary_leak.xml new file mode 100644 index 0000000000..9bf97331f7 --- /dev/null +++ b/leakcanary-android-core/src/main/res/drawable/leak_canary_leak.xml @@ -0,0 +1,30 @@ + + + + + + diff --git a/leakcanary-android-core/src/main/res/drawable/leak_canary_notification.xml b/leakcanary-android-core/src/main/res/drawable/leak_canary_notification.xml deleted file mode 100644 index 3fe6f4824c..0000000000 --- a/leakcanary-android-core/src/main/res/drawable/leak_canary_notification.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - diff --git a/leakcanary-android-core/src/main/res/layout/leak_canary_leak_activity.xml b/leakcanary-android-core/src/main/res/layout/leak_canary_leak_activity.xml index e6c01fda74..a385b35d69 100644 --- a/leakcanary-android-core/src/main/res/layout/leak_canary_leak_activity.xml +++ b/leakcanary-android-core/src/main/res/layout/leak_canary_leak_activity.xml @@ -14,40 +14,95 @@ - - + + + + + + - + + + + + + > + + + \ No newline at end of file diff --git a/leakcanary-android-core/src/main/res/values/leak_canary_colors.xml b/leakcanary-android-core/src/main/res/values/leak_canary_colors.xml index 6996c6be20..c75e38ae52 100644 --- a/leakcanary-android-core/src/main/res/values/leak_canary_colors.xml +++ b/leakcanary-android-core/src/main/res/values/leak_canary_colors.xml @@ -26,7 +26,7 @@ #939CA3 #2F2F2F #151C1F - #c1151C1F + #66151C1F #40151C1F #ffffff #ffd40b