Skip to content

Commit

Permalink
修复首次打开悬浮窗不显示内容
Browse files Browse the repository at this point in the history
  • Loading branch information
lulululbj committed Nov 13, 2019
1 parent 632357e commit da543f6
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 6 deletions.
3 changes: 0 additions & 3 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,6 @@
-keep public class * extends android.support.v4.app.Fragment


#忽略警告
-ignorewarning

##记录生成的日志数据,gradle build时在本项目根目录输出##
#apk 包内所有 class 的内部结构
# -dump proguard/class_files.txt
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class BoxAccessibilityService : AccessibilityService() {
var instance: BoxAccessibilityService? = null
}

private var showWindow by Preference(Preference.SHOW_WINDOW, false)
// private var showWindow by Preference(Preference.SHOW_WINDOW, false)

override fun onInterrupt() {

Expand All @@ -23,7 +23,6 @@ class BoxAccessibilityService : AccessibilityService() {
override fun onAccessibilityEvent(event: AccessibilityEvent) {
if (event.eventType == AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED) {
"${event.packageName}$\n${event.className}".loge("box")
if (showWindow)
FloatWindowManager.addItem(HistoryBean(event.packageName.toString(), event.className.toString()))
}
}
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/luyao/box/util/FloatWindowManager.kt
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ object FloatWindowManager {
fun addItem(historyBean: HistoryBean) {
windowAdapter.addData(0, historyBean)
windowRecycleView?.scrollToPosition(0)
windowAdapter.notifyDataSetChanged()
// windowAdapter.notifyDataSetChanged()
}

fun show() {
Expand Down

0 comments on commit da543f6

Please sign in to comment.