Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a2ce811c authored by Bobby Georgescu's avatar Bobby Georgescu
Browse files

Update design for grid/filmstrip switcher

Bug: 7317501
Change-Id: I8975071b2a6d8b9f03c54c4bd3a6aa157fc6dc2e
parent ee7c1e01
Loading
Loading
Loading
Loading
+45 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2006 The Android Open Source Project

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->
<TwoLineListItem xmlns:android="http://schemas.android.com/apk/res/android"
    android:paddingLeft="18dp"
    android:paddingRight="18dp"
    android:background="?android:attr/activatedBackgroundIndicator"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:minHeight="?android:attr/listPreferredItemHeight"
    android:mode="twoLine"
    android:gravity="center_vertical"
>
    <TextView xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@android:id/text1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:singleLine="true"
        android:ellipsize="end"
        android:gravity="top"
        android:textAppearance="?android:attr/textAppearanceMedium"
        android:minHeight="?attr/listPreferredItemHeightSmall"
    />
    <TextView xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@android:id/text2"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:gravity="bottom"
        android:textAppearance="?android:attr/textAppearanceSmall"
        android:singleLine="true"
        android:minHeight="?attr/listPreferredItemHeightSmall"
    />
</TwoLineListItem>
 No newline at end of file
+2 −2
Original line number Diff line number Diff line
@@ -459,10 +459,10 @@
    <string name="no_external_storage">No external storage available</string>

    <!-- Label for album filmstrip button -->
    <string name="switch_photo_filmstrip">Filmstrip</string>
    <string name="switch_photo_filmstrip">Filmstrip view</string>

    <!-- Label for album grid button -->
    <string name="switch_photo_grid">Grid</string>
    <string name="switch_photo_grid">Grid view</string>

    <!-- The tilte of a dialog showing trimming in progress. [CHAR LIMIT=20] -->
    <string name="trimming">Trimming</string>
+14 −13
Original line number Diff line number Diff line
@@ -26,7 +26,6 @@ import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.res.Resources;
import android.text.TextUtils.TruncateAt;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
@@ -35,6 +34,7 @@ import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ShareActionProvider;
import android.widget.TextView;
import android.widget.TwoLineListItem;

import com.android.gallery3d.R;
import com.android.gallery3d.common.ApiHelper;
@@ -151,26 +151,27 @@ public class GalleryActionBar implements OnNavigationListener {
            return position;
        }

        private View getView(CharSequence label, View convertView,
                ViewGroup parent, boolean ellipsize) {
        @Override
        public View getView(int position, View convertView, ViewGroup parent) {
            if (convertView == null) {
                convertView = mInflater.inflate(R.layout.action_bar_text,
                convertView = mInflater.inflate(R.layout.action_bar_two_line_text,
                        parent, false);
            }
            TextView view = (TextView) convertView;
            view.setEllipsize(ellipsize ? TruncateAt.END : null);
            view.setText(label);
            TwoLineListItem view = (TwoLineListItem) convertView;
            view.getText1().setText(mActionBar.getTitle());
            view.getText2().setText((CharSequence) getItem(position));
            return convertView;
        }

        @Override
        public View getView(int position, View convertView, ViewGroup parent) {
            return getView(mActionBar.getTitle(), convertView, parent, true);
        }

        @Override
        public View getDropDownView(int position, View convertView, ViewGroup parent) {
            return getView((CharSequence) getItem(position), convertView, parent, false);
            if (convertView == null) {
                convertView = mInflater.inflate(R.layout.action_bar_text,
                        parent, false);
            }
            TextView view = (TextView) convertView;
            view.setText((CharSequence) getItem(position));
            return convertView;
        }
    }