Search in sources :

Example 6 with WPTextView

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);
}
Also used : WPTextView(org.wordpress.android.widgets.WPTextView)

Example 7 with WPTextView

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;
}
Also used : SwipeToRefreshHelper(org.wordpress.android.util.helpers.SwipeToRefreshHelper) ReaderSimplePostContainerView(org.wordpress.android.ui.reader.views.ReaderSimplePostContainerView) ReaderSimplePostView(org.wordpress.android.ui.reader.views.ReaderSimplePostView) ReaderWebView(org.wordpress.android.ui.reader.views.ReaderWebView) View(android.view.View) WebView(android.webkit.WebView) WPScrollView(org.wordpress.android.widgets.WPScrollView) ReaderPostDetailHeaderView(org.wordpress.android.ui.reader.views.ReaderPostDetailHeaderView) TextView(android.widget.TextView) WPTextView(org.wordpress.android.widgets.WPTextView) ReaderIconCountView(org.wordpress.android.ui.reader.views.ReaderIconCountView) ReaderLikingUsersView(org.wordpress.android.ui.reader.views.ReaderLikingUsersView) ProgressBar(android.widget.ProgressBar) CustomSwipeRefreshLayout(org.wordpress.android.util.widgets.CustomSwipeRefreshLayout)

Example 8 with WPTextView

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();
}
Also used : AlertDialog(android.app.AlertDialog) EditText(android.widget.EditText) DialogInterface(android.content.DialogInterface) Bundle(android.os.Bundle) WPTextView(org.wordpress.android.widgets.WPTextView) View(android.view.View) WPTextView(org.wordpress.android.widgets.WPTextView) LayoutInflater(android.view.LayoutInflater)

Example 9 with WPTextView

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);
}
Also used : WPTextView(org.wordpress.android.widgets.WPTextView) TextView(android.widget.TextView) View(android.view.View) WPTextView(org.wordpress.android.widgets.WPTextView)

Example 10 with WPTextView

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;
}
Also used : WPTextView(org.wordpress.android.widgets.WPTextView) ImageView(android.widget.ImageView) View(android.view.View) WPTextView(org.wordpress.android.widgets.WPTextView) TextView(android.widget.TextView)

Aggregations

WPTextView (org.wordpress.android.widgets.WPTextView)13 View (android.view.View)12 ImageView (android.widget.ImageView)6 TextView (android.widget.TextView)6 OnClickListener (android.view.View.OnClickListener)4 ViewGroup (android.view.ViewGroup)4 Bundle (android.os.Bundle)3 Editable (android.text.Editable)2 TextWatcher (android.text.TextWatcher)2 AlertDialog (android.app.AlertDialog)1 DialogInterface (android.content.DialogInterface)1 Intent (android.content.Intent)1 Drawable (android.graphics.drawable.Drawable)1 ActionBar (android.support.v7.app.ActionBar)1 KeyEvent (android.view.KeyEvent)1 LayoutInflater (android.view.LayoutInflater)1 WebView (android.webkit.WebView)1 Button (android.widget.Button)1 EditText (android.widget.EditText)1 ProgressBar (android.widget.ProgressBar)1