use of com.abewy.android.apps.klyph.adapter.MultiObjectAdapter in project Klyph by jonathangerbaud.
the class TitledFragmentActivity method displaySpinnerInActionBar.
@Override
public void displaySpinnerInActionBar(List<GraphObject> data, int position, OnNavigationListener listener) {
MultiObjectAdapter adapter = new MultiObjectAdapter(null, SpecialLayout.DROP_DOWN_ITEM);
adapter.addAll(data);
getActionBar().setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);
getActionBar().setListNavigationCallbacks(adapter, listener);
getActionBar().setSelectedNavigationItem(position);
}
use of com.abewy.android.apps.klyph.adapter.MultiObjectAdapter in project Klyph by jonathangerbaud.
the class EventDeclined method onViewCreated.
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
setListAdapter(new MultiObjectAdapter(getListView()));
defineEmptyText(R.string.empty_list_no_user);
setListVisible(false);
setRequestType(Query.EVENT_DECLINED);
super.onViewCreated(view, savedInstanceState);
}
use of com.abewy.android.apps.klyph.adapter.MultiObjectAdapter in project Klyph by jonathangerbaud.
the class EventFragment method onViewCreated.
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
defineEmptyText(R.string.empty_list_no_data);
setListVisible(false);
attendButtonListener = new View.OnClickListener() {
@Override
public void onClick(View v) {
if (!event.isUserAttendingEvent()) {
handleResponseClick(Query.POST_EVENT_ATTEND);
}
}
};
unsureButtonListener = new View.OnClickListener() {
@Override
public void onClick(View v) {
if (!event.isUserUnsureEvent()) {
handleResponseClick(Query.POST_EVENT_UNSURE);
}
}
};
declinedButtonListener = new View.OnClickListener() {
@Override
public void onClick(View v) {
if (!event.isUserDeclinedEvent()) {
handleResponseClick(Query.POST_EVENT_DECLINE);
}
}
};
invitedGuestListener = new View.OnClickListener() {
@Override
public void onClick(View v) {
UserListDialog dialog = new UserListDialog();
dialog.setCustomTitle(getString(R.string.event_num_invitee, event.getAll_members_count()));
dialog.setRequestType(Query.EVENT_INVITED);
dialog.setElementId(event.getEid());
dialog.show(getFragmentManager(), "");
dialog.load();
}
};
goingGuestListener = new View.OnClickListener() {
@Override
public void onClick(View v) {
UserListDialog dialog = new UserListDialog();
dialog.setCustomTitle(getString(R.string.event_num_attending, event.getAttending_count()));
dialog.setRequestType(Query.EVENT_GOING);
dialog.setElementId(event.getEid());
dialog.show(getFragmentManager(), "");
dialog.load();
}
};
unsureGuestListener = new View.OnClickListener() {
@Override
public void onClick(View v) {
UserListDialog dialog = new UserListDialog();
dialog.setCustomTitle(getString(R.string.event_num_unsure, event.getUnsure_count()));
dialog.setRequestType(Query.EVENT_MAYBE);
dialog.setElementId(event.getEid());
dialog.show(getFragmentManager(), "");
dialog.load();
}
};
declinedGuestListener = new View.OnClickListener() {
@Override
public void onClick(View v) {
UserListDialog dialog = new UserListDialog();
dialog.setCustomTitle(getString(R.string.event_num_declined, event.getDeclined_count()));
dialog.setRequestType(Query.EVENT_DECLINED);
dialog.setElementId(event.getEid());
dialog.show(getFragmentManager(), "");
dialog.load();
}
};
setRequestType(Query.EVENT_TIMELINE);
setNewestRequestType(Query.EVENT_TIMELINE);
super.onViewCreated(view, savedInstanceState);
MultiObjectAdapter adapter = /*KlyphPreferences.areBannerAdsEnabled() ? new NewsfeedAdapter(getListView(), SpecialLayout.EVENT_ABOUT)
: */
new MultiObjectAdapter(getListView(), SpecialLayout.EVENT_ABOUT);
if (KlyphPreferences.animateCards()) {
GoogleCardStyleAdapter gcsAdapter = new GoogleCardStyleAdapter(adapter);
gcsAdapter.setAbsListView(getListView());
setListAdapter(gcsAdapter);
} else {
setListAdapter(adapter);
}
}
use of com.abewy.android.apps.klyph.adapter.MultiObjectAdapter in project Klyph by jonathangerbaud.
the class Birthdays method onViewCreated.
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
Calendar calendar = new GregorianCalendar();
Date trialTime = new Date();
calendar.setTime(trialTime);
String month = String.valueOf(calendar.get(Calendar.MONTH) + 1);
String day = String.valueOf(calendar.get(Calendar.DAY_OF_MONTH));
if (month.length() == 1)
month = "0" + month;
if (day.length() == 1)
day = "0" + day;
setInitialOffset(month + "/" + day);
setListAdapter(new MultiObjectAdapter(getListView(), SpecialLayout.USER_BIRTHDAY));
defineEmptyText(R.string.empty_list_no_birthday);
setRequestType(Query.BIRTHDAYS);
setListVisible(false);
super.onViewCreated(view, savedInstanceState);
}
use of com.abewy.android.apps.klyph.adapter.MultiObjectAdapter in project Klyph by jonathangerbaud.
the class GalleryFragment method goBack.
public void goBack(ArrayList<String> uris) {
Intent intent = new Intent();
SparseBooleanArray positions = getGridView().getCheckedItemPositions();
int n = getGridView().getCheckedItemCount();
if (uris == null)
uris = new ArrayList<String>();
if (n > 0) {
MultiObjectAdapter adapter = getAdapter();
for (int i = 0; i < n; i++) {
if (adapter.getItem(positions.keyAt(i)) instanceof Picture) {
Picture image = (Picture) adapter.getItem(positions.keyAt(i));
uris.add(image.getUri());
}
}
}
if (uris.size() > 0) {
intent.putStringArrayListExtra(KlyphBundleExtras.PHOTO_LIST_URI, uris);
getActivity().setResult(Activity.RESULT_OK, intent);
} else {
getActivity().setResult(Activity.RESULT_CANCELED, null);
}
getActivity().finish();
}
Aggregations