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

Commit bdbb6e06 authored by Svetoslav's avatar Svetoslav Committed by Android (Google) Code Review
Browse files

Merge "Update the "More options" button in printing." into lmp-dev

parents a72dd6ba 3c238245
Loading
Loading
Loading
Loading
+0 −19
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2014 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.
-->

<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
    android:src="@drawable/ic_menu_savetopdf"
    android:tint="@color/promoted_action_background_color" />
+209 −235
Original line number Diff line number Diff line
@@ -216,44 +216,18 @@

        <!-- More options -->

         <LinearLayout
             android:id="@+id/more_options_container"
             android:layout_width="fill_parent"
             android:layout_height="wrap_content"
             android:paddingStart="28dip"
             android:paddingEnd="28dip"
             android:orientation="vertical"
             android:visibility="visible">

             <ImageView
                 android:layout_width="fill_parent"
                 android:layout_height="1dip"
                 android:layout_gravity="fill_horizontal"
                 android:background="?android:attr/colorControlNormal"
                 android:contentDescription="@null">
             </ImageView>

        <Button
            android:id="@+id/more_options_button"
            style="?android:attr/borderlessButtonStyle"
                 android:layout_width="fill_parent"
            android:textColor="?android:attr/textColorPrimary"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
                 android:layout_gravity="fill_horizontal"
            android:layout_marginStart="16dip"
            android:layout_marginEnd="16dip"
            android:text="@string/more_options_button"
                 android:gravity="start|center_vertical"
                 android:textAllCaps="false">
            android:gravity="start|center_vertical">
        </Button>

             <ImageView
                 android:layout_width="fill_parent"
                 android:layout_height="1dip"
                 android:layout_gravity="fill_horizontal"
                 android:background="?android:attr/colorControlNormal"
                 android:contentDescription="@null">
             </ImageView>

         </LinearLayout>

    </LinearLayout>

    <!-- Expand/collapse handle -->
+3 −0
Original line number Diff line number Diff line
@@ -33,6 +33,9 @@
        android:id="@+id/message"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginStart="16dip"
        android:layout_marginEnd="16dip"
        android:gravity="center_horizontal"
        android:text="@string/print_error_default_message"
        android:textAppearance="?android:attr/textAppearanceLargeInverse">
    </TextView>
+4 −7
Original line number Diff line number Diff line
@@ -180,8 +180,6 @@ public class PrintActivity extends Activity implements RemotePrintDocument.Updat
    private TextView mSummaryCopies;
    private TextView mSummaryPaperSize;

    private View mAdvancedPrintOptionsContainer;

    private Button mMoreOptionsButton;

    private ImageView mPrintButton;
@@ -1024,7 +1022,6 @@ public class PrintActivity extends Activity implements RemotePrintDocument.Updat
        mPageRangeEditText.addTextChangedListener(new RangeTextWatcher());

        // Advanced options button.
        mAdvancedPrintOptionsContainer = findViewById(R.id.more_options_container);
        mMoreOptionsButton = (Button) findViewById(R.id.more_options_button);
        mMoreOptionsButton.setOnClickListener(clickListener);

@@ -1294,10 +1291,10 @@ public class PrintActivity extends Activity implements RemotePrintDocument.Updat
        ComponentName serviceName = mCurrentPrinter.getId().getServiceName();
        if (!TextUtils.isEmpty(PrintOptionUtils.getAdvancedOptionsActivityName(
                this, serviceName))) {
            mAdvancedPrintOptionsContainer.setVisibility(View.VISIBLE);
            mMoreOptionsButton.setVisibility(View.VISIBLE);
            mMoreOptionsButton.setEnabled(true);
        } else {
            mAdvancedPrintOptionsContainer.setVisibility(View.GONE);
            mMoreOptionsButton.setVisibility(View.GONE);
            mMoreOptionsButton.setEnabled(false);
        }

@@ -1704,7 +1701,7 @@ public class PrintActivity extends Activity implements RemotePrintDocument.Updat
                if (position == 0 && getPdfPrinter() != null) {
                    PrinterHolder printerHolder = (PrinterHolder) getItem(position);
                    title = printerHolder.printer.getName();
                    icon = getResources().getDrawable(R.drawable.ic_savetopdf);
                    icon = getResources().getDrawable(R.drawable.ic_menu_savetopdf);
                } else if (position == 1) {
                    title = getString(R.string.all_printers);
                }
@@ -1712,7 +1709,7 @@ public class PrintActivity extends Activity implements RemotePrintDocument.Updat
                if (position == 1 && getPdfPrinter() != null) {
                    PrinterHolder printerHolder = (PrinterHolder) getItem(position);
                    title = printerHolder.printer.getName();
                    icon = getResources().getDrawable(R.drawable.ic_savetopdf);
                    icon = getResources().getDrawable(R.drawable.ic_menu_savetopdf);
                } else if (position == getCount() - 1) {
                    title = getString(R.string.all_printers);
                } else {
+9 −9
Original line number Diff line number Diff line
@@ -53,7 +53,7 @@ public final class PrintContentView extends ViewGroup implements View.OnClickLis

    private View mDraggableContent;
    private View mPrintButton;
    private ViewGroup mMoreOptionsContainer;
    private View mMoreOptionsButton;
    private ViewGroup mOptionsContainer;

    private View mEmbeddedContentContainer;
@@ -140,7 +140,7 @@ public final class PrintContentView extends ViewGroup implements View.OnClickLis
        mDynamicContent = findViewById(R.id.dynamic_content);
        mDraggableContent = findViewById(R.id.draggable_content);
        mPrintButton = findViewById(R.id.print_button);
        mMoreOptionsContainer = (ViewGroup) findViewById(R.id.more_options_container);
        mMoreOptionsButton = findViewById(R.id.more_options_button);
        mOptionsContainer = (ViewGroup) findViewById(R.id.options_container);
        mEmbeddedContentContainer = findViewById(R.id.embedded_content_container);
        mEmbeddedContentScrim = findViewById(R.id.embedded_content_scrim);
@@ -301,14 +301,14 @@ public final class PrintContentView extends ViewGroup implements View.OnClickLis
                || (mDragProgress == 1.0f && progress < 1.0f)) {
            mSummaryContent.setLayerType(View.LAYER_TYPE_HARDWARE, null);
            mDraggableContent.setLayerType(View.LAYER_TYPE_HARDWARE, null);
            mMoreOptionsContainer.setLayerType(View.LAYER_TYPE_HARDWARE, null);
            mMoreOptionsButton.setLayerType(View.LAYER_TYPE_HARDWARE, null);
            ensureImeClosedAndInputFocusCleared();
        }
        if ((mDragProgress > 0 && progress == 0)
                || (mDragProgress < 1.0f && progress == 1.0f)) {
            mSummaryContent.setLayerType(View.LAYER_TYPE_NONE, null);
            mDraggableContent.setLayerType(View.LAYER_TYPE_NONE, null);
            mMoreOptionsContainer.setLayerType(View.LAYER_TYPE_NONE, null);
            mMoreOptionsButton.setLayerType(View.LAYER_TYPE_NONE, null);
        }

        mDragProgress = progress;
@@ -317,7 +317,7 @@ public final class PrintContentView extends ViewGroup implements View.OnClickLis

        final float inverseAlpha = 1.0f - progress;
        mOptionsContainer.setAlpha(inverseAlpha);
        mMoreOptionsContainer.setAlpha(inverseAlpha);
        mMoreOptionsButton.setAlpha(inverseAlpha);

        mEmbeddedContentScrim.setBackgroundColor(computeScrimColor());

@@ -336,8 +336,8 @@ public final class PrintContentView extends ViewGroup implements View.OnClickLis
            if (mOptionsStateChangeListener != null) {
                mOptionsStateChangeListener.onOptionsClosed();
            }
            if (mMoreOptionsContainer.getVisibility() != View.GONE) {
                mMoreOptionsContainer.setVisibility(View.INVISIBLE);
            if (mMoreOptionsButton.getVisibility() != View.GONE) {
                mMoreOptionsButton.setVisibility(View.INVISIBLE);
            }
            mDraggableContent.setVisibility(View.INVISIBLE);
            // If we change the scrim visibility the dimming is lagging
@@ -346,8 +346,8 @@ public final class PrintContentView extends ViewGroup implements View.OnClickLis
            mEmbeddedContentScrim.setClickable(false);
            mExpandCollapseIcon.setBackgroundResource(R.drawable.ic_expand_more);
        } else {
            if (mMoreOptionsContainer.getVisibility() != View.GONE) {
                mMoreOptionsContainer.setVisibility(View.VISIBLE);
            if (mMoreOptionsButton.getVisibility() != View.GONE) {
                mMoreOptionsButton.setVisibility(View.VISIBLE);
            }
            mDraggableContent.setVisibility(View.VISIBLE);
        }