public static SubjectFactory<ExpandableListActivitySubject, ExpandableListActivity> type() { return new SubjectFactory<ExpandableListActivitySubject, ExpandableListActivity>() { @Override public ExpandableListActivitySubject getSubject(FailureStrategy fs, ExpandableListActivity that) { return new ExpandableListActivitySubject(fs, that); } }; }
@Override public void onClick(View v) { if (v != null) { final int position = ((ExpandableListActivity) context) .getExpandableListView().getPositionForView(v) - 1; Log.d("" + position, "checkposition"); final long packedPosition = ((ExpandableListActivity) context) .getExpandableListView().getExpandableListPosition( position); Log.d("" + packedPosition, "checkposition"); ((ExpandableListActivity) context).getExpandableListView(); // final int packedPosition = // ((ExpandableListActivity)context).getExpandableListView().getExpandableListPosition(position); final int groupPosition = ExpandableListView .getPackedPositionGroup(packedPosition); if (groupPosition != AdapterView.INVALID_POSITION) { mCallBack = (OnGroupClickListener) ((Activity) context); mCallBack.OnGroupClick(groupPosition, groupItem.get(groupPosition).getUrl().toString(), "link"); } } }
@Override public void onClick(View v) { if (v != null) { final int position = ((ExpandableListActivity) context) .getExpandableListView().getPositionForView(v) - 1;//Give the position of parent view Log.d("" + position, "checkposition"); final long packedPosition = ((ExpandableListActivity) context) .getExpandableListView().getExpandableListPosition( position); Log.d("" + packedPosition, "checkposition"); ((ExpandableListActivity) context).getExpandableListView(); // final int packedPosition = // ((ExpandableListActivity)context).getExpandableListView().getExpandableListPosition(position); final int groupPosition = ExpandableListView .getPackedPositionGroup(packedPosition); if (groupPosition != AdapterView.INVALID_POSITION) { mCallBack = (OnGroupClickListener) ((Activity) context); mCallBack.OnGroupClick(groupPosition, groupItem.get(groupPosition).getUrl().toString(), "Share"); } } }
@Override public void onClick(View v) { if (v != null) { final int position = ((ExpandableListActivity) context) .getExpandableListView().getPositionForView(v) - 1;//Give the position of parent view Log.d("" + position, "checkposition"); final long packedPosition = ((ExpandableListActivity) context) .getExpandableListView().getExpandableListPosition( position); Log.d("" + packedPosition, "checkposition"); ((ExpandableListActivity) context).getExpandableListView(); // final int packedPosition = // ((ExpandableListActivity)context).getExpandableListView().getExpandableListPosition(position); final int groupPosition = ExpandableListView .getPackedPositionGroup(packedPosition); if (groupPosition != AdapterView.INVALID_POSITION) { mCallBack = (OnGroupClickListener) ((Activity) context); mCallBack.OnGroupClick(groupPosition, groupItem.get(groupPosition).getDescription().toString(), "copy"); } } }
@Override public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { if (buttonView!=null){ final int position = ((ExpandableListActivity)context).getExpandableListView().getPositionForView(buttonView); Log.d(""+position,"checkposition"); final long packedPosition= ((ExpandableListActivity)context).getExpandableListView().getExpandableListPosition(position); Log.d(""+packedPosition,"checkposition"); //((ExpandableListActivity)context).getExpandableListView(); // final int packedPosition = ((ExpandableListActivity)context).getExpandableListView().getExpandableListPosition(position); final int groupPosition = ExpandableListView.getPackedPositionGroup(packedPosition); if (groupPosition != AdapterView.INVALID_POSITION) { getGroup(groupPosition).setStar(isChecked); //Change the View if (isChecked){ mCallBack=(OnGroupClickListener)((Activity)context); mCallBack.OnGroupClick(groupPosition,groupItem.get(groupPosition).getGuid(),"star"); }else { mCallBack=(OnGroupClickListener)((Activity)context); mCallBack.OnGroupClick(groupPosition,groupItem.get(groupPosition).getGuid(),"unstar"); } } } }
protected ExpandableListActivitySubject(FailureStrategy failureStrategy, ExpandableListActivity subject) { super(failureStrategy, subject); }
public ExpandableListActivityAssert(ExpandableListActivity actual) { super(actual, ExpandableListActivityAssert.class); }