Skip to content

Commit

Permalink
fix usage tracker counting when scrolling comments
Browse files Browse the repository at this point in the history
  • Loading branch information
nethical6 committed Dec 30, 2024
1 parent d774a1c commit 52a6cfb
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,8 @@ class UsageTrackingService : BaseBlockingService() {
rootInActiveWindow,
"com.google.android.youtube:id/reel_recycler"
)
if (reelView != null) takeReelAction("com.google.android.youtube") else hideReelTrackingView()
val commentsSection = ViewBlocker.findElementById(rootInActiveWindow,"com.google.android.youtube:id/engagement_panel_content")
if (reelView != null && commentsSection == null) takeReelAction("com.google.android.youtube") else hideReelTrackingView()
}


Expand All @@ -287,7 +288,9 @@ class UsageTrackingService : BaseBlockingService() {
rootInActiveWindow,
"app.revanced.android.youtube:id/reel_recycler"
)
if (reelView != null) takeReelAction("app.revanced.android.youtube") else hideReelTrackingView()
// prevents events from scrolls on comments section
val commentsSection = ViewBlocker.findElementById(rootInActiveWindow,"app.revanced.android.youtube:id/engagement_panel_content")
if (reelView != null && commentsSection == null) takeReelAction("app.revanced.android.youtube") else hideReelTrackingView()
}
}
}
Expand Down
20 changes: 10 additions & 10 deletions app/src/main/res/layout/dialog_permission_info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -99,22 +99,22 @@
app:drawableTintMode="src_in" />
</LinearLayout>

<Button
<Button
android:id="@+id/btn_reject"
style="@style/Widget.Material3.Button.OutlinedButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="8dp"
android:text="@string/reject" />

<Button
android:id="@+id/btn_accept"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="8dp"
android:layout_marginBottom="8dp"
android:text="@string/accept" />

<Button
android:id="@+id/btn_reject"
style="@style/Widget.Material3.Button.OutlinedButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="8dp"
android:text="@string/reject" />

</LinearLayout>
</LinearLayout>

</ScrollView>
2 changes: 1 addition & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@
<string name="from">From</string>
<string name="end">End</string>
<string name="accept">Accept</string>
<string name="accessibility_perm_desc">DigiPaws uses the Accessibility permission to provide features like app monitoring and usage tracking to enhance your experience. This permission allows DigiPaws to detect app activities and help manage device usage effectively. Rest assured, all data is processed locally on your device and is never sent to any server or third party. Your privacy and data security are our top priorities.</string>
<string name="accessibility_perm_desc">DigiPaws uses the Accessibility permission to provide features like app monitoring and usage tracking to enhance your experience. This permission allows DigiPaws to detect app activities and help manage device usage effectively. Rest assured, all data is processed locally on your device and is never sent to any server or third party. Your privacy and data security are our top priorities. \n \n By pressing Accept, you acknowledge and agree to the above .</string>
<string name="reject">Reject</string>
<string name="peel_the_onions">Peel the onions</string>
<string name="fix_your_life">Fix your life</string>
Expand Down

0 comments on commit 52a6cfb

Please sign in to comment.