Skip to content

Commit

Permalink
Change opening menu to ACTION_UP instead of ACTION_DOWN
Browse files Browse the repository at this point in the history
(cherry picked from commit 22b4ecf)
  • Loading branch information
nielsvanvelzen committed Jan 24, 2023
1 parent 3d97b5a commit cb046c2
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceStat

@Override
public boolean onKey(View v, int keyCode, KeyEvent event) {
if (event.getAction() != KeyEvent.ACTION_DOWN) return false;
if (event.getAction() != KeyEvent.ACTION_UP) return false;

if (keyCode == KeyEvent.KEYCODE_MEDIA_PLAY || keyCode == KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE) {
mediaManager.getValue().setCurrentMediaAdapter(mAdapter);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ protected void setupEventListeners() {

@Override
public boolean onKey(View v, int keyCode, KeyEvent event) {
if (event.getAction() != KeyEvent.ACTION_DOWN) return false;
if (event.getAction() != KeyEvent.ACTION_UP) return false;
return KeyProcessor.HandleKey(keyCode, mCurrentItem, requireActivity());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ class HomeRowsFragment : RowsSupportFragment(), AudioEventListener, View.OnKeyLi
}

override fun onKey(v: View?, keyCode: Int, event: KeyEvent?): Boolean {
if (event?.action != KeyEvent.ACTION_DOWN) return false
if (event?.action != KeyEvent.ACTION_UP) return false
return KeyProcessor.HandleKey(keyCode, currentItem, activity)
}

Expand Down

0 comments on commit cb046c2

Please sign in to comment.