Java 类android.app.ExpandableListActivity 实例源码

项目:truth-android    文件:ExpandableListActivitySubject.java   
public static SubjectFactory<ExpandableListActivitySubject, ExpandableListActivity> type() {
  return new SubjectFactory<ExpandableListActivitySubject, ExpandableListActivity>() {
    @Override
    public ExpandableListActivitySubject getSubject(FailureStrategy fs, ExpandableListActivity that) {
      return new ExpandableListActivitySubject(fs, that);
    }
  };
}
项目:ClinicalTrialTracker    文件:ArticleExpandableListAdapter.java   
@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");

        }
    }
}
项目:ClinicalTrialTracker    文件:ArticleExpandableListAdapter.java   
@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");

        }
    }
}
项目:ClinicalTrialTracker    文件:ArticleExpandableListAdapter.java   
@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");

        }
    }
}
项目:ClinicalTrialTracker    文件:ArticleExpandableListAdapter.java   
@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");    
              }          
          } 

     }

  }
项目:truth-android    文件:ExpandableListActivitySubject.java   
protected ExpandableListActivitySubject(FailureStrategy failureStrategy, ExpandableListActivity subject) {
  super(failureStrategy, subject);
}
项目:assertj-android    文件:ExpandableListActivityAssert.java   
public ExpandableListActivityAssert(ExpandableListActivity actual) {
  super(actual, ExpandableListActivityAssert.class);
}