Stefan Kuhne | 61b47bb | 2015-07-28 14:04:25 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2015 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.internal.widget; |
| 18 | |
Wale Ogunwale | 3797c22 | 2015-10-27 14:21:58 -0700 | [diff] [blame] | 19 | import static android.app.ActivityManager.StackId.FULLSCREEN_WORKSPACE_STACK_ID; |
| 20 | |
Stefan Kuhne | 61b47bb | 2015-07-28 14:04:25 -0700 | [diff] [blame] | 21 | import android.content.Context; |
| 22 | import android.os.RemoteException; |
| 23 | import android.util.AttributeSet; |
Skuhne | 81c524a | 2015-08-12 13:34:14 -0700 | [diff] [blame] | 24 | import android.view.MotionEvent; |
Stefan Kuhne | 61b47bb | 2015-07-28 14:04:25 -0700 | [diff] [blame] | 25 | import android.view.View; |
Skuhne | f7b882c | 2015-08-11 17:18:58 -0700 | [diff] [blame] | 26 | import android.widget.LinearLayout; |
Stefan Kuhne | 61b47bb | 2015-07-28 14:04:25 -0700 | [diff] [blame] | 27 | import android.view.ViewGroup; |
Stefan Kuhne | f4dd71a | 2015-08-07 09:28:52 -0700 | [diff] [blame] | 28 | import android.view.ViewOutlineProvider; |
| 29 | import android.view.Window; |
Stefan Kuhne | 61b47bb | 2015-07-28 14:04:25 -0700 | [diff] [blame] | 30 | import android.util.Log; |
| 31 | import android.util.TypedValue; |
| 32 | |
Stefan Kuhne | 61b47bb | 2015-07-28 14:04:25 -0700 | [diff] [blame] | 33 | import com.android.internal.R; |
Wale Ogunwale | bf9eefc | 2015-11-17 14:47:52 -0800 | [diff] [blame^] | 34 | import com.android.internal.policy.DecorView; |
Stefan Kuhne | 61b47bb | 2015-07-28 14:04:25 -0700 | [diff] [blame] | 35 | import com.android.internal.policy.PhoneWindow; |
| 36 | |
Stefan Kuhne | 61b47bb | 2015-07-28 14:04:25 -0700 | [diff] [blame] | 37 | /** |
| 38 | * This class represents the special screen elements to control a window on free form |
| 39 | * environment. All thse screen elements are added in the "non client area" which is the area of |
| 40 | * the window which is handled by the OS and not the application. |
| 41 | * As such this class handles the following things: |
| 42 | * <ul> |
| 43 | * <li>The caption, containing the system buttons like maximize, close and such as well as |
| 44 | * allowing the user to drag the window around.</li> |
| 45 | * <li>The shadow - which is changing dependent on the window focus.</li> |
| 46 | * <li>The border around the client area (if there is one).</li> |
| 47 | * <li>The resize handles which allow to resize the window.</li> |
| 48 | * </ul> |
| 49 | * After creating the view, the function |
Wale Ogunwale | f3a62fb | 2015-10-14 17:07:29 -0700 | [diff] [blame] | 50 | * {@link #setPhoneWindow} needs to be called to make |
Stefan Kuhne | 61b47bb | 2015-07-28 14:04:25 -0700 | [diff] [blame] | 51 | * the connection to it's owning PhoneWindow. |
| 52 | * Note: At this time the application can change various attributes of the DecorView which |
| 53 | * will break things (in settle/unexpected ways): |
| 54 | * <ul> |
| 55 | * <li>setElevation</li> |
| 56 | * <li>setOutlineProvider</li> |
| 57 | * <li>setSurfaceFormat</li> |
| 58 | * <li>..</li> |
| 59 | * </ul> |
| 60 | * This will be mitigated once b/22527834 will be addressed. |
| 61 | */ |
Chong Zhang | 509ea6b | 2015-09-30 14:09:52 -0700 | [diff] [blame] | 62 | public class NonClientDecorView extends LinearLayout |
Wale Ogunwale | bf9eefc | 2015-11-17 14:47:52 -0800 | [diff] [blame^] | 63 | implements View.OnClickListener, View.OnTouchListener { |
Stefan Kuhne | 61b47bb | 2015-07-28 14:04:25 -0700 | [diff] [blame] | 64 | private final static String TAG = "NonClientDecorView"; |
| 65 | // The height of a window which has focus in DIP. |
| 66 | private final int DECOR_SHADOW_FOCUSED_HEIGHT_IN_DIP = 20; |
| 67 | // The height of a window which has not in DIP. |
| 68 | private final int DECOR_SHADOW_UNFOCUSED_HEIGHT_IN_DIP = 5; |
Stefan Kuhne | 61b47bb | 2015-07-28 14:04:25 -0700 | [diff] [blame] | 69 | private PhoneWindow mOwner = null; |
Skuhne | 81c524a | 2015-08-12 13:34:14 -0700 | [diff] [blame] | 70 | private boolean mWindowHasShadow = false; |
Wale Ogunwale | 0b3562d | 2015-11-17 11:26:56 -0800 | [diff] [blame] | 71 | public boolean mShowDecor = false; |
Skuhne | 81c524a | 2015-08-12 13:34:14 -0700 | [diff] [blame] | 72 | |
| 73 | // True if the window is being dragged. |
| 74 | private boolean mDragging = false; |
| 75 | |
Skuhne | 81c524a | 2015-08-12 13:34:14 -0700 | [diff] [blame] | 76 | // True when the left mouse button got released while dragging. |
| 77 | private boolean mLeftMouseButtonReleased; |
| 78 | |
Skuhne | a5a93ee | 2015-08-20 15:43:57 -0700 | [diff] [blame] | 79 | // True if this window is resizable (which is currently only true when the decor is shown). |
Chong Zhang | 8e89b31 | 2015-09-09 15:09:30 -0700 | [diff] [blame] | 80 | public boolean mVisible = false; |
Skuhne | a5a93ee | 2015-08-20 15:43:57 -0700 | [diff] [blame] | 81 | |
Stefan Kuhne | 61b47bb | 2015-07-28 14:04:25 -0700 | [diff] [blame] | 82 | // The current focus state of the window for updating the window elevation. |
Skuhne | 81c524a | 2015-08-12 13:34:14 -0700 | [diff] [blame] | 83 | private boolean mWindowHasFocus = true; |
Stefan Kuhne | 61b47bb | 2015-07-28 14:04:25 -0700 | [diff] [blame] | 84 | |
| 85 | // Cludge to address b/22668382: Set the shadow size to the maximum so that the layer |
| 86 | // size calculation takes the shadow size into account. We set the elevation currently |
| 87 | // to max until the first layout command has been executed. |
Skuhne | 81c524a | 2015-08-12 13:34:14 -0700 | [diff] [blame] | 88 | private boolean mAllowUpdateElevation = false; |
Stefan Kuhne | 61b47bb | 2015-07-28 14:04:25 -0700 | [diff] [blame] | 89 | |
| 90 | public NonClientDecorView(Context context) { |
| 91 | super(context); |
| 92 | } |
| 93 | |
| 94 | public NonClientDecorView(Context context, AttributeSet attrs) { |
| 95 | super(context, attrs); |
| 96 | } |
| 97 | |
| 98 | public NonClientDecorView(Context context, AttributeSet attrs, int defStyle) { |
| 99 | super(context, attrs, defStyle); |
| 100 | } |
| 101 | |
Wale Ogunwale | bf9eefc | 2015-11-17 14:47:52 -0800 | [diff] [blame^] | 102 | public void setPhoneWindow(PhoneWindow owner, boolean showDecor, boolean windowHasShadow) { |
Stefan Kuhne | 61b47bb | 2015-07-28 14:04:25 -0700 | [diff] [blame] | 103 | mOwner = owner; |
| 104 | mWindowHasShadow = windowHasShadow; |
Stefan Kuhne | f4dd71a | 2015-08-07 09:28:52 -0700 | [diff] [blame] | 105 | mShowDecor = showDecor; |
Skuhne | f7b882c | 2015-08-11 17:18:58 -0700 | [diff] [blame] | 106 | updateCaptionVisibility(); |
Stefan Kuhne | 61b47bb | 2015-07-28 14:04:25 -0700 | [diff] [blame] | 107 | if (mWindowHasShadow) { |
Stefan Kuhne | f4dd71a | 2015-08-07 09:28:52 -0700 | [diff] [blame] | 108 | initializeElevation(); |
Stefan Kuhne | 61b47bb | 2015-07-28 14:04:25 -0700 | [diff] [blame] | 109 | } |
| 110 | // By changing the outline provider to BOUNDS, the window can remove its |
| 111 | // background without removing the shadow. |
| 112 | mOwner.getDecorView().setOutlineProvider(ViewOutlineProvider.BOUNDS); |
Skuhne | b816087 | 2015-09-22 09:51:39 -0700 | [diff] [blame] | 113 | |
Stefan Kuhne | 61b47bb | 2015-07-28 14:04:25 -0700 | [diff] [blame] | 114 | findViewById(R.id.maximize_window).setOnClickListener(this); |
| 115 | findViewById(R.id.close_window).setOnClickListener(this); |
| 116 | } |
| 117 | |
Skuhne | 81c524a | 2015-08-12 13:34:14 -0700 | [diff] [blame] | 118 | @Override |
Chong Zhang | 509ea6b | 2015-09-30 14:09:52 -0700 | [diff] [blame] | 119 | public boolean onTouch(View v, MotionEvent e) { |
Skuhne | 81c524a | 2015-08-12 13:34:14 -0700 | [diff] [blame] | 120 | // Note: There are no mixed events. When a new device gets used (e.g. 1. Mouse, 2. touch) |
| 121 | // the old input device events get cancelled first. So no need to remember the kind of |
| 122 | // input device we are listening to. |
| 123 | switch (e.getActionMasked()) { |
| 124 | case MotionEvent.ACTION_DOWN: |
Skuhne | a635a26 | 2015-08-26 15:45:58 -0700 | [diff] [blame] | 125 | if (!mShowDecor) { |
| 126 | // When there is no decor we should not react to anything. |
| 127 | return false; |
| 128 | } |
Skuhne | 81c524a | 2015-08-12 13:34:14 -0700 | [diff] [blame] | 129 | // A drag action is started if we aren't dragging already and the starting event is |
| 130 | // either a left mouse button or any other input device. |
| 131 | if (!mDragging && |
| 132 | (e.getToolType(e.getActionIndex()) != MotionEvent.TOOL_TYPE_MOUSE || |
| 133 | (e.getButtonState() & MotionEvent.BUTTON_PRIMARY) != 0)) { |
| 134 | mDragging = true; |
Skuhne | 81c524a | 2015-08-12 13:34:14 -0700 | [diff] [blame] | 135 | mLeftMouseButtonReleased = false; |
Chong Zhang | 8e89b31 | 2015-09-09 15:09:30 -0700 | [diff] [blame] | 136 | startMovingTask(e.getRawX(), e.getRawY()); |
Skuhne | 81c524a | 2015-08-12 13:34:14 -0700 | [diff] [blame] | 137 | } |
| 138 | break; |
| 139 | |
| 140 | case MotionEvent.ACTION_MOVE: |
| 141 | if (mDragging && !mLeftMouseButtonReleased) { |
| 142 | if (e.getToolType(e.getActionIndex()) == MotionEvent.TOOL_TYPE_MOUSE && |
| 143 | (e.getButtonState() & MotionEvent.BUTTON_PRIMARY) == 0) { |
| 144 | // There is no separate mouse button up call and if the user mixes mouse |
| 145 | // button drag actions, we stop dragging once he releases the button. |
| 146 | mLeftMouseButtonReleased = true; |
| 147 | break; |
| 148 | } |
Skuhne | 81c524a | 2015-08-12 13:34:14 -0700 | [diff] [blame] | 149 | } |
| 150 | break; |
| 151 | |
| 152 | case MotionEvent.ACTION_UP: |
Skuhne | 81c524a | 2015-08-12 13:34:14 -0700 | [diff] [blame] | 153 | case MotionEvent.ACTION_CANCEL: |
Skuhne | a5a93ee | 2015-08-20 15:43:57 -0700 | [diff] [blame] | 154 | if (!mDragging) { |
| 155 | break; |
Skuhne | 81c524a | 2015-08-12 13:34:14 -0700 | [diff] [blame] | 156 | } |
Skuhne | a5a93ee | 2015-08-20 15:43:57 -0700 | [diff] [blame] | 157 | // Abort the ongoing dragging. |
| 158 | mDragging = false; |
Skuhne | a5a93ee | 2015-08-20 15:43:57 -0700 | [diff] [blame] | 159 | return true; |
Skuhne | 81c524a | 2015-08-12 13:34:14 -0700 | [diff] [blame] | 160 | } |
| 161 | return mDragging; |
| 162 | } |
| 163 | |
Stefan Kuhne | f4dd71a | 2015-08-07 09:28:52 -0700 | [diff] [blame] | 164 | /** |
| 165 | * The phone window configuration has changed and the decor needs to be updated. |
| 166 | * @param showDecor True if the decor should be shown. |
| 167 | * @param windowHasShadow True when the window should show a shadow. |
| 168 | **/ |
Wale Ogunwale | 0d7e912 | 2015-11-17 10:45:06 -0800 | [diff] [blame] | 169 | public void onConfigurationChanged(boolean showDecor, boolean windowHasShadow) { |
Stefan Kuhne | f4dd71a | 2015-08-07 09:28:52 -0700 | [diff] [blame] | 170 | mShowDecor = showDecor; |
Skuhne | f7b882c | 2015-08-11 17:18:58 -0700 | [diff] [blame] | 171 | updateCaptionVisibility(); |
Stefan Kuhne | f4dd71a | 2015-08-07 09:28:52 -0700 | [diff] [blame] | 172 | if (windowHasShadow != mWindowHasShadow) { |
| 173 | mWindowHasShadow = windowHasShadow; |
| 174 | initializeElevation(); |
| 175 | } |
| 176 | } |
| 177 | |
Stefan Kuhne | 61b47bb | 2015-07-28 14:04:25 -0700 | [diff] [blame] | 178 | @Override |
| 179 | public void onClick(View view) { |
| 180 | if (view.getId() == R.id.maximize_window) { |
Stefan Kuhne | 1b42057 | 2015-08-07 10:50:19 -0700 | [diff] [blame] | 181 | maximizeWindow(); |
Stefan Kuhne | 61b47bb | 2015-07-28 14:04:25 -0700 | [diff] [blame] | 182 | } else if (view.getId() == R.id.close_window) { |
Stefan Kuhne | 1b42057 | 2015-08-07 10:50:19 -0700 | [diff] [blame] | 183 | mOwner.dispatchOnWindowDismissed(true /*finishTask*/); |
Stefan Kuhne | 61b47bb | 2015-07-28 14:04:25 -0700 | [diff] [blame] | 184 | } |
| 185 | } |
| 186 | |
| 187 | @Override |
| 188 | public void onWindowFocusChanged(boolean hasWindowFocus) { |
| 189 | mWindowHasFocus = hasWindowFocus; |
| 190 | updateElevation(); |
| 191 | super.onWindowFocusChanged(hasWindowFocus); |
| 192 | } |
| 193 | |
| 194 | @Override |
Stefan Kuhne | 61b47bb | 2015-07-28 14:04:25 -0700 | [diff] [blame] | 195 | protected void onLayout(boolean changed, int left, int top, int right, int bottom) { |
Stefan Kuhne | 61b47bb | 2015-07-28 14:04:25 -0700 | [diff] [blame] | 196 | // If the application changed its SystemUI metrics, we might also have to adapt |
| 197 | // our shadow elevation. |
| 198 | updateElevation(); |
| 199 | mAllowUpdateElevation = true; |
| 200 | |
Skuhne | f7b882c | 2015-08-11 17:18:58 -0700 | [diff] [blame] | 201 | super.onLayout(changed, left, top, right, bottom); |
Stefan Kuhne | 61b47bb | 2015-07-28 14:04:25 -0700 | [diff] [blame] | 202 | } |
| 203 | |
Stefan Kuhne | 61b47bb | 2015-07-28 14:04:25 -0700 | [diff] [blame] | 204 | @Override |
Skuhne | f7b882c | 2015-08-11 17:18:58 -0700 | [diff] [blame] | 205 | public void addView(View child, int index, ViewGroup.LayoutParams params) { |
Stefan Kuhne | f4dd71a | 2015-08-07 09:28:52 -0700 | [diff] [blame] | 206 | // Make sure that we never get more then one client area in our view. |
Stefan Kuhne | 61b47bb | 2015-07-28 14:04:25 -0700 | [diff] [blame] | 207 | if (index >= 2 || getChildCount() >= 2) { |
| 208 | throw new IllegalStateException("NonClientDecorView can only handle 1 client view"); |
| 209 | } |
| 210 | super.addView(child, index, params); |
| 211 | } |
| 212 | |
Stefan Kuhne | f4dd71a | 2015-08-07 09:28:52 -0700 | [diff] [blame] | 213 | /** |
| 214 | * Determine if the workspace is entirely covered by the window. |
| 215 | * @return Returns true when the window is filling the entire screen/workspace. |
| 216 | **/ |
Stefan Kuhne | 61b47bb | 2015-07-28 14:04:25 -0700 | [diff] [blame] | 217 | private boolean isFillingScreen() { |
| 218 | return (0 != ((getWindowSystemUiVisibility() | getSystemUiVisibility()) & |
| 219 | (View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | |
| 220 | View.SYSTEM_UI_FLAG_IMMERSIVE | View.SYSTEM_UI_FLAG_LOW_PROFILE))); |
| 221 | } |
| 222 | |
Stefan Kuhne | f4dd71a | 2015-08-07 09:28:52 -0700 | [diff] [blame] | 223 | /** |
Skuhne | f7b882c | 2015-08-11 17:18:58 -0700 | [diff] [blame] | 224 | * Updates the visibility of the caption. |
| 225 | **/ |
| 226 | private void updateCaptionVisibility() { |
| 227 | // Don't show the decor if the window has e.g. entered full screen. |
| 228 | boolean invisible = isFillingScreen() || !mShowDecor; |
| 229 | View caption = getChildAt(0); |
| 230 | caption.setVisibility(invisible ? GONE : VISIBLE); |
Chong Zhang | 509ea6b | 2015-09-30 14:09:52 -0700 | [diff] [blame] | 231 | caption.setOnTouchListener(this); |
Chong Zhang | 8e89b31 | 2015-09-09 15:09:30 -0700 | [diff] [blame] | 232 | mVisible = !invisible; |
Skuhne | f7b882c | 2015-08-11 17:18:58 -0700 | [diff] [blame] | 233 | } |
| 234 | |
| 235 | /** |
Stefan Kuhne | f4dd71a | 2015-08-07 09:28:52 -0700 | [diff] [blame] | 236 | * The elevation gets set for the first time and the framework needs to be informed that |
| 237 | * the surface layer gets created with the shadow size in mind. |
| 238 | **/ |
| 239 | private void initializeElevation() { |
| 240 | // TODO(skuhne): Call setMaxElevation here accordingly after b/22668382 got fixed. |
| 241 | mAllowUpdateElevation = false; |
| 242 | if (mWindowHasShadow) { |
| 243 | updateElevation(); |
| 244 | } else { |
| 245 | mOwner.setElevation(0); |
| 246 | } |
| 247 | } |
| 248 | |
| 249 | /** |
| 250 | * The shadow height gets controlled by the focus to visualize highlighted windows. |
| 251 | * Note: This will overwrite application elevation properties. |
| 252 | * Note: Windows which have (temporarily) changed their attributes to cover the SystemUI |
| 253 | * will get no shadow as they are expected to be "full screen". |
| 254 | **/ |
Wale Ogunwale | bf9eefc | 2015-11-17 14:47:52 -0800 | [diff] [blame^] | 255 | public void updateElevation() { |
Stefan Kuhne | 61b47bb | 2015-07-28 14:04:25 -0700 | [diff] [blame] | 256 | float elevation = 0; |
Skuhne | b816087 | 2015-09-22 09:51:39 -0700 | [diff] [blame] | 257 | // Do not use a shadow when we are in resizing mode (mRenderer not null) since the shadow |
| 258 | // is bound to the content size and not the target size. |
Wale Ogunwale | bf9eefc | 2015-11-17 14:47:52 -0800 | [diff] [blame^] | 259 | if (mWindowHasShadow |
| 260 | && ((DecorView) mOwner.getDecorView()).mBackdropFrameRenderer == null) { |
Stefan Kuhne | 61b47bb | 2015-07-28 14:04:25 -0700 | [diff] [blame] | 261 | boolean fill = isFillingScreen(); |
| 262 | elevation = fill ? 0 : |
| 263 | (mWindowHasFocus ? DECOR_SHADOW_FOCUSED_HEIGHT_IN_DIP : |
| 264 | DECOR_SHADOW_UNFOCUSED_HEIGHT_IN_DIP); |
Stefan Kuhne | f4dd71a | 2015-08-07 09:28:52 -0700 | [diff] [blame] | 265 | // TODO(skuhne): Remove this if clause once b/22668382 got fixed. |
Stefan Kuhne | 61b47bb | 2015-07-28 14:04:25 -0700 | [diff] [blame] | 266 | if (!mAllowUpdateElevation && !fill) { |
Stefan Kuhne | 61b47bb | 2015-07-28 14:04:25 -0700 | [diff] [blame] | 267 | elevation = DECOR_SHADOW_FOCUSED_HEIGHT_IN_DIP; |
| 268 | } |
| 269 | // Convert the DP elevation into physical pixels. |
| 270 | elevation = dipToPx(elevation); |
| 271 | } |
| 272 | // Don't change the elevation if it didn't change since it can require some time. |
| 273 | if (mOwner.getDecorView().getElevation() != elevation) { |
| 274 | mOwner.setElevation(elevation); |
| 275 | } |
| 276 | } |
| 277 | |
Stefan Kuhne | f4dd71a | 2015-08-07 09:28:52 -0700 | [diff] [blame] | 278 | /** |
| 279 | * Converts a DIP measure into physical pixels. |
| 280 | * @param dip The dip value. |
| 281 | * @return Returns the number of pixels. |
| 282 | */ |
Stefan Kuhne | 61b47bb | 2015-07-28 14:04:25 -0700 | [diff] [blame] | 283 | private float dipToPx(float dip) { |
| 284 | return TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dip, |
| 285 | getResources().getDisplayMetrics()); |
| 286 | } |
Stefan Kuhne | 1b42057 | 2015-08-07 10:50:19 -0700 | [diff] [blame] | 287 | |
Stefan Kuhne | f4dd71a | 2015-08-07 09:28:52 -0700 | [diff] [blame] | 288 | /** |
| 289 | * Maximize the window by moving it to the maximized workspace stack. |
| 290 | **/ |
Stefan Kuhne | 1b42057 | 2015-08-07 10:50:19 -0700 | [diff] [blame] | 291 | private void maximizeWindow() { |
Skuhne | ce2faa5 | 2015-08-11 10:36:38 -0700 | [diff] [blame] | 292 | Window.WindowControllerCallback callback = mOwner.getWindowControllerCallback(); |
Stefan Kuhne | 1b42057 | 2015-08-07 10:50:19 -0700 | [diff] [blame] | 293 | if (callback != null) { |
| 294 | try { |
Wale Ogunwale | 3797c22 | 2015-10-27 14:21:58 -0700 | [diff] [blame] | 295 | callback.changeWindowStack(FULLSCREEN_WORKSPACE_STACK_ID); |
Stefan Kuhne | 1b42057 | 2015-08-07 10:50:19 -0700 | [diff] [blame] | 296 | } catch (RemoteException ex) { |
| 297 | Log.e(TAG, "Cannot change task workspace."); |
| 298 | } |
| 299 | } |
| 300 | } |
Stefan Kuhne | 61b47bb | 2015-07-28 14:04:25 -0700 | [diff] [blame] | 301 | } |