Skip to content

Commit dbd1002

Browse files
committed
评论列表独立一个Activity
1 parent f96ffd4 commit dbd1002

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
package com.rae.cnblogs.activity;
2+
3+
import android.os.Bundle;
4+
import android.support.annotation.Nullable;
5+
import android.view.View;
6+
7+
import com.rae.cnblogs.R;
8+
import com.rae.cnblogs.fragment.BlogCommentFragment;
9+
import com.rae.cnblogs.sdk.bean.BlogBean;
10+
import com.rae.cnblogs.sdk.bean.BlogType;
11+
12+
/**
13+
* 评论
14+
* Created by ChenRui on 2017/10/21 0021 2:54.
15+
*/
16+
public class CommentActivity extends SwipeBackBaseActivity {
17+
18+
private BlogCommentFragment fragment;
19+
20+
@Override
21+
protected void onCreate(@Nullable Bundle savedInstanceState) {
22+
super.onCreate(savedInstanceState);
23+
setContentView(R.layout.activity_single_fragment);
24+
showHomeAsUp();
25+
mToolBar.setOnClickListener(new View.OnClickListener() {
26+
@Override
27+
public void onClick(View v) {
28+
fragment.scrollToTop();
29+
}
30+
});
31+
fragment = BlogCommentFragment.newInstance((BlogBean) getIntent().getParcelableExtra("blog"), BlogType.typeOf(getIntent().getStringExtra("type")));
32+
getSupportFragmentManager().beginTransaction()
33+
.add(R.id.content, fragment)
34+
.commit();
35+
}
36+
}

0 commit comments

Comments
 (0)