Commit 9c1ee8d2 authored by jyx's avatar jyx

更新二级UI样式

parent 41a35b14
...@@ -2,6 +2,7 @@ package com.duben.library.net.neterror; ...@@ -2,6 +2,7 @@ package com.duben.library.net.neterror;
import android.net.ParseException; import android.net.ParseException;
import com.duben.roseplaylet.utils.LogUtil;
import com.google.gson.JsonParseException; import com.google.gson.JsonParseException;
import org.apache.http.conn.ConnectTimeoutException; import org.apache.http.conn.ConnectTimeoutException;
......
...@@ -2,7 +2,6 @@ package com.duben.library.utils ...@@ -2,7 +2,6 @@ package com.duben.library.utils
import android.annotation.SuppressLint import android.annotation.SuppressLint
import android.content.Context import android.content.Context
import android.graphics.Bitmap
import android.graphics.drawable.Drawable import android.graphics.drawable.Drawable
import android.widget.ImageView import android.widget.ImageView
import com.bumptech.glide.Glide import com.bumptech.glide.Glide
...@@ -12,10 +11,8 @@ import com.bumptech.glide.load.resource.bitmap.CenterCrop ...@@ -12,10 +11,8 @@ import com.bumptech.glide.load.resource.bitmap.CenterCrop
import com.bumptech.glide.load.resource.bitmap.CenterInside import com.bumptech.glide.load.resource.bitmap.CenterInside
import com.bumptech.glide.load.resource.bitmap.FitCenter import com.bumptech.glide.load.resource.bitmap.FitCenter
import com.bumptech.glide.load.resource.bitmap.RoundedCorners import com.bumptech.glide.load.resource.bitmap.RoundedCorners
import com.bumptech.glide.load.resource.gif.GifDrawable
import com.bumptech.glide.request.RequestOptions import com.bumptech.glide.request.RequestOptions
import com.bumptech.glide.request.target.SimpleTarget import com.bumptech.glide.request.target.SimpleTarget
import com.bumptech.glide.request.target.ViewTarget
import com.bumptech.glide.request.transition.Transition import com.bumptech.glide.request.transition.Transition
import com.bumptech.glide.signature.ObjectKey import com.bumptech.glide.signature.ObjectKey
import com.duben.roseplaylet.utils.BubbleUtils import com.duben.roseplaylet.utils.BubbleUtils
......
...@@ -6,11 +6,17 @@ import com.google.gson.Gson; ...@@ -6,11 +6,17 @@ import com.google.gson.Gson;
import com.google.gson.GsonBuilder; import com.google.gson.GsonBuilder;
import com.google.gson.JsonElement; import com.google.gson.JsonElement;
import com.google.gson.JsonObject; import com.google.gson.JsonObject;
import com.google.gson.TypeAdapter;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonToken;
import com.google.gson.stream.JsonWriter;
import java.io.IOException;
import java.lang.reflect.Type; import java.lang.reflect.Type;
public class JsonUtil { public class JsonUtil {
private static Gson gson = new GsonBuilder() private static Gson gson = new GsonBuilder()
.registerTypeAdapter(String.class, new StringNullAdapter())
.addSerializationExclusionStrategy(new FooAnnotationExclusionStrategy()) .addSerializationExclusionStrategy(new FooAnnotationExclusionStrategy())
.create(); .create();
...@@ -76,4 +82,27 @@ public class JsonUtil { ...@@ -76,4 +82,27 @@ public class JsonUtil {
return null; return null;
} }
} }
public static class StringNullAdapter extends TypeAdapter<String> {
@Override
public void write(JsonWriter jsonWriter, String s) throws IOException {
//将对象转成json对象时,若有字段为null ,则转为""
if (s == null) {
jsonWriter.value("");
return;
}
jsonWriter.value(s);
}
@Override
public String read(JsonReader jsonReader) throws IOException {
//将json对象转成对象时,若有字段为null ,则转为""
if (jsonReader.peek() == JsonToken.NULL) {
jsonReader.nextNull();
return "";
}
return jsonReader.nextString();
}
}
} }
\ No newline at end of file
package com.duben.roseplaylet.common; package com.duben.roseplaylet.common;
import com.duben.roseplaylet.manager.GenerateTestUserSig;
/** /**
* 描述:配置app设置开关 * 描述:配置app设置开关
* 作者:孟崔广 * 作者:孟崔广
...@@ -33,6 +31,4 @@ public class AppConfig { ...@@ -33,6 +31,4 @@ public class AppConfig {
public static long splashTime = 0L; public static long splashTime = 0L;
public static double firstVipPrice = 0.0; public static double firstVipPrice = 0.0;
public static int IM_SDK_APPID = GenerateTestUserSig.SDKAPPID;
} }
package com.duben.roseplaylet.manager;
import android.text.TextUtils;
import android.util.Base64;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.UnsupportedEncodingException;
import java.nio.charset.Charset;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
import java.util.Arrays;
import java.util.zip.Deflater;
import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
/**
* Module: GenerateTestUserSig
*
* Function: Used to generate UserSig for testing. UserSig is a security signature designed by Tencent Cloud for its cloud services.
* It is calculated based on SDKAppID, UserID, and EXPIRETIME using the HMAC-SHA256 encryption algorithm.
*
* Attention: Do not use the code below in your commercial application. This is because:
*
* The code may be able to calculate UserSig correctly, but it is only for quick testing of the SDK’s basic features, not for commercial applications.
* SECRETKEY in client code can be easily decompiled and reversed, especially on web.
* Once your key is disclosed, attackers will be able to steal your Tencent Cloud traffic.
*
* The correct method is to deploy the UserSig calculation code and encryption key on your project server so that your application can request from your server a UserSig that is calculated whenever one is needed.
* Given that it is more difficult to hack a server than a client application, server-end calculation can better protect your key.
*
* Reference: https://intl.cloud.tencent.com/document/product/1047/34385
*/
public class GenerateTestUserSig {
/**
* Tencent Cloud SDKAppID. Set it to the SDKAppID of your account.
* <p>
* You can view your SDKAppID after creating an application in the [Tencent Cloud IM console](https://console.intl.cloud.tencent.com/im).
* SDKAppID uniquely identifies a Tencent Cloud account.
*/
public static final int SDKAPPID = 1600069405;
/**
* Signature validity period, which should not be set too short
* <p>
* Time unit: second
* Default value: 604800 (7 days)
*/
private static final int EXPIRETIME = 604800;
/**
* Follow the steps below to obtain the key required for UserSig calculation.
* <p>
* Step 1. Log in to the [Tencent Cloud IM console](https://console.intl.cloud.tencent.com/im), and create an application if you don’t have one.
* Step 2. Click Application Configuration to go to the basic configuration page and locate Account System Integration.
* Step 3. Click View Key to view the encrypted key used for UserSig calculation. Then copy and paste the key to the variable below.
* <p>
* Note: this method is for testing only. Before commercial launch, please migrate the UserSig calculation code and key to your backend server to prevent key disclosure and traffic stealing.
* Reference: https://intl.cloud.tencent.com/document/product/1047/34385
*/
private static final String SECRETKEY = "aa890ec2ba5679ae35f857288ce75ec9cfeee9715fd31682977a7bda7824d08c";
/**
* Calculate UserSig
* <p>
* The asymmetric encryption algorithm HMAC-SHA256 is used in the function to calculate UserSig based on SDKAppID, UserID, and EXPIRETIME.
*
* @note: Do not use the code below in your commercial application. This is because:
* <p>
* The code may be able to calculate UserSig correctly, but it is only for quick testing of the SDK’s basic features, not for commercial applications.
* SECRETKEY in client code can be easily decompiled and reversed, especially on web.
* Once your key is disclosed, attackers will be able to steal your Tencent Cloud traffic.
* <p>
* The correct method is to deploy the UserSig calculation code and encryption key on your project server so that your application can request from your server a UserSig that is calculated whenever one is needed.
* Given that it is more difficult to hack a server than a client application, server-end calculation can better protect your key.
* <p>
* Reference: https://intl.cloud.tencent.com/document/product/1047/34385
*/
public static String genTestUserSig(String userId) {
return GenTLSSignature(SDKAPPID, userId, EXPIRETIME, null, SECRETKEY);
}
/**
* Generate a TLS ticket
*
* @param sdkappid AppID of the application
* @param userId User ID
* @param expire Validity period, in seconds
* @param userbuf null by default
* @param priKeyContent Private key required for generating a TLS ticket
* @return If an error occurs, an empty string will be returned or exceptions printed. If the operation succeeds, a valid ticket will be returned.
*/
private static String GenTLSSignature(long sdkappid, String userId, long expire, byte[] userbuf, String priKeyContent) {
if (TextUtils.isEmpty(priKeyContent)) {
return "";
}
long currTime = System.currentTimeMillis() / 1000;
JSONObject sigDoc = new JSONObject();
try {
sigDoc.put("TLS.ver", "2.0");
sigDoc.put("TLS.identifier", userId);
sigDoc.put("TLS.sdkappid", sdkappid);
sigDoc.put("TLS.expire", expire);
sigDoc.put("TLS.time", currTime);
} catch (JSONException e) {
e.printStackTrace();
}
String base64UserBuf = null;
if (null != userbuf) {
base64UserBuf = Base64.encodeToString(userbuf, Base64.NO_WRAP);
try {
sigDoc.put("TLS.userbuf", base64UserBuf);
} catch (JSONException e) {
e.printStackTrace();
}
}
String sig = hmacsha256(sdkappid, userId, currTime, expire, priKeyContent, base64UserBuf);
if (sig.length() == 0) {
return "";
}
try {
sigDoc.put("TLS.sig", sig);
} catch (JSONException e) {
e.printStackTrace();
}
Deflater compressor = new Deflater();
compressor.setInput(sigDoc.toString().getBytes(Charset.forName("UTF-8")));
compressor.finish();
byte[] compressedBytes = new byte[2048];
int compressedBytesLength = compressor.deflate(compressedBytes);
compressor.end();
return new String(base64EncodeUrl(Arrays.copyOfRange(compressedBytes, 0, compressedBytesLength)));
}
private static String hmacsha256(long sdkappid, String userId, long currTime, long expire, String priKeyContent, String base64Userbuf) {
String contentToBeSigned = "TLS.identifier:" + userId + "\n"
+ "TLS.sdkappid:" + sdkappid + "\n"
+ "TLS.time:" + currTime + "\n"
+ "TLS.expire:" + expire + "\n";
if (null != base64Userbuf) {
contentToBeSigned += "TLS.userbuf:" + base64Userbuf + "\n";
}
try {
byte[] byteKey = priKeyContent.getBytes("UTF-8");
Mac hmac = Mac.getInstance("HmacSHA256");
SecretKeySpec keySpec = new SecretKeySpec(byteKey, "HmacSHA256");
hmac.init(keySpec);
byte[] byteSig = hmac.doFinal(contentToBeSigned.getBytes("UTF-8"));
return new String(Base64.encode(byteSig, Base64.NO_WRAP));
} catch (UnsupportedEncodingException e) {
return "";
} catch (NoSuchAlgorithmException e) {
return "";
} catch (InvalidKeyException e) {
return "";
}
}
private static byte[] base64EncodeUrl(byte[] input) {
byte[] base64 = new String(Base64.encode(input, Base64.NO_WRAP)).getBytes();
for (int i = 0; i < base64.length; ++i)
switch (base64[i]) {
case '+':
base64[i] = '*';
break;
case '/':
base64[i] = '-';
break;
case '=':
base64[i] = '_';
break;
default:
break;
}
return base64;
}
}
...@@ -5,11 +5,15 @@ import android.graphics.drawable.ColorDrawable ...@@ -5,11 +5,15 @@ import android.graphics.drawable.ColorDrawable
import android.text.method.ScrollingMovementMethod import android.text.method.ScrollingMovementMethod
import android.view.LayoutInflater import android.view.LayoutInflater
import android.widget.TextView import android.widget.TextView
import com.duben.library.net.neterror.BaseSubscriber
import com.duben.library.net.neterror.Throwable
import com.duben.roseplaylet.MintsApplication import com.duben.roseplaylet.MintsApplication
import com.duben.roseplaylet.R import com.duben.roseplaylet.R
import com.duben.roseplaylet.mvp.model.BaseResponse
import com.duben.roseplaylet.mvp.model.WXInfo import com.duben.roseplaylet.mvp.model.WXInfo
import com.duben.roseplaylet.utils.ToastUtil import com.duben.roseplaylet.utils.ToastUtil
import com.duben.roseplaylet.utils.UcropUtils import com.duben.roseplaylet.utils.UcropUtils
import com.google.gson.JsonObject
import com.tencent.qcloud.tuicore.TUIConfig import com.tencent.qcloud.tuicore.TUIConfig
import com.tencent.qcloud.tuikit.timcommon.config.classicui.TUIConfigClassic import com.tencent.qcloud.tuikit.timcommon.config.classicui.TUIConfigClassic
import com.tencent.qcloud.tuikit.tuichat.config.classicui.TUIChatConfigClassic import com.tencent.qcloud.tuikit.tuichat.config.classicui.TUIChatConfigClassic
...@@ -27,12 +31,33 @@ class IMHelper private constructor() { ...@@ -27,12 +31,33 @@ class IMHelper private constructor() {
customSet() customSet()
} }
private var SECRET_KEY = ""
companion object { companion object {
const val IM_SDK_APPID = 1600069405
val instance: IMHelper by lazy(mode = LazyThreadSafetyMode.SYNCHRONIZED) { val instance: IMHelper by lazy(mode = LazyThreadSafetyMode.SYNCHRONIZED) {
IMHelper() IMHelper()
} }
} }
fun getUserSig(): String {
return SECRET_KEY
}
fun getImMsg() {
val application = MintsApplication.getContext() as MintsApplication
AppHttpManager.getInstance(application)
.call(application.loanService.imMsg,
object : BaseSubscriber<BaseResponse<JsonObject>>() {
override fun onCompleted() {}
override fun onError(e: Throwable) {}
override fun onNext(baseResponse: BaseResponse<JsonObject>) {
}
})
}
fun customSet() { fun customSet() {
val appContext = MintsApplication.getContext() val appContext = MintsApplication.getContext()
......
...@@ -156,8 +156,8 @@ public class LoginWrapper { ...@@ -156,8 +156,8 @@ public class LoginWrapper {
if (loginStatus == V2TIMManager.V2TIM_STATUS_LOGOUT && !TextUtils.isEmpty(userInfo.getUserID())) { if (loginStatus == V2TIMManager.V2TIM_STATUS_LOGOUT && !TextUtils.isEmpty(userInfo.getUserID())) {
if (lastLoginCode >= BaseConstants.ERR_SDK_NET_ENCODE_FAILED && lastLoginCode <= BaseConstants.ERR_SDK_NET_SEND_REMAINING_TIMEOUT_NO_NETWORK) { if (lastLoginCode >= BaseConstants.ERR_SDK_NET_ENCODE_FAILED && lastLoginCode <= BaseConstants.ERR_SDK_NET_SEND_REMAINING_TIMEOUT_NO_NETWORK) {
LogUtil.i(TAG, "onConnectSuccess, login IMSDK"); LogUtil.i(TAG, "onConnectSuccess, login IMSDK");
loginIMSDK(MintsApplication.getContext(), AppConfig.IM_SDK_APPID, userInfo.getUserID(), loginIMSDK(MintsApplication.getContext(), IMHelper.IM_SDK_APPID, userInfo.getUserID(),
GenerateTestUserSig.genTestUserSig(userInfo.getUserID()), getLoginConfig(), IMHelper.Companion.getInstance().getUserSig(), getLoginConfig(),
new TUICallback() { new TUICallback() {
@Override @Override
public void onSuccess() { public void onSuccess() {
......
package com.duben.roseplaylet.mvp.model
/**
* @author Assen
* @date 2025/1/14
* @desc
*/
data class SeeWechat(
val black: Int,
val canSee: Boolean,
val errMsg: String? = null,
val hasWechat: Boolean,
val online: Boolean,
val surCount: Int,
val wechat: String? = null
) : java.io.Serializable
\ No newline at end of file
package com.duben.roseplaylet.mvp.model
/**
* @author Assen
* @date 2025/1/15
* @desc
*/
data class UserProfileData(
var age: String? = null,
var appearance: String? = null,
var birthday: String? = null,
var black: Int? = null,
var bodyWeight: String? = null,
var canChat: Boolean,
var canSee: Boolean,
var canSeeSurCount: Int? = null,
var career: String? = null,
var city: String? = null,
var days: String? = null,
var distance: String? = null,
var findCity: String? = null,
var findDescribe: String? = null,
var hallTime: String? = null,
var hasWechat: Boolean,
var headerUrl: String? = null,
var idcardStatus: Int? = null,
var images: String? = null,
var infoWechat: String? = null,
var interest: String? = null,
var introduce: String? = null,
var lastTime: Long? = null,
var likeCount: Int? = null,
var likeStatus: Int? = null,
var nickName: String? = null,
var online: Boolean,
var sex: Int? = null,
var tagsCommon: String? = null,
var tagsOther: String? = null,
var uid: Long? = null,
var updateCount: Int? = null,
var userHeight: String? = null
) : java.io.Serializable
\ No newline at end of file
package com.duben.roseplaylet.mvp.model;
import java.io.Serializable;
public class UserProfileDataBean implements Serializable {
private UserProfileData info;
public UserProfileData getInfo() {
return info;
}
public void setInfo(UserProfileData info) {
this.info = info;
}
public static class UserProfileData implements Serializable {
/**
* sex : 2
* infoWechat :
* canChat : true
* canSee : true
* likeStatus : 0
* images :
* canSeeSurCount : 14
* black : 1
* online : true
* birthday : 2021-01-01
* lastTime : 1736233526000
* career :
* updateCount : 0
* distance : 0.00
* city :
* likeCount : 0
* findDescribe :
* uid : 2401515422701300000
* idcardStatus : 0
* interest :
* userHeight :
* hasWechat : true
* nickName :
* introduce :
* headerUrl : https://img2.baidu.com/it/u=3360819743,727089392&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500
* appearance :
* tagsOther :
* findCity :
* tagsCommon :
* bodyWeight :
* hallTime : 近日活跃
* days : 13个月
* age : 4
*/
private int sex;
private String infoWechat;
private boolean canChat;
private boolean canSee;
private int likeStatus;
private String images;
private int canSeeSurCount;
private int black;
private boolean online;
private String birthday;
private long lastTime;
private String career;
private int updateCount;
private String distance;
private String city;
private int likeCount;
private String findDescribe;
private long uid;
private int idcardStatus;
private String interest;
private String userHeight;
private boolean hasWechat;
private String nickName;
private String introduce;
private String headerUrl;
private String appearance;
private String tagsOther;
private String findCity;
private String tagsCommon;
private String bodyWeight;
private String hallTime;
private String days;
private String age;
public int getSex() {
return sex;
}
public void setSex(int sex) {
this.sex = sex;
}
public String getInfoWechat() {
return infoWechat;
}
public void setInfoWechat(String infoWechat) {
this.infoWechat = infoWechat;
}
public boolean isCanChat() {
return canChat;
}
public void setCanChat(boolean canChat) {
this.canChat = canChat;
}
public boolean isCanSee() {
return canSee;
}
public void setCanSee(boolean canSee) {
this.canSee = canSee;
}
public int getLikeStatus() {
return likeStatus;
}
public void setLikeStatus(int likeStatus) {
this.likeStatus = likeStatus;
}
public String getImages() {
return images;
}
public void setImages(String images) {
this.images = images;
}
public int getCanSeeSurCount() {
return canSeeSurCount;
}
public void setCanSeeSurCount(int canSeeSurCount) {
this.canSeeSurCount = canSeeSurCount;
}
public int getBlack() {
return black;
}
public void setBlack(int black) {
this.black = black;
}
public boolean isOnline() {
return online;
}
public void setOnline(boolean online) {
this.online = online;
}
public String getBirthday() {
return birthday;
}
public void setBirthday(String birthday) {
this.birthday = birthday;
}
public long getLastTime() {
return lastTime;
}
public void setLastTime(long lastTime) {
this.lastTime = lastTime;
}
public String getCareer() {
return career;
}
public void setCareer(String career) {
this.career = career;
}
public int getUpdateCount() {
return updateCount;
}
public void setUpdateCount(int updateCount) {
this.updateCount = updateCount;
}
public String getDistance() {
return distance;
}
public void setDistance(String distance) {
this.distance = distance;
}
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city;
}
public int getLikeCount() {
return likeCount;
}
public void setLikeCount(int likeCount) {
this.likeCount = likeCount;
}
public String getFindDescribe() {
return findDescribe;
}
public void setFindDescribe(String findDescribe) {
this.findDescribe = findDescribe;
}
public long getUid() {
return uid;
}
public void setUid(long uid) {
this.uid = uid;
}
public int getIdcardStatus() {
return idcardStatus;
}
public void setIdcardStatus(int idcardStatus) {
this.idcardStatus = idcardStatus;
}
public String getInterest() {
return interest;
}
public void setInterest(String interest) {
this.interest = interest;
}
public String getUserHeight() {
return userHeight;
}
public void setUserHeight(String userHeight) {
this.userHeight = userHeight;
}
public boolean isHasWechat() {
return hasWechat;
}
public void setHasWechat(boolean hasWechat) {
this.hasWechat = hasWechat;
}
public String getNickName() {
return nickName;
}
public void setNickName(String nickName) {
this.nickName = nickName;
}
public String getIntroduce() {
return introduce;
}
public void setIntroduce(String introduce) {
this.introduce = introduce;
}
public String getHeaderUrl() {
return headerUrl;
}
public void setHeaderUrl(String headerUrl) {
this.headerUrl = headerUrl;
}
public String getAppearance() {
return appearance;
}
public void setAppearance(String appearance) {
this.appearance = appearance;
}
public String getTagsOther() {
return tagsOther;
}
public void setTagsOther(String tagsOther) {
this.tagsOther = tagsOther;
}
public String getFindCity() {
return findCity;
}
public void setFindCity(String findCity) {
this.findCity = findCity;
}
public String getTagsCommon() {
return tagsCommon;
}
public void setTagsCommon(String tagsCommon) {
this.tagsCommon = tagsCommon;
}
public String getBodyWeight() {
return bodyWeight;
}
public void setBodyWeight(String bodyWeight) {
this.bodyWeight = bodyWeight;
}
public String getHallTime() {
return hallTime;
}
public void setHallTime(String hallTime) {
this.hallTime = hallTime;
}
public String getDays() {
return days;
}
public void setDays(String days) {
this.days = days;
}
public String getAge() {
return age;
}
public void setAge(String age) {
this.age = age;
}
}
}
...@@ -4,7 +4,7 @@ import com.duben.library.net.neterror.BaseSubscriber ...@@ -4,7 +4,7 @@ import com.duben.library.net.neterror.BaseSubscriber
import com.duben.library.net.neterror.Throwable import com.duben.library.net.neterror.Throwable
import com.duben.roseplaylet.manager.AppHttpManager import com.duben.roseplaylet.manager.AppHttpManager
import com.duben.roseplaylet.mvp.model.BaseResponse import com.duben.roseplaylet.mvp.model.BaseResponse
import com.duben.roseplaylet.mvp.model.UserProfileDataBean import com.duben.roseplaylet.mvp.model.UserProfileData
import com.duben.roseplaylet.mvp.views.BasicUserProfileView import com.duben.roseplaylet.mvp.views.BasicUserProfileView
import java.util.HashMap import java.util.HashMap
...@@ -18,13 +18,13 @@ class BasicUserProfilePresenter : BasePresenter<BasicUserProfileView>() { ...@@ -18,13 +18,13 @@ class BasicUserProfilePresenter : BasePresenter<BasicUserProfileView>() {
vo["headerUrl"] = headerUrl vo["headerUrl"] = headerUrl
AppHttpManager.getInstance(loanApplication) AppHttpManager.getInstance(loanApplication)
.call(loanService.initInfo(vo), .call(loanService.initInfo(vo),
object : BaseSubscriber<BaseResponse<UserProfileDataBean>>() { object : BaseSubscriber<BaseResponse<UserProfileData>>() {
override fun onCompleted() { override fun onCompleted() {
if (isLinkView) return if (isLinkView) return
view.hideLoading() view.hideLoading()
} }
override fun onNext(baseResponse: BaseResponse<UserProfileDataBean>) { override fun onNext(baseResponse: BaseResponse<UserProfileData>) {
if (isLinkView) return if (isLinkView) return
view.hideLoading() view.hideLoading()
......
...@@ -4,7 +4,7 @@ import com.duben.library.net.neterror.BaseSubscriber ...@@ -4,7 +4,7 @@ import com.duben.library.net.neterror.BaseSubscriber
import com.duben.library.net.neterror.Throwable import com.duben.library.net.neterror.Throwable
import com.duben.roseplaylet.manager.AppHttpManager import com.duben.roseplaylet.manager.AppHttpManager
import com.duben.roseplaylet.mvp.model.BaseResponse import com.duben.roseplaylet.mvp.model.BaseResponse
import com.duben.roseplaylet.mvp.model.UserProfileDataBean import com.duben.roseplaylet.mvp.model.UserProfileData
import com.duben.roseplaylet.mvp.views.EditProfileView import com.duben.roseplaylet.mvp.views.EditProfileView
import java.util.HashMap import java.util.HashMap
...@@ -13,13 +13,13 @@ class EditProfilePresenter : BasePresenter<EditProfileView>() { ...@@ -13,13 +13,13 @@ class EditProfilePresenter : BasePresenter<EditProfileView>() {
fun getUserInfo() { fun getUserInfo() {
AppHttpManager.getInstance(loanApplication) AppHttpManager.getInstance(loanApplication)
.call(loanService.userInfo, .call(loanService.userInfo,
object : BaseSubscriber<BaseResponse<UserProfileDataBean>>() { object : BaseSubscriber<BaseResponse<UserProfileData>>() {
override fun onCompleted() { override fun onCompleted() {
if (isLinkView) return if (isLinkView) return
view.hideLoading() view.hideLoading()
} }
override fun onNext(baseResponse: BaseResponse<UserProfileDataBean>) { override fun onNext(baseResponse: BaseResponse<UserProfileData>) {
if (isLinkView) return if (isLinkView) return
view.hideLoading() view.hideLoading()
...@@ -45,18 +45,18 @@ class EditProfilePresenter : BasePresenter<EditProfileView>() { ...@@ -45,18 +45,18 @@ class EditProfilePresenter : BasePresenter<EditProfileView>() {
} }
fun setUserInfo(userProfileData: UserProfileDataBean.UserProfileData) { fun setUserInfo(userProfileData: UserProfileData) {
val vo = HashMap<String, Any>() val vo = HashMap<String, Any>()
vo["info"] = userProfileData vo["info"] = userProfileData
AppHttpManager.getInstance(loanApplication) AppHttpManager.getInstance(loanApplication)
.call(loanService.setUserInfo(vo), .call(loanService.setUserInfo(vo),
object : BaseSubscriber<BaseResponse<UserProfileDataBean>>() { object : BaseSubscriber<BaseResponse<UserProfileData>>() {
override fun onCompleted() { override fun onCompleted() {
if (isLinkView) return if (isLinkView) return
view.hideLoading() view.hideLoading()
} }
override fun onNext(baseResponse: BaseResponse<UserProfileDataBean>) { override fun onNext(baseResponse: BaseResponse<UserProfileData>) {
if (isLinkView) return if (isLinkView) return
view.hideLoading() view.hideLoading()
......
package com.duben.roseplaylet.mvp.presenters package com.duben.roseplaylet.mvp.presenters
import com.duben.roseplaylet.MintsApplication import com.duben.roseplaylet.MintsApplication
import com.duben.roseplaylet.common.Constant
import com.duben.roseplaylet.common.DeviceInfo import com.duben.roseplaylet.common.DeviceInfo
import com.duben.roseplaylet.manager.AppHttpManager import com.duben.roseplaylet.manager.AppHttpManager
import com.duben.roseplaylet.manager.UserManager import com.duben.roseplaylet.manager.UserManager
import com.duben.roseplaylet.mvp.model.* import com.duben.roseplaylet.mvp.model.*
import com.duben.roseplaylet.mvp.views.HomeView import com.duben.roseplaylet.mvp.views.HomeView
import com.duben.roseplaylet.utils.AppPreferencesManager
import com.duben.roseplaylet.utils.DeviceUuidFactory import com.duben.roseplaylet.utils.DeviceUuidFactory
import com.duben.library.net.neterror.BaseSubscriber import com.duben.library.net.neterror.BaseSubscriber
import com.duben.library.net.neterror.Throwable import com.duben.library.net.neterror.Throwable
import com.duben.roseplaylet.common.AppConfig import com.duben.roseplaylet.manager.IMHelper
import com.google.gson.JsonObject import com.google.gson.JsonObject
import java.util.HashMap import java.util.HashMap
...@@ -69,7 +67,6 @@ class HomePresenter : BasePresenter<HomeView>() { ...@@ -69,7 +67,6 @@ class HomePresenter : BasePresenter<HomeView>() {
when (code) { when (code) {
200 -> { 200 -> {
view.topTabsSuc(baseResponse.data) view.topTabsSuc(baseResponse.data)
// showTurn()
} }
else -> { else -> {
view.showToast(message) view.showToast(message)
...@@ -169,6 +166,7 @@ class HomePresenter : BasePresenter<HomeView>() { ...@@ -169,6 +166,7 @@ class HomePresenter : BasePresenter<HomeView>() {
200 -> if (data != null) { 200 -> if (data != null) {
UserManager.getInstance().saveUserInfo(data) UserManager.getInstance().saveUserInfo(data)
saveTerminalInfo() saveTerminalInfo()
IMHelper.instance.getImMsg()
} }
else -> { else -> {
view.showToast(message) view.showToast(message)
......
...@@ -7,9 +7,45 @@ import com.duben.roseplaylet.mvp.model.BannerList ...@@ -7,9 +7,45 @@ import com.duben.roseplaylet.mvp.model.BannerList
import com.duben.roseplaylet.mvp.model.BaseResponse import com.duben.roseplaylet.mvp.model.BaseResponse
import com.duben.roseplaylet.mvp.model.HallList import com.duben.roseplaylet.mvp.model.HallList
import com.duben.roseplaylet.mvp.views.SquareView import com.duben.roseplaylet.mvp.views.SquareView
import com.google.gson.JsonObject
class SquarePresenter : BasePresenter<SquareView>() { class SquarePresenter : BasePresenter<SquareView>() {
fun toLike(toUid: String, status: Int) {
val vo = hashMapOf<String, Any>()
vo["toUid"] = toUid
vo["status"] = status
AppHttpManager.getInstance(loanApplication)
.call(loanService.toLike(vo), object : BaseSubscriber<BaseResponse<JsonObject>>() {
override fun onCompleted() {
if (isLinkView) return
view.hideLoading()
}
override fun onNext(baseResponse: BaseResponse<JsonObject>) {
if (isLinkView) return
view.hideLoading()
val code = baseResponse.status
val message = baseResponse.message
when (code) {
200 -> {}
else -> {
view.showToast(message)
}
}
}
override fun onError(e: Throwable?) {
if (isLinkView) return
view.hideLoading()
view.showToast(e?.message)
}
})
}
fun saveGps(latitude: String, longitude: String, city: String) { fun saveGps(latitude: String, longitude: String, city: String) {
val vo = hashMapOf<String, Any>() val vo = hashMapOf<String, Any>()
vo["latitude"] = latitude vo["latitude"] = latitude
......
...@@ -42,7 +42,6 @@ public class TrackPresenter extends BaseTrackPresenter { ...@@ -42,7 +42,6 @@ public class TrackPresenter extends BaseTrackPresenter {
switch (baseResponse.getStatus()) { switch (baseResponse.getStatus()) {
case 200: { case 200: {
UserManager.getInstance().saveUserInfo(baseResponse.getData()); UserManager.getInstance().saveUserInfo(baseResponse.getData());
// firstShowVedio();
saveTerminalInfo(); saveTerminalInfo();
} }
} }
......
package com.duben.roseplaylet.mvp.views package com.duben.roseplaylet.mvp.views
import com.duben.roseplaylet.mvp.model.UserProfileDataBean import com.duben.roseplaylet.mvp.model.UserProfileData
interface EditProfileView : BaseView { interface EditProfileView : BaseView {
fun getUserInfoSuc(data: UserProfileDataBean) fun getUserInfoSuc(data: UserProfileData)
fun getUserInfoFail() fun getUserInfoFail()
fun setUserInfoSuc() fun setUserInfoSuc()
......
package com.duben.roseplaylet.mvp.views
import com.duben.roseplaylet.mvp.model.SeeWechat
import com.duben.roseplaylet.mvp.model.UserProfileData
interface UserProfileView : BaseView {
fun getMorePageSuc(data: UserProfileData)
fun getMorePageFail()
fun seeWechatSuc(data: SeeWechat)
fun seeWechatFail()
fun unlockWechatSuc()
fun unlockWechatFail()
fun toWhiteSuc()
fun toBlackSuc()
}
...@@ -6,7 +6,8 @@ import android.text.TextUtils; ...@@ -6,7 +6,8 @@ import android.text.TextUtils;
import com.duben.roseplaylet.mvp.model.FaceParam; import com.duben.roseplaylet.mvp.model.FaceParam;
import com.duben.roseplaylet.mvp.model.HallList; import com.duben.roseplaylet.mvp.model.HallList;
import com.duben.roseplaylet.mvp.model.RecommendBannerList; import com.duben.roseplaylet.mvp.model.RecommendBannerList;
import com.duben.roseplaylet.mvp.model.UserProfileDataBean; import com.duben.roseplaylet.mvp.model.SeeWechat;
import com.duben.roseplaylet.mvp.model.UserProfileData;
import com.google.gson.JsonObject; import com.google.gson.JsonObject;
import com.duben.roseplaylet.BuildConfig; import com.duben.roseplaylet.BuildConfig;
import com.duben.roseplaylet.mvp.model.BannerList; import com.duben.roseplaylet.mvp.model.BannerList;
...@@ -397,19 +398,19 @@ public interface LoanService { ...@@ -397,19 +398,19 @@ public interface LoanService {
* 同城喜欢 * 同城喜欢
*/ */
@POST("roseApi/hall/like") @POST("roseApi/hall/like")
Observable<BaseResponse<JsonObject>> like(@Body Map<String, Object> vo); Observable<BaseResponse<JsonObject>> toLike(@Body Map<String, Object> vo);
/** /**
* 二级资料页 * 二级资料页
*/ */
@POST("roseApi/hall/morePage") @POST("roseApi/hall/morePage")
Observable<BaseResponse<UserProfileDataBean>> getMorePage(@Body Map<String, Object> vo); Observable<BaseResponse<UserProfileData>> getMorePage(@Body Map<String, Object> vo);
/** /**
* 查看微信号 * 查看微信号
*/ */
@POST("roseApi/hall/seeWechat") @POST("roseApi/hall/seeWechat")
Observable<BaseResponse<JsonObject>> seeWechat(@Body Map<String, Object> vo); Observable<BaseResponse<SeeWechat>> seeWechat(@Body Map<String, Object> vo);
/** /**
* 金币解锁和免费次数解锁同一接口 * 金币解锁和免费次数解锁同一接口
...@@ -421,13 +422,13 @@ public interface LoanService { ...@@ -421,13 +422,13 @@ public interface LoanService {
* 查看资料 * 查看资料
*/ */
@POST("roseApi/user/info") @POST("roseApi/user/info")
Observable<BaseResponse<UserProfileDataBean>> getUserInfo(); Observable<BaseResponse<UserProfileData>> getUserInfo();
/** /**
* 编辑资料 * 编辑资料
*/ */
@POST("roseApi/user/setInfo") @POST("roseApi/user/setInfo")
Observable<BaseResponse<UserProfileDataBean>> setUserInfo(@Body Map<String, Object> vo); Observable<BaseResponse<UserProfileData>> setUserInfo(@Body Map<String, Object> vo);
/** /**
* 我喜欢的 * 我喜欢的
...@@ -465,6 +466,36 @@ public interface LoanService { ...@@ -465,6 +466,36 @@ public interface LoanService {
@POST("roseApi/hall/white") @POST("roseApi/hall/white")
Observable<BaseResponse<JsonObject>> setWhite(@Body Map<String, Object> vo); Observable<BaseResponse<JsonObject>> setWhite(@Body Map<String, Object> vo);
/**
* 获取im信息
*/
@POST("roseApi/user/getImMsg")
Observable<BaseResponse<JsonObject>> getImMsg();
/**
* 分享链接(二维码地址)
*/
@POST("roseApi/share/shareUrl")
Observable<BaseResponse<JsonObject>> getShareUrl();
/**
* 邀请页基础信息
*/
@POST("roseApi/share/sharePageMsg")
Observable<BaseResponse<JsonObject>> getSharePageMsg();
/**
* 查看图片
*/
@POST("roseApi/user/getImages")
Observable<BaseResponse<JsonObject>> getImages();
/**
* 设置图片
*/
@POST("roseApi/user/setImages")
Observable<BaseResponse<JsonObject>> setImages(@Body Map<String, Object> vo);
/** /**
* 默认http工厂 * 默认http工厂
*/ */
......
...@@ -34,6 +34,7 @@ import com.luck.picture.lib.tools.SdkVersionUtils ...@@ -34,6 +34,7 @@ import com.luck.picture.lib.tools.SdkVersionUtils
import com.tbruyelle.rxpermissions.RxPermissions import com.tbruyelle.rxpermissions.RxPermissions
import com.yalantis.ucrop.UCrop import com.yalantis.ucrop.UCrop
import kotlinx.android.synthetic.main.activity_basic_user_profile.* import kotlinx.android.synthetic.main.activity_basic_user_profile.*
import kotlinx.android.synthetic.main.dialog_nine_continue.*
import kotlinx.android.synthetic.main.header_layout.* import kotlinx.android.synthetic.main.header_layout.*
import java.io.File import java.io.File
...@@ -92,17 +93,17 @@ class BasicUserProfileActivity : BaseActivity(), View.OnClickListener, BasicUser ...@@ -92,17 +93,17 @@ class BasicUserProfileActivity : BaseActivity(), View.OnClickListener, BasicUser
showAgePickDialog() showAgePickDialog()
} }
R.id.tv_save -> { R.id.tv_save -> {
val nickname = tv_age.text.toString() val nickname = et_nickname.text.toString()
val age = tv_age.text.toString() val age = tv_age.text.toString()
if (TextUtils.isEmpty(avatarUrl)) { if (TextUtils.isEmpty(avatarUrl)) {
showToast("请上传头像!") showToast("请上传头像!")
return return
} }
if (TextUtils.isEmpty(et_nickname.text.toString())) { if (TextUtils.isEmpty(nickname)) {
showToast("请输入昵称!") showToast("请输入昵称!")
return return
} }
if (TextUtils.isEmpty(tv_age.text.toString())) { if (TextUtils.isEmpty(age)) {
showToast("请输入年龄!") showToast("请输入年龄!")
return return
} }
...@@ -111,7 +112,7 @@ class BasicUserProfileActivity : BaseActivity(), View.OnClickListener, BasicUser ...@@ -111,7 +112,7 @@ class BasicUserProfileActivity : BaseActivity(), View.OnClickListener, BasicUser
return return
} }
basicUserProfilePresenter.initBasicInfo("$age-1-1", nickname, age, avatarUrl!!) basicUserProfilePresenter.initBasicInfo("$age-1-1", nickname, sex!!, avatarUrl!!)
} }
} }
} }
......
...@@ -21,10 +21,7 @@ import com.duben.roseplaylet.common.OssType ...@@ -21,10 +21,7 @@ import com.duben.roseplaylet.common.OssType
import com.duben.roseplaylet.common.UserProfile import com.duben.roseplaylet.common.UserProfile
import com.duben.roseplaylet.manager.OssManager import com.duben.roseplaylet.manager.OssManager
import com.duben.roseplaylet.manager.UserManager import com.duben.roseplaylet.manager.UserManager
import com.duben.roseplaylet.mvp.model.JobBean import com.duben.roseplaylet.mvp.model.*
import com.duben.roseplaylet.mvp.model.JsonBean
import com.duben.roseplaylet.mvp.model.PickBean
import com.duben.roseplaylet.mvp.model.UserProfileDataBean
import com.duben.roseplaylet.mvp.presenters.EditProfilePresenter import com.duben.roseplaylet.mvp.presenters.EditProfilePresenter
import com.duben.roseplaylet.mvp.views.EditProfileView import com.duben.roseplaylet.mvp.views.EditProfileView
import com.duben.roseplaylet.ui.widgets.pick.SinglePickDialog import com.duben.roseplaylet.ui.widgets.pick.SinglePickDialog
...@@ -80,7 +77,7 @@ class EditProfileActivity : BaseActivity(), View.OnClickListener, EditProfileVie ...@@ -80,7 +77,7 @@ class EditProfileActivity : BaseActivity(), View.OnClickListener, EditProfileVie
private var avatarUrl = "" private var avatarUrl = ""
private var toUid = "" private var toUid = ""
private var userProfileData: UserProfileDataBean.UserProfileData? = null private var userProfileData: UserProfileData? = null
private val editProfilePresenter by lazy { EditProfilePresenter() } private val editProfilePresenter by lazy { EditProfilePresenter() }
...@@ -693,8 +690,8 @@ class EditProfileActivity : BaseActivity(), View.OnClickListener, EditProfileVie ...@@ -693,8 +690,8 @@ class EditProfileActivity : BaseActivity(), View.OnClickListener, EditProfileVie
} }
} }
override fun getUserInfoSuc(data: UserProfileDataBean) { override fun getUserInfoSuc(data: UserProfileData) {
this.userProfileData = data.info this.userProfileData = data
initData() initData()
} }
......
package com.duben.roseplaylet.ui.activitys package com.duben.roseplaylet.ui.activitys
import android.app.Dialog
import android.graphics.Color
import android.os.Bundle import android.os.Bundle
import android.os.Handler
import android.os.Looper
import android.text.TextUtils
import android.view.LayoutInflater
import android.view.View import android.view.View
import androidx.recyclerview.widget.LinearLayoutManager
import com.duben.library.utils.GlideUtils import com.duben.library.utils.GlideUtils
import com.duben.roseplaylet.R
import com.duben.roseplaylet.ui.activitys.base.BaseActivity
import com.duben.library.utils.nodoubleclick.AntiShake import com.duben.library.utils.nodoubleclick.AntiShake
import com.duben.roseplaylet.R
import com.duben.roseplaylet.common.Constant import com.duben.roseplaylet.common.Constant
import com.duben.roseplaylet.mvp.model.UserProfileDataBean import com.duben.roseplaylet.mvp.model.SeeWechat
import com.duben.roseplaylet.mvp.presenters.UserInfoPresenter import com.duben.roseplaylet.mvp.model.UserProfileData
import com.duben.roseplaylet.mvp.views.UserInfoView import com.duben.roseplaylet.mvp.presenters.UserProfilePresenter
import com.duben.roseplaylet.mvp.views.UserProfileView
import com.duben.roseplaylet.ui.activitys.base.BaseActivity
import com.duben.roseplaylet.ui.adapter.UserProfileAlbumAdapter
import com.duben.roseplaylet.ui.widgets.DialogListener
import com.duben.roseplaylet.ui.widgets.ToBlackConfirmDialog
import com.duben.roseplaylet.ui.widgets.ToBlackDialog
import com.google.android.material.appbar.AppBarLayout
import kotlinx.android.synthetic.main.activity_user_profile.* import kotlinx.android.synthetic.main.activity_user_profile.*
import kotlinx.android.synthetic.main.layout_user_profile_head.*
import kotlinx.android.synthetic.main.layout_user_profile_case.*
import kotlin.math.abs
/** /**
* 描述:用户信息 * 描述:用户信息
*/ */
class UserProfileActivity : BaseActivity(), View.OnClickListener, UserInfoView { class UserProfileActivity : BaseActivity(), View.OnClickListener, UserProfileView {
private var headerImg = private lateinit var userProfileAlbumAdapter: UserProfileAlbumAdapter
"https://pics0.baidu.com/feed/810a19d8bc3eb13589ac35cdb62485dcfd1f4422.jpeg"
private var toUid = "" private var toUid = ""
private val userInfoPresenter by lazy { UserInfoPresenter() } private var userIsMale = true
private val userProfilePresenter by lazy { UserProfilePresenter() }
private var userProfileData: UserProfileDataBean.UserProfileData? = null private var userProfileData: UserProfileData? = null
override fun getBundleExtras(extras: Bundle?) { override fun getBundleExtras(extras: Bundle?) {
super.getBundleExtras(extras) super.getBundleExtras(extras)
...@@ -38,40 +55,214 @@ class UserProfileActivity : BaseActivity(), View.OnClickListener, UserInfoView { ...@@ -38,40 +55,214 @@ class UserProfileActivity : BaseActivity(), View.OnClickListener, UserInfoView {
override fun isApplyKitKatTranslucency() = false override fun isApplyKitKatTranslucency() = false
override fun initViewsAndEvents() { override fun initViewsAndEvents() {
userInfoPresenter.attachView(this) userProfilePresenter.attachView(this)
userInfoPresenter.getMorePage(toUid) initAppBar()
initAlbumRcy()
initView()
initListener() initListener()
} }
override fun onResume() {
super.onResume()
userProfilePresenter.getMorePage(toUid)
}
private fun initView() { private fun initView() {
GlideUtils.loadImageView(this, headerImg, iv_header) if (userIsMale) {
// 男性
view_male.visibility = View.VISIBLE
tv_like_male.visibility = View.GONE
tv_wechat.visibility = View.VISIBLE
rl_top_female.visibility = View.GONE
fl_head_male.visibility = View.VISIBLE
tv_days.visibility = View.VISIBLE
ll_impression.visibility = View.GONE
tv_info_7.visibility = View.VISIBLE
} else {
// 女性
view_male.visibility = View.GONE
tv_like_male.visibility = View.VISIBLE
tv_wechat.visibility = View.GONE
rl_top_female.visibility = View.VISIBLE
fl_head_male.visibility = View.GONE
tv_days.visibility = View.GONE
ll_impression.visibility = View.VISIBLE
tv_info_5.visibility = View.VISIBLE
}
} }
override fun onClick(v: View?) { override fun onClick(v: View?) {
if (AntiShake.check(v?.id)) return if (AntiShake.check(v?.id)) return
when (v?.id) { when (v?.id) {
R.id.iv_left_icon -> finish() R.id.iv_head_back -> finish()
R.id.iv_head_share -> {
}
R.id.iv_head_more -> {
showToBlackDialog()
}
R.id.iv_like, R.id.tv_like_male -> {
}
R.id.tv_chat -> {
userProfileData?.let {
if (it.canChat) {
// TODO 直接聊
return
}
if (userIsMale) {
// 男性 非VIP TODO 弹解锁聊天弹框
} else {
// 女性
// TODO 弹出认证弹框
}
}
}
R.id.tv_wechat -> {
userProfilePresenter.seeWechat(toUid)
}
} }
} }
private fun initListener() { private fun initListener() {
// iv_left_icon.setOnClickListener(this) iv_head_back.setOnClickListener(this)
iv_head_share.setOnClickListener(this)
iv_head_more.setOnClickListener(this)
tv_wechat.setOnClickListener(this) tv_wechat.setOnClickListener(this)
tv_chat.setOnClickListener(this) tv_chat.setOnClickListener(this)
tv_like_male.setOnClickListener(this)
iv_like.setOnClickListener(this)
}
override fun getMorePageSuc(data: UserProfileData) {
this.userProfileData = data
userIsMale = data.sex == 1
initView()
initData()
}
private fun initData() {
userProfileData?.let {
if (it.images?.isNotEmpty() == true) {
// it.images
userProfileAlbumAdapter.setNewInstance(arrayListOf())
}
if (userIsMale) {
// 男性
tv_days.text = "已注册" + it.days
GlideUtils.loadImageView(this, it.headerUrl, iv_avatar_male)
tv_label_distance.text = it.distance + "km"
if (TextUtils.isEmpty(it.introduce)) {
tv_introduce_text.text = "小姐姐你好呀!"
} else {
tv_introduce_text.text = it.introduce
}
// 喜欢女生特质
if (TextUtils.isEmpty(it.findDescribe)) {
tv_info_7.text = it.findDescribe
} else {
tv_info_7.text = "秘密"
}
if (it.online) {
tv_online_male.visibility = View.VISIBLE
} else {
tv_online_male.visibility = View.GONE
}
} else {
GlideUtils.loadImageView(this, it.headerUrl, iv_avatar_female)
tv_label_distance.text = "距你" + it.distance + "km"
if (TextUtils.isEmpty(it.introduce)) {
tv_introduce_text.text = "不知道写什么耶,哥哥帮我想想~"
} else {
tv_introduce_text.text = it.introduce
}
tv_active.text = it.hallTime
// 身型
if (TextUtils.isEmpty(it.appearance)) {
tv_info_5.text = it.appearance
} else {
tv_info_5.text = "秘密"
}
}
tv_label_name.text = it.nickName
tv_like_count.text = "" + it.likeCount + "人喜欢"
tv_label_age.text = it.age
if (!TextUtils.isEmpty(it.city)) {
tv_label_address.visibility = View.VISIBLE
tv_label_address.text = it.city
}
tv_info_1.visibility = View.GONE
// 身高
if (TextUtils.isEmpty(it.userHeight)) {
tv_info_2.text = it.userHeight
} else {
tv_info_2.text = "秘密"
}
// 体重
if (TextUtils.isEmpty(it.bodyWeight)) {
tv_info_3.text = it.bodyWeight
} else {
tv_info_3.text = "秘密"
}
// 城市
if (TextUtils.isEmpty(it.city)) {
tv_info_4.text = it.city
} else {
tv_info_4.text = "秘密"
}
// 个性标签
if (TextUtils.isEmpty(it.tagsCommon)) {
tv_info_6.text = it.tagsCommon
} else {
tv_info_6.text = "秘密"
}
// 工作
if (TextUtils.isEmpty(it.career)) {
tv_info_8.text = it.career
} else {
tv_info_8.text = "秘密"
}
}
} }
override fun getMorePageSuc(data: UserProfileDataBean) { private fun initAlbumRcy() {
this.userProfileData = data.info rcy_album.layoutManager = LinearLayoutManager(context)
val userProfileAlbumAdapter = UserProfileAlbumAdapter()
userProfileAlbumAdapter.animationEnable = false
rcy_album.adapter = userProfileAlbumAdapter
val emptyView = LayoutInflater.from(this).inflate(R.layout.item_empty_data, null)
userProfileAlbumAdapter.setEmptyView(emptyView)
userProfileAlbumAdapter.setOnItemChildClickListener { adapter, view, position ->
}
} }
override fun getMorePageFail() { override fun getMorePageFail() {
} }
override fun seeWechatSuc() { override fun seeWechatSuc(data: SeeWechat) {
if (data.canSee) {
if (!data.hasWechat) {
showToast(data.errMsg)
} else {
// TODO 直接看微信
}
} else {
// TODO 弹VIP弹框
}
} }
override fun seeWechatFail() { override fun seeWechatFail() {
...@@ -83,9 +274,89 @@ class UserProfileActivity : BaseActivity(), View.OnClickListener, UserInfoView { ...@@ -83,9 +274,89 @@ class UserProfileActivity : BaseActivity(), View.OnClickListener, UserInfoView {
override fun unlockWechatFail() { override fun unlockWechatFail() {
} }
override fun toWhiteSuc() {
showToast("已将对方移出黑名单!")
userProfileData?.black = 0
}
override fun toBlackSuc() {
showToast("拉黑成功!")
userProfileData?.black = 1
}
override fun onDestroy() { override fun onDestroy() {
userInfoPresenter.detachView() userProfilePresenter.detachView()
super.onDestroy() super.onDestroy()
} }
private fun showToBlackDialog() {
userProfileData?.let {
ToBlackDialog(this, it.black == 0, object : DialogListener() {
override fun onClick(dialog: Dialog?, v: View?) {
super.onClick(dialog, v)
dialog?.dismiss()
when (v?.id) {
R.id.tv_to_black -> {
if (it.black == 1) {
userProfilePresenter.toWhite("" + it.uid)
} else {
Handler(Looper.getMainLooper()).postDelayed({
ToBlackConfirmDialog(this@UserProfileActivity,
object : DialogListener() {
override fun onClick(dialog: Dialog?, v: View?) {
super.onClick(dialog, v)
dialog?.dismiss()
if (v?.id == R.id.tv_confirm) {
userProfilePresenter.toBlack("" + it.uid)
}
}
}).show()
}, 500)
}
}
}
}
}).show()
}
}
private fun initAppBar() {
appbar.addOnOffsetChangedListener(AppBarLayout.OnOffsetChangedListener { appBarLayout, verticalOffset ->
//verticalOffset 当前偏移量 appBarLayout.getTotalScrollRange() 最大高度 便宜值
val offset = abs(verticalOffset) //目的是将负数转换为绝对正数;
if (userIsMale) {
} else {
// 标题栏的渐变
toolbar.setBackgroundColor(
changeAlpha(
resources.getColor(R.color.color_232122),
abs(verticalOffset * 1.0f) / appBarLayout.totalScrollRange
)
)
}
/**
* 当前最大高度 在减去已偏移值 获取浮动 先显示在隐藏
*/
if (offset < appBarLayout.totalScrollRange) {
ll_head_center.alpha =
1 - (appBarLayout.totalScrollRange - offset * 1.0f) / (appBarLayout.totalScrollRange)
} else if (offset > appBarLayout.totalScrollRange) {
val floate =
(offset - appBarLayout.totalScrollRange) * 1.0f / (appBarLayout.totalScrollRange)
ll_head_center.alpha = 1 - floate
}
})
}
/**
* 根据百分比改变颜色透明度
*/
fun changeAlpha(color: Int, fraction: Float): Int {
val alpha = (Color.alpha(color) * fraction).toInt()
return Color.argb(alpha, 35, 33, 34)
}
} }
package com.duben.roseplaylet.ui.activitys package com.duben.roseplaylet.ui.activitys
import android.content.Intent import android.content.Intent
import android.graphics.Color
import android.text.TextUtils import android.text.TextUtils
import android.view.View import android.view.View
import com.duben.library.utils.nodoubleclick.AntiShake import com.duben.library.utils.nodoubleclick.AntiShake
...@@ -25,8 +26,11 @@ class WriteSignatureActivity : BaseActivity(), View.OnClickListener, WriteMoodVi ...@@ -25,8 +26,11 @@ class WriteSignatureActivity : BaseActivity(), View.OnClickListener, WriteMoodVi
override fun initViewsAndEvents() { override fun initViewsAndEvents() {
writeMoodPresenter.attachView(this) writeMoodPresenter.attachView(this)
tv_title.text = "个性签名" tv_title.text = "个性签名"
tv_title.setTextColor(Color.WHITE)
iv_left_icon.visibility = View.VISIBLE
iv_left_icon.setImageResource(R.mipmap.ic_arrow_white)
line.visibility = View.GONE
initListener() initListener()
} }
......
...@@ -20,6 +20,7 @@ import android.view.WindowManager; ...@@ -20,6 +20,7 @@ import android.view.WindowManager;
import android.view.inputmethod.InputMethodManager; import android.view.inputmethod.InputMethodManager;
import android.widget.EditText; import android.widget.EditText;
import com.duben.roseplaylet.utils.StatusBarUtil;
import com.gyf.barlibrary.ImmersionBar; import com.gyf.barlibrary.ImmersionBar;
import com.duben.roseplaylet.MintsApplication; import com.duben.roseplaylet.MintsApplication;
import com.duben.roseplaylet.R; import com.duben.roseplaylet.R;
...@@ -46,7 +47,6 @@ public abstract class BaseActivity extends BaseAppCompatActivity implements Base ...@@ -46,7 +47,6 @@ public abstract class BaseActivity extends BaseAppCompatActivity implements Base
try { try {
if (TextUtils.equals(getClass().getSimpleName(), "SplashActivity") if (TextUtils.equals(getClass().getSimpleName(), "SplashActivity")
|| TextUtils.equals(getClass().getSimpleName(), "GuideActivity") || TextUtils.equals(getClass().getSimpleName(), "GuideActivity")
) { ) {
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN); WindowManager.LayoutParams.FLAG_FULLSCREEN);
...@@ -54,10 +54,14 @@ public abstract class BaseActivity extends BaseAppCompatActivity implements Base ...@@ -54,10 +54,14 @@ public abstract class BaseActivity extends BaseAppCompatActivity implements Base
|| TextUtils.equals(getClass().getSimpleName(), "RealAuthActivity") || TextUtils.equals(getClass().getSimpleName(), "RealAuthActivity")
|| TextUtils.equals(getClass().getSimpleName(), "EditProfileActivity") || TextUtils.equals(getClass().getSimpleName(), "EditProfileActivity")
|| TextUtils.equals(getClass().getSimpleName(), "WriteSignatureActivity") || TextUtils.equals(getClass().getSimpleName(), "WriteSignatureActivity")
|| TextUtils.equals(getClass().getSimpleName(), "EditProfileActivity")
|| TextUtils.equals(getClass().getSimpleName(), "UserProfileActivity")
|| TextUtils.equals(getClass().getSimpleName(), "MainActivity")
) { ) {
setDarkStatusBar(); setDarkStatusBar();
} else { } else {
setLightStatusBar(); StatusBarUtil.StatusBarLightMode(this);
// setLightStatusBar();
} }
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
...@@ -89,8 +93,8 @@ public abstract class BaseActivity extends BaseAppCompatActivity implements Base ...@@ -89,8 +93,8 @@ public abstract class BaseActivity extends BaseAppCompatActivity implements Base
private void setDarkStatusBar() { private void setDarkStatusBar() {
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION); getWindow().clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
getWindow().addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS); getWindow().addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
getWindow().setStatusBarColor(getResources().getColor(R.color.black)); getWindow().setStatusBarColor(getResources().getColor(R.color.full_transparent));
getWindow().setNavigationBarColor(getResources().getColor(R.color.black)); getWindow().setNavigationBarColor(getResources().getColor(R.color.full_transparent));
int vis = getWindow().getDecorView().getSystemUiVisibility(); int vis = getWindow().getDecorView().getSystemUiVisibility();
vis |= View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR; vis |= View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR;
getWindow().getDecorView().setSystemUiVisibility(vis); getWindow().getDecorView().setSystemUiVisibility(vis);
......
...@@ -3,7 +3,12 @@ package com.duben.roseplaylet.ui.adapter ...@@ -3,7 +3,12 @@ package com.duben.roseplaylet.ui.adapter
import android.content.Intent import android.content.Intent
import android.os.Bundle import android.os.Bundle
import android.view.View import android.view.View
import android.widget.ImageView
import android.widget.TextView import android.widget.TextView
import com.airbnb.lottie.LottieAnimationView
import com.airbnb.lottie.LottieComposition
import com.airbnb.lottie.LottieCompositionFactory
import com.airbnb.lottie.LottieDrawable
import com.chad.library.adapter.base.BaseQuickAdapter import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.duben.library.utils.GlideUtils import com.duben.library.utils.GlideUtils
...@@ -14,10 +19,12 @@ import com.duben.roseplaylet.ui.activitys.UserProfileActivity ...@@ -14,10 +19,12 @@ import com.duben.roseplaylet.ui.activitys.UserProfileActivity
class SquareAdapter : BaseQuickAdapter<HallList.ListDTO, BaseViewHolder>(R.layout.item_square) { class SquareAdapter : BaseQuickAdapter<HallList.ListDTO, BaseViewHolder>(R.layout.item_square) {
private var isBlur = false
override fun convert(holder: BaseViewHolder, item: HallList.ListDTO) { override fun convert(holder: BaseViewHolder, item: HallList.ListDTO) {
holder.getView<TextView>(R.id.tv_recommend_name).text = item.nickName holder.getView<TextView>(R.id.tv_recommend_name).text = item.nickName
holder.getView<TextView>(R.id.tv_status).text = item.hallTime holder.getView<TextView>(R.id.tv_status).text = item.hallTime
holder.getView<TextView>(R.id.tv_recommend_location).text = item.distance holder.getView<TextView>(R.id.tv_recommend_location).text = "" + item.distance + "km"
val tvRealLabel = holder.getView<TextView>(R.id.tv_real_label) val tvRealLabel = holder.getView<TextView>(R.id.tv_real_label)
if (item.idcardStatus == 1) { if (item.idcardStatus == 1) {
...@@ -28,11 +35,35 @@ class SquareAdapter : BaseQuickAdapter<HallList.ListDTO, BaseViewHolder>(R.layou ...@@ -28,11 +35,35 @@ class SquareAdapter : BaseQuickAdapter<HallList.ListDTO, BaseViewHolder>(R.layou
holder.getView<TextView>(R.id.tv_recommend_location).text holder.getView<TextView>(R.id.tv_recommend_location).text
if (isBlur) {
GlideUtils.loadBlurImageView( GlideUtils.loadBlurImageView(
holder.itemView.context, holder.itemView.context,
item.headerUrl, item.headerUrl,
holder.getView(R.id.iv_recommend_header) holder.getView(R.id.iv_recommend_header)
) )
} else {
GlideUtils.loadImageViewNoAnim2(
holder.itemView.context,
item.headerUrl,
holder.getView(R.id.iv_recommend_header)
)
}
if (item.likeStatus == 0) {
holder.getView<ImageView>(R.id.iv_heart)
} else {
holder.getView<ImageView>(R.id.iv_heart)
}
holder.getView<ImageView>(R.id.iv_heart).setOnClickListener {
mOnClickLikeListener?.onClickLike(holder.adapterPosition)
if (item.likeStatus == 0) {
playCollectAnim(holder.getView(R.id.iv_heart))
} else {
playCancelCollectAnim(holder.getView(R.id.iv_heart))
}
}
holder.itemView.setOnClickListener { holder.itemView.setOnClickListener {
val intent = Intent(it.context, UserProfileActivity::class.java) val intent = Intent(it.context, UserProfileActivity::class.java)
...@@ -42,4 +73,44 @@ class SquareAdapter : BaseQuickAdapter<HallList.ListDTO, BaseViewHolder>(R.layou ...@@ -42,4 +73,44 @@ class SquareAdapter : BaseQuickAdapter<HallList.ListDTO, BaseViewHolder>(R.layou
it.context.startActivity(intent) it.context.startActivity(intent)
} }
} }
fun setIsBlur(isBlur: Boolean) {
this.isBlur = isBlur
}
private fun playCollectAnim(view: LottieAnimationView) {
val lottieDrawable = LottieDrawable()
LottieCompositionFactory.fromAsset(context, "home_collect.json")
.addListener { result: LottieComposition? ->
lottieDrawable.setImagesAssetsFolder("images/")
lottieDrawable.composition = result
lottieDrawable.loop(false)
lottieDrawable.playAnimation()
}
view.setImageDrawable(lottieDrawable)
}
private fun playCancelCollectAnim(view: LottieAnimationView) {
val lottieDrawable = LottieDrawable()
LottieCompositionFactory.fromAsset(context, "home_cancel_collect.json")
.addListener { result: LottieComposition? ->
lottieDrawable.setImagesAssetsFolder("images/")
lottieDrawable.composition = result
lottieDrawable.loop(false)
lottieDrawable.playAnimation()
}
view.setImageDrawable(lottieDrawable)
}
private var mOnClickLikeListener: OnClickLikeListener? = null
fun setOnClickLikeListener(onClickLikeListener: OnClickLikeListener) {
this.mOnClickLikeListener = onClickLikeListener
}
interface OnClickLikeListener {
fun onClickLike(position: Int)
}
} }
\ No newline at end of file
...@@ -3,6 +3,7 @@ package com.duben.roseplaylet.ui.adapter ...@@ -3,6 +3,7 @@ package com.duben.roseplaylet.ui.adapter
import androidx.fragment.app.Fragment import androidx.fragment.app.Fragment
import androidx.viewpager2.adapter.FragmentStateAdapter import androidx.viewpager2.adapter.FragmentStateAdapter
import com.duben.roseplaylet.ui.fragment.SquareListFragment import com.duben.roseplaylet.ui.fragment.SquareListFragment
import com.duben.roseplaylet.utils.LogUtil
class SquarePageAdapter( class SquarePageAdapter(
private val data: List<String>, private val data: List<String>,
...@@ -18,6 +19,7 @@ class SquarePageAdapter( ...@@ -18,6 +19,7 @@ class SquarePageAdapter(
override fun getItemCount() = data.size override fun getItemCount() = data.size
override fun createFragment(position: Int): Fragment { override fun createFragment(position: Int): Fragment {
LogUtil.d("AAAAAAAAAA$position")
val newFragment = SquareListFragment.newInstance(position + 1) val newFragment = SquareListFragment.newInstance(position + 1)
fragments[position] = newFragment fragments[position] = newFragment
return newFragment return newFragment
......
package com.duben.roseplaylet.ui.adapter
import android.view.View
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.duben.library.utils.GlideUtils
import com.duben.roseplaylet.R
class UserProfileAlbumAdapter :
BaseQuickAdapter<String, BaseViewHolder>(R.layout.item_user_profile_album) {
private var isShowAuth = false
override fun convert(holder: BaseViewHolder, item: String) {
if (isShowAuth) {
holder.getView<View>(R.id.tv_auth).visibility = View.VISIBLE
} else {
holder.getView<View>(R.id.tv_auth).visibility = View.GONE
}
GlideUtils.loadImageView(context, item, holder.getView(R.id.iv_photo))
}
}
\ No newline at end of file
...@@ -19,6 +19,7 @@ import com.duben.roseplaylet.ad.AdManager ...@@ -19,6 +19,7 @@ import com.duben.roseplaylet.ad.AdManager
import com.duben.roseplaylet.ad.banner.BannerManager import com.duben.roseplaylet.ad.banner.BannerManager
import com.duben.roseplaylet.common.AppConfig import com.duben.roseplaylet.common.AppConfig
import com.duben.roseplaylet.common.Constant import com.duben.roseplaylet.common.Constant
import com.duben.roseplaylet.manager.IMHelper
import com.duben.roseplaylet.manager.LocalVedioManager import com.duben.roseplaylet.manager.LocalVedioManager
import com.duben.roseplaylet.manager.TrackManager import com.duben.roseplaylet.manager.TrackManager
import com.duben.roseplaylet.manager.UserManager import com.duben.roseplaylet.manager.UserManager
...@@ -59,6 +60,7 @@ class MainFragment : LazyLoadBaseFragment(), HomeView, View.OnClickListener, OnR ...@@ -59,6 +60,7 @@ class MainFragment : LazyLoadBaseFragment(), HomeView, View.OnClickListener, OnR
return fragment return fragment
} }
} }
var mSelectTabIndex = -1 var mSelectTabIndex = -1
private val tabsData = mutableListOf<HotStyleTypesBean>() private val tabsData = mutableListOf<HotStyleTypesBean>()
private val bannerList = mutableListOf<BannerBean>() private val bannerList = mutableListOf<BannerBean>()
...@@ -113,6 +115,7 @@ class MainFragment : LazyLoadBaseFragment(), HomeView, View.OnClickListener, OnR ...@@ -113,6 +115,7 @@ class MainFragment : LazyLoadBaseFragment(), HomeView, View.OnClickListener, OnR
if (userManager.vipFlag) { if (userManager.vipFlag) {
homePresenter.signAfterSeconds() homePresenter.signAfterSeconds()
} }
IMHelper.instance.getImMsg()
TrackManager.getInstance().getMyInfo() TrackManager.getInstance().getMyInfo()
} }
......
...@@ -11,7 +11,7 @@ import com.duben.roseplaylet.ad.express.ExpressAdCallback ...@@ -11,7 +11,7 @@ import com.duben.roseplaylet.ad.express.ExpressAdCallback
import com.duben.roseplaylet.ad.express.MyExpressManager import com.duben.roseplaylet.ad.express.MyExpressManager
import com.duben.roseplaylet.common.AppConfig import com.duben.roseplaylet.common.AppConfig
import com.duben.roseplaylet.common.Constant import com.duben.roseplaylet.common.Constant
import com.duben.roseplaylet.manager.GenerateTestUserSig import com.duben.roseplaylet.manager.IMHelper
import com.duben.roseplaylet.manager.LoginWrapper import com.duben.roseplaylet.manager.LoginWrapper
import com.duben.roseplaylet.manager.UserManager import com.duben.roseplaylet.manager.UserManager
import com.duben.roseplaylet.mvp.model.UserBean import com.duben.roseplaylet.mvp.model.UserBean
...@@ -98,10 +98,9 @@ class MyFragment : LazyLoadBaseFragment(), MyView, View.OnClickListener { ...@@ -98,10 +98,9 @@ class MyFragment : LazyLoadBaseFragment(), MyView, View.OnClickListener {
val tuiLoginConfig = LoginWrapper.getLoginConfig() val tuiLoginConfig = LoginWrapper.getLoginConfig()
tuiLoginConfig.isInitLocalStorageOnly = true tuiLoginConfig.isInitLocalStorageOnly = true
val userID = instance.userID val userID = instance.userID
val userSig = GenerateTestUserSig.genTestUserSig(userID) val userSig = IMHelper.instance.getUserSig()
LoginWrapper.getInstance().loginIMSDK(MintsApplication.getContext(), LoginWrapper.getInstance().loginIMSDK(MintsApplication.getContext(),
AppConfig.IM_SDK_APPID, userID, userSig, tuiLoginConfig, object : TUICallback() { IMHelper.IM_SDK_APPID, userID, userSig, tuiLoginConfig, object : TUICallback() {
override fun onSuccess() { override fun onSuccess() {
LogUtil.i("LoginWrapper ", "imLogin onSuccess") LogUtil.i("LoginWrapper ", "imLogin onSuccess")
startChatActivity() startChatActivity()
......
...@@ -11,8 +11,10 @@ import com.duben.roseplaylet.ui.fragment.base.LazyLoadBaseFragment ...@@ -11,8 +11,10 @@ import com.duben.roseplaylet.ui.fragment.base.LazyLoadBaseFragment
import com.scwang.smartrefresh.layout.api.RefreshLayout import com.scwang.smartrefresh.layout.api.RefreshLayout
import com.scwang.smartrefresh.layout.listener.OnLoadMoreListener import com.scwang.smartrefresh.layout.listener.OnLoadMoreListener
import com.duben.roseplaylet.common.AppConfig import com.duben.roseplaylet.common.AppConfig
import com.duben.roseplaylet.manager.UserManager
import com.duben.roseplaylet.mvp.presenters.SquarePresenter import com.duben.roseplaylet.mvp.presenters.SquarePresenter
import com.duben.roseplaylet.mvp.views.SquareView import com.duben.roseplaylet.mvp.views.SquareView
import com.duben.roseplaylet.ui.activitys.UserProfileActivity
import com.duben.roseplaylet.ui.adapter.SquareAdapter import com.duben.roseplaylet.ui.adapter.SquareAdapter
import kotlinx.android.synthetic.main.fragment_square_list.* import kotlinx.android.synthetic.main.fragment_square_list.*
...@@ -42,11 +44,12 @@ class SquareListFragment : LazyLoadBaseFragment(), SquareView, OnLoadMoreListene ...@@ -42,11 +44,12 @@ class SquareListFragment : LazyLoadBaseFragment(), SquareView, OnLoadMoreListene
override fun initViewsAndEvents() { override fun initViewsAndEvents() {
squarePresenter.attachView(this) squarePresenter.attachView(this)
initRecy()
initListener()
arguments?.let { arguments?.let {
mType = it.getInt(SQUARE_TYPE, 1) mType = it.getInt(SQUARE_TYPE, 1)
} }
initListener()
initRecy()
} }
override fun onResume() { override fun onResume() {
...@@ -83,11 +86,29 @@ class SquareListFragment : LazyLoadBaseFragment(), SquareView, OnLoadMoreListene ...@@ -83,11 +86,29 @@ class SquareListFragment : LazyLoadBaseFragment(), SquareView, OnLoadMoreListene
private fun initRecy() { private fun initRecy() {
squareAdapter = SquareAdapter() squareAdapter = SquareAdapter()
if (mType == 3 && !UserManager.getInstance().vipFlag) {
squareAdapter.setIsBlur(true)
} else {
squareAdapter.setIsBlur(false)
}
squareAdapter.animationEnable = false squareAdapter.animationEnable = false
rcy_square_list.adapter = squareAdapter rcy_square_list.adapter = squareAdapter
val emptyView = val emptyView =
LayoutInflater.from(requireContext()).inflate(R.layout.item_empty_data, null) LayoutInflater.from(requireContext()).inflate(R.layout.item_empty_data, null)
squareAdapter.setEmptyView(emptyView) squareAdapter.setEmptyView(emptyView)
squareAdapter.setOnItemChildClickListener { adapter, view, position ->
val bundle = Bundle()
bundle.putString(Constant.TO_UID, squareAdapter.data[position].uid.toString())
readyGo(UserProfileActivity::class.java, bundle)
}
squareAdapter.setOnClickLikeListener(object : SquareAdapter.OnClickLikeListener {
override fun onClickLike(position: Int) {
squarePresenter.toLike(
squareAdapter.data[position].uid.toString(),
squareAdapter.data[position].likeStatus
)
}
})
} }
private fun initListener() { private fun initListener() {
......
package com.duben.roseplaylet.ui.widgets
import android.app.Dialog
import android.content.Context
import android.view.Gravity
import android.view.KeyEvent
import android.view.View
import android.view.WindowManager
import android.widget.ImageView
import android.widget.TextView
import com.duben.roseplaylet.R
class ToBlackConfirmDialog(private val context: Context, private val listener: DialogListener?) :
Dialog(context, R.style.dialog) {
private val lp: WindowManager.LayoutParams
private val tv_confirm: TextView
private val iv_close: ImageView
init {
setContentView(R.layout.dialog_to_black_confirm)
// 设置window属性
lp = window!!.attributes
lp.gravity = Gravity.CENTER
lp.width = WindowManager.LayoutParams.MATCH_PARENT
lp.windowAnimations = R.style.DialogAnimFade
window!!.attributes = lp
// 设置外部不可关闭
setCancelable(false)
setCanceledOnTouchOutside(false)
setOnKeyListener { _, i, _ -> i == KeyEvent.KEYCODE_BACK }
tv_confirm = findViewById<View>(R.id.tv_confirm) as TextView
iv_close = findViewById<View>(R.id.iv_close) as ImageView
iv_close.setOnClickListener(listener)
tv_confirm.setOnClickListener(listener)
listener?.setDialog(this)
}
}
\ No newline at end of file
package com.duben.roseplaylet.ui.widgets
import android.app.Dialog
import android.content.Context
import android.view.Gravity
import android.view.View
import android.view.WindowManager
import android.widget.TextView
import com.duben.roseplaylet.R
class ToBlackDialog(
private val context: Context,
private val isBlack: Boolean,
private val listener: DialogListener
) : Dialog(context, R.style.dialog) {
private val lp: WindowManager.LayoutParams
private val tv_to_black: TextView
private val tv_cancel: TextView
init {
setContentView(R.layout.dialog_to_black)
// 设置window属性
lp = window!!.attributes
lp.gravity = Gravity.BOTTOM
lp.width = WindowManager.LayoutParams.MATCH_PARENT
lp.windowAnimations = R.style.DialogAnimBottom
window!!.attributes = lp
// 查找View
tv_to_black = findViewById<View>(R.id.tv_to_black) as TextView
tv_cancel = findViewById<View>(R.id.tv_cancel) as TextView
if (isBlack) {
tv_to_black.text = "拉黑(屏蔽对方)"
} else {
tv_to_black.text = "移出黑名单(取消屏蔽)"
}
tv_to_black.setOnClickListener(listener)
tv_cancel.setOnClickListener(listener)
listener.setDialog(this)
}
}
\ No newline at end of file
...@@ -33,10 +33,6 @@ object JobData { ...@@ -33,10 +33,6 @@ object JobData {
} catch (e: Exception) { } catch (e: Exception) {
e.printStackTrace() e.printStackTrace()
} }
LogUtil.d("AAAAAAAAALLLLLLLLLLLLLLL")
Logger.d(data.toString())
return data return data
} }
......
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<!-- 填充的颜色 -->
<solid android:color="@color/color_E4C46C" />
<!-- 设置按钮的四个角为弧形 -->
<!-- android:radius 弧形的半径 -->
<corners
android:bottomLeftRadius="10dp"
android:topRightRadius="10dp" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" <shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle"> android:shape="rectangle">
<!-- 填充的颜色 -->
<solid android:color="@color/color_232122" /> <gradient
<!-- 设置按钮的四个角为弧形 --> android:angle="225"
<!-- android:radius 弧形的半径 --> android:endColor="@color/color_1cffffff"
android:startColor="@color/color_1fffcc32" />
<corners android:radius="10dp" /> <corners android:radius="10dp" />
</shape> </shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<!-- 填充的颜色 -->
<solid android:color="@color/color_EAE3E0" />
<!-- 设置按钮的四个角为弧形 -->
<!-- android:radius 弧形的半径 -->
<corners android:radius="10dip" />
</shape>
\ No newline at end of file
...@@ -9,32 +9,36 @@ ...@@ -9,32 +9,36 @@
android:layout_height="match_parent"> android:layout_height="match_parent">
<com.google.android.material.appbar.AppBarLayout <com.google.android.material.appbar.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@android:color/transparent" android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:layout_behavior=".ui.widgets.AppBarLayoutBehavior">
<com.google.android.material.appbar.CollapsingToolbarLayout <com.google.android.material.appbar.CollapsingToolbarLayout
android:id="@+id/toolbar_layout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:contentScrim="@android:color/transparent" app:contentScrim="@color/color_232122"
app:layout_scrollFlags="scroll|enterAlways|enterAlwaysCollapsed"> app:layout_scrollFlags="scroll|exitUntilCollapsed">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<RelativeLayout <RelativeLayout
android:id="@+id/rl_top_female"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:layout_collapseParallaxMultiplier="0.5"> android:visibility="visible">
<ImageView <ImageView
android:id="@+id/iv_header" android:id="@+id/iv_avatar_female"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="300dp" android:layout_height="300dp" />
app:layout_collapseMode="parallax" />
<TextView <TextView
android:id="@+id/tv_status" android:id="@+id/tv_active"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentBottom="true" android:layout_alignParentBottom="true"
...@@ -50,23 +54,36 @@ ...@@ -50,23 +54,36 @@
</RelativeLayout> </RelativeLayout>
<View
android:id="@+id/view_male"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="visible" />
</com.google.android.material.appbar.CollapsingToolbarLayout> <include layout="@layout/layout_user_profile_case" />
<LinearLayout </LinearLayout>
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="50dp" android:layout_height="80dp"
android:background="@color/green"> android:fitsSystemWindows="true"
app:layout_collapseMode="pin"
app:popupTheme="@style/ThemeOverlay.AppCompat.Dark">
<include layout="@layout/layout_user_profile_head" />
</LinearLayout> </androidx.appcompat.widget.Toolbar>
</com.google.android.material.appbar.CollapsingToolbarLayout>
</com.google.android.material.appbar.AppBarLayout> </com.google.android.material.appbar.AppBarLayout>
<androidx.core.widget.NestedScrollView <androidx.core.widget.NestedScrollView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@color/black" android:background="@color/color_232122"
app:layout_behavior="@string/appbar_scrolling_view_behavior"> app:layout_behavior="@string/appbar_scrolling_view_behavior">
<LinearLayout <LinearLayout
...@@ -74,146 +91,6 @@ ...@@ -74,146 +91,6 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical"> android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:paddingTop="5dp"
android:paddingBottom="5dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal">
<ImageView
android:id="@+id/iv_avatar"
android:layout_width="70dp"
android:layout_height="70dp"
android:layout_marginStart="20dp"
android:src="@mipmap/ic_my_avat" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="80dp"
android:layout_marginStart="10dp"
android:layout_weight="1"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:id="@+id/tv_label_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="都看到"
android:textColor="@color/white" />
<TextView
android:id="@+id/tv_label_isvip"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:background="@drawable/shape_label_white"
android:paddingStart="4dp"
android:paddingTop="2dp"
android:paddingEnd="4dp"
android:paddingBottom="2dp"
android:text="VIP"
android:textColor="@color/black"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginTop="3dp"
android:layout_weight="1"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:id="@+id/tv_label_age"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/shape_label_white"
android:paddingStart="4dp"
android:paddingTop="2dp"
android:paddingEnd="4dp"
android:paddingBottom="2dp"
android:text="44岁"
android:textColor="@color/black" />
<TextView
android:id="@+id/tv_label_height"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:background="@drawable/shape_label_white"
android:paddingStart="4dp"
android:paddingTop="2dp"
android:paddingEnd="4dp"
android:paddingBottom="2dp"
android:text="172cm"
android:textColor="@color/black" />
<TextView
android:id="@+id/tv_label_address"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:background="@drawable/shape_label_white"
android:paddingStart="4dp"
android:paddingTop="2dp"
android:paddingEnd="4dp"
android:paddingBottom="2dp"
android:text="北京北京"
android:textColor="@color/black" />
</LinearLayout>
<TextView
android:id="@+id/tv_ip"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="登录IP:12323213"
android:textColor="@color/white" />
</LinearLayout>
<LinearLayout
android:layout_width="60dp"
android:layout_height="wrap_content"
android:layout_marginEnd="10dp"
android:gravity="center_horizontal"
android:orientation="vertical">
<ImageView
android:layout_width="30dp"
android:layout_height="30dp"
android:src="@drawable/djx_like" />
<TextView
android:id="@+id/tv_like_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:text="10人喜欢"
android:textColor="@color/white" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
...@@ -235,13 +112,14 @@ ...@@ -235,13 +112,14 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" /> android:layout_height="wrap_content" />
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
android:id="@+id/ll_impression"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical"> android:orientation="vertical"
android:visibility="gone">
<TextView <TextView
android:id="@+id/tv_impression" android:id="@+id/tv_impression"
...@@ -292,7 +170,8 @@ ...@@ -292,7 +170,8 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="10dp" android:layout_marginStart="10dp"
android:orientation="vertical"> android:orientation="vertical"
android:visibility="visible">
<TextView <TextView
android:id="@+id/tv_info" android:id="@+id/tv_info"
...@@ -388,8 +267,30 @@ ...@@ -388,8 +267,30 @@
android:textSize="16sp" android:textSize="16sp"
app:drawableStartCompat="@mipmap/ic_text_clear" /> app:drawableStartCompat="@mipmap/ic_text_clear" />
<TextView
android:id="@+id/tv_info_8"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:drawablePadding="10dp"
android:gravity="center_vertical"
android:text="@string/app_name"
android:textColor="@color/gray"
android:textSize="16sp"
app:drawableStartCompat="@mipmap/ic_text_clear" />
</LinearLayout> </LinearLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="30dp"
android:layout_marginBottom="100dp"
android:text="请勿通过约会进行不法交易,如被举报核实将做封号处理"
android:textColor="@color/color_848389"
android:textSize="12sp" />
</LinearLayout> </LinearLayout>
</androidx.core.widget.NestedScrollView> </androidx.core.widget.NestedScrollView>
...@@ -400,7 +301,7 @@ ...@@ -400,7 +301,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="45dp" android:layout_height="45dp"
android:layout_gravity="bottom" android:layout_gravity="bottom"
android:layout_marginBottom="50dp" android:layout_marginBottom="30dp"
android:orientation="horizontal" android:orientation="horizontal"
android:paddingStart="20dp" android:paddingStart="20dp"
android:paddingEnd="20dp"> android:paddingEnd="20dp">
...@@ -416,7 +317,20 @@ ...@@ -416,7 +317,20 @@
android:gravity="center" android:gravity="center"
android:text="她的微信" android:text="她的微信"
android:textColor="@color/color_0B0907" android:textColor="@color/color_0B0907"
android:textSize="18sp" /> android:textSize="16sp" />
<TextView
android:id="@+id/tv_like_male"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginEnd="15dp"
android:layout_weight="1"
android:background="@drawable/shape_profile_chat"
android:elevation="1dp"
android:gravity="center"
android:text="喜欢"
android:textColor="@color/color_0B0907"
android:textSize="16sp" />
<TextView <TextView
android:id="@+id/tv_chat" android:id="@+id/tv_chat"
...@@ -429,7 +343,7 @@ ...@@ -429,7 +343,7 @@
android:gravity="center" android:gravity="center"
android:text="私聊" android:text="私聊"
android:textColor="@color/color_0B0907" android:textColor="@color/color_0B0907"
android:textSize="18sp" /> android:textSize="16sp" />
</LinearLayout> </LinearLayout>
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
android:paddingStart="10dp" android:paddingStart="10dp"
android:paddingEnd="10dp" android:paddingEnd="10dp"
android:textColor="@color/color_8F8E94" android:textColor="@color/color_8F8E94"
android:textSize="16sp" /> android:textSize="14sp" />
<RelativeLayout <RelativeLayout
android:layout_width="match_parent" android:layout_width="match_parent"
......
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/shape_main_black"
android:orientation="vertical">
<TextView
android:id="@+id/tv_to_black"
android:layout_width="match_parent"
android:layout_height="60dp"
android:gravity="center"
android:text="拉黑(屏蔽对方)"
android:textColor="@color/white"
android:textSize="16sp" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/graya" />
<TextView
android:id="@+id/tv_cancel"
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="@color/gray"
android:gravity="center"
android:text="取消"
android:textColor="@color/white"
android:textSize="16sp" />
</LinearLayout>
</FrameLayout>
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginStart="30dp"
android:layout_marginEnd="30dp"
android:gravity="center"
android:orientation="vertical">
<LinearLayout
android:id="@+id/ll_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/shape_bg_hall"
android:gravity="center_horizontal"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="20dp"
android:layout_marginTop="30dp"
android:layout_marginEnd="20dp"
android:gravity="center"
android:text="您们将无法再看到对方和对方的动态,确定吗?"
android:textColor="@color/white"
android:textSize="16sp"
android:textStyle="bold" />
<TextView
android:id="@+id/tv_confirm"
android:layout_width="260dp"
android:layout_height="40dp"
android:layout_marginTop="30dp"
android:layout_marginBottom="30dp"
android:background="@drawable/shape_square_tab"
android:gravity="center"
android:text="确定"
android:textColor="@color/black"
android:textSize="14sp" />
</LinearLayout>
<ImageView
android:id="@+id/iv_close"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_below="@id/ll_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="30dp"
android:src="@mipmap/ic_close" />
</RelativeLayout>
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
android:id="@+id/rcy_square_list" android:id="@+id/rcy_square_list"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:minHeight="600dp"
android:overScrollMode="never" android:overScrollMode="never"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" /> app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />
......
<?xml version="1.0" encoding="utf-8"?> <?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:id="@+id/ll_recommend_root" android:id="@+id/ll_recommend_root"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="10dp" android:layout_marginStart="10dp"
android:layout_marginEnd="10dp"
android:layout_marginBottom="10dp"
android:background="@drawable/shape_square_item" android:background="@drawable/shape_square_item"
android:elevation="2dp"
android:orientation="horizontal" android:orientation="horizontal"
android:padding="10dp"> android:padding="10dp">
...@@ -32,6 +36,11 @@ ...@@ -32,6 +36,11 @@
android:textSize="12sp" /> android:textSize="12sp" />
</FrameLayout> </FrameLayout>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="120dp" android:layout_height="120dp"
...@@ -47,109 +56,71 @@ ...@@ -47,109 +56,71 @@
android:id="@+id/tv_recommend_name" android:id="@+id/tv_recommend_name"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:lines="1" android:lines="1"
android:singleLine="true" android:singleLine="true"
android:text="张三" android:text="张三"
android:textColor="#454A69" android:textColor="@color/white"
android:textSize="18sp" /> android:textSize="18sp" />
<!-- <TextView-->
<!-- android:id="@+id/tv_recommend_status"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_alignParentEnd="true"-->
<!-- android:layout_centerVertical="true"-->
<!-- android:text="●在线"-->
<!-- android:textColor="@color/apk_uninstalled"-->
<!-- android:textSize="12sp" />-->
<!-- <TextView-->
<!-- android:id="@+id/tv_recommend_vip"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_centerVertical="true"-->
<!-- android:layout_marginStart="10dp"-->
<!-- android:layout_toEndOf="@+id/tv_recommend_name"-->
<!-- android:background="@drawable/shape_bg_reco3"-->
<!-- android:paddingLeft="8dp"-->
<!-- android:paddingRight="8dp"-->
<!-- android:text="VIP"-->
<!-- android:textColor="@color/white"-->
<!-- android:textSize="10sp" />-->
</RelativeLayout> </RelativeLayout>
<!-- <LinearLayout-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_marginTop="8dp"-->
<!-- android:layout_marginBottom="8dp"-->
<!-- android:orientation="horizontal">-->
<!-- <TextView-->
<!-- android:id="@+id/tv_recommend_age"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="24dp"-->
<!-- android:layout_gravity="center_vertical"-->
<!-- android:layout_marginStart="10dp"-->
<!-- android:background="@drawable/shape_bg_reco2"-->
<!-- android:drawableLeft="@mipmap/ic_quit_yuan"-->
<!-- android:gravity="center"-->
<!-- android:paddingLeft="4dp"-->
<!-- android:paddingRight="4dp"-->
<!-- android:text="40"-->
<!-- android:textColor="@color/white"-->
<!-- android:textSize="13sp" />-->
<!-- </LinearLayout>-->
<LinearLayout <LinearLayout
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="10dp" android:layout_marginStart="10dp"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp" android:layout_marginBottom="8dp"
android:orientation="horizontal"> android:orientation="horizontal">
<TextView <TextView
android:id="@+id/tv_recommend_height" android:id="@+id/tv_recommend_height"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="22dp" android:layout_height="20dp"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:layout_marginRight="6dp" android:layout_marginEnd="6dp"
android:background="@drawable/shape_bg_reco1" android:background="@drawable/shape_square_label1"
android:gravity="center" android:gravity="center"
android:paddingLeft="4dp" android:paddingLeft="8dp"
android:paddingRight="4dp" android:paddingRight="8dp"
android:text="176cm" android:text="176cm"
android:textColor="@color/white" android:textColor="@color/color_DB6572"
android:textSize="12sp" /> android:textSize="12sp" />
<TextView <TextView
android:id="@+id/tv_recommend_city" android:id="@+id/tv_recommend_city"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="22dp" android:layout_height="20dp"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:background="@drawable/shape_bg_reco1" android:background="@drawable/shape_square_label1"
android:gravity="center" android:gravity="center"
android:paddingLeft="4dp" android:paddingLeft="8dp"
android:paddingRight="4dp" android:paddingRight="8dp"
android:singleLine="true" android:singleLine="true"
android:text="四川 成都" android:text="四川 成都"
android:textColor="@color/white" android:textColor="@color/color_DB6572"
android:textSize="12sp" /> android:textSize="12sp" />
</LinearLayout> </LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:gravity="center_vertical">
<ImageView
android:layout_width="20dp"
android:layout_height="20dp"
android:src="@mipmap/ic_quit_yuan" />
<TextView <TextView
android:id="@+id/tv_recommend_location" android:id="@+id/tv_recommend_location"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:drawableLeft="@mipmap/ic_quit_yuan"
android:gravity="center" android:gravity="center"
android:text="308.1km" android:text="308.1km"
android:textColor="#454A69" android:textColor="@color/color_D2D2D2"
android:textSize="12sp" /> android:textSize="12sp" />
</LinearLayout>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
...@@ -161,14 +132,12 @@ ...@@ -161,14 +132,12 @@
android:id="@+id/iv_photo1" android:id="@+id/iv_photo1"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginEnd="6dp"
android:src="@mipmap/ic_my_avat" /> android:src="@mipmap/ic_my_avat" />
<ImageView <ImageView
android:id="@+id/iv_photo2" android:id="@+id/iv_photo2"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginEnd="6dp"
android:src="@mipmap/ic_my_avat" /> android:src="@mipmap/ic_my_avat" />
<FrameLayout <FrameLayout
...@@ -204,4 +173,16 @@ ...@@ -204,4 +173,16 @@
</LinearLayout> </LinearLayout>
<com.airbnb.lottie.LottieAnimationView
android:id="@+id/iv_heart"
android:layout_width="35dp"
android:layout_height="35dp"
android:layout_gravity="end"
android:layout_marginTop="10dp"
android:layout_marginEnd="10dp"
android:src="@mipmap/home_collect_img_0" />
</FrameLayout>
</LinearLayout> </LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/iv_photo"
android:layout_width="120dp"
android:layout_height="120dp"
android:scaleType="centerCrop"
android:src="@mipmap/ic_launcher_main" />
<TextView
android:id="@+id/tv_auth"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end"
android:background="@drawable/shape_photo_auth"
android:paddingStart="6dp"
android:paddingTop="2dp"
android:paddingEnd="6dp"
android:paddingBottom="2dp"
android:text="本人"
android:textColor="@color/white"
android:textSize="12sp" />
</FrameLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:paddingTop="5dp"
android:paddingBottom="5dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal">
<FrameLayout
android:id="@+id/fl_head_male"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="20dp">
<com.duben.roseplaylet.ui.widgets.CircleImageView
android:id="@+id/iv_avatar_male"
android:layout_width="70dp"
android:layout_height="70dp"
android:src="@mipmap/ic_my_avat"
android:visibility="visible" />
<TextView
android:id="@+id/tv_online_male"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal|bottom"
android:background="@drawable/shape_square_tab"
android:paddingStart="6dp"
android:paddingTop="2dp"
android:paddingEnd="6dp"
android:paddingBottom="2dp"
android:text="在线"
android:textColor="@color/white"
android:textSize="12sp" />
</FrameLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="80dp"
android:layout_marginStart="10dp"
android:layout_weight="1"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:id="@+id/tv_label_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/app_name"
android:textColor="@color/white" />
<TextView
android:id="@+id/tv_label_isvip"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:background="@drawable/shape_label_white"
android:paddingStart="4dp"
android:paddingTop="2dp"
android:paddingEnd="4dp"
android:paddingBottom="2dp"
android:text="VIP"
android:textColor="@color/black"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginTop="3dp"
android:layout_weight="1"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:id="@+id/tv_label_age"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/shape_label_white"
android:paddingStart="4dp"
android:paddingTop="2dp"
android:paddingEnd="4dp"
android:paddingBottom="2dp"
android:text="44岁"
android:textColor="@color/black" />
<TextView
android:id="@+id/tv_label_address"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:background="@drawable/shape_label_white"
android:paddingStart="4dp"
android:paddingTop="2dp"
android:paddingEnd="4dp"
android:paddingBottom="2dp"
android:text="北京北京"
android:textColor="@color/black"
android:visibility="gone" />
<TextView
android:id="@+id/tv_label_distance"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:background="@drawable/shape_label_white"
android:paddingStart="4dp"
android:paddingTop="2dp"
android:paddingEnd="4dp"
android:paddingBottom="2dp"
android:text="172cm"
android:textColor="@color/black" />
</LinearLayout>
<TextView
android:id="@+id/tv_days"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="登录IP:12323213"
android:textColor="@color/white"
android:visibility="gone" />
</LinearLayout>
<LinearLayout
android:layout_width="60dp"
android:layout_height="wrap_content"
android:layout_marginEnd="10dp"
android:gravity="center_horizontal"
android:orientation="vertical">
<ImageView
android:id="@+id/iv_like"
android:layout_width="30dp"
android:layout_height="30dp"
android:src="@drawable/djx_like" />
<TextView
android:id="@+id/tv_like_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:text="10人喜欢"
android:textColor="@color/white" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
\ No newline at end of file
<?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"
android:id="@+id/head_container"
android:layout_width="match_parent"
android:layout_height="80dp">
<View
android:id="@+id/v_bar"
android:layout_width="match_parent"
android:layout_height="30dp"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/iv_head_back"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginStart="10dp"
android:src="@mipmap/ic_arrow_white"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/v_bar" />
<LinearLayout
android:id="@+id/ll_head_center"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
app:layout_collapseParallaxMultiplier="0.5"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/v_bar">
<ImageView
android:id="@+id/iv_head_avatar"
android:layout_width="40dp"
android:layout_height="40dp"
android:src="@mipmap/ic_my_avat" />
<TextView
android:id="@+id/tv_head_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:text="@string/app_name"
android:textColor="@color/white"
android:textSize="18sp" />
</LinearLayout>
<ImageView
android:id="@+id/iv_head_more"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="10dp"
android:src="@mipmap/ic_label_right"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/v_bar" />
<ImageView
android:id="@+id/iv_head_share"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="10dp"
android:src="@mipmap/ic_label_right"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@id/iv_head_more"
app:layout_constraintTop_toBottomOf="@id/v_bar" />
</androidx.constraintlayout.widget.ConstraintLayout>
...@@ -64,5 +64,12 @@ ...@@ -64,5 +64,12 @@
<color name="color_FDEFCA">#FDEFCA</color> <color name="color_FDEFCA">#FDEFCA</color>
<color name="color_E7C26A">#E7C26A</color> <color name="color_E7C26A">#E7C26A</color>
<color name="color_383838">#383838</color> <color name="color_383838">#383838</color>
<color name="color_848389">#848389</color>
<color name="color_FFCC32">#FFCC32</color>
<color name="color_1fffcc32">#1fffcc32</color>
<color name="color_1cffffff">#1cffffff</color>
<color name="color_EAE3E0">#EAE3E0</color>
<color name="color_DB6572">#DB6572</color>
<color name="color_D2D2D2">#D2D2D2</color>
</resources> </resources>
\ No newline at end of file
...@@ -23,8 +23,8 @@ android.nonTransitiveRClass=true ...@@ -23,8 +23,8 @@ android.nonTransitiveRClass=true
#DEBUG_URL="https://test.mints-id.com/camera-api/" #DEBUG_URL="https://test.mints-id.com/camera-api/"
#DEBUG_URL="http://cui.mints-id.com/" #DEBUG_URL="http://cui.mints-id.com/"
DEBUG_URL="http://47.95.116.182:9886/" #DEBUG_URL="http://47.95.116.182:9886/"
#DEBUG_URL="https://api.mints-tech.cn/camera-api/" DEBUG_URL="https://api.mints-tech.cn/camera-api/"
RELEASE_URL="https://api.mints-tech.cn/camera-api/" RELEASE_URL="https://api.mints-tech.cn/camera-api/"
RELEASE_KEY_PASSWORD=mintsroseplaylet RELEASE_KEY_PASSWORD=mintsroseplaylet
...@@ -37,9 +37,9 @@ RELEASE_SHARESDK_KEY=3911a009c7983 ...@@ -37,9 +37,9 @@ RELEASE_SHARESDK_KEY=3911a009c7983
RELEASE_SHARESDK_SECRET=a7cf0fd727fe6bb3f401af89b5bc0134 RELEASE_SHARESDK_SECRET=a7cf0fd727fe6bb3f401af89b5bc0134
#weixin #weixin
WEIXIN_APP_PAY_ID ="wx78fff52fb3b373c5" WEIXIN_APP_PAY_ID ="wx6f4215662bbee3cf"
WEIXIN_APP_ID =wx78fff52fb3b373c5 WEIXIN_APP_ID =wx6f4215662bbee3cf
WEIXIN_APP_SECRET =63a98dbec4bbc432dc92039be7229540 WEIXIN_APP_SECRET =c659e7978ad8a6bfc242468d01df51a4
#umeng-done #umeng-done
RELEASE_UMENG_KEY=677f617e8f232a05f1f2ed7a RELEASE_UMENG_KEY=677f617e8f232a05f1f2ed7a
......
...@@ -16,8 +16,8 @@ ...@@ -16,8 +16,8 @@
<Tumblr Enable="false" /> <Tumblr Enable="false" />
<Email Enable="false" /> <Email Enable="false" />
<ShortMessage Enable="false" /> <ShortMessage Enable="false" />
<Wechat AppId="wx78fff52fb3b373c5" AppSecret="63a98dbec4bbc432dc92039be7229540" userName="gh_afb25ac019c9" path="pages/index/index.html?id=1" WithShareTicket="true" MiniprogramType="0" /> <Wechat AppId="wx6f4215662bbee3cf" AppSecret="c659e7978ad8a6bfc242468d01df51a4" userName="gh_afb25ac019c9" path="pages/index/index.html?id=1" WithShareTicket="true" MiniprogramType="0" />
<WechatMoments AppId="wx78fff52fb3b373c5" AppSecret="63a98dbec4bbc432dc92039be7229540" /> <WechatMoments AppId="wx6f4215662bbee3cf" AppSecret="c659e7978ad8a6bfc242468d01df51a4" />
<QQ Enable="false" /> <QQ Enable="false" />
<Instapaper Enable="false" /> <Instapaper Enable="false" />
<Pocket Enable="false" /> <Pocket Enable="false" />
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment