1 /* 2 * Copyright (C) 2011 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 android.view.inputmethod; 18 19 import com.android.tools.layoutlib.annotations.LayoutlibDelegate; 20 21 import android.os.IBinder; 22 import android.os.ResultReceiver; 23 import android.view.View; 24 25 26 /** 27 * Delegate used to provide new implementation of a select few methods of {@link InputMethodManager} 28 * 29 * Through the layoutlib_create tool, the original methods of InputMethodManager have been replaced 30 * by calls to methods of the same name in this delegate class. 31 * 32 */ 33 public class InputMethodManager_Delegate { 34 35 // ---- Overridden methods ---- 36 37 @LayoutlibDelegate isInEditMode()38 /*package*/ static boolean isInEditMode() { 39 return true; 40 } 41 42 43 @LayoutlibDelegate showSoftInput(InputMethodManager thisManager, View view, int flags)44 /*package*/ static boolean showSoftInput(InputMethodManager thisManager, View view, int flags) { 45 return false; 46 } 47 48 @LayoutlibDelegate showSoftInput(InputMethodManager thisManager, View view, int flags, ResultReceiver resultReceiver)49 /*package*/ static boolean showSoftInput(InputMethodManager thisManager, View view, int flags, 50 ResultReceiver resultReceiver) { 51 return false; 52 } 53 54 @LayoutlibDelegate showSoftInput(InputMethodManager thisManager, View view, ImeTracker.Token statsToken, int flags, ResultReceiver resultReceiver, int reason)55 /*package*/static boolean showSoftInput(InputMethodManager thisManager, View view, 56 ImeTracker.Token statsToken, int flags, ResultReceiver resultReceiver, int reason) { 57 return false; 58 } 59 60 @LayoutlibDelegate hideSoftInputFromWindow(InputMethodManager thisManager, IBinder windowToken, int flags)61 /*package*/ static boolean hideSoftInputFromWindow(InputMethodManager thisManager, 62 IBinder windowToken, int flags) { 63 return false; 64 } 65 66 @LayoutlibDelegate hideSoftInputFromWindow(InputMethodManager thisManager, IBinder windowToken, int flags, ResultReceiver resultReceiver)67 /*package*/ static boolean hideSoftInputFromWindow(InputMethodManager thisManager, 68 IBinder windowToken, int flags, ResultReceiver resultReceiver) { 69 return false; 70 } 71 72 @LayoutlibDelegate hideSoftInputFromWindow(InputMethodManager thisManager, IBinder windowToken, int flags, ResultReceiver resultReceiver, int reason)73 /*package*/ static boolean hideSoftInputFromWindow(InputMethodManager thisManager, 74 IBinder windowToken, int flags, ResultReceiver resultReceiver, int reason) { 75 return false; 76 } 77 } 78