| Chunk |
|---|
| Conflicting content |
|---|
import java.util.ArrayList; import java.util.HashMap; <<<<<<< HEAD:java/src/com/android/inputmethod/keyboard/KeyboardView.java ======= import java.util.LinkedList; import java.util.List; import java.util.Locale; >>>>>>> 20ffde8d830eaf1996e84a886085bc69fdac9105:java/src/com/android/inputmethod/latin/LatinKeyboardBaseView.java import java.util.WeakHashMap; /** |
| Solution content |
|---|
import java.util.ArrayList; import java.util.HashMap; import java.util.WeakHashMap; /** |
| File |
|---|
| KeyboardView.java |
| Developer's decision |
|---|
| Version 1 |
| Kind of conflict |
|---|
| Import |
| Chunk |
|---|
| Conflicting content |
|---|
protected CharSequence adjustCase(CharSequence label) {
if (mKeyboard.isShiftedOrShiftLocked() && label != null && label.length() < 3
&& Character.isLowerCase(label.charAt(0))) {
<<<<<<< HEAD:java/src/com/android/inputmethod/keyboard/KeyboardView.java
return label.toString().toUpperCase();
=======
return label.toString().toUpperCase(getKeyboardLocale());
>>>>>>> 20ffde8d830eaf1996e84a886085bc69fdac9105:java/src/com/android/inputmethod/latin/LatinKeyboardBaseView.java
}
return label;
} |
| Solution content |
|---|
protected CharSequence adjustCase(CharSequence label) {
if (mKeyboard.isShiftedOrShiftLocked() && label != null && label.length() < 3
&& Character.isLowerCase(label.charAt(0))) {
return label.toString().toUpperCase();
}
return label;
} |
| File |
|---|
| KeyboardView.java |
| Developer's decision |
|---|
| Version 1 |
| Kind of conflict |
|---|
| Method invocation |
| Return statement |
| Chunk |
|---|
| Conflicting content |
|---|
private SharedPreferences mPrefs;
private String mSelectedLanguages;
private ArrayList |
| Solution content |
|---|
private SharedPreferences mPrefs;
private String mSelectedLanguages;
private ArrayList |
| File |
|---|
| InputLanguageSelection.java |
| Developer's decision |
|---|
| Version 1 |
| Kind of conflict |
|---|
| Array initializer |
| Attribute |
| Chunk |
|---|
| Conflicting content |
|---|
PreferenceGroup parent = getPreferenceScreen();
for (int i = 0; i < mAvailableLanguages.size(); i++) {
CheckBoxPreference pref = new CheckBoxPreference(this);
<<<<<<< HEAD
Locale locale = mAvailableLanguages.get(i).mLocale;
pref.setTitle(SubtypeSwitcher.getFullDisplayName(locale, true));
=======
Locale locale = mAvailableLanguages.get(i).locale;
pref.setTitle(LanguageSwitcher.toTitleCase(locale.getDisplayName(locale), locale));
>>>>>>> 20ffde8d830eaf1996e84a886085bc69fdac9105
boolean checked = isLocaleIn(locale, languageList);
pref.setChecked(checked);
if (hasDictionary(locale)) { |
| Solution content |
|---|
PreferenceGroup parent = getPreferenceScreen();
for (int i = 0; i < mAvailableLanguages.size(); i++) {
CheckBoxPreference pref = new CheckBoxPreference(this);
Locale locale = mAvailableLanguages.get(i).mLocale;
pref.setTitle(SubtypeSwitcher.getFullDisplayName(locale, true));
boolean checked = isLocaleIn(locale, languageList);
pref.setChecked(checked);
if (hasDictionary(locale)) { |
| File |
|---|
| InputLanguageSelection.java |
| Developer's decision |
|---|
| Version 1 |
| Kind of conflict |
|---|
| Attribute |
| Method invocation |
| Variable |
| Chunk |
|---|
| Conflicting content |
|---|
if (len == 5) {
String language = s.substring(0, 2);
String country = s.substring(3, 5);
<<<<<<< HEAD
Locale l = new Locale(language, country);
// Exclude languages that are not relevant to LatinIME
if (arrayContains(BLACKLIST_LANGUAGES, language)) continue;
if (finalSize == 0) {
preprocess[finalSize++] =
new Loc(SubtypeSwitcher.getFullDisplayName(l, true), l);
=======
l = new Locale(language, country);
} else if (len == 2) {
language = s;
l = new Locale(language);
} else {
continue;
}
// Exclude languages that are not relevant to LatinIME
if (!isWhitelisted(s)) continue;
if (finalSize == 0) {
preprocess[finalSize++] =
new Loc(LanguageSwitcher.toTitleCase(l.getDisplayName(l), l), l);
} else {
// check previous entry:
// same lang and a country -> upgrade to full name and
// insert ours with full name
// diff lang -> insert ours with lang-only name
if (preprocess[finalSize-1].locale.getLanguage().equals(
language)) {
preprocess[finalSize-1].label = LanguageSwitcher.toTitleCase(
preprocess[finalSize-1].locale.getDisplayName(),
preprocess[finalSize-1].locale);
preprocess[finalSize++] =
new Loc(LanguageSwitcher.toTitleCase(l.getDisplayName(), l), l);
>>>>>>> 20ffde8d830eaf1996e84a886085bc69fdac9105
} else {
// check previous entry:
// same lang and a country -> upgrade to full name and |
| Solution content |
|---|
if (len == 5) {
String language = s.substring(0, 2);
String country = s.substring(3, 5);
Locale l = new Locale(language, country);
// Exclude languages that are not relevant to LatinIME
if (arrayContains(BLACKLIST_LANGUAGES, language)) continue;
if (finalSize == 0) {
preprocess[finalSize++] =
new Loc(SubtypeSwitcher.getFullDisplayName(l, true), l);
} else {
// check previous entry:
// same lang and a country -> upgrade to full name and |
| File |
|---|
| InputLanguageSelection.java |
| Developer's decision |
|---|
| Version 1 |
| Kind of conflict |
|---|
| Array access |
| Attribute |
| Comment |
| If statement |
| Method invocation |
| Variable |
| Chunk |
|---|
| Conflicting content |
|---|
preprocess[finalSize++] =
new Loc(SubtypeSwitcher.getFullDisplayName(l, false), l);
} else {
<<<<<<< HEAD
String displayName;
if (s.equals("zz_ZZ")) {
// ignore this locale
} else {
displayName = SubtypeSwitcher.getFullDisplayName(l, true);
preprocess[finalSize++] = new Loc(displayName, l);
}
=======
displayName = LanguageSwitcher.toTitleCase(l.getDisplayName(l), l);
preprocess[finalSize++] = new Loc(displayName, l);
>>>>>>> 20ffde8d830eaf1996e84a886085bc69fdac9105
}
}
} |
| Solution content |
|---|
preprocess[finalSize++] =
new Loc(SubtypeSwitcher.getFullDisplayName(l, false), l);
} else {
String displayName;
if (s.equals("zz_ZZ")) {
// ignore this locale
} else {
displayName = SubtypeSwitcher.getFullDisplayName(l, true);
preprocess[finalSize++] = new Loc(displayName, l);
}
}
}
} |
| File |
|---|
| InputLanguageSelection.java |
| Developer's decision |
|---|
| Version 1 |
| Kind of conflict |
|---|
| Array access |
| If statement |
| Method invocation |
| Variable |
| Chunk |
|---|
| Conflicting content |
|---|
import android.content.SharedPreferences.Editor; import android.text.TextUtils; <<<<<<< HEAD import java.util.ArrayList; ======= >>>>>>> 20ffde8d830eaf1996e84a886085bc69fdac9105 import java.util.Locale; /** |
| Solution content |
|---|
import android.content.SharedPreferences.Editor; import android.text.TextUtils; import java.util.ArrayList; import java.util.Locale; /** |
| File |
|---|
| LanguageSwitcher.java |
| Developer's decision |
|---|
| Version 1 |
| Kind of conflict |
|---|
| Import |
| Chunk |
|---|
| Conflicting content |
|---|
editor.putString(Settings.PREF_INPUT_LANGUAGE, getInputLanguage());
SharedPreferencesCompat.apply(editor);
}
<<<<<<< HEAD
=======
static String toTitleCase(String s, Locale locale) {
if (s.length() == 0) {
return s;
}
return s.toUpperCase(locale).charAt(0) + s.substring(1);
}
>>>>>>> 20ffde8d830eaf1996e84a886085bc69fdac9105
} |
| Solution content |
|---|
editor.putString(Settings.PREF_INPUT_LANGUAGE, getInputLanguage());
SharedPreferencesCompat.apply(editor);
}
} |
| File |
|---|
| LanguageSwitcher.java |
| Developer's decision |
|---|
| Version 1 |
| Kind of conflict |
|---|
| Method declaration |
| Chunk |
|---|
| Conflicting content |
|---|
import android.widget.HorizontalScrollView; import android.widget.LinearLayout; <<<<<<< HEAD import com.android.inputmethod.keyboard.Keyboard; import com.android.inputmethod.keyboard.KeyboardActionListener; import com.android.inputmethod.keyboard.KeyboardSwitcher; import com.android.inputmethod.keyboard.KeyboardView; import com.android.inputmethod.keyboard.LatinKeyboard; import com.android.inputmethod.keyboard.LatinKeyboardView; import com.android.inputmethod.latin.Utils.RingCharBuffer; import com.android.inputmethod.voice.VoiceIMEConnector; ======= import com.android.inputmethod.latin.LatinIMEUtil.RingCharBuffer; import com.android.inputmethod.voice.FieldContext; import com.android.inputmethod.voice.SettingsUtil; import com.android.inputmethod.voice.VoiceInput; import org.xmlpull.v1.XmlPullParserException; >>>>>>> 20ffde8d830eaf1996e84a886085bc69fdac9105 import java.io.FileDescriptor; import java.io.PrintWriter; |
| Solution content |
|---|
import android.widget.HorizontalScrollView; import android.widget.LinearLayout; import com.android.inputmethod.keyboard.Keyboard; import com.android.inputmethod.keyboard.KeyboardActionListener; import com.android.inputmethod.keyboard.KeyboardSwitcher; import com.android.inputmethod.keyboard.KeyboardView; import com.android.inputmethod.keyboard.LatinKeyboard; import com.android.inputmethod.keyboard.LatinKeyboardView; import com.android.inputmethod.latin.Utils.RingCharBuffer; import com.android.inputmethod.voice.VoiceIMEConnector; import java.io.FileDescriptor; import java.io.PrintWriter; |
| File |
|---|
| LatinIME.java |
| Developer's decision |
|---|
| Version 1 |
| Kind of conflict |
|---|
| Import |
| Chunk |
|---|
| Conflicting content |
|---|
|| keyCodes[0] > Character.MAX_CODE_POINT) {
return;
}
<<<<<<< HEAD
code = keyCodes[0];
if (switcher.isAlphabetMode() && Character.isLowerCase(code)) {
int upperCaseCode = Character.toUpperCase(code);
if (upperCaseCode != code) {
code = upperCaseCode;
} else {
// Some keys, such as [eszett], have upper case as multi-characters.
String upperCase = new String(new int[] {code}, 0, 1).toUpperCase();
onTextInput(upperCase);
=======
primaryCode = keyCodes[0];
if (mKeyboardSwitcher.isAlphabetMode() && Character.isLowerCase(primaryCode)) {
// In some locales, such as Turkish, Character.toUpperCase() may return a wrong
// character because it doesn't take care of locale.
final String upperCaseString = new String(new int[] {primaryCode}, 0, 1)
.toUpperCase(mLanguageSwitcher.getInputLocale());
if (upperCaseString.codePointCount(0, upperCaseString.length()) == 1) {
primaryCode = upperCaseString.codePointAt(0);
} else {
// Some keys, such as [eszett], have upper case as multi-characters.
onText(upperCaseString);
>>>>>>> 20ffde8d830eaf1996e84a886085bc69fdac9105
return;
}
} |
| Solution content |
|---|
|| keyCodes[0] > Character.MAX_CODE_POINT) {
return;
}
code = keyCodes[0];
if (switcher.isAlphabetMode() && Character.isLowerCase(code)) {
int upperCaseCode = Character.toUpperCase(code);
if (upperCaseCode != code) {
code = upperCaseCode;
} else {
// Some keys, such as [eszett], have upper case as multi-characters.
String upperCase = new String(new int[] {code}, 0, 1).toUpperCase();
onTextInput(upperCase);
return;
}
} |
| File |
|---|
| LatinIME.java |
| Developer's decision |
|---|
| Version 1 |
| Kind of conflict |
|---|
| Array access |
| Comment |
| If statement |
| Method invocation |
| Variable |
| Chunk |
|---|
| Conflicting content |
|---|
* @param suggestion the suggestion picked by the user to be committed to
* the text field
*/
<<<<<<< HEAD
private void pickSuggestion(CharSequence suggestion) {
KeyboardSwitcher switcher = mKeyboardSwitcher;
if (!switcher.isKeyboardAvailable())
return;
=======
private void pickSuggestion(CharSequence suggestion, boolean correcting) {
final LatinKeyboardView inputView = mKeyboardSwitcher.getInputView();
final Locale inputLocale = mLanguageSwitcher.getInputLocale();
if (mCapsLock) {
suggestion = suggestion.toString().toUpperCase(inputLocale);
} else if (preferCapitalization()
|| (mKeyboardSwitcher.isAlphabetMode()
&& inputView.isShifted())) {
suggestion = suggestion.toString().toUpperCase(inputLocale).charAt(0)
+ suggestion.subSequence(1, suggestion.length()).toString();
}
>>>>>>> 20ffde8d830eaf1996e84a886085bc69fdac9105
InputConnection ic = getCurrentInputConnection();
if (ic != null) {
mVoiceConnector.rememberReplacedWord(suggestion, mWordSeparators); |
| Solution content |
|---|
* @param suggestion the suggestion picked by the user to be committed to
* the text field
*/
private void pickSuggestion(CharSequence suggestion) {
KeyboardSwitcher switcher = mKeyboardSwitcher;
if (!switcher.isKeyboardAvailable())
return;
InputConnection ic = getCurrentInputConnection();
if (ic != null) {
mVoiceConnector.rememberReplacedWord(suggestion, mWordSeparators); |
| File |
|---|
| LatinIME.java |
| Developer's decision |
|---|
| Version 1 |
| Kind of conflict |
|---|
| Attribute |
| If statement |
| Method invocation |
| Method signature |
| Variable |
| Chunk |
|---|
| Conflicting content |
|---|
}
/**
saveWordInHistory(suggestion);
mHasValidSuggestions = false;
mCommittedLength = suggestion.length();
<<<<<<< HEAD
=======
((LatinKeyboard) inputView.getKeyboard()).setPreferredLetters(null);
// If we just corrected a word, then don't show punctuations
if (!correcting) {
setNextSuggestions();
}
updateShiftKeyState(getCurrentInputEditorInfo());
}
/**
* Tries to apply any voice alternatives for the word if this was a spoken word and
* there are voice alternatives.
* @param touching The word that the cursor is touching, with position information
* @return true if an alternative was found, false otherwise.
*/
private boolean applyVoiceAlternatives(EditingUtil.SelectedWord touching) {
// Search for result in spoken word alternatives
String selectedWord = touching.word.toString().trim();
if (!mWordToSuggestions.containsKey(selectedWord)) {
selectedWord = selectedWord.toLowerCase();
}
if (mWordToSuggestions.containsKey(selectedWord)) {
mShowingVoiceSuggestions = true;
List |
| Solution content |
|---|
saveWordInHistory(suggestion);
mHasValidSuggestions = false;
mCommittedLength = suggestion.length();
}
/** |
| File |
|---|
| LatinIME.java |
| Developer's decision |
|---|
| Version 1 |
| Kind of conflict |
|---|
| Comment |
| If statement |
| Method invocation |
| Method signature |
| Return statement |
| Variable |
| Chunk |
|---|
| Conflicting content |
|---|
import android.util.Log; import android.view.View; <<<<<<< HEAD import java.io.File; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Set; ======= import java.nio.ByteBuffer; import java.util.ArrayList; import java.util.Arrays; import java.util.List; >>>>>>> 20ffde8d830eaf1996e84a886085bc69fdac9105 /** * This class loads a dictionary and provides a list of suggestions for a given sequence of |
| Solution content |
|---|
import android.util.Log; import android.view.View; import java.io.File; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Set; /** * This class loads a dictionary and provides a list of suggestions for a given sequence of |
| File |
|---|
| Suggest.java |
| Developer's decision |
|---|
| Version 1 |
| Kind of conflict |
|---|
| Import |