Fixed the bug that the floating animation of the tool button could not be automatically restored

This commit is contained in:
2022-08-08 17:07:40 +08:00
parent afd7181d7c
commit a58dff2830

View File

@@ -44,11 +44,9 @@ public class ToolsAdapter extends RecyclerView.Adapter<ToolsAdapter.ViewHolder>
toolButton.setText(button.getText()); toolButton.setText(button.getText());
toolButton.setOnClickListener(view -> ToolsLauncher.launch(parent.getContext(), button.getActivity())); toolButton.setOnClickListener(view -> ToolsLauncher.launch(parent.getContext(), button.getActivity()));
toolButton.setOnTouchListener((view, motionEvent) -> { toolButton.setOnTouchListener((view, motionEvent) -> {
if (motionEvent.getAction() == MotionEvent.ACTION_DOWN) { if (motionEvent.getAction() == MotionEvent.ACTION_DOWN) {
view.animate().translationZ(8f).setDuration(100L); view.animate().translationZ(8f).setDuration(100L);
} }else {
if (motionEvent.getAction() == MotionEvent.ACTION_UP) {
view.animate().translationZ(0).setDuration(100L); view.animate().translationZ(0).setDuration(100L);
} }
return false; return false;