Open sumitnaharia opened 8 years ago
can you provide some code?
package com.homebrain.adapter;
import android.content.Context; import android.graphics.drawable.AnimationDrawable; import android.os.Handler; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.CompoundButton; import android.widget.ImageView; import android.widget.RelativeLayout; import android.widget.SeekBar; import android.widget.TextView;
import com.homebrain.R; import com.homebrain.models.Device; import com.homebrain.models.Group; import com.homebrain.utill.AnimationUtills; import com.homebrain.utill.Utils; import com.homebrain.widgets.CheckBox;
import java.util.ArrayList; import java.util.List;
import ayalma.ir.expandablerecyclerview.ExpandableRecyclerView;
/**
Created by and-06 on 24/06/16.
*/
public class RecycleViewExpandableAdapter extends ExpandableRecyclerView.Adapter<RecyclerView.ViewHolder, ExpandableRecyclerView.GroupViewHolder, Device, Group> {
private final LayoutInflater inflater;
private Context context;
private ArrayList
public RecycleViewExpandableAdapter(Context context, List
@Override public int getGroupItemCount() { if(groupList!=null) return groupList.size() - 1; else return -1; }
@Override public int getChildItemCount(int i) { return groupList.get(i).getDevices().size(); }
@Override public Group getGroupItem(int i) { return groupList.get(i); }
@Override public Device getChildItem(int i, int i1) { return groupList.get(i).getDevices().get(i1); }
@Override protected ExpandableRecyclerView.GroupViewHolder onCreateGroupViewHolder(final ViewGroup viewGroup) { final View rootView = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.group_name_row, viewGroup, false); return new ExpandableRecyclerView.GroupViewHolder(rootView) { ImageView image = (ImageView) rootView.findViewById(R.id.group_expand_arow);
@Override
public void expand() {
image.setImageResource(R.drawable.ic_home_up_arrow);
}
@Override
public void collapse() {
image.setImageResource(R.drawable.ic_home_down_arrow);
}
@Override
public void setExpanded(boolean b) {
}
@Override
public boolean isExpanded() {
return true;
}
};
}
@Override public void onBindGroupViewHolder(ExpandableRecyclerView.GroupViewHolder holder, int group) { super.onBindGroupViewHolder(holder, group); TextView textView = (TextView) holder.itemView.findViewById(R.id.tv_group_name); textView.setText(groupList.get(group).getGroupName());
}
@Override public void onBindChildViewHolder(final RecyclerView.ViewHolder holder, final int group, final int position) { CompoundButton.OnCheckedChangeListener listener = new CompoundButton.OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { if (isChecked) { groupList.get(group).getDevices().get(position).setStatus(Utils.Status.ON); } else { groupList.get(group).getDevices().get(position).setStatus(Utils.Status.OFF); } handler.postDelayed(new Runnable() { @Override public void run() { notifyDataSetChanged();
}
}, 200);
}
};
SeekBar.OnSeekBarChangeListener onSeekBarChangeListener = new SeekBar.OnSeekBarChangeListener() {
@Override
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
int value = progress == 0 ? 0 : progress;
groupList.get(group).getDevices().get(position).setLastValue(groupList.get(group).getDevices().get(position).getCurrentValue());
groupList.get(group).getDevices().get(position).setCurrentValue(value);
handler.postDelayed(new Runnable() {
@Override
public void run() {
notifyDataSetChanged();
}
}, 200);
}
@Override
public void onStartTrackingTouch(SeekBar seekBar) {
}
@Override
public void onStopTrackingTouch(SeekBar seekBar) {
}
};
SeekBar.OnSeekBarChangeListener onSeekBarFanChangeListener = new SeekBar.OnSeekBarChangeListener() {
@Override
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
// float value = progress==0?0:(float)progress/100; // Syso.print("* progres 1st >"+progress); float value = progress == 0 ? 0 : 600 - progress * 100; // Syso.print("* progres 2nd >"+value); groupList.get(group).getDevices().get(position).setLastValue(groupList.get(group).getDevices().get(position).getCurrentValue()); groupList.get(group).getDevices().get(position).setCurrentValue((int) value); handler.postDelayed(new Runnable() { @Override public void run() { notifyDataSetChanged();
}
}, 200);
}
@Override
public void onStartTrackingTouch(SeekBar seekBar) {
}
@Override
public void onStopTrackingTouch(SeekBar seekBar) {
}
};
super.onBindChildViewHolder(holder, group, position);
final Device device = groupList.get(group).getDevices().get(position);
if (holder instanceof ChildLasmViewHolder) {
((ChildLasmViewHolder) holder).icHomeDeviceUnActive.setImageResource(device.getDeviceType().getImg_gray());
((ChildLasmViewHolder) holder).icHomeDeviceActive.setImageResource(device.getDeviceType().getAnim_img_2());
((ChildLasmViewHolder) holder).txtHomeDeviceName.setText(device.getDeviceType().getName());
((ChildLasmViewHolder) holder).icHomeDeviceActive.clearAnimation();
((ChildLasmViewHolder) holder).icHomeDeviceActive.setVisibility(View.GONE);
if (device.getStatus() == Utils.Status.ON) {
((ChildLasmViewHolder) holder).icHomeDeviceActive.setVisibility(View.VISIBLE);
((ChildLasmViewHolder) holder).icHomeDevice.setImageResource(R.drawable.btn_bg_home_active);
AnimationUtills.updateAlpha(((ChildLasmViewHolder) holder).icHomeDeviceActive, ((float) device.getLastValue() / 100), ((float) device.getCurrentValue() / 100));
((ChildLasmViewHolder) holder).icHomeDeviceSpeedLine.setProgressDrawable(context.getResources().getDrawable(R.drawable.seekbar_progressbar));
((ChildLasmViewHolder) holder).icHomeDeviceUnActiveOff.setChecked(true);
} else {
((ChildLasmViewHolder) holder).icHomeDeviceActive.setVisibility(View.INVISIBLE);
((ChildLasmViewHolder) holder).icHomeDeviceSpeedLine.setProgressDrawable(context.getResources().getDrawable(R.drawable.seekbar_progressbar_unactive));
((ChildLasmViewHolder) holder).icHomeDevice.setImageResource(R.drawable.btn_bg_home_inactive);
//((ChildLasmViewHolder) holder).icHomeDeviceUnActiveOff.setChecked(false);
((ChildLasmViewHolder) holder).icHomeDeviceSpeedLine.setProgress(device.getCurrentValue());
AnimationUtills.updateAlpha(((ChildLasmViewHolder) holder).icHomeDeviceActive, 0, 0);
}
((ChildLasmViewHolder) holder).icHomeDeviceSpeedLine.setOnSeekBarChangeListener(onSeekBarChangeListener);
((ChildLasmViewHolder) holder).icHomeDeviceUnActiveOff.setOnCheckedChangeListener(listener);
} else if (holder instanceof ChildLdmViewHolder) {
((ChildLdmViewHolder) holder).icHomeDeviceActive.setImageResource(device.getDeviceType().getImg_gray());
((ChildLdmViewHolder) holder).txtHomeDeviceName.setText(device.getDeviceType().getName());
((ChildLdmViewHolder) holder).icHomeDeviceUnActiveOff.setOnCheckedChangeListener(listener);
if (device.getStatus() == Utils.Status.ON) {
((ChildLdmViewHolder) holder).icHomeDevice.setImageResource(R.drawable.btn_bg_home_active);
((ChildLdmViewHolder) holder).icHomeDeviceActive.setImageResource(device.getDeviceType().getAnim_img_2());
} else {
((ChildLdmViewHolder) holder).icHomeDevice.setImageResource(R.drawable.btn_bg_home_inactive);
((ChildLdmViewHolder) holder).icHomeDeviceActive.setImageResource(device.getDeviceType().getImg_gray());
}
} else if (holder instanceof ChildFcmViewHolder) {
// childViewHolder.img_fan_active.setVisibility(View.VISIBLE); ((ChildFcmViewHolder) holder).icHomeDeviceUnActive.setImageResource(device.getDeviceType().getAnim_img_1()); ((ChildFcmViewHolder) holder).icHomeDeviceActive.setImageResource(device.getDeviceType().getAnim_img_2()); ((ChildFcmViewHolder) holder).img_fan_active.setImageResource(device.getDeviceType().getAnim_img_3()); ((ChildFcmViewHolder) holder).img_fan_active.setVisibility(View.GONE); ((ChildFcmViewHolder) holder).icHomeDeviceActive.setVisibility(View.VISIBLE); if (device.getDeviceType().getId() == 101) { //((ChildFcmViewHolder) holder).icHomeDeviceActive.setPadding(context.getResources().getInteger(R.integer.x_for_room_cooler), context.getResources().getInteger(R.integer.y_for_room_cooler), context.getResources().getInteger(R.integer.x_for_room_cooler), context.getResources().getInteger(R.integer.y_for_room_cooler)); RelativeLayout.LayoutParams lp1 = new RelativeLayout.LayoutParams(RecyclerView.LayoutParams.WRAP_CONTENT, RecyclerView.LayoutParams.WRAP_CONTENT); lp1.setMargins(context.getResources().getInteger(R.integer.x_for_room_cooler), context.getResources().getInteger(R.integer.y_for_room_cooler), 0, 0); ((ChildFcmViewHolder) holder).icHomeDeviceActive.setLayoutParams(lp1); ((ChildFcmViewHolder) holder).img_fan_active.setLayoutParams(lp1);
// ((ChildFcmViewHolder) holder).img_fan_active.setPadding(context.getResources().getInteger(R.integer.x_for_room_cooler), context.getResources().getInteger(R.integer.y_for_room_cooler), context.getResources().getInteger(R.integer.x_for_room_cooler), context.getResources().getInteger(R.integer.y_for_room_cooler));
} else if (device.getDeviceType().getId() == 106) {
// ((ChildFcmViewHolder) holder).img_fan_active.setPadding(context.getResources().getInteger(R.integer.x_for_table_fan), context.getResources().getInteger(R.integer.y_for_table_fan), context.getResources().getInteger(R.integer.x_for_table_fan), context.getResources().getInteger(R.integer.y_for_table_fan));
// ((ChildFcmViewHolder) holder).icHomeDeviceActive.setPadding(context.getResources().getInteger(R.integer.x_for_table_fan), context.getResources().getInteger(R.integer.y_for_table_fan), context.getResources().getInteger(R.integer.x_for_table_fan), context.getResources().getInteger(R.integer.y_for_table_fan));
RelativeLayout.LayoutParams lp1 = new RelativeLayout.LayoutParams(RecyclerView.LayoutParams.WRAP_CONTENT, RecyclerView.LayoutParams.WRAP_CONTENT);
lp1.setMargins(context.getResources().getInteger(R.integer.x_for_table_fan), context.getResources().getInteger(R.integer.y_for_table_fan), 0, 0);
((ChildFcmViewHolder) holder).icHomeDeviceActive.setLayoutParams(lp1);
((ChildFcmViewHolder) holder).img_fan_active.setLayoutParams(lp1);
} else if (device.getDeviceType().getId() == 104) {
// ((ChildFcmViewHolder) holder).img_fan_active.setPadding(context.getResources().getInteger(R.integer.x_for_pdestal_fan), context.getResources().getInteger(R.integer.y_for_pdestal_fan), context.getResources().getInteger(R.integer.x_for_pdestal_fan), context.getResources().getInteger(R.integer.y_for_pdestal_fan));
// ((ChildFcmViewHolder) holder).icHomeDeviceActive.setPadding(context.getResources().getInteger(R.integer.x_for_pdestal_fan), context.getResources().getInteger(R.integer.y_for_pdestal_fan), context.getResources().getInteger(R.integer.x_for_pdestal_fan), context.getResources().getInteger(R.integer.y_for_pdestal_fan));
RelativeLayout.LayoutParams lp1 = new RelativeLayout.LayoutParams(RecyclerView.LayoutParams.WRAP_CONTENT, RecyclerView.LayoutParams.WRAP_CONTENT);
lp1.setMargins(context.getResources().getInteger(R.integer.x_for_pdestal_fan), context.getResources().getInteger(R.integer.y_for_pdestal_fan), 0, 0);
((ChildFcmViewHolder) holder).img_fan_active.setLayoutParams(lp1);
((ChildFcmViewHolder) holder).icHomeDeviceActive.setLayoutParams(lp1);
} else if (device.getDeviceType().getId() == 107) {
((ChildFcmViewHolder) holder).icHomeDeviceActive.setImageResource(device.getDeviceType().getAnim_img_2());
((ChildFcmViewHolder) holder).img_fan_active.setImageResource(device.getDeviceType().getAnim_img_2());
((ChildFcmViewHolder) holder).img_fan_active.setVisibility(View.VISIBLE);
// ((ChildFcmViewHolder) holder).img_fan_active.setPadding(context.getResources().getInteger(R.integer.x_for_vrv_upper_blade), context.getResources().getInteger(R.integer.y_for_vrv_upper_blade), context.getResources().getInteger(R.integer.x_for_vrv_upper_blade), context.getResources().getInteger(R.integer.y_for_vrv_upper_blade)); // ((ChildFcmViewHolder) holder).icHomeDeviceActive.setPadding(context.getResources().getInteger(R.integer.x_for_vrv_lower_blade), context.getResources().getInteger(R.integer.y_for_vrv_lower_blade), context.getResources().getInteger(R.integer.x_for_vrv_lower_blade), context.getResources().getInteger(R.integer.y_for_vrv_lower_blade)); RelativeLayout.LayoutParams lp1 = new RelativeLayout.LayoutParams(RecyclerView.LayoutParams.WRAP_CONTENT, RecyclerView.LayoutParams.WRAP_CONTENT); lp1.setMargins(context.getResources().getInteger(R.integer.x_for_vrv_upper_blade), context.getResources().getInteger(R.integer.y_for_vrv_upper_blade), 0, 0); ((ChildFcmViewHolder) holder).img_fan_active.setLayoutParams(lp1); RelativeLayout.LayoutParams lp2 = new RelativeLayout.LayoutParams(RecyclerView.LayoutParams.WRAP_CONTENT, RecyclerView.LayoutParams.WRAP_CONTENT); lp2.setMargins(context.getResources().getInteger(R.integer.x_for_vrv_lower_blade), context.getResources().getInteger(R.integer.y_for_vrv_lower_blade), 0, 0); ((ChildFcmViewHolder) holder).icHomeDeviceActive.setLayoutParams(lp2);
((ChildFcmViewHolder) holder).icHomeDeviceActive.setVisibility(View.VISIBLE);
}
((ChildFcmViewHolder) holder).txtHomeDeviceName.setText(device.getDeviceType().getName());
// ((ChildFcmViewHolder) holder).img_fan_active.clearAnimation(); // ((ChildFcmViewHolder) holder).icHomeDeviceActive.clearAnimation();
((ChildFcmViewHolder) holder).icHomeDeviceBrightnessIntensity.setOnSeekBarChangeListener(onSeekBarFanChangeListener);
((ChildFcmViewHolder) holder).icHomeDeviceUnActiveOff.setOnCheckedChangeListener(listener);
if (device.getStatus() == Utils.Status.ON) {
((ChildFcmViewHolder) holder).img_fan_active.setVisibility(View.VISIBLE);
if (device.getDeviceType().getId() == 107) {
((ChildFcmViewHolder) holder).icHomeDeviceActive.setImageResource(device.getDeviceType().getAnim_img_3());
((ChildFcmViewHolder) holder).img_fan_active.setImageResource(device.getDeviceType().getAnim_img_3());
((ChildFcmViewHolder) holder).icHomeDeviceActive.setVisibility(View.VISIBLE);
AnimationUtills.updateRotation(((ChildFcmViewHolder) holder).img_fan_active, device.getCurrentValue());
AnimationUtills.updateRotation(((ChildFcmViewHolder) holder).icHomeDeviceActive, device.getCurrentValue());
} else if (device.getDeviceType().getId() == 100 || device.getDeviceType().getId() == 105 || device.getDeviceType().getId() == 108) {
((ChildFcmViewHolder) holder).icHomeDeviceActive.setVisibility(View.GONE);
((ChildFcmViewHolder) holder).img_fan_active.setImageResource(device.getDeviceType().getAnim_img_3());
} else {
((ChildFcmViewHolder) holder).icHomeDeviceActive.setVisibility(View.GONE);
AnimationUtills.updateRotation(((ChildFcmViewHolder) holder).img_fan_active, device.getCurrentValue());
((ChildFcmViewHolder) holder).img_fan_active.setImageResource(device.getDeviceType().getAnim_img_3());
}
((ChildFcmViewHolder) holder).icHomeDeviceBrightnessIntensity.setProgressDrawable(context.getResources().getDrawable(R.drawable.seekbar_progressbar));
((ChildFcmViewHolder) holder).icHomeDeviceUnActiveOff.setChecked(true);
((ChildFcmViewHolder) holder).icHomeDevice.setImageResource(R.drawable.btn_bg_home_active);
} else {
((ChildFcmViewHolder) holder).img_fan_active.clearAnimation();
((ChildFcmViewHolder) holder).icHomeDeviceActive.clearAnimation();
((ChildFcmViewHolder) holder).icHomeDeviceBrightnessIntensity.setProgressDrawable(context.getResources().getDrawable(R.drawable.seekbar_progressbar_unactive));
((ChildFcmViewHolder) holder).icHomeDevice.setImageResource(R.drawable.btn_bg_home_inactive);
((ChildFcmViewHolder) holder).icHomeDeviceUnActiveOff.setChecked(false);
}
} else if (holder instanceof ChildCcmViewHolder) {
((ChildCcmViewHolder) holder).txtHomeDeviceName.setText(device.getDeviceType().getName());
((ChildCcmViewHolder) holder).icHomeDeviceOpenClose.setOnCheckedChangeListener(listener);
((ChildCcmViewHolder) holder).icHomeCloseBtn.setClickable(true);
((ChildCcmViewHolder) holder).icHomeCloseBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
AnimationUtills.stopAnimation(handler);
((ChildCcmViewHolder) holder).icHomeDeviceOpenClose.setChecked(false);
}
});
if (device.getDeviceType().getId() == 1) {
((ChildCcmViewHolder) holder).icHomeImageActive.setImageResource(R.drawable.roller_blind_animation);
} else if (device.getDeviceType().getId() == 0) {
((ChildCcmViewHolder) holder).icHomeImageActive.setBackgroundResource(R.drawable.curtain_animation);
}
if (device.getStatus() == Utils.Status.ON) {
((ChildCcmViewHolder) holder).icHomeDeviceOpenClose.setClickable(false);
if (device.getDeviceType().getId() == 1) {
// Animation call from Animation Utills
AnimationUtills.showAnimation(((ChildCcmViewHolder) holder).icHomeImageActive, context,handler, 2);
} else if (device.getDeviceType().getId() == 0) {
AnimationUtills.showAnimation(((ChildCcmViewHolder) holder).icHomeImageActive, context,handler, 1);
}
((ChildCcmViewHolder) holder).icHomeDevice.setImageResource(R.drawable.btn_bg_home_active);
} else {
((ChildCcmViewHolder) holder).icHomeDeviceOpenClose.setClickable(true);
((ChildCcmViewHolder) holder).icHomeDevice.setImageResource(R.drawable.btn_bg_home_inactive);
}
}
}
@Override protected RecyclerView.ViewHolder onCreateChildViewHolder(ViewGroup viewGroup, int i) { if (i == ITEM_TYPE_LASM) { View rootView = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.lasm_child_group_row, viewGroup, false);
return new ChildLasmViewHolder(rootView);
} else if (i == ITEM_TYPE_CCM) {
View rootView = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.ccm_child_group_row, viewGroup, false);
return new ChildCcmViewHolder(rootView);
} else if (i == ITEM_TYPE_LDM) {
View rootView = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.ldm_child_group_row, viewGroup, false);
return new ChildLdmViewHolder(rootView);
} else if (i == ITEM_TYPE_FCM) {
View rootView = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.fcm_child_group_row, viewGroup, false);
return new ChildFcmViewHolder(rootView);
}
throw new RuntimeException("there is no type that matches the type " + i + " + make sure your using types correctly");
}
@Override public int getChildItemViewType(int i, int i1) { if (groupList.get(i).getDevices().get(i1).getDeviceType().getProductType().equals(Utils.ProductType.LASM)) { return ITEM_TYPE_LASM; } else if (groupList.get(i).getDevices().get(i1).getDeviceType().getProductType().equals(Utils.ProductType.LDM)) { return ITEM_TYPE_LDM; } else if (groupList.get(i).getDevices().get(i1).getDeviceType().getProductType().equals(Utils.ProductType.FCM)) { return ITEM_TYPE_FCM; } else { return ITEM_TYPE_CCM; } }
public class GroupViewHolder extends ExpandableRecyclerView.ViewHolder {
private TextView groupName;
private ImageView expanArow;
public GroupViewHolder(View context) {
super(context);
groupName = (TextView) context.findViewById(R.id.tv_group_name);
expanArow = (ImageView) context.findViewById(R.id.group_expand_arow);
}
}
public class ChildLasmViewHolder extends RecyclerView.ViewHolder { TextView txtHomeDeviceName; ImageView icHomeDevice; SeekBar icHomeDeviceBrightnessLine; SeekBar icHomeDeviceSpeedLine; CheckBox icHomeDeviceUnActiveOff; ImageView icHomeDeviceUnActive; ImageView icHomeDeviceActive;
public ChildLasmViewHolder(View itemView) {
super(itemView);
txtHomeDeviceName = (TextView) itemView.findViewById(R.id.tv_home_device_name);
icHomeDevice = (ImageView) itemView.findViewById(R.id.imageView);
icHomeDeviceUnActive = (ImageView) itemView.findViewById(R.id.img_bulb_inactive);
icHomeDeviceSpeedLine = (SeekBar) itemView.findViewById(R.id.home_seek_bar);
icHomeDeviceActive = (ImageView) itemView.findViewById(R.id.img_bulb_active);
icHomeDeviceUnActiveOff = (CheckBox) itemView.findViewById(R.id.ic_home_device_on_off);
icHomeDeviceBrightnessLine = (SeekBar) itemView.findViewById(R.id.home_seek_bar);
}
}
public class ChildLdmViewHolder extends RecyclerView.ViewHolder { TextView txtHomeDeviceName; ImageView icHomeDevice; CheckBox icHomeDeviceUnActiveOff; ImageView icHomeDeviceActive;
public ChildLdmViewHolder(View itemView) {
super(itemView);
txtHomeDeviceName = (TextView) itemView.findViewById(R.id.tv_home_device_name);
icHomeDevice = (ImageView) itemView.findViewById(R.id.imageView);
icHomeDeviceActive = (ImageView) itemView.findViewById(R.id.img_bulb_inactive);
icHomeDeviceUnActiveOff = (CheckBox) itemView.findViewById(R.id.ic_home_device_on_off);
}
}
public class ChildFcmViewHolder extends RecyclerView.ViewHolder { TextView txtHomeDeviceName; ImageView icHomeDevice; SeekBar icHomeDeviceBrightnessIntensity; CheckBox icHomeDeviceUnActiveOff; ImageView icHomeDeviceUnActive; ImageView icHomeDeviceActive, img_fan_active;
public ChildFcmViewHolder(View itemView) {
super(itemView);
txtHomeDeviceName = (TextView) itemView.findViewById(R.id.tv_home_device_name);
icHomeDevice = (ImageView) itemView.findViewById(R.id.imageView);
icHomeDeviceUnActive = (ImageView) itemView.findViewById(R.id.img_bulb_inactive);
icHomeDeviceActive = (ImageView) itemView.findViewById(R.id.img_bulb_active);
icHomeDeviceUnActiveOff = (CheckBox) itemView.findViewById(R.id.ic_home_device_on_off);
icHomeDeviceBrightnessIntensity = (SeekBar) itemView.findViewById(R.id.home_seek_bar1);
img_fan_active = (ImageView) itemView.findViewById(R.id.img_fan_active);
}
}
public class ChildCcmViewHolder extends RecyclerView.ViewHolder { TextView txtHomeDeviceName; ImageView icHomeDevice; CheckBox icHomeDeviceOpenClose; ImageView icHomeOne, icHomeTwo, icHomeThree, icHomeFour, icHomeCloseBtn, icHomeImageActive;
public ChildCcmViewHolder(View itemView) {
super(itemView);
txtHomeDeviceName = (TextView) itemView.findViewById(R.id.tv_home_device_name);
icHomeDevice = (ImageView) itemView.findViewById(R.id.imageView);
icHomeOne = (ImageView) itemView.findViewById(R.id.img1);
icHomeTwo = (ImageView) itemView.findViewById(R.id.img2);
icHomeThree = (ImageView) itemView.findViewById(R.id.img3);
icHomeFour = (ImageView) itemView.findViewById(R.id.img4);
icHomeCloseBtn = (ImageView) itemView.findViewById(R.id.ic_close_btn);
icHomeImageActive = (ImageView) itemView.findViewById(R.id.ic_home_image_active);
icHomeDeviceOpenClose = (CheckBox) itemView.findViewById(R.id.ic_home_device_open_close);
}
}
@Override public void collapse(int group) { super.collapse(group); }
}
i have added only adapter code if u want i can send you more code also
when we add infinite animation some time they stop when we scroll upward