Commit 8a4a898d authored by maxiaoliang's avatar maxiaoliang

修改

parent 73418428
......@@ -58,6 +58,7 @@ import com.zxhl.cms.utils.UserDataUtils;
import com.zxhl.cms.utils.Utils;
import com.zxhl.cms.widget.ChatDialogUtils;
import com.zxhl.cms.widget.LoadingDialog;
import com.zxhl.main.page.fragment.ConstellationMachFragment;
import com.zxhl.main.page.fragment.HomeFragment;
import com.zxhl.main.page.fragment.VoiceRoomFragment;
import com.zxhl.main.page.view.NavigationBottomView;
......@@ -162,7 +163,7 @@ public class MainActivity extends BaseActivity implements NavigationBottomView.N
private void initFragment() {
fragments.add(new HomeFragment());
fragments.add(new VoiceRoomFragment());
fragments.add(new ConstellationMachFragment());
fragments.add(new ChatFragment());
fragments.add(new UserCenterFragment());
......@@ -201,15 +202,15 @@ public class MainActivity extends BaseActivity implements NavigationBottomView.N
@Override
public void onNavigationClick(int vId) {
if (vId == com.zxhl.main.R.id.id_view_navigation_bottom_user) {
if (vId == com.zxhl.main.R.id.id_ll_bottom_user) {
switchFragment(3);
EventUtils.INSTANCE.onEvent("tab_imp", "user");
} else if (vId == com.zxhl.main.R.id.id_view_navigation_bottom_box) {
} else if (vId == com.zxhl.main.R.id.id_ll_bottom_shouye) {
switchFragment(0);
EventUtils.INSTANCE.onEvent("tab_imp", "home");
} else if (vId == R.id.id_view_navigation_bottom_voice_room) {
} else if (vId == R.id.id_ll_bottom_xingzuo) {
switchFragment(1);
} else if (vId == R.id.id_view_navigation_bottom_msg) {
} else if (vId == R.id.id_ll_bottom_msg) {
switchFragment(2);
}
}
......
......@@ -117,6 +117,10 @@
<item>50万-100万</item>
<item>100万以上</item>
</string-array>
<string-array name="default_gender">
<item>Girl</item>
<item>Boy</item>
</string-array>
<string-array name="default_occupation">
<item>销售/业务</item>
<item>人事/行政</item>
......
......@@ -243,7 +243,7 @@ public class NetConfig {
}
public static class StarLight {
public static final String HOME_STAR_LIGHT_LIST = "app/v1/game/star/pageList";//首页列表
public static final String HOME_STAR_LIGHT_LIST = "app/v1/hk/game/star/pageList";//首页列表
public static final String HOME_STAR_LIGHT_USER_INFO = "app/v1/game/star/getUserInfo";//访问他人主页
public static final String HOME_STAR_LIGHT_USER_LIKE = "app/v1/game/star/like";//喜欢/取消喜欢
public static final String HOME_STAR_LIGHT_USER_FOLLOW = "app/v1/game/star/follow";//关注用户/取消关注
......
......@@ -34,6 +34,7 @@ class HomeListEntity {
var picturesList: List<String>? = null
var ifchoose: Boolean = false
var distance: String? = ""
var countryEn:String? = ""
var isUpload = false
}
\ No newline at end of file
......@@ -222,4 +222,9 @@ interface RounterApi {
@RounterUri(Constant.scheme + "://blocklist")
fun getIntentBlockList(): Intent
@RounterUri(Constant.scheme + "://updatenickname")
fun getIntentUpdateNickName(): Intent
@RounterUri(Constant.scheme + "://updateintrodution")
fun getIntentUpdateIntrodution(): Intent
}
\ No newline at end of file
package com.zxhl.cms.utils;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
public class BirthdayToAgeUtil {
private static String birthday;
private static String ageStr;
private static int age;
//出生年、月、日
private static int year;
private static int month;
private static int day;
public static String BirthdayToAge(String birthday1) {
birthday = birthday1;
stringToInt(birthday, "yyyy-MM-dd");
// 得到当前时间的年、月、日
Calendar cal = Calendar.getInstance();
int yearNow = cal.get(Calendar.YEAR);
int monthNow = cal.get(Calendar.MONTH) + 1;
int dayNow = cal.get(Calendar.DATE);
// 用当前年月日减去出生年月日
int yearMinus = yearNow - year;
int monthMinus = monthNow - month;
int dayMinus = dayNow - day;
age = yearMinus;// 先大致赋值
if (yearMinus <= 0) {
age = 0;
ageStr = String.valueOf(age) ;
return ageStr;
}
if (monthMinus < 0) {
age = age - 1;
} else if (monthMinus == 0) {
if (dayMinus < 0) {
age = age - 1;
}
}
ageStr = String.valueOf(age);
return ageStr;
}
/**
* String类型转换成date类型
* strTime: 要转换的string类型的时间,
* formatType: 要转换的格式yyyy-MM-dd HH:mm:ss
* //yyyy年MM月dd日 HH时mm分ss秒,
* strTime的时间格式必须要与formatType的时间格式相同
*/
private static Date stringToDate(String strTime, String formatType) {
try {
SimpleDateFormat formatter = new SimpleDateFormat(formatType);
Date date;
date = formatter.parse(strTime);
return date;
} catch (Exception e) {
return null;
}
}
/**
* String类型转换为long类型
* .............................
* strTime为要转换的String类型时间
* formatType时间格式
* formatType格式为yyyy-MM-dd HH:mm:ss//yyyy年MM月dd日 HH时mm分ss秒
* strTime的时间格式和formatType的时间格式必须相同
*/
private static void stringToInt(String strTime, String formatType) {
try {
//String类型转换为date类型
Calendar calendar = Calendar.getInstance();
Date date = stringToDate(strTime, formatType);
calendar.setTime(date);
if (date == null) {
} else {
//date类型转成long类型
year = calendar.get(Calendar.YEAR);
month = calendar.get(Calendar.MONTH) + 1;
day = calendar.get(Calendar.DAY_OF_MONTH);
}
} catch (Exception e) {
}
}
}
......@@ -221,7 +221,24 @@ public class JumpUtils {
Utils.showToast(AppContext.get(), "该版本暂不支持,请更新版本!");
}
}
public static void UpdateNickNameJump() {
try {
Intent intent = RounterBus.getRounter(RounterApi.class).getIntentUpdateNickName();
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
AppContext.get().startActivity(intent);
} catch (Exception e) {
Utils.showToast(AppContext.get(), "该版本暂不支持,请更新版本!");
}
}
public static void UpdateIntrodutionJump() {
try {
Intent intent = RounterBus.getRounter(RounterApi.class).getIntentUpdateIntrodution();
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
AppContext.get().startActivity(intent);
} catch (Exception e) {
Utils.showToast(AppContext.get(), "该版本暂不支持,请更新版本!");
}
}
public static void UserInfoJump() {
try {
......
......@@ -1192,5 +1192,6 @@ public class Utils {
return true;
return false;
}
}
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="@dimen/dp_75"
android:layout_height="@dimen/dp_75">
android:layout_width="match_parent"
android:layout_height="140dp">
<ImageView
android:id="@+id/id_img_show"
......@@ -12,18 +12,17 @@
<ImageView
android:id="@+id/id_img_add"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_centerInParent="true"
android:padding="12dp"
android:background="@drawable/icon_add_photo" />
<ImageView
android:id="@+id/id_img_del"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_width="30dp"
android:layout_height="30dp"
android:padding="5dp"
android:layout_alignParentRight="true"
android:src="@drawable/icon_guanbi_photo"
android:visibility="gone" />
</RelativeLayout>
......@@ -136,6 +136,24 @@
android:scheme="hwxg" />
</intent-filter>
</activity>
<activity android:name="com.zxhl.main.page.activity.UpdateNickNameActivity">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<data
android:host="updatenickname"
android:scheme="hwxg" />
</intent-filter>
</activity>
<activity android:name="com.zxhl.main.page.activity.UpdateIntrodutionActivity">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<data
android:host="updateintrodution"
android:scheme="hwxg" />
</intent-filter>
</activity>
<activity android:name="com.zxhl.main.page.activity.WinterBoxActivity">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
......
package com.zxhl.main.page.activity
import android.view.View
import com.zxhl.cms.AppContext
import com.zxhl.cms.common.base.BaseActivity
import com.zxhl.main.R
class UpdateIntrodutionActivity : BaseActivity() {
override fun init() {
}
override fun before() {
super.before()
setStatusBarBackground(AppContext.get().resources.getColor(R.color.transparent))
}
override fun onClick(v: View?) {
}
override fun layoutID(): Int {
return R.layout.activity_layout_update_introdution
}
}
\ No newline at end of file
package com.zxhl.main.page.activity
import android.view.View
import com.zxhl.cms.AppContext
import com.zxhl.cms.common.base.BaseActivity
import com.zxhl.main.R
class UpdateNickNameActivity : BaseActivity() {
override fun init() {
}
override fun before() {
super.before()
setStatusBarBackground(AppContext.get().resources.getColor(R.color.transparent))
}
override fun onClick(v: View?) {
}
override fun layoutID(): Int {
return R.layout.activity_layout_update_nick_name
}
}
\ No newline at end of file
......@@ -8,13 +8,19 @@ import android.graphics.Bitmap
import android.graphics.BitmapFactory
import android.graphics.Color
import android.graphics.drawable.Drawable
import android.net.Uri
import android.os.Build
import android.text.Editable
import android.text.TextUtils
import android.text.TextWatcher
import android.util.Log
import android.view.View
import android.widget.ImageView
import android.widget.Toast
import androidx.core.app.ActivityCompat
import androidx.recyclerview.widget.GridLayoutManager
import byc.imagewatcher.ImageWatcher
import byc.imagewatcher.ImageWatcherHelper
import com.bigkoo.pickerview.builder.OptionsPickerBuilder
import com.bigkoo.pickerview.view.OptionsPickerView
import com.bumptech.glide.Glide
......@@ -27,6 +33,7 @@ import com.google.gson.Gson
import com.luck.picture.lib.PictureSelector
import com.luck.picture.lib.config.PictureConfig
import com.luck.picture.lib.config.PictureMimeType
import com.luck.picture.lib.decoration.GridSpacingItemDecoration
import com.luck.picture.lib.entity.LocalMedia
import com.zxhl.cms.AppContext
import com.zxhl.cms.common.Const
......@@ -35,14 +42,12 @@ import com.zxhl.cms.net.SettingPreference
import com.zxhl.cms.net.model.uc.UserInfo
import com.zxhl.cms.runtimepermission.NicePermission
import com.zxhl.cms.runtimepermission.NicePermissionListener
import com.zxhl.cms.utils.GetJsonDataUtil
import com.zxhl.cms.utils.ImageUtils
import com.zxhl.cms.utils.JumpUtils
import com.zxhl.cms.utils.Utils
import com.zxhl.cms.widget.ChatDialogUtils
import com.zxhl.cms.widget.LoadingDialog
import com.zxhl.cms.utils.*
import com.zxhl.cms.widget.*
import com.zxhl.main.R
import com.zxhl.main.page.`interface`.*
import com.zxhl.main.page.adapter.PhotoMoveListener
import com.zxhl.main.page.adapter.PublishPhotoAdapter
import com.zxhl.main.page.contract.EditUserInfoContract
import com.zxhl.main.page.entity.JsonBean
import com.zxhl.main.page.presenter.EditUserInfoPresenter
......@@ -56,13 +61,21 @@ import java.io.File
//个人信息页面
class UserInfoActivity : BaseActivity(), EditUserInfoContract.View, ChooseDateCallBack,
ChooseHeightCallBack, ChooseWeightCallBack, ChooseIncomeCallBack,ChossoccupationCallBack{
ChooseHeightCallBack, ChooseWeightCallBack, ChooseIncomeCallBack, ChossoccupationCallBack,
ChooseGenderCallBack, OnRecycleItemClickListener<String>,
ImageWatcher.OnPictureLongPressListener, AdCallback<String>,
PhotoMoveListener {
private var mPresenter: EditUserInfoPresenter? = null
var selectList: List<LocalMedia>? = ArrayList()
private var options1Items: ArrayList<JsonBean> = ArrayList() //省
private val options2Items: ArrayList<ArrayList<String>> = ArrayList() //市
private val options3Items: ArrayList<ArrayList<ArrayList<String>>> = ArrayList() //区
private var mAdapter: PublishPhotoAdapter? = null
private val COLUMN: Int = 3
private var mLoading: LoadingDialog? = null
private var mImgUrlList = ArrayList<String>()
private var iwHelper: ImageWatcherHelper? = null
var isTranslucentStatus = false
override fun onClick(v: View?) {
}
......@@ -78,6 +91,8 @@ class UserInfoActivity : BaseActivity(), EditUserInfoContract.View, ChooseDateCa
override fun init() {
initJsonData()
initPhoto()
updateView()
mLoading = LoadingDialog.getLoadingDialog(
this,
getString(com.zxhl.cms.R.string.wait_ing),
......@@ -121,6 +136,10 @@ class UserInfoActivity : BaseActivity(), EditUserInfoContract.View, ChooseDateCa
id_rl_height?.setOnClickListener {
DialogUtils.showchooseHeight(this, this)
}
id_rl_gender?.setOnClickListener {
DialogUtils.showchooseGender(this, this)
}
id_rl_weight?.setOnClickListener {
DialogUtils.showchooseWeight(this, this)
}
......@@ -133,6 +152,54 @@ class UserInfoActivity : BaseActivity(), EditUserInfoContract.View, ChooseDateCa
id_tv_sava_info?.setOnClickListener {
saveInfo()
}
id_rl_nick_name?.setOnClickListener {
JumpUtils.UpdateNickNameJump()
}
id_rl_introduction?.setOnClickListener {
JumpUtils.UpdateIntrodutionJump()
}
}
fun initPhoto() {
iwHelper =
ImageWatcherHelper.with(this, GlideSimpleLoader()) // 一般来讲, ImageWatcher 需要占据全屏的位置
.setTranslucentStatus(if (!isTranslucentStatus) Utils.calcStatusBarHeight(AppContext.get()) else 0) // 如果不是透明状态栏,你需要给ImageWatcher标记 一个偏移值,以修正点击ImageView查看的启动动画的Y轴起点的不正确
.setErrorImageRes(R.mipmap.error_picture) // 配置error图标 如果不介意使用lib自带的图标,并不一定要调用这个API
.setOnPictureLongPressListener(this)
.setOnStateChangedListener(object : ImageWatcher.OnStateChangedListener {
override fun onStateChangeUpdate(
imageWatcher: ImageWatcher,
clicked: ImageView,
position: Int,
uri: Uri,
animatedValue: Float,
actionTag: Int
) {
Log.e(
"IW",
"onStateChangeUpdate [$position][$uri][$animatedValue][$actionTag]"
)
}
override fun onStateChanged(
imageWatcher: ImageWatcher,
position: Int,
uri: Uri,
actionTag: Int
) {
if (actionTag == ImageWatcher.STATE_ENTER_DISPLAYING) {
// Toast.makeText(getApplicationContext(), "点击了图片 [" + position + "]" + uri + "", Toast.LENGTH_SHORT).show();
} else if (actionTag == ImageWatcher.STATE_EXIT_HIDING) {
// Toast.makeText(getApplicationContext(), "退出了查看大图", Toast.LENGTH_SHORT).show();
}
}
})
.setIndexProvider(CustomDotIndexProvider()) //自定义页码指示器(默认数字)
.setLoadingUIProvider(CustomLoadingUIProvider()) // 自定义LoadingUI
mAdapter = PublishPhotoAdapter(mActivity, this, this)
id_rl_choose_photo?.layoutManager = GridLayoutManager(mActivity, COLUMN)
id_rl_choose_photo.addItemDecoration(GridSpacingItemDecoration(COLUMN, 20, false))
id_rl_choose_photo.setAdapter(mAdapter)
}
fun saveInfo() {
......@@ -147,8 +214,8 @@ class UserInfoActivity : BaseActivity(), EditUserInfoContract.View, ChooseDateCa
showToast("请继续完善未填写项哦~")
return
}
var headImg: MultipartBody.Part?=null
if(!selectList.isNullOrEmpty()){
var headImg: MultipartBody.Part? = null
if (!selectList.isNullOrEmpty()) {
val f = File(selectList!![0].compressPath)
val requestFile = RequestBody.create("multipart/form-data".toMediaTypeOrNull(), f)
headImg = MultipartBody.Part.createFormData("headImage", f.name, requestFile)
......@@ -163,7 +230,7 @@ class UserInfoActivity : BaseActivity(), EditUserInfoContract.View, ChooseDateCa
id_tv_address.text.toString(),
id_tv_weight.text.toString()
)
}else{
} else {
mPresenter?.updateUserInfoNoHeadImg(
id_tv_birth?.text.toString(),
id_edit_desc?.text.toString(),
......@@ -193,7 +260,7 @@ class UserInfoActivity : BaseActivity(), EditUserInfoContract.View, ChooseDateCa
} else {
id_img_head.setImageResource(R.drawable.icon_user_photo_default)
}
id_tv_birth?.text = result.birthday
id_tv_birth?.text = "${result.age}"
if (!TextUtils.isEmpty(result.description)) {
id_edit_desc?.setText(result.description)
id_tv_length.text = (30 - result.description.length).toString()
......@@ -230,14 +297,6 @@ class UserInfoActivity : BaseActivity(), EditUserInfoContract.View, ChooseDateCa
}
override fun updateSuc() {
mLoading?.setResult(true, "修改成功", 1000)
finish()
}
override fun updateFail() {
mLoading?.setResult(false, "修改失败", 1000)
}
fun showPickerView() {
val pvOptions: OptionsPickerView<*> = OptionsPickerBuilder(
......@@ -309,14 +368,15 @@ class UserInfoActivity : BaseActivity(), EditUserInfoContract.View, ChooseDateCa
.freeStyleCropEnabled(false)// 裁剪框是否可拖拽 true or false
.isDragFrame(false)
.showCropGrid(false)// 是否显示裁剪矩形网格 圆形裁剪时建议设为false true or false
.forResult(PictureConfig.CHOOSE_REQUEST)//结果回调onActivityResult code
.forResult(PictureConfig.REQUEST_CAMERA)//结果回调onActivityResult code
}
private val mImgList = ArrayList<LocalMedia>()
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
super.onActivityResult(requestCode, resultCode, data)
if (data != null && resultCode == -1) {
if (requestCode == PictureConfig.CHOOSE_REQUEST) {
if (requestCode == PictureConfig.REQUEST_CAMERA) {
selectList = PictureSelector.obtainMultipleResult(data)
val photoSize = Utils.dip2px(90)
Glide.with(this).asBitmap().load(selectList!![0].compressPath)
......@@ -350,7 +410,71 @@ class UserInfoActivity : BaseActivity(), EditUserInfoContract.View, ChooseDateCa
}
}
)
} else if (requestCode == PictureConfig.CHOOSE_REQUEST) {
val selectList = PictureSelector.obtainMultipleResult(data)
if (mAdapter != null) {
// mPhtoList?.addAll(mAdapter?.list!!)
}
if (!selectList.isNullOrEmpty()) {
mImgList?.clear()
mImgList?.addAll(selectList)
checkImgList(0)
}
}
}
}
fun checkImgList(num: Int) {
if (mImgList.size > 0) {
val data = mImgList[0]
mImgList?.removeAt(0)
uploadFile(data, num)
} else {
uploadPhotoUrl()
}
}
//上传本地图片获取url
fun uploadFile(data: LocalMedia, num: Int) {
Log.e("MXL", "本地路径" + data.compressPath)
val f = File(data.compressPath)
val requestFile =
RequestBody.create("multipart/form-data".toMediaTypeOrNull(), f)
val fileBody =
MultipartBody.Part.createFormData("file", f.name, requestFile)
mLoading?.setLoading("上传中")
mLoading?.show()
mPresenter?.upload(fileBody)
//写上报地址获取url逻辑,成功or失败, 成功调 mImgUrlList.add(url) checkImgList(0)
//失败
// if (num < 3) {
// val s = num + 1
// uploadFile(data, s)
// } else if (num == 3) {
// //重试了三次失败的。
// // data 做记录
// // checkImgList(0)
// } else {
// checkImgList(0)
// }
}
fun uploadPhotoUrl() {
if (mImgUrlList.size > 0) {
//走打包上报url逻辑
val sb = StringBuilder()
for (str in mImgUrlList!!) {
if (sb.length > 0) {
sb.append(",")
}
sb.append(str)
}
Log.e("MXL", "参数" + sb.toString())
mPresenter?.pictures(sb.toString())
} else {
//删到最后一张了
mPresenter?.pictures("")
}
}
......@@ -477,5 +601,135 @@ class UserInfoActivity : BaseActivity(), EditUserInfoContract.View, ChooseDateCa
id_tv_zhiye?.text = string
}
}
override fun chooseGender(string: String?) {
if (TextUtils.isEmpty(string)) {
} else {
id_tv_gender?.text = string
}
}
override fun onItemClick(view: View?, position: Int, data: String?) {
when (view?.id) {
R.id.id_img_add -> {
EventUtils.onEvent("UploadAlbumImage", "相册上传图")
PictureSelector.create(this)
.openGallery(PictureConfig.TYPE_ALL)
.imageSpanCount(4)// 每行显示个数 int
.maxSelectNum(getSize())
.selectionMode(PictureConfig.SINGLE)// 多选 or 单选 PictureConfig.MULTIPLE or PictureConfig.SINGLE
.isSingleDirectReturn(true)//PictureConfig.SINGLE模式下是否直接返回
.previewImage(true)// 是否可预览图片 true or false
.isCamera(true)// 是否显示拍照按钮 true or false
.imageFormat(PictureMimeType.JPEG)// 拍照保存图片格式后缀,默认jpeg
.isZoomAnim(true)// 图片列表点击 缩放效果 默认true
.setOutputCameraPath(Const.getImgPath())// 自定义拍照保存路径,可不填
.enableCrop(false)// 是否裁剪 true or false
.compress(true)// 是否压缩 true or false
.compressSavePath(Const.getImgPath())//压缩图片保存地址
.showCropFrame(true)// 是否显示裁剪矩形边框 圆形裁剪时建议设为 false true or false
.showCropGrid(false)// 是否显示裁剪矩形网格 圆形裁剪时建议设为 false true or false
.rotateEnabled(false) // 裁剪是否可旋转图片 true or false
.freeStyleCropEnabled(false)// 裁剪框是否可拖拽 true or false
.showCropGrid(false)// 是否显示裁剪矩形网格 圆形裁剪时建议设为false true or false
.forResult(PictureConfig.CHOOSE_REQUEST)//结果回调onActivityResult code
}
R.id.id_img_del -> {
delet(position)
}
R.id.id_img_show -> {
iwHelper?.show(
getImageUriList(mImgUrlList), position
)
}
}
}
fun getSize(): Int {
if (mAdapter == null) {
return 6
} else {
return 7 - mAdapter?.itemCount!!
}
}
fun getImageUriList(files: List<String?>?): List<Uri>? {
val imageUriList: MutableList<Uri> = java.util.ArrayList()
if (files != null && files.size > 0) {
for (str in files) {
imageUriList.add(Uri.parse(str))
}
}
return imageUriList
}
override fun onPictureLongPress(v: ImageView?, uri: Uri?, pos: Int) {
}
override fun moveFinish() {
}
override fun onResult(code: Int, result: String?) {
updateView()
}
fun updateView() {
val user = SettingPreference.getUserInfoData()
if (user == null) {
return
}
if (!user.picturesList.isNullOrEmpty()) {
mImgUrlList?.clear()
mImgUrlList?.addAll(user.picturesList)
if (mAdapter != null) {
mAdapter?.clear()
}
mAdapter?.appendToList(user.picturesList)
mAdapter?.notifyDataSetChanged()
} else {
if (mAdapter != null) {
mAdapter?.clear()
}
}
}
fun delet(position: Int) {
mImgUrlList?.removeAt(position)
mLoading?.setLoading("loading")
mLoading?.show()
uploadPhotoUrl()
}
override fun updateSuc() {
mLoading?.setResult(true, "修改成功", 1000)
finish()
}
override fun updateFail() {
mLoading?.setResult(false, "修改失败", 1000)
}
override fun uploadSuc(result: String) {
mImgUrlList.add(result)
checkImgList(0)
}
override fun uploadFail() {
}
override fun updatePicSuc() {
mImgUrlList.clear()
mLoading?.setResult(true, "Success", 1000)
UserDataUtils.updateUserInfo(this)
}
override fun updatePicFail() {
mLoading?.setResult(true, "Fail", 1000)
}
}
\ No newline at end of file
package com.zxhl.main.page.adapter
import androidx.recyclerview.widget.RecyclerView
interface ItemTouchHelperAdapter {
//数据交换
fun onItemMove(source: RecyclerView.ViewHolder?, target: RecyclerView.ViewHolder?)
//数据删除
fun onItemDissmiss(source: RecyclerView.ViewHolder?)
//drag或者swipe选中
fun onItemSelect(source: RecyclerView.ViewHolder?)
//状态清除
fun onItemClear(source: RecyclerView.ViewHolder?)
}
\ No newline at end of file
package com.zxhl.main.page.adapter
interface PhotoMoveListener {
fun moveFinish()
}
\ No newline at end of file
package com.zxhl.main.page.adapter
import android.content.Context
import android.util.Log
import android.util.SparseArray
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.ImageView
import androidx.recyclerview.widget.RecyclerView
import com.bumptech.glide.Glide
import com.bumptech.glide.load.resource.bitmap.CircleCrop
import com.bumptech.glide.request.RequestOptions
import com.zxhl.cms.AppContext
import com.zxhl.cms.R
import com.zxhl.cms.common.base.BaseRecyclerAdapter
import com.zxhl.cms.utils.OnRecycleItemClickListener
import java.util.*
class PublishPhotoAdapter : BaseRecyclerAdapter<String, PublishPhotoAdapter.ViewHolder> ,
ItemTouchHelperAdapter {
private var mContext: Context? = null
private val listener: OnRecycleItemClickListener<String>
private val moveListener:PhotoMoveListener
constructor(
content: Context?,
listener: OnRecycleItemClickListener<String>,
moveListener:PhotoMoveListener
) : super() {
mContext = content
this.listener = listener
this.moveListener=moveListener
}
override fun getItemCount(): Int {
val size = mList.size
if (size < 8) {
return size + 1
} else {
return size
}
}
private val mImageViews: SparseArray<ImageView?>? = null
fun getImageViews(): SparseArray<ImageView?>? {
return mImageViews
}
override fun getItem(position: Int): String {
return super.getItem(position)
}
// override fun getItem(position: Int): LocalMedia {
// return super.getItem(position)
// }
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
if (position < list.size) {
var str = mList[position]
Glide.with(AppContext.mAppContext).load(str)
.into(holder?.item_img_show!!)
holder?.item_img_del?.visibility = View.VISIBLE
// holder?.item_img_show?.setLoadImageUrl(str, false)
// holder?.item_img_show?.setLoadImageUrl(Uri.parse(bean.compressPath))
holder?.item_img_add?.visibility = View.GONE
} else {
holder?.item_img_show?.setImageResource(R.color.color_ededed)
holder?.item_img_del?.visibility = View.GONE
holder?.item_img_add?.visibility = View.VISIBLE
}
}
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
return ViewHolder(
LayoutInflater.from(AppContext.get())
.inflate(R.layout.item_layout_photo, parent, false)
)
}
inner class ViewHolder : RecyclerView.ViewHolder {
var item_img_add: ImageView?
var item_img_show: ImageView?
var item_img_del: ImageView?
constructor(
itemView: View
) : super(itemView) {
item_img_add = itemView.findViewById<ImageView>(R.id.id_img_add)
item_img_show = itemView.findViewById<ImageView>(R.id.id_img_show)
item_img_del = itemView.findViewById<ImageView>(R.id.id_img_del)
item_img_show?.setOnClickListener {
val pos = adapterPosition
if (pos < mList.size) {
listener.onItemClick(it, position, null)
}
}
item_img_add?.setOnClickListener {
val pos = adapterPosition
if (pos < mList.size) {
} else {
listener.onItemClick(it, position, null)
}
}
item_img_del?.setOnClickListener {
val pos = adapterPosition
if (pos < mList.size) {
listener.onItemClick(it, position, null)
} else {
}
}
}
}
override fun onItemMove(source: RecyclerView.ViewHolder?, target: RecyclerView.ViewHolder?) {
var fromPosition=source?.adapterPosition
var toPosition=target?.adapterPosition
if (fromPosition != null) {
if (toPosition != null) {
if(fromPosition<mList.size&&toPosition<mList.size){
//交换数据位置
Collections.swap(mList, fromPosition, toPosition)
//刷新位置交换
notifyItemMoved(fromPosition, toPosition)
onItemClear(source)
moveListener.moveFinish()
}
}
}
}
override fun onItemDissmiss(source: RecyclerView.ViewHolder?) {
var position = source?.adapterPosition
mList.remove(position) //移除数据
if (position != null) {
notifyItemRemoved(position)
}//刷新数据移除
}
override fun onItemSelect(source: RecyclerView.ViewHolder?) {
//当拖拽选中时放大选中的view
source?.itemView?.setScaleX(1.2f)
source?.itemView?.setScaleY(1.2f)
}
override fun onItemClear(source: RecyclerView.ViewHolder?) {
//拖拽结束后恢复view的状态
source?.itemView?.setScaleX(1.0f)
source?.itemView?.setScaleY(1.0f)
}
}
\ No newline at end of file
......@@ -9,6 +9,10 @@ class EditUserInfoContract {
fun setData(result: UserInfo?)
fun updateSuc()
fun updateFail()
fun uploadSuc(result: String)
fun uploadFail()
fun updatePicSuc()
fun updatePicFail()
}
interface Presenter {
......@@ -36,5 +40,7 @@ class EditUserInfoContract {
province: String,
weight: String,
)
fun upload(file: MultipartBody.Part?)
fun pictures(list:String?)
}
}
\ No newline at end of file
package com.zxhl.main.page.fragment
import android.view.View
import com.zxhl.cms.common.base.BaseFragment
import com.zxhl.main.R
class ConstellationMachFragment:BaseFragment() {
override fun layoutID(): Int {
return R.layout.fragment_layout_constellation_match
}
override fun init(view: View?) {
}
}
\ No newline at end of file
package com.zxhl.main.page.`interface`
interface ChooseGenderCallBack {
fun chooseGender(string: String?)
}
\ No newline at end of file
......@@ -5,6 +5,7 @@ import com.zxhl.cms.ad.upload.model.Response
import com.zxhl.cms.net.ApiClient
import com.zxhl.cms.net.RxSchedulers
import com.zxhl.cms.net.callback.BaseObserver
import com.zxhl.cms.net.model.chat.PictureEntity
import com.zxhl.cms.net.model.uc.UserInfo
import com.zxhl.main.page.contract.EditUserInfoContract
import okhttp3.MultipartBody
......@@ -98,5 +99,39 @@ class EditUserInfoPresenter : EditUserInfoContract.Presenter {
})
}
override fun upload(file: MultipartBody.Part?) {
ApiClient.homeApi.upload(file)
.compose(RxSchedulers.observableIO2Main())
.subscribe(object : BaseObserver<PictureEntity>() {
override fun onSuccess(result: PictureEntity?) {
if (result != null) {
mView.uploadSuc(result.url.toString())
}
}
override fun onFailure(e: Throwable?, code: String?, errorMsg: String?) {
Log.e("MXL", "ERROR" + code + errorMsg)
mView.uploadFail()
}
})
}
override fun pictures(list: String?) {
ApiClient.homeApi.updatePictures(list)
.compose(RxSchedulers.observableIO2Main())
.subscribe(object : BaseObserver<Any>() {
override fun onSuccess(result: Any?) {
if (result != null) {
mView.updatePicSuc()
}
}
override fun onFailure(e: Throwable?, code: String?, errorMsg: String?) {
Log.e("MXL", "ERROR" + code + errorMsg)
mView.updatePicFail()
}
})
}
}
\ No newline at end of file
......@@ -16,6 +16,7 @@ import com.cncoderx.wheelview.WheelView
import com.loper7.date_time_picker.DateTimePicker
import com.loper7.date_time_picker.StringUtils
import com.zxhl.cms.AppContext
import com.zxhl.cms.utils.BirthdayToAgeUtil
import com.zxhl.cms.utils.PhoneUtils
import com.zxhl.main.R
import com.zxhl.main.page.*
......@@ -128,8 +129,8 @@ object DialogUtils {
val datePicker = mDialogView.findViewById<DateTimePicker>(R.id.dateTimePicker)
val _MAX_TIME = (365*24* 60 * 60 * 13 * 1000L)+(366*24* 60 * 60 * 5 * 1000L)
val curTime = System.currentTimeMillis()
val maxTime: Long = curTime - _MAX_TIME
datePicker?. setDefaultMillisecond(959788800000)
val maxTime: Long = curTime
datePicker?. setDefaultMillisecond(curTime)
datePicker?.setMaxMillisecond(maxTime)
val tvsure = mDialogView.findViewById<TextView>(R.id.id_tv_sure)
val tvquxiao = mDialogView.findViewById<TextView>(R.id.id_tv_quxiao)
......@@ -140,7 +141,8 @@ object DialogUtils {
}
})
tvsure?.setOnClickListener {
chooseDatalistener?.chooseData(chooseDate)
chooseDatalistener?.chooseData(BirthdayToAgeUtil.BirthdayToAge(chooseDate))
mDialog.dismiss()
}
tvquxiao?.setOnClickListener {
......@@ -151,6 +153,7 @@ object DialogUtils {
val array = intArrayOf(0, 1, 2)
datePicker?.setDisplayType(array)
datePicker?.showLabel(false)
mDialog.setCanceledOnTouchOutside(true)
mDialog.setCancelable(true)
mDialog?.show()
......@@ -315,7 +318,45 @@ object DialogUtils {
mDialog.setCancelable(true)
mDialog?.show()
}
fun showchooseGender(
context: Activity,
chooseDatalistener: ChooseGenderCallBack
) {
if (context == null) return
val mDialog = Dialog(context, R.style.CenterCompatDialogTheme)
val mDialogView =
showBottomDialog(
R.layout.dialog_layout_gender,
context,
mDialog,
0,
Gravity.BOTTOM
)
var chooseData: String? = "Girl"
val wheelview = mDialogView.findViewById<WheelView>(R.id.wheel3d)
val tvsure = mDialogView.findViewById<TextView>(R.id.id_tv_sure)
val tvquxiao = mDialogView.findViewById<TextView>(R.id.id_tv_quxiao)
wheelview.setOnWheelChangedListener(object : OnWheelChangedListener {
override fun onChanged(view: WheelView?, oldIndex: Int, newIndex: Int) {
chooseData = view!!.getItem(newIndex).toString()
Log.e("MXL", "chooseData:" + chooseData)
}
})
tvsure?.setOnClickListener {
chooseDatalistener?.chooseGender(chooseData)
mDialog.dismiss()
}
tvquxiao?.setOnClickListener {
chooseData = ""
chooseDatalistener?.chooseGender(chooseData)
mDialog.dismiss()
}
mDialog.setCanceledOnTouchOutside(true)
mDialog.setCancelable(true)
mDialog?.show()
}
fun showMemberTrip(
context: Activity
) {
......
......@@ -5,12 +5,8 @@ import android.util.AttributeSet
import android.view.LayoutInflater
import android.widget.RelativeLayout
import android.widget.TextView
import com.zxhl.cms.AppContext
import com.zxhl.cms.router.RounterApi
import com.zxhl.cms.router.RounterBus
import com.zxhl.cms.utils.JumpUtils
import com.zxhl.main.R
import org.jetbrains.anko.startActivity
import kotlinx.android.synthetic.main.view_navigation_bottom.view.*
/**
* Created by gaoleichao on 2018/12/28
......@@ -36,174 +32,76 @@ class NavigationBottomView : RelativeLayout {
private var mVideoText: TextView? = null
private var mWarehouseText: TextView? = null
private var mVoiceroomText: TextView? = null
private var navifationCallback: NavifationCallback? = null
private fun init() {
LayoutInflater.from(context).inflate(R.layout.view_navigation_bottom, this)
mUserText = findViewById(R.id.id_view_navigation_bottom_user)
mWarehouseText = findViewById(R.id.id_view_navigation_bottom_msg)
mVideoText = findViewById(R.id.id_view_navigation_bottom_box)
mVoiceroomText = findViewById(R.id.id_view_navigation_bottom_voice_room)
mUserText?.setOnClickListener {
id_ll_bottom_user?.setOnClickListener {
id_view_navigation_bottom_user?.setImageResource(R.drawable.icon_my_click)
id_view_navigation_bottom_msg?.setImageResource(R.drawable.icon_xiaoxi_default)
id_view_navigation_bottom_xingzuo?.setImageResource(R.drawable.icon_xingzuo_default)
id_view_navigation_bottom_shouye?.setImageResource(R.drawable.icon_shouye_default)
// if(true){
// JumpUtils.activityJump(RounterBus.getRounter(RounterApi::class.java).getIntentActivityLogin())
// } else {
mVideoText?.setTextColor(resources.getColor(R.color.color_666666))
mUserText?.setTextColor(resources.getColor(R.color.color_aa60ff))
mWarehouseText?.setTextColor(resources.getColor(R.color.color_666666))
mVoiceroomText?.setTextColor(resources.getColor(R.color.color_666666))
val voiceDrawable = getResources().getDrawable(R.drawable.icon_yuyin_default)
voiceDrawable.setBounds(
0,
0,
voiceDrawable.getMinimumWidth(),
voiceDrawable.getMinimumHeight()
)
val userDrawable = getResources().getDrawable(R.drawable.icon_my_click_xinzeng)
userDrawable.setBounds(
0,
0,
userDrawable.getMinimumWidth(),
userDrawable.getMinimumHeight()
)
val videoDrawable = getResources().getDrawable(R.drawable.icon_shouye_default)
videoDrawable.setBounds(
0,
0,
videoDrawable.getMinimumWidth(),
videoDrawable.getMinimumHeight()
)
val warehouseDrawable = getResources().getDrawable(R.drawable.icon_xiaoxi_default)
warehouseDrawable.setBounds(
0,
0,
videoDrawable.getMinimumWidth(),
videoDrawable.getMinimumHeight()
)
mVoiceroomText?.setCompoundDrawables(null,voiceDrawable,null,null)
mUserText?.setCompoundDrawables(null, userDrawable, null, null)
mVideoText?.setCompoundDrawables(null, videoDrawable, null, null)
mWarehouseText?.setCompoundDrawables(null, warehouseDrawable, null, null)
// mVideoText?.setTextColor(resources.getColor(R.color.color_666666))
// mUserText?.setTextColor(resources.getColor(R.color.color_aa60ff))
// mWarehouseText?.setTextColor(resources.getColor(R.color.color_666666))
// mVoiceroomText?.setTextColor(resources.getColor(R.color.color_666666))
// val voiceDrawable = getResources().getDrawable(R.drawable.icon_xingzuo_default)
// voiceDrawable.setBounds(
// 0,
// 0,
// voiceDrawable.getMinimumWidth(),
// voiceDrawable.getMinimumHeight()
// )
// val userDrawable = getResources().getDrawable(R.drawable.icon_my_click_xinzeng)
// userDrawable.setBounds(
// 0,
// 0,
// userDrawable.getMinimumWidth(),
// userDrawable.getMinimumHeight()
// )
// val videoDrawable = getResources().getDrawable(R.drawable.icon_shouye_default)
// videoDrawable.setBounds(
// 0,
// 0,
// videoDrawable.getMinimumWidth(),
// videoDrawable.getMinimumHeight()
// )
// val warehouseDrawable = getResources().getDrawable(R.drawable.icon_xiaoxi_default)
// warehouseDrawable.setBounds(
// 0,
// 0,
// videoDrawable.getMinimumWidth(),
// videoDrawable.getMinimumHeight()
// )
// mVoiceroomText?.setCompoundDrawables(null, voiceDrawable, null, null)
// mUserText?.setCompoundDrawables(null, userDrawable, null, null)
// mVideoText?.setCompoundDrawables(null, videoDrawable, null, null)
// mWarehouseText?.setCompoundDrawables(null, warehouseDrawable, null, null)
navifationCallback?.onNavigationClick(it.id)
// }
}
mVoiceroomText?.setOnClickListener {
mVoiceroomText?.setTextColor(resources.getColor(R.color.color_aa60ff))
mVideoText?.setTextColor(resources.getColor(R.color.color_666666))
mUserText?.setTextColor(resources.getColor(R.color.color_666666))
mWarehouseText?.setTextColor(resources.getColor(R.color.color_666666))
val voiceDrawable = getResources().getDrawable(R.drawable.icon_yuyin_click)
voiceDrawable.setBounds(
0,
0,
voiceDrawable.getMinimumWidth(),
voiceDrawable.getMinimumHeight()
)
val userDrawable = getResources().getDrawable(R.drawable.icon_my_default)
userDrawable.setBounds(
0,
0,
userDrawable.getMinimumWidth(),
userDrawable.getMinimumHeight()
);
val videoDrawable = getResources().getDrawable(R.drawable.icon_shouye_default)
videoDrawable.setBounds(
0,
0,
videoDrawable.getMinimumWidth(),
videoDrawable.getMinimumHeight()
)
val warehouseDrawable = getResources().getDrawable(R.drawable.icon_xiaoxi_default)
warehouseDrawable.setBounds(
0,
0,
videoDrawable.getMinimumWidth(),
videoDrawable.getMinimumHeight()
)
mVoiceroomText?.setCompoundDrawables(null,voiceDrawable,null,null)
mUserText?.setCompoundDrawables(null, userDrawable, null, null)
mVideoText?.setCompoundDrawables(null, videoDrawable, null, null)
mWarehouseText?.setCompoundDrawables(null, warehouseDrawable, null, null)
id_ll_bottom_shouye?.setOnClickListener {
id_view_navigation_bottom_user?.setImageResource(R.drawable.icon_my_default)
id_view_navigation_bottom_msg?.setImageResource(R.drawable.icon_xiaoxi_default)
id_view_navigation_bottom_xingzuo?.setImageResource(R.drawable.icon_xingzuo_default)
id_view_navigation_bottom_shouye?.setImageResource(R.drawable.icon_shouye_click)
navifationCallback?.onNavigationClick(it.id)
}
mVideoText?.setOnClickListener {
mVideoText?.setTextColor(resources.getColor(R.color.color_aa60ff))
mUserText?.setTextColor(resources.getColor(R.color.color_666666))
mWarehouseText?.setTextColor(resources.getColor(R.color.color_666666))
mVoiceroomText?.setTextColor(resources.getColor(R.color.color_666666))
val voiceDrawable = getResources().getDrawable(R.drawable.icon_yuyin_default)
voiceDrawable.setBounds(
0,
0,
voiceDrawable.getMinimumWidth(),
voiceDrawable.getMinimumHeight()
)
val userDrawable = getResources().getDrawable(R.drawable.icon_my_default)
userDrawable.setBounds(
0,
0,
userDrawable.getMinimumWidth(),
userDrawable.getMinimumHeight()
)
val videoDrawable = getResources().getDrawable(R.drawable.icon_shouye_click)
videoDrawable.setBounds(
0,
0,
videoDrawable.getMinimumWidth(),
videoDrawable.getMinimumHeight()
)
val warehouseDrawable = getResources().getDrawable(R.drawable.icon_xiaoxi_default)
warehouseDrawable.setBounds(
0,
0,
videoDrawable.getMinimumWidth(),
videoDrawable.getMinimumHeight()
)
mVoiceroomText?.setCompoundDrawables(null,voiceDrawable,null,null)
mUserText?.setCompoundDrawables(null, userDrawable, null, null)
mVideoText?.setCompoundDrawables(null, videoDrawable, null, null)
mWarehouseText?.setCompoundDrawables(null, warehouseDrawable, null, null)
id_ll_bottom_xingzuo?.setOnClickListener {
id_view_navigation_bottom_user?.setImageResource(R.drawable.icon_my_default)
id_view_navigation_bottom_msg?.setImageResource(R.drawable.icon_xiaoxi_default)
id_view_navigation_bottom_xingzuo?.setImageResource(R.drawable.icon_xingzuo_click)
id_view_navigation_bottom_shouye?.setImageResource(R.drawable.icon_shouye_default)
navifationCallback?.onNavigationClick(it.id)
}
mWarehouseText?.setOnClickListener {
mVideoText?.setTextColor(resources.getColor(R.color.color_666666))
mUserText?.setTextColor(resources.getColor(R.color.color_666666))
mWarehouseText?.setTextColor(resources.getColor(R.color.color_aa60ff))
mVoiceroomText?.setTextColor(resources.getColor(R.color.color_666666))
val voiceDrawable = getResources().getDrawable(R.drawable.icon_yuyin_default)
voiceDrawable.setBounds(
0,
0,
voiceDrawable.getMinimumWidth(),
voiceDrawable.getMinimumHeight()
)
val userDrawable = getResources().getDrawable(R.drawable.icon_my_default)
userDrawable.setBounds(
0,
0,
userDrawable.getMinimumWidth(),
userDrawable.getMinimumHeight()
)
val videoDrawable = getResources().getDrawable(R.drawable.icon_shouye_default)
videoDrawable.setBounds(
0,
0,
videoDrawable.getMinimumWidth(),
videoDrawable.getMinimumHeight()
)
val warehouseDrawable = getResources().getDrawable(R.drawable.icon_xiaoxi_click)
warehouseDrawable.setBounds(
0,
0,
videoDrawable.getMinimumWidth(),
videoDrawable.getMinimumHeight()
)
mVoiceroomText?.setCompoundDrawables(null,voiceDrawable,null,null)
mUserText?.setCompoundDrawables(null, userDrawable, null, null)
mVideoText?.setCompoundDrawables(null, videoDrawable, null, null)
mWarehouseText?.setCompoundDrawables(null, warehouseDrawable, null, null)
id_ll_bottom_msg?.setOnClickListener {
id_view_navigation_bottom_user?.setImageResource(R.drawable.icon_my_default)
id_view_navigation_bottom_msg?.setImageResource(R.drawable.icon_xiaoxi_click)
id_view_navigation_bottom_xingzuo?.setImageResource(R.drawable.icon_xingzuo_default)
id_view_navigation_bottom_shouye?.setImageResource(R.drawable.icon_shouye_default)
navifationCallback?.onNavigationClick(it.id)
}
}
......
<?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="match_parent"
android:background="#F6F6F6"
android:orientation="vertical">
<RelativeLayout
android:id="@+id/id_rl_title"
android:layout_width="match_parent"
android:layout_height="68dp"
android:background="@color/white">
<ImageView
android:id="@+id/id_img_back"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:padding="15dp"
android:src="@drawable/icon_fanhui_hei" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="12dp"
android:includeFontPadding="false"
android:text="Introduction"
android:textColor="@color/color_333333"
android:textSize="18sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:padding="10dp"
android:text="SAVE"
android:textColor="@color/color_824fff"
android:textSize="15sp"
android:textStyle="bold" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="180dp"
android:layout_margin="10dp"
android:background="@drawable/shape_ffffff_r5">
<EditText
android:id="@+id/id_edit_introdution"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@null"
android:gravity="left"
android:maxLength="140"
android:textColor="@color/color_999999"
android:textColorHint="#CCCCCC"
android:textCursorDrawable="@color/color_824fff"
android:textSize="@dimen/sp_13" />
<TextView
android:id="@+id/id_tv_length"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:layout_marginRight="10dp"
android:layout_marginBottom="10dp"
android:text="0/140"
android:textColor="@color/color_999999"
android:textSize="15sp" />
</RelativeLayout>
</LinearLayout>
<?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="match_parent"
android:background="#F6F6F6"
android:orientation="vertical">
<RelativeLayout
android:id="@+id/id_rl_title"
android:layout_width="match_parent"
android:layout_height="68dp"
android:background="@color/white">
<ImageView
android:id="@+id/id_img_back"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:padding="15dp"
android:src="@drawable/icon_fanhui_hei" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="12dp"
android:includeFontPadding="false"
android:text="Nick name"
android:textColor="@color/color_333333"
android:textSize="18sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:padding="10dp"
android:text="SAVE"
android:textColor="@color/color_824fff"
android:textSize="15sp"
android:textStyle="bold" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="70dp"
android:layout_margin="10dp"
android:background="@drawable/shape_ffffff_r5">
<EditText
android:id="@+id/id_edit_nickname"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@null"
android:gravity="left"
android:padding="10dp"
android:textColor="@color/color_999999"
android:textColorHint="#CCCCCC"
android:textCursorDrawable="@color/color_824fff"
android:textSize="@dimen/sp_13" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:padding="5dp"
android:src="@drawable/icon_edit_clear" />
</RelativeLayout>
</LinearLayout>
......@@ -2,7 +2,7 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#F6F6F6">
android:background="@color/white">
<RelativeLayout
android:id="@+id/id_rl_title"
......@@ -25,15 +25,23 @@
android:layout_centerHorizontal="true"
android:layout_marginBottom="12dp"
android:includeFontPadding="false"
android:text="个人信息"
android:text="Profile"
android:textColor="@color/color_333333"
android:textSize="18sp" />
</RelativeLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/id_rl_choose_photo"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/id_rl_title"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp" />
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/id_rl_title">
android:layout_below="@+id/id_rl_choose_photo">
<LinearLayout
android:layout_width="match_parent"
......@@ -43,6 +51,7 @@
android:layout_marginBottom="@dimen/dp_20"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
......@@ -51,13 +60,15 @@
android:layout_marginBottom="@dimen/dp_10"
android:text="填写个人信息,让大家更了解你~"
android:textColor="@color/color_999999"
android:textSize="13sp" />
android:textSize="13sp"
android:visibility="gone" />
<RelativeLayout
android:id="@+id/id_rl_voice"
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="@drawable/shape_ffffff_r5">
android:background="@drawable/shape_ffffff_r5"
android:visibility="gone">
<TextView
android:layout_width="wrap_content"
......@@ -80,11 +91,7 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_10"
android:background="@drawable/shape_ffffff_r5"
android:orientation="vertical"
android:paddingLeft="@dimen/dp_10"
android:paddingRight="@dimen/dp_10">
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
......@@ -94,9 +101,9 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:text="头像"
android:text="Portrait"
android:textColor="@color/color_333333"
android:textSize="@dimen/sp_13" />
android:textSize="15sp" />
<ImageView
android:id="@+id/id_img_head"
......@@ -113,6 +120,7 @@
android:background="#EDEDED" />
<RelativeLayout
android:id="@+id/id_rl_nick_name"
android:layout_width="match_parent"
android:layout_height="50dp">
......@@ -120,23 +128,23 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:text="昵称"
android:text="Nick name"
android:textColor="@color/color_333333"
android:textSize="@dimen/sp_13" />
android:textSize="15sp" />
<EditText
<TextView
android:id="@+id/id_edit_nickname"
android:layout_width="150dp"
android:layout_height="match_parent"
android:layout_alignParentRight="true"
android:background="@null"
android:drawableRight="@drawable/icon_edit_right"
android:drawablePadding="10dp"
android:ellipsize="end"
android:gravity="right|center_vertical"
android:maxLength="10"
android:textColor="@color/color_999999"
android:textColorHint="#CCCCCC"
android:textCursorDrawable="@null"
android:hint="@string/no_write"
android:textSize="@dimen/sp_13" />
android:textSize="15sp" />
</RelativeLayout>
<View
......@@ -146,7 +154,8 @@
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="114dp">
android:layout_height="114dp"
android:visibility="gone">
<TextView
android:id="@+id/id_tv_qianming"
......@@ -193,10 +202,39 @@
android:layout_marginTop="@dimen/dp_10"
android:background="@drawable/shape_ffffff_r5"
android:orientation="vertical"
android:paddingLeft="@dimen/dp_10"
android:paddingRight="@dimen/dp_10"
android:visibility="visible">
<RelativeLayout
android:id="@+id/id_rl_gender"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_50">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:text="Gender"
android:textColor="@color/color_333333"
android:textSize="15sp" />
<TextView
android:id="@+id/id_tv_gender"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:drawableRight="@drawable/icon_edit_right"
android:drawablePadding="10dp"
android:textColor="@color/color_999999"
android:textColorHint="#CCCCCC"
android:textSize="15sp" />
</RelativeLayout>
<View
android:layout_width="match_parent"
android:layout_height="0.5dp"
android:background="#EDEDED" />
<RelativeLayout
android:id="@+id/id_rl_birth"
android:layout_width="match_parent"
......@@ -206,9 +244,9 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:text="生日"
android:text="Age"
android:textColor="@color/color_333333"
android:textSize="@dimen/sp_13" />
android:textSize="15sp" />
<TextView
android:id="@+id/id_tv_birth"
......@@ -216,10 +254,11 @@
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:drawableRight="@drawable/icon_edit_right"
android:drawablePadding="10dp"
android:textColor="@color/color_999999"
android:textColorHint="#CCCCCC"
android:textSize="@dimen/sp_13"
android:hint="@string/no_choose"/>
android:textSize="15sp" />
</RelativeLayout>
<View
......@@ -230,7 +269,8 @@
<RelativeLayout
android:id="@+id/id_rl_height"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_50">
android:layout_height="@dimen/dp_50"
android:visibility="gone">
<TextView
android:layout_width="wrap_content"
......@@ -255,12 +295,14 @@
<View
android:layout_width="match_parent"
android:layout_height="0.5dp"
android:background="#EDEDED" />
android:background="#EDEDED"
android:visibility="gone" />
<RelativeLayout
android:id="@+id/id_rl_weight"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_50">
android:layout_height="@dimen/dp_50"
android:visibility="gone">
<TextView
android:layout_width="wrap_content"
......@@ -281,6 +323,82 @@
android:textColorHint="#CCCCCC"
android:textSize="@dimen/sp_13" />
</RelativeLayout>
<View
android:layout_width="match_parent"
android:layout_height="0.5dp"
android:background="#EDEDED"
android:visibility="gone" />
<RelativeLayout
android:id="@+id/id_rl_location"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_50"
android:visibility="visible">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:text="Location"
android:textColor="@color/color_333333"
android:textSize="@dimen/sp_13" />
<TextView
android:id="@+id/id_tv_location"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:drawableRight="@drawable/icon_edit_right"
android:drawablePadding="10dp"
android:visibility="invisible"
android:textColor="@color/color_999999"
android:textColorHint="#CCCCCC"
android:textSize="15sp" />
</RelativeLayout>
<View
android:layout_width="match_parent"
android:layout_height="0.5dp"
android:background="#EDEDED"
android:visibility="visible" />
<RelativeLayout
android:id="@+id/id_rl_introduction"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="15dp"
android:visibility="visible">
<TextView
android:id="@+id/id_tv_title_trip"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:text="Introduction"
android:textColor="@color/color_333333"
android:textSize="@dimen/sp_13" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginTop="18dp"
android:src="@drawable/icon_edit_right" />
<TextView
android:id="@+id/id_tv_introduction"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:layout_below="@+id/id_tv_title_trip"
android:textColor="@color/color_999999"
android:textSize="15sp" />
</RelativeLayout>
</LinearLayout>
<LinearLayout
......@@ -290,7 +408,8 @@
android:background="@drawable/shape_ffffff_r5"
android:orientation="vertical"
android:paddingLeft="@dimen/dp_10"
android:paddingRight="@dimen/dp_10">
android:paddingRight="@dimen/dp_10"
android:visibility="gone">
<RelativeLayout
android:id="@+id/id_rl_city"
......@@ -311,9 +430,9 @@
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:hint="@string/no_choose"
android:textColor="@color/color_999999"
android:textColorHint="#CCCCCC"
android:hint="@string/no_choose"
android:textSize="@dimen/sp_13" />
</RelativeLayout>
......@@ -377,6 +496,7 @@
android:textSize="@dimen/sp_13" />
</RelativeLayout>
</LinearLayout>
<TextView
android:id="@+id/id_tv_sava_info"
android:layout_width="match_parent"
......@@ -387,7 +507,8 @@
android:text="保存信息"
android:textColor="@color/white"
android:textSize="18sp"
android:textStyle="bold" />
android:textStyle="bold"
android:visibility="gone" />
</LinearLayout>
......
......@@ -18,7 +18,7 @@
android:paddingTop="10dp"
android:paddingRight="15dp"
android:paddingBottom="10dp"
android:text="取消"
android:text="Cancel"
android:textColor="@color/color_333333"
android:textSize="@dimen/sp_15"
android:textStyle="bold" />
......@@ -31,7 +31,7 @@
android:paddingTop="10dp"
android:paddingRight="15dp"
android:paddingBottom="10dp"
android:text="选择生日"
android:text="Select age"
android:textColor="@color/color_333333"
android:textSize="@dimen/sp_15"
android:textStyle="bold" />
......@@ -45,7 +45,7 @@
android:paddingTop="10dp"
android:paddingRight="15dp"
android:paddingBottom="10dp"
android:text="确定"
android:text="Confirm"
android:textColor="@color/color_aa60ff"
android:textSize="@dimen/sp_15" />
</RelativeLayout>
......
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/id_tv_quxiao"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="15dp"
android:paddingTop="10dp"
android:paddingRight="15dp"
android:paddingBottom="10dp"
android:text="Cancel"
android:textColor="@color/color_333333"
android:textSize="@dimen/sp_15"
android:textStyle="bold" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:paddingLeft="15dp"
android:paddingTop="10dp"
android:paddingRight="15dp"
android:paddingBottom="10dp"
android:text="Select gender"
android:textColor="@color/color_333333"
android:textSize="@dimen/sp_15"
android:textStyle="bold" />
<TextView
android:id="@+id/id_tv_sure"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:paddingLeft="15dp"
android:paddingTop="10dp"
android:paddingRight="15dp"
android:paddingBottom="10dp"
android:text="Confirm"
android:textColor="@color/color_aa60ff"
android:textSize="@dimen/sp_15" />
</RelativeLayout>
<com.cncoderx.wheelview.Wheel3DView
android:id="@+id/wheel3d"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_30"
app:wheelCyclic="true"
app:wheelEntries="@array/default_gender"
app:wheelItemCount="9"
app:wheelItemWidth="160dp"
app:wheelItemHeight="40dp"
app:wheelTextSize="18sp"
app:wheelTextColor="@color/c1c1c1"
app:wheelSelectedTextColor="@color/color_333333"
app:wheelDividerColor="@color/ededed"
app:wheelHighlightColor="@color/wheel_highlight_color" />
</LinearLayout>
<?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="match_parent"
android:background="@drawable/bj_xingzuo"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="35dp"
android:text=" Horoscope love match"
android:textColor="@color/white"
android:textSize="18sp"
android:textStyle="bold" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="30dp">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:src="@drawable/icon_xingzuo" />
</RelativeLayout>
</LinearLayout>
......@@ -12,83 +12,78 @@
android:gravity="bottom"
android:orientation="horizontal">
<TextView
android:id="@+id/id_view_navigation_bottom_box"
<LinearLayout
android:id="@+id/id_ll_bottom_shouye"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_height="match_parent"
android:layout_weight="1"
android:drawableTop="@drawable/icon_shouye_click"
android:drawablePadding="2dp"
android:gravity="center"
android:includeFontPadding="false"
android:text="首页"
android:textColor="@color/color_aa60ff"
android:textSize="11sp" />
<TextView
android:id="@+id/id_view_navigation_bottom_voice_room"
android:layout_width="match_parent"
android:gravity="center">
<ImageView
android:id="@+id/id_view_navigation_bottom_shouye"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:src="@drawable/icon_shouye_click" />
</LinearLayout>
<LinearLayout
android:id="@+id/id_ll_bottom_xingzuo"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:drawableTop="@drawable/icon_yuyin_default"
android:drawablePadding="2dp"
android:gravity="center"
android:includeFontPadding="false"
android:text="语音房"
android:textColor="@color/color_666666"
android:textSize="11sp" />
android:gravity="center">
<ImageView
android:id="@+id/id_view_navigation_bottom_xingzuo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/icon_xingzuo_default" />
</LinearLayout>
<RelativeLayout
android:id="@+id/id_ll_bottom_msg"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1">
<TextView
<ImageView
android:id="@+id/id_view_navigation_bottom_msg"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_gravity="center_vertical"
android:drawableTop="@drawable/icon_xiaoxi_default"
android:drawablePadding="2dp"
android:gravity="center"
android:includeFontPadding="false"
android:text="消息"
android:textColor="@color/color_666666"
android:textSize="11sp"
/>
android:src="@drawable/icon_xiaoxi_default" />
<TextView
android:id="@+id/id_tv_msg_num"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:includeFontPadding="false"
android:textColor="@color/white"
android:layout_alignTop="@+id/id_view_navigation_bottom_msg"
android:layout_marginLeft="-7dp"
android:layout_toRightOf="@+id/id_view_navigation_bottom_msg"
android:background="@drawable/icon_3"
android:visibility="gone"
android:textSize="10sp"
android:gravity="center"
android:layout_marginLeft="-7dp"
android:includeFontPadding="false"
android:textColor="@color/white"
android:textSize="10sp"
android:textStyle="bold"
android:text="99+"/>
android:visibility="gone" />
</RelativeLayout>
<TextView
android:id="@+id/id_view_navigation_bottom_user"
<LinearLayout
android:id="@+id/id_ll_bottom_user"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_height="match_parent"
android:layout_weight="1"
android:drawableTop="@drawable/icon_my_default"
android:drawablePadding="2dp"
android:gravity="center"
android:text="我的"
android:textColor="@color/color_666666"
android:textSize="11sp" />
android:gravity="center">
<ImageView
android:id="@+id/id_view_navigation_bottom_user"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/icon_my_default" />
</LinearLayout>
</LinearLayout>
</merge>
\ No newline at end of file
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