Search in sources :

Example 66 with ProgressBar

use of android.widget.ProgressBar in project WordPress-Android by wordpress-mobile.

the class CommentDetailFragment method submitReply.

/*
     * post comment box text as a reply to the current comment
     */
private void submitReply() {
    if (mComment == null || !isAdded() || mIsSubmittingReply)
        return;
    if (!NetworkUtils.checkConnection(getActivity()))
        return;
    final String replyText = EditTextUtils.getText(mEditReply);
    if (TextUtils.isEmpty(replyText))
        return;
    // disable editor, hide soft keyboard, hide submit icon, and show progress spinner while submitting
    mEditReply.setEnabled(false);
    EditTextUtils.hideSoftInput(mEditReply);
    mSubmitReplyBtn.setVisibility(View.GONE);
    final ProgressBar progress = (ProgressBar) getView().findViewById(R.id.progress_submit_comment);
    progress.setVisibility(View.VISIBLE);
    mIsSubmittingReply = true;
    AnalyticsTracker.track(AnalyticsTracker.Stat.NOTIFICATION_REPLIED_TO);
    // Pseudo comment reply
    CommentModel reply = new CommentModel();
    reply.setContent(replyText);
    mDispatcher.dispatch(CommentActionBuilder.newCreateNewCommentAction(new RemoteCreateCommentPayload(mSite, mComment, reply)));
}
Also used : RemoteCreateCommentPayload(org.wordpress.android.fluxc.store.CommentStore.RemoteCreateCommentPayload) ProgressBar(android.widget.ProgressBar) CommentModel(org.wordpress.android.fluxc.model.CommentModel)

Example 67 with ProgressBar

use of android.widget.ProgressBar in project WordPress-Android by wordpress-mobile.

the class PlansActivity method hideProgress.

private void hideProgress() {
    final ProgressBar progress = (ProgressBar) findViewById(R.id.progress_loading_plans);
    progress.setVisibility(View.GONE);
}
Also used : ProgressBar(android.widget.ProgressBar)

Example 68 with ProgressBar

use of android.widget.ProgressBar 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 69 with ProgressBar

use of android.widget.ProgressBar in project WordPress-Android by wordpress-mobile.

the class ReaderPostDetailFragment method onEventMainThread.

/*
     * post slugs resolution to IDs has completed
     */
@SuppressWarnings("unused")
public void onEventMainThread(ReaderEvents.PostSlugsRequestCompleted event) {
    mPostSlugsResolutionUnderway = false;
    if (!isAdded())
        return;
    final ProgressBar progress = (ProgressBar) getView().findViewById(R.id.progress_loading);
    progress.setVisibility(View.GONE);
    if (event.getStatusCode() == 200) {
        replacePost(event.getBlogId(), event.getPostId(), false);
    } else {
        onRequestFailure(event.getStatusCode());
    }
}
Also used : ProgressBar(android.widget.ProgressBar)

Example 70 with ProgressBar

use of android.widget.ProgressBar in project base-adapter-helper by JoanZapata.

the class BaseQuickAdapter method createIndeterminateProgressView.

private View createIndeterminateProgressView(View convertView, ViewGroup parent) {
    if (convertView == null) {
        FrameLayout container = new FrameLayout(context);
        container.setForegroundGravity(Gravity.CENTER);
        ProgressBar progress = new ProgressBar(context);
        container.addView(progress);
        convertView = container;
    }
    return convertView;
}
Also used : FrameLayout(android.widget.FrameLayout) ProgressBar(android.widget.ProgressBar)

Aggregations

ProgressBar (android.widget.ProgressBar)193 TextView (android.widget.TextView)66 View (android.view.View)63 ImageView (android.widget.ImageView)41 LinearLayout (android.widget.LinearLayout)30 Context (android.content.Context)18 ViewGroup (android.view.ViewGroup)16 WindowManager (android.view.WindowManager)14 FrameLayout (android.widget.FrameLayout)14 Drawable (android.graphics.drawable.Drawable)13 Dialog (android.app.Dialog)12 Button (android.widget.Button)12 RelativeLayout (android.widget.RelativeLayout)12 LayoutInflater (android.view.LayoutInflater)11 SuppressLint (android.annotation.SuppressLint)10 LayoutParams (android.widget.LinearLayout.LayoutParams)9 Intent (android.content.Intent)8 LayoutParams (android.view.ViewGroup.LayoutParams)8 AlertDialog (android.app.AlertDialog)7 TypedArray (android.content.res.TypedArray)7