DO NOT USE -
Bug 1289242 - Add button to activate AS detail view
Until we have content in the AS panel we can use this button to launch
the detail view.
MozReview-Commit-ID: F6e0y4CBwZb
--- a/mobile/android/base/java/org/mozilla/gecko/home/activitystream/ActivityStream.java
+++ b/mobile/android/base/java/org/mozilla/gecko/home/activitystream/ActivityStream.java
@@ -5,29 +5,46 @@
package org.mozilla.gecko.home.activitystream;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.LoaderManager;
import android.util.AttributeSet;
-import android.widget.FrameLayout;
import org.mozilla.gecko.BrowserApp;
import org.mozilla.gecko.R;
-
import org.mozilla.gecko.animation.PropertyAnimator;
import org.mozilla.gecko.home.HomeBanner;
import org.mozilla.gecko.home.HomeFragment;
import org.mozilla.gecko.home.HomeScreen;
+import android.view.View;
+import android.widget.Button;
+import android.widget.RelativeLayout;
+
import java.lang.ref.WeakReference;
-public class ActivityStream extends FrameLayout implements HomeScreen {
+public class ActivityStream extends RelativeLayout implements HomeScreen {
+
+ @Override
+ protected void onLayout(boolean changed, int l, int t, int r, int b) {
+ super.onLayout(changed, l, t, r, b);
+
+ Button detailButton = (Button) findViewById(R.id.detail_button);
+
+ detailButton.setOnClickListener(new OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ Intent i = new Intent(getContext(), ASDetailActivity.class);
+ getContext().startActivity(i);
+ }
+ });
+ }
public ActivityStream(Context context, AttributeSet attrs) {
super(context, attrs);
}
private WeakReference<BrowserApp> browserAppWeakReference = new WeakReference<BrowserApp>(null);
public void setBrowserApp(final BrowserApp browserApp) {
--- a/mobile/android/base/resources/layout/activity_stream.xml
+++ b/mobile/android/base/resources/layout/activity_stream.xml
@@ -1,16 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<org.mozilla.gecko.home.activitystream.ActivityStream xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:tools="http://schemas.android.com/tools"
- android:orientation="vertical"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:background="@android:color/white">
+ xmlns:tools="http://schemas.android.com/tools"
+ android:orientation="vertical"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:background="@android:color/white">
- <TextView
- tools:ignore="HardcodedText"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="Activity Stream \\o/"
- android:id="@+id/textView"
- android:layout_gravity="center_horizontal"/>
+ <Button android:id="@+id/detail_button"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ tools:ignore="HardcodedText"
+ android:text="Press here for detail view"/>
+
</org.mozilla.gecko.home.activitystream.ActivityStream>
\ No newline at end of file