Commit 9bd22764 authored by mvanouwerkerk's avatar mvanouwerkerk Committed by Commit bot

Pull getParams up to NewTabPageViewHolder.

Review-Url: https://codereview.chromium.org/2274663003
Cr-Commit-Position: refs/heads/master@{#414683}
parent 5b71fe7f
......@@ -269,10 +269,6 @@ public class CardViewHolder extends NewTabPageViewHolder {
return LayoutInflater.from(parent.getContext()).inflate(resourceId, parent, false);
}
private RecyclerView.LayoutParams getParams() {
return (RecyclerView.LayoutParams) itemView.getLayoutParams();
}
/**
* Animates the card being swiped to the right as if the user had dismissed it. You must check
* {@link #isDismissable()} before calling.
......
......@@ -50,4 +50,8 @@ public class NewTabPageViewHolder extends RecyclerView.ViewHolder {
*/
public void updateLayoutParams() {
}
protected RecyclerView.LayoutParams getParams() {
return (RecyclerView.LayoutParams) itemView.getLayoutParams();
}
}
......@@ -4,7 +4,6 @@
package org.chromium.chrome.browser.ntp.snippets;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.widget.TextView;
......@@ -82,11 +81,10 @@ public class SectionHeaderViewHolder extends NewTabPageViewHolder {
*/
public void updateDisplay() {
mHeaderTextView.setText(mHeaderListItem.getHeaderText());
RecyclerView.LayoutParams params = (RecyclerView.LayoutParams) itemView.getLayoutParams();
int headerHeight = getHeaderHeight();
itemView.setAlpha((float) headerHeight / mMaxSnippetHeaderHeight);
params.height = headerHeight;
getParams().height = headerHeight;
itemView.requestLayout();
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment