├── app ├── .gitignore ├── src │ └── main │ │ ├── res │ │ ├── values │ │ │ ├── dimens.xml │ │ │ ├── colors.xml │ │ │ ├── strings.xml │ │ │ └── styles.xml │ │ ├── drawable-hdpi │ │ │ └── ic_post.png │ │ ├── drawable-mdpi │ │ │ └── ic_post.png │ │ ├── drawable-xhdpi │ │ │ └── ic_post.png │ │ ├── drawable-xxhdpi │ │ │ └── ic_post.png │ │ ├── mipmap-hdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ ├── mipmap-mdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ ├── mipmap-xhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ ├── layout │ │ │ ├── content_main.xml │ │ │ ├── dialog_register.xml │ │ │ ├── activity_user_info.xml │ │ │ ├── activity_main.xml │ │ │ └── activity_login.xml │ │ └── menu │ │ │ └── menu_main.xml │ │ ├── java │ │ └── bmob │ │ │ └── yellowdoing │ │ │ └── com │ │ │ └── bmobcommunity │ │ │ ├── User.java │ │ │ ├── MyComment.java │ │ │ ├── MyCommunity.java │ │ │ ├── LoginActivity.java │ │ │ ├── UserInfoActivity.java │ │ │ └── MainActivity.java │ │ └── AndroidManifest.xml ├── build.gradle └── proguard-rules.pro ├── settings.gradle ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── communityUI ├── src │ └── main │ │ ├── res │ │ ├── drawable-hdpi │ │ │ ├── ic_zan.png │ │ │ ├── ic_back.png │ │ │ ├── ic_reply.png │ │ │ ├── ic_add_picture.png │ │ │ └── ic_zan_hover.png │ │ ├── drawable-mdpi │ │ │ ├── ic_zan.png │ │ │ ├── ic_back.png │ │ │ ├── ic_reply.png │ │ │ ├── ic_add_picture.png │ │ │ ├── ic_zan_hover.png │ │ │ ├── edit_text_cursor.xml │ │ │ ├── text_item_reply.xml │ │ │ └── edit_style.xml │ │ ├── drawable-xhdpi │ │ │ ├── ic_back.png │ │ │ ├── ic_reply.png │ │ │ ├── ic_zan.png │ │ │ ├── ic_zan_hover.png │ │ │ └── ic_add_picture.png │ │ ├── drawable-xxhdpi │ │ │ ├── ic_back.png │ │ │ ├── ic_zan.png │ │ │ ├── ic_reply.png │ │ │ ├── ic_zan_hover.png │ │ │ ├── ic_add_picture.png │ │ │ └── hospital_bitmap.png │ │ ├── drawable │ │ │ ├── zan_style.xml │ │ │ └── zan_style_2.xml │ │ ├── layout │ │ │ ├── list_item_image.xml │ │ │ ├── list_item_more.xml │ │ │ ├── fragment_communicty.xml │ │ │ ├── list_item_child_reply_2.xml │ │ │ ├── list_item_child_reply.xml │ │ │ ├── reply_layout.xml │ │ │ ├── list_item_reply.xml │ │ │ ├── activity_post.xml │ │ │ ├── list_item_community.xml │ │ │ ├── activity_comment_detail.xml │ │ │ └── activity_community_detail.xml │ │ └── values │ │ │ └── values.xml │ │ ├── AndroidManifest.xml │ │ └── java │ │ └── hg │ │ └── yellowdoing │ │ └── communityui │ │ ├── MyListView.java │ │ ├── CommunityInterface.java │ │ ├── ChildReplyAdapter2.java │ │ ├── Community.java │ │ ├── ChildReplyAdapter.java │ │ ├── PostActivity.java │ │ ├── ImageAdapter.java │ │ ├── CommunityFragment.java │ │ ├── Comment.java │ │ ├── ImageSelectAdapter.java │ │ ├── CommentDetailActivity.java │ │ ├── CommentAdapter.java │ │ ├── CommunityAdapter.java │ │ ├── CommunityDetialActivity.java │ │ └── CircleImageView.java ├── build.gradle ├── proguard-rules.pro ├── gradlew.bat └── gradlew ├── .gitignore ├── .idea ├── modules.xml ├── runConfigurations.xml ├── gradle.xml └── misc.xml ├── gradle.properties ├── README.md ├── gradlew.bat └── gradlew /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app', ':communityUI' 2 | -------------------------------------------------------------------------------- /app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 16dp 3 | 4 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowDoing/communityUI/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_post.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowDoing/communityUI/HEAD/app/src/main/res/drawable-hdpi/ic_post.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_post.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowDoing/communityUI/HEAD/app/src/main/res/drawable-mdpi/ic_post.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_post.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowDoing/communityUI/HEAD/app/src/main/res/drawable-xhdpi/ic_post.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_post.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowDoing/communityUI/HEAD/app/src/main/res/drawable-xxhdpi/ic_post.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowDoing/communityUI/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowDoing/communityUI/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowDoing/communityUI/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowDoing/communityUI/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowDoing/communityUI/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /communityUI/src/main/res/drawable-hdpi/ic_zan.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowDoing/communityUI/HEAD/communityUI/src/main/res/drawable-hdpi/ic_zan.png -------------------------------------------------------------------------------- /communityUI/src/main/res/drawable-mdpi/ic_zan.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowDoing/communityUI/HEAD/communityUI/src/main/res/drawable-mdpi/ic_zan.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowDoing/communityUI/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowDoing/communityUI/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowDoing/communityUI/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowDoing/communityUI/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /communityUI/src/main/res/drawable-hdpi/ic_back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowDoing/communityUI/HEAD/communityUI/src/main/res/drawable-hdpi/ic_back.png -------------------------------------------------------------------------------- /communityUI/src/main/res/drawable-hdpi/ic_reply.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowDoing/communityUI/HEAD/communityUI/src/main/res/drawable-hdpi/ic_reply.png -------------------------------------------------------------------------------- /communityUI/src/main/res/drawable-mdpi/ic_back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowDoing/communityUI/HEAD/communityUI/src/main/res/drawable-mdpi/ic_back.png -------------------------------------------------------------------------------- /communityUI/src/main/res/drawable-mdpi/ic_reply.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowDoing/communityUI/HEAD/communityUI/src/main/res/drawable-mdpi/ic_reply.png -------------------------------------------------------------------------------- /communityUI/src/main/res/drawable-xhdpi/ic_back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowDoing/communityUI/HEAD/communityUI/src/main/res/drawable-xhdpi/ic_back.png -------------------------------------------------------------------------------- /communityUI/src/main/res/drawable-xhdpi/ic_reply.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowDoing/communityUI/HEAD/communityUI/src/main/res/drawable-xhdpi/ic_reply.png -------------------------------------------------------------------------------- /communityUI/src/main/res/drawable-xhdpi/ic_zan.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowDoing/communityUI/HEAD/communityUI/src/main/res/drawable-xhdpi/ic_zan.png -------------------------------------------------------------------------------- /communityUI/src/main/res/drawable-xxhdpi/ic_back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowDoing/communityUI/HEAD/communityUI/src/main/res/drawable-xxhdpi/ic_back.png -------------------------------------------------------------------------------- /communityUI/src/main/res/drawable-xxhdpi/ic_zan.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowDoing/communityUI/HEAD/communityUI/src/main/res/drawable-xxhdpi/ic_zan.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowDoing/communityUI/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /communityUI/src/main/res/drawable-xxhdpi/ic_reply.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowDoing/communityUI/HEAD/communityUI/src/main/res/drawable-xxhdpi/ic_reply.png -------------------------------------------------------------------------------- /communityUI/src/main/res/drawable-hdpi/ic_add_picture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowDoing/communityUI/HEAD/communityUI/src/main/res/drawable-hdpi/ic_add_picture.png -------------------------------------------------------------------------------- /communityUI/src/main/res/drawable-hdpi/ic_zan_hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowDoing/communityUI/HEAD/communityUI/src/main/res/drawable-hdpi/ic_zan_hover.png -------------------------------------------------------------------------------- /communityUI/src/main/res/drawable-mdpi/ic_add_picture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowDoing/communityUI/HEAD/communityUI/src/main/res/drawable-mdpi/ic_add_picture.png -------------------------------------------------------------------------------- /communityUI/src/main/res/drawable-mdpi/ic_zan_hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowDoing/communityUI/HEAD/communityUI/src/main/res/drawable-mdpi/ic_zan_hover.png -------------------------------------------------------------------------------- /communityUI/src/main/res/drawable-xhdpi/ic_zan_hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowDoing/communityUI/HEAD/communityUI/src/main/res/drawable-xhdpi/ic_zan_hover.png -------------------------------------------------------------------------------- /communityUI/src/main/res/drawable-xxhdpi/ic_zan_hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowDoing/communityUI/HEAD/communityUI/src/main/res/drawable-xxhdpi/ic_zan_hover.png -------------------------------------------------------------------------------- /communityUI/src/main/res/drawable-xhdpi/ic_add_picture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowDoing/communityUI/HEAD/communityUI/src/main/res/drawable-xhdpi/ic_add_picture.png -------------------------------------------------------------------------------- /communityUI/src/main/res/drawable-xxhdpi/ic_add_picture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowDoing/communityUI/HEAD/communityUI/src/main/res/drawable-xxhdpi/ic_add_picture.png -------------------------------------------------------------------------------- /communityUI/src/main/res/drawable-xxhdpi/hospital_bitmap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowDoing/communityUI/HEAD/communityUI/src/main/res/drawable-xxhdpi/hospital_bitmap.png -------------------------------------------------------------------------------- /communityUI/src/main/res/drawable-mdpi/edit_text_cursor.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /communityUI/src/main/res/drawable/zan_style.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /communityUI/src/main/res/drawable-mdpi/text_item_reply.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /communityUI/src/main/res/drawable/zan_style_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Mon Dec 28 10:00:20 PST 2015 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=file:///Users/ganhuang/Downloads//gradle-4.1-all.zip -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | .externalNativeBuild 10 | .idea/vcs.xml 11 | app/libs/ 12 | app/src/main/res/drawable/ 13 | communityUI/libs/ 14 | communityUI/src/androidTest/ 15 | 16 | communityUI/src/test/ 17 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #3F51B5 4 | #303F9F 5 | #FF4081 6 | #000000 7 | #2894ff 8 | 9 | -------------------------------------------------------------------------------- /communityUI/src/main/res/drawable-mdpi/edit_style.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /communityUI/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | CommunityUI 3 | 注销/登陆 4 | 账号 5 | 密码 6 | 请输入账号 7 | 请输入密码 8 | 登陆 9 | 注册账号 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/layout/content_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | -------------------------------------------------------------------------------- /communityUI/src/main/res/layout/list_item_image.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/menu/menu_main.xml: -------------------------------------------------------------------------------- 1 | 5 | 9 | 10 | 14 | 15 | -------------------------------------------------------------------------------- /communityUI/src/main/res/layout/list_item_more.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 15 | 16 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 14 | 51 | -------------------------------------------------------------------------------- /communityUI/src/main/res/layout/list_item_reply.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 16 | 17 | 25 | 26 | 35 | 46 | 47 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## communityUI 2 | 一个可快速集成的朋友圈界面,支持评论、子评论、点赞、回复人数。 3 | 4 | ![](https://note.youdao.com/yws/api/personal/file/WEB065b58ab97645293aaa2f2287d10bea1?method=download&shareKey=eb82539165ecee4e1694a44d889405bf) ![](https://note.youdao.com/yws/api/personal/file/WEB2caef7ed89cd62aa5e048c5e22892262?method=download&shareKey=163142cec3144bf4fb135fac6c0abf87) 5 | 6 | > 建议有一个自己的后台数据库,可直接集成,示例代码用的是作者自己的简单后台 7 | 8 | #### 集成步骤 9 | 1 . 继承CommunityInterface接口,添加fragment 10 | 11 | ``` 12 | //朋友圈列表是一个fragment,需要事务添加 13 | public class MainActivity extends AppCompatActivity implements CommunityInterface { 14 | 15 | @Override 16 | protected void onCreate(Bundle savedInstanceState) { 17 | super.onCreate(savedInstanceState); 18 | setContentView(R.layout.activity_main); 19 | 20 | getSupportFragmentManager().beginTransaction() 21 | .add(R.id.container, new CommunityFragment().setCommunityInterface(this)) 22 | .commit(); 23 | } 24 | ``` 25 | 2 . 实现接口的六个方法,进行数据转换 26 | 27 | void loadCommunityList(CommunitySubsriber subsriber,int page); 28 | 29 | void comment(CommentSubsriber2 subsriber,String communityId,String parentId,String commentId,String content); 30 | 31 | void loadComments(CommentSubsriber subsriber,String communityId,int page); 32 | 33 | void like(Subsriber subsriber,String communityId); 34 | 35 | void unLike(Subsriber subsriber,String communityId); 36 | 37 | void post(Subsriber subsriber,ArrayList imagePaths,String content); 38 | 39 | 3 . 在Mainifest.xml文件添加activity声明 40 | 41 | 42 | ``` 43 | 44 | 46 | 48 | 49 | 50 | 51 | ``` 52 | 53 | 54 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 20 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 34 | 35 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /app/src/main/java/bmob/yellowdoing/com/bmobcommunity/MyCommunity.java: -------------------------------------------------------------------------------- 1 | package bmob.yellowdoing.com.bmobcommunity; 2 | 3 | import com.droi.sdk.core.DroiExpose; 4 | import com.droi.sdk.core.DroiObject; 5 | import com.droi.sdk.core.DroiObjectName; 6 | import com.droi.sdk.core.DroiReference; 7 | 8 | import java.util.ArrayList; 9 | import java.util.List; 10 | 11 | /** 12 | * Created by YellowDoing on 2017/11/18. 13 | * 14 | */ 15 | 16 | @DroiObjectName("Community") 17 | public class MyCommunity extends DroiObject { 18 | 19 | @DroiExpose 20 | private ArrayList imagePaths; 21 | @DroiExpose 22 | private String content; 23 | @DroiReference 24 | private User author; 25 | @DroiExpose 26 | private String nickName; 27 | @DroiExpose 28 | private int replyNum; 29 | @DroiExpose 30 | private List likePersons; 31 | 32 | 33 | public List getLikePersons() { 34 | return likePersons; 35 | } 36 | 37 | public void setLikePersons(List likePersons) { 38 | this.likePersons = likePersons; 39 | } 40 | 41 | public String getNickName() { 42 | return nickName; 43 | } 44 | 45 | public void setNickName(String nickName) { 46 | this.nickName = nickName; 47 | } 48 | 49 | public int getReplyNum() { 50 | return replyNum; 51 | } 52 | 53 | public void setReplyNum(int replyNum) { 54 | this.replyNum = replyNum; 55 | } 56 | 57 | public ArrayList getImagePaths() { 58 | return imagePaths; 59 | } 60 | 61 | public void setImagePaths(ArrayList imagePaths) { 62 | this.imagePaths = imagePaths; 63 | } 64 | 65 | public String getContent() { 66 | return content; 67 | } 68 | 69 | public void setContent(String content) { 70 | this.content = content; 71 | } 72 | 73 | public User getAuthor() { 74 | return author; 75 | } 76 | 77 | public void setAuthor(User author) { 78 | this.author = author; 79 | } 80 | 81 | @Override 82 | public String toString() { 83 | return "MyCommunity{" + 84 | "imagePaths=" + imagePaths + 85 | ", content='" + content + '\'' + 86 | ", author=" + author + 87 | ", nickName='" + nickName + '\'' + 88 | ", replyNum=" + replyNum + 89 | ", likePersons=" + likePersons + 90 | '}'; 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /communityUI/src/main/res/layout/activity_post.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 10 | 17 | 18 | 26 | 27 | 35 | 36 | 41 | 42 | 43 | 51 | 52 | 53 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /communityUI/src/main/java/hg/yellowdoing/communityui/ChildReplyAdapter2.java: -------------------------------------------------------------------------------- 1 | package hg.yellowdoing.communityui; 2 | 3 | import android.content.Intent; 4 | import android.view.LayoutInflater; 5 | import android.view.View; 6 | import android.view.ViewGroup; 7 | import android.widget.BaseAdapter; 8 | import android.widget.TextView; 9 | 10 | import java.util.List; 11 | 12 | /** 13 | * Created by YellowDoing on 2017/11/27. 14 | */ 15 | 16 | public class ChildReplyAdapter2 extends BaseAdapter { 17 | 18 | private List mCommentList; 19 | private CommentDetailActivity mContext; 20 | private LayoutInflater mInflater; 21 | private Comment mComment; 22 | 23 | public ChildReplyAdapter2(Comment comment, CommentDetailActivity context) { 24 | mComment = comment; 25 | mCommentList = comment.getChildComments(); 26 | mContext = context; 27 | mInflater = LayoutInflater.from(mContext); 28 | } 29 | 30 | public void add(Comment comment){ 31 | mCommentList.add(comment); 32 | notifyDataSetChanged(); 33 | } 34 | 35 | @Override 36 | public int getCount() { 37 | return mCommentList.size(); 38 | } 39 | 40 | @Override 41 | public Comment getItem(int position) { 42 | return mCommentList.get(position); 43 | } 44 | 45 | @Override 46 | public long getItemId(int position) { 47 | return 0; 48 | } 49 | 50 | @Override 51 | public View getView(int position, View convertView, ViewGroup parent) { 52 | View view = mInflater.inflate(R.layout.list_item_child_reply_2, null); 53 | 54 | final Comment comment = mCommentList.get(position); 55 | 56 | TextView tv_author_name = (TextView) view.findViewById(R.id.tv_author_name); 57 | TextView tv_reply = (TextView) view.findViewById(R.id.tv_reply); 58 | TextView tv_beReplied = (TextView) view.findViewById(R.id.tv_beReplied); 59 | TextView tv_content = (TextView) view.findViewById(R.id.tv_content); 60 | 61 | tv_content.setText(comment.getContent()); 62 | 63 | if (comment.getTheOtherNickName() != null) { 64 | tv_reply.setVisibility(View.VISIBLE); 65 | tv_beReplied.setText(comment.getTheOtherNickName() + ":"); 66 | tv_author_name.setText(comment.getNickName()); 67 | } else { 68 | tv_reply.setVisibility(View.GONE); 69 | tv_author_name.setText(comment.getNickName() + ":"); 70 | } 71 | 72 | return view; 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /communityUI/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_login.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 12 | 13 | 21 | 22 | 29 | 30 | 31 | 32 | 36 | 37 | 45 | 46 | 54 | 55 | 56 | 57 |