Java Code Examples for com.handmark.pulltorefresh.library.PullToRefreshExpandableListView

The following are top voted examples for showing how to use com.handmark.pulltorefresh.library.PullToRefreshExpandableListView. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: OverPulltorefresh   File: PullToRefreshExpandableListActivity.java   View source code 5 votes vote down vote up
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	setContentView(R.layout.activity_ptr_expandable_list);

	mPullRefreshListView = (PullToRefreshExpandableListView) findViewById(R.id.pull_refresh_expandable_list);

	// Set a listener to be invoked when the list should be refreshed.
	mPullRefreshListView.setOnRefreshListener(new OnRefreshListener<ExpandableListView>() {
		@Override
		public void onRefresh(PullToRefreshBase<ExpandableListView> refreshView) {
			// Do work to refresh the list here.
			new GetDataTask().execute();
		}
	});

	for (String group : mGroupStrings) {
		Map<String, String> groupMap1 = new HashMap<String, String>();
		groupData.add(groupMap1);
		groupMap1.put(KEY, group);

		List<Map<String, String>> childList = new ArrayList<Map<String, String>>();
		for (String string : mChildStrings) {
			Map<String, String> childMap = new HashMap<String, String>();
			childList.add(childMap);
			childMap.put(KEY, string);
		}
		childData.add(childList);
	}

	mAdapter = new SimpleExpandableListAdapter(this, groupData, android.R.layout.simple_expandable_list_item_1,
			new String[] { KEY }, new int[] { android.R.id.text1 }, childData,
			android.R.layout.simple_expandable_list_item_2, new String[] { KEY }, new int[] { android.R.id.text1 });
	setListAdapter(mAdapter);
}
 
Example 2
Project: yiim_v2   File: FriendManager.java   View source code 5 votes vote down vote up
public void onCreateView() {
	mListView = (PullToRefreshExpandableListView) mRootView
			.findViewById(R.id.tab_contacts_list);

	mPinnedHeaderView = mRootView
			.findViewById(R.id.friend_list_group_header);

	mPinnedImageView = (ImageView) mRootView
			.findViewById(R.id.friend_list_group_img);
	mPinnedTextView = (TextView) mRootView
			.findViewById(R.id.friend_list_group_text);
	mPinnedRightTextView = (TextView) mRootView
			.findViewById(R.id.friend_list_group_right_text);

	mPinnedImageView.setBackgroundResource(R.drawable.group_unfold_arrow);

	mListView
			.setOnRefreshListener(new OnRefreshListener<ExpandableListView>() {

				@Override
				public void onRefresh(
						PullToRefreshBase<ExpandableListView> refreshView) {
					// TODO Auto-generated method stub
					mGroups.clear();
					mEntries.clear();
					mAdapter.notifyDataSetChanged();
					XmppLoadRosterRunnable runnable = new XmppLoadRosterRunnable(
							mYiFragment.getActivity(), null);
					getXmppBinder().execute(runnable);
				}
			});
}
 
Example 3
Project: Z_MyProPullToRefresh   File: PullToRefreshExpandableListActivity.java   View source code 5 votes vote down vote up
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	setContentView(R.layout.activity_ptr_expandable_list);

	mPullRefreshListView = (PullToRefreshExpandableListView) findViewById(R.id.pull_refresh_expandable_list);

	// Set a listener to be invoked when the list should be refreshed.
	mPullRefreshListView.setOnRefreshListener(new OnRefreshListener<ExpandableListView>() {
		@Override
		public void onRefresh(PullToRefreshBase<ExpandableListView> refreshView) {
			// Do work to refresh the list here.
			new GetDataTask().execute();
		}
	});

	for (String group : mGroupStrings) {
		Map<String, String> groupMap1 = new HashMap<String, String>();
		groupData.add(groupMap1);
		groupMap1.put(KEY, group);

		List<Map<String, String>> childList = new ArrayList<Map<String, String>>();
		for (String string : mChildStrings) {
			Map<String, String> childMap = new HashMap<String, String>();
			childList.add(childMap);
			childMap.put(KEY, string);
		}
		childData.add(childList);
	}

	mAdapter = new SimpleExpandableListAdapter(this, groupData, android.R.layout.simple_expandable_list_item_1,
			new String[] { KEY }, new int[] { android.R.id.text1 }, childData,
			android.R.layout.simple_expandable_list_item_2, new String[] { KEY }, new int[] { android.R.id.text1 });
	setListAdapter(mAdapter);
}
 
Example 4
Project: Android-PullToRefresh-VerticalViewPager   File: PullToRefreshExpandableListActivity.java   View source code 5 votes vote down vote up
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	setContentView(R.layout.activity_ptr_expandable_list);

	mPullRefreshListView = (PullToRefreshExpandableListView) findViewById(R.id.pull_refresh_expandable_list);

	// Set a listener to be invoked when the list should be refreshed.
	mPullRefreshListView.setOnRefreshListener(new OnRefreshListener<ExpandableListView>() {
		@Override
		public void onRefresh(PullToRefreshBase<ExpandableListView> refreshView) {
			// Do work to refresh the list here.
			new GetDataTask().execute();
		}
	});

	for (String group : mGroupStrings) {
		Map<String, String> groupMap1 = new HashMap<String, String>();
		groupData.add(groupMap1);
		groupMap1.put(KEY, group);

		List<Map<String, String>> childList = new ArrayList<Map<String, String>>();
		for (String string : mChildStrings) {
			Map<String, String> childMap = new HashMap<String, String>();
			childList.add(childMap);
			childMap.put(KEY, string);
		}
		childData.add(childList);
	}

	mAdapter = new SimpleExpandableListAdapter(this, groupData, android.R.layout.simple_expandable_list_item_1,
			new String[] { KEY }, new int[] { android.R.id.text1 }, childData,
			android.R.layout.simple_expandable_list_item_2, new String[] { KEY }, new int[] { android.R.id.text1 });
	setListAdapter(mAdapter);
}
 
Example 5
Project: PullToRefresh-StaggeredGridView   File: PullToRefreshExpandableListActivity.java   View source code 5 votes vote down vote up
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	setContentView(R.layout.activity_ptr_expandable_list);

	mPullRefreshListView = (PullToRefreshExpandableListView) findViewById(R.id.pull_refresh_expandable_list);

	// Set a listener to be invoked when the list should be refreshed.
	mPullRefreshListView.setOnRefreshListener(new OnRefreshListener<ExpandableListView>() {
		@Override
		public void onRefresh(PullToRefreshBase<ExpandableListView> refreshView) {
			// Do work to refresh the list here.
			new GetDataTask().execute();
		}
	});

	for (String group : mGroupStrings) {
		Map<String, String> groupMap1 = new HashMap<String, String>();
		groupData.add(groupMap1);
		groupMap1.put(KEY, group);

		List<Map<String, String>> childList = new ArrayList<Map<String, String>>();
		for (String string : mChildStrings) {
			Map<String, String> childMap = new HashMap<String, String>();
			childList.add(childMap);
			childMap.put(KEY, string);
		}
		childData.add(childList);
	}

	mAdapter = new SimpleExpandableListAdapter(this, groupData, android.R.layout.simple_expandable_list_item_1,
			new String[] { KEY }, new int[] { android.R.id.text1 }, childData,
			android.R.layout.simple_expandable_list_item_2, new String[] { KEY }, new int[] { android.R.id.text1 });
	setListAdapter(mAdapter);
}
 
Example 6
Project: Viewer   File: AtHomeCameraVideolistNaoCan.java   View source code 4 votes vote down vote up
private void initView()
	{
		filetype = getIntent().getIntExtra("video_type", 0);
		month_name = getResources().getStringArray(R.array.month_array);
		expListView = (PullToRefreshExpandableListView) findViewById(R.id.athome_camera_tab_videolist_expandableListView);
		expListView.getRefreshableView().setGroupIndicator(null);
		expListView.getRefreshableView().setDivider(null);
		StreamerInfo basicInfo = Viewer.getViewer().getStreamerInfoMgr().getStreamerInfo(Long.valueOf(cid));
        int camCount = 0;
        if (basicInfo != null) {
            camCount = basicInfo.getCamCount();
        }
		numofcamera = basicInfo.getCamCount();
		titleText = (TextView) findViewById(R.id.title);
		relayout_alert = (LinearLayout) findViewById(R.id.relayout_alert);
//		cameraListView = (ListView)findViewById(R.id.cameraListView);
		mMyViewerHelper = MyViewerHelper.getInstance(getApplicationContext());
		mCameraInfos = mMyViewerHelper.getAllCameraInfos();
//		cameraListAdapter = new CameraListAdapter(this,mCameraInfos);
//		cameraListView.setAdapter(cameraListAdapter);
//		cameraListView.setOnItemClickListener(this);
		relayout_alert_cell1 = (RelativeLayout) findViewById(R.id.relayout_alert_cell1);
		relayout_selectTime = (RelativeLayout) findViewById(R.id.relayout_selectTime);
		select_time = (TextView) findViewById(R.id.select_time);
		relayout_selectTime.setOnClickListener(this);
		athome_up_down = (RelativeLayout) findViewById(R.id.athome_up_down);
		athome_up_down.setOnClickListener(this);
		relayout_alert_cell1.setOnClickListener(this);
		opt_linlayout = (LinearLayout) findViewById(R.id.opt_linlayout);
		opt_linlayout.setOnClickListener(this);
		findViewById(R.id.back_linlayout).setOnClickListener(this);
		not_viedeoList = (RelativeLayout) findViewById(R.id.not_viedeoList);
		not_viedeoList.setOnClickListener(this);
		videoListViewHandler = new VideoListViewHandler(this, myHandler, cid, filetype);
		adapter = new VideoListViewAdapter(this, filetype, cid, isNewAvs, basicInfo.getStreamerType(), videoListViewHandler);
		if(iCam != -1){
			adapter.setNewAvsInfo(camConfig.get(iCam).getCamIndex());
		}else{
			adapter.setNewAvsInfo(-1);
		}
		expListView.getRefreshableView().setAdapter(adapter);
		expListView.getRefreshableView().setOnChildClickListener(this);
		expListView.getRefreshableView().setOnScrollListener(this);
		expListView.setOnRefreshListener(this);
		date = "all";
		reload();
		setCameraName();
		silde_up_in = AnimationUtils.loadAnimation(this, R.anim.silde_up_in);
		silde_up_out = AnimationUtils.loadAnimation(this, R.anim.silde_up_out);
	}
 
Example 7
Project: SneezeReader   File: PullToRefreshExpandableListFragment.java   View source code 4 votes vote down vote up
protected PullToRefreshExpandableListView onCreatePullToRefreshListView(LayoutInflater inflater,
		Bundle savedInstanceState) {
	return new PullToRefreshExpandableListView(getActivity());
}
 
Example 8
Project: OverPulltorefresh   File: PullToRefreshExpandableListFragment.java   View source code 4 votes vote down vote up
protected PullToRefreshExpandableListView onCreatePullToRefreshListView(LayoutInflater inflater,
		Bundle savedInstanceState) {
	return new PullToRefreshExpandableListView(getActivity());
}
 
Example 9
Project: Android-PullToRefresh   File: PullToRefreshExpandableListFragment.java   View source code 4 votes vote down vote up
protected PullToRefreshExpandableListView onCreatePullToRefreshListView(LayoutInflater inflater,
		Bundle savedInstanceState) {
	return new PullToRefreshExpandableListView(getActivity());
}
 
Example 10
Project: love   File: PullToRefreshExpandableListFragment.java   View source code 4 votes vote down vote up
protected PullToRefreshExpandableListView onCreatePullToRefreshListView(LayoutInflater inflater,
		Bundle savedInstanceState) {
	return new PullToRefreshExpandableListView(getActivity());
}
 
Example 11
Project: ONE-Unofficial   File: PullToRefreshExpandableListFragment.java   View source code 4 votes vote down vote up
protected PullToRefreshExpandableListView onCreatePullToRefreshListView(LayoutInflater inflater,
		Bundle savedInstanceState) {
	return new PullToRefreshExpandableListView(getActivity());
}
 
Example 12
Project: Z_MyProPullToRefresh   File: PullToRefreshExpandableListFragment.java   View source code 4 votes vote down vote up
protected PullToRefreshExpandableListView onCreatePullToRefreshListView(LayoutInflater inflater,
		Bundle savedInstanceState) {
	return new PullToRefreshExpandableListView(getActivity());
}
 
Example 13
Project: Android-PullToRefresh-VerticalViewPager   File: PullToRefreshExpandableListFragment.java   View source code 4 votes vote down vote up
protected PullToRefreshExpandableListView onCreatePullToRefreshListView(LayoutInflater inflater,
		Bundle savedInstanceState) {
	return new PullToRefreshExpandableListView(getActivity());
}
 
Example 14
Project: PullToRefresh-StaggeredGridView   File: PullToRefreshExpandableListFragment.java   View source code 4 votes vote down vote up
protected PullToRefreshExpandableListView onCreatePullToRefreshListView(LayoutInflater inflater,
		Bundle savedInstanceState) {
	return new PullToRefreshExpandableListView(getActivity());
}