77 广场列表内容显示不全and注销用户跳转个人主页

This commit is contained in:
2025-12-16 18:32:46 +08:00
parent c2714ff68a
commit 81b41ef392
3 changed files with 12 additions and 4 deletions

View File

@@ -186,7 +186,7 @@ public class CirleListAdapter extends BaseQuickAdapter<CircleListBean, BaseViewH
helper.getView(R.id.dy_lookmore_tv).setVisibility(GONE);
helper.getView(R.id.dy_content_tv).setVisibility(GONE);
} else {
helper.getView(R.id.dy_lookmore_tv).setVisibility(VISIBLE);
helper.getView(R.id.dy_lookmore_tv).setVisibility(GONE);
helper.getView(R.id.dy_content_tv).setVisibility(VISIBLE);
}
helper.getView(R.id.dy_lookmore_tv).getViewTreeObserver().addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener() {
@@ -196,7 +196,7 @@ public class CirleListAdapter extends BaseQuickAdapter<CircleListBean, BaseViewH
TextView view = helper.getView(R.id.dy_content_tv);
int lineCount = view.getLineCount();
if (lineCount >= 7) {
helper.getView(R.id.dy_lookmore_tv).setVisibility(VISIBLE);
helper.getView(R.id.dy_lookmore_tv).setVisibility(GONE);
helper.getView(R.id.dy_content_tv).getViewTreeObserver().removeOnPreDrawListener(this);//销毁
} else {
helper.getView(R.id.dy_lookmore_tv).setVisibility(GONE);

View File

@@ -7,6 +7,7 @@ import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.util.Log;
import com.blankj.utilcode.util.ActivityUtils;
import com.blankj.utilcode.util.GsonUtils;
import com.blankj.utilcode.util.LogUtils;
import com.blankj.utilcode.util.ToastUtils;
@@ -2061,6 +2062,11 @@ public class RetrofitClient {
BaseModel<UserInfo> listBaseModel = response.body();
if (listBaseModel.getCode() == 1) {
observer.onNext(listBaseModel.getData());
}else if (listBaseModel.getCode() == 0){
ToastUtils.showShort(listBaseModel.getMsg());
if (ActivityUtils.getTopActivity().getComponentName().getClassName().contains("UserHomepageActivity")){
ActivityUtils.getTopActivity().finish();
}
}
}
}

View File

@@ -122,8 +122,10 @@
android:layout_height="wrap_content"
android:layout_marginStart="0dp"
android:layout_marginTop="14dp"
android:ellipsize="end"
android:maxLines="7"
tools:text="为什么会有这篇文章呢,是因为之前关于 TabLayout 的使用陆陆续续也写了好几篇了,感觉比较分散,且不成体系,写这篇文章的目的就是希望能把各种效果的实现一次性讲齐,所以也有了标题的「看这篇就够了」。
TabLayout作为导航组件来说使用场景非常的多也意味着要满足各种各样的需求。
在效果实现上,有同学会选择自定义 View 来做,定制性高,但易用性、稳定性、维护性不敢保证,使用官方组件能避免这些不确定性,一是开源,有很多大佬共建,会不停的迭代;二是经过大型 app 验证,比如 google play有了这两点基本可以放心大胆的使用官方组件了。
那可能有的同学又会说,道理我都懂,可是不满足需求啊,只能自定义了。是的,早期的 api 确实不够丰富,在某些需求的实现上显得捉襟见肘,但是 google 也在不断的迭代,目前为止,常见的样式都能满足。"
android:textColor="@color/black"
android:textSize="14sp"
/>