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

Add support v17 Leanback #136

Merged
merged 2 commits into from
Oct 2, 2015
Merged

Add support v17 Leanback #136

merged 2 commits into from
Oct 2, 2015

Conversation

pt2121
Copy link
Contributor

@pt2121 pt2121 commented Sep 13, 2015

Addresses #60
Also, fixes toString in SearchViewQueryTextEvent.

@JakeWharton
Copy link
Owner

I merged d353616 to master. It should have been a separate PR.

}
};

final SearchEditText.OnKeyboardDismissListener emptyListener = new SearchEditText.OnKeyboardDismissListener() {
Copy link
Owner

Choose a reason for hiding this comment

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

Why this and not just set null?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is no null check when onKeyboardDismiss is called. Please see SearchEditText on line 52. Setting null here will cause null pointer exception.

Copy link
Owner

Choose a reason for hiding this comment

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

Ah, interesting. I just sent a fix for it: http://r.android.com/170991

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok. Thanks!

Copy link
Owner

Choose a reason for hiding this comment

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

Instead of creating this ahead of time, just new it up inside the onUnsubscribe method below. Then we don't pay the cost of allocation (even though it's suuuuuper small) until we actually unsubscribe.

@pt2121
Copy link
Contributor Author

pt2121 commented Sep 24, 2015

Have any chance to review this?

subscriber.add(new MainThreadSubscription() {
@Override
protected void onUnsubscribe() {
view.setOnKeyboardDismissListener(emptyListener);
Copy link
Owner

Choose a reason for hiding this comment

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

Can you add // TODO set to null once http://b.android.com/187101 is released. above this line.

@JakeWharton
Copy link
Owner

Don't forget to rebase and squash when you fix up the things I commented on! This looks great though. Looking forward to it.


setContentView(R.layout.lb_search_fragment);

searchBar = (SearchBar) findViewById(R.id.lb_search_bar);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can't new SearchBar(this) here. searchEditText will be null. In SearchBar class, mSearchTextEditor is created in onFinishInflate.

Copy link
Owner

Choose a reason for hiding this comment

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

Ah, got it.

@pt2121
Copy link
Contributor Author

pt2121 commented Sep 27, 2015

Fixed all the things. Thanks for the feedbacks. Not sure why the CI build failed.

@JakeWharton
Copy link
Owner

I'll look. There's one of two flaky tests, sadly.

On Sun, Sep 27, 2015, 9:17 AM Prat notifications@github.com wrote:

Fixed all the things. Thanks for the feedbacks. Not sure why the CI build
failed.


Reply to this email directly or view it on GitHub
#136 (comment)
.

@JakeWharton
Copy link
Owner

Are you sure the tests pass? Those are the two that are failing on Travis CI.

@pt2121
Copy link
Contributor Author

pt2121 commented Sep 27, 2015

Yes, they did when I tested locally. I ran the tests a couple times and everything looked fine. Not sure why they failed on Travis. I will look into this.

@@ -5,7 +5,7 @@ android:
- build-tools-23.0.1
- android-23
- extra-android-m2repository
- sys-img-armeabi-v7a-android-15
- sys-img-armeabi-v7a-android-17
Copy link
Owner

Choose a reason for hiding this comment

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

We're not even using this. The script below creates an emulator using API 18.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok. I'll revert it back.

@pt2121
Copy link
Contributor Author

pt2121 commented Oct 1, 2015

Jake, I fixed the test. it turns out one of the child views loading animations and sounds so it took more than 45 seconds to load the activity on some emulators.

@JakeWharton
Copy link
Owner

Nice work! Thanks.

JakeWharton added a commit that referenced this pull request Oct 2, 2015
@JakeWharton JakeWharton merged commit edcf58a into JakeWharton:master Oct 2, 2015
@pt2121
Copy link
Contributor Author

pt2121 commented Oct 2, 2015

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants