use of com.abewy.android.apps.klyph.core.graph.GraphObject in project Klyph by jonathangerbaud.
the class UserAbout method onGridItemClick.
@Override
public void onGridItemClick(KlyphGridView l, View v, int position, long id) {
GraphObject data = (GraphObject) l.getItemAtPosition(position);
Intent intent = Klyph.getIntentForGraphObject(getActivity(), data);
if (intent != null) {
startActivity(intent);
}
}
use of com.abewy.android.apps.klyph.core.graph.GraphObject in project Klyph by jonathangerbaud.
the class UserListDialog method onItemClick.
@Override
public void onItemClick(AdapterView<?> arg0, View arg1, int position, long arg3) {
GraphObject object = (GraphObject) arg0.getItemAtPosition(position);
if (object instanceof Tag) {
Tag tag = (Tag) object;
startActivity(Klyph.getIntentForGraphObject(getActivity(), tag));
} else if (object instanceof Friend) {
Friend friend = (Friend) object;
startActivity(Klyph.getIntentForGraphObject(getActivity(), friend));
}
}
use of com.abewy.android.apps.klyph.core.graph.GraphObject in project Klyph by jonathangerbaud.
the class KlyphDialogFragment method startLoading.
protected void startLoading() {
loading = true;
if (isError == true && getAdapter().getCount() > 0) {
GraphObject lastObject = getAdapter().getLastItem();
if (lastObject instanceof TextButtonItem) {
getAdapter().remove(lastObject);
}
}
isError = false;
if (!firstLoad) {
if (!loadingObjectAsFirstItem)
getAdapter().add(loadingObject);
else
getAdapter().insert(loadingObject, 0);
getAdapter().notifyDataSetChanged();
}
}
use of com.abewy.android.apps.klyph.core.graph.GraphObject in project Klyph by jonathangerbaud.
the class GroupActivity method getCachedDataFromInstanceState.
@Override
protected List<GraphObject> getCachedDataFromInstanceState(Bundle savedInstanceState) {
Group group = savedInstanceState.getParcelable("group");
List<GraphObject> data = new ArrayList<GraphObject>();
data.add(group);
return data;
}
use of com.abewy.android.apps.klyph.core.graph.GraphObject in project Klyph by jonathangerbaud.
the class AlbumActivity method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
requestWindowFeature(Window.FEATURE_ACTION_BAR_OVERLAY);
super.onCreate(savedInstanceState);
getActionBar().setBackgroundDrawable(getResources().getDrawable(R.drawable.ab_background_transparent_gradient));
getWindow().setBackgroundDrawableResource(R.drawable.image_background);
setTitle("");
setLoadingView(findViewById(R.id.progress_bar));
ArrayList<Photo> photos = getIntent().getParcelableArrayListExtra(KlyphBundleExtras.ALBUM_PHOTOS);
List<String> imageIds = getIntent().getStringArrayListExtra(KlyphBundleExtras.PHOTO_LIST_ID);
if (photos != null) {
List<GraphObject> list = new ArrayList<GraphObject>();
for (Photo photo : photos) {
list.add(photo);
}
((TabsAdapter) getPagerAdapter()).setPhotos(list);
int startPosition = getIntent().getIntExtra(KlyphBundleExtras.START_POSITION, 0);
getViewPager().setCurrentItem(startPosition);
showViewPager();
((TabsAdapter) getPagerAdapter()).show();
setLoadingViewVisible(false);
} else if (imageIds != null) {
String id = "";
int n = imageIds.size();
for (int i = 0; i < n; i++) {
if (i < n - 1) {
id += "\"" + imageIds.get(i) + "\", ";
} else {
id += "\"" + imageIds.get(i) + "\"";
}
}
new AsyncRequest(Query.PHOTO_LIST, id, "", new AsyncRequest.Callback() {
@Override
public void onComplete(final Response response) {
runOnUiThread(new Runnable() {
@Override
public void run() {
if (response.getError() == null) {
onPhotoListRequestSuccess(response.getGraphObjectList());
} else {
onPhotoListRequestError(response.getError());
}
}
});
}
}).execute();
} else {
Log.d("AlbumActivity", "else");
String id = getIntent().getStringExtra(KlyphBundleExtras.ALBUM_ID);
// String name =
// getIntent().getStringExtra(CkoobafeBundleExtras.ALBUM_NAME);
// showPageIndicator();
showViewPager();
// ((TabsAdapter) getPagerAdapter()).show();
new AsyncRequest(Query.ALBUM_PHOTOS, id, "", new AsyncRequest.Callback() {
@Override
public void onComplete(final Response response) {
runOnUiThread(new Runnable() {
@Override
public void run() {
if (response.getError() == null) {
onAlbumPhotosRequestSuccess(response.getGraphObjectList());
} else {
onAlbumPhotosRequestError(response.getError());
}
}
});
}
}).execute();
}
}
Aggregations