Skip to content

Commit 98f4374

Browse files
committed
fix:修复未找到匹配项,点击上下箭头数组越界的BUG,版本号改为0.0.13
1 parent 83877dc commit 98f4374

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

cp-network-capture/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ android {
1010
minSdk 21
1111
targetSdk 33
1212
versionCode 1
13-
versionName "0.0.12"
13+
versionName "0.0.13"
1414
}
1515

1616
buildTypes {

cp-network-capture/src/main/java/cn/coderpig/cp_network_capture/ui/activity/TextSearchActivity.kt

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,16 @@ class TextSearchActivity : AppCompatActivity() {
4242
searchMatchText()
4343
}
4444
tvNextMatch -> {
45-
if (mCurMatchPos >= mMatchRangeList.size - 1) mCurMatchPos = 0 else mCurMatchPos++
46-
scrollToTargetLine()
45+
if (!mMatchRangeList.isNullOrEmpty()) {
46+
if (mCurMatchPos >= mMatchRangeList.size - 1) mCurMatchPos = 0 else mCurMatchPos++
47+
scrollToTargetLine()
48+
}
4749
}
4850
tvPreviousMatch -> {
49-
if (mCurMatchPos <= 0) mCurMatchPos = mMatchRangeList.size - 1 else mCurMatchPos--
50-
scrollToTargetLine()
51+
if (!mMatchRangeList.isNullOrEmpty()) {
52+
if (mCurMatchPos <= 0) mCurMatchPos = mMatchRangeList.size - 1 else mCurMatchPos--
53+
scrollToTargetLine()
54+
}
5155
}
5256
}
5357
}

0 commit comments

Comments
 (0)