Skip to content

Commit

Permalink
rename: 更新部分变量名
Browse files Browse the repository at this point in the history
Former-commit-id: 1472c09
Former-commit-id: 90f2bbd
  • Loading branch information
afkT committed Apr 25, 2022
1 parent 0b704d4 commit d64b1dc
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 43 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -261,13 +261,12 @@ class SKUDialog(
binding.vidNumberEt
.addTextChangedListener(object : EditTextUtils.DevTextWatcher() {
override fun onTextChanged(
s: CharSequence,
text: CharSequence,
start: Int,
before: Int,
count: Int
) {
val strNumber = s.toString()
val inputNumber = ConvertUtils.toInt(strNumber)
val inputNumber = ConvertUtils.toInt(text)
// 数量相同则不处理
if (inputNumber == currentNumber) {
return
Expand Down
8 changes: 4 additions & 4 deletions lib/DevApp/src/main/java/dev/utils/app/EditTextUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -853,14 +853,14 @@ public DevTextWatcher setType(int type) {

/**
* 在文本变化前调用
* @param s 修改之前的文字
* @param text 修改之前的文字
* @param start 字符串中即将发生修改的位置
* @param count 字符串中即将被修改的文字的长度, 如果是新增的话则为 0
* @param after 被修改的文字修改之后的长度, 如果是删除的话则为 0
*/
@Override
public void beforeTextChanged(
CharSequence s,
CharSequence text,
int start,
int count,
int after
Expand All @@ -869,14 +869,14 @@ public void beforeTextChanged(

/**
* 在文本变化后调用
* @param s 改变后的字符串
* @param text 改变后的字符串
* @param start 有变动的字符串的位置
* @param before 被改变的字符串长度, 如果是新增则为 0
* @param count 添加的字符串长度, 如果是删除则为 0
*/
@Override
public void onTextChanged(
CharSequence s,
CharSequence text,
int start,
int before,
int count
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ public final void setView(View view) {
}

@Override
public final void setText(CharSequence s) {
public final void setText(CharSequence text) {
if (mMessageView != null) {
mMessageView.setText(s);
mMessageView.setText(text);
}
}

Expand Down
14 changes: 7 additions & 7 deletions lib/DevAssist/src/main/java/dev/assist/EditTextSearchAssist.java
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,10 @@ public void remove() {

/**
* 发送消息 ( 功能由该方法实现 )
* @param charSequence 输入内容
* @param text 输入内容
*/
public void post(final CharSequence charSequence) {
mDelayAssist.post(charSequence);
public void post(final CharSequence text) {
mDelayAssist.post(text);
}

// =
Expand Down Expand Up @@ -149,25 +149,25 @@ private void initTextWatcher() {
mTextWatcher = new TextWatcher() {
@Override
public void onTextChanged(
CharSequence charSequence,
CharSequence text,
int start,
int before,
int count
) {
post(charSequence);
post(text);
}

@Override
public void beforeTextChanged(
CharSequence s,
CharSequence text,
int start,
int count,
int after
) {
}

@Override
public void afterTextChanged(Editable s) {
public void afterTextChanged(Editable text) {
}
};
}
Expand Down
36 changes: 18 additions & 18 deletions lib/DevAssist/src/main/java/dev/assist/EditTextWatcherAssist.java
Original file line number Diff line number Diff line change
Expand Up @@ -160,48 +160,48 @@ public void onFocusChange(
mTextWatcher = new TextWatcher() {
@Override
public void onTextChanged(
CharSequence charSequence,
CharSequence text,
int start,
int before,
int count
) {
if (mFocusPos == position) {
if (otherListener != null) {
otherListener.onTextChanged(
charSequence, start, before, count,
text, start, before, count,
editText, position, object
);
}

if (listener != null) { // 触发回调
listener.onTextChanged(charSequence, editText, position, object);
listener.onTextChanged(text, editText, position, object);
}
}
}

@Override
public void beforeTextChanged(
CharSequence s,
CharSequence text,
int start,
int count,
int after
) {
if (mFocusPos == position) {
if (otherListener != null) {
otherListener.beforeTextChanged(
s, start, count, after,
text, start, count, after,
editText, position, object
);
}
}
}

@Override
public void afterTextChanged(Editable s) {
public void afterTextChanged(Editable text) {
if (mFocusPos == position) {
if (otherListener != null) {
otherListener.afterTextChanged(
s, editText, position, object
text, editText, position, object
);
}
}
Expand Down Expand Up @@ -238,13 +238,13 @@ public interface InputListener<T> {

/**
* 文本改变监听
* @param charSequence 改变文本
* @param editText EditText
* @param position 索引
* @param object Object
* @param text 改变文本
* @param editText EditText
* @param position 索引
* @param object Object
*/
void onTextChanged(
CharSequence charSequence,
CharSequence text,
EditText editText,
int position,
T object
Expand Down Expand Up @@ -285,7 +285,7 @@ public void onFocusChange(

/**
* 在文本变化前调用
* @param s 修改之前的文字
* @param text 修改之前的文字
* @param start 字符串中即将发生修改的位置
* @param count 字符串中即将被修改的文字的长度, 如果是新增的话则为 0
* @param after 被修改的文字修改之后的长度, 如果是删除的话则为 0
Expand All @@ -294,7 +294,7 @@ public void onFocusChange(
* @param object Object
*/
public void beforeTextChanged(
CharSequence s,
CharSequence text,
int start,
int count,
int after,
Expand All @@ -306,7 +306,7 @@ public void beforeTextChanged(

/**
* 在文本变化后调用
* @param s 改变后的字符串
* @param text 改变后的字符串
* @param start 有变动的字符串的位置
* @param before 被改变的字符串长度, 如果是新增则为 0
* @param count 添加的字符串长度, 如果是删除则为 0
Expand All @@ -315,7 +315,7 @@ public void beforeTextChanged(
* @param object Object
*/
public void onTextChanged(
CharSequence s,
CharSequence text,
int start,
int before,
int count,
Expand All @@ -327,13 +327,13 @@ public void onTextChanged(

/**
* 在文本变化后调用
* @param s 修改后的文字
* @param text 修改后的文字
* @param editText EditText
* @param position 索引
* @param object Object
*/
public void afterTextChanged(
Editable s,
Editable text,
EditText editText,
int position,
T object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,50 +245,50 @@ private void drawOperate() {
private final TextWatcher _listener = new TextWatcher() {
/**
* 在文本变化前调用
* @param s 修改之前的文字
* @param text 修改之前的文字
* @param start 字符串中即将发生修改的位置
* @param count 字符串中即将被修改的文字的长度, 如果是新增的话则为 0
* @param after 被修改的文字修改之后的长度, 如果是删除的话则为 0
*/
@Override
public void beforeTextChanged(
CharSequence s,
CharSequence text,
int start,
int count,
int after
) {
if (mTextWatcher != null) {
mTextWatcher.beforeTextChanged(s, start, count, after);
mTextWatcher.beforeTextChanged(text, start, count, after);
}
}

/**
* 在文本变化后调用
* @param s 改变后的字符串
* @param text 改变后的字符串
* @param start 有变动的字符串的位置
* @param before 被改变的字符串长度, 如果是新增则为 0
* @param count 添加的字符串长度, 如果是删除则为 0
*/
@Override
public void onTextChanged(
CharSequence s,
CharSequence text,
int start,
int before,
int count
) {
if (mTextWatcher != null) {
mTextWatcher.onTextChanged(s, start, before, count);
mTextWatcher.onTextChanged(text, start, before, count);
}
}

/**
* 在文本变化后调用
* @param s 修改后的文字
* @param text 修改后的文字
*/
@Override
public void afterTextChanged(Editable s) {
public void afterTextChanged(Editable text) {
if (mTextWatcher != null) {
mTextWatcher.afterTextChanged(s);
mTextWatcher.afterTextChanged(text);
}
drawOperate();
}
Expand Down

0 comments on commit d64b1dc

Please sign in to comment.