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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/firstrun/DataReductionProxyView.java

Issue 1339613004: Add Data Reduction Proxy card to Clank FRE in EM (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixing strings Created 5 years, 3 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/src/org/chromium/chrome/browser/firstrun/DataReductionProxyView.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/firstrun/TosAndUmaView.java b/chrome/android/java/src/org/chromium/chrome/browser/firstrun/DataReductionProxyView.java
similarity index 67%
copy from chrome/android/java/src/org/chromium/chrome/browser/firstrun/TosAndUmaView.java
copy to chrome/android/java/src/org/chromium/chrome/browser/firstrun/DataReductionProxyView.java
index 3c8ec646ae56b446f0187c1d5c414178575bd09b..054f182c17d852a4df897a280b8bee18af257111 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/firstrun/TosAndUmaView.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/firstrun/DataReductionProxyView.java
@@ -7,17 +7,19 @@ package org.chromium.chrome.browser.firstrun;
import android.content.Context;
import android.util.AttributeSet;
import android.widget.FrameLayout;
+import android.widget.ImageView;
import android.widget.LinearLayout;
+import android.widget.TextView;
import org.chromium.base.ApiCompatibilityUtils;
import org.chromium.chrome.R;
/**
- * View that handles orientation changes for Terms of Service and UMA first run page.
+ * View that handles orientation changes for the Data Saver first run page.
*/
-public class TosAndUmaView extends FrameLayout {
+public class DataReductionProxyView extends FrameLayout {
- public TosAndUmaView(Context context, AttributeSet attrs) {
+ public DataReductionProxyView(Context context, AttributeSet attrs) {
super(context, attrs);
}
@@ -28,7 +30,10 @@ public class TosAndUmaView extends FrameLayout {
int width = MeasureSpec.getSize(widthMeasureSpec);
int height = MeasureSpec.getSize(heightMeasureSpec);
LinearLayout content = (LinearLayout) findViewById(R.id.fre_content);
- LinearLayout wrapper = (LinearLayout) findViewById(R.id.text_wrapper);
+ LinearLayout wrapper = (LinearLayout) findViewById(R.id.data_reduction_invitation_text);
+ ImageView imageView = (ImageView) findViewById(R.id.data_reduction_illustration);
+ TextView textView1 = (TextView) findViewById(R.id.data_reduction_title_1);
+ TextView textView2 = (TextView) findViewById(R.id.data_reduction_title_2);
MarginLayoutParams params = (MarginLayoutParams) wrapper.getLayoutParams();
int paddingStart = 0;
if (width >= 2 * getResources().getDimension(R.dimen.fre_image_carousel_width)
@@ -37,10 +42,17 @@ public class TosAndUmaView extends FrameLayout {
paddingStart = getResources().getDimensionPixelSize(R.dimen.fre_margin);
params.width = 0;
params.height = LayoutParams.WRAP_CONTENT;
+ imageView.getLayoutParams().width =
+ (int) getResources().getDimension(R.dimen.fre_image_carousel_width);
+ textView1.setVisibility(VISIBLE);
+ textView2.setVisibility(GONE);
} else {
content.setOrientation(LinearLayout.VERTICAL);
params.width = LayoutParams.WRAP_CONTENT;
params.height = 0;
+ imageView.getLayoutParams().width = LayoutParams.WRAP_CONTENT;
+ textView1.setVisibility(GONE);
+ textView2.setVisibility(VISIBLE);
}
ApiCompatibilityUtils.setPaddingRelative(content,
paddingStart,
@@ -50,4 +62,4 @@ public class TosAndUmaView extends FrameLayout {
wrapper.setLayoutParams(params);
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
}
-}
+}

Powered by Google App Engine
This is Rietveld 408576698