use of com.abewy.android.apps.klyph.core.fql.Video in project Klyph by jonathangerbaud.
the class VideoSerializer method serializeObject.
@Override
public JSONObject serializeObject(GraphObject object) {
JSONObject json = new JSONObject();
serializePrimitives(object, json);
Video video = (Video) object;
FormatSerializer fs = new FormatSerializer();
try {
json.put("format", fs.serializeArray(video.getFormat()));
} catch (JSONException e) {
Log.d("StreamSerializer", "JSONException " + e.getMessage());
}
return json;
}
use of com.abewy.android.apps.klyph.core.fql.Video in project Klyph by jonathangerbaud.
the class StreamButtonBar method handleShareAction.
private void handleShareAction(final IStreamHolder holder, final Stream stream) {
Intent intent = new Intent(getContext(holder.getShareButton()), PostActivity.class);
intent.putExtra(KlyphBundleExtras.SHARE, true);
Attachment att = stream.getAttachment();
if (stream.isLink()) {
Link link = stream.getLink();
intent.putExtra(KlyphBundleExtras.SHARE_LINK_URL, link.getUrl());
intent.putExtra(KlyphBundleExtras.SHARE_LINK_IMAGE_URL, link.getPicture());
intent.putExtra(KlyphBundleExtras.SHARE_LINK_NAME, link.getTitle());
intent.putExtra(KlyphBundleExtras.SHARE_LINK_DESC, link.getSummary());
} else if (stream.isPhoto()) /* || att.isPhoto() */
{
Photo photo = stream.getPhoto();
intent.putExtra(KlyphBundleExtras.SHARE_PHOTO_ID, stream.isPhoto() ? photo.getObject_id() : att.getFb_object_id());
} else if (stream.isVideo()) /* || att.isVideo() */
{
Video video = stream.getVideo();
intent.putExtra(KlyphBundleExtras.SHARE_VIDEO_ID, stream.isVideo() ? video.getVid() : att.getFb_object_id());
} else /*
* else if (att.isAlbum())
* {
* intent.putExtra(KlyphBundleExtras.SHARE_ALBUM_ID, att.getFb_object_id());
* }
*/
{
intent.putExtra(KlyphBundleExtras.SHARE_POST_ID, stream);
Log.d("StreamButtonBar", "Share something but I do not what");
}
getContext(holder.getShareButton()).startActivity(intent);
}
use of com.abewy.android.apps.klyph.core.fql.Video in project Klyph by jonathangerbaud.
the class StreamButtonBar method handleShareWithAction.
private void handleShareWithAction(final IStreamHolder holder, final Stream stream) {
Intent intent = new Intent();
intent.setAction(Intent.ACTION_SEND);
Attachment att = stream.getAttachment();
if (stream.isLink()) {
Link link = stream.getLink();
intent.putExtra(Intent.EXTRA_TEXT, link.getUrl());
intent.putExtra(Intent.EXTRA_SUBJECT, link.getTitle());
intent.setType("text/plain");
} else if (stream.isPhoto()) /* || att.isPhoto() */
{
Photo photo = stream.getPhoto();
intent.putExtra(Intent.EXTRA_TEXT, photo.getLargestImageURL());
if (photo.getCaption().length() > 0)
intent.putExtra(Intent.EXTRA_SUBJECT, photo.getCaption());
else if (stream.getMessage().length() > 0)
intent.putExtra(Intent.EXTRA_SUBJECT, stream.getMessage());
intent.setType("text/plain");
// intent.putExtra(KlyphBundleExtras.SHARE_PHOTO_ID, stream.isPhoto() ? photo.getObject_id() : att.getFb_object_id());
} else if (stream.isVideo()) /* || att.isVideo() */
{
Video video = stream.getVideo();
intent.putExtra(Intent.EXTRA_TEXT, video.getSrc_hq());
if (video.getTitle().length() > 0)
intent.putExtra(Intent.EXTRA_SUBJECT, video.getTitle());
else if (stream.getMessage().length() > 0)
intent.putExtra(Intent.EXTRA_SUBJECT, stream.getMessage());
intent.setType("text/plain");
// intent.putExtra(KlyphBundleExtras.SHARE_VIDEO_ID, stream.isVideo() ? video.getVid() : att.getFb_object_id());
} else /*
* else if (att.isAlbum())
* {
* intent.putExtra(KlyphBundleExtras.SHARE_ALBUM_ID, att.getFb_object_id());
* }
*/
if (att.getMedia().size() == 1) {
Media m = att.getMedia().get(0);
intent.putExtra(Intent.EXTRA_TEXT, m.getSrc());
intent.putExtra(Intent.EXTRA_SUBJECT, m.getAlt());
intent.setType("text/plain");
} else {
if (stream.getMessage().length() > 0) {
intent.putExtra(Intent.EXTRA_TEXT, stream.getMessage());
intent.setType("text/plain");
} else if (stream.getDescription().length() > 0) {
intent.putExtra(Intent.EXTRA_TEXT, stream.getDescription());
intent.setType("text/plain");
}
}
try {
getContext(holder.getShareButton()).startActivity(intent);
} catch (ActivityNotFoundException e) {
}
}
use of com.abewy.android.apps.klyph.core.fql.Video in project Klyph by jonathangerbaud.
the class AlbumVideos method onGridItemClick.
@Override
public void onGridItemClick(KlyphGridView gridView, View v, int position, long id) {
Video video = (Video) getAdapter().getItem(position);
listener.onVideoSelected(AlbumVideos.this, video);
}
Aggregations