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

Commit bf32a1dc authored by Adrian Roos's avatar Adrian Roos Committed by android-build-merger
Browse files

Merge "Keep RemoteInputView visible when focused" into nyc-dev

am: 046f2c80

* commit '046f2c80':
  Keep RemoteInputView visible when focused

Change-Id: I2c0fefa9cb4e761a833fe554532aefd0875de4ad
parents ce528bba 046f2c80
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -21,7 +21,7 @@
    <com.android.internal.widget.NotificationActionListLayout
    <com.android.internal.widget.NotificationActionListLayout
            android:id="@+id/actions"
            android:id="@+id/actions"
            android:layout_width="match_parent"
            android:layout_width="match_parent"
            android:layout_height="56dp"
            android:layout_height="@dimen/notification_action_list_height"
            android:paddingEnd="4dp"
            android:paddingEnd="4dp"
            android:orientation="horizontal"
            android:orientation="horizontal"
            android:gravity="center_vertical"
            android:gravity="center_vertical"
+3 −0
Original line number Original line Diff line number Diff line
@@ -152,6 +152,9 @@
    <!-- The margin on the end of the content view with a picture.-->
    <!-- The margin on the end of the content view with a picture.-->
    <dimen name="notification_content_picture_margin">56dp</dimen>
    <dimen name="notification_content_picture_margin">56dp</dimen>


    <!-- The height of the notification action list -->
    <dimen name="notification_action_list_height">56dp</dimen>

    <!-- height of the content margin to accomodate for the header -->
    <!-- height of the content margin to accomodate for the header -->
    <dimen name="notification_content_margin_top">37.5dp</dimen>
    <dimen name="notification_content_margin_top">37.5dp</dimen>


+2 −0
Original line number Original line Diff line number Diff line
@@ -2584,6 +2584,8 @@
  <java-symbol type="dimen" name="input_extract_action_button_width" />
  <java-symbol type="dimen" name="input_extract_action_button_width" />
  <java-symbol type="dimen" name="input_extract_action_button_height" />
  <java-symbol type="dimen" name="input_extract_action_button_height" />


  <java-symbol type="dimen" name="notification_action_list_height" />

  <!-- TV Remote Service package -->
  <!-- TV Remote Service package -->
  <java-symbol type="string" name="config_tvRemoteServicePackage" />
  <java-symbol type="string" name="config_tvRemoteServicePackage" />


+41 −5
Original line number Original line Diff line number Diff line
@@ -374,10 +374,42 @@ public class NotificationContentView extends FrameLayout {
        mContentHeight = Math.max(Math.min(contentHeight, getHeight()), getMinHeight());;
        mContentHeight = Math.max(Math.min(contentHeight, getHeight()), getMinHeight());;
        mUnrestrictedContentHeight = Math.max(contentHeight, getMinHeight());
        mUnrestrictedContentHeight = Math.max(contentHeight, getMinHeight());
        selectLayout(mAnimate /* animate */, false /* force */);
        selectLayout(mAnimate /* animate */, false /* force */);

        int minHeightHint = getMinContentHeightHint();

        NotificationViewWrapper wrapper = getVisibleWrapper(mVisibleType);
        if (wrapper != null) {
            wrapper.setContentHeight(mContentHeight, minHeightHint);
        }

        wrapper = getVisibleWrapper(mTransformationStartVisibleType);
        if (wrapper != null) {
            wrapper.setContentHeight(mContentHeight, minHeightHint);
        }

        updateClipping();
        updateClipping();
        invalidateOutline();
        invalidateOutline();
    }
    }


    /**
     * @return the minimum apparent height that the wrapper should allow for the purpose
     *         of aligning elements at the bottom edge. If this is larger than the content
     *         height, the notification is clipped instead of being further shrunk.
     */
    private int getMinContentHeightHint() {
        if (mIsChildInGroup && (mVisibleType == VISIBLE_TYPE_SINGLELINE
                || mTransformationStartVisibleType == VISIBLE_TYPE_SINGLELINE)) {
            return mContext.getResources().getDimensionPixelSize(
                        com.android.internal.R.dimen.notification_action_list_height);
        }
        if (mHeadsUpChild != null) {
            return mHeadsUpChild.getHeight();
        } else {
            return mContractedChild.getHeight() + mContext.getResources().getDimensionPixelSize(
                com.android.internal.R.dimen.notification_action_list_height);
        }
    }

    private void updateContentTransformation() {
    private void updateContentTransformation() {
        int visibleType = calculateVisibleType();
        int visibleType = calculateVisibleType();
        if (visibleType != mVisibleType) {
        if (visibleType != mVisibleType) {
@@ -498,6 +530,10 @@ public class NotificationContentView extends FrameLayout {
                    visibleView.setVisibility(VISIBLE);
                    visibleView.setVisibility(VISIBLE);
                    transferRemoteInputFocus(visibleType);
                    transferRemoteInputFocus(visibleType);
                }
                }
                NotificationViewWrapper visibleWrapper = getVisibleWrapper(visibleType);
                if (visibleWrapper != null) {
                    visibleWrapper.setContentHeight(mContentHeight, getMinContentHeightHint());
                }


                if (animate && ((visibleType == VISIBLE_TYPE_EXPANDED && mExpandedChild != null)
                if (animate && ((visibleType == VISIBLE_TYPE_EXPANDED && mExpandedChild != null)
                        || (visibleType == VISIBLE_TYPE_HEADSUP && mHeadsUpChild != null)
                        || (visibleType == VISIBLE_TYPE_HEADSUP && mHeadsUpChild != null)
+60 −0
Original line number Original line Diff line number Diff line
/*
 * Copyright (C) 2016 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
 */

package com.android.systemui.statusbar.notification;

import android.text.Layout;
import android.text.TextUtils;
import android.util.Pools;
import android.view.View;
import android.widget.TextView;

/**
 * A transform state of the action list
*/
public class ActionListTransformState extends TransformState {

    private static Pools.SimplePool<ActionListTransformState> sInstancePool
            = new Pools.SimplePool<>(40);

    @Override
    protected boolean sameAs(TransformState otherState) {
        return otherState instanceof ActionListTransformState;
    }

    public static ActionListTransformState obtain() {
        ActionListTransformState instance = sInstancePool.acquire();
        if (instance != null) {
            return instance;
        }
        return new ActionListTransformState();
    }

    @Override
    protected void resetTransformedView() {
        // We need to keep the Y transformation, because this is used to keep the action list
        // aligned at the bottom, unrelated to transforms.
        float y = getTransformedView().getTranslationY();
        super.resetTransformedView();
        getTransformedView().setTranslationY(y);
    }

    @Override
    public void recycle() {
        super.recycle();
        sInstancePool.release(this);
    }
}
Loading