Commit 8a4a898d authored by maxiaoliang's avatar maxiaoliang

修改

parent 73418428
...@@ -58,6 +58,7 @@ import com.zxhl.cms.utils.UserDataUtils; ...@@ -58,6 +58,7 @@ import com.zxhl.cms.utils.UserDataUtils;
import com.zxhl.cms.utils.Utils; import com.zxhl.cms.utils.Utils;
import com.zxhl.cms.widget.ChatDialogUtils; import com.zxhl.cms.widget.ChatDialogUtils;
import com.zxhl.cms.widget.LoadingDialog; 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.HomeFragment;
import com.zxhl.main.page.fragment.VoiceRoomFragment; import com.zxhl.main.page.fragment.VoiceRoomFragment;
import com.zxhl.main.page.view.NavigationBottomView; import com.zxhl.main.page.view.NavigationBottomView;
...@@ -162,7 +163,7 @@ public class MainActivity extends BaseActivity implements NavigationBottomView.N ...@@ -162,7 +163,7 @@ public class MainActivity extends BaseActivity implements NavigationBottomView.N
private void initFragment() { private void initFragment() {
fragments.add(new HomeFragment()); fragments.add(new HomeFragment());
fragments.add(new VoiceRoomFragment()); fragments.add(new ConstellationMachFragment());
fragments.add(new ChatFragment()); fragments.add(new ChatFragment());
fragments.add(new UserCenterFragment()); fragments.add(new UserCenterFragment());
...@@ -201,15 +202,15 @@ public class MainActivity extends BaseActivity implements NavigationBottomView.N ...@@ -201,15 +202,15 @@ public class MainActivity extends BaseActivity implements NavigationBottomView.N
@Override @Override
public void onNavigationClick(int vId) { 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); switchFragment(3);
EventUtils.INSTANCE.onEvent("tab_imp", "user"); 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); switchFragment(0);
EventUtils.INSTANCE.onEvent("tab_imp", "home"); 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); switchFragment(1);
} else if (vId == R.id.id_view_navigation_bottom_msg) { } else if (vId == R.id.id_ll_bottom_msg) {
switchFragment(2); switchFragment(2);
} }
} }
......
...@@ -117,6 +117,10 @@ ...@@ -117,6 +117,10 @@
<item>50万-100万</item> <item>50万-100万</item>
<item>100万以上</item> <item>100万以上</item>
</string-array> </string-array>
<string-array name="default_gender">
<item>Girl</item>
<item>Boy</item>
</string-array>
<string-array name="default_occupation"> <string-array name="default_occupation">
<item>销售/业务</item> <item>销售/业务</item>
<item>人事/行政</item> <item>人事/行政</item>
......
...@@ -243,7 +243,7 @@ public class NetConfig { ...@@ -243,7 +243,7 @@ public class NetConfig {
} }
public static class StarLight { 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_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_LIKE = "app/v1/game/star/like";//喜欢/取消喜欢
public static final String HOME_STAR_LIGHT_USER_FOLLOW = "app/v1/game/star/follow";//关注用户/取消关注 public static final String HOME_STAR_LIGHT_USER_FOLLOW = "app/v1/game/star/follow";//关注用户/取消关注
......
...@@ -34,6 +34,7 @@ class HomeListEntity { ...@@ -34,6 +34,7 @@ class HomeListEntity {
var picturesList: List<String>? = null var picturesList: List<String>? = null
var ifchoose: Boolean = false var ifchoose: Boolean = false
var distance: String? = "" var distance: String? = ""
var countryEn:String? = ""
var isUpload = false var isUpload = false
} }
\ No newline at end of file
...@@ -222,4 +222,9 @@ interface RounterApi { ...@@ -222,4 +222,9 @@ interface RounterApi {
@RounterUri(Constant.scheme + "://blocklist") @RounterUri(Constant.scheme + "://blocklist")
fun getIntentBlockList(): Intent 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 { ...@@ -221,7 +221,24 @@ public class JumpUtils {
Utils.showToast(AppContext.get(), "该版本暂不支持,请更新版本!"); 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() { public static void UserInfoJump() {
try { try {
......
...@@ -1192,5 +1192,6 @@ public class Utils { ...@@ -1192,5 +1192,6 @@ public class Utils {
return true; return true;
return false; return false;
} }
} }
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="@dimen/dp_75" android:layout_width="match_parent"
android:layout_height="@dimen/dp_75"> android:layout_height="140dp">
<ImageView <ImageView
android:id="@+id/id_img_show" android:id="@+id/id_img_show"
...@@ -12,18 +12,17 @@ ...@@ -12,18 +12,17 @@
<ImageView <ImageView
android:id="@+id/id_img_add" android:id="@+id/id_img_add"
android:layout_width="wrap_content" android:layout_width="40dp"
android:layout_height="wrap_content" android:layout_height="40dp"
android:layout_centerInParent="true" android:layout_centerInParent="true"
android:padding="12dp"
android:background="@drawable/icon_add_photo" /> android:background="@drawable/icon_add_photo" />
<ImageView <ImageView
android:id="@+id/id_img_del" android:id="@+id/id_img_del"
android:layout_width="wrap_content" android:layout_width="30dp"
android:layout_height="wrap_content" android:layout_height="30dp"
android:layout_alignParentRight="true"
android:padding="5dp" android:padding="5dp"
android:layout_alignParentRight="true"
android:src="@drawable/icon_guanbi_photo" android:src="@drawable/icon_guanbi_photo"
android:visibility="gone" /> android:visibility="gone" />
</RelativeLayout> </RelativeLayout>
...@@ -136,6 +136,24 @@ ...@@ -136,6 +136,24 @@
android:scheme="hwxg" /> android:scheme="hwxg" />
</intent-filter> </intent-filter>
</activity> </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"> <activity android:name="com.zxhl.main.page.activity.WinterBoxActivity">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.VIEW" /> <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
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 { ...@@ -9,6 +9,10 @@ class EditUserInfoContract {
fun setData(result: UserInfo?) fun setData(result: UserInfo?)
fun updateSuc() fun updateSuc()
fun updateFail() fun updateFail()
fun uploadSuc(result: String)
fun uploadFail()
fun updatePicSuc()
fun updatePicFail()
} }
interface Presenter { interface Presenter {
...@@ -36,5 +40,7 @@ class EditUserInfoContract { ...@@ -36,5 +40,7 @@ class EditUserInfoContract {
province: String, province: String,
weight: 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 ...@@ -5,6 +5,7 @@ import com.zxhl.cms.ad.upload.model.Response
import com.zxhl.cms.net.ApiClient import com.zxhl.cms.net.ApiClient
import com.zxhl.cms.net.RxSchedulers import com.zxhl.cms.net.RxSchedulers
import com.zxhl.cms.net.callback.BaseObserver 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.cms.net.model.uc.UserInfo
import com.zxhl.main.page.contract.EditUserInfoContract import com.zxhl.main.page.contract.EditUserInfoContract
import okhttp3.MultipartBody import okhttp3.MultipartBody
...@@ -98,5 +99,39 @@ class EditUserInfoPresenter : EditUserInfoContract.Presenter { ...@@ -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 ...@@ -16,6 +16,7 @@ import com.cncoderx.wheelview.WheelView
import com.loper7.date_time_picker.DateTimePicker import com.loper7.date_time_picker.DateTimePicker
import com.loper7.date_time_picker.StringUtils import com.loper7.date_time_picker.StringUtils
import com.zxhl.cms.AppContext import com.zxhl.cms.AppContext
import com.zxhl.cms.utils.BirthdayToAgeUtil
import com.zxhl.cms.utils.PhoneUtils import com.zxhl.cms.utils.PhoneUtils
import com.zxhl.main.R import com.zxhl.main.R
import com.zxhl.main.page.* import com.zxhl.main.page.*
...@@ -128,8 +129,8 @@ object DialogUtils { ...@@ -128,8 +129,8 @@ object DialogUtils {
val datePicker = mDialogView.findViewById<DateTimePicker>(R.id.dateTimePicker) val datePicker = mDialogView.findViewById<DateTimePicker>(R.id.dateTimePicker)
val _MAX_TIME = (365*24* 60 * 60 * 13 * 1000L)+(366*24* 60 * 60 * 5 * 1000L) val _MAX_TIME = (365*24* 60 * 60 * 13 * 1000L)+(366*24* 60 * 60 * 5 * 1000L)
val curTime = System.currentTimeMillis() val curTime = System.currentTimeMillis()
val maxTime: Long = curTime - _MAX_TIME val maxTime: Long = curTime
datePicker?. setDefaultMillisecond(959788800000) datePicker?. setDefaultMillisecond(curTime)
datePicker?.setMaxMillisecond(maxTime) datePicker?.setMaxMillisecond(maxTime)
val tvsure = mDialogView.findViewById<TextView>(R.id.id_tv_sure) val tvsure = mDialogView.findViewById<TextView>(R.id.id_tv_sure)
val tvquxiao = mDialogView.findViewById<TextView>(R.id.id_tv_quxiao) val tvquxiao = mDialogView.findViewById<TextView>(R.id.id_tv_quxiao)
...@@ -140,7 +141,8 @@ object DialogUtils { ...@@ -140,7 +141,8 @@ object DialogUtils {
} }
}) })
tvsure?.setOnClickListener { tvsure?.setOnClickListener {
chooseDatalistener?.chooseData(chooseDate)
chooseDatalistener?.chooseData(BirthdayToAgeUtil.BirthdayToAge(chooseDate))
mDialog.dismiss() mDialog.dismiss()
} }
tvquxiao?.setOnClickListener { tvquxiao?.setOnClickListener {
...@@ -151,6 +153,7 @@ object DialogUtils { ...@@ -151,6 +153,7 @@ object DialogUtils {
val array = intArrayOf(0, 1, 2) val array = intArrayOf(0, 1, 2)
datePicker?.setDisplayType(array) datePicker?.setDisplayType(array)
datePicker?.showLabel(false)
mDialog.setCanceledOnTouchOutside(true) mDialog.setCanceledOnTouchOutside(true)
mDialog.setCancelable(true) mDialog.setCancelable(true)
mDialog?.show() mDialog?.show()
...@@ -315,7 +318,45 @@ object DialogUtils { ...@@ -315,7 +318,45 @@ object DialogUtils {
mDialog.setCancelable(true) mDialog.setCancelable(true)
mDialog?.show() 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( fun showMemberTrip(
context: Activity context: Activity
) { ) {
......
This diff is collapsed.
<?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>
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
android:paddingTop="10dp" android:paddingTop="10dp"
android:paddingRight="15dp" android:paddingRight="15dp"
android:paddingBottom="10dp" android:paddingBottom="10dp"
android:text="取消" android:text="Cancel"
android:textColor="@color/color_333333" android:textColor="@color/color_333333"
android:textSize="@dimen/sp_15" android:textSize="@dimen/sp_15"
android:textStyle="bold" /> android:textStyle="bold" />
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
android:paddingTop="10dp" android:paddingTop="10dp"
android:paddingRight="15dp" android:paddingRight="15dp"
android:paddingBottom="10dp" android:paddingBottom="10dp"
android:text="选择生日" android:text="Select age"
android:textColor="@color/color_333333" android:textColor="@color/color_333333"
android:textSize="@dimen/sp_15" android:textSize="@dimen/sp_15"
android:textStyle="bold" /> android:textStyle="bold" />
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
android:paddingTop="10dp" android:paddingTop="10dp"
android:paddingRight="15dp" android:paddingRight="15dp"
android:paddingBottom="10dp" android:paddingBottom="10dp"
android:text="确定" android:text="Confirm"
android:textColor="@color/color_aa60ff" android:textColor="@color/color_aa60ff"
android:textSize="@dimen/sp_15" /> android:textSize="@dimen/sp_15" />
</RelativeLayout> </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 @@ ...@@ -12,83 +12,78 @@
android:gravity="bottom" android:gravity="bottom"
android:orientation="horizontal"> android:orientation="horizontal">
<TextView <LinearLayout
android:id="@+id/id_view_navigation_bottom_box" android:id="@+id/id_ll_bottom_shouye"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="match_parent"
android:layout_gravity="center_vertical"
android:layout_weight="1" android:layout_weight="1"
android:drawableTop="@drawable/icon_shouye_click" android:gravity="center">
android:drawablePadding="2dp"
android:gravity="center" <ImageView
android:includeFontPadding="false" android:id="@+id/id_view_navigation_bottom_shouye"
android:text="首页" android:layout_width="wrap_content"
android:textColor="@color/color_aa60ff" android:layout_height="wrap_content"
android:textSize="11sp" /> android:src="@drawable/icon_shouye_click" />
<TextView </LinearLayout>
android:id="@+id/id_view_navigation_bottom_voice_room"
<LinearLayout
android:id="@+id/id_ll_bottom_xingzuo"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="match_parent"
android:layout_gravity="center_vertical"
android:layout_weight="1" android:layout_weight="1"
android:drawableTop="@drawable/icon_yuyin_default" android:gravity="center">
android:drawablePadding="2dp"
android:gravity="center" <ImageView
android:includeFontPadding="false" android:id="@+id/id_view_navigation_bottom_xingzuo"
android:text="语音房" android:layout_width="wrap_content"
android:textColor="@color/color_666666" android:layout_height="wrap_content"
android:textSize="11sp" /> android:src="@drawable/icon_xingzuo_default" />
</LinearLayout>
<RelativeLayout <RelativeLayout
android:id="@+id/id_ll_bottom_msg"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="1"> android:layout_weight="1">
<TextView <ImageView
android:id="@+id/id_view_navigation_bottom_msg" android:id="@+id/id_view_navigation_bottom_msg"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_centerInParent="true" android:layout_centerInParent="true"
android:layout_gravity="center_vertical" android:src="@drawable/icon_xiaoxi_default" />
android:drawableTop="@drawable/icon_xiaoxi_default"
android:drawablePadding="2dp" <TextView
android:id="@+id/id_tv_msg_num"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
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:gravity="center" android:gravity="center"
android:includeFontPadding="false" android:includeFontPadding="false"
android:text="消息" android:textColor="@color/white"
android:textColor="@color/color_666666" android:textSize="10sp"
android:textSize="11sp" android:textStyle="bold"
/> android:visibility="gone" />
<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_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:textStyle="bold"
android:text="99+"/>
</RelativeLayout> </RelativeLayout>
<TextView <LinearLayout
android:id="@+id/id_view_navigation_bottom_user" android:id="@+id/id_ll_bottom_user"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="match_parent"
android:layout_gravity="center_vertical"
android:layout_weight="1" android:layout_weight="1"
android:drawableTop="@drawable/icon_my_default" android:gravity="center">
android:drawablePadding="2dp"
android:gravity="center" <ImageView
android:text="我的" android:id="@+id/id_view_navigation_bottom_user"
android:textColor="@color/color_666666" android:layout_width="wrap_content"
android:textSize="11sp" /> android:layout_height="wrap_content"
android:src="@drawable/icon_my_default" />
</LinearLayout>
</LinearLayout> </LinearLayout>
</merge> </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