47 lines
1.5 KiB
Java
47 lines
1.5 KiB
Java
package com.gh.gamecenter;
|
|
|
|
import android.os.Bundle;
|
|
import android.support.v7.widget.LinearLayoutManager;
|
|
import android.support.v7.widget.RecyclerView;
|
|
import android.view.View;
|
|
|
|
import com.gh.base.BaseActivity;
|
|
import com.gh.gamecenter.adapter.CommentDetailAdapter;
|
|
|
|
import butterknife.BindView;
|
|
|
|
/**
|
|
* Created by khy on 2017/3/22.
|
|
*/
|
|
public class CommentDetailActivity extends BaseActivity {
|
|
|
|
@BindView(R.id.comment_detail_rv) RecyclerView mRecyclerView;
|
|
|
|
private CommentDetailAdapter mAdapter;
|
|
private LinearLayoutManager mLayoutManager;
|
|
|
|
@Override
|
|
protected void onCreate(Bundle savedInstanceState) {
|
|
super.onCreate(savedInstanceState);
|
|
View view = View.inflate(this, R.layout.activity_comment_detail, null);
|
|
init(view, "查看对话");
|
|
|
|
String commentId = getIntent().getExtras().getString("commentId");
|
|
|
|
mAdapter = new CommentDetailAdapter(this, commentId);
|
|
mLayoutManager = new LinearLayoutManager(this);
|
|
mRecyclerView.setLayoutManager(mLayoutManager);
|
|
mRecyclerView.setAdapter(mAdapter);
|
|
|
|
mRecyclerView.setOnScrollListener(new RecyclerView.OnScrollListener() {
|
|
@Override
|
|
public void onScrollStateChanged(RecyclerView recyclerView, int newState) {
|
|
super.onScrollStateChanged(recyclerView, newState);
|
|
if (newState == RecyclerView.SCROLL_STATE_IDLE && !mAdapter.isOver() && !mAdapter.isLoading()) {
|
|
mAdapter.loadData(mAdapter.getItemCount());
|
|
}
|
|
}
|
|
});
|
|
}
|
|
}
|