• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2012 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package com.android.inputmethod.keyboard.internal;
18 
19 public final class KeyPreviewDrawParams {
20     // The graphical geometry of the key preview.
21     // <-width->
22     // +-------+   ^
23     // |       |   |
24     // |preview| height (visible)
25     // |       |   |
26     // +       + ^ v
27     //  \     /  |offset
28     // +-\   /-+ v
29     // |  +-+  |
30     // |parent |
31     // |    key|
32     // +-------+
33     // The background of a {@link TextView} being used for a key preview may have invisible
34     // paddings. To align the more keys keyboard panel's visible part with the visible part of
35     // the background, we need to record the width and height of key preview that don't include
36     // invisible paddings.
37     public int mPreviewVisibleWidth;
38     public int mPreviewVisibleHeight;
39     // The key preview may have an arbitrary offset and its background that may have a bottom
40     // padding. To align the more keys keyboard and the key preview we also need to record the
41     // offset between the top edge of parent key and the bottom of the visible part of key
42     // preview background.
43     public int mPreviewVisibleOffset;
44 }
45