use of com.abewy.android.apps.klyph.adapter.MultiObjectAdapter in project Klyph by jonathangerbaud.
the class KlyphFragment method populate.
protected void populate(List<GraphObject> data) {
if (getView() != null) {
MultiObjectAdapter adapter = getAdapter();
for (GraphObject graphObject : data) {
adapter.add(graphObject);
}
// adapter.addAll(data); is only available in api 11
endLoading();
boolean requestHasMoreData = request != null && request.hasMoreData();
if (data.size() == 0 || !requestHasMoreData)
noMoreData = true;
offset = String.valueOf(adapter.getCount());
}
}
use of com.abewy.android.apps.klyph.adapter.MultiObjectAdapter in project Klyph by jonathangerbaud.
the class AlbumPhotos method onViewCreated.
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
setListVisible(false);
setRequestType(tagged ? Query.ALBUM_TAGGED_PHOTOS : Query.ALBUM_PHOTOS);
getGridView().setAdapter(new MultiObjectAdapter(getListView(), SpecialLayout.GRID));
defineEmptyText(R.string.empty_list_no_photo);
//getGridView().setStretchMode(GridView.NO_STRETCH);
super.onViewCreated(view, savedInstanceState);
}
use of com.abewy.android.apps.klyph.adapter.MultiObjectAdapter in project Klyph by jonathangerbaud.
the class GroupPhotos method onViewCreated.
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
setListVisible(false);
setRequestType(Query.GROUP_PHOTOS);
super.onViewCreated(view, savedInstanceState);
defineEmptyText(R.string.empty_list_no_photo);
getGridView().setAdapter(new MultiObjectAdapter(getListView(), SpecialLayout.GRID));
}
use of com.abewy.android.apps.klyph.adapter.MultiObjectAdapter in project Klyph by jonathangerbaud.
the class ImageFragment method onViewCreated.
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
progress = (ProgressBar) view.findViewById(R.id.progress);
emptyView = (ListEmptyView) view.findViewById(R.id.emptyView);
imageView = (ImageViewTouch) view.findViewById(R.id.image);
slidingDrawer = (KlyphSlidingDrawer) view.findViewById(R.id.sliding_drawer);
captionInfo = (ViewGroup) view.findViewById(R.id.caption_info);
profileImage = (ImageView) view.findViewById(R.id.author_profile_image);
authorName = (TextView) view.findViewById(R.id.author_name);
postTime = (TextView) view.findViewById(R.id.post_time);
sendTextEdit = (EditText) view.findViewById(R.id.send_text_edit);
sendButton = (ImageButton) view.findViewById(R.id.send_button);
emptyView.setText(R.string.cannot_find_photo);
getListView().setCacheColorHint(AttrUtil.getColor(getActivity(), android.R.attr.windowBackground));
// imageView.setOnScaleListener(this);
imageView.setSingleTapListener(new ImageViewTouch.OnImageViewTouchSingleTapListener() {
@Override
public void onSingleTapConfirmed() {
toggleBarVisibility();
}
});
sendButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
handlePostComment();
}
});
defineEmptyText(R.string.no_comment);
adapter = new MultiObjectAdapter(getListView(), SpecialLayout.PHOTO);
setListAdapter(adapter);
// setRequestType(Query.PHOTO_AND_COMMENTS);
setRequestType(Query.PHOTO);
super.onViewCreated(view, savedInstanceState);
//Crash if before super.onViewCreated(view, savedInstanceState);
getListView().getAdapter().registerDataSetObserver(observer);
}
use of com.abewy.android.apps.klyph.adapter.MultiObjectAdapter in project Klyph by jonathangerbaud.
the class Notifications method onActivityCreated.
/*
* @Override
* protected KlyphPullToRefreshListView onCreatePullToRefreshListView(LayoutInflater inflater, Bundle savedInstanceState)
* {
* return (KlyphPullToRefreshListView) inflater.inflate(R.layout.list_notifications, null);
* }
*/
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
NotificationSwipeDismissAdapter swAdapter = new NotificationSwipeDismissAdapter(new MultiObjectAdapter(getListView()), new OnDismissCallback() {
@Override
public void onDismiss(AbsListView arg0, int[] positions) {
for (int i : positions) {
if (getAdapter().getItem(i) instanceof Notification) {
Notification notification = (Notification) getAdapter().getItem(i);
setNotificationRead(notification);
}
}
List<GraphObject> list = new ArrayList<GraphObject>();
for (GraphObject o : getAdapter().getItems()) {
if (!(o instanceof Header)) {
list.add(o);
}
}
populate(list);
}
});
swAdapter.setAbsListView(getListView());
setListAdapter(swAdapter);
// setListAdapter(new MultiObjectAdapter(getListView()));
defineEmptyText(R.string.empty_list_no_notification);
setListVisible(false);
setRequestType(Query.NOTIFICATIONS);
loggedIn = true;
new Handler().postDelayed(new Runnable() {
public void run() {
loadNotifications();
}
}, 2000);
}
Aggregations