Commit 3586706b authored by Henrique Nakashima's avatar Henrique Nakashima Committed by Commit Bot

Remove unused ViewUtils#setNinePatchBackgroundResource()

Bug: 995916
Change-Id: I19886e1608085745ae686a86f560eaa484a39760
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1829644Reviewed-by: default avatarTommy Nyquist <nyquist@chromium.org>
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
Cr-Commit-Position: refs/heads/master@{#700835}
parent b1519836
......@@ -16,8 +16,6 @@ import android.util.TypedValue;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.DrawableRes;
import org.chromium.base.ApiCompatibilityUtils;
import org.chromium.base.ContextUtils;
import org.chromium.chrome.R;
......@@ -125,20 +123,6 @@ public class ViewUtils {
sLocationTmp[1] + view.getBottom() - view.getTop(), Region.Op.DIFFERENCE);
}
/**
* Sets the background of a view to the given 9-patch resource and restores its padding. This
* works around a bug in Android where the padding is lost when a 9-patch resource is applied
* programmatically.
*/
public static void setNinePatchBackgroundResource(View view, @DrawableRes int resource) {
int left = view.getPaddingLeft();
int top = view.getPaddingTop();
int right = view.getPaddingRight();
int bottom = view.getPaddingBottom();
view.setBackgroundResource(resource);
view.setPadding(left, top, right, bottom);
}
/**
* Converts density-independent pixels (dp) to pixels on the screen (px).
*
......
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