diff options
author | John Hoford <hoford@google.com> | 2013-08-14 12:14:54 -0700 |
---|---|---|
committer | John Hoford <hoford@google.com> | 2013-08-14 12:14:54 -0700 |
commit | 5d1cf1f9c8c6359905988e096b50f07ce326df21 (patch) | |
tree | 78ccdde6f5f3f82a6b7d331148b1aecd5e995d11 | |
parent | 3130144bcd9403153b9385f9b91d4262d626a113 (diff) | |
download | android_packages_apps_Gallery2-5d1cf1f9c8c6359905988e096b50f07ce326df21.tar.gz android_packages_apps_Gallery2-5d1cf1f9c8c6359905988e096b50f07ce326df21.tar.bz2 android_packages_apps_Gallery2-5d1cf1f9c8c6359905988e096b50f07ce326df21.zip |
Add close button to info panel
Change-Id: Iba4c64af4e37bc3d03cc3cb1ee371158d210c5f8
-rw-r--r-- | res/layout/filtershow_info_panel.xml | 47 | ||||
-rw-r--r-- | src/com/android/gallery3d/filtershow/FilterShowActivity.java | 6 | ||||
-rw-r--r-- | src/com/android/gallery3d/filtershow/info/InfoPanel.java | 13 |
3 files changed, 59 insertions, 7 deletions
diff --git a/res/layout/filtershow_info_panel.xml b/res/layout/filtershow_info_panel.xml index e2da73f95..39446dfbf 100644 --- a/res/layout/filtershow_info_panel.xml +++ b/res/layout/filtershow_info_panel.xml @@ -18,8 +18,49 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" - android:background="#3a4e56" - android:padding="16dp"> + android:background="#3a4e56"> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="horizontal" + android:background="#222"> + + <ImageButton + android:id="@+id/cancelInfo" + android:layout_width="wrap_content" + android:layout_height="fill_parent" + android:layout_gravity="left|center_vertical" + android:background="@android:color/transparent" + android:layout_weight=".1" + android:gravity="left" + android:src="@drawable/ic_menu_cancel_holo_light" + android:textSize="18dip"/> + + <ImageView + android:layout_width="2dp" + android:layout_height="fill_parent" + android:src="@drawable/filtershow_vertical_bar"/> + + <TextView + style="?android:textAppearanceLarge" + android:textStyle="bold" + android:textColor="#fff" + android:layout_weight="1" + android:layout_gravity="left|center_vertical" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:padding="8dip" + android:text="@string/filtershow_show_info_panel"/> + + </LinearLayout> + + <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:orientation="vertical" + android:background="#3a4e56" + android:padding="16dp"> <ScrollView android:layout_width="match_parent" @@ -115,5 +156,5 @@ android:layout_height="wrap_content"/> </LinearLayout> </ScrollView> - + </LinearLayout> </LinearLayout>
\ No newline at end of file diff --git a/src/com/android/gallery3d/filtershow/FilterShowActivity.java b/src/com/android/gallery3d/filtershow/FilterShowActivity.java index 43f132505..523b00e6e 100644 --- a/src/com/android/gallery3d/filtershow/FilterShowActivity.java +++ b/src/com/android/gallery3d/filtershow/FilterShowActivity.java @@ -320,7 +320,7 @@ public class FilterShowActivity extends FragmentActivity implements OnItemClickL } } - private void hideInformationPanel() { + public void hideInformationPanel() { FrameLayout infoLayout = (FrameLayout) findViewById(R.id.central_panel_container); infoLayout.setVisibility(View.GONE); Fragment fragment = getSupportFragmentManager().findFragmentByTag(InfoPanel.FRAGMENT_TAG); @@ -332,7 +332,7 @@ public class FilterShowActivity extends FragmentActivity implements OnItemClickL mShowingInformationPanel = false; } - public void showInformationPanel() { + public void toggleInformationPanel() { mShowingInformationPanel = !mShowingInformationPanel; if (!mShowingInformationPanel) { hideInformationPanel(); @@ -957,7 +957,7 @@ public class FilterShowActivity extends FragmentActivity implements OnItemClickL return true; } case R.id.showInfoPanel: { - showInformationPanel(); + toggleInformationPanel(); return true; } } diff --git a/src/com/android/gallery3d/filtershow/info/InfoPanel.java b/src/com/android/gallery3d/filtershow/info/InfoPanel.java index a06527f3a..39102f186 100644 --- a/src/com/android/gallery3d/filtershow/info/InfoPanel.java +++ b/src/com/android/gallery3d/filtershow/info/InfoPanel.java @@ -22,16 +22,17 @@ import android.net.Uri; import android.os.Bundle; import android.support.v4.app.Fragment; import android.text.Html; -import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; +import android.widget.ImageButton; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.TextView; import com.android.gallery3d.R; import com.android.gallery3d.exif.ExifInterface; import com.android.gallery3d.exif.ExifTag; +import com.android.gallery3d.filtershow.FilterShowActivity; import com.android.gallery3d.filtershow.cache.ImageLoader; import com.android.gallery3d.filtershow.imageshow.MasterImage; @@ -45,6 +46,7 @@ public class InfoPanel extends Fragment { private TextView mImageName; private TextView mImageSize; private TextView mExifData; + private ImageButton mHideButton; private String createStringFromIfFound(ExifTag exifTag, int tag, int str) { String exifString = ""; @@ -72,10 +74,19 @@ public class InfoPanel extends Fragment { mImageName = (TextView) mMainView.findViewById(R.id.imageName); mImageSize = (TextView) mMainView.findViewById(R.id.imageSize); mExifData = (TextView) mMainView.findViewById(R.id.exifData); + mHideButton =(ImageButton) mMainView.findViewById(R.id.cancelInfo); + HistogramView histogramView = (HistogramView) mMainView.findViewById(R.id.histogramView); histogramView.setBitmap(bitmap); + mHideButton.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + FilterShowActivity activity = (FilterShowActivity)getActivity(); + activity.toggleInformationPanel(); + } + }); Uri uri = MasterImage.getImage().getUri(); String path = ImageLoader.getLocalPathFromUri(getActivity(), uri); Uri localUri = null; |