|
@@ -4,6 +4,7 @@
|
|
|
package kr.co.zumo.app.lifeplus.view;
|
|
package kr.co.zumo.app.lifeplus.view;
|
|
|
|
|
|
|
|
import android.support.annotation.NonNull;
|
|
import android.support.annotation.NonNull;
|
|
|
|
|
+import android.util.Log;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* CharFinder
|
|
* CharFinder
|
|
@@ -22,7 +23,7 @@ public class CharFinder {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public CharFinder(String prevStr) {
|
|
public CharFinder(String prevStr) {
|
|
|
- this.prevStr = prevStr;
|
|
|
|
|
|
|
+ setPrevStr(prevStr);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -35,15 +36,11 @@ public class CharFinder {
|
|
|
* @return isBackspace: backspace 입력이 있는지 확인
|
|
* @return isBackspace: backspace 입력이 있는지 확인
|
|
|
*/
|
|
*/
|
|
|
public boolean find(@NonNull String currentStr, @NonNull char[] str, @NonNull int[] index) {
|
|
public boolean find(@NonNull String currentStr, @NonNull char[] str, @NonNull int[] index) {
|
|
|
- if (prevStr.length() == currentStr.length()) {
|
|
|
|
|
|
|
+ if (prevStr.length() == currentStr.length() || Math.abs(prevStr.length() - currentStr.length()) > 1) {
|
|
|
// 길이가 같아서 구분할 수 없음
|
|
// 길이가 같아서 구분할 수 없음
|
|
|
- prevStr = currentStr;
|
|
|
|
|
- index[0] = -1;
|
|
|
|
|
- return false;
|
|
|
|
|
- }
|
|
|
|
|
- else if (Math.abs(prevStr.length() - currentStr.length()) > 1) {
|
|
|
|
|
// 길이 차이가 2이상일 경우 정상 입력이 아님
|
|
// 길이 차이가 2이상일 경우 정상 입력이 아님
|
|
|
- prevStr = currentStr;
|
|
|
|
|
|
|
+ setPrevStr(currentStr);
|
|
|
|
|
+ str[0] = Character.MIN_VALUE;
|
|
|
index[0] = -1;
|
|
index[0] = -1;
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
@@ -79,11 +76,16 @@ public class CharFinder {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- prevStr = currentStr;
|
|
|
|
|
|
|
+ setPrevStr(currentStr);
|
|
|
|
|
|
|
|
return isBackspace;
|
|
return isBackspace;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ public void setPrevStr(String prevStr) {
|
|
|
|
|
+ this.prevStr = prevStr;
|
|
|
|
|
+ Log.e("APP# CharFinder | CharFinder", "|" + "str ====> " + prevStr);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* length
|
|
* length
|
|
|
*
|
|
*
|