use of android.widget.ScrollView in project HumaneApp by Ganesh1010.
the class UserProfileActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_user_profile);
toolbar = (Toolbar) findViewById(R.id.toolbar_user_profile);
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setTitle("");
// Back Arrow
final Drawable upArrow = ContextCompat.getDrawable(this, R.drawable.abc_ic_ab_back_material);
upArrow.setColorFilter(ContextCompat.getColor(this, R.color.colorTextIcons), PorterDuff.Mode.SRC_ATOP);
getSupportActionBar().setHomeAsUpIndicator(upArrow);
toolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
onBackPressed();
}
});
// Focusing up the page
scrollView = ((ScrollView) findViewById(R.id.scrollview_user_profile));
scrollView.post(new Runnable() {
@Override
public void run() {
scrollView.fullScroll(ScrollView.FOCUS_UP);
}
});
// Edit button functionality
editImageButton = (CircleImageView) findViewById(R.id.edit_imagebutton_user_profile);
editImageButton.setOnClickListener(UserProfileActivity.this);
// My Organisation Button
myOrgButton = (Button) findViewById(R.id.my_org_button_edit_profile);
myOrgButton.setOnClickListener(UserProfileActivity.this);
}
use of android.widget.ScrollView in project WordPress-Android by wordpress-mobile.
the class CommentDetailFragment method showComment.
/*
* display the current comment
*/
private void showComment() {
if (!isAdded() || getView() == null)
return;
// these two views contain all the other views except the progress bar
final ScrollView scrollView = (ScrollView) getView().findViewById(R.id.scroll_view);
final View layoutBottom = getView().findViewById(R.id.layout_bottom);
// hide container views when comment is null (will happen when opened from a notification)
if (mComment == null) {
scrollView.setVisibility(View.GONE);
layoutBottom.setVisibility(View.GONE);
if (mNote != null) {
SiteModel site = mSiteStore.getSiteBySiteId(mNote.getSiteId());
if (site == null) {
ToastUtils.showToast(getActivity(), R.string.error_load_comment);
return;
}
// Check if the comment is already in our store
CommentModel comment = mCommentStore.getCommentBySiteAndRemoteId(site, mNote.getCommentId());
if (comment != null) {
// It exists, then show it as a "Notification"
showCommentAsNotification(mNote, site, comment);
} else {
// It's not in our store yet, request it.
RemoteCommentPayload payload = new RemoteCommentPayload(site, mNote.getCommentId());
mDispatcher.dispatch(CommentActionBuilder.newFetchCommentAction(payload));
setProgressVisible(true);
// Show a "temporary" comment built from the note data, the view will be refreshed once the
// comment has been fetched.
showCommentAsNotification(mNote, site, null);
}
}
return;
}
scrollView.setVisibility(View.VISIBLE);
layoutBottom.setVisibility(View.VISIBLE);
// Add action buttons footer
if (mNote == null && mLayoutButtons.getParent() == null) {
mCommentContentLayout.addView(mLayoutButtons);
}
final WPNetworkImageView imgAvatar = (WPNetworkImageView) getView().findViewById(R.id.image_avatar);
final TextView txtName = (TextView) getView().findViewById(R.id.text_name);
final TextView txtDate = (TextView) getView().findViewById(R.id.text_date);
txtName.setText(mComment.getAuthorName() == null ? getString(R.string.anonymous) : HtmlUtils.fastUnescapeHtml(mComment.getAuthorName()));
txtDate.setText(DateTimeUtils.javaDateToTimeSpan(DateTimeUtils.dateFromIso8601(mComment.getDatePublished()), WordPress.getContext()));
int maxImageSz = getResources().getDimensionPixelSize(R.dimen.reader_comment_max_image_size);
CommentUtils.displayHtmlComment(mTxtContent, mComment.getContent(), maxImageSz, mImageLoader);
int avatarSz = getResources().getDimensionPixelSize(R.dimen.avatar_sz_large);
if (mComment.getAuthorProfileImageUrl() != null) {
imgAvatar.setImageUrl(GravatarUtils.fixGravatarUrl(mComment.getAuthorProfileImageUrl(), avatarSz), WPNetworkImageView.ImageType.AVATAR);
} else if (mComment.getAuthorEmail() != null) {
String avatarUrl = GravatarUtils.gravatarFromEmail(mComment.getAuthorEmail(), avatarSz);
imgAvatar.setImageUrl(avatarUrl, WPNetworkImageView.ImageType.AVATAR);
} else {
imgAvatar.setImageUrl(null, WPNetworkImageView.ImageType.AVATAR);
}
updateStatusViews();
// navigate to author's blog when avatar or name clicked
if (mComment.getAuthorUrl() != null) {
View.OnClickListener authorListener = new View.OnClickListener() {
@Override
public void onClick(View v) {
ReaderActivityLauncher.openUrl(getActivity(), mComment.getAuthorUrl());
}
};
imgAvatar.setOnClickListener(authorListener);
txtName.setOnClickListener(authorListener);
txtName.setTextColor(ContextCompat.getColor(getActivity(), R.color.reader_hyperlink));
} else {
txtName.setTextColor(ContextCompat.getColor(getActivity(), R.color.grey_darken_30));
}
showPostTitle(mSite, mComment.getRemotePostId());
// make sure reply box is showing
if (mLayoutReply.getVisibility() != View.VISIBLE && canReply()) {
AniUtils.animateBottomBar(mLayoutReply, true);
if (mEditReply != null && mShouldFocusReplyField) {
mEditReply.performClick();
disableShouldFocusReplyField();
}
}
getFragmentManager().invalidateOptionsMenu();
}
use of android.widget.ScrollView in project WordPress-Android by wordpress-mobile.
the class MySiteFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
final ViewGroup rootView = (ViewGroup) inflater.inflate(R.layout.my_site_fragment, container, false);
int fabHeight = getResources().getDimensionPixelSize(android.support.design.R.dimen.design_fab_size_normal);
int fabMargin = getResources().getDimensionPixelSize(R.dimen.fab_margin);
mFabTargetYTranslation = (fabHeight + fabMargin) * 2;
mBlavatarSz = getResources().getDimensionPixelSize(R.dimen.blavatar_sz_small);
mBlavatarImageView = (WPNetworkImageView) rootView.findViewById(R.id.my_site_blavatar);
mBlogTitleTextView = (WPTextView) rootView.findViewById(R.id.my_site_title_label);
mBlogSubtitleTextView = (WPTextView) rootView.findViewById(R.id.my_site_subtitle_label);
mLookAndFeelHeader = (LinearLayout) rootView.findViewById(R.id.my_site_look_and_feel_header);
mThemesContainer = (RelativeLayout) rootView.findViewById(R.id.row_themes);
mPeopleView = (RelativeLayout) rootView.findViewById(R.id.row_people);
mPlanContainer = (RelativeLayout) rootView.findViewById(R.id.row_plan);
mConfigurationHeader = rootView.findViewById(R.id.row_configuration);
mSettingsView = rootView.findViewById(R.id.row_settings);
mAdminView = (RelativeLayout) rootView.findViewById(R.id.row_admin);
mScrollView = (ScrollView) rootView.findViewById(R.id.scroll_view);
mNoSiteView = (LinearLayout) rootView.findViewById(R.id.no_site_view);
mNoSiteDrakeImageView = (ImageView) rootView.findViewById(R.id.my_site_no_site_view_drake);
mFabView = rootView.findViewById(R.id.fab_button);
mCurrentPlanNameTextView = (WPTextView) rootView.findViewById(R.id.my_site_current_plan_text_view);
mPageView = (RelativeLayout) rootView.findViewById(R.id.row_pages);
// hide the FAB the first time the fragment is created in order to animate it in onResume()
if (savedInstanceState == null) {
mFabView.setVisibility(View.INVISIBLE);
}
mFabView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
ActivityLauncher.addNewPostOrPageForResult(getActivity(), getSelectedSite(), false);
}
});
rootView.findViewById(R.id.switch_site).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
showSitePicker();
}
});
rootView.findViewById(R.id.row_view_site).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
ActivityLauncher.viewCurrentSite(getActivity(), getSelectedSite());
}
});
rootView.findViewById(R.id.row_stats).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
ActivityLauncher.viewBlogStats(getActivity(), getSelectedSite());
}
});
mPlanContainer.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
ActivityLauncher.viewBlogPlans(getActivity(), getSelectedSite());
}
});
rootView.findViewById(R.id.row_blog_posts).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
ActivityLauncher.viewCurrentBlogPosts(getActivity(), getSelectedSite());
}
});
rootView.findViewById(R.id.row_media).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
ActivityLauncher.viewCurrentBlogMedia(getActivity(), getSelectedSite());
}
});
rootView.findViewById(R.id.row_pages).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
ActivityLauncher.viewCurrentBlogPages(getActivity(), getSelectedSite());
}
});
rootView.findViewById(R.id.row_comments).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
ActivityLauncher.viewCurrentBlogComments(getActivity(), getSelectedSite());
}
});
mThemesContainer.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
ActivityLauncher.viewCurrentBlogThemes(getActivity(), getSelectedSite());
}
});
mPeopleView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
ActivityLauncher.viewCurrentBlogPeople(getActivity(), getSelectedSite());
}
});
mSettingsView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
ActivityLauncher.viewBlogSettingsForResult(getActivity(), getSelectedSite());
}
});
rootView.findViewById(R.id.row_admin).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
ActivityLauncher.viewBlogAdmin(getActivity(), getSelectedSite());
}
});
rootView.findViewById(R.id.my_site_add_site_btn).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
SitePickerActivity.addSite(getActivity(), mAccountStore.hasAccessToken());
}
});
return rootView;
}
use of android.widget.ScrollView in project WordPress-Android by wordpress-mobile.
the class MediaGallerySettingsFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
mAllowCheckChanged = true;
mType = GalleryType.DEFAULT;
mNumColumns = DEFAULT_THUMBNAIL_COLUMN_COUNT;
mIsRandomOrder = false;
restoreState(savedInstanceState);
View view = inflater.inflate(R.layout.media_gallery_settings_fragment, container, false);
mHeader = view.findViewById(R.id.media_gallery_settings_header);
mScrollView = (ScrollView) view.findViewById(R.id.media_gallery_settings_content_container);
mTitleView = (TextView) view.findViewById(R.id.media_gallery_settings_title);
mNumColumnsContainer = view.findViewById(R.id.media_gallery_settings_num_columns_container);
int visible = (mType == GalleryType.DEFAULT) ? View.VISIBLE : View.GONE;
mNumColumnsContainer.setVisibility(visible);
ExpandableHeightGridView numColumnsGrid = (ExpandableHeightGridView) view.findViewById(R.id.media_gallery_num_columns_grid);
numColumnsGrid.setExpanded(true);
ArrayList<String> list = new ArrayList<String>(9);
for (int i = 1; i <= 9; i++) {
list.add(i + "");
}
mGridAdapter = new CustomGridAdapter(mNumColumns);
numColumnsGrid.setAdapter(mGridAdapter);
mThumbnailCheckbox = (CheckBox) view.findViewById(R.id.media_gallery_type_thumbnail_grid);
mTiledCheckbox = (CheckBox) view.findViewById(R.id.media_gallery_type_tiled);
mSquaresCheckbox = (CheckBox) view.findViewById(R.id.media_gallery_type_squares);
mCirclesCheckbox = (CheckBox) view.findViewById(R.id.media_gallery_type_circles);
mSlideshowCheckbox = (CheckBox) view.findViewById(R.id.media_gallery_type_slideshow);
setType(mType.getTag());
mThumbnailCheckbox.setOnCheckedChangeListener(this);
mTiledCheckbox.setOnCheckedChangeListener(this);
mSquaresCheckbox.setOnCheckedChangeListener(this);
mCirclesCheckbox.setOnCheckedChangeListener(this);
mSlideshowCheckbox.setOnCheckedChangeListener(this);
mRandomOrderCheckbox = (CheckBox) view.findViewById(R.id.media_gallery_random_checkbox);
mRandomOrderCheckbox.setChecked(mIsRandomOrder);
mRandomOrderCheckbox.setOnCheckedChangeListener(this);
Button reverseButton = (Button) view.findViewById(R.id.media_gallery_settings_reverse_button);
reverseButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
mCallback.onReverseClicked();
}
});
return view;
}
use of android.widget.ScrollView in project WordPress-Android by wordpress-mobile.
the class NotificationsSettingsDialogPreference method onCreateDialogView.
@Override
protected View onCreateDialogView() {
ScrollView outerView = new ScrollView(getContext());
outerView.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT));
LinearLayout innerView = new LinearLayout(getContext());
innerView.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT));
innerView.setOrientation(LinearLayout.VERTICAL);
View spacerView = new View(getContext());
int spacerHeight = getContext().getResources().getDimensionPixelSize(R.dimen.margin_medium);
spacerView.setLayoutParams(new ViewGroup.LayoutParams(ActionBar.LayoutParams.MATCH_PARENT, spacerHeight));
innerView.addView(spacerView);
outerView.addView(innerView);
configureLayoutForView(innerView);
return outerView;
}
Aggregations