Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Unified Diff: chrome/android/java_staging/src/org/chromium/chrome/browser/widget/BoundedLinearLayout.java

Issue 1206673003: Merge java_staging/src into java/src. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/android/java_staging/src/org/chromium/chrome/browser/widget/BoundedLinearLayout.java
diff --git a/chrome/android/java_staging/src/org/chromium/chrome/browser/widget/BoundedLinearLayout.java b/chrome/android/java_staging/src/org/chromium/chrome/browser/widget/BoundedLinearLayout.java
deleted file mode 100644
index 4c6b41c2bd807b93c3de1fc58f50c1e126e4fdb7..0000000000000000000000000000000000000000
--- a/chrome/android/java_staging/src/org/chromium/chrome/browser/widget/BoundedLinearLayout.java
+++ /dev/null
@@ -1,53 +0,0 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-package org.chromium.chrome.browser.widget;
-
-import android.content.Context;
-import android.content.res.TypedArray;
-import android.util.AttributeSet;
-import android.widget.LinearLayout;
-
-import org.chromium.chrome.R;
-
-/**
- * A LinearLayout that can be constrained to a maximum width.
- *
- * Example:
- * <org.chromium.chrome.browser.widget.BoundedLinearLayout
- * xmlns:android="http://schemas.android.com/apk/res/android"
- * xmlns:chrome="http://schemas.android.com/apk/res-auto"
- * android:layout_width="match_parent"
- * android:layout_height="match_parent"
- * chrome:maxWidth="692dp" >
- * ...
- */
-public class BoundedLinearLayout extends LinearLayout {
-
- private static final int NO_MAX_WIDTH = -1;
-
- private final int mMaxWidth;
-
- /**
- * Constructor for inflating from XML.
- */
- public BoundedLinearLayout(Context context, AttributeSet attrs) {
- super(context, attrs);
- TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.BoundedView);
- mMaxWidth = a.getDimensionPixelSize(R.styleable.BoundedView_maxWidth, NO_MAX_WIDTH);
- a.recycle();
- }
-
- @Override
- protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
- // Limit width to mMaxWidth.
- int widthSize = MeasureSpec.getSize(widthMeasureSpec);
- if (mMaxWidth != NO_MAX_WIDTH && widthSize > mMaxWidth) {
- int widthMode = MeasureSpec.getMode(widthMeasureSpec);
- if (widthMode == MeasureSpec.UNSPECIFIED) widthMode = MeasureSpec.AT_MOST;
- widthMeasureSpec = MeasureSpec.makeMeasureSpec(mMaxWidth, widthMode);
- }
- super.onMeasure(widthMeasureSpec, heightMeasureSpec);
- }
-}

Powered by Google App Engine
This is Rietveld 408576698