break;
}
}
-
+
+ // Remove the warning that `OnTouchListener()` needs to override `performClick()`, as the only purpose of setting the `OnTouchListener()` is to make it do nothing.
+ @SuppressLint("ClickableViewAccessibility")
private void initializeApp() {
// Get a handle for the input method.
InputMethodManager inputMethodManager = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
this.registerReceiver(orbotStatusBroadcastReceiver, new IntentFilter("org.torproject.android.intent.action.STATUS"));
// Get handles for views that need to be modified.
+ LinearLayout bookmarksHeaderLinearLayout = findViewById(R.id.bookmarks_header_linearlayout);
ListView bookmarksListView = findViewById(R.id.bookmarks_drawer_listview);
FloatingActionButton launchBookmarksActivityFab = findViewById(R.id.launch_bookmarks_activity_fab);
FloatingActionButton createBookmarkFolderFab = findViewById(R.id.create_bookmark_folder_fab);
}
});
+ // Set a touch listener on the bookmarks header linear layout so that touches don't pass through to the button underneath.
+ bookmarksHeaderLinearLayout.setOnTouchListener((view, motionEvent) -> {
+ // Consume the touch.
+ return true;
+ });
+
// Set the launch bookmarks activity FAB to launch the bookmarks activity.
launchBookmarksActivityFab.setOnClickListener(v -> {
// Get a copy of the favorite icon bitmap.
<!-- A compound drawable doesn't work well because only the image view should execute the `onClick()`. -->
<LinearLayout
+ android:id="@+id/bookmarks_header_linearlayout"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:orientation="horizontal"
<!-- A compound drawable doesn't work well because only the image view should execute the `onClick()`. -->
<LinearLayout
+ android:id="@+id/bookmarks_header_linearlayout"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:orientation="horizontal"