Skip to content

Commit

Permalink
change keyboard icon button action from close keyboard to show system…
Browse files Browse the repository at this point in the history
… keyboard switcher
  • Loading branch information
plateaukao committed Jun 29, 2020
1 parent bb8f730 commit 58c63a9
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 55 deletions.
4 changes: 2 additions & 2 deletions LimeStudio/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ android {

minSdkVersion 21
targetSdkVersion 30
versionCode 600
versionName '6.0.0'
versionCode 601
versionName '6.0.1'
}
buildTypes {
release {
Expand Down
13 changes: 8 additions & 5 deletions LimeStudio/app/src/main/java/net/toload/main/hd/LIMEService.java
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
public class LIMEService extends InputMethodService implements
LIMEKeyboardBaseView.OnKeyboardActionListener {

private static final boolean DEBUG = true;
private static final boolean DEBUG = false;
private static final String TAG = "LIMEService";

private static Thread queryThread; // queryThread for no-blocking I/O Jeremy '15,6,1
Expand Down Expand Up @@ -1650,8 +1650,11 @@ public void onKey(int primaryCode, int[] keyCodes, int x, int y) {
if (!(!hasPhysicalKeyPressed && hasDistinctMultitouch))
handleShift();
} else if (primaryCode == LIMEBaseKeyboard.KEYCODE_DONE) {// long press on options and shift
handleClose();
// Jeremy '12,5,21 process the arrow keys on soft keyboard
// Daniel
// change to show system input method picker
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
imm.showInputMethodPicker();
//handleClose();
} else if (primaryCode == LIMEBaseKeyboard.KEYCODE_UP) {
keyDownUp(KeyEvent.KEYCODE_DPAD_UP, hasCandidatesShown);
} else if (primaryCode == LIMEBaseKeyboard.KEYCODE_DOWN) {
Expand Down Expand Up @@ -2574,9 +2577,9 @@ private void forceHideCandidateView() {
mCandidateList.clear();

if (mFixedCandidateViewOn) {
mCandidateViewInInputView.forceHide();
//mCandidateViewInInputView.forceHide();
} else {
hideCandidateView();
//hideCandidateView();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
@SuppressLint("UseSparseArrays")
public class LIMEKeyboardBaseView extends View implements PointerTracker.UIProxy {
private static final String TAG = "LIMEKeyboardBaseView";
private static final boolean DEBUG = true;
private static final boolean DEBUG = false;

public static final int NOT_A_TOUCH_COORDINATE = -1;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
import android.view.inputmethod.InputMethodManager;

public class LIMEKeyboardView extends LIMEKeyboardBaseView {
static final boolean DEBUG = true;
static final boolean DEBUG = false;
static final String TAG = "LIMEKeyboardView";

public static final int KEYCODE_OPTIONS = -100;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,16 +82,6 @@ public void onCreate(Bundle savedInstanceState) {
}
mLIMEPref = new LIMEPreferenceManager(ctx);
DBSrv = new DBServer(ctx);
//-----------------------
// // Startup Search Service
// if (DBSrv == null) {
// try {
// ctx.bindService(new Intent(IDBService.class.getName()),
// serConn, Context.BIND_AUTO_CREATE);
// } catch (Exception e) {
// Log.i(TAG, "Failed to connect Search Service");
// }
// }
}

@Override
Expand All @@ -108,7 +98,6 @@ public void onPause() {

// Unregister the listener whenever a key changes
getPreferenceScreen().getSharedPreferences().unregisterOnSharedPreferenceChangeListener(this);

}


Expand All @@ -120,7 +109,6 @@ public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, Strin

if(key.equals("phonetic_keyboard_type")){
String selectedPhoneticKeyboardType = mLIMEPref.getPhoneticKeyboardType();
//PreferenceManager.getDefaultSharedPreferences(ctx).getString("phonetic_keyboard_type", "");
try {

KeyboardObj kobj = DBSrv.getKeyboardObj("phonetic");
Expand All @@ -147,23 +135,7 @@ public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, Strin
kobj = DBSrv.getKeyboardObj("hsu");
}
DBSrv.setIMKeyboard("phonetic", kobj.getDescription(), kobj.getCode());
/*
DBSrv.setIMKeyboard("phonetic", kobj.getDescription(), kobj.getCode());
if(selectedPhoneticKeyboardType.equals("standard")){
DBSrv.setIMKeyboard("phonetic",
DBSrv.getKeyboardInfo("phonetic", "desc"), "phonetic");
}else if(selectedPhoneticKeyboardType.equals("eten")){
DBSrv.setIMKeyboard("phonetic",
DBSrv.getKeyboardInfo("phoneticet41", "desc"), "phoneticet41");
}else if(selectedPhoneticKeyboardType.equals("hsu")){
DBSrv.setIMKeyboard("phonetic",
DBSrv.getKeyboardInfo("hsu", "desc"), "hsu");//jeremy '12,6,6 new hsu and et26 keybaord
}else if(selectedPhoneticKeyboardType.equals("eten26")){
DBSrv.setIMKeyboard("phonetic",
DBSrv.getKeyboardInfo("et26", "desc"), "et26");
}*/
if(DEBUG) Log.i(TAG, "onSharedPreferenceChanged() PhoneticIMInfo.kyeboard:" +
if(DEBUG) Log.i(TAG, "onSharedPreferenceChanged() PhoneticIMInfo.kyeboard:" +
DBSrv.getImInfo("phonetic", "keyboard"));
} catch (RemoteException e) {
Log.i(TAG, "onSharedPreferenceChanged(), WriteIMinfo for selected phonetic keyboard failed!!");
Expand All @@ -176,19 +148,5 @@ public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, Strin


}


// private ServiceConnection serConn = new ServiceConnection() {
// public void onServiceConnected(ComponentName name, IBinder service) {
// if(DBSrv == null){
// DBSrv = IDBService.Stub.asInterface(service);
// }
// }
// public void onServiceDisconnected(ComponentName name) {}
//
// };
}



}
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,4 @@ static class ViewHolder{
TextView filename;
TextView detail;
}



}

0 comments on commit 58c63a9

Please sign in to comment.