fix bugs. add 字体流光 自定义view,cos上传报错信息。
This commit is contained in:
@@ -224,5 +224,6 @@ dependencies {
|
||||
|
||||
api project(':Loadinglibrary')
|
||||
api project(':moduletablayout')
|
||||
implementation "org.jetbrains.kotlin:kotlin-reflect:2.0.21"
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ import static android.view.View.GONE;
|
||||
import static android.view.View.VISIBLE;
|
||||
import static com.blankj.utilcode.util.ActivityUtils.startActivity;
|
||||
|
||||
import android.graphics.Color;
|
||||
import android.os.Bundle;
|
||||
import android.text.SpannableStringBuilder;
|
||||
import android.text.Spanned;
|
||||
@@ -30,6 +31,7 @@ import com.xscm.moduleutil.utils.MeHeadView;
|
||||
import com.xscm.moduleutil.utils.NumberFormatUtils;
|
||||
import com.xscm.moduleutil.utils.SpUtil;
|
||||
import com.xscm.moduleutil.widget.MyGridView;
|
||||
import com.xscm.moduleutil.widget.ShineTextView;
|
||||
import com.xscm.moduleutil.widget.img.FullScreenUtil;
|
||||
|
||||
import java.util.List;
|
||||
@@ -46,13 +48,13 @@ public class CirleListAdapter extends BaseQuickAdapter<CircleListBean, BaseViewH
|
||||
}
|
||||
|
||||
public interface OnItemClickListener {
|
||||
void onDianzanClick(int index,CircleListBean item);
|
||||
void onDianzanClick(int index, CircleListBean item);
|
||||
|
||||
void onHeadImageClick(CircleListBean item);
|
||||
|
||||
void onZsClick(int idx,CircleListBean item);
|
||||
void onZsClick(int idx, CircleListBean item);
|
||||
|
||||
void onMoreClick(int idx,CircleListBean item);
|
||||
void onMoreClick(int idx, CircleListBean item);
|
||||
|
||||
void onPinglunClick(CircleListBean item);
|
||||
|
||||
@@ -86,7 +88,7 @@ public class CirleListAdapter extends BaseQuickAdapter<CircleListBean, BaseViewH
|
||||
Bundle diff = (Bundle) payload;
|
||||
if (diff.containsKey("like_num")) {
|
||||
helper.setText(R.id.dy_fabulous, diff.getString("like_num"));
|
||||
if (diff.containsKey("is_like")){
|
||||
if (diff.containsKey("is_like")) {
|
||||
if (diff.getInt("is_like") == 1) {
|
||||
helper.setImageResource(R.id.dianzan_image, R.mipmap.dongtai_hudong_yidianzan);
|
||||
} else {
|
||||
@@ -130,7 +132,7 @@ public class CirleListAdapter extends BaseQuickAdapter<CircleListBean, BaseViewH
|
||||
// 设置点击回调
|
||||
helper.getView(com.xscm.moduleutil.R.id.dianzan).setOnClickListener(v -> {
|
||||
if (mListener != null) {
|
||||
mListener.onDianzanClick(helper.getPosition(),item);
|
||||
mListener.onDianzanClick(helper.getPosition(), item);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -139,11 +141,11 @@ public class CirleListAdapter extends BaseQuickAdapter<CircleListBean, BaseViewH
|
||||
});
|
||||
|
||||
helper.getView(com.xscm.moduleutil.R.id.zs).setOnClickListener(v -> {
|
||||
if (mListener != null) mListener.onZsClick(helper.getPosition(),item);
|
||||
if (mListener != null) mListener.onZsClick(helper.getPosition(), item);
|
||||
});
|
||||
|
||||
helper.getView(R.id.diandian).setOnClickListener(v -> {
|
||||
if (mListener != null) mListener.onMoreClick(helper.getPosition(),item);
|
||||
if (mListener != null) mListener.onMoreClick(helper.getPosition(), item);
|
||||
});
|
||||
|
||||
helper.getView(R.id.pinglun).setOnClickListener(v -> {
|
||||
@@ -164,6 +166,15 @@ public class CirleListAdapter extends BaseQuickAdapter<CircleListBean, BaseViewH
|
||||
});
|
||||
//昵称
|
||||
helper.setText(R.id.dy_name_text, item.getNickname());
|
||||
ShineTextView tvName = helper.getView(R.id.dy_name_text);
|
||||
if (!item.getNickname_color().isEmpty()) {
|
||||
tvName.setStartColor(Color.parseColor(item.getNickname_color()));
|
||||
tvName.setShineColor(Color.parseColor(item.getNickname_color()));
|
||||
tvName.setEndColor(Color.parseColor(item.getNickname_color()));
|
||||
tvName.setShine(true);
|
||||
tvName.setShineType(0);
|
||||
}
|
||||
|
||||
|
||||
//头像
|
||||
// ImageUtils.loadHeadCC(item.getAvatar(), helper.getView(R.id.dy_head_image));
|
||||
|
||||
@@ -132,7 +132,7 @@ public class BaseRoomPresenter<V extends IView> extends BasePresenter<V> impleme
|
||||
|
||||
@Override
|
||||
public void putOnWheat(String roomId, String userId,String pitNum) {
|
||||
MvpRef.get().showLoadings();
|
||||
// MvpRef.get().showLoadings();
|
||||
// ApiClient.getInstance().putOnWheat(roomId, userId,pitNum, new BaseObserver<PutOnWheatResp>() {
|
||||
// @Override
|
||||
// public void onSubscribe(Disposable d) {
|
||||
|
||||
@@ -446,8 +446,8 @@ public class CommonAppContext extends MultiDexApplication implements Applicatio
|
||||
// startService(mqttServiceIntent);
|
||||
// }
|
||||
|
||||
// mqttConnect=MqttConnect.getInstance(this,"tcp://1.13.181.248","android-"+ MqttClient.generateClientId());
|
||||
mqttConnect=MqttConnect.getInstance(this,"tcp://1.13.101.98","android-"+ MqttClient.generateClientId());
|
||||
mqttConnect=MqttConnect.getInstance(this,"tcp://1.13.181.248","android-"+ MqttClient.generateClientId());
|
||||
// mqttConnect=MqttConnect.getInstance(this,"tcp://1.13.101.98","android-"+ MqttClient.generateClientId());
|
||||
mqttConnect.mqttClient();
|
||||
|
||||
// 每次启动应用时重置状态
|
||||
@@ -526,8 +526,8 @@ public class CommonAppContext extends MultiDexApplication implements Applicatio
|
||||
|
||||
public void upMqtt(){
|
||||
if (mqttConnect==null){
|
||||
// mqttConnect=MqttConnect.getInstance(this,"tcp://1.13.181.248","android-"+ MqttClient.generateClientId());
|
||||
mqttConnect=MqttConnect.getInstance(this,"tcp://1.13.101.98","android-"+ MqttClient.generateClientId());
|
||||
mqttConnect=MqttConnect.getInstance(this,"tcp://1.13.181.248","android-"+ MqttClient.generateClientId());
|
||||
// mqttConnect=MqttConnect.getInstance(this,"tcp://1.13.101.98","android-"+ MqttClient.generateClientId());
|
||||
mqttConnect.mqttClient();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ public class CircleListBean {
|
||||
public List<HeatedBean> title;//话题列表
|
||||
|
||||
public String nobility_image;//贵族图标
|
||||
public String nickname_color;//昵称颜色
|
||||
public String nickname_color = "";//昵称颜色
|
||||
public String mic_cycle;//麦圈
|
||||
|
||||
public String read_num;//阅读数
|
||||
|
||||
@@ -21,5 +21,5 @@ public class ExpandColumnBean {
|
||||
private String agree;
|
||||
private List<String> icon;
|
||||
private String nobility_image;//贵族图标
|
||||
private String nickname_color;//昵称颜色
|
||||
private String nickname_color = "";//昵称颜色
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ public class RoonGiftModel {
|
||||
private String all_room_push;
|
||||
private String special;
|
||||
private String sort;
|
||||
private String type;
|
||||
private String type = "";
|
||||
private String child_type;
|
||||
private String sold;
|
||||
private String cardiac;
|
||||
|
||||
@@ -1,19 +1,23 @@
|
||||
package com.xscm.moduleutil.bean;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import com.xscm.moduleutil.BaseEvent;
|
||||
import com.xscm.moduleutil.bean.room.FriendInfo;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
*@author qx
|
||||
*@data 2025/6/3
|
||||
*@description: 个人信息,点击我的获取
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class UserInfo implements Serializable {
|
||||
public class UserInfo extends BaseEvent implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
public static final String FEMALE = "2";
|
||||
public static final String MALE = "1";
|
||||
@@ -69,7 +73,7 @@ public class UserInfo implements Serializable {
|
||||
private String ta;
|
||||
|
||||
private String nobility_image;//贵族图标
|
||||
private String nickname_color;//昵称颜色
|
||||
private String nickname_color = "";//昵称颜色
|
||||
private String mic_cycle;//麦圈
|
||||
private String is_hide;//0不能设置,1:可以设置
|
||||
private String hide_status;//0-取消隐身,1-设置隐身
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
package com.xscm.moduleutil.bean.room;
|
||||
|
||||
import com.xscm.moduleutil.BaseEvent;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.List;
|
||||
/**
|
||||
@@ -8,13 +11,15 @@ import java.util.List;
|
||||
*@data 2025/9/29
|
||||
*@description:小时榜实体类
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class RoomHourBean {
|
||||
public class RoomHourBean extends BaseEvent {
|
||||
private String time_range;
|
||||
private List<RoomListBean> lists;
|
||||
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class RoomListBean {
|
||||
public class RoomListBean extends BaseEvent{
|
||||
private String room_id;
|
||||
private String room_name;
|
||||
private int label_id;
|
||||
|
||||
@@ -29,7 +29,7 @@ public class RoomPitBean implements Serializable {
|
||||
*/
|
||||
|
||||
private String id;//id
|
||||
private String pit_number;//麦位号
|
||||
private String pit_number = "";//麦位号
|
||||
private String state;//麦位状态 正常 ,1封麦;3禁麦
|
||||
private int is_lock;//0未锁麦 1锁麦
|
||||
private int is_mute;//0未禁麦 1禁麦
|
||||
|
||||
@@ -766,6 +766,9 @@ public interface ApiServer {
|
||||
@GET(Constants.GET_NOBILITY_PRICE)
|
||||
Call<BaseModel<NobilityPrice>> getNobilityPrice(@Query("id") String id);
|
||||
|
||||
@POST(Constants.POST_SEND_LOG)
|
||||
Call<BaseModel<String>> postSendAppLog(@Query("log_name") String logName,@Query("log_url") String logUrl);
|
||||
|
||||
@GET(Constants.GET_BOX_GIFT_LIST_XLH)
|
||||
Call<BaseModel<BlindBoxBean>> getBoxGiftListXLH( @Query("room_id") String room_id);
|
||||
|
||||
|
||||
@@ -3814,6 +3814,35 @@ public class RetrofitClient {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public void sendAppLog(String logName,String logPath,BaseObserver<String> observer) {
|
||||
sApiServer.postSendAppLog(logName,logPath).enqueue(new Callback<BaseModel<String>>() {
|
||||
@Override
|
||||
public void onResponse(Call<BaseModel<String>> call, Response<BaseModel<String>> response) {
|
||||
if (response.code() == 200) {
|
||||
int code = response.body().getCode();
|
||||
if (code == 1) {
|
||||
observer.onNext("成功");
|
||||
}else if (code == 301){
|
||||
try {
|
||||
ToastUtils.showShort(response.body().getMsg());
|
||||
CommonAppContext.getInstance().clearLoginInfo();
|
||||
} catch (ClassNotFoundException e) {
|
||||
LogUtils.e( e.toString());
|
||||
}
|
||||
}else {
|
||||
observer.onNext("失败");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<BaseModel<String>> call, Throwable t) {
|
||||
observer.onNext("失败");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/// 巡乐会抽奖
|
||||
public void xlhChou(String roomId, String
|
||||
num, BaseObserver<List<XlhDrawBean>> observer) {
|
||||
|
||||
@@ -217,7 +217,7 @@ public class MessageListenerSingleton {
|
||||
try {
|
||||
// 先退出当前群组(如果需要)
|
||||
if (groupId != null && !groupId.equals(roomId)) {
|
||||
LogUtils.d("MessageListener", "开始退出群组: " + groupId);
|
||||
LogUtils.d("MessageListener", "开始退出群组: " + groupId +"____room:"+ roomId);
|
||||
CountDownLatch quitLatch = new CountDownLatch(1);
|
||||
boolean[] quitSuccess = {false};
|
||||
|
||||
@@ -225,14 +225,14 @@ public class MessageListenerSingleton {
|
||||
V2TIMManager.getInstance().quitGroup("room" + groupId, new V2TIMCallback() {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
LogUtils.d("MessageListener", "退出群组成功: " + groupId);
|
||||
LogUtils.d("MessageListener", "退出群组成功: " + groupId+"____room:"+ roomId);
|
||||
quitSuccess[0] = true;
|
||||
quitLatch.countDown();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(int code, String desc) {
|
||||
LogUtils.e("MessageListener", "退出群组失败: " + groupId + ", code=" + code + ", desc=" + desc);
|
||||
LogUtils.e("MessageListener", "退出群组失败: " + groupId +"____room:"+ roomId + ", code=" + code + ", desc=" + desc);
|
||||
quitSuccess[0] = false;
|
||||
quitLatch.countDown();
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ import io.reactivex.disposables.Disposable;
|
||||
public abstract class BasePresenter<V extends IView> implements IPresenter {
|
||||
protected CompositeDisposable mDisposables = new CompositeDisposable();
|
||||
protected RetrofitClient api = RetrofitClient.getInstance();
|
||||
protected Reference<V> MvpRef;
|
||||
protected Reference<V> MvpRef;
|
||||
protected Context mContext;
|
||||
|
||||
@Deprecated
|
||||
|
||||
@@ -863,7 +863,7 @@ public class AgoraManager {
|
||||
//打开对方支持的推流
|
||||
public void muteAllRemoteAudioStreamsExUserId(boolean enabled){
|
||||
if (rtcEngine != null){
|
||||
// rtcEngine.muteRemoteAudioStreamEx(pkUserId,enabled,connection);
|
||||
rtcEngine.muteRemoteAudioStreamEx(pkUserId,enabled,connection);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,19 +1,35 @@
|
||||
package com.xscm.moduleutil.utils;
|
||||
|
||||
import android.os.SystemClock;
|
||||
import android.util.SparseArray;
|
||||
import android.view.View;
|
||||
|
||||
/**
|
||||
*@author qx
|
||||
*@data 2025/9/10
|
||||
*@description: 防止重复点击的工具类
|
||||
*/
|
||||
public class ClickUtils {
|
||||
private static final long CLICK_INTERVAL = 1000; // 1000ms内不允许重复点击
|
||||
private static long lastClickTime = 0;
|
||||
private static final long DEFAULT_CLICK_INTERVAL = 500;
|
||||
private static final SparseArray<Long> lastClickTimes = new SparseArray<>();
|
||||
|
||||
public static boolean isFastDoubleClick() {
|
||||
long currentTime = System.currentTimeMillis();
|
||||
if (currentTime - lastClickTime < CLICK_INTERVAL) {
|
||||
public static boolean isFastDoubleClick(View view) {
|
||||
return isFastDoubleClick(view, DEFAULT_CLICK_INTERVAL);
|
||||
}
|
||||
|
||||
public static boolean isFastDoubleClick(View view, long interval) {
|
||||
long currentTime = SystemClock.elapsedRealtime();
|
||||
int viewId = view.getId();
|
||||
Long lastClickTime = lastClickTimes.get(viewId);
|
||||
if (lastClickTime != null && currentTime - lastClickTime < interval) {
|
||||
return true;
|
||||
}
|
||||
lastClickTime = currentTime;
|
||||
lastClickTimes.put(viewId, currentTime);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// 新增:清理所有点击记录
|
||||
public static void clearAllClickRecords() {
|
||||
lastClickTimes.clear();
|
||||
}
|
||||
}
|
||||
@@ -196,7 +196,19 @@ public class ImageUtils {
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static void loadRoomItem(String path, ImageView mImageView) {
|
||||
if (mImageView == null) {
|
||||
return;
|
||||
}
|
||||
Context context = mImageView.getContext();
|
||||
if (context instanceof android.app.Activity) {
|
||||
android.app.Activity activity = (android.app.Activity) context;
|
||||
if (activity.isFinishing() || (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1 && activity.isDestroyed())) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
Glide.with(mImageView).load(path).diskCacheStrategy(DiskCacheStrategy.ALL).into(mImageView);
|
||||
}
|
||||
|
||||
public static void loadHeadCC(String path, ImageView mImageView) {
|
||||
if (mImageView == null) {
|
||||
|
||||
@@ -8,6 +8,7 @@ import android.widget.ImageView;
|
||||
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
|
||||
import com.blankj.utilcode.util.LogUtils;
|
||||
import com.xscm.moduleutil.R;
|
||||
import com.xscm.moduleutil.utils.logger.Logger;
|
||||
import com.xscm.moduleutil.widget.AvatarFrameView;
|
||||
@@ -47,7 +48,7 @@ public class MeHeadView extends ConstraintLayout {
|
||||
}
|
||||
|
||||
public void setData(String headPicture, String framePicture, String nobilityImage) {
|
||||
Logger.e(headPicture, framePicture, nobilityImage);
|
||||
LogUtils.e(headPicture, framePicture, nobilityImage);
|
||||
if (!TextUtils.isEmpty(headPicture)) {
|
||||
ImageUtils.loadHead(headPicture, mRiv);
|
||||
}
|
||||
|
||||
@@ -207,7 +207,7 @@ public class TimeUtils {
|
||||
//获取当前日期
|
||||
public static String getCurrentDate2() {
|
||||
Date d = new Date();
|
||||
SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss SSS");
|
||||
SimpleDateFormat sf = new SimpleDateFormat("yyyy_MM_dd_hh_mm_ss_SSS");
|
||||
return sf.format(d);
|
||||
}
|
||||
/**
|
||||
|
||||
@@ -80,7 +80,7 @@ public class CosUploadManager {
|
||||
String tmpSecretKey = tempKeyBean.getCredentials().getTmpSecretKey(); // 临时密钥 SecretKey
|
||||
String sessionToken = tempKeyBean.getCredentials().getSessionToken(); // 临时密钥 Token
|
||||
long expiredTime = tempKeyBean.getExpiredTime();//临时密钥有效截止时间戳,单位是秒
|
||||
// 建议返回服务器时间作为签名的开始时间,避免由于用户手机本地时间偏差过大导致请求过期
|
||||
// 建议返回服务器时间作为签名的开始时间,避免由于用户手机本地时间偏差过大导致请求过期
|
||||
long startTime = tempKeyBean.getStartTime(); //临时密钥有效起始时间,单位是秒
|
||||
// 存储桶所在地域简称,例如广州地区是 ap-guangzhou
|
||||
String region = tempKeyBean.getRegion();
|
||||
@@ -95,13 +95,13 @@ public class CosUploadManager {
|
||||
CosXmlService cosXmlService = new CosXmlService(mContext, serviceConfig);
|
||||
|
||||
// 任何 CosXmlRequest 都支持这种方式,例如上传 PutObjectRequest、下载 GetObjectRequest、删除 DeleteObjectRequest 等
|
||||
// 以下用上传进行示例
|
||||
// 以下用上传进行示例
|
||||
PutObjectRequest putRequest = new PutObjectRequest(bucketName, objectKey, localFilePath);
|
||||
// sessionQCloudCredentials 为第一步“初始化密钥”中获取到的单次临时密钥
|
||||
// sessionQCloudCredentials 为第一步“初始化密钥”中获取到的单次临时密钥
|
||||
putRequest.setCredential(sessionQCloudCredentials);
|
||||
// 初始化 TransferConfig,这里使用默认配置,如果需要定制,请参考 SDK 接口文档
|
||||
// 初始化 TransferConfig,这里使用默认配置,如果需要定制,请参考 SDK 接口文档
|
||||
TransferConfig transferConfig = new TransferConfig.Builder().build();
|
||||
// 初始化 TransferManager
|
||||
// 初始化 TransferManager
|
||||
TransferManager transferManager = new TransferManager(cosXmlService, transferConfig);
|
||||
COSXMLUploadTask uploadTask = transferManager.upload(putRequest, null);
|
||||
uploadTask.setCosXmlResultListener(new CosXmlResultListener() {
|
||||
|
||||
@@ -63,7 +63,7 @@ public final class DataLogger implements DataLoggingInterceptor.Logger {
|
||||
}
|
||||
// 响应结束,打印整条日志
|
||||
if (message.startsWith(DataLoggingInterceptor.sLogEndFlag)) {
|
||||
if (mMessage.toString().contains("https://test.vespa.xscmmidi.site/api/Xintiao/keep_xintiao"))
|
||||
if (mMessage.toString().contains("Xintiao/keep_xintiao"))
|
||||
return;
|
||||
LogUtils.d(mMessage.toString());
|
||||
return;
|
||||
|
||||
@@ -17,6 +17,7 @@ import com.blankj.utilcode.util.FileUtils;
|
||||
import com.blankj.utilcode.util.ThreadUtils;
|
||||
import com.xscm.moduleutil.base.CommonAppContext;
|
||||
import com.xscm.moduleutil.utils.Md5Utils;
|
||||
import com.xscm.moduleutil.utils.TimeUtils;
|
||||
import com.xscm.moduleutil.utils.logger.Logger;
|
||||
|
||||
import java.io.File;
|
||||
@@ -53,6 +54,7 @@ public class OSSOperUtils {
|
||||
public static final String img = "images/android_images/";
|
||||
public static final String video = "video/";
|
||||
public static final String audio = "audio/";
|
||||
public static final String AppLog = "applog/";
|
||||
|
||||
|
||||
/**
|
||||
@@ -77,6 +79,15 @@ public class OSSOperUtils {
|
||||
// }
|
||||
}
|
||||
|
||||
public static String getAppLogPath(File file) {
|
||||
String fileMD5 = Md5Utils.getFileMD5(file);
|
||||
String suffix = "";
|
||||
if (file.getName().contains(".")) {
|
||||
suffix = file.getName().substring(file.getName().lastIndexOf("."));
|
||||
}
|
||||
return AppLog + fileMD5 + TimeUtils.getCurrentDate2() + suffix;
|
||||
}
|
||||
|
||||
public static OSSOperUtils newInstance() {
|
||||
if (null == utils) {
|
||||
utils = new OSSOperUtils();
|
||||
|
||||
@@ -411,6 +411,7 @@ public class Constants {
|
||||
public static final String GET_NOBILITY_DETAIL = "/api/Nobility/get_nobility_detail";//爵位详情
|
||||
public static final String GET_NOBILITY_LIST = "/api/Nobility/get_nobility_list";//爵位列表
|
||||
public static final String GET_NOBILITY_PRICE = "/api/Nobility/get_nobility_price";//爵位购买价格
|
||||
public static final String POST_SEND_LOG = "api/Report/android_log_report";//上传log信息
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,125 @@
|
||||
package com.xscm.moduleutil.widget
|
||||
|
||||
|
||||
import android.content.Context
|
||||
import android.graphics.Canvas
|
||||
import android.graphics.Color
|
||||
import android.graphics.LinearGradient
|
||||
import android.graphics.Matrix
|
||||
import android.graphics.Shader
|
||||
import android.util.AttributeSet
|
||||
import androidx.appcompat.widget.AppCompatTextView
|
||||
import com.xscm.moduleutil.R
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* 流光字体
|
||||
* @author TXZ
|
||||
* @version 1.0
|
||||
* created by 2024/5/23 9:32
|
||||
*/
|
||||
class ShineTextView : AppCompatTextView {
|
||||
|
||||
//是否开启流光,默认开启
|
||||
var isShine = true
|
||||
|
||||
//默认是流光效果 0 流光 1 注入效果
|
||||
var shineType = 0
|
||||
//流光效果下字体流动次数
|
||||
var shineCount: Int = Int.MAX_VALUE
|
||||
//注入效果 开始,中间,结束
|
||||
var startColor: Int = Color.WHITE
|
||||
var shineColor: Int = Color.WHITE
|
||||
var endColor: Int = Color.WHITE
|
||||
//一次动效时长
|
||||
var shineDuration: Int = 400
|
||||
|
||||
var _count: Int = 0 //自行运行动画次数
|
||||
|
||||
private lateinit var mLinearGradient: LinearGradient
|
||||
private var mGradientMatrix: Matrix = Matrix()
|
||||
private var mViewWidth = 0
|
||||
private var mTranslate = 0
|
||||
|
||||
constructor(context: Context) : this(context, null)
|
||||
constructor(context: Context, attrs: AttributeSet?) : this(context, attrs, 0)
|
||||
constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int) : super(
|
||||
context, attrs, defStyleAttr
|
||||
) {
|
||||
obtainAttributes(attrs!!)
|
||||
}
|
||||
|
||||
|
||||
private fun obtainAttributes(attrs: AttributeSet) {
|
||||
val typedArray = context.obtainStyledAttributes(attrs, R.styleable.ShineTextView)
|
||||
typedArray.apply {
|
||||
isShine = typedArray.getBoolean(R.styleable.ShineTextView_isShine, isShine)
|
||||
shineType = typedArray.getInt(R.styleable.ShineTextView_shineType, shineType)
|
||||
startColor = typedArray.getColor(R.styleable.ShineTextView_startColor, startColor)
|
||||
shineColor = typedArray.getColor(R.styleable.ShineTextView_midColor, shineColor)
|
||||
endColor = typedArray.getColor(R.styleable.ShineTextView_endColor, endColor)
|
||||
shineCount = typedArray.getInt(R.styleable.ShineTextView_shineCount, shineCount)
|
||||
shineDuration =
|
||||
typedArray.getInt(R.styleable.ShineTextView_shineDuration, shineDuration)
|
||||
}
|
||||
typedArray.recycle()
|
||||
}
|
||||
|
||||
|
||||
override fun onSizeChanged(w: Int, h: Int, oldw: Int, oldh: Int) {
|
||||
super.onSizeChanged(w, h, oldw, oldh)
|
||||
if (isShine) {
|
||||
mViewWidth = measuredWidth
|
||||
when (shineType) {
|
||||
0 -> {
|
||||
//流光效果
|
||||
mLinearGradient = LinearGradient(
|
||||
0f,
|
||||
0f,
|
||||
(mViewWidth / 4).toFloat(),
|
||||
0f,
|
||||
intArrayOf(currentTextColor, shineColor, currentTextColor),
|
||||
null,
|
||||
Shader.TileMode.CLAMP
|
||||
)
|
||||
}
|
||||
|
||||
1 -> {
|
||||
mLinearGradient = LinearGradient(
|
||||
0f,
|
||||
0f,
|
||||
(mViewWidth / 6).toFloat(),
|
||||
0f,
|
||||
intArrayOf(endColor, shineColor, startColor),
|
||||
null,
|
||||
Shader.TileMode.CLAMP
|
||||
)
|
||||
}
|
||||
}
|
||||
paint.shader = mLinearGradient
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
override fun onDraw(canvas: Canvas) {
|
||||
super.onDraw(canvas)
|
||||
if (!isShine || !::mLinearGradient.isLateinit) return
|
||||
mTranslate += mViewWidth / (shineDuration / 50)
|
||||
if (mTranslate > 1.2 * mViewWidth) {
|
||||
mTranslate = -mViewWidth / 5
|
||||
_count++
|
||||
}
|
||||
mGradientMatrix.setTranslate(mTranslate.toFloat(), 0f)
|
||||
mLinearGradient.setLocalMatrix(mGradientMatrix)
|
||||
when {
|
||||
shineType == 0 && _count < shineCount -> postInvalidateDelayed(50)
|
||||
shineType == 1 && _count < 1 -> postInvalidateDelayed(50)
|
||||
else -> {
|
||||
mGradientMatrix.setTranslate((1.2 * mViewWidth).toFloat(), 0f)
|
||||
mLinearGradient.setLocalMatrix(mGradientMatrix)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,16 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/bubble"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:minWidth="@dimen/dp_256"
|
||||
android:maxWidth="@dimen/dp_256"
|
||||
android:padding="@dimen/dp_8"
|
||||
android:background="@drawable/ease_row_pubilc_user_bg"
|
||||
>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/bubble"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/ease_row_pubilc_user_bg"
|
||||
android:maxWidth="@dimen/dp_256"
|
||||
android:minWidth="@dimen/dp_256"
|
||||
android:padding="@dimen/dp_8">
|
||||
|
||||
<!-- 网络背景图片 -->
|
||||
<!-- <ImageView-->
|
||||
@@ -25,104 +23,105 @@
|
||||
|
||||
<!-- 用户头像 -->
|
||||
<com.xscm.moduleutil.utils.MeHeadView
|
||||
android:id="@+id/avatar"
|
||||
android:layout_width="@dimen/dp_28"
|
||||
android:layout_height="@dimen/dp_28"
|
||||
android:layout_marginEnd="@dimen/dp_3"
|
||||
android:layout_marginTop="@dimen/dp_3"
|
||||
android:layout_marginBottom="@dimen/dp_3"
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
app:riv_oval="true"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"/>
|
||||
android:id="@+id/avatar"
|
||||
android:layout_width="@dimen/dp_28"
|
||||
android:layout_height="@dimen/dp_28"
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
android:layout_marginTop="@dimen/dp_3"
|
||||
android:layout_marginEnd="@dimen/dp_3"
|
||||
android:layout_marginBottom="@dimen/dp_3"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:riv_oval="true" />
|
||||
|
||||
<!-- 用户名称 -->
|
||||
<TextView
|
||||
android:id="@+id/tv_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="#CCA882"
|
||||
android:textSize="@dimen/sp_12"
|
||||
android:layout_marginStart="@dimen/dp_2"
|
||||
tools:text="饶利"
|
||||
app:layout_constraintStart_toEndOf="@+id/avatar"
|
||||
app:layout_constraintTop_toTopOf="@+id/avatar"/>
|
||||
<com.xscm.moduleutil.widget.ShineTextView
|
||||
android:id="@+id/tv_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_2"
|
||||
android:textColor="#CCA882"
|
||||
android:textSize="@dimen/sp_12"
|
||||
app:isShine="false"
|
||||
app:layout_constraintStart_toEndOf="@+id/avatar"
|
||||
app:layout_constraintTop_toTopOf="@+id/avatar"
|
||||
tools:text="饶利" />
|
||||
|
||||
<!-- 用户标签容器 -->
|
||||
<LinearLayout
|
||||
android:id="@+id/line"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_2"
|
||||
android:layout_marginTop="@dimen/dp_5"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintStart_toEndOf="@+id/avatar"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_name"/>
|
||||
android:id="@+id/line"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_2"
|
||||
android:layout_marginTop="@dimen/dp_5"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintStart_toEndOf="@+id/avatar"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_name" />
|
||||
|
||||
<!-- 消息内容 -->
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="left|center_vertical"
|
||||
android:layout_marginStart="4dp"
|
||||
android:layout_marginTop="2dp"
|
||||
android:padding="@dimen/dp_3"
|
||||
android:paddingEnd="@dimen/dp_10"
|
||||
app:layout_constraintStart_toEndOf="@+id/avatar"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/line">
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="4dp"
|
||||
android:layout_marginTop="2dp"
|
||||
android:gravity="left|center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:padding="@dimen/dp_3"
|
||||
android:paddingEnd="@dimen/dp_10"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/avatar"
|
||||
app:layout_constraintTop_toBottomOf="@+id/line">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:lineHeight="@dimen/dp_20"
|
||||
android:lineSpacingExtra="@dimen/dp_2"
|
||||
android:paddingStart="@dimen/dp_8"
|
||||
android:paddingEnd="@dimen/dp_8"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_14"
|
||||
tools:text="饶利: 潇洒亼◇生2.0:"
|
||||
tools:visibility="gone"/>
|
||||
android:id="@+id/tv_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:lineHeight="@dimen/dp_20"
|
||||
android:lineSpacingExtra="@dimen/dp_2"
|
||||
android:paddingStart="@dimen/dp_8"
|
||||
android:paddingEnd="@dimen/dp_8"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_14"
|
||||
tools:text="饶利: 潇洒亼◇生2.0:"
|
||||
tools:visibility="gone" />
|
||||
|
||||
<com.xscm.moduleutil.widget.AdaptiveImageView
|
||||
android:id="@+id/im_emj"
|
||||
android:layout_width="@dimen/dp_40"
|
||||
android:layout_height="@dimen/dp_40"
|
||||
android:layout_marginStart="@dimen/dp_2"
|
||||
android:id="@+id/im_emj"
|
||||
android:layout_width="@dimen/dp_40"
|
||||
android:layout_height="@dimen/dp_40"
|
||||
android:layout_marginStart="@dimen/dp_2"
|
||||
|
||||
tools:src="@mipmap/ic_launcher"
|
||||
android:scaleType="fitXY"
|
||||
android:adjustViewBounds="true"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible"/>
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="fitXY"
|
||||
android:visibility="gone"
|
||||
tools:src="@mipmap/ic_launcher"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<!-- <ImageView-->
|
||||
<!-- android:id="@+id/im_emj"-->
|
||||
<!-- android:layout_width="0dp"-->
|
||||
<!-- android:layout_height="0dp"-->
|
||||
<!-- android:layout_marginStart="@dimen/dp_2"-->
|
||||
<!-- android:paddingStart="@dimen/dp_8"-->
|
||||
<!-- android:paddingEnd="@dimen/dp_8"-->
|
||||
<!-- tools:src="@mipmap/ic_launcher"-->
|
||||
<!-- android:maxHeight="@dimen/dp_50"-->
|
||||
<!-- android:maxWidth="@dimen/dp_50"-->
|
||||
<!-- android:minWidth="@dimen/dp_40"-->
|
||||
<!-- android:minHeight="@dimen/dp_40"-->
|
||||
<!-- android:scaleType="centerCrop"-->
|
||||
<!-- android:adjustViewBounds="true"-->
|
||||
<!-- android:visibility="gone"-->
|
||||
<!-- tools:visibility="visible"-->
|
||||
<!-- <ImageView-->
|
||||
<!-- android:id="@+id/im_emj"-->
|
||||
<!-- android:layout_width="0dp"-->
|
||||
<!-- android:layout_height="0dp"-->
|
||||
<!-- android:layout_marginStart="@dimen/dp_2"-->
|
||||
<!-- android:paddingStart="@dimen/dp_8"-->
|
||||
<!-- android:paddingEnd="@dimen/dp_8"-->
|
||||
<!-- tools:src="@mipmap/ic_launcher"-->
|
||||
<!-- android:maxHeight="@dimen/dp_50"-->
|
||||
<!-- android:maxWidth="@dimen/dp_50"-->
|
||||
<!-- android:minWidth="@dimen/dp_40"-->
|
||||
<!-- android:minHeight="@dimen/dp_40"-->
|
||||
<!-- android:scaleType="centerCrop"-->
|
||||
<!-- android:adjustViewBounds="true"-->
|
||||
<!-- android:visibility="gone"-->
|
||||
<!-- tools:visibility="visible"-->
|
||||
|
||||
<!-- app:layout_constraintWidth_default="wrap"-->
|
||||
<!-- app:layout_constraintHeight_default="wrap"-->
|
||||
<!-- app:layout_constraintWidth_min="@dimen/dp_40"-->
|
||||
<!-- app:layout_constraintHeight_min="@dimen/dp_40"-->
|
||||
<!-- app:layout_constraintWidth_max="@dimen/dp_50"-->
|
||||
<!-- app:layout_constraintHeight_max="@dimen/dp_50"-->
|
||||
<!-- app:layout_constraintStart_toStartOf="parent"-->
|
||||
<!-- app:layout_constraintTop_toTopOf="parent"/>-->
|
||||
<!-- app:layout_constraintWidth_default="wrap"-->
|
||||
<!-- app:layout_constraintHeight_default="wrap"-->
|
||||
<!-- app:layout_constraintWidth_min="@dimen/dp_40"-->
|
||||
<!-- app:layout_constraintHeight_min="@dimen/dp_40"-->
|
||||
<!-- app:layout_constraintWidth_max="@dimen/dp_50"-->
|
||||
<!-- app:layout_constraintHeight_max="@dimen/dp_50"-->
|
||||
<!-- app:layout_constraintStart_toStartOf="parent"-->
|
||||
<!-- app:layout_constraintTop_toTopOf="parent"/>-->
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
@@ -44,11 +44,12 @@
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
<com.xscm.moduleutil.widget.ShineTextView
|
||||
android:id="@+id/dy_name_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="萌新驾到"
|
||||
app:isShine="false"
|
||||
android:textColor="#212121"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:background="@color/transparent">
|
||||
android:background="@drawable/shape_dialog">
|
||||
|
||||
<app.dinus.com.loadingdrawable.LoadingView
|
||||
android:id="@+id/cool_wait_view"
|
||||
@@ -25,6 +25,8 @@
|
||||
android:text="加载中..."
|
||||
android:textColor="#333333"
|
||||
android:textSize="16sp"
|
||||
android:paddingBottom="@dimen/dp_10"
|
||||
android:layout_marginHorizontal="@dimen/dp_50"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/cool_wait_view" />
|
||||
|
||||
@@ -302,4 +302,29 @@
|
||||
<item name="android:windowIsFloating">true</item>
|
||||
<item name="android:windowContentOverlay">@null</item>
|
||||
</style>
|
||||
|
||||
|
||||
<declare-styleable name="ShineTextView">
|
||||
<!-- 闪光方式-->
|
||||
<attr name="shineType">
|
||||
<!-- 流光效果-->
|
||||
<enum name="shine" value="0" />
|
||||
<!-- 颜色替换效果,原先是一个颜色,经过流光替换成另一种颜色,必须设置开始颜色,跟结束颜色-->
|
||||
<enum name="replace" value="1" />
|
||||
</attr>
|
||||
<!-- 开始颜色-->
|
||||
<attr name="startColor" format="color" />
|
||||
<!-- 中间颜色-->
|
||||
<attr name="midColor" format="color" />
|
||||
<!-- 结束颜色-->
|
||||
<attr name="endColor" format="color" />
|
||||
<!-- 是否开启流光效果-->
|
||||
<attr name="isShine" format="boolean" />
|
||||
<!-- 设置流光时间-->
|
||||
<attr name="shineDuration" format="integer" />
|
||||
<!-- 流光次数-->
|
||||
<attr name="shineCount" format="integer" />
|
||||
</declare-styleable>
|
||||
|
||||
|
||||
</resources>
|
||||
Reference in New Issue
Block a user