Parcourir la source

Merge remote-tracking branch 'origin/master'

DESKTOP-JJ6HLMB il y a 1 an
Parent
commit
720fed1da0
25 fichiers modifiés avec 711 ajouts et 228 suppressions
  1. 47 31
      TMessagesProj/src/main/java/org/telegram/cricdit/adapter/NewsAdapter.java
  2. 19 15
      TMessagesProj/src/main/java/org/telegram/cricdit/adapter/NewsGroupAdapter.java
  3. 16 2
      TMessagesProj/src/main/java/org/telegram/cricdit/adapter/ProfileAdapter.java
  4. 0 1
      TMessagesProj/src/main/java/org/telegram/cricdit/bean/Base.java
  5. 13 0
      TMessagesProj/src/main/java/org/telegram/cricdit/bean/BaseBean.java
  6. 1 0
      TMessagesProj/src/main/java/org/telegram/cricdit/bean/NewsGroupBean.java
  7. 4 0
      TMessagesProj/src/main/java/org/telegram/cricdit/net/ApiService.java
  8. 83 35
      TMessagesProj/src/main/java/org/telegram/cricdit/ui/MeActivity.java
  9. 23 10
      TMessagesProj/src/main/java/org/telegram/cricdit/ui/NewsDetailCommentFragment.java
  10. 4 7
      TMessagesProj/src/main/java/org/telegram/cricdit/ui/NewsGroupFragment.java
  11. 3 1
      TMessagesProj/src/main/java/org/telegram/cricdit/utils/ColorUtil.java
  12. 219 0
      TMessagesProj/src/main/java/org/telegram/cricdit/utils/NumberUtils.java
  13. 56 22
      TMessagesProj/src/main/java/org/telegram/messenger/MessagesController.java
  14. 0 1
      TMessagesProj/src/main/java/org/telegram/ui/DialogsActivity.java
  15. 5 0
      TMessagesProj/src/main/res/drawable/shape_group_create_icon_bg.xml
  16. 5 0
      TMessagesProj/src/main/res/drawable/shape_me_post_bg.xml
  17. 104 25
      TMessagesProj/src/main/res/layout/activity_me3.xml
  18. 3 2
      TMessagesProj/src/main/res/layout/activity_news_detail_comment.xml
  19. 9 8
      TMessagesProj/src/main/res/layout/btn_follow.xml
  20. 38 32
      TMessagesProj/src/main/res/layout/fragment_news_group.xml
  21. 24 17
      TMessagesProj/src/main/res/layout/item_news_group.xml
  22. 5 5
      TMessagesProj/src/main/res/layout/item_news_head.xml
  23. 6 6
      TMessagesProj/src/main/res/layout/item_news_singer_img.xml
  24. 23 8
      TMessagesProj/src/main/res/layout/item_person_detail_post.xml
  25. 1 0
      TMessagesProj/src/main/res/values/string-cricdit.xml

+ 47 - 31
TMessagesProj/src/main/java/org/telegram/cricdit/adapter/NewsAdapter.java

@@ -62,6 +62,7 @@ import java.util.Arrays;
 import java.util.List;
 
 public class NewsAdapter extends RecyclerView.Adapter{
+    private final GradientDrawable followNormalBg;
     private BaseFragment fragment;
     private Context mContext;
     private List<NewsBean.NewsFeedBean> mList;
@@ -87,9 +88,15 @@ public class NewsAdapter extends RecyclerView.Adapter{
         requestOptionsCircle = new RequestOptions().transforms(new CircleCrop());
         requestOptions = new RequestOptions().transforms(new CenterCrop(), new RoundedCorners(UIUtil.dip2px(mContext, 7)));
         requestOptionsVideo = new RequestOptions().frame(3000000).centerCrop().placeholder(R.drawable.img_placeholder_single).error(R.drawable.img_placeholder_single);
-        gd = new GradientDrawable(GradientDrawable.Orientation.TOP_BOTTOM, new int[]{ColorUtil.COLOR_LINE_GRAY,ColorUtil.COLOR_LINE_GRAY});
+        gd = new GradientDrawable(GradientDrawable.Orientation.TOP_BOTTOM, new int[]{ColorUtil.COLOR_WHITE, ColorUtil.COLOR_WHITE});
         gd.setShape(GradientDrawable.RECTANGLE);
-        gd.setCornerRadius(UIUtil.dip2px(mContext, 7));
+        gd.setStroke(UIUtil.dip2px(mContext, 1),ColorUtil.COLOR_LINE_GRAY);
+        gd.setCornerRadius(UIUtil.dip2px(mContext, 15));
+
+        followNormalBg = new GradientDrawable(GradientDrawable.Orientation.TOP_BOTTOM, new int[]{ColorUtil.COLOR_BLACK, ColorUtil.COLOR_BLACK});
+        followNormalBg.setShape(GradientDrawable.RECTANGLE);
+        followNormalBg.setColor(ColorUtil.COLOR_BLACK);
+        followNormalBg.setCornerRadius(UIUtil.dip2px(mContext, 15));
     }
 
     @NonNull
@@ -173,40 +180,49 @@ public class NewsAdapter extends RecyclerView.Adapter{
                     mHolder.nineGridView.setAdapter(new MyNineGridViewAdapter(fragment, imageInfo, new ArrayList<>(Arrays.asList(splitList))));
                 }
             }
+        } else {
+            //视频
+            mHolder.rlVideo.setVisibility(View.VISIBLE);
+            Glide.with(mContext)
+                    .setDefaultRequestOptions(requestOptionsVideo)
+                    .load(bean.getVideo())
+                    .apply(requestOptions)
+                    .into(mHolder.ivVideo);
+        }
+
+        mHolder.tvFollow.setText(R.string.follow);
+        Drawable drawableLeft = mContext.getResources().getDrawable(R.drawable.icon_news_like);
+        drawableLeft.setBounds(0, 0, drawableLeft.getMinimumWidth(), drawableLeft.getMinimumHeight());
+        mHolder.tvLikeNum.setCompoundDrawables(drawableLeft, null, null, null);
+
+        if (UserConfig.getInstance(currentAccount).isClientActivated()) {
+            TLRPC.User currentUser = UserConfig.getInstance(currentAccount).getCurrentUser();
+            if (bean.getUserId().equals(currentUser.id + "")) {
+                mHolder.llFollow.setVisibility(View.GONE);
             } else {
-                //视频
-                mHolder.rlVideo.setVisibility(View.VISIBLE);
-                Glide.with(mContext)
-                        .setDefaultRequestOptions(requestOptionsVideo)
-                        .load(bean.getVideo())
-                        .apply(requestOptions)
-                        .into(mHolder.ivVideo);
+                mHolder.llFollow.setVisibility(View.VISIBLE);
+                if (bean.getIsFollow()) {
+                    mHolder.tvFollow.setTextColor(ColorUtil.COLOR_BLACK);
+                    mHolder.tvFollow.setText(R.string.following);
+                    mHolder.llFollow.setBackground(gd);
+                } else {
+                    mHolder.tvFollow.setTextColor(ColorUtil.COLOR_WHITE);
+                    mHolder.llFollow.setBackground(followNormalBg);
+                    mHolder.tvFollow.setText(R.string.follow);
+                }
             }
 
-            mHolder.tvFollow.setText(R.string.follow);
-            Drawable drawableLeft = mContext.getResources().getDrawable(R.drawable.icon_news_like);
+            if (bean.getIsLike()) {
+                drawableLeft = mContext.getResources().getDrawable(R.mipmap.icon_liked);
+            }
             drawableLeft.setBounds(0, 0, drawableLeft.getMinimumWidth(), drawableLeft.getMinimumHeight());
             mHolder.tvLikeNum.setCompoundDrawables(drawableLeft, null, null, null);
-            mHolder.llFollow.setVisibility(View.VISIBLE);
-            mHolder.ivHeart.setVisibility(View.VISIBLE);
-            mHolder.llFollow.setBackgroundResource(R.drawable.img_follow_btn);
-            if (UserConfig.getInstance(currentAccount).isClientActivated()) {
-                TLRPC.User currentUser = UserConfig.getInstance(currentAccount).getCurrentUser();
-                if (bean.getUserId().equals(currentUser.id+"")) {
-                    mHolder.llFollow.setVisibility(View.GONE);
-                } else if (bean.getIsFollow()) {
-                    mHolder.llFollow.setVisibility(View.VISIBLE);
-                    mHolder.tvFollow.setText(R.string.focus_on);
-                    mHolder.llFollow.setBackground(gd);
-                    mHolder.ivHeart.setVisibility(View.GONE);
-                }
-                if (bean.getIsLike()) {
-                    drawableLeft = mContext.getResources().getDrawable(R.mipmap.icon_liked);
-                }
-                drawableLeft.setBounds(0, 0, drawableLeft.getMinimumWidth(), drawableLeft.getMinimumHeight());
-                mHolder.tvLikeNum.setCompoundDrawables(drawableLeft, null, null, null);
-            }
-            initNormalListener(mHolder, position);
+        } else {
+            mHolder.tvFollow.setTextColor(ColorUtil.COLOR_WHITE);
+            mHolder.llFollow.setBackground(followNormalBg);
+            mHolder.tvFollow.setText(R.string.follow);
+        }
+        initNormalListener(mHolder, position);
     }
 
     private void initNormalListener(NewsAdapter.ViewHolder mHolder, int position) {

+ 19 - 15
TMessagesProj/src/main/java/org/telegram/cricdit/adapter/NewsGroupAdapter.java

@@ -1,6 +1,7 @@
 package org.telegram.cricdit.adapter;
 
 import android.content.Context;
+import android.os.Bundle;
 import android.text.TextUtils;
 import android.view.View;
 import android.view.ViewGroup;
@@ -16,9 +17,13 @@ import com.bumptech.glide.load.resource.bitmap.RoundedCorners;
 import com.bumptech.glide.request.RequestOptions;
 
 import org.telegram.cricdit.bean.NewsGroupBean;
+import org.telegram.cricdit.utils.Base64Utils;
 import org.telegram.cricdit.utils.ColorUtil;
+import org.telegram.cricdit.utils.DrawableUtil;
 import org.telegram.cricdit.utils.TimeUtils;
 import org.telegram.messenger.R;
+import org.telegram.ui.ActionBar.BaseFragment;
+import org.telegram.ui.ChatActivity;
 import org.telegram.ui.Components.AvatarsImageView;
 
 import java.text.SimpleDateFormat;
@@ -29,10 +34,12 @@ public class NewsGroupAdapter extends RecyclerView.Adapter {
 
     private Context mContext;
     private List<NewsGroupBean.GroupData> mlist;
+    private BaseFragment fragment;
 
-    public NewsGroupAdapter(Context mContext, List list) {
-        this.mContext = mContext;
+    public NewsGroupAdapter(BaseFragment fragment, List list) {
+        this.mContext = fragment.getContext();
         this.mlist = list;
+        this.fragment = fragment;
     }
 
     @Override
@@ -47,14 +54,16 @@ public class NewsGroupAdapter extends RecyclerView.Adapter {
         ViewHolder viewHolder = (ViewHolder) holder;
         NewsGroupBean.GroupData groupData = mlist.get(position);
         Glide.with(holder.itemView)
-                .load(groupData.group_image)
+                .load(Base64Utils.base64ToBitmap(groupData.group_image))
                 .placeholder(R.drawable.book_group)
                 .error(R.drawable.book_group)
                 .apply(RequestOptions.bitmapTransform(new CircleCrop()))
                 .into(viewHolder.head);
+
         viewHolder.groupName.setText(groupData.group_name);
-        viewHolder.tvContent.setText(groupData.last_sms);
-        viewHolder.groupTag.setText(TextUtils.isEmpty(groupData.last_user_name) ? "" : ("#"+groupData.last_user_name+"#"));
+//        viewHolder.tvContent.setText(groupData.last_sms);
+        viewHolder.tvContent.setText(groupData.group_members + " Members");
+//        viewHolder.groupTag.setText(TextUtils.isEmpty(groupData.last_user_name) ? "" : ("#"+groupData.last_user_name+"#"));
         String time;
         if (groupData.last_time == 0) {
             Date date = new Date();
@@ -64,16 +73,11 @@ public class NewsGroupAdapter extends RecyclerView.Adapter {
             time = TimeUtils.timeStamp2Str(Long.parseLong(groupData.last_time + "000"), "HH:mm");
         }
         viewHolder.date.setText(time);
-        viewHolder.itemView.setOnClickListener(new View.OnClickListener() {
-            @Override
-            public void onClick(View v) {
-                //跳转到对应群组聊天页
-                /*ARouter.getInstance().build(ARouterPath.PATH_CHAT_CHAT_ACTIVITY)
-                        .withString(Constant.K_GROUP_ID, groupData.group_id)
-                        .withString(Constant.K_NAME, groupData.group_name)
-                        .withString(Constant.K_MEMBERS, groupData.group_num + "")
-                        .navigation();*/
-            }
+        viewHolder.itemView.setOnClickListener(v -> {
+            //跳转到对应群组聊天页
+            Bundle args = new Bundle();
+            args.putLong("chat_id", Long.parseLong(groupData.group_id));
+            fragment.presentFragment(new ChatActivity(args));
         });
     }
 

+ 16 - 2
TMessagesProj/src/main/java/org/telegram/cricdit/adapter/ProfileAdapter.java

@@ -22,6 +22,7 @@ import org.telegram.cricdit.bean.PersonDetailBean;
 import org.telegram.cricdit.utils.Base64Utils;
 import org.telegram.cricdit.utils.ColorUtil;
 import org.telegram.cricdit.utils.DrawableUtil;
+import org.telegram.cricdit.utils.GlideUtils;
 import org.telegram.cricdit.utils.GsonHel;
 import org.telegram.cricdit.utils.StringUtils;
 import org.telegram.cricdit.utils.TimeUtils;
@@ -70,13 +71,27 @@ public class ProfileAdapter extends BaseMultiItemQuickAdapter<PersonDetailBean,
                 RoundedImageView postAvatarImg = baseViewHolder.getView(R.id.person_detail_avatar);
                 postAvatarImg.setImageBitmap(Base64Utils.base64ToBitmap(personDetailBean.personPostBean.user_avatar));
 
+               RoundedImageView roundedImageView = baseViewHolder.getView(R.id.person_detail_figure);
+
+                if (!TextUtils.isEmpty(personDetailBean.personPostBean.medium)) {
+                    roundedImageView.setVisibility(View.VISIBLE);
+
+                    if (personDetailBean.personPostBean.medium.contains(",http")) {
+                        GlideUtils.load(getContext(),personDetailBean.personPostBean.medium.split(",")[0],roundedImageView);
+                    } else{
+                        GlideUtils.load(getContext(),personDetailBean.personPostBean.medium,roundedImageView);
+                    }
+
+                } else {
+                    roundedImageView.setVisibility(View.GONE);
+                }
+
                 baseViewHolder.setText(R.id.person_detail_comment_text, personDetailBean.personPostBean.comment_num + "");
 
                 baseViewHolder.setImageDrawable(R.id.person_detail_comment_icon, DrawableUtil.resToDrawable(getContext(), R.drawable.icon_news_msg, ColorUtil.COLOR_ICON_GRAY));
 
                 baseViewHolder.setText(R.id.person_detail_likes_text, personDetailBean.personPostBean.like_num + "");
 
-
                 if (personDetailBean.personPostBean.is_like) {
                     baseViewHolder.setImageDrawable(R.id.person_detail_likes_icon, getContext().getResources().getDrawable(R.drawable.icon_liked));
                 } else {
@@ -145,7 +160,6 @@ public class ProfileAdapter extends BaseMultiItemQuickAdapter<PersonDetailBean,
 
                 RoundedImageView followerAvatarImg = baseViewHolder.getView(R.id.item_profile_following_avatar);
                 followerAvatarImg.setImageBitmap(Base64Utils.base64ToBitmap(personDetailBean.personFollowerBean.avatar));
-
                 break;
         }
     }

+ 0 - 1
TMessagesProj/src/main/java/org/telegram/cricdit/bean/Base.java

@@ -1,7 +1,6 @@
 package org.telegram.cricdit.bean;
 
 /**
- * Created by WJ on 2017/12/29.
  */
 
 public class Base<T> {

+ 13 - 0
TMessagesProj/src/main/java/org/telegram/cricdit/bean/BaseBean.java

@@ -0,0 +1,13 @@
+package org.telegram.cricdit.bean;
+
+/**
+ */
+
+public class BaseBean {
+    public int errCode;
+
+    public String errMsg;
+
+    public Object data;
+}
+

+ 1 - 0
TMessagesProj/src/main/java/org/telegram/cricdit/bean/NewsGroupBean.java

@@ -11,6 +11,7 @@ public class NewsGroupBean {
     public static class GroupData{
         public String group_id;
         public String group_image;
+        public int group_members;
         public String group_name;
         public String last_user_name;
         public long last_time;

+ 4 - 0
TMessagesProj/src/main/java/org/telegram/cricdit/net/ApiService.java

@@ -126,4 +126,8 @@ public interface ApiService {
     @POST(Constants.APP_AUTH_URL + "/demo/upload")
     Observable<BaseResponse<String>> uploadFile(@Part MultipartBody.Part body);
 
+    //创建群组
+    @POST(Constants.APP_AUTH_URL + "/demo/create_group")
+    Call<ResponseBody> createGroup(@Body RequestBody requestBody);
+
 }

+ 83 - 35
TMessagesProj/src/main/java/org/telegram/cricdit/ui/MeActivity.java

@@ -12,6 +12,7 @@ import android.os.Bundle;
 import android.provider.Settings;
 import android.text.TextUtils;
 import android.view.View;
+import android.view.ViewTreeObserver;
 import android.widget.FrameLayout;
 import android.widget.ImageView;
 import android.widget.LinearLayout;
@@ -24,6 +25,7 @@ import com.google.android.exoplayer2.SimpleExoPlayer;
 import com.google.android.material.appbar.AppBarLayout;
 import com.google.android.material.appbar.CollapsingToolbarLayout;
 import com.google.android.material.snackbar.Snackbar;
+import com.luck.picture.lib.utils.BitmapUtils;
 import com.makeramen.roundedimageview.RoundedImageView;
 
 import org.telegram.cricdit.base.BaseTabActivity;
@@ -32,6 +34,8 @@ import org.telegram.cricdit.config.Constants;
 import org.telegram.cricdit.utils.AppInfoUtils;
 import org.telegram.cricdit.utils.Base64Utils;
 import org.telegram.cricdit.utils.ColorUtil;
+import org.telegram.cricdit.utils.DrawableUtil;
+import org.telegram.cricdit.utils.NumberUtils;
 import org.telegram.cricdit.view.CommonItemView;
 import org.telegram.cricdit.view.RoundImageView;
 import org.telegram.messenger.AndroidUtilities;
@@ -68,12 +72,13 @@ public class MeActivity extends BaseTabActivity {
     private ImageView mIvProfile;
     private ImageView mIvAvatar;
     private FrameLayout mAvatarContainer;
-//    private RoundedImageView mAvatarImg;
+    private RoundedImageView mAvatarImg;
+    private float mHeightOffset;
 
 
     @Override
     protected int getLayoutResId() {
-        return R.layout.activity_me;
+        return R.layout.activity_me3;
     }
 
     @Override
@@ -90,53 +95,61 @@ public class MeActivity extends BaseTabActivity {
     protected void initView(View view) {
         TextView nickname = view.findViewById(R.id.me_tv_nickname);
         TextView username = view.findViewById(R.id.me_tv_username);
-//        ImageView avatar = view.findViewById(R.id.me_tv_avatar);
 
         mAvatarContainer = view.findViewById(R.id.me_fl_avatar_container);
-//        LinearLayout homePageContainer = view.findViewById(R.id.me_homepage_container);
+        LinearLayout homePageContainer = view.findViewById(R.id.me_homepage_container);
         LinearLayout profileContainer = view.findViewById(R.id.me_tv_profile_container);
 //        homePageContainer.setBackgroundColor(ColorUtil.COLOR_BLUE);
+        homePageContainer.setBackgroundColor(ColorUtil.COLOR_WHITE);
 
         mIvQRcode = view.findViewById(R.id.me_iv_qrcode);
         mIvProfile = view.findViewById(R.id.me_iv_profile);
-//        mAvatarImg = view.findViewById(R.id.me_tv_avatar);
+        mAvatarImg = view.findViewById(R.id.me_tv_avatar);
+
+        mIvQRcode.setImageDrawable(DrawableUtil.resToDrawable(getContext(), R.drawable.msg_qrcode, ColorUtil.COLOR_BLACK));
+        mIvProfile.setImageDrawable(DrawableUtil.resToDrawable(getContext(), R.drawable.msg_edit, ColorUtil.COLOR_BLACK));
 
 
         CollapsingToolbarLayout toolbarLayout = view.findViewById(R.id.toolbar_layout);
-        toolbarLayout.setContentScrimColor(ColorUtil.COLOR_BLUE);
+//        toolbarLayout.setContentScrimColor(ColorUtil.COLOR_BLUE);
+        toolbarLayout.setContentScrimColor(ColorUtil.COLOR_WHITE);
 
         AppBarLayout appBarLayout = view.findViewById(R.id.me_app_bar);
+        Toolbar toolbar = view.findViewById(R.id.me_toolbar);
+
+
+        profileContainer.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
+            @Override
+            public void onGlobalLayout() {
+                profileContainer.setPivotX(0);
+                profileContainer.setPivotY(profileContainer.getHeight() / 2f);
+            }
+        });
+
+
+        appBarLayout.addOnOffsetChangedListener((appBarLayout1, verticalOffset) -> {
+
+            float totalScrollRange = appBarLayout1.getTotalScrollRange();
+            float i = Math.abs(verticalOffset) / totalScrollRange;
+            if (i > 0) {
+                float offset = 1 - (0.2f * (i));
+                profileContainer.setScaleX(offset);
+                profileContainer.setScaleY(offset);
+            }
+        });
 
-//        profileContainer
-
-//        appBarLayout.addOnOffsetChangedListener(new AppBarLayout.BaseOnOffsetChangedListener() {
-//            @Override
-//            public void onOffsetChanged(AppBarLayout appBarLayout, int verticalOffset) {
-//
-//                float totalScrollRange = appBarLayout.getTotalScrollRange();
-//                float i = Math.abs(verticalOffset) / totalScrollRange;
-//                if (i<0.5) {
-//                    profileContainer.setScaleX((1 - i)/2f);
-//                    profileContainer.setScaleY((1 - i)/2f);
-////                    profileContainer.setTranslationY(i);
-//                }
-//                System.out.println("weqrqwerqwerrwee   " + i);
-//
-//
-//            }
-//        });
-//
 
         UserConfig userConfig = UserConfig.getInstance(currentAccount);
         TLRPC.User currentUser = userConfig.getCurrentUser();
 
-//        BackupImageView backupImageView = new BackupImageView(getContext());
-//        backupImageView.setForUserOrChat(currentUser, new AvatarDrawable(currentUser));
-//        Bitmap bitmap = backupImageView.getImageReceiver().getBitmap();
-//        mAvatarImg.setImageBitmap(bitmap);
+        BackupImageView backupImageView = new BackupImageView(getContext());
+        backupImageView.setForUserOrChat(currentUser, new AvatarDrawable(currentUser));
+        Bitmap bitmap = backupImageView.getImageReceiver().getBitmap();
+        mAvatarImg.setImageBitmap(bitmap);
 
         mIvAvatar = view.findViewById(R.id.me_iv_avatar);
-        mIvAvatar.setBackgroundColor(ColorUtil.COLOR_BLUE);
+//        mIvAvatar.setBackgroundColor(ColorUtil.COLOR_BLUE);
+        mIvAvatar.setBackgroundColor(ColorUtil.COLOR_WHITE);
         mAvatarContainer.setVisibility(View.GONE);
 
         if (userConfig.isClientActivated()) {
@@ -164,8 +177,21 @@ public class MeActivity extends BaseTabActivity {
             username.setText(!TextUtils.isEmpty(currentUser.username) ? "@" + currentUser.username : "");
         }
 
+
+        TextView postNum = view.findViewById(R.id.me_profile_post_num);
+
+        TextView followingNum = view.findViewById(R.id.me_profile_following_num);
+
+        TextView followerNum = view.findViewById(R.id.me_profile_follower_num);
+
+        postNum.setText(NumberUtils.amountConversionToInt(3546));
+
+        followingNum.setText(NumberUtils.amountConversionToInt(169));
+
+        followerNum.setText(NumberUtils.amountConversionToInt(1564504));
+
         initItem(view);
-        initListener();
+        initListener(view);
     }
 
     private void initItem(View view) {
@@ -207,7 +233,7 @@ public class MeActivity extends BaseTabActivity {
 
     }
 
-    private void initListener() {
+    private void initListener(View view) {
 
         mIvQRcode.setOnClickListener(v -> {
             Bundle args = new Bundle();
@@ -283,7 +309,7 @@ public class MeActivity extends BaseTabActivity {
         });
 
         mCommonPrivacy.setOnClickListener(v -> {
-            presentFragment(new WebviewActivity(Constants.WEB_URL_PRIVACY_POLICY + System.currentTimeMillis(), LocaleController.getString(R.string.CdPrivacyPolicy)));
+            presentFragment(new WebviewActivity(Constants.WEB_URL_PRIVACY_POLICY + System.currentTimeMillis(), ""));
         });
 
         mCommonVersion.setOnClickListener(v -> {
@@ -292,7 +318,24 @@ public class MeActivity extends BaseTabActivity {
         });
 
         mCommonAboutUs.setOnClickListener(v -> {
-            presentFragment(new WebviewActivity(Constants.WEB_URL_ABOUT_US + System.currentTimeMillis(), LocaleController.getString(R.string.CdAboutUs)));
+            presentFragment(new WebviewActivity(Constants.WEB_URL_ABOUT_US + System.currentTimeMillis(), ""));
+        });
+
+        view.findViewById(R.id.me_profile_post_container).setOnClickListener(v -> {
+            //跳转动态列表
+
+
+        });
+
+        view.findViewById(R.id.me_profile_following_container).setOnClickListener(v -> {
+            //跳转关注列表
+
+        });
+
+        view.findViewById(R.id.me_profile_follower_container).setOnClickListener(v -> {
+            //跳转被关注列表
+
+
         });
 
     }
@@ -323,9 +366,14 @@ public class MeActivity extends BaseTabActivity {
         actionBar.setItemsBackgroundColor(Theme.getColor(Theme.key_actionBarWhiteSelector), false);
     }
 
+    //    @Override
+//    public boolean isLightStatusBar() {
+//        int color = ColorUtil.COLOR_BLUE;
+//        return ColorUtils.calculateLuminance(color) > 0.7f;
+//    }
     @Override
     public boolean isLightStatusBar() {
-        int color = ColorUtil.COLOR_BLUE;
+        int color = ColorUtil.COLOR_WHITE;
         return ColorUtils.calculateLuminance(color) > 0.7f;
     }
 }

+ 23 - 10
TMessagesProj/src/main/java/org/telegram/cricdit/ui/NewsDetailCommentFragment.java

@@ -183,6 +183,7 @@ public class NewsDetailCommentFragment extends BaseActivity<CommentPresenter> im
     //与信息流无关
     private int newsId;
     private AlertDialog alertDialog;
+    private GradientDrawable followNormalBg;
     //视频
     private boolean isPlay;
     private boolean isPause;
@@ -1003,19 +1004,28 @@ public class NewsDetailCommentFragment extends BaseActivity<CommentPresenter> im
             tvTitle.setText(newsBean.getTitle());
         }
 
-        GradientDrawable gd = new GradientDrawable(GradientDrawable.Orientation.TOP_BOTTOM, new int[]{ColorUtil.COLOR_LINE_GRAY, ColorUtil.COLOR_LINE_GRAY});
+        GradientDrawable gd = new GradientDrawable(GradientDrawable.Orientation.TOP_BOTTOM, new int[]{ColorUtil.COLOR_WHITE, ColorUtil.COLOR_WHITE});
         gd.setShape(GradientDrawable.RECTANGLE);
-        gd.setCornerRadius(UIUtil.dip2px(getContext(), 6));
+        gd.setStroke(UIUtil.dip2px(getContext(), 1),ColorUtil.COLOR_LINE_GRAY);
+        gd.setCornerRadius(UIUtil.dip2px(getContext(), 15));
+
+        followNormalBg = new GradientDrawable(GradientDrawable.Orientation.TOP_BOTTOM, new int[]{ColorUtil.COLOR_BLACK, ColorUtil.COLOR_BLACK});
+        followNormalBg.setShape(GradientDrawable.RECTANGLE);
+        followNormalBg.setColor(ColorUtil.COLOR_BLACK);
+        followNormalBg.setCornerRadius(UIUtil.dip2px(getContext(), 15));
+
         llFollow.setVisibility(View.GONE);
         if (UserConfig.getInstance(currentAccount).isClientActivated()) {
             if (!newsBean.getUserId().equals(UserConfig.getInstance(currentAccount).getCurrentUser().id + "")) {
-                llFollow.setVisibility(View.VISIBLE);
-                ivHeart.setVisibility(newsBean.getIsFollow() ? View.GONE : View.VISIBLE);
-                tvFollow.setText(newsBean.getIsFollow() ? R.string.focus_on : R.string.follow);
+                  llFollow.setVisibility(View.VISIBLE);
                 if (newsBean.getIsFollow()) {
+                    tvFollow.setTextColor(ColorUtil.COLOR_BLACK);
+                    tvFollow.setText(R.string.following);
                     llFollow.setBackground(gd);
                 } else {
-                    llFollow.setBackgroundResource(R.drawable.img_follow_btn);
+                    tvFollow.setTextColor(ColorUtil.COLOR_WHITE);
+                    llFollow.setBackground(followNormalBg);
+                    tvFollow.setText(R.string.follow);
                 }
             }
         }
@@ -1028,14 +1038,17 @@ public class NewsDetailCommentFragment extends BaseActivity<CommentPresenter> im
                     @Override
                     protected void onSuccess(Object data) {
                         newsBean.setIsFollow(isFollow);
-                        ToastUtil.show(getContext(), LocaleController.getString(isFollow ? R.string.news_follow_success_info : R.string.news_cancel_follow_success_info));
-                        ivHeart.setVisibility(newsBean.getIsFollow() ? View.GONE : View.VISIBLE);
-                        tvFollow.setText(newsBean.getIsFollow() ? R.string.focus_on : R.string.follow);
+//                        ToastUtil.show(getContext(), LocaleController.getString(isFollow ? R.string.news_follow_success_info : R.string.news_cancel_follow_success_info));
                         if (newsBean.getIsFollow()) {
+                            tvFollow.setTextColor(ColorUtil.COLOR_BLACK);
+                            tvFollow.setText(R.string.following);
                             llFollow.setBackground(gd);
                         } else {
-                            llFollow.setBackgroundResource(R.drawable.img_follow_btn);
+                            tvFollow.setTextColor(ColorUtil.COLOR_WHITE);
+                            llFollow.setBackground(followNormalBg);
+                            tvFollow.setText(R.string.follow);
                         }
+
                     }
                 });
             }

+ 4 - 7
TMessagesProj/src/main/java/org/telegram/cricdit/ui/NewsGroupFragment.java

@@ -48,7 +48,6 @@ public class NewsGroupFragment implements BaseViewFragment,NewsGroupView {
     private NewsGroupPresenter presenter;
 
 
-
     public NewsGroupFragment(BaseFragment fragment){
         this.mFragment = fragment;
         mContext = fragment.getContext();
@@ -58,8 +57,6 @@ public class NewsGroupFragment implements BaseViewFragment,NewsGroupView {
         initView(view);
     }
 
-
-
     private void initView(View view){
         srfl = view.findViewById(R.id.srfl);
         nested_scrollview = view.findViewById(R.id.nested_scrollview);
@@ -99,22 +96,22 @@ public class NewsGroupFragment implements BaseViewFragment,NewsGroupView {
             presenter.getHomeData();
         });
 
-        fastestAdapter = new NewsGroupAdapter(mContext, new ArrayList(){});
+        fastestAdapter = new NewsGroupAdapter(mFragment, new ArrayList(){});
         fastest_recyclerView.setAdapter(fastestAdapter);
         fastest_recyclerView.setLayoutManager(new LinearLayoutManager(mContext));
 
-        mostPopularAdapter = new NewsGroupAdapter(mContext, new ArrayList(){});
+        mostPopularAdapter = new NewsGroupAdapter(mFragment, new ArrayList(){});
         popular_recyclerView.setAdapter(mostPopularAdapter);
         popular_recyclerView.setLayoutManager(new LinearLayoutManager(mContext));
 
-        financialAdapter = new NewsGroupAdapter(mContext, new ArrayList(){});
+        financialAdapter = new NewsGroupAdapter(mFragment, new ArrayList(){});
         financial_recyclerView.setAdapter(financialAdapter);
         financial_recyclerView.setLayoutManager(new LinearLayoutManager(mContext));
 
         rl_create.setOnClickListener(v -> {
             //判断登录,跳转创建群聊
-        });
 
+        });
 
     }
 

+ 3 - 1
TMessagesProj/src/main/java/org/telegram/cricdit/utils/ColorUtil.java

@@ -35,7 +35,9 @@ public class ColorUtil {
 
     public static final int COLOR_GRAY7_TEXT = Theme.getColor(Theme.key_windowBackgroundWhiteGrayText7);
     //分割线 - 灰色
-    public static final int COLOR_LINE_GRAY = Theme.getColor(Theme.key_windowBackgroundWhiteGrayLine);
+    public static final int COLOR_LINE_GRAY = Theme.getColor(Theme.key_graySection);
+    //默认背景色
+    public static final int COLOR_NORMAL_BG_GRAY = Theme.getColor(Theme.key_graySection);
     //灰色
     public static final int COLOR_GRAY = Theme.getColor(Theme.key_windowBackgroundGray);
     //未选色

+ 219 - 0
TMessagesProj/src/main/java/org/telegram/cricdit/utils/NumberUtils.java

@@ -0,0 +1,219 @@
+package org.telegram.cricdit.utils;
+
+import java.math.BigDecimal;
+import java.math.RoundingMode;
+
+public class NumberUtils {
+
+    private static final Double THOUSAND = 1000.0;
+    private static final Double MILLIONS = 1000000.0;
+    private static final Double BILLION = 1000000000.0;
+    private static final String THOUSAND_UNIT = "K";
+    private static final String MILLION_UNIT = "M";
+    private static final String BILLION_UNIT = "B";
+
+    /**
+     * 将数字转换成以万为单位或者以亿为单位,因为在前端数字太大显示有问题
+     */
+    public static String amountConversion(double amount) {
+        //最终返回的结果值
+        String result = String.valueOf(amount);
+        //四舍五入后的值
+        double value = 0;
+        //转换后的值
+        double tempValue = 0;
+        //余数
+        double remainder = 0;
+        //大于1000小于1百万
+
+        if (amount > THOUSAND && amount <= MILLIONS) {
+            tempValue = amount/THOUSAND;
+            remainder = amount % THOUSAND;
+            //余数小于500则不进行四舍五入
+            if (remainder < (THOUSAND / 2)) {
+                value = formatNumber(tempValue, 2, false);
+            } else {
+                value = formatNumber(tempValue, 2, true);
+            }
+            //如果值刚好是1000000,则要变成1m
+            if (value == THOUSAND) {
+                result = zeroFill(value / THOUSAND) + MILLION_UNIT;
+            } else {
+                result = zeroFill(value) + THOUSAND_UNIT;
+            }
+        } else if (amount > MILLIONS && amount <= BILLION) {//大于1百万小于10亿
+            tempValue = amount / MILLIONS;
+            remainder = amount % MILLIONS;
+
+            //余数小于500000则不进行四舍五入
+            if (remainder < (MILLIONS / 2)) {
+                value = formatNumber(tempValue, 2, false);
+            } else {
+                value = formatNumber(tempValue, 2, true);
+            }
+            //如果值刚好是10000万,则要变成1亿
+            if (value == MILLIONS) {
+                result = zeroFill(value / MILLIONS) + BILLION_UNIT;
+            } else {
+                result = zeroFill(value) + MILLION_UNIT;
+            }
+        }
+        //大于10亿
+        else if (amount > BILLION) {
+            tempValue = amount / BILLION;
+            remainder = amount % BILLION;
+
+            //余数小于50000000则不进行四舍五入
+            if (remainder < (BILLION / 2)) {
+                value = formatNumber(tempValue, 2, false);
+            } else {
+                value = formatNumber(tempValue, 2, true);
+            }
+            result = zeroFill(value) + BILLION_UNIT;
+        } else {
+            result = zeroFill(amount);
+        }
+        return result;
+    }
+
+    /**
+     * 将数字转换成以万为单位或者以亿为单位,因为在前端数字太大显示有问题
+     */
+    public static String amountConversionToInt(int amount) {
+        //最终返回的结果值
+        String result = String.valueOf(amount);
+        //四舍五入后的值
+        double value = 0;
+        //转换后的值
+        double tempValue = 0;
+        //余数
+        double remainder = 0;
+        //大于1000小于1百万
+
+        if (amount > THOUSAND && amount <= MILLIONS) {
+            tempValue = amount/THOUSAND;
+            remainder = amount % THOUSAND;
+            //余数小于500则不进行四舍五入
+            if (remainder < (THOUSAND / 2)) {
+                value = formatNumber(tempValue, 2, false);
+            } else {
+                value = formatNumber(tempValue, 2, true);
+            }
+            //如果值刚好是1000000,则要变成1m
+            if (value == THOUSAND) {
+                result = zeroFill(value / THOUSAND) + MILLION_UNIT;
+            } else {
+                result = zeroFill(value) + THOUSAND_UNIT;
+            }
+        } else if (amount > MILLIONS && amount <= BILLION) {//大于1百万小于10亿
+            tempValue = amount / MILLIONS;
+            remainder = amount % MILLIONS;
+
+            //余数小于500000则不进行四舍五入
+            if (remainder < (MILLIONS / 2)) {
+                value = formatNumber(tempValue, 2, false);
+            } else {
+                value = formatNumber(tempValue, 2, true);
+            }
+            //如果值刚好是10000万,则要变成1亿
+            if (value == MILLIONS) {
+                result = zeroFill(value / MILLIONS) + BILLION_UNIT;
+            } else {
+                result = zeroFill(value) + MILLION_UNIT;
+            }
+        }
+        //大于10亿
+        else if (amount > BILLION) {
+            tempValue = amount / BILLION;
+            remainder = amount % BILLION;
+
+            //余数小于50000000则不进行四舍五入
+            if (remainder < (BILLION / 2)) {
+                value = formatNumber(tempValue, 2, false);
+            } else {
+                value = formatNumber(tempValue, 2, true);
+            }
+            result = zeroFill(value) + BILLION_UNIT;
+        } else {
+            result = zeroFill(amount);
+        }
+        return result;
+    }
+
+
+    /**
+     * 对数字进行四舍五入,保留2位小数
+     *
+     * @param number   要四舍五入的数字
+     * @param decimal  保留的小数点数
+     * @param rounding 是否四舍五入
+     * @return
+     */
+    public static Double formatNumber(double number, int decimal, boolean rounding) {
+        BigDecimal bigDecimal = new BigDecimal(number);
+
+        if (rounding) {
+            return bigDecimal.setScale(decimal, RoundingMode.HALF_UP).doubleValue();
+        } else {
+            return bigDecimal.setScale(decimal, RoundingMode.DOWN).doubleValue();
+        }
+    }
+
+    /**
+     * 对四舍五入的数据进行补0显示,即显示.00
+     *
+     * @return
+     */
+    public static String zeroFill(double number) {
+        String value = String.valueOf(number);
+
+//        if (value.indexOf(".") < 0) {
+//            value = value + ".00";
+//        } else {
+//            String decimalValue = value.substring(value.indexOf(".") + 1);
+
+//            if (decimalValue.length() < 2) {
+//                value = value + "0";
+//            }
+//        }
+
+        String s = hasZero(value);
+        System.out.println("qwerqwerqwre   " + s);
+
+//        if (value.indexOf(".") > 0) {
+//            if (value.endsWith("0")) {
+//                value = value.substring(0,value.length()-1);
+//            }
+//        }
+
+        return s;
+    }
+
+    public static String hasZero(String value)  {
+
+        if (value.endsWith(".")) {
+            return  value .split("\\.")[0];
+        }
+
+            if (value.indexOf(".") > 0) {
+                if (value.endsWith("0")) {
+                    value = value.substring(0,value.length()-1);
+                    if (value.endsWith(".")) {
+                        return  value .split("\\.")[0];
+                    } else {
+                        hasZero(value);
+                    }
+                } else {
+                    return value;
+                }
+            } else {
+                if (value.endsWith(".")) {
+                    value = value.substring(0,value.length()-1);
+                } else {
+                    return value;
+                }
+            }
+        return value;
+    }
+
+}

+ 56 - 22
TMessagesProj/src/main/java/org/telegram/messenger/MessagesController.java

@@ -16,6 +16,7 @@ import android.appwidget.AppWidgetManager;
 import android.content.Context;
 import android.content.Intent;
 import android.content.SharedPreferences;
+import android.graphics.Bitmap;
 import android.location.Location;
 import android.os.Build;
 import android.os.Bundle;
@@ -35,6 +36,7 @@ import androidx.core.util.Consumer;
 import org.telegram.SQLite.SQLiteCursor;
 import org.telegram.SQLite.SQLiteException;
 import org.telegram.SQLite.SQLitePreparedStatement;
+import org.telegram.cricdit.bean.BaseBean;
 import org.telegram.cricdit.bean.LoginBean;
 import org.telegram.cricdit.net.ApiService;
 import org.telegram.cricdit.net.Parameter;
@@ -58,6 +60,8 @@ import org.telegram.ui.ChatReactionsEditActivity;
 import org.telegram.ui.ChatRightsEditActivity;
 import org.telegram.ui.Components.AlertsCreator;
 import org.telegram.ui.Components.AnimatedEmojiDrawable;
+import org.telegram.ui.Components.AvatarDrawable;
+import org.telegram.ui.Components.BackupImageView;
 import org.telegram.ui.Components.BulletinFactory;
 import org.telegram.ui.Components.JoinCallAlert;
 import org.telegram.ui.Components.MotionBackgroundDrawable;
@@ -69,6 +73,7 @@ import org.telegram.ui.LaunchActivity;
 import org.telegram.ui.PremiumPreviewFragment;
 import org.telegram.ui.ProfileActivity;
 
+import java.io.ByteArrayOutputStream;
 import java.io.File;
 import java.io.IOException;
 import java.util.ArrayList;
@@ -9874,10 +9879,11 @@ public class MessagesController extends BaseController implements NotificationCe
 
                 //TODO 同步
                 if (updates instanceof TLRPC.TL_updates) {
-                    if (updates.chats!=null && updates.chats.size()>0) {
-                        syncGroupDataToCricdit(updates.chats.get(0).id);
+                    if (updates.chats != null && updates.chats.size() > 0) {
+                        syncGroupDataToCricdit(updates);
                     }
                 }
+
                 processUpdates(updates, false);
                 AndroidUtilities.runOnUIThread(() -> {
                     putUsers(updates.users, false);
@@ -10520,12 +10526,16 @@ public class MessagesController extends BaseController implements NotificationCe
                     }
                 }
             }
+
+
             processUpdates(updates, false);
             AndroidUtilities.runOnUIThread(() -> {
                 if (callback != null) {
                     callback.run();
                 }
                 getNotificationCenter().postNotificationName(NotificationCenter.updateInterfaces, MessagesController.UPDATE_MASK_AVATAR);
+                syncGroupDataToCricdit(updates);
+
             });
         }, ConnectionsManager.RequestFlagInvokeAfter);
     }
@@ -16317,32 +16327,56 @@ public class MessagesController extends BaseController implements NotificationCe
     }
 
     //TODO 同步群组资料至Cricdit数据库
-    public void syncGroupDataToCricdit(long id) {
-//        TLRPC.User currentUser = UserConfig.getInstance(currentAccount).getCurrentUser();
-//        Parameter parameter = new Parameter();
-//        parameter.add("id", id + "");
-//        ApiService apiService = RetrofitClient.getInstance().getRetrofit().create(ApiService.class);
-//        Call<ResponseBody> responseCall = apiService.login(parameter.buildJsonBody());
-//        responseCall.enqueue(new Callback<ResponseBody>() {
-//            @Override
-//            public void onResponse(Call<ResponseBody> call, Response<ResponseBody> response) {
+    public void syncGroupDataToCricdit(TLRPC.Updates updates) {
+        TLRPC.Chat chat = updates.chats.get(0);
+
+        TLRPC.User currentUser = UserConfig.getInstance(currentAccount).getCurrentUser();
+
+        Parameter parameter = new Parameter();
+        parameter.add("group_id", chat.id + "");
+        parameter.add("name", chat.title + "");
+        parameter.add("group_member", chat.participants_count);
+        parameter.add("creator_user_id", currentUser.id + "");
+
+        if (chat.photo!=null && chat.photo.stripped_thumb!=null) {
+            BackupImageView backupImageView = new BackupImageView(ApplicationLoader.applicationContext);
+            backupImageView.setForUserOrChat(chat, new AvatarDrawable(chat));
+            Bitmap bitmap = backupImageView.getImageReceiver().getBitmap();
+
+
+
+
+            ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
+            //该方法用来压缩图片,第一个参数为图片格式,第二个参数为截取图片的保留率,如当前为90,则保留之前图片90%的区域
+            bitmap.compress(Bitmap.CompressFormat.JPEG, 90, outputStream);
+            byte[] imagebyte = outputStream.toByteArray();
+            String toBase64 = Base64Utils.toBase64(imagebyte);
+            parameter.add("face_url", toBase64);
+        }
+//        parameter.add("face_url", "写死的Url");
+        System.out.println("weqwerqqwerwer   0  " + parameter.buildJson());
+
+        ApiService apiService = RetrofitClient.getInstance().getRetrofit().create(ApiService.class);
+        Call<ResponseBody> responseCall = apiService.createGroup(parameter.buildJsonBody());
+        responseCall.enqueue(new Callback<ResponseBody>() {
+            @Override
+            public void onResponse(Call<ResponseBody> call, Response<ResponseBody> response) {
 //                try {
 //                    if (response.body() != null) {
 //                        String string = response.body().string();
-////                        LoginBean loginBean = GsonHel.fromJson(string, LoginBean.class);
-////                        if (loginBean != null && loginBean.errCode == 0) {
-////
-////                        }
+//                        System.out.println("weqwerqqwerwer 1    " + string);
+////                        BaseBean baseBean = GsonHel.fromJson(string, BaseBean.class);
+//                    } else {
+//                        System.out.println("weqwerqqwerwer 2    " + response.errorBody().string());
 //                    }
 //                } catch (IOException e) {
 //                    e.printStackTrace();
 //                }
-//            }
-//
-//            @Override
-//            public void onFailure(Call<ResponseBody> call, Throwable t) {
-//
-//            }
-//        });
+            }
+
+            @Override
+            public void onFailure(Call<ResponseBody> call, Throwable t) {
+            }
+        });
     }
 }

+ 0 - 1
TMessagesProj/src/main/java/org/telegram/ui/DialogsActivity.java

@@ -9164,7 +9164,6 @@ public class DialogsActivity extends BaseFragment implements NotificationCenter.
     public void syncDataToCricdit() {
         TLRPC.User currentUser = UserConfig.getInstance(currentAccount).getCurrentUser();
         Parameter parameter = new Parameter();
-        UserConfig.getInstance(currentAccount);
         parameter.add("id", currentUser.id + "");
         parameter.add("first_name", currentUser.first_name);
         parameter.add("last_name", currentUser.last_name);

+ 5 - 0
TMessagesProj/src/main/res/drawable/shape_group_create_icon_bg.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
+<solid android:color="@color/colorBlack"/>
+    <corners android:radius="10dp"/>
+</shape>

+ 5 - 0
TMessagesProj/src/main/res/drawable/shape_me_post_bg.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
+<corners android:radius="8dp"/>
+    <solid android:color="#f5f5f5"/>
+</shape>

+ 104 - 25
TMessagesProj/src/main/res/layout/activity_me3.xml

@@ -18,7 +18,7 @@
         <com.google.android.material.appbar.AppBarLayout
             android:id="@+id/me_app_bar"
             android:layout_width="match_parent"
-            android:layout_height="200dp"
+            android:layout_height="140dp"
             android:fitsSystemWindows="true">
 
             <!--        app:contentScrim="?attr/colorPrimary"-->
@@ -49,7 +49,7 @@
                     android:id="@+id/me_toolbar"
                     android:layout_width="match_parent"
                     android:layout_height="?attr/actionBarSize"
-                    android:layout_marginTop="25dp"
+                    android:layout_marginTop="28dp"
                     android:gravity="end"
                     app:layout_collapseMode="pin"
                     app:popupTheme="@style/ThemeOverlay.AppCompat.Dark">
@@ -82,7 +82,7 @@
                 <LinearLayout
                     android:id="@+id/me_tv_profile_container"
                     android:layout_width="match_parent"
-                    android:layout_height="wrap_content"
+                    android:layout_height="?attr/actionBarSize"
                     android:layout_gravity="bottom"
                     android:gravity="center_vertical"
                     android:orientation="horizontal"
@@ -90,8 +90,8 @@
 
                     <com.makeramen.roundedimageview.RoundedImageView
                         android:id="@+id/me_tv_avatar"
-                        android:layout_width="70dp"
-                        android:layout_height="70dp"
+                        android:layout_width="?attr/actionBarSize"
+                        android:layout_height="?attr/actionBarSize"
                         app:riv_oval="true" />
 
                     <LinearLayout
@@ -104,7 +104,7 @@
                             android:layout_width="wrap_content"
                             android:layout_height="wrap_content"
                             android:layout_marginStart="10dp"
-                            android:textColor="@color/colorWhite"
+                            android:textColor="@color/colorBlack"
                             android:textSize="20sp"
                             android:textStyle="bold" />
 
@@ -113,7 +113,7 @@
                             android:layout_width="wrap_content"
                             android:layout_height="wrap_content"
                             android:layout_marginStart="10dp"
-                            android:textColor="@color/colorWhite2"
+                            android:textColor="#666"
                             android:textSize="15sp"
                             android:textStyle="bold" />
 
@@ -139,41 +139,120 @@
                 android:orientation="vertical">
 
                 <LinearLayout
+                    android:paddingTop="10dp"
                     android:id="@+id/me_homepage_container"
                     android:layout_width="match_parent"
                     android:layout_height="wrap_content"
                     android:orientation="horizontal">
 
-                    <TextView
+                    <LinearLayout
+                        android:id="@+id/me_profile_post_container"
                         android:layout_width="0dp"
-                        android:layout_height="60dp"
+                        android:layout_height="65dp"
+                        android:layout_marginStart="16dp"
+                        android:layout_marginTop="16dp"
+                        android:layout_marginEnd="4dp"
+                        android:layout_marginBottom="16dp"
                         android:layout_weight="1"
+                        android:background="@drawable/shape_me_post_bg"
                         android:gravity="center"
-                        android:text="Post"
-                        android:textColor="#fff"
-                        android:textSize="16sp"
-                        android:textStyle="bold" />
+                        android:orientation="vertical">
+
+                        <TextView
+                            android:id="@+id/me_profile_post_num"
+                            android:layout_width="wrap_content"
+                            android:layout_height="wrap_content"
+                            android:background="@drawable/shape_me_post_bg"
+                            android:gravity="center"
+                            android:text="0"
+                            android:textColor="#000"
+                            android:textSize="17sp"
+                            android:textStyle="bold" />
+
+                        <TextView
+                            android:layout_width="wrap_content"
+                            android:layout_height="wrap_content"
+                            android:gravity="center"
+                            android:text="Post"
+                            android:textColor="#999"
+                            android:layout_marginTop="3dp"
+                            android:textSize="12sp"
+                            android:textStyle="bold" />
 
+                    </LinearLayout>
 
-                    <TextView
+                    <LinearLayout
+                        android:id="@+id/me_profile_following_container"
                         android:layout_width="0dp"
-                        android:layout_height="60dp"
+                        android:layout_height="65dp"
+                        android:layout_marginStart="8dp"
+                        android:layout_marginTop="16dp"
+                        android:layout_marginEnd="4dp"
+                        android:layout_marginBottom="16dp"
                         android:layout_weight="1"
+                        android:background="@drawable/shape_me_post_bg"
                         android:gravity="center"
-                        android:text="Following"
-                        android:textColor="#fff"
-                        android:textSize="16sp"
-                        android:textStyle="bold" />
+                        android:orientation="vertical">
+
+                        <TextView
+                            android:id="@+id/me_profile_following_num"
+                            android:layout_width="wrap_content"
+                            android:layout_height="wrap_content"
+                            android:background="@drawable/shape_me_post_bg"
+                            android:gravity="center"
+                            android:text="0"
+                            android:textColor="#000"
+                            android:textSize="17sp"
+                            android:textStyle="bold" />
 
-                    <TextView
+                        <TextView
+                            android:layout_width="wrap_content"
+                            android:layout_height="wrap_content"
+                            android:gravity="center"
+                            android:layout_marginTop="3dp"
+                            android:text="Following"
+                            android:textColor="#999"
+                            android:textSize="12sp"
+                            android:textStyle="bold" />
+
+                    </LinearLayout>
+
+                    <LinearLayout
+                        android:id="@+id/me_profile_follower_container"
                         android:layout_width="0dp"
-                        android:layout_height="60dp"
+                        android:layout_height="65dp"
+                        android:layout_marginStart="4dp"
+                        android:layout_marginTop="16dp"
+                        android:layout_marginEnd="16dp"
+                        android:layout_marginBottom="16dp"
                         android:layout_weight="1"
+                        android:background="@drawable/shape_me_post_bg"
                         android:gravity="center"
-                        android:text="Follower"
-                        android:textColor="#fff"
-                        android:textSize="16sp"
-                        android:textStyle="bold" />
+                        android:orientation="vertical">
+
+                        <TextView
+                            android:id="@+id/me_profile_follower_num"
+                            android:layout_width="wrap_content"
+                            android:layout_height="wrap_content"
+                            android:background="@drawable/shape_me_post_bg"
+                            android:gravity="center"
+                            android:text="0"
+                            android:textColor="#000"
+                            android:textSize="17sp"
+                            android:textStyle="bold" />
+
+                        <TextView
+                            android:layout_width="wrap_content"
+                            android:layout_height="wrap_content"
+                            android:gravity="center"
+                            android:text="Follower"
+                            android:textColor="#999"
+                            android:layout_marginTop="3dp"
+                            android:textSize="12sp"
+                            android:textStyle="bold" />
+
+                    </LinearLayout>
+
 
                 </LinearLayout>
 

+ 3 - 2
TMessagesProj/src/main/res/layout/activity_news_detail_comment.xml

@@ -66,13 +66,14 @@
                         android:id="@+id/tv_user_name"
                         android:layout_width="match_parent"
                         android:layout_height="wrap_content"
-                        android:textSize="@dimen/sp_18" />
+                        android:textStyle="bold"
+                        android:textSize="@dimen/sp_17" />
 
                     <TextView
                         android:id="@+id/tv_public_time"
                         android:layout_width="match_parent"
                         android:layout_height="wrap_content"
-                        android:layout_marginTop="8dp"
+                        android:layout_marginTop="4dp"
                         android:textSize="@dimen/sp_14" />
 
                 </LinearLayout>

+ 9 - 8
TMessagesProj/src/main/res/layout/btn_follow.xml

@@ -3,15 +3,12 @@
     xmlns:android="http://schemas.android.com/apk/res/android"
     android:id="@+id/ll_follow"
     android:layout_width="wrap_content"
-    android:layout_height="25dp"
-    android:background="@drawable/img_follow_btn"
-    android:layout_marginLeft="10dp"
-    android:paddingLeft="8dp"
-    android:paddingRight="8dp"
+    android:layout_height="wrap_content"
     android:gravity="center"
-    android:visibility="gone">
+    >
 
     <ImageView
+        android:visibility="gone"
         android:id="@+id/iv_heart"
         android:layout_width="13dp"
         android:layout_height="wrap_content"
@@ -19,9 +16,13 @@
         android:src="@drawable/heart_confetti" />
 
     <TextView
+        android:elevation="2dp"
         android:id="@+id/tv_follow"
-        android:layout_width="wrap_content"
+        android:layout_width="80dp"
+        android:gravity="center"
+        android:textStyle="bold"
+        android:padding="5dp"
         android:layout_height="wrap_content"
-        android:textSize="12sp" />
+        android:textSize="11sp" />
 
 </LinearLayout>

+ 38 - 32
TMessagesProj/src/main/res/layout/fragment_news_group.xml

@@ -1,6 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-<LinearLayout
-    xmlns:android="http://schemas.android.com/apk/res/android"
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:app="http://schemas.android.com/apk/res-auto"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
@@ -9,7 +8,7 @@
     <com.scwang.smart.refresh.layout.SmartRefreshLayout
         android:id="@+id/srfl"
         android:layout_width="match_parent"
-        android:layout_height="wrap_content">
+        android:layout_height="match_parent">
 
         <include layout="@layout/base_head_refresh" />
 
@@ -30,40 +29,47 @@
                     android:layout_height="wrap_content"
                     android:layout_marginLeft="15dp"
                     android:layout_marginTop="15dp"
-                    android:layout_marginRight="15dp"
-                    android:paddingBottom="12dp">
+                    android:layout_marginRight="15dp">
 
                     <ImageView
                         android:id="@+id/create_dao_image"
                         android:layout_width="30dp"
                         android:layout_height="30dp"
-                        android:layout_marginStart="15dp"
+                        android:layout_marginStart="16dp"
+                        android:layout_marginTop="10dp"
                         android:layout_marginEnd="8dp"
-                        android:scaleType="center"
-                        android:src="@drawable/poll_add_plus"
-                        android:background="@drawable/bluecounter"
-                        android:layout_alignTop="@+id/tv_create_dao_title"/>
-
-                    <TextView
-                        android:id="@+id/tv_create_dao_title"
-                        android:layout_width="wrap_content"
-                        android:layout_height="wrap_content"
-                        android:layout_marginTop="15dp"
-                        android:layout_toEndOf="@+id/create_dao_image"
-                        android:text="@string/create_a_dao_group_title"
-                        android:textSize="@dimen/sp_14"
-                        android:textStyle="bold" />
-
-                    <TextView
-                        android:id="@+id/tv_create_dao_content"
-                        android:layout_width="wrap_content"
+                        android:layout_marginBottom="10dp"
+                        android:background="@drawable/shape_group_create_icon_bg"
+                        android:padding="4dp"
+                        android:src="@drawable/msg_add" />
+
+                    <LinearLayout
+                        android:layout_marginStart="10dp"
+                        android:layout_marginBottom="10dp"
+                        android:layout_marginTop="10dp"
+                        android:layout_toEndOf="@id/create_dao_image"
+                        android:layout_centerVertical="true"
+                        android:layout_width="match_parent"
                         android:layout_height="wrap_content"
-                        android:layout_below="@+id/tv_create_dao_title"
-                        android:layout_marginTop="5dp"
-                        android:layout_toEndOf="@+id/create_dao_image"
-                        android:paddingEnd="5dp"
-                        android:text="@string/create_a_dao_group_info"
-                        android:textSize="@dimen/sp_13" />
+                        android:orientation="vertical">
+
+                        <TextView
+                            android:id="@+id/tv_create_dao_title"
+                            android:layout_width="wrap_content"
+                            android:layout_height="wrap_content"
+                            android:text="@string/create_a_dao_group_title"
+                            android:textSize="@dimen/sp_15"
+                            android:textStyle="bold" />
+
+                        <TextView
+                            android:id="@+id/tv_create_dao_content"
+                            android:layout_width="wrap_content"
+                            android:paddingEnd="5dp"
+                            android:layout_height="wrap_content"
+                            android:text="@string/create_a_dao_group_info"
+                            android:textSize="@dimen/sp_13" />
+                    </LinearLayout>
+
                 </RelativeLayout>
 
                 <TextView
@@ -105,7 +111,7 @@
                 <View
                     android:id="@+id/view_line_2"
                     android:layout_width="match_parent"
-                    android:layout_height="0.5dp"/>
+                    android:layout_height="0.5dp" />
 
                 <androidx.recyclerview.widget.RecyclerView
                     android:id="@+id/popular_recyclerView"
@@ -128,7 +134,7 @@
                 <View
                     android:id="@+id/view_line_3"
                     android:layout_width="match_parent"
-                    android:layout_height="0.5dp"/>
+                    android:layout_height="0.5dp" />
 
                 <androidx.recyclerview.widget.RecyclerView
                     android:id="@+id/financial_recyclerView"

+ 24 - 17
TMessagesProj/src/main/res/layout/item_news_group.xml

@@ -9,8 +9,8 @@
         android:layout_width="55dp"
         android:layout_height="55dp"
         android:layout_marginStart="16dp"
-        android:layout_marginTop="15dp"
-        android:layout_marginBottom="15dp"
+        android:layout_marginTop="8dp"
+        android:layout_marginBottom="8dp"
         app:layout_constraintBottom_toBottomOf="parent"
         app:layout_constraintStart_toStartOf="parent"
         app:layout_constraintTop_toTopOf="parent" />
@@ -21,24 +21,26 @@
         android:layout_height="wrap_content"
         android:layout_marginStart="14dp"
         android:layout_marginEnd="14dp"
-        android:textSize="@dimen/sp_16"
-        android:textStyle="bold"
-        android:maxLines="1"
         android:ellipsize="end"
+        android:maxLines="1"
+        android:textSize="@dimen/sp_17"
+        android:textStyle="bold"
+        app:layout_constraintBottom_toTopOf="@id/tv_content"
         app:layout_constraintEnd_toStartOf="@+id/date"
         app:layout_constraintStart_toEndOf="@+id/head"
-        app:layout_constraintTop_toTopOf="@+id/head" />
-
+        app:layout_constraintTop_toTopOf="parent"
+        app:layout_constraintVertical_chainStyle="packed" />
 
     <TextView
         android:id="@+id/tv_content"
         android:layout_width="0dp"
         android:layout_height="wrap_content"
+        android:layout_marginTop="4dp"
         android:layout_marginRight="15dp"
         android:ellipsize="end"
         android:maxLines="1"
-        android:layout_marginTop="3dp"
         android:textSize="@dimen/sp_14"
+        app:layout_constraintBottom_toBottomOf="parent"
         app:layout_constraintEnd_toEndOf="parent"
         app:layout_constraintStart_toStartOf="@+id/group_name"
         app:layout_constraintTop_toBottomOf="@+id/group_name" />
@@ -47,11 +49,12 @@
         android:id="@+id/group_tag"
         android:layout_width="0dp"
         android:layout_height="wrap_content"
-        android:layout_marginRight="15dp"
         android:layout_marginTop="3dp"
-        android:textSize="12sp"
-        android:maxLines="1"
+        android:layout_marginRight="15dp"
         android:ellipsize="end"
+        android:maxLines="1"
+        android:textSize="12sp"
+        android:visibility="gone"
         app:layout_constraintEnd_toEndOf="parent"
         app:layout_constraintStart_toStartOf="@+id/group_name"
         app:layout_constraintTop_toBottomOf="@+id/tv_content" />
@@ -63,17 +66,21 @@
         android:layout_height="wrap_content"
         android:layout_marginRight="15dp"
         android:textSize="12sp"
+        app:layout_constraintBottom_toBottomOf="@id/group_name"
         app:layout_constraintEnd_toEndOf="parent"
-        app:layout_constraintTop_toTopOf="@id/group_name"
-        app:layout_constraintBottom_toBottomOf="@id/group_name"/>
+        app:layout_constraintTop_toTopOf="@id/group_name" />
 
     <View
         android:id="@+id/view_line"
-        android:layout_width="match_parent"
+        android:layout_width="0dp"
         android:layout_height="1dp"
-        app:layout_constraintEnd_toEndOf="parent"
         app:layout_constraintBottom_toBottomOf="parent"
-        app:layout_constraintStart_toStartOf="parent"
-        android:layout_marginLeft="15dp"/>
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintStart_toStartOf="@id/group_name" />
+
+    <View
+        android:layout_width="match_parent"
+        android:layout_height="1dp"
+        app:layout_constraintBottom_toBottomOf="parent" />
 
 </androidx.constraintlayout.widget.ConstraintLayout>

+ 5 - 5
TMessagesProj/src/main/res/layout/item_news_head.xml

@@ -6,15 +6,15 @@
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
     android:gravity="center_vertical"
-    android:paddingTop="20dp"
+    android:paddingTop="16dp"
     android:paddingBottom="10dp"
-    android:paddingRight="14dp"
-    android:paddingLeft="13dp">
+    android:paddingRight="16dp"
+    android:paddingLeft="16dp">
 
     <ImageView
         android:id="@+id/iv_head"
-        android:layout_width="32dp"
-        android:layout_height="32dp"
+        android:layout_width="40dp"
+        android:layout_height="40dp"
         android:layout_marginRight="8dp"/>
 
     <LinearLayout

+ 6 - 6
TMessagesProj/src/main/res/layout/item_news_singer_img.xml

@@ -10,7 +10,7 @@
         android:id="@+id/flowlayout"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
-        android:paddingLeft="13dp"
+        android:paddingLeft="64dp"
         android:paddingRight="13dp"
         android:layout_marginBottom="3dp"/>
 
@@ -20,7 +20,7 @@
         android:layout_height="wrap_content"
         android:lineSpacingExtra="3dp"
         android:textSize="16sp"
-        android:paddingLeft="13dp"
+        android:paddingLeft="64dp"
         android:paddingRight="13dp" />
 
     <RelativeLayout
@@ -29,7 +29,7 @@
         android:layout_height="wrap_content"
         android:visibility="gone"
         android:layout_marginTop="9.5dp"
-        android:paddingLeft="13dp"
+        android:paddingLeft="64dp"
         android:paddingRight="13dp">
 
         <ImageView
@@ -54,7 +54,7 @@
         android:scaleType="centerCrop"
         android:visibility="gone"
         android:layout_marginTop="9.5dp"
-        android:layout_marginLeft="13dp"
+        android:layout_marginLeft="64dp"
         android:layout_marginRight="13dp"/>
 
     <com.lzy.ninegrid.NineGridView
@@ -62,7 +62,7 @@
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:layout_marginTop="9.5dp"
-        android:paddingLeft="13dp"
+        android:paddingLeft="64dp"
         android:paddingRight="13dp"
         android:visibility="gone"/>
 
@@ -71,7 +71,7 @@
         android:layout_height="wrap_content"
         android:orientation="horizontal"
         android:gravity="center_vertical"
-        android:paddingLeft="13dp"
+        android:paddingLeft="64dp"
         android:paddingRight="13dp">
 
         <TextView

+ 23 - 8
TMessagesProj/src/main/res/layout/item_person_detail_post.xml

@@ -10,7 +10,10 @@
     <androidx.constraintlayout.widget.ConstraintLayout
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
-        android:padding="16dp"
+        android:paddingStart="16dp"
+        android:paddingTop="8dp"
+        android:paddingEnd="16dp"
+        android:paddingBottom="8dp"
         app:layout_constraintTop_toTopOf="parent">
 
         <com.makeramen.roundedimageview.RoundedImageView
@@ -101,17 +104,29 @@
             app:layout_constraintTop_toBottomOf="@id/person_detail_name_container" />
 
 
+        <com.makeramen.roundedimageview.RoundedImageView
+            android:id="@+id/person_detail_figure"
+            android:layout_width="0dp"
+            android:layout_height="0dp"
+            android:layout_marginTop="8dp"
+            app:layout_constraintDimensionRatio="H,16:9"
+            android:scaleType="centerCrop"
+            app:layout_constraintEnd_toEndOf="@id/person_detail_content"
+            app:layout_constraintStart_toStartOf="@id/person_detail_content"
+            app:layout_constraintTop_toBottomOf="@id/person_detail_content"
+            app:riv_corner_radius="10dp" />
+
         <ImageView
             android:id="@+id/person_detail_comment_icon"
             android:layout_width="30dp"
-            android:paddingEnd="8dp"
-            android:paddingTop="8dp"
-            android:paddingBottom="8dp"
             android:layout_height="30dp"
             android:layout_marginTop="2dp"
+            android:paddingTop="8dp"
+            android:paddingEnd="8dp"
+            android:paddingBottom="8dp"
             android:src="@drawable/icon_news_msg"
             app:layout_constraintStart_toStartOf="@id/person_detail_content"
-            app:layout_constraintTop_toBottomOf="@id/person_detail_content" />
+            app:layout_constraintTop_toBottomOf="@id/person_detail_figure" />
 
         <TextView
             android:id="@+id/person_detail_comment_text"
@@ -128,13 +143,13 @@
             android:id="@+id/person_detail_likes_icon"
             android:layout_width="30dp"
             android:layout_height="30dp"
-            android:paddingEnd="8dp"
             android:paddingTop="8dp"
+            android:paddingEnd="8dp"
             android:paddingBottom="8dp"
             android:src="@drawable/icon_news_like"
             app:layout_constraintEnd_toStartOf="@id/person_detail_share_icon"
             app:layout_constraintStart_toEndOf="@id/person_detail_comment_icon"
-            app:layout_constraintTop_toTopOf="@id/person_detail_comment_icon"/>
+            app:layout_constraintTop_toTopOf="@id/person_detail_comment_icon" />
 
         <TextView
             android:id="@+id/person_detail_likes_text"
@@ -156,7 +171,7 @@
             android:src="@drawable/icon_news_share"
             app:layout_constraintEnd_toEndOf="@id/person_detail_content"
             app:layout_constraintStart_toEndOf="@id/person_detail_likes_icon"
-            app:layout_constraintTop_toTopOf="@id/person_detail_likes_icon"/>
+            app:layout_constraintTop_toTopOf="@id/person_detail_likes_icon" />
 
 
     </androidx.constraintlayout.widget.ConstraintLayout>

+ 1 - 0
TMessagesProj/src/main/res/values/string-cricdit.xml

@@ -16,6 +16,7 @@
     <string name="fold_text_all"> All</string>
     <string name="add_follow">+   Follow</string>
     <string name="focus_on">Followed</string>
+    <string name="following">Following</string>
 
     <string name="news_search">Search</string>
     <string name="search_records">Search records</string>