use of android.widget.ImageButton in project Klyph by jonathangerbaud.
the class StreamAdapter method attachHolder.
@Override
protected void attachHolder(View view) {
ImageView authorProfileImage = (ImageView) view.findViewById(R.id.author_profile_image);
TextView story = (TextView) view.findViewById(R.id.story);
TextView postTime = (TextView) view.findViewById(R.id.post_time);
ImageView sharedAuthorProfileImage = (ImageView) view.findViewById(R.id.shared_author_profile_image);
TextView sharedStory = (TextView) view.findViewById(R.id.shared_story);
TextView sharedPostTime = (TextView) view.findViewById(R.id.shared_post_time);
TextView message = (TextView) view.findViewById(R.id.message);
ImageView postPhoto = (ImageView) view.findViewById(R.id.post_photo);
ImageView postVideoPlay = (ImageView) view.findViewById(R.id.post_video_play);
TextView videoTitle = (TextView) view.findViewById(R.id.post_video_title);
TextView videoUrl = (TextView) view.findViewById(R.id.post_video_url);
ImageView postPicturePlay = (ImageView) view.findViewById(R.id.post_picture_play);
ImageView postLinkBackground = (ImageView) view.findViewById(R.id.stream_link_image_background);
TextView postName = (TextView) view.findViewById(R.id.post_name);
TextView postCaption = (TextView) view.findViewById(R.id.post_caption);
TextView postDescription = (TextView) view.findViewById(R.id.post_description);
Button likeButton = (Button) view.findViewById(R.id.like_button);
Button commentButton = (Button) view.findViewById(R.id.comment_button);
ImageButton shareButton = (ImageButton) view.findViewById(R.id.share_button);
ImageButton overflowButton = (ImageButton) view.findViewById(R.id.overflow_button);
HListView streamAlbum = (HListView) view.findViewById(R.id.stream_album);
ViewGroup streamLink = (ViewGroup) view.findViewById(R.id.stream_link);
ViewGroup buttonBar = (ViewGroup) view.findViewById(R.id.button_bar);
View buttonBarDivider = (View) view.findViewById(R.id.button_bar_divider);
StreamHolder holder = new StreamHolder(authorProfileImage, story, postTime, sharedAuthorProfileImage, sharedStory, sharedPostTime, message, postPhoto, postVideoPlay, videoTitle, videoUrl, postPicturePlay, postLinkBackground, postName, postCaption, postDescription, likeButton, commentButton, shareButton, overflowButton, streamAlbum, streamLink, buttonBar, buttonBarDivider);
setHolder(view, holder);
}
use of android.widget.ImageButton in project Klyph by jonathangerbaud.
the class PostActivity method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Intent intent = getIntent();
if (intent.getStringExtra(KlyphBundleExtras.EVENT_ID) != null) {
elementId = intent.getStringExtra(KlyphBundleExtras.EVENT_ID);
isEventMessage = true;
} else if (intent.getStringExtra(KlyphBundleExtras.PAGE_ID) != null) {
elementId = intent.getStringExtra(KlyphBundleExtras.PAGE_ID);
isPageMessage = true;
} else if (intent.getStringExtra(KlyphBundleExtras.GROUP_ID) != null) {
elementId = intent.getStringExtra(KlyphBundleExtras.GROUP_ID);
isGroupMessage = true;
} else {
elementId = KlyphSession.getSessionUserId();
}
Log.d("PostActivity", "event " + isEventMessage + " page " + isPageMessage + " group " + isGroupMessage);
boolean shareLink = intent.getBooleanExtra(KlyphBundleExtras.SHARE, false);
String action = intent.getAction();
String type = intent.getType();
setTitle(isEventMessage == false ? R.string.publish_new_status : R.string.publish_new_event_message);
photoUris = new ArrayList<String>();
messageTextView = (TextView) findViewById(R.id.message_textview);
friendsTextView = (TextView) findViewById(R.id.friends_textview);
placeTextView = (TextView) findViewById(R.id.place_textview);
photosFragment = (PostPhotos) getFragmentManager().findFragmentById(R.id.photos_fragment);
albumsFragment = (PostAlbums) getFragmentManager().findFragmentById(R.id.albums_fragment);
linkFragment = (PostLink) getFragmentManager().findFragmentById(R.id.link_fragment);
shareFragment = (PostShare) getFragmentManager().findFragmentById(R.id.share_fragment);
getFragmentManager().beginTransaction().hide(photosFragment).commitAllowingStateLoss();
getFragmentManager().beginTransaction().hide(albumsFragment).commitAllowingStateLoss();
getFragmentManager().beginTransaction().hide(linkFragment).commitAllowingStateLoss();
if (shareLink == true) {
shareFragment.initWithIntent(getIntent());
shareFragmentVisible = true;
} else {
getFragmentManager().beginTransaction().hide(shareFragment).commit();
}
if (isEventMessage == true) {
LinearLayout buttonBar = (LinearLayout) findViewById(R.id.button_bar);
buttonBar.setVisibility(View.GONE);
} else {
ImageButton placeDeleteButton = (ImageButton) findViewById(R.id.place_delete_button);
ImageButton friendsDeleteButton = (ImageButton) findViewById(R.id.friends_delete_button);
friendsButton = (ImageButton) findViewById(R.id.friends_button);
photosButton = (ImageButton) findViewById(R.id.picture_button);
placeButton = (ImageButton) findViewById(R.id.place_button);
linkButton = (ImageButton) findViewById(R.id.link_button);
privacyButton = (ImageButton) findViewById(R.id.privacy_button);
placeDeleteButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
clearPlace();
updateButtonStatus();
}
});
friendsDeleteButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
clearFriends();
updateButtonStatus();
}
});
friendsButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(PostActivity.this, FriendPickerActivity.class);
if (friends != null && friends.size() > 0) {
ArrayList<String> ids = new ArrayList<String>();
ids.addAll(friends.keySet());
intent.putStringArrayListExtra(KlyphBundleExtras.FRIEND_PICKER_IDS, ids);
}
startActivityForResult(intent, FRIEND_PICKER);
}
});
photosButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
startGallery();
}
});
placeButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
startActivityForResult(new Intent(PostActivity.this, PlacePickerActivity.class), PLACE_PICKER);
}
});
linkButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
linkFragment.reset();
getFragmentManager().beginTransaction().show(linkFragment).commitAllowingStateLoss();
linkFragmentVisible = true;
updateButtonStatus();
}
});
setPrivacyListenerApi11();
setPrivacy(KlyphPreferences.getPrivacy());
if (Intent.ACTION_SEND.equals(action) && type != null) {
displayBackArrow(false);
setAppIconBackToHomeEnabled(false);
if ("text/plain".equals(type)) {
String sharedText = intent.getStringExtra(Intent.EXTRA_TEXT);
String sharedSubject = intent.getStringExtra(Intent.EXTRA_SUBJECT);
if (sharedText != null) {
boolean isUrl = false;
try {
new URL(sharedText);
isUrl = true;
} catch (MalformedURLException e) {
isUrl = false;
}
if (isUrl == true) {
linkFragment.setUrl(sharedText);
linkFragment.setTitle(sharedSubject);
getFragmentManager().beginTransaction().show(linkFragment).commitAllowingStateLoss();
} else {
messageTextView.setText(sharedText);
}
}
} else if (type.startsWith("image/")) {
Uri imageUri = (Uri) intent.getParcelableExtra(Intent.EXTRA_STREAM);
if (imageUri != null) {
// Update UI to reflect image being shared
photoUris = new ArrayList<String>();
if (StringUtils.startsWith(imageUri.toString(), "content://")) {
photoUris.add(getRealPathFromURI(imageUri));
} else {
photoUris.add(imageUri.getPath());
}
photosFragment.setImages(photoUris);
getFragmentManager().beginTransaction().show(photosFragment).commitAllowingStateLoss();
photosFragment.updateLayout();
}
}
} else if (Intent.ACTION_SEND_MULTIPLE.equals(action) && type != null) {
displayBackArrow(false);
setAppIconBackToHomeEnabled(false);
if (type.startsWith("image/")) {
ArrayList<Uri> imageUris = intent.getParcelableArrayListExtra(Intent.EXTRA_STREAM);
if (imageUris != null) {
// Update UI to reflect multiple images being shared
photoUris = new ArrayList<String>();
for (Uri uri : imageUris) {
if (StringUtils.startsWith(uri.toString(), "content://")) {
photoUris.add(getRealPathFromURI(uri));
} else {
photoUris.add(uri.getPath());
}
}
photosFragment.setImages(photoUris);
getFragmentManager().beginTransaction().show(photosFragment).commitAllowingStateLoss();
photosFragment.updateLayout();
}
}
} else {
Log.d("PostActivity", "Received other");
}
updateButtonStatus();
privacyButton.setVisibility(isGroupMessage == true || isEventMessage == true ? View.GONE : View.VISIBLE);
}
if (KlyphData.getFriendLists() == null) {
new AsyncRequest(Query.FRIEND_LISTS, "", "", new Callback() {
@Override
public void onComplete(Response response) {
onRequestComplete(response);
}
}).execute();
}
}
use of android.widget.ImageButton in project Klyph by jonathangerbaud.
the class PostPhotosActivity method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
photoUris = new ArrayList<String>();
setTitle(R.string.publish_new_photos);
messageTextView = (TextView) findViewById(R.id.message_textview);
friendsTextView = (TextView) findViewById(R.id.friends_textview);
placeTextView = (TextView) findViewById(R.id.place_textview);
photosFragment = (PostPhotos) getFragmentManager().findFragmentById(R.id.photos_fragment);
albumsFragment = (AlbumSpinner) getFragmentManager().findFragmentById(R.id.albums_fragment);
albumsFragment.setDefaultAlbumId(getIntent().getExtras().getString(KlyphBundleExtras.ALBUM_ID));
albumsFragment.setOnSelectionChangeListener(this);
getFragmentManager().beginTransaction().hide(photosFragment).commit();
ImageButton placeDeleteButton = (ImageButton) findViewById(R.id.place_delete_button);
ImageButton friendsDeleteButton = (ImageButton) findViewById(R.id.friends_delete_button);
friendsButton = (ImageButton) findViewById(R.id.friends_button);
ImageButton add = (ImageButton) findViewById(R.id.add_button);
ImageButton place = (ImageButton) findViewById(R.id.place_button);
privacyButton = (ImageButton) findViewById(R.id.privacy_button);
privacyButton.setEnabled(false);
placeDeleteButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
clearPlace();
}
});
friendsDeleteButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
clearFriends();
}
});
friendsButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(PostPhotosActivity.this, FriendPickerActivity.class);
if (friends != null && friends.size() > 0) {
ArrayList<String> ids = new ArrayList<String>();
ids.addAll(friends.keySet());
intent.putStringArrayListExtra(KlyphBundleExtras.FRIEND_PICKER_IDS, ids);
}
startActivityForResult(intent, FRIEND_PICKER);
}
});
add.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
startGallery();
}
});
place.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
startActivityForResult(new Intent(PostPhotosActivity.this, PlacePickerActivity.class), PLACE_PICKER);
}
});
setPrivacyListenerApi11();
setPrivacy(KlyphPreferences.getPrivacy());
if (KlyphData.getFriendLists() == null) {
new AsyncRequest(Query.FRIEND_LISTS, "", "", new Callback() {
@Override
public void onComplete(Response response) {
onRequestComplete(response);
}
}).execute();
}
}
use of android.widget.ImageButton in project QuickReturn by lawloretienne.
the class QuickReturnFacebookActivity method onCreate.
// endregion
// region Lifecycle Methods
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_quick_return_facebook);
ButterKnife.bind(this);
mSectionsPagerAdapter = new SectionsPagerAdapter(getFragmentManager());
// Set up the ViewPager with the sections adapter.
mViewPager.setAdapter(mSectionsPagerAdapter);
mTabs.setAllCaps(false);
mTabs.setShouldExpand(true);
// mTabs.setTextSize(QuickReturnUtils.dp2px(this, 16));
// mTabs.setTabBackground(R.drawable.selector_bg_tab);
mTabs.setIndicatorColorResource(R.color.dark_slate_blue);
mTabs.setIndicatorHeight(QuickReturnUtils.dp2px(this, 6));
mTabs.setDividerColor(getResources().getColor(android.R.color.transparent));
mTabs.setUnderlineHeight(QuickReturnUtils.dp2px(this, 0));
// mTabs.setBackgroundColor(getResources().getColor(R.color.indigo));
mTabs.setOnPageChangeListener(mTabsOnPageChangeListener);
mTabs.setViewPager(mViewPager);
// Set first tab selected
mTabsLinearLayout = ((LinearLayout) mTabs.getChildAt(0));
ImageButton ib = (ImageButton) mTabsLinearLayout.getChildAt(0);
ib.setImageResource(R.drawable.ic_action_news_highlighted);
}
use of android.widget.ImageButton in project sharelock-android by auth0.
the class AboutActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_about);
ImageButton newButton = (ImageButton) findViewById(R.id.about_new_button);
newButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
startNewSecretActivity();
}
});
final Toolbar toolbar = (Toolbar) findViewById(R.id.about_toolbar);
setSupportActionBar(toolbar);
mFlexibleSpaceImageHeight = getResources().getDimensionPixelSize(R.dimen.about_flexible_space_height);
mActionBarSize = getActionBarSize();
// Even when the top gap has began to change, header bar still can move
// within mIntersectionHeight.
mIntersectionHeight = getResources().getDimensionPixelSize(R.dimen.about_intersection_height);
mHeader = findViewById(R.id.about_header);
mHeaderBar = findViewById(R.id.about_header_bar);
mHeaderBackground = findViewById(R.id.about_header_background);
final ObservableScrollView scrollable = createScrollable();
final TextView subtitleText = (TextView) findViewById(R.id.about_subtitle);
subtitleText.setText(getString(R.string.about_subtitle));
setTitle(null);
ScrollUtils.addOnGlobalLayoutListener((View) scrollable, new Runnable() {
@Override
public void run() {
mReady = true;
updateViews(scrollable.getCurrentScrollY(), false);
}
});
TextView aboutText = (TextView) findViewById(R.id.container);
aboutText.setText(Html.fromHtml(getString(R.string.sharelock_about)));
}
Aggregations