Files
lawnchair/src/com/android/launcher3/util/HorizontalInsettableView.java
Nick Chameyev 4ba48cdb8b Add quick search bar width unfold animation
Adds unfold animation to quick search bar in launcher
which changes the width of the quick search bar
from 70% to 100%.

Bug: 193795041
Test: manual
Change-Id: I8c55ca1cc5b5894847503beac8ecd8adec3e5674
2021-08-17 16:58:57 +01:00

36 lines
1.3 KiB
Java

/*
* Copyright (C) 2021 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.launcher3.util;
/**
* Allows the implementing view to add insets to the left and right.
*/
public interface HorizontalInsettableView {
/**
* Sets left and right insets for the view so it looks like the width of the view is
* reduced when inset is increased.
*
* The inset is calculated based on the width of the view: e.g. when the width of
* the view is 100px then if we apply 0.15f horizontal inset percentage the rendered width
* of the view will be 70px with 15px of padding on the left and right sides.
*
* @param insetPercentage width percentage to inset the content from the left and from the right
*/
void setHorizontalInsets(float insetPercentage);
}