зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1320449 - Enable keyboard text prediction on the awesome bar during normal browsing. r=sebastian
MozReview-Commit-ID: 17xMoyDhYmn --HG-- extra : rebase_source : 64ee68c411c830dc5e89197e7d7fc62a50f14978
This commit is contained in:
Родитель
face87e5ac
Коммит
c7fd475af5
|
@ -20,6 +20,7 @@ import org.mozilla.gecko.util.StringUtils;
|
|||
import android.content.Context;
|
||||
import android.graphics.Rect;
|
||||
import android.text.Editable;
|
||||
import android.text.InputType;
|
||||
import android.text.NoCopySpan;
|
||||
import android.text.Selection;
|
||||
import android.text.Spanned;
|
||||
|
@ -417,6 +418,8 @@ public class ToolbarEditText extends CustomEditText
|
|||
* If there is no autocomplete text, both removeAutocomplete() and commitAutocomplete()
|
||||
* are no-ops and return false. Therefore we can use them here without checking explicitly
|
||||
* if we have autocomplete text or not.
|
||||
*
|
||||
* Also turns off text prediction for private mode tabs.
|
||||
*/
|
||||
@Override
|
||||
public InputConnection onCreateInputConnection(final EditorInfo outAttrs) {
|
||||
|
@ -425,6 +428,10 @@ public class ToolbarEditText extends CustomEditText
|
|||
return null;
|
||||
}
|
||||
|
||||
if (isPrivateMode()) {
|
||||
outAttrs.inputType |= InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS;
|
||||
}
|
||||
|
||||
return new InputConnectionWrapper(ic, false) {
|
||||
@Override
|
||||
public boolean deleteSurroundingText(final int beforeLength, final int afterLength) {
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1.0"
|
||||
android:inputType="textUri|textNoSuggestions"
|
||||
android:inputType="textUri"
|
||||
android:imeOptions="actionGo|flagNoExtractUi|flagNoFullscreen"
|
||||
android:selectAllOnFocus="true"
|
||||
android:contentDescription="@string/url_bar_default_text"
|
||||
|
|
Загрузка…
Ссылка в новой задаче