Skip to content

Commit 37c5714

Browse files
committed
Fix Bugs
1 parent 7d948f6 commit 37c5714

File tree

5 files changed

+30
-125
lines changed

5 files changed

+30
-125
lines changed

app/src/main/AndroidManifest.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,15 @@
66
<!-- This app can appear on top of other apps -->
77
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
88
<uses-permission android:name="android.permission.PACKAGE_USAGE_STATS" />
9+
<uses-permission android:name="android.permission.QUERY_ALL_PACKAGES" />
10+
11+
<queries>
12+
<intent>
13+
<action
14+
android:name="android.accessibilityservice.AccessibilityService" />
15+
</intent>
16+
</queries>
17+
918
<application
1019
android:name=".App"
1120
android:label="@string/app_name"

app/src/main/java/io/github/ratul/topactivity/dialog/DialogBeautifier.java

Lines changed: 0 additions & 83 deletions
This file was deleted.

app/src/main/java/io/github/ratul/topactivity/service/AccessibilityMonitoringService.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ public boolean isSystemClass(String className) {
6262
@Override
6363
public void onAccessibilityEvent(AccessibilityEvent event) {
6464
if (WindowUtil.viewAdded && DatabaseUtil.isShowWindow() && DatabaseUtil.hasAccess()) {
65-
String act1 = event.getClassName().toString();
66-
String act2 = event.getPackageName().toString();
65+
String act1 = String.valueOf(event.getClassName());
66+
String act2 = String.valueOf(event.getPackageName());
6767

6868
if (isSystemClass(act1))
6969
return;

app/src/main/java/io/github/ratul/topactivity/utils/WindowUtil.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,6 @@ public static String getAppName(Context context, String pkg) {
151151
PackageManager pm = context.getPackageManager();
152152
return pm.getApplicationLabel(pm.getApplicationInfo(pkg, 0)).toString();
153153
} catch (Exception e) {
154-
// Ignored
155-
e.printStackTrace();
156154
return "";
157155
}
158156
}

app/src/main/res/layout/window_tasks.xml

Lines changed: 19 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,29 @@
1414
android:layout_width="match_parent"
1515
android:layout_height="wrap_content"
1616
android:orientation="horizontal" >
17-
18-
<io.github.ratul.topactivity.view.BoldTextView
17+
18+
<io.github.ratul.topactivity.view.NormalTextView
19+
android:id="@+id/text"
20+
android:layout_width="match_parent"
21+
android:layout_height="match_parent"
22+
android:layout_marginTop="1dp"
23+
android:background="#60111111"
24+
android:clickable="true"
25+
android:padding="8dp"
26+
android:singleLine="false"
27+
android:textColor="#FFFFFF"
28+
android:textSize="13sp" />
29+
30+
<io.github.ratul.topactivity.view.BoldTextView
1931
android:id="@+id/title"
2032
android:layout_width="wrap_content"
2133
android:layout_height="wrap_content"
22-
android:layout_weight="1"
34+
android:ellipsize="end"
2335
android:gravity="center_vertical"
2436
android:padding="8dp"
25-
android:text="Activity Info"
37+
android:text="-Info"
2638
android:textColor="#FFFFFF"
27-
android:textSize="14sp" />
39+
android:textSize="12sp" />
2840

2941
<com.google.android.material.imageview.ShapeableImageView
3042
android:id="@+id/closeBtn"
@@ -35,38 +47,7 @@
3547
android:scaleType="fitXY"
3648
android:src="@drawable/ic_close" />
3749
</LinearLayout>
38-
39-
<LinearLayout
40-
android:layout_width="match_parent"
41-
android:layout_height="wrap_content"
42-
android:background="#60808080"
43-
android:orientation="horizontal" >
44-
45-
<io.github.ratul.topactivity.view.NormalTextView
46-
android:layout_width="80dp"
47-
android:layout_height="match_parent"
48-
android:layout_marginRight="1dp"
49-
android:layout_marginTop="1dp"
50-
android:background="#60111111"
51-
android:gravity="center"
52-
android:padding="8dp"
53-
android:text="App name"
54-
android:textColor="#FFFFFF"
55-
android:textSize="13sp" />
56-
57-
<io.github.ratul.topactivity.view.NormalTextView
58-
android:id="@+id/text"
59-
android:layout_width="match_parent"
60-
android:layout_height="match_parent"
61-
android:layout_marginTop="1dp"
62-
android:background="#60111111"
63-
android:clickable="true"
64-
android:padding="8dp"
65-
android:singleLine="false"
66-
android:textColor="#FFFFFF"
67-
android:textSize="12sp" />
68-
</LinearLayout>
69-
50+
7051
<LinearLayout
7152
android:layout_width="match_parent"
7253
android:layout_height="wrap_content"
@@ -130,4 +111,4 @@
130111
</LinearLayout>
131112
</LinearLayout>
132113

133-
</LinearLayout>
114+
</LinearLayout>

0 commit comments

Comments
 (0)