Skip to content

Commit

Permalink
update debug code
Browse files Browse the repository at this point in the history
  • Loading branch information
jrfeng committed Nov 21, 2020
1 parent a0ff84f commit f16258c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import android.annotation.SuppressLint;
import android.graphics.Color;
import android.os.Bundle;
import android.view.LayoutInflater;
Expand Down Expand Up @@ -44,6 +45,15 @@ protected void onCreate(Bundle savedInstanceState) {
mAdapter = new TestSelectableAdapter(mItems);
recyclerView.setAdapter(mAdapter);

final TextView tvSelectCount = findViewById(R.id.tvSelectCount);
mAdapter.setOnSelectCountChangeListener(new SelectableHelper.OnSelectCountChangeListener() {
@SuppressLint("SetTextI18n")
@Override
public void onSelectCountChanged(int selectedCount) {
tvSelectCount.setText("SelectCount: " + selectedCount);
}
});

RadioGroup rgMode = findViewById(R.id.rgMode);
rgMode.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
@Override
Expand Down
8 changes: 8 additions & 0 deletions app/src/main/res/layout/activity_selectable_helper.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@
android:layout_height="0dp"
android:layout_weight="1" />

<TextView
android:id="@+id/tvSelectCount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginLeft="16dp"
android:text="SelectCount: 0" />

<RadioGroup
android:id="@+id/rgMode"
android:layout_width="wrap_content"
Expand Down

0 comments on commit f16258c

Please sign in to comment.