Skip to content

Commit

Permalink
Updating icons (#1648)
Browse files Browse the repository at this point in the history
  • Loading branch information
pyricau committed Nov 27, 2019
1 parent e4db0e7 commit 3352c2b
Show file tree
Hide file tree
Showing 14 changed files with 159 additions and 89 deletions.
Expand Up @@ -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) {
Expand Down
Expand Up @@ -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
Expand All @@ -25,15 +23,27 @@ import java.io.IOException
internal class LeakActivity : NavigatingActivity() {

private val leaksButton by lazy {
findViewById<TextView>(R.id.leak_canary_navigation_button_leaks)
findViewById<View>(R.id.leak_canary_navigation_button_leaks)
}

private val leaksButtonIconView by lazy {
findViewById<View>(R.id.leak_canary_navigation_button_leaks_icon)
}

private val heapDumpsButton by lazy {
findViewById<TextView>(R.id.leak_canary_navigation_button_heap_dumps)
findViewById<View>(R.id.leak_canary_navigation_button_heap_dumps)
}

private val heapDumpsButtonIconView by lazy {
findViewById<View>(R.id.leak_canary_navigation_button_heap_dumps_icon)
}

private val aboutButton by lazy {
findViewById<TextView>(R.id.leak_canary_navigation_button_about)
findViewById<View>(R.id.leak_canary_navigation_button_about)
}

private val aboutButtonIconView by lazy {
findViewById<View>(R.id.leak_canary_navigation_button_about_icon)
}

private val bottomNavigationBar by lazy {
Expand All @@ -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
Expand Down Expand Up @@ -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 ->
Expand Down
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_selected="false" android:color="@color/leak_canary_gray_darkest_50p" />
<item android:state_selected="false" android:color="@color/leak_canary_gray_darkest_40p" />
<item android:state_selected="true" android:color="@color/leak_canary_gray_darkest" />
</selector>

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
22 changes: 22 additions & 0 deletions leakcanary-android-core/src/main/res/drawable/leak_canary_dump.xml
@@ -0,0 +1,22 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="23dp"
android:viewportWidth="24"
android:viewportHeight="23">
<path
android:pathData="M3.25,5H10.25"
android:strokeWidth="2.5"
android:fillColor="#00000000"
android:strokeColor="#000000"
android:strokeLineCap="round"/>
<path
android:pathData="M2.25,5.25h0.5v2.5h-0.5z"
android:strokeWidth="0.5"
android:fillColor="#000000"
android:strokeColor="#000000"/>
<path
android:pathData="M3,8C3,6.8954 3.8954,6 5,6H19C20.1046,6 21,6.8954 21,8V16C21,17.1046 20.1046,18 19,18H5C3.8954,18 3,17.1046 3,16V8Z"
android:strokeWidth="2"
android:fillColor="#00000000"
android:strokeColor="#000000"/>
</vector>
@@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#151C1F"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData="M11,17h2v-6h-2v6zM12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM12,20c-4.41,0 -8,-3.59 -8,-8s3.59,-8 8,-8 8,3.59 8,8 -3.59,8 -8,8zM11,9h2L13,7h-2v2z"/>
</vector>
30 changes: 30 additions & 0 deletions leakcanary-android-core/src/main/res/drawable/leak_canary_leak.xml
@@ -0,0 +1,30 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M14.5771,8.25L14.5771,21"
android:strokeWidth="2.5"
android:fillColor="#00000000"
android:strokeColor="#151C1F"
android:strokeLineCap="round"/>
<path
android:pathData="M9.7883,4L9.7883,10.5385"
android:strokeWidth="2.5"
android:fillColor="#00000000"
android:strokeColor="#151C1F"
android:strokeLineCap="round"/>
<path
android:pathData="M19.3652,8.25L19.3244,17.5957"
android:strokeWidth="2.5"
android:fillColor="#00000000"
android:strokeColor="#151C1F"
android:strokeLineCap="round"/>
<path
android:pathData="M5,7.2691V15.4422"
android:strokeWidth="2.5"
android:fillColor="#00000000"
android:strokeColor="#151C1F"
android:strokeLineCap="round"/>
</vector>

This file was deleted.

Expand Up @@ -14,40 +14,95 @@
<LinearLayout
android:id="@+id/leak_canary_bottom_navigation_bar"
android:layout_width="match_parent"
android:layout_height="48dp"
android:orientation="horizontal"
android:layout_height="68dp"
android:background="@color/leak_canary_yellow"
android:orientation="horizontal"
>
<TextView

<LinearLayout
android:id="@+id/leak_canary_navigation_button_leaks"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:textColor="@color/leak_canary_bottom_menu"
android:orientation="vertical"
android:background="@drawable/leak_canary_tab_background"
android:text="Leaks"
/>
<TextView
>
<ImageView
android:id="@+id/leak_canary_navigation_button_leaks_icon"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_gravity="center_horizontal"
android:layout_marginTop="14dp"
android:src="@drawable/leak_canary_leak"
android:scaleType="center"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="2dp"
android:text="Leaks"
android:textColor="@color/leak_canary_bottom_menu"
android:textSize="11sp"
/>
</LinearLayout>


<LinearLayout
android:id="@+id/leak_canary_navigation_button_heap_dumps"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:textColor="@color/leak_canary_bottom_menu"
android:orientation="vertical"
android:background="@drawable/leak_canary_tab_background"
android:text="Heap Dumps"
/>
<TextView
>
<ImageView
android:id="@+id/leak_canary_navigation_button_heap_dumps_icon"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_gravity="center_horizontal"
android:layout_marginTop="14dp"
android:src="@drawable/leak_canary_dump"
android:scaleType="center"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="2dp"
android:text="Heap Dumps"
android:textColor="@color/leak_canary_bottom_menu"
android:textSize="11sp"
/>
</LinearLayout>

<LinearLayout
android:id="@+id/leak_canary_navigation_button_about"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:textColor="@color/leak_canary_bottom_menu"
android:orientation="vertical"
android:background="@drawable/leak_canary_tab_background"
android:text="About"
/>
>
<ImageView
android:id="@+id/leak_canary_navigation_button_about_icon"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_gravity="center_horizontal"
android:layout_marginTop="14dp"
android:src="@drawable/leak_canary_info"
android:scaleType="center"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="2dp"
android:text="About"
android:textColor="@color/leak_canary_bottom_menu"
android:textSize="11sp"
/>
</LinearLayout>
</LinearLayout>

</LinearLayout>
Expand Up @@ -26,7 +26,7 @@
<color name="leak_canary_gray_light">#939CA3</color>
<color name="leak_canary_gray">#2F2F2F</color>
<color name="leak_canary_gray_darkest">#151C1F</color>
<color name="leak_canary_gray_darkest_50p">#c1151C1F</color>
<color name="leak_canary_gray_darkest_40p">#66151C1F</color>
<color name="leak_canary_gray_darkest_25p">#40151C1F</color>
<color name="leak_canary_white">#ffffff</color>
<color name="leak_canary_heap_stack_trace">#ffd40b</color>
Expand Down

0 comments on commit 3352c2b

Please sign in to comment.