Bug 1289242 - Enable ASDetailAcitivity's close button draft
authorAndrzej Hunt <ahunt@mozilla.com>
Mon, 01 Aug 2016 15:14:31 -0700
changeset 398733 93bd8d84c2961d04c6994bfb403c845591487326
parent 398732 8b083176a27c7c5903476632635b6861afb4833a
child 398734 39093e5343e6ee82eb830c68810e069953f70a04
child 398858 32550b97b94ae15b71f93d86381287115adfc8a3
push id25610
push userahunt@mozilla.com
push dateTue, 09 Aug 2016 17:01:51 +0000
bugs1289242
milestone51.0a1
Bug 1289242 - Enable ASDetailAcitivity's close button MozReview-Commit-ID: 2UnbsMGeVnr
mobile/android/base/java/org/mozilla/gecko/home/activitystream/ASDetailActivity.java
--- a/mobile/android/base/java/org/mozilla/gecko/home/activitystream/ASDetailActivity.java
+++ b/mobile/android/base/java/org/mozilla/gecko/home/activitystream/ASDetailActivity.java
@@ -6,16 +6,19 @@ package org.mozilla.gecko.home.activitys
 
 import android.os.Bundle;
 import android.support.annotation.Nullable;
 import android.support.design.widget.TabLayout;
 import android.support.v4.app.Fragment;
 import android.support.v4.app.FragmentPagerAdapter;
 import android.support.v4.view.ViewPager;
 import android.support.v7.app.AppCompatActivity;
+import android.view.View;
+import android.widget.Button;
+import android.widget.ImageView;
 
 import org.mozilla.gecko.R;
 import org.mozilla.gecko.home.CombinedHistoryPanel;
 import org.mozilla.gecko.home.HomeFragment;
 import org.mozilla.gecko.home.HomePager;
 
 import java.util.EnumSet;
 
@@ -71,16 +74,24 @@ public class ASDetailActivity
                 }
             }
         };
 
         pager.setAdapter(adapter);
 
         TabLayout tabLayout = (TabLayout) findViewById(R.id.as_detail_tablayout);
         tabLayout.setupWithViewPager(pager);
+
+        final ImageView exitButton = (ImageView) findViewById(R.id.as_close_button);
+        exitButton.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                finish();
+            }
+        });
     }
 
     @Override
     public void onUrlOpen(String url, EnumSet<HomePager.OnUrlOpenListener.Flags> flags) {
         ASOpenURLDelegate.openURL(this, url, flags);
     }
 
     @Override