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

Commit 546b6cd3 authored by Jorim Jaggi's avatar Jorim Jaggi Committed by Automerger Merge Worker
Browse files

Merge "Add jank test for IME animations" into rvc-dev am: b7681303 am: 9b508bb6

Change-Id: I859e2a169cf8e04f9db1cd95bc1df785bfaa79b9
parents fa34fc66 9b508bb6
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -306,5 +306,14 @@
                <category android:name="com.android.test.uibench.TEST" />
            </intent-filter>
        </activity>

        <activity
            android:name="WindowInsetsControllerActivity"
            android:label="WindowInsetsControllerActivity" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="com.android.test.uibench.TEST" />
            </intent-filter>
        </activity>
    </application>
</manifest>
+53 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2020 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.test.uibench;

import static android.view.WindowInsetsAnimation.Callback.DISPATCH_MODE_STOP;

import android.os.Bundle;
import android.os.PersistableBundle;
import android.view.WindowInsets;
import android.view.WindowInsetsAnimation;
import android.widget.EditText;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;

import java.util.List;

public class WindowInsetsControllerActivity extends AppCompatActivity {

    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        EditText text = new EditText(this);
        text.setText("WindowInsetsController");
        setContentView(text);
        getWindow().setDecorFitsSystemWindows(false);

        text.setWindowInsetsAnimationCallback(
                new WindowInsetsAnimation.Callback(DISPATCH_MODE_STOP) {
            @NonNull
            @Override
            public WindowInsets onProgress(@NonNull WindowInsets insets,
                    @NonNull List<WindowInsetsAnimation> runningAnimations) {
                return WindowInsets.CONSUMED;
            }
        });
    }
}