Controller Refactor
Bug: 3170671
First step towards a model/view/control design in Browser
introduced Controller object
started separating UI code
represent state of the app in one place only
Change-Id: Ica387d6bde2dcf1a4993c3db0cce498cf34ff60f
diff --git a/src/com/android/browser/TabScrollView.java b/src/com/android/browser/TabScrollView.java
index 7268ddc..fbb40aa 100644
--- a/src/com/android/browser/TabScrollView.java
+++ b/src/com/android/browser/TabScrollView.java
@@ -35,7 +35,7 @@
*/
public class TabScrollView extends HorizontalScrollView {
- private BrowserActivity mBrowserActivity;
+ private Context mContext;
private LinearLayout mContentView;
private int mSelected;
private Drawable mArrowLeft;
@@ -70,11 +70,11 @@
}
private void init(Context ctx) {
- mBrowserActivity = (BrowserActivity) ctx;
+ mContext = ctx;
mAnimationDuration = ctx.getResources().getInteger(
R.integer.tab_animation_duration);
setHorizontalScrollBarEnabled(false);
- mContentView = new LinearLayout(mBrowserActivity);
+ mContentView = new LinearLayout(mContext);
mContentView.setOrientation(LinearLayout.HORIZONTAL);
mContentView.setLayoutParams(
new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.MATCH_PARENT));