Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Target Api 28 level #34

Open
gauraviqlance opened this issue Aug 14, 2019 · 0 comments
Open

Target Api 28 level #34

gauraviqlance opened this issue Aug 14, 2019 · 0 comments

Comments

@gauraviqlance
Copy link

it is not work what you have tall implement either i am not clickable of my view.
public class BookingDetailActivity extends AppCompatActivity implements RecyclerTouchListener.RecyclerTouchListenerHelper,AddPackageContract.View {

onTouchListener = new RecyclerTouchListener(this, recyclerViewAddItem);
onTouchListener.setClickable(new RecyclerTouchListener.OnRowClickListener() {
@OverRide
public void onRowClicked(int position) {
// ShowLogToast.ShowToast(getApplicationContext(), "Row " + (position + 1) + " clicked!", 1);
}

            @Override
            public void onIndependentViewClicked(int independentViewID, int position) {
                // main view is cliecked  (linear forgound view)
               // ShowLogToast.ShowToast(getApplicationContext(), "Button in row " + (position + 1) + " clicked!", 1);
            }
        }).setSwipeOptionViews(R.id.linearEdit, R.id.linearDelete)
                .setSwipeable(R.id.linearForeground, R.id.relativeBackground, new RecyclerTouchListener.OnSwipeOptionsClickListener() {
                    @Override
                    public void onSwipeOptionClicked(int viewID, int position) {
                        String message = "";
                        if (viewID == R.id.linearEdit) {
                            message += "Edit";
                            setEditItem(position);
                        } else if (viewID == R.id.linearDelete) {
                            showAlertDeleteItem(position);
                            message += "Delete";
                        }
                        message += " clicked for row " + (position + 1);
                        ShowLogToast.ShowLog(TAG,message);
                        //ShowLogToast.ShowToast(getApplicationContext(), message, 1);
                    }
                });

@OverRide
protected void onResume() {
super.onResume();
if (recyclerViewAddItem != null)
recyclerViewAddItem.addOnItemTouchListener(onTouchListener);
}

@Override
protected void onPause() {
    super.onPause();
    if (recyclerViewAddItem != null)
    recyclerViewAddItem.removeOnItemTouchListener(onTouchListener);
}

// for hide view of recycler when user touch out side of recyclerView.
@Override
public void setOnActivityTouchListener(OnActivityTouchListener listener) {
    this.touchListener = listener;
}

@Override
public boolean dispatchTouchEvent(MotionEvent ev) {
    if (touchListener != null) touchListener.getTouchCoordinates(ev);
    return super.dispatchTouchEvent(ev);
}  }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant