use of org.wordpress.android.widgets.WPTextView in project WordPress-Android by wordpress-mobile.
the class AboutActivity method onCreate.
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
setContentView(R.layout.about_activity);
WPTextView version = (WPTextView) findViewById(R.id.about_version);
version.setText(getString(R.string.version) + " " + WordPress.versionName);
WPTextView tos = (WPTextView) findViewById(R.id.about_tos);
tos.setOnClickListener(this);
WPTextView pp = (WPTextView) findViewById(R.id.about_privacy);
pp.setOnClickListener(this);
WPTextView publisher = (WPTextView) findViewById(R.id.about_publisher);
publisher.setText(getString(R.string.publisher) + " " + getString(R.string.automattic_inc));
WPTextView copyright = (WPTextView) findViewById(R.id.about_copyright);
copyright.setText("©" + Calendar.getInstance().get(Calendar.YEAR) + " " + getString(R.string.automattic_inc));
WPTextView about = (WPTextView) findViewById(R.id.about_url);
about.setOnClickListener(this);
}
use of org.wordpress.android.widgets.WPTextView in project WordPress-Android by wordpress-mobile.
the class ReaderPostDetailFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
final View view = inflater.inflate(R.layout.reader_fragment_post_detail, container, false);
CustomSwipeRefreshLayout swipeRefreshLayout = (CustomSwipeRefreshLayout) view.findViewById(R.id.swipe_to_refresh);
//this fragment hides/shows toolbar with scrolling, which messes up ptr animation position
//so we have to set it manually
int swipeToRefreshOffset = getResources().getDimensionPixelSize(R.dimen.toolbar_content_offset);
swipeRefreshLayout.setProgressViewOffset(false, 0, swipeToRefreshOffset);
mSwipeToRefreshHelper = new SwipeToRefreshHelper(getActivity(), swipeRefreshLayout, new SwipeToRefreshHelper.RefreshListener() {
@Override
public void onRefreshStarted() {
if (!isAdded()) {
return;
}
updatePost();
}
});
mScrollView = (WPScrollView) view.findViewById(R.id.scroll_view_reader);
mScrollView.setScrollDirectionListener(this);
mLayoutFooter = (ViewGroup) view.findViewById(R.id.layout_post_detail_footer);
mLikingUsersView = (ReaderLikingUsersView) view.findViewById(R.id.layout_liking_users_view);
mLikingUsersDivider = view.findViewById(R.id.layout_liking_users_divider);
mLikingUsersLabel = view.findViewById(R.id.text_liking_users_label);
// setup the ReaderWebView
mReaderWebView = (ReaderWebView) view.findViewById(R.id.reader_webview);
mReaderWebView.setCustomViewListener(this);
mReaderWebView.setUrlClickListener(this);
mReaderWebView.setPageFinishedListener(this);
// hide footer and scrollView until the post is loaded
mLayoutFooter.setVisibility(View.INVISIBLE);
mScrollView.setVisibility(View.INVISIBLE);
View relatedPostsContainer = view.findViewById(R.id.container_related_posts);
mGlobalRelatedPostsView = (ReaderSimplePostContainerView) relatedPostsContainer.findViewById(R.id.related_posts_view_global);
mLocalRelatedPostsView = (ReaderSimplePostContainerView) relatedPostsContainer.findViewById(R.id.related_posts_view_local);
mSignInButton = (WPTextView) view.findViewById(R.id.nux_sign_in_button);
mSignInButton.setOnClickListener(mSignInClickListener);
final ProgressBar progress = (ProgressBar) view.findViewById(R.id.progress_loading);
if (mPostSlugsResolutionUnderway) {
progress.setVisibility(View.VISIBLE);
}
showPost();
return view;
}
use of org.wordpress.android.widgets.WPTextView in project WordPress-Android by wordpress-mobile.
the class ProfileInputDialogFragment method onCreateDialog.
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
LayoutInflater layoutInflater = LayoutInflater.from(getActivity());
View promptView = layoutInflater.inflate(R.layout.my_profile_dialog, null);
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(getActivity());
alertDialogBuilder.setView(promptView);
final WPTextView textView = (WPTextView) promptView.findViewById(R.id.my_profile_dialog_label);
final EditText editText = (EditText) promptView.findViewById(R.id.my_profile_dialog_input);
final WPTextView hintView = (WPTextView) promptView.findViewById(R.id.my_profile_dialog_hint);
Bundle args = getArguments();
String title = args.getString(TITLE_TAG);
String hint = args.getString(HINT_TAG);
Boolean isMultiline = args.getBoolean(IS_MULTILINE_TAG);
String initialText = args.getString(INITIAL_TEXT_TAG);
final int callbackId = args.getInt(CALLBACK_ID_TAG);
textView.setText(title);
if (!TextUtils.isEmpty(hint)) {
hintView.setText(hint);
} else {
hintView.setVisibility(View.GONE);
}
if (!isMultiline) {
editText.setMaxLines(1);
}
if (!TextUtils.isEmpty(initialText)) {
editText.setText(initialText);
editText.setSelection(0, initialText.length());
}
alertDialogBuilder.setCancelable(true).setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
if (getTargetFragment() instanceof Callback) {
((Callback) getTargetFragment()).onSuccessfulInput(editText.getText().toString(), callbackId);
} else {
AppLog.e(AppLog.T.UTILS, "Target fragment doesn't implement ProfileInputDialogFragment.Callback");
}
}
}).setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
dialog.cancel();
}
});
return alertDialogBuilder.create();
}
use of org.wordpress.android.widgets.WPTextView in project WordPress-Android by wordpress-mobile.
the class MyProfileFragment method onSuccessfulInput.
@Override
public void onSuccessfulInput(String input, int callbackId) {
View rootView = getView();
if (rootView == null)
return;
if (!NetworkUtils.isNetworkAvailable(getActivity())) {
ToastUtils.showToast(getActivity(), R.string.error_post_my_profile_no_connection);
return;
}
WPTextView textView = (WPTextView) rootView.findViewById(callbackId);
updateLabel(textView, input);
updateMyProfileForLabel(textView);
}
use of org.wordpress.android.widgets.WPTextView in project WordPress-Android by wordpress-mobile.
the class MagicLinkRequestFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.magic_link_request_fragment, container, false);
WPTextView magicLinkButton = (WPTextView) view.findViewById(R.id.magic_button);
magicLinkButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
sendMagicLinkRequest();
}
});
mRequestEmailView = (TextView) view.findViewById(R.id.password_layout);
mRequestEmailView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mListener.onEnterPasswordRequested();
}
});
initInfoButtons(view);
return view;
}
Aggregations