Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove old references to "__" prefixed resources initiated by #159 #263

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Snapshots are available in Sonatype's `snapshots` repository:
* Added LeakCanary version name to `LeakCanary.leakInfo()`: [#49](https://github.com/square/leakcanary/issues/49).
* `leakcanary-android-no-op` is lighter, it does not depend on `leakcanary-watcher` anymore, only 2 classes now: [#74](https://github.com/square/leakcanary/issues/74).
* Adding field state details to the text leak trace.
* A Toast is displayed while the heap dump is in progress to warn that the UI will freeze: [#20](https://github.com/square/leakcanary/issues/49). You can customize the toast by providing your own layout named `__leak_canary_heap_dump_toast.xml` (e.g. you could make it an empty layout).
* A Toast is displayed while the heap dump is in progress to warn that the UI will freeze: [#20](https://github.com/square/leakcanary/issues/49). You can customize the toast by providing your own layout named `leak_canary_heap_dump_toast.xml` (e.g. you could make it an empty layout).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope. These are the change logs for 1.3.1, which wont' change what so ever.

* If the analysis fails, the result and heap dump are kept so that it can be reported to LeakCanary: [#102](https://github.com/square/leakcanary/issues/102).
* Update to HAHA 1.3 to fix a 2 crashes [#3](https://github.com/square/leakcanary/issues/3) [46](https://github.com/square/leakcanary/issues/46)

Expand Down
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,37 +181,37 @@ That way, your release code will contain no reference to LeakCanary other than t

### Icon and label

`DisplayLeakActivity` comes with a default icon and label, which you can change by providing `R.drawable.__leak_canary_icon` and `R.string.__leak_canary_display_activity_label` in your app:
`DisplayLeakActivity` comes with a default icon and label, which you can change by providing `R.drawable.leak_canary_icon` and `R.string.leak_canary_display_activity_label` in your app:

```
res/
drawable-hdpi/
__leak_canary_icon.png
leak_canary_icon.png
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll have to do the changes on README.md when the 1.4 version is released. Until then, we need to stay accurate with 1.3.1

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another option: create a file named README-1.4.md that contains those changes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I see. Is there such a "pending" area to keep track of these kind of changes?
I don't think a README file per version is good for readability...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No pending area right now. Suggestions welcome.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Release branches could be just fine right?
Something like releases/1.4 containing updated versions of README, CHANGELOG, etc.

drawable-mdpi/
__leak_canary_icon.png
leak_canary_icon.png
drawable-xhdpi/
__leak_canary_icon.png
leak_canary_icon.png
drawable-xxhdpi/
__leak_canary_icon.png
leak_canary_icon.png
drawable-xxxhdpi/
__leak_canary_icon.png
leak_canary_icon.png
```

```xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="__leak_canary_display_activity_label">MyLeaks</string>
<string name="leak_canary_display_activity_label">MyLeaks</string>
</resources>
```

### Stored leak traces

`DisplayLeakActivity` saves up to 7 heap dumps & leak traces in the app directory. You can change that number by providing `R.integer.__leak_canary_max_stored_leaks` in your app:
`DisplayLeakActivity` saves up to 7 heap dumps & leak traces in the app directory. You can change that number by providing `R.integer.leak_canary_max_stored_leaks` in your app:

```xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<integer name="__leak_canary_max_stored_leaks">20</integer>
<integer name="leak_canary_max_stored_leaks">20</integer>
</resources>
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,9 @@ public static PendingIntent createPendingIntent(Context context, String referenc

setContentView(R.layout.leak_canary_display_leak);

listView = (ListView) findViewById(R.id.__leak_canary_display_leak_list);
failureView = (TextView) findViewById(R.id.__leak_canary_display_leak_failure);
actionButton = (Button) findViewById(R.id.__leak_canary_action);
listView = (ListView) findViewById(R.id.leak_canary_display_leak_list);
failureView = (TextView) findViewById(R.id.leak_canary_display_leak_failure);
actionButton = (Button) findViewById(R.id.leak_canary_action);

maxStoredLeaks = getResources().getInteger(R.integer.leak_canary_max_stored_leaks);

Expand Down Expand Up @@ -323,8 +323,8 @@ class LeakListAdapter extends BaseAdapter {
convertView = LayoutInflater.from(DisplayLeakActivity.this)
.inflate(R.layout.leak_canary_leak_row, parent, false);
}
TextView titleView = (TextView) convertView.findViewById(R.id.__leak_canary_row_text);
TextView timeView = (TextView) convertView.findViewById(R.id.__leak_canary_row_time);
TextView titleView = (TextView) convertView.findViewById(R.id.leak_canary_row_text);
TextView timeView = (TextView) convertView.findViewById(R.id.leak_canary_row_time);
Leak leak = getItem(position);

String index;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,14 @@ final class DisplayLeakAdapter extends BaseAdapter {
convertView =
LayoutInflater.from(context).inflate(R.layout.leak_canary_ref_top_row, parent, false);
}
TextView textView = findById(convertView, R.id.__leak_canary_row_text);
TextView textView = findById(convertView, R.id.leak_canary_row_text);
textView.setText(context.getPackageName());
} else {
if (convertView == null) {
convertView =
LayoutInflater.from(context).inflate(R.layout.leak_canary_ref_row, parent, false);
}
TextView textView = findById(convertView, R.id.__leak_canary_row_text);
TextView textView = findById(convertView, R.id.leak_canary_row_text);

boolean isRoot = position == 1;
boolean isLeakingInstance = position == getCount() - 1;
Expand All @@ -69,7 +69,7 @@ final class DisplayLeakAdapter extends BaseAdapter {
}
textView.setText(Html.fromHtml(htmlString));

DisplayLeakConnectorView connector = findById(convertView, R.id.__leak_canary_row_connector);
DisplayLeakConnectorView connector = findById(convertView, R.id.leak_canary_row_connector);
if (isRoot) {
connector.setType(DisplayLeakConnectorView.Type.START);
} else {
Expand All @@ -79,7 +79,7 @@ final class DisplayLeakAdapter extends BaseAdapter {
connector.setType(DisplayLeakConnectorView.Type.NODE);
}
}
MoreDetailsView moreDetailsView = findById(convertView, R.id.__leak_canary_row_more);
MoreDetailsView moreDetailsView = findById(convertView, R.id.leak_canary_row_more);
moreDetailsView.setOpened(opened[position]);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,23 @@
android:background="#3c3c3c"
>
<ListView
android:id="@+id/__leak_canary_display_leak_list"
android:id="@+id/leak_canary_display_leak_list"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:dividerHeight="0dp"
android:divider="@null"
/>
<TextView
android:id="@+id/__leak_canary_display_leak_failure"
android:id="@+id/leak_canary_display_leak_failure"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:textSize="12sp"
android:visibility="gone"
/>
<Button
android:id="@+id/__leak_canary_action"
android:id="@+id/leak_canary_action"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
>

<TextView
android:id="@+id/__leak_canary_row_text"
android:id="@+id/leak_canary_row_text"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
Expand All @@ -32,7 +32,7 @@
/>

<TextView
android:id="@+id/__leak_canary_row_time"
android:id="@+id/leak_canary_row_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,23 @@
>

<com.squareup.leakcanary.internal.DisplayLeakConnectorView
android:id="@+id/__leak_canary_row_connector"
android:id="@+id/leak_canary_row_connector"
android:layout_width="16dp"
android:layout_height="match_parent"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
/>

<TextView
android:id="@+id/__leak_canary_row_text"
android:id="@+id/leak_canary_row_text"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
/>

<com.squareup.leakcanary.internal.MoreDetailsView
android:id="@+id/__leak_canary_row_more"
android:id="@+id/leak_canary_row_more"
android:layout_width="12dp"
android:layout_height="12dp"
android:layout_gravity="center_vertical"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
-->
<TextView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/__leak_canary_row_text"
android:id="@+id/leak_canary_row_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="16dp"
Expand Down
2 changes: 1 addition & 1 deletion leakcanary-sample/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@
<string name="helper_text">Start the async task, <b>rotate the screen</b> and wait for a bit. A
wild notification appears.
</string>
<string name="__leak_canary_display_activity_label">Leaks Sample</string>
<string name="leak_canary_display_activity_label">Leaks Sample</string>
</resources>