Loading res/layout/all_apps_search_bar.xml +1 −1 Original line number Diff line number Diff line Loading @@ -38,7 +38,7 @@ android:contentDescription="@string/all_apps_button_label" android:src="@drawable/ic_arrow_back_grey" /> <com.android.launcher3.allapps.AllAppsSearchEditView <com.android.launcher3.ExtendedEditText android:id="@+id/search_box_input" android:layout_width="match_parent" android:layout_height="match_parent" Loading res/layout/user_folder.xml +1 −1 Original line number Diff line number Diff line Loading @@ -53,7 +53,7 @@ android:paddingLeft="8dp" android:paddingRight="8dp" > <com.android.launcher3.FolderEditText <com.android.launcher3.ExtendedEditText android:id="@+id/folder_name" android:layout_width="0dp" android:layout_height="wrap_content" Loading src/com/android/launcher3/allapps/AllAppsSearchEditView.java→src/com/android/launcher3/ExtendedEditText.java +10 −10 Original line number Diff line number Diff line Loading @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.launcher3.allapps; package com.android.launcher3; import android.content.Context; import android.util.AttributeSet; Loading @@ -22,28 +22,28 @@ import android.widget.EditText; /** * The edit text for the search container * The edit text that reports back when the back key has been pressed. */ public class AllAppsSearchEditView extends EditText { public class ExtendedEditText extends EditText { /** * Implemented by listeners of the back key. */ public interface OnBackKeyListener { public void onBackKey(); public boolean onBackKey(); } private OnBackKeyListener mBackKeyListener; public AllAppsSearchEditView(Context context) { this(context, null); public ExtendedEditText(Context context) { super(context); } public AllAppsSearchEditView(Context context, AttributeSet attrs) { this(context, attrs, 0); public ExtendedEditText(Context context, AttributeSet attrs) { super(context, attrs); } public AllAppsSearchEditView(Context context, AttributeSet attrs, int defStyleAttr) { public ExtendedEditText(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); } Loading @@ -56,7 +56,7 @@ public class AllAppsSearchEditView extends EditText { // If this is a back key, propagate the key back to the listener if (keyCode == KeyEvent.KEYCODE_BACK && event.getAction() == KeyEvent.ACTION_UP) { if (mBackKeyListener != null) { mBackKeyListener.onBackKey(); return mBackKeyListener.onBackKey(); } return false; } Loading src/com/android/launcher3/Folder.java +10 −3 Original line number Diff line number Diff line Loading @@ -124,7 +124,7 @@ public class Folder extends LinearLayout implements DragSource, View.OnClickList @Thunk FolderPagedView mContent; @Thunk View mContentWrapper; FolderEditText mFolderName; ExtendedEditText mFolderName; private View mFooter; private int mFooterHeight; Loading Loading @@ -196,8 +196,15 @@ public class Folder extends LinearLayout implements DragSource, View.OnClickList mContent = (FolderPagedView) findViewById(R.id.folder_content); mContent.setFolder(this); mFolderName = (FolderEditText) findViewById(R.id.folder_name); mFolderName.setFolder(this); mFolderName = (ExtendedEditText) findViewById(R.id.folder_name); mFolderName.setOnBackKeyListener(new ExtendedEditText.OnBackKeyListener() { @Override public boolean onBackKey() { // Close the activity on back key press doneEditingFolderName(true); return false; } }); mFolderName.setOnFocusChangeListener(this); // We disable action mode for now since it messes up the view on phones Loading src/com/android/launcher3/FolderEditText.javadeleted 100644 → 0 +0 −36 Original line number Diff line number Diff line package com.android.launcher3; import android.content.Context; import android.util.AttributeSet; import android.view.KeyEvent; import android.widget.EditText; public class FolderEditText extends EditText { private Folder mFolder; public FolderEditText(Context context) { super(context); } public FolderEditText(Context context, AttributeSet attrs) { super(context, attrs); } public FolderEditText(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } public void setFolder(Folder folder) { mFolder = folder; } @Override public boolean onKeyPreIme(int keyCode, KeyEvent event) { // Catch the back button on the soft keyboard so that we can just close the activity if (event.getKeyCode() == android.view.KeyEvent.KEYCODE_BACK) { mFolder.doneEditingFolderName(true); } return super.onKeyPreIme(keyCode, event); } } Loading
res/layout/all_apps_search_bar.xml +1 −1 Original line number Diff line number Diff line Loading @@ -38,7 +38,7 @@ android:contentDescription="@string/all_apps_button_label" android:src="@drawable/ic_arrow_back_grey" /> <com.android.launcher3.allapps.AllAppsSearchEditView <com.android.launcher3.ExtendedEditText android:id="@+id/search_box_input" android:layout_width="match_parent" android:layout_height="match_parent" Loading
res/layout/user_folder.xml +1 −1 Original line number Diff line number Diff line Loading @@ -53,7 +53,7 @@ android:paddingLeft="8dp" android:paddingRight="8dp" > <com.android.launcher3.FolderEditText <com.android.launcher3.ExtendedEditText android:id="@+id/folder_name" android:layout_width="0dp" android:layout_height="wrap_content" Loading
src/com/android/launcher3/allapps/AllAppsSearchEditView.java→src/com/android/launcher3/ExtendedEditText.java +10 −10 Original line number Diff line number Diff line Loading @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.launcher3.allapps; package com.android.launcher3; import android.content.Context; import android.util.AttributeSet; Loading @@ -22,28 +22,28 @@ import android.widget.EditText; /** * The edit text for the search container * The edit text that reports back when the back key has been pressed. */ public class AllAppsSearchEditView extends EditText { public class ExtendedEditText extends EditText { /** * Implemented by listeners of the back key. */ public interface OnBackKeyListener { public void onBackKey(); public boolean onBackKey(); } private OnBackKeyListener mBackKeyListener; public AllAppsSearchEditView(Context context) { this(context, null); public ExtendedEditText(Context context) { super(context); } public AllAppsSearchEditView(Context context, AttributeSet attrs) { this(context, attrs, 0); public ExtendedEditText(Context context, AttributeSet attrs) { super(context, attrs); } public AllAppsSearchEditView(Context context, AttributeSet attrs, int defStyleAttr) { public ExtendedEditText(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); } Loading @@ -56,7 +56,7 @@ public class AllAppsSearchEditView extends EditText { // If this is a back key, propagate the key back to the listener if (keyCode == KeyEvent.KEYCODE_BACK && event.getAction() == KeyEvent.ACTION_UP) { if (mBackKeyListener != null) { mBackKeyListener.onBackKey(); return mBackKeyListener.onBackKey(); } return false; } Loading
src/com/android/launcher3/Folder.java +10 −3 Original line number Diff line number Diff line Loading @@ -124,7 +124,7 @@ public class Folder extends LinearLayout implements DragSource, View.OnClickList @Thunk FolderPagedView mContent; @Thunk View mContentWrapper; FolderEditText mFolderName; ExtendedEditText mFolderName; private View mFooter; private int mFooterHeight; Loading Loading @@ -196,8 +196,15 @@ public class Folder extends LinearLayout implements DragSource, View.OnClickList mContent = (FolderPagedView) findViewById(R.id.folder_content); mContent.setFolder(this); mFolderName = (FolderEditText) findViewById(R.id.folder_name); mFolderName.setFolder(this); mFolderName = (ExtendedEditText) findViewById(R.id.folder_name); mFolderName.setOnBackKeyListener(new ExtendedEditText.OnBackKeyListener() { @Override public boolean onBackKey() { // Close the activity on back key press doneEditingFolderName(true); return false; } }); mFolderName.setOnFocusChangeListener(this); // We disable action mode for now since it messes up the view on phones Loading
src/com/android/launcher3/FolderEditText.javadeleted 100644 → 0 +0 −36 Original line number Diff line number Diff line package com.android.launcher3; import android.content.Context; import android.util.AttributeSet; import android.view.KeyEvent; import android.widget.EditText; public class FolderEditText extends EditText { private Folder mFolder; public FolderEditText(Context context) { super(context); } public FolderEditText(Context context, AttributeSet attrs) { super(context, attrs); } public FolderEditText(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } public void setFolder(Folder folder) { mFolder = folder; } @Override public boolean onKeyPreIme(int keyCode, KeyEvent event) { // Catch the back button on the soft keyboard so that we can just close the activity if (event.getKeyCode() == android.view.KeyEvent.KEYCODE_BACK) { mFolder.doneEditingFolderName(true); } return super.onKeyPreIme(keyCode, event); } }