Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3866675d authored by kaiyiz's avatar kaiyiz Committed by Gerrit - the friendly Code Review server
Browse files

Settings: Fix searchbox and keyboard display issue

Click search in menu,there is no code to show the keyboard.
After rotate screen,the search edittext still has focus.

Add code to show the keyboard after click search in menu.
And hide keyboard after rotate screen.

CRs-Fixed: 743621

Change-Id: Ie26f2d80e9b7f557cf20d5094d563c180da99102
parent 901a674a
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -722,7 +722,6 @@

        <activity android:name="Settings$ManageApplicationsActivity"
                android:label="@string/applications_settings"
                android:configChanges="orientation|keyboardHidden|screenSize"
                android:taskAffinity="">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
+15 −0
Original line number Diff line number Diff line
@@ -52,6 +52,7 @@ import android.support.v4.view.ViewPager;
import android.text.BidiFormatter;
import android.text.Editable;
import android.text.format.Formatter;
import android.text.InputType;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.util.Log;
@@ -91,6 +92,8 @@ import com.android.settings.Utils;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.Timer;
import java.util.TimerTask;

final class CanBeOnSdCardChecker {
    final IPackageManager mPm;
@@ -994,6 +997,7 @@ public class ManageApplications extends Fragment implements
            public void afterTextChanged(Editable s) {
            }
        });
        mTextView.setInputType(InputType.TYPE_NULL);

        mViewPager = (ViewPager) rootView.findViewById(R.id.pager);
        MyPagerAdapter adapter = new MyPagerAdapter();
@@ -1465,7 +1469,18 @@ public class ManageApplications extends Fragment implements
        if (mSearchView.getVisibility() != View.VISIBLE) {
            if (mCurTab.mListType != LIST_TYPE_RUNNING) {
                mSearchView.setVisibility(View.VISIBLE);
                mTextView.setInputType(InputType.TYPE_CLASS_TEXT);
                mTextView.requestFocus();
                //After the interface is loaded,the inputmethod can be shown
                Timer timer = new Timer();
                timer.schedule(new TimerTask(){
                    public void run()
                    {
                        InputMethodManager inputManager = (InputMethodManager)mTextView.getContext()
                                .getSystemService(Context.INPUT_METHOD_SERVICE);
                        inputManager.showSoftInput(mTextView, 0);
                    }
                },150);
            }
        }
    }