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

onClick not working #79

Open
Shrinu opened this issue Apr 22, 2017 · 1 comment
Open

onClick not working #79

Shrinu opened this issue Apr 22, 2017 · 1 comment

Comments

@Shrinu
Copy link

Shrinu commented Apr 22, 2017

<com.balysv.materialripple.MaterialRippleLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/categoryripple"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:mrl_rippleAlpha="0.2"
app:mrl_rippleColor="@color/colorPrimaryDark"
app:mrl_rippleDimension="4dp"
app:mrl_rippleDuration="250"
app:mrl_rippleInAdapter="true"
app:mrl_rippleOverlay="true">

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="48dp"
    android:background="@android:color/white"
    android:orientation="vertical">

    <TextView
        android:id="@+id/text"
        android:layout_width="match_parent"
        android:layout_height="48dp"
        android:layout_marginLeft="16dp"
        android:layout_toLeftOf="@+id/groupIndicator"
        android:gravity="center_vertical"
        android:text="Test"
        android:textColor="@android:color/black"
        android:textSize="12sp" />

    <ImageView
        android:id="@+id/groupIndicator"
        android:layout_width="10dp"
        android:layout_height="10dp"
        android:layout_alignParentRight="true"
        android:layout_centerVertical="true"
        android:layout_marginRight="10dp" />
</RelativeLayout>

</com.balysv.materialripple.MaterialRippleLayout>

public View getGroupView(final int groupPosition, boolean isExpanded, View convertView, ViewGroup parent) {
if (convertView == null) {
convertView = mInflater.inflate(R.layout.category_item, null);
}
MaterialRippleLayout mRipple = (MaterialRippleLayout) convertView.findViewById(R.id.categoryripple);
mRipple.setTag(true);
mRipple.setTag(R.id.groupIndicator, groupPosition);
mRipple.setOnClickListener(new View.OnClickListener() {
@OverRide
public void onClick(View v) {
showToast(categories.get(groupPosition).getCategory_name());
}
});
}

I am using BaseExpandableListAdapter,
showtoast is never called. Where I am making mistake not able to find out.

@timyang-bowtie
Copy link

Duplicate of #86

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

2 participants