use of com.lingtuan.firefly.adapter.NearByPeopleAdapter in project SmartMesh_Android by SmartMeshFoundation.
the class NearByPeopleUI method initData.
@Override
protected void initData() {
swipeLayout.setColorScheme(R.color.app_title_bg);
setTitle(getString(R.string.near_by_people_title));
String filter = MySharedPrefs.readString(this, MySharedPrefs.FILE_USER, MySharedPrefs.NEARY_PEOPLE_FILTER);
if (!TextUtils.isEmpty(filter)) {
// int index=Integer.parseInt(filter);
// imgFilter.setText(sexFilter[index]);
CURRENT_FILTER = filter;
}
// else{
// imgFilter.setText(sexFilter[0]);
// }
imgFilter.setVisibility(View.VISIBLE);
source = new ArrayList<UserInfoVo>();
String response = Utils.readFromFile("discover-people_nearby.json");
if (!TextUtils.isEmpty(response)) {
try {
JSONObject json = new JSONObject(response);
JSONArray array = json.optJSONArray("data");
parseJson(array);
} catch (JSONException e) {
e.printStackTrace();
}
}
mRequestUtils = NetRequestUtils.getInstance();
adapter = new NearByPeopleAdapter(this, source);
nearLv.setAdapter(adapter);
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
swipeLayout.setRefreshing(true);
loadNearByList(1, CURRENT_FILTER);
}
}, 500);
}
Aggregations