Search in sources :

Example 1 with ReaderRecyclerView

use of org.wordpress.android.ui.reader.views.ReaderRecyclerView in project WordPress-Android by wordpress-mobile.

the class ReaderTagFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.reader_fragment_list, container, false);
    mRecyclerView = (ReaderRecyclerView) view.findViewById(R.id.recycler_view);
    return view;
}
Also used : TextView(android.widget.TextView) ReaderRecyclerView(org.wordpress.android.ui.reader.views.ReaderRecyclerView) View(android.view.View)

Example 2 with ReaderRecyclerView

use of org.wordpress.android.ui.reader.views.ReaderRecyclerView in project WordPress-Android by wordpress-mobile.

the class ReaderUserListActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.reader_activity_userlist);
    setTitle(null);
    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    if (toolbar != null) {
        setSupportActionBar(toolbar);
        toolbar.setNavigationOnClickListener(new View.OnClickListener() {

            @Override
            public void onClick(View v) {
                onBackPressed();
            }
        });
    }
    ActionBar actionBar = getSupportActionBar();
    if (actionBar != null) {
        getSupportActionBar().setDisplayShowTitleEnabled(true);
        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    }
    if (savedInstanceState != null) {
        mRestorePosition = savedInstanceState.getInt(ReaderConstants.KEY_RESTORE_POSITION);
    }
    int spacingHorizontal = 0;
    int spacingVertical = DisplayUtils.dpToPx(this, 1);
    mRecyclerView = (ReaderRecyclerView) findViewById(R.id.recycler_view);
    mRecyclerView.addItemDecoration(new RecyclerItemDecoration(spacingHorizontal, spacingVertical));
    long blogId = getIntent().getLongExtra(ReaderConstants.ARG_BLOG_ID, 0);
    long postId = getIntent().getLongExtra(ReaderConstants.ARG_POST_ID, 0);
    long commentId = getIntent().getLongExtra(ReaderConstants.ARG_COMMENT_ID, 0);
    loadUsers(blogId, postId, commentId);
}
Also used : RecyclerItemDecoration(org.wordpress.android.widgets.RecyclerItemDecoration) ReaderRecyclerView(org.wordpress.android.ui.reader.views.ReaderRecyclerView) View(android.view.View) ActionBar(android.support.v7.app.ActionBar) Toolbar(android.support.v7.widget.Toolbar)

Example 3 with ReaderRecyclerView

use of org.wordpress.android.ui.reader.views.ReaderRecyclerView in project WordPress-Android by wordpress-mobile.

the class ReaderBlogFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.reader_fragment_list, container, false);
    mRecyclerView = (ReaderRecyclerView) view.findViewById(R.id.recycler_view);
    // options menu (with search) only appears for followed blogs
    setHasOptionsMenu(getBlogType() == ReaderBlogType.FOLLOWED);
    return view;
}
Also used : SearchView(android.support.v7.widget.SearchView) TextView(android.widget.TextView) ReaderRecyclerView(org.wordpress.android.ui.reader.views.ReaderRecyclerView) View(android.view.View)

Example 4 with ReaderRecyclerView

use of org.wordpress.android.ui.reader.views.ReaderRecyclerView in project WordPress-Android by wordpress-mobile.

the class ReaderCommentListActivity method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    ((WordPress) getApplication()).component().inject(this);
    setContentView(R.layout.reader_activity_comment_list);
    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    if (toolbar != null) {
        setSupportActionBar(toolbar);
        toolbar.setNavigationOnClickListener(new View.OnClickListener() {

            @Override
            public void onClick(View v) {
                onBackPressed();
            }
        });
    }
    ActionBar actionBar = getSupportActionBar();
    if (actionBar != null) {
        actionBar.setDisplayShowTitleEnabled(true);
        actionBar.setDisplayHomeAsUpEnabled(true);
    }
    if (savedInstanceState != null) {
        mBlogId = savedInstanceState.getLong(ReaderConstants.ARG_BLOG_ID);
        mPostId = savedInstanceState.getLong(ReaderConstants.ARG_POST_ID);
        mRestorePosition = savedInstanceState.getInt(ReaderConstants.KEY_RESTORE_POSITION);
        mHasUpdatedComments = savedInstanceState.getBoolean(KEY_HAS_UPDATED_COMMENTS);
        mInterceptedUri = savedInstanceState.getString(ReaderConstants.ARG_INTERCEPTED_URI);
    } else {
        mBlogId = getIntent().getLongExtra(ReaderConstants.ARG_BLOG_ID, 0);
        mPostId = getIntent().getLongExtra(ReaderConstants.ARG_POST_ID, 0);
        mDirectOperation = (DirectOperation) getIntent().getSerializableExtra(ReaderConstants.ARG_DIRECT_OPERATION);
        mCommentId = getIntent().getLongExtra(ReaderConstants.ARG_COMMENT_ID, 0);
        mInterceptedUri = getIntent().getStringExtra(ReaderConstants.ARG_INTERCEPTED_URI);
        // connection so we can show existing comments while offline
        if (NetworkUtils.isNetworkAvailable(this)) {
            ReaderCommentTable.purgeCommentsForPost(mBlogId, mPostId);
        }
    }
    mSwipeToRefreshHelper = new SwipeToRefreshHelper(this, (CustomSwipeRefreshLayout) findViewById(R.id.swipe_to_refresh), new SwipeToRefreshHelper.RefreshListener() {

        @Override
        public void onRefreshStarted() {
            updatePostAndComments();
        }
    });
    mRecyclerView = (ReaderRecyclerView) findViewById(R.id.recycler_view);
    int spacingHorizontal = 0;
    int spacingVertical = DisplayUtils.dpToPx(this, 1);
    mRecyclerView.addItemDecoration(new RecyclerItemDecoration(spacingHorizontal, spacingVertical));
    mCommentBox = (ViewGroup) findViewById(R.id.layout_comment_box);
    mEditComment = (SuggestionAutoCompleteText) mCommentBox.findViewById(R.id.edit_comment);
    mEditComment.getAutoSaveTextHelper().setUniqueId(String.format(Locale.US, "%d%d", mPostId, mBlogId));
    mSubmitReplyBtn = mCommentBox.findViewById(R.id.btn_submit_reply);
    if (!loadPost()) {
        ToastUtils.showToast(this, R.string.reader_toast_err_get_post);
        finish();
        return;
    }
    mRecyclerView.setAdapter(getCommentAdapter());
    if (savedInstanceState != null) {
        setReplyToCommentId(savedInstanceState.getLong(KEY_REPLY_TO_COMMENT_ID), false);
    }
    refreshComments();
    mSuggestionServiceConnectionManager = new SuggestionServiceConnectionManager(this, mBlogId);
    mSuggestionAdapter = SuggestionUtils.setupSuggestions(mBlogId, this, mSuggestionServiceConnectionManager, mPost.isWP());
    if (mSuggestionAdapter != null) {
        mEditComment.setAdapter(mSuggestionAdapter);
    }
    AnalyticsUtils.trackWithReaderPostDetails(AnalyticsTracker.Stat.READER_ARTICLE_COMMENTS_OPENED, mPost);
}
Also used : SuggestionServiceConnectionManager(org.wordpress.android.ui.suggestion.util.SuggestionServiceConnectionManager) RecyclerItemDecoration(org.wordpress.android.widgets.RecyclerItemDecoration) SwipeToRefreshHelper(org.wordpress.android.util.helpers.SwipeToRefreshHelper) View(android.view.View) TextView(android.widget.TextView) ReaderRecyclerView(org.wordpress.android.ui.reader.views.ReaderRecyclerView) ActionBar(android.support.v7.app.ActionBar) Toolbar(android.support.v7.widget.Toolbar) CustomSwipeRefreshLayout(org.wordpress.android.util.widgets.CustomSwipeRefreshLayout)

Aggregations

View (android.view.View)4 ReaderRecyclerView (org.wordpress.android.ui.reader.views.ReaderRecyclerView)4 TextView (android.widget.TextView)3 ActionBar (android.support.v7.app.ActionBar)2 Toolbar (android.support.v7.widget.Toolbar)2 RecyclerItemDecoration (org.wordpress.android.widgets.RecyclerItemDecoration)2 SearchView (android.support.v7.widget.SearchView)1 SuggestionServiceConnectionManager (org.wordpress.android.ui.suggestion.util.SuggestionServiceConnectionManager)1 SwipeToRefreshHelper (org.wordpress.android.util.helpers.SwipeToRefreshHelper)1 CustomSwipeRefreshLayout (org.wordpress.android.util.widgets.CustomSwipeRefreshLayout)1