Commit 283fbbed authored by fengruiyu's avatar fengruiyu

Merge branch 'master' of http://39.97.65.143:81/android/android_street into fry_dev

 Conflicts:
	app/src/main/AndroidManifest.xml
parents cdb591b9 a6fac0d4
...@@ -135,6 +135,9 @@ android { ...@@ -135,6 +135,9 @@ android {
dependencies { dependencies {
implementation fileTree(include:['*.jar'], dir:'libs') implementation fileTree(include:['*.jar'], dir:'libs')
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation rootProject.ext.support["junit"] testImplementation rootProject.ext.support["junit"]
//下拉刷新 //下拉刷新
...@@ -152,7 +155,9 @@ dependencies { ...@@ -152,7 +155,9 @@ dependencies {
implementation 'com.github.iielse:switchbutton:1.0.4' implementation 'com.github.iielse:switchbutton:1.0.4'
// BottomDialog // BottomDialog
implementation 'com.google.android.material:material:1.0.0' implementation 'com.google.android.material:material:1.0.0'
// 日志
implementation 'com.squareup.okhttp3:logging-interceptor:4.1.0'
implementation 'com.orhanobut:logger:2.2.0'
// 三方接入 // 三方接入
// 移动安全联盟 // 移动安全联盟
......
...@@ -314,10 +314,6 @@ ...@@ -314,10 +314,6 @@
} }
-keep class com.uc.crashsdk.** { *; } -keep class com.uc.crashsdk.** { *; }
-keep interface com.uc.crashsdk.** { *; } -keep interface com.uc.crashsdk.** { *; }
......
...@@ -2,42 +2,21 @@ ...@@ -2,42 +2,21 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
package="com.mints.street"> package="com.mints.street">
<uses-sdk
android:minSdkVersion="21"
android:targetSdkVersion="30" />
<supports-screens
android:anyDensity="true"
android:largeScreens="true"
android:normalScreens="false"
android:resizeable="true"
android:smallScreens="true" />
<!-- 这个权限用于进行网络定位 --> <!-- 这个权限用于进行网络定位 -->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> <!-- 这个权限用于访问GPS定位 -->
<!-- 这个权限用于访问GPS定位 --> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> <!-- 用于访问wifi网络信息,wifi信息会用于进行网络定位 -->
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /> <!-- 获取网络状态,根据网络状态切换进行数据请求网络转换 -->
<!-- 用于访问wifi网络信息,wifi信息会用于进行网络定位 --> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <!-- 写外置存储。如果开发者使用了离线地图,并且数据写在外置存储区域,则需要申请该权限 -->
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <!-- 读取外置存储。如果开发者使用了so动态加载功能并且把so文件放在了外置存储区域,则需要申请该权限,否则不需要 -->
<!-- 获取网络状态,根据网络状态切换进行数据请求网络转换 --> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> <!-- 访问网络,进行地图相关业务数据请求,包括地图数据,路线规划,POI检索等 -->
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android.permission.INTERNET" /> <!-- 调用相机,用于实现扫描二维码,预览个性化地图编辑器生成的个性化地图样式(开发者实际开发中地图SDK不需要该权限) -->
<!-- 写外置存储。如果开发者使用了离线地图,并且数据写在外置存储区域,则需要申请该权限 --> <uses-permission android:name="android.permission.CAMERA" /> <!-- 获取手机状态信息 -->
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.READ_PHONE_STATE" />
<!-- 读取外置存储。如果开发者使用了so动态加载功能并且把so文件放在了外置存储区域,则需要申请该权限,否则不需要 --> <!-- android10以后 后台运行位置 -->
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
<!-- 访问网络,进行地图相关业务数据请求,包括地图数据,路线规划,POI检索等 -->
<uses-permission android:name="android.permission.INTERNET" />
<!-- 调用相机,用于实现扫描二维码,预览个性化地图编辑器生成的个性化地图样式(开发者实际开发中地图SDK不需要该权限)-->
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<application <application
android:name="com.mints.street.AppApplication" android:name=".AppApplication"
android:allowBackup="true" android:allowBackup="true"
android:icon="@mipmap/ic_launcher_main" android:icon="@mipmap/ic_launcher_main"
android:label="@string/app_name" android:label="@string/app_name"
...@@ -73,43 +52,46 @@ ...@@ -73,43 +52,46 @@
<meta-data <meta-data
android:name="Mob-AppSecret" android:name="Mob-AppSecret"
android:value="${SHARE_SECRET}" /> android:value="${SHARE_SECRET}" />
<!--百度地图开放平台 -->
<meta-data <meta-data
android:name="com.baidu.lbsapi.API_KEY" android:name="com.baidu.lbsapi.API_KEY"
android:value="SD6luBGzUFSVEZ3n9Xjk3xTsvDFmuRCi" /><!--百度地图开放平台 --> android:value="SD6luBGzUFSVEZ3n9Xjk3xTsvDFmuRCi" />
<!--百度地图开放平台 service--> <!-- 百度地图开放平台 service -->
<service android:name="com.baidu.location.f" <service
android:name="com.baidu.location.f"
android:enabled="true" android:enabled="true"
android:process=":remote"/> android:process=":remote" />
<activity android:name="com.mints.street.splash.SplashActivity" <activity
android:name=".splash.SplashActivity"
android:theme="@style/NormalSplash"> android:theme="@style/NormalSplash">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN" /> <action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" /> <category android:name="android.intent.category.LAUNCHER" />
</intent-filter> </intent-filter>
<intent-filter> <intent-filter>
<action android:name="android.intent.action.VIEW" /> <action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" /> <category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="um.60e80209a6f90557b7b19aa7" /> <data android:scheme="um.60e80209a6f90557b7b19aa7" />
</intent-filter> </intent-filter>
</activity>
<activity android:name="com.mints.street.login.LoginActivity">
</activity> </activity>
<activity android:name="com.mints.street.main.MainActivity" <activity android:name=".login.LoginActivity"></activity>
<activity
android:name=".main.MainActivity"
android:configChanges="orientation|keyboardHidden|screenSize" android:configChanges="orientation|keyboardHidden|screenSize"
android:launchMode="singleTask" android:launchMode="singleTask"
android:theme="@style/AppTheme.NoneTranslucent"> android:theme="@style/AppTheme.NoneTranslucent"></activity>
<activity android:name=".main.my.MoresettingsActivity" />
</activity> <activity android:name=".main.my.AboutusActivity" />
<activity android:name=".main.my.MoresettingsActivity"/> <activity android:name=".main.my.PermissionsActivity" />
<activity android:name=".main.my.AboutusActivity"/> <activity android:name=".main.my.OpenvipActivity" />
<activity android:name=".main.my.PermissionsActivity"/> <activity android:name=".main.home.HistoricalimageActivity" />
<activity android:name=".main.home.HistoricalimageActivity"/> <activity android:name=".main.my.BindMobileActivity" />
<activity android:name=".splash.GuideActivity"/>
<!-- ShareSDK start --> <!-- ShareSDK start -->
<activity <activity
android:name="com.mob.tools.MobUIShell" android:name="com.mob.tools.MobUIShell"
...@@ -147,8 +129,7 @@ ...@@ -147,8 +129,7 @@
android:name="android.support.FILE_PROVIDER_PATHS" android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/file_paths" android:resource="@xml/file_paths"
tools:replace="android:resource" /> tools:replace="android:resource" />
</provider> </provider> <!-- 广点通广告 -->
<!-- 广点通广告 -->
<uses-library <uses-library
android:name="org.apache.http.legacy" android:name="org.apache.http.legacy"
android:required="false" /> android:required="false" />
...@@ -168,19 +149,16 @@ ...@@ -168,19 +149,16 @@
android:name="com.qq.e.ads.LandscapeADActivity" android:name="com.qq.e.ads.LandscapeADActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize" android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
android:screenOrientation="landscape" android:screenOrientation="landscape"
tools:replace="android:screenOrientation" /> tools:replace="android:screenOrientation" /> <!-- WX_APPID必填项 -->
<!-- WX_APPID必填项 -->
<meta-data <meta-data
android:name="WX_APPID" android:name="WX_APPID"
android:value="wx8f26539eabfb04f2" /> android:value="wx8f26539eabfb04f2" />
<activity <activity
android:name=".wxapi.WXPayEntryActivity" android:name=".wxapi.WXPayEntryActivity"
android:exported="true" android:exported="true"
android:screenOrientation="portrait" android:screenOrientation="portrait"
android:windowSoftInputMode="adjustPan" /> android:windowSoftInputMode="adjustPan" /> <!-- 支付宝 -->
<!-- 支付宝 -->
<activity <activity
android:name="com.alipay.sdk.app.H5PayActivity" android:name="com.alipay.sdk.app.H5PayActivity"
android:configChanges="orientation|keyboardHidden|navigation|screenSize" android:configChanges="orientation|keyboardHidden|navigation|screenSize"
...@@ -193,11 +171,7 @@ ...@@ -193,11 +171,7 @@
android:exported="false" android:exported="false"
android:screenOrientation="behind" android:screenOrientation="behind"
android:windowSoftInputMode="adjustResize|stateHidden" /> android:windowSoftInputMode="adjustResize|stateHidden" />
<activity android:name=".main.vr.PanoramicActivity" <activity android:name=".main.vr.PanoramicActivity" />
android:screenOrientation="sensor"
android:configChanges="orientation|keyboardHidden"
/>
<activity android:name=".main.home.SearchMapActivity"/>
</application> </application>
</manifest> </manifest>
\ No newline at end of file
...@@ -3,8 +3,6 @@ package com.mints.street ...@@ -3,8 +3,6 @@ package com.mints.street
import android.content.Context import android.content.Context
import android.os.StrictMode import android.os.StrictMode
import android.os.StrictMode.VmPolicy import android.os.StrictMode.VmPolicy
import android.util.Log
import android.widget.Toast
import com.baidu.lbsapi.BMapManager import com.baidu.lbsapi.BMapManager
import com.baidu.mapapi.CoordType import com.baidu.mapapi.CoordType
import com.baidu.mapapi.SDKInitializer import com.baidu.mapapi.SDKInitializer
...@@ -13,8 +11,11 @@ import com.fry.base.base.BaseApp ...@@ -13,8 +11,11 @@ import com.fry.base.base.BaseApp
import com.mints.street.main.vr.PanoramicActivity import com.mints.street.main.vr.PanoramicActivity
import com.mints.street.manager.CsjGroMoreManager import com.mints.street.manager.CsjGroMoreManager
import com.mints.street.manager.UmengManager import com.mints.street.manager.UmengManager
import com.orhanobut.logger.AndroidLogAdapter
import com.orhanobut.logger.FormatStrategy
import com.orhanobut.logger.Logger
import com.orhanobut.logger.PrettyFormatStrategy
import me.goldze.mvvmhabit.utils.KLog import me.goldze.mvvmhabit.utils.KLog
import java.util.concurrent.TimeoutException
/** /**
* Created by 冯瑞雨 on 2021/7/1. * Created by 冯瑞雨 on 2021/7/1.
...@@ -61,6 +62,8 @@ class AppApplication : BaseApp() { ...@@ -61,6 +62,8 @@ class AppApplication : BaseApp() {
SDKInitializer.setCoordType(CoordType.BD09LL) SDKInitializer.setCoordType(CoordType.BD09LL)
//百度全景 //百度全景
initEngineManager(this) initEngineManager(this)
bindLogger()
} }
/** /**
* 初始化百度全景 * 初始化百度全景
...@@ -74,6 +77,21 @@ class AppApplication : BaseApp() { ...@@ -74,6 +77,21 @@ class AppApplication : BaseApp() {
} }
} }
/**
* 自定义logger
*/
private fun bindLogger() {
//自定义logger
val formatStrategy: FormatStrategy = PrettyFormatStrategy.newBuilder()
.showThreadInfo(false) //是否选择显示线程信息,默认为true
.methodCount(0) //方法数显示多少行,默认2行
.methodOffset(7) //隐藏方法内部调用到偏移量,默认5
// .logStrategy(customLog) //打印日志的策略,默认LogCat
.tag("mints---network") //自定义TAG全部标签,默认PRETTY_LOGGER
.build()
Logger.addLogAdapter(AndroidLogAdapter(formatStrategy))
}
companion object { companion object {
var mContext: AppApplication? = null var mContext: AppApplication? = null
var mBMapManager: BMapManager? = null var mBMapManager: BMapManager? = null
......
package com.mints.street.adapter;
import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import androidx.viewpager.widget.PagerAdapter;
import androidx.viewpager.widget.ViewPager;
import com.fry.base.utils.DensityUtils;
import com.mints.street.adapter.listener.OnPageSelectListener;
import com.mints.street.widget.CoverFlowViewPager;
import java.util.List;
public class CoverFlowAdapter extends PagerAdapter implements ViewPager.OnPageChangeListener {
/**
* 默认缩小的padding值
*/
public static int sWidthPadding;
public static int sHeightPadding;
/**
* 子元素的集合
*/
private List<View> mViewList;
/**
* 滑动监听的回调接口
*/
private OnPageSelectListener listener;
/**
* 上下文对象
*/
private Context mContext;
public CoverFlowAdapter(List<View> mImageViewList, Context context) {
this.mViewList = mImageViewList;
mContext = context;
// 设置padding值
sWidthPadding = DensityUtils.dip2px(16);
sHeightPadding = DensityUtils.dip2px(28);
}
@Override
public void destroyItem(ViewGroup container, int position, Object object) {
container.removeView(mViewList.get(position));
}
@Override
public Object instantiateItem(ViewGroup container, int position) {
View view = mViewList.get(position);
container.addView(view);
return view;
}
@Override
public int getCount() {
return mViewList == null ? 0 : mViewList.size();
}
@Override
public boolean isViewFromObject(View view, Object object) {
return view == object;
}
@Override
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
// 该方法回调ViewPager 的滑动偏移量
if (mViewList.size() > 0 && position < mViewList.size()) {
//当前手指触摸滑动的页面,从0页滑动到1页 offset越来越大,padding越来越大
int outHeightPadding = (int) (positionOffset * sHeightPadding);
int outWidthPadding = (int) (positionOffset * sWidthPadding);
// 从0滑动到一时,此时position = 0,其应该是缩小的,符合
mViewList.get(position).setPadding(outWidthPadding, outHeightPadding, outWidthPadding, outHeightPadding);
// position+1 为即将显示的页面,越来越大
if (position < mViewList.size() - 1) {
int inWidthPadding = (int) ((1 - positionOffset) * sWidthPadding);
int inHeightPadding = (int) ((1 - positionOffset) * sHeightPadding);
mViewList.get(position + 1).setPadding(inWidthPadding, inHeightPadding, inWidthPadding, inHeightPadding);
}
}
}
@Override
public void onPageSelected(int position) {
// 回调选择的接口
if (listener != null) {
listener.select(position);
}
}
@Override
public void onPageScrollStateChanged(int state) {
}
/**
* 当将某一个作为最中央时的回调
*
* @param listener
*/
public void setOnPageSelectListener(CoverFlowViewPager listener) {
this.listener = listener;
}
}
package com.mints.street.adapter
import android.content.Context
import android.graphics.Paint
import com.alibaba.android.vlayout.layout.GridLayoutHelper
import com.fry.base.adapter.AbstractVLayoutBaseAdapter
import com.fry.base.adapter.BindingViewHolder
import com.fry.base.binding.setMargin
import com.mints.street.R
import com.mints.street.databinding.ItemGridPaymentAdpaterBinding
import me.goldze.mvvmhabit.utils.AppUtils
class GridPaymentAdapter(val context: Context, val list: List<String>) : AbstractVLayoutBaseAdapter<ItemGridPaymentAdpaterBinding, List<String>>(context, list, 3) {
private var mposition: Int = -1
override fun onBindViewHolder(holder: BindingViewHolder<ItemGridPaymentAdpaterBinding>, position: Int) {
holder.binding.text1.paint.flags = Paint.STRIKE_THRU_TEXT_FLAG
var a = holder.binding.bg.layoutParams
holder.binding.bg.setMargin(AppUtils.dp2Px(context, 10F), 0, AppUtils.dp2Px(context, 10F), 0, null, null, null)
holder.itemView.setOnClickListener {
mposition = holder.adapterPosition
holder.binding.bg.setBackgroundResource(R.drawable.shape_bg_payment_down)
notifyDataSetChanged()
}
if (mposition == position) {
holder.binding.bg.setBackgroundResource(R.drawable.shape_bg_payment_down)
} else {
holder.binding.bg.setBackgroundResource(R.drawable.shape_bg_payment)
}
}
override fun getItemCount() = list.size
override fun onCreateLayoutHelper() = GridLayoutHelper(3)
override fun getLayoutId(viewType: Int) = R.layout.item_grid_payment_adpater
}
\ No newline at end of file
package com.mints.street.adapter.listener;
public interface OnPageSelectListener {
void select(int position);
}
package com.mints.street.api package com.mints.street.api
import com.mints.street.bean.AwardBean import com.mints.street.bean.BaseResponse
import com.mints.street.bean.UserBean import com.mints.street.bean.UserBean
import com.mints.street.bean.VipBean
import com.mints.street.netwrok.common.HttpManager import com.mints.street.netwrok.common.HttpManager
import io.reactivex.Observable import io.reactivex.Observable
import me.goldze.mvvmhabit.http.BaseResponse
import retrofit2.Response import retrofit2.Response
import retrofit2.http.Body import retrofit2.http.Body
import retrofit2.http.POST import retrofit2.http.POST
...@@ -18,6 +18,15 @@ interface MainApi { ...@@ -18,6 +18,15 @@ interface MainApi {
return HttpManager.getInstance().defaultClient.create(MainApi::class.java) return HttpManager.getInstance().defaultClient.create(MainApi::class.java)
} }
} }
/**
* 获取验证码
*
* @return
*/
@POST("api/sendMobileCode")
fun sendMobileCode(@Body vo: @JvmSuppressWildcards Map<String, Any>): Observable<Response<BaseResponse<Any>>>
/** /**
* 登录 * 登录
*/ */
...@@ -25,9 +34,14 @@ interface MainApi { ...@@ -25,9 +34,14 @@ interface MainApi {
fun mobileLogin(@Body vo: @JvmSuppressWildcards Map<String, Any>): Observable<Response<BaseResponse<UserBean>>> fun mobileLogin(@Body vo: @JvmSuppressWildcards Map<String, Any>): Observable<Response<BaseResponse<UserBean>>>
/** /**
* 获取用户配置信息 * 提交设备信息
* *
* @return
*/ */
@POST("api/getCoinMsg") @POST("api/saveTerminalInfo")
fun getCoinMsg(): Observable<Response<BaseResponse<AwardBean>>> fun saveTerminalInfo(@Body vo: @JvmSuppressWildcards Map<String, Any>): Observable<Response<BaseResponse<Any>>>
@POST("api/getVipProductsByType")
fun getVipProductsByType(@Body vo: @JvmSuppressWildcards Map<String, Any>): Observable<Response<BaseResponse<VipBean>>>
} }
\ No newline at end of file
package com.fry.base.bean package com.mints.street.bean
import android.annotation.SuppressLint import android.annotation.SuppressLint
import android.os.Parcelable import android.os.Parcelable
......
package com.mints.street.bean
import android.annotation.SuppressLint
import android.os.Parcelable
import kotlinx.android.parcel.Parcelize
/**
*
* @author jyx
* @date 2021/4/7
* @des
*/
@SuppressLint("ParcelCreator")
@Parcelize
data class AwardBean(
var highCoin: Int = 0,
var showHigh: Boolean = false,
var coin: Int = 0,
var riskinfoRate: Boolean = false
) : Parcelable
\ No newline at end of file
package me.goldze.mvvmhabit.http; package com.mints.street.bean;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName; import com.google.gson.annotations.SerializedName;
import java.io.Serializable;
/** /**
* Created by goldze on 2017/5/10. * Created by goldze on 2017/5/10.
* 该类仅供参考,实际业务返回的固定字段, 根据需求来定义, * 该类仅供参考,实际业务返回的固定字段, 根据需求来定义,
*/ */
public class BaseResponse<T> { public class BaseResponse<T> implements Serializable {
private int status; private int status;
private String message; private String message;
...@@ -43,7 +44,7 @@ public class BaseResponse<T> { ...@@ -43,7 +44,7 @@ public class BaseResponse<T> {
} }
public boolean isOk() { public boolean isOk() {
return status >= 200 && status < 300; return status == 200 && status < 700;
} }
public String getMessage() { public String getMessage() {
......
...@@ -5,31 +5,19 @@ import java.io.Serializable ...@@ -5,31 +5,19 @@ import java.io.Serializable
/** /**
* 描述:用户信息 * 描述:用户信息
* 作者:孟崔广 * 作者:孟崔广
* 时间:2019/10/29 18:42 * 时间:2021/7/29 18:42
* 邮箱:mengcga@163.com
*/ */
class UserBean : Serializable { class UserBean : Serializable {
val token: String? = null val token: String = ""
val toKeepAnAccount: String? = null
val consumer: ConsumerBean? = null val consumer: ConsumerBean? = null
inner class ConsumerBean : Serializable { inner class ConsumerBean : Serializable {
val head: String? = null val openid: String = ""
val openid: String? = null val nickname: String = ""
val nickname: String? = null val mobile: String = ""
val mobile: String? = null val idcode: String = ""
val real_name: String? = null val isForever: Boolean = false
val alipay_account: String? = null val expireTime : Long = 0
val idcode: String? = null val pk_id : Long = 0
val gameInfo: String? = null
var sumCoin: String? = null
val surplus //余额
= 0.0
val coin // 积分
= 0
val pk_id // 用户id
: Long = 0
val isFirstSignInApp // 首次登录app true:首次
= false
} }
} }
package com.mints.street.bean
class VipBean {
}
\ No newline at end of file
...@@ -12,4 +12,8 @@ object Constant { ...@@ -12,4 +12,8 @@ object Constant {
*/ */
const val MINTS_PKG_NAME = "com.mints.street" const val MINTS_PKG_NAME = "com.mints.street"
/**
* 第一次打开权限页面
*/
const val FIRST_OPEN_PERMISSIONS = "first_open_permissions"
} }
package com.mints.street.login package com.mints.street.login
import android.graphics.Color
import android.os.Bundle import android.os.Bundle
import android.os.PersistableBundle
import android.text.TextUtils
import android.view.View import android.view.View
import androidx.lifecycle.Observer import androidx.lifecycle.Observer
import com.fry.base.base.BaseActivity import com.fry.base.base.BaseActivity
import com.mints.street.BR import com.mints.street.BR
import com.mints.street.R import com.mints.street.R
import com.mints.street.databinding.ActivityLoginBinding import com.mints.street.databinding.ActivityLoginBinding
import com.mints.street.manager.UserManager
import com.mints.street.utils.BackInputUtil
import kotlinx.android.synthetic.main.activity_bindmobile.*
import kotlinx.android.synthetic.main.activity_login.*
import kotlinx.android.synthetic.main.include_header.* import kotlinx.android.synthetic.main.include_header.*
import me.goldze.mvvmhabit.utils.ToastUtils import me.goldze.mvvmhabit.utils.ToastUtils
...@@ -14,37 +21,70 @@ import me.goldze.mvvmhabit.utils.ToastUtils ...@@ -14,37 +21,70 @@ import me.goldze.mvvmhabit.utils.ToastUtils
* Created by 冯瑞雨 on 2021/7/2. * Created by 冯瑞雨 on 2021/7/2.
*/ */
class LoginActivity : BaseActivity<ActivityLoginBinding, LoginViewModel>(), View.OnClickListener { class LoginActivity : BaseActivity<ActivityLoginBinding, LoginViewModel>(), View.OnClickListener {
private var mobile: String? = null
override fun initContentView(savedInstanceState: Bundle?) = R.layout.activity_login override fun initContentView(savedInstanceState: Bundle?) = R.layout.activity_login
override fun initVariableId() = BR.viewModel override fun initVariableId() = BR.viewModel
override fun initData() { override fun initData() {
super.initData() super.initData()
initView() initView()
initListener()
} }
private fun initView() { private fun initListener() {
binding.button.setOnClickListener { binding.button.setOnClickListener {
viewModel.login() viewModel.login("18311400069", "123456")
} }
iv_left_icon.setImageResource(R.mipmap.iv_return_white)
// iv_left_icon.visibility = View.VISIBLE binding.tvSendSms.setOnClickListener {
// ToastUtils.showLong("点击获取验证码")
var mobile = et_phone.text.toString().trim()
if (mobile.length < 13) {
ToastUtils.showLong("请输入手机号")
return@setOnClickListener
}
mobile = mobile.replace(" ".toRegex(), "")
viewModel.sendMobileCode(mobile)
}
iv_left_icon.setOnClickListener(this)
iv_left_icon.setOnClickListener(this) iv_left_icon.setOnClickListener(this)
} }
private fun initView() {
iv_left_icon.setImageResource(R.mipmap.iv_return_white)
iv_left_icon.visibility = View.VISIBLE
//手机号设置格式
BackInputUtil.phoneNumAddSpace(et_phone)
/*mobile = UserManager.INSTANCE.getMobile()
if (!TextUtils.isEmpty(mobile)) {
et_sms.setText(mobile)
et_sms.setSelection(mobile!!.length + 2)
}*/
}
override fun initViewObservable() { override fun initViewObservable() {
super.initViewObservable() super.initViewObservable()
viewModel.data.observe(this, Observer<String>{ viewModel.data.observe(this, Observer<String> {
ToastUtils.showLong("初始化成功") ToastUtils.showLong("初始化成功")
}) })
} }
override fun onClick(v: View?) { override fun onClick(v: View?) {
when (v?.id) { when (v?.id) {
R.id.iv_left_icon -> { R.id.iv_left_icon -> finish()
finish()
}
} }
} }
} }
\ No newline at end of file
...@@ -2,37 +2,110 @@ package com.mints.street.login ...@@ -2,37 +2,110 @@ package com.mints.street.login
import android.app.Application import android.app.Application
import androidx.lifecycle.MutableLiveData import androidx.lifecycle.MutableLiveData
import com.mints.street.bean.AwardBean import com.mints.street.bean.BaseResponse
import com.mints.street.bean.UserBean
import com.mints.street.common.DeviceInfo
import com.mints.street.manager.UserManager
import com.mints.street.model.ApiModel import com.mints.street.model.ApiModel
import com.mints.street.netwrok.base.HttpSubscribeImpl import com.mints.street.netwrok.base.HttpSubscribeImpl
import com.mints.street.utils.DeviceUuidFactory
import me.goldze.mvvmhabit.base.BaseViewModel import me.goldze.mvvmhabit.base.BaseViewModel
import me.goldze.mvvmhabit.http.BaseResponse
import me.goldze.mvvmhabit.utils.KLog import me.goldze.mvvmhabit.utils.KLog
import me.goldze.mvvmhabit.utils.ToastUtils
import java.util.HashMap
/** /**
* Created by 冯瑞雨 on 2021/7/2. * Created by mcg
*/ */
class LoginViewModel(application: Application) : BaseViewModel(application) { class LoginViewModel(application: Application) : BaseViewModel(application) {
val data :MutableLiveData<String> = MutableLiveData() val data :MutableLiveData<String> = MutableLiveData()
fun login() { val deviceInfo: DeviceInfo
ApiModel.coinMsg(lifecycleProvider).safeSubscribe( get() {
object : HttpSubscribeImpl<BaseResponse<AwardBean>>( return DeviceInfo.instance
this@LoginViewModel, true }
) {
override fun onBusinessSuccess(response: BaseResponse<AwardBean>) {
KLog.e("sfdsdf", response.result.toString())
}
override fun onError(e: Throwable) { /**
KLog.e("LoginViewModel", "登录错误") * 手机验证码
*
* @param mobile
*/
fun sendMobileCode(mobile: String) {
val vo = HashMap<String, Any>()
vo["mobile"] = mobile
vo["type"] = 1
} ApiModel.sendMobileCode(lifecycleProvider,vo).safeSubscribe(
object : HttpSubscribeImpl<BaseResponse<Any>>(
this@LoginViewModel, true) {
override fun onBusinessSuccess(response: BaseResponse<Any>) {
KLog.e("sendMobileCode", response.result.toString())
}
override fun onError(e: Throwable) {
data.value = "失败"
KLog.e("sendMobileCode", "发送验证码错误")
}
})
}
fun login(mobile: String, smsCode: String) {
// showDialog()
val vo = HashMap<String, Any>()
vo["mobile"] = mobile
vo["smsCode"] = smsCode
vo["device"] = DeviceUuidFactory().deviceUuid.toString()
ApiModel.login(lifecycleProvider,vo).safeSubscribe(
object : HttpSubscribeImpl<BaseResponse<UserBean>>(
this@LoginViewModel, true) {
override fun onBusinessSuccess(response: BaseResponse<UserBean>) {
// dismissDialog()
this@LoginViewModel.saveTerminalInfo()
UserManager.INSTANCE.saveUserInfo(response.result)
KLog.e("login", response.result.toString())
ToastUtils.showShort("登录信息="+response.result.consumer?.idcode)
data.value = response.message
}
override fun onError(e: Throwable) {
data.value = "失败"
KLog.e("LoginViewModel", "登录错误")
}
})
}
/**
* 提交设备信息
*/
fun saveTerminalInfo() {
val vo = hashMapOf<String, Any>()
val macAddress: String = deviceInfo.getMacAddress()
val mac = macAddress.replace(":", "")
vo["mac"] = mac
vo["mac1"] = macAddress
vo["androidid"] = deviceInfo.getAndroidId(null)
vo["imei"] = deviceInfo.iMEI
// if (!TextUtils.isEmpty(App.OAID)) {
// vo["oaid"] = App.OAID
// }
vo["os"] = "android"
vo["model"] = deviceInfo.newModel
vo["uuid"] = DeviceUuidFactory().deviceUuid
vo["osversion"] = deviceInfo.oSVersion
vo["appversion"] = deviceInfo.versionName
override fun onComplete() { ApiModel.saveTerminalInfo(lifecycleProvider,vo).safeSubscribe(
super.onComplete() object : HttpSubscribeImpl<BaseResponse<Any>>(
} this@LoginViewModel, true) {
}) override fun onBusinessSuccess(response: BaseResponse<Any>) {
KLog.e("saveTerminalInfo", response.result.toString())
}
})
} }
} }
\ No newline at end of file
...@@ -61,11 +61,12 @@ class MainActivity : BaseActivity<ActivityMainBinding, MainViewModel>() { ...@@ -61,11 +61,12 @@ class MainActivity : BaseActivity<ActivityMainBinding, MainViewModel>() {
// test // test
UmengManager.initUm() UmengManager.initUm()
val rxPermissions = RxPermissions(this ) val rxPermissions = RxPermissions(this)
rxPermissions.request(Manifest.permission.ACCESS_COARSE_LOCATION) rxPermissions.request(Manifest.permission.ACCESS_COARSE_LOCATION,
.subscribe { Manifest.permission.WRITE_EXTERNAL_STORAGE,
Manifest.permission.READ_PHONE_STATE)
} .subscribe {
}
} }
...@@ -148,6 +149,7 @@ private fun ViewPager2.initMain(activity: FragmentActivity): ViewPager2 { ...@@ -148,6 +149,7 @@ private fun ViewPager2.initMain(activity: FragmentActivity): ViewPager2 {
} }
return this return this
} }
/** /**
* 拦截BottomNavigation长按事件 防止长按时出现Toast ---- 追求完美的大屌群友提的bug * 拦截BottomNavigation长按事件 防止长按时出现Toast ---- 追求完美的大屌群友提的bug
* @receiver BottomNavigationViewEx * @receiver BottomNavigationViewEx
......
...@@ -2,13 +2,11 @@ package com.mints.street.main.home ...@@ -2,13 +2,11 @@ package com.mints.street.main.home
import android.os.Bundle import android.os.Bundle
import android.view.View import android.view.View
import com.coorchice.library.utils.LogUtils
import com.fry.base.base.BaseActivity import com.fry.base.base.BaseActivity
import com.mints.street.BR import com.mints.street.BR
import com.mints.street.R import com.mints.street.R
import com.mints.street.databinding.ActivityHistoricalImageBinding import com.mints.street.databinding.ActivityHistoricalImageBinding
import kotlinx.android.synthetic.main.activity_historical_image.* import kotlinx.android.synthetic.main.activity_historical_image.*
import me.goldze.mvvmhabit.utils.ToastUtils
/** /**
* 描述:历史影像 * 描述:历史影像
...@@ -17,6 +15,8 @@ import me.goldze.mvvmhabit.utils.ToastUtils ...@@ -17,6 +15,8 @@ import me.goldze.mvvmhabit.utils.ToastUtils
*/ */
class HistoricalimageActivity :BaseActivity<ActivityHistoricalImageBinding, HistoricalimageModel>(), View.OnClickListener { class HistoricalimageActivity :BaseActivity<ActivityHistoricalImageBinding, HistoricalimageModel>(), View.OnClickListener {
var strings= mutableListOf<String>()
override fun initVariableId() = BR.viewModel override fun initVariableId() = BR.viewModel
override fun initContentView(savedInstanceState: Bundle?)= R.layout.activity_historical_image override fun initContentView(savedInstanceState: Bundle?)= R.layout.activity_historical_image
override fun initData() { override fun initData() {
...@@ -25,9 +25,23 @@ class HistoricalimageActivity :BaseActivity<ActivityHistoricalImageBinding, Hist ...@@ -25,9 +25,23 @@ class HistoricalimageActivity :BaseActivity<ActivityHistoricalImageBinding, Hist
} }
private fun initView() { private fun initView() {
iv_left.setOnClickListener(this)
iv_right.setOnClickListener(this)
bt_main.setOnClickListener(this)
for (i in 0..19) {
strings.add(i.toString() + "00")
}
hsMain.setData(strings)
} }
override fun onClick(v: View?) { override fun onClick(v: View?) {
when (v?.getId()) {
R.id.iv_left -> hsMain.setAnLeftOffset()
R.id.iv_right -> hsMain.setAnRightOffset()
R.id.bt_main -> tvMain.setText("所选文本:" + hsMain.getSelectedString())
else -> {
}
}
} }
} }
...@@ -137,6 +137,10 @@ class HomeFragment : BaseFragment<FragmentHomeBinding, HomeViewModel>(), SensorE ...@@ -137,6 +137,10 @@ class HomeFragment : BaseFragment<FragmentHomeBinding, HomeViewModel>(), SensorE
binding.imageOut.setOnClickListener { binding.imageOut.setOnClickListener {
mBaiduMap?.setMapStatus(MapStatusUpdateFactory.zoomOut()) mBaiduMap?.setMapStatus(MapStatusUpdateFactory.zoomOut())
} }
//历史影像
binding.imageMapHistory.setOnClickListener {
startActivity(HistoricalimageActivity::class.java)
}
mRecommendStopSearch = RecommendStopSearch.newInstance() mRecommendStopSearch = RecommendStopSearch.newInstance()
mRecommendStopSearch?.setOnGetRecommendStopResultListener { result -> mRecommendStopSearch?.setOnGetRecommendStopResultListener { result ->
if (result != null) { if (result != null) {
......
...@@ -17,12 +17,17 @@ class AboutusActivity :BaseActivity<ActivityAboutusBinding, AboutusViewModel>(), ...@@ -17,12 +17,17 @@ class AboutusActivity :BaseActivity<ActivityAboutusBinding, AboutusViewModel>(),
override fun initData() { override fun initData() {
super.initData() super.initData()
initView() initView()
initListener()
}
private fun initListener() {
iv_left_icon.setOnClickListener(this)
} }
private fun initView() { private fun initView() {
tv_title.text="关于我们" tv_title.text="关于我们"
tv_title.setTextColor(Color.BLACK) tv_title.setTextColor(Color.BLACK)
iv_left_icon.setImageResource(R.mipmap.iv_return) iv_left_icon.setImageResource(R.mipmap.ic_arrow_back)
iv_left_icon.visibility=View.VISIBLE iv_left_icon.visibility=View.VISIBLE
tv_user.setOnClickListener(this) tv_user.setOnClickListener(this)
tv_privacy.setOnClickListener(this) tv_privacy.setOnClickListener(this)
...@@ -30,6 +35,7 @@ class AboutusActivity :BaseActivity<ActivityAboutusBinding, AboutusViewModel>(), ...@@ -30,6 +35,7 @@ class AboutusActivity :BaseActivity<ActivityAboutusBinding, AboutusViewModel>(),
override fun onClick(v: View?) { override fun onClick(v: View?) {
when(v?.id){ when(v?.id){
R.id.iv_left_icon -> finish()
R.id.tv_user->{ R.id.tv_user->{
// startActivity(UseragreementActivity::class.java) // startActivity(UseragreementActivity::class.java)
} }
......
package com.mints.street.main.my
import android.Manifest
import android.os.Bundle
import android.text.TextUtils
import android.view.View
import com.fry.base.base.BaseActivity
import com.mints.street.BR
import com.mints.street.R
import com.mints.street.databinding.ActivityBindmobileBinding
import com.mints.street.utils.BackInputUtil
import com.tbruyelle.rxpermissions2.RxPermissions
import kotlinx.android.synthetic.main.activity_bindmobile.*
import kotlinx.android.synthetic.main.include_header.*
import me.goldze.mvvmhabit.utils.ToastUtils
class BindMobileActivity : BaseActivity<ActivityBindmobileBinding, BindMobileViewModel>(), View.OnClickListener {
private var mobile: String? = null
override fun initVariableId() = BR.viewModel
override fun initContentView(savedInstanceState: Bundle?) = R.layout.activity_bindmobile
override fun initData() {
super.initData()
initView()
initListener()
}
private fun initListener() {
iv_left_icon.setOnClickListener(this)
tvLoginSendcode.setOnClickListener(this)
tvLoginNext.setOnClickListener(this)
}
private fun initView() {
tv_title.text = "绑定手机号"
iv_left_icon.visibility = View.VISIBLE
iv_left_icon.setImageResource(R.mipmap.ic_arrow_back)
BackInputUtil.phoneNumAddSpace(etLoginMobile)
// mobile = UserManager.getInstance().mobile
if (!TextUtils.isEmpty(mobile)) {
etLoginMobile.setText(mobile)
etLoginMobile.setSelection(mobile!!.length + 2)
}
}
override fun onClick(v: View?) {
when(v?.id){
R.id.iv_left_icon -> {
finish()
}
R.id.tvLoginSendcode -> {
var mobile = etLoginMobile.text.toString().trim()
if (mobile.length < 13) {
ToastUtils.showShortSafe("请输入手机号")
return
}
sendCodeThread()
mobile = mobile.replace(" ".toRegex(), "")
// loginPresenter.sendMobileBindingCode(mobile)
viewModel.sendMobileCode(mobile)
}
R.id.tvLoginNext -> {
var mobile = etLoginMobile.text.toString().trim()
if (mobile.length < 13) {
ToastUtils.showShortSafe("请输入手机号")
return
}
val code = etLoginCode.text.toString().trim()
if (code.length < 4) {
ToastUtils.showShortSafe("请输入验证码")
return
}
RxPermissions(this@BindMobileActivity)
.request(Manifest.permission.READ_PHONE_STATE)
.subscribe { granted: Boolean ->
if (granted) {
mobile = mobile.replace(" ".toRegex(), "")
// loginPresenter.bindingMobile(mobile, code)
} else {
// showMissingPermissionDialog("设备")
}
}
}
}
}
var num = 0
var run: Runnable? = null
fun sendCodeThread() {
num = 60
tvLoginSendcode?.let {
it.isEnabled = false
it.text = "($num)重新获取"
run = object : Runnable {
override fun run() {
num--
if (num == 0) {
it.text = "重新获取"
it.isEnabled = true
} else {
it.text = "($num)重新获取"
it.postDelayed(this, 1000)
}
}
}
it.postDelayed(run, 1000)
}
}
}
package com.mints.street.main.my
import android.app.Application
import androidx.lifecycle.MutableLiveData
import com.mints.street.model.ApiModel
import com.mints.street.netwrok.base.HttpSubscribeImpl
import me.goldze.mvvmhabit.base.BaseViewModel
import me.goldze.mvvmhabit.http.BaseResponse
import me.goldze.mvvmhabit.utils.KLog
import java.util.HashMap
class BindMobileViewModel (application: Application): BaseViewModel(application) {
val data : MutableLiveData<String> = MutableLiveData()
/**
* 手机验证码
*
* @param mobile
*/
fun sendMobileCode(mobile: String) {
val vo = HashMap<String, Any>()
vo["mobile"] = mobile
vo["type"] = 1
ApiModel.sendMobileCode(lifecycleProvider,vo).safeSubscribe(
object : HttpSubscribeImpl<BaseResponse<Any>>(
this@BindMobileViewModel, true) {
override fun onBusinessSuccess(response: BaseResponse<Any>) {
KLog.e("sendMobileCode", response.result.toString())
}
override fun onError(e: Throwable) {
data.value = "失败"
KLog.e("sendMobileCode", "发送验证码错误")
}
})
}
}
...@@ -3,26 +3,92 @@ package com.mints.street.main.my ...@@ -3,26 +3,92 @@ package com.mints.street.main.my
import android.graphics.Color import android.graphics.Color
import android.os.Bundle import android.os.Bundle
import android.view.View import android.view.View
import android.widget.ImageView
import android.widget.TextView
import androidx.core.content.ContextCompat
import com.fry.base.base.BaseActivity import com.fry.base.base.BaseActivity
import com.mints.street.BR import com.mints.street.BR
import com.mints.street.R import com.mints.street.R
import com.mints.street.databinding.ActivityMoresettingsBinding import com.mints.street.databinding.ActivityMoresettingsBinding
import kotlinx.android.synthetic.main.activity_moresettings.*
import kotlinx.android.synthetic.main.include_header.* import kotlinx.android.synthetic.main.include_header.*
class MoresettingsActivity: BaseActivity<ActivityMoresettingsBinding, MoresettingsViewModel>() { class MoresettingsActivity : BaseActivity<ActivityMoresettingsBinding, MoresettingsViewModel>(), View.OnClickListener {
override fun initVariableId() = BR.viewModel override fun initVariableId() = BR.viewModel
override fun initContentView(savedInstanceState: Bundle?)= R.layout.activity_moresettings override fun initContentView(savedInstanceState: Bundle?) = R.layout.activity_moresettings
override fun initData() { override fun initData() {
super.initData() super.initData()
initView() initView()
initListener()
}
private fun initListener() {
item_phone.setOnClickListener(this)
iv_left_icon.setOnClickListener(this)
item_userAgree.setOnClickListener(this)
item_privacyAgree.setOnClickListener(this)
} }
private fun initView() { private fun initView() {
tv_title.text="更多设置"
tv_title.text = "更多设置"
tv_title.setTextColor(Color.BLACK) tv_title.setTextColor(Color.BLACK)
iv_left_icon.setImageResource(R.mipmap.iv_return) iv_left_icon.setImageResource(R.mipmap.ic_arrow_back)
iv_left_icon.visibility= View.VISIBLE iv_left_icon.visibility = View.VISIBLE
item_phone.findViewById<TextView>(R.id.tv_title).text = "手机号"
val phone = ContextCompat.getDrawable(this, R.mipmap.icon_settings_tel)
phone?.setBounds(0, 0, 56, 56)
item_phone.findViewById<TextView>(R.id.tv_title).setCompoundDrawables(phone, null, null, null)
// item_phone.findViewById<TextView>(R.id.tv_right).visibility=View.VISIBLE
// item_phone.findViewById<TextView>(R.id.tv_right).text = "未绑定"
item_phone.findViewById<TextView>(R.id.tv_right).visibility = View.GONE
item_phone.findViewById<ImageView>(R.id.iv_right).visibility = View.VISIBLE
item_userAgree.findViewById<TextView>(R.id.tv_title).text = "用户协议"
val userAgree = ContextCompat.getDrawable(this, R.mipmap.icon_settings_user)
userAgree?.setBounds(0, 0, 56, 56)
item_userAgree.findViewById<TextView>(R.id.tv_title).setCompoundDrawables(userAgree, null, null, null)
item_userAgree.findViewById<TextView>(R.id.tv_right).visibility = View.GONE
item_userAgree.findViewById<ImageView>(R.id.iv_right).visibility = View.VISIBLE
item_privacyAgree.findViewById<TextView>(R.id.tv_title).text = "隐私协议"
val privacyAgree = ContextCompat.getDrawable(this, R.mipmap.icon_settings_privacy)
privacyAgree?.setBounds(0, 0, 56, 56)
item_privacyAgree.findViewById<TextView>(R.id.tv_title).setCompoundDrawables(privacyAgree, null, null, null)
item_privacyAgree.findViewById<TextView>(R.id.tv_right).visibility = View.GONE
item_privacyAgree.findViewById<ImageView>(R.id.iv_right).visibility = View.VISIBLE
}
override fun onClick(v: View?) {
when (v?.id) {
R.id.iv_left_icon -> {
finish()
}
R.id.item_phone -> {
// if (!userManager.userIsLogin()) {
// readyGo(WxLoginActivity::class.java)
// return
// }
// if (userManager.mobile.isEmpty()) {
startActivity(BindMobileActivity::class.java)
// }
}
R.id.item_userAgree -> {
}
R.id.item_privacyAgree -> {
}
}
} }
......
...@@ -8,8 +8,10 @@ import android.view.View ...@@ -8,8 +8,10 @@ import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import android.widget.CheckBox import android.widget.CheckBox
import android.widget.ImageView import android.widget.ImageView
import android.widget.TextView
import android.widget.Toast import android.widget.Toast
import androidx.appcompat.widget.LinearLayoutCompat import androidx.appcompat.widget.LinearLayoutCompat
import androidx.core.content.ContextCompat
import com.fry.base.base.BaseFragment import com.fry.base.base.BaseFragment
import com.google.android.material.bottomsheet.BottomSheetDialog import com.google.android.material.bottomsheet.BottomSheetDialog
import com.mints.street.BR import com.mints.street.BR
...@@ -17,6 +19,7 @@ import com.mints.street.R ...@@ -17,6 +19,7 @@ import com.mints.street.R
import com.mints.street.databinding.FragmentMyBinding import com.mints.street.databinding.FragmentMyBinding
import com.mints.street.login.LoginActivity import com.mints.street.login.LoginActivity
import com.mints.street.main.home.HistoricalimageActivity import com.mints.street.main.home.HistoricalimageActivity
import kotlinx.android.synthetic.main.activity_moresettings.*
import kotlinx.android.synthetic.main.fragment_my.* import kotlinx.android.synthetic.main.fragment_my.*
...@@ -25,14 +28,13 @@ import kotlinx.android.synthetic.main.fragment_my.* ...@@ -25,14 +28,13 @@ import kotlinx.android.synthetic.main.fragment_my.*
* 个人中心页面 * 个人中心页面
*/ */
class MyFragment : BaseFragment<FragmentMyBinding, MyViewModel>(), View.OnClickListener { class MyFragment : BaseFragment<FragmentMyBinding, MyViewModel>(), View.OnClickListener {
//弹窗 //弹窗
private var mBottomSheetDialog: BottomSheetDialog? = null private var mBottomSheetDialog: BottomSheetDialog? = null
private var iv_weixin: ImageView? = null private var iv_weixin: ImageView? = null
private var ly_phone: LinearLayoutCompat? = null private var ly_phone: LinearLayoutCompat? = null
private var cb_checked: CheckBox? = null private var cb_checked: CheckBox? = null
//checkbox是否选中
private var ischecked = false
override fun initContentView(inflater: LayoutInflater?, override fun initContentView(inflater: LayoutInflater?,
container: ViewGroup?, container: ViewGroup?,
savedInstanceState: Bundle?) = R.layout.fragment_my savedInstanceState: Bundle?) = R.layout.fragment_my
...@@ -41,11 +43,10 @@ class MyFragment : BaseFragment<FragmentMyBinding, MyViewModel>(), View.OnClickL ...@@ -41,11 +43,10 @@ class MyFragment : BaseFragment<FragmentMyBinding, MyViewModel>(), View.OnClickL
override fun initData() { override fun initData() {
super.initData() super.initData()
initView() initView()
initListener()
} }
private fun initView() { private fun initListener() {
//设置登录点击事件 //设置登录点击事件
binding.llMyLogin.setOnClickListener { binding.llMyLogin.setOnClickListener {
//创建弹窗 //创建弹窗
...@@ -63,21 +64,38 @@ class MyFragment : BaseFragment<FragmentMyBinding, MyViewModel>(), View.OnClickL ...@@ -63,21 +64,38 @@ class MyFragment : BaseFragment<FragmentMyBinding, MyViewModel>(), View.OnClickL
//设置立即领取点击事件 //设置立即领取点击事件
binding.btTry.setOnClickListener { binding.btTry.setOnClickListener {
startActivity(PermissionsActivity::class.java) // startActivity(PermissionsActivity::class.java)
startActivity(OpenvipActivity::class.java)
} }
ly_aboutus.setOnClickListener(this) aboutus.setOnClickListener(this)
ly_moresettings.setOnClickListener(this) moresettings.setOnClickListener(this)
}
private fun initView() {
aboutus.findViewById<TextView>(R.id.tv_title).text = "关于我们"
val userAgree = ContextCompat.getDrawable(context!!, R.mipmap.iv_about_us)
userAgree?.setBounds(0, 0, 56, 56)
aboutus.findViewById<TextView>(R.id.tv_title).setCompoundDrawables(userAgree, null, null, null)
aboutus.findViewById<TextView>(R.id.tv_right).visibility = View.GONE
aboutus.findViewById<ImageView>(R.id.iv_right).visibility = View.VISIBLE
moresettings.findViewById<TextView>(R.id.tv_title).text = "更多设置"
val privacyAgree = ContextCompat.getDrawable(context!!, R.mipmap.iv_more_settings)
privacyAgree?.setBounds(0, 0, 56, 56)
moresettings.findViewById<TextView>(R.id.tv_title).setCompoundDrawables(privacyAgree, null, null, null)
moresettings.findViewById<TextView>(R.id.tv_right).visibility = View.GONE
moresettings.findViewById<ImageView>(R.id.iv_right).visibility = View.VISIBLE
} }
override fun onClick(v: View?) { override fun onClick(v: View?) {
when (v?.id) { when (v?.id) {
R.id.ly_aboutus -> { R.id.aboutus -> {
// startActivity(AboutusActivity::class.java) startActivity(AboutusActivity::class.java)
startActivity(HistoricalimageActivity::class.java) // startActivity(PermissionsActivity::class.java)
} }
R.id.ly_moresettings -> { R.id.moresettings -> {
startActivity(MoresettingsActivity::class.java) startActivity(MoresettingsActivity::class.java)
} }
R.id.ll_my_login -> { R.id.ll_my_login -> {
......
package com.mints.street.main.my
import android.graphics.Color
import android.os.Bundle
import android.view.View
import com.alibaba.android.vlayout.DelegateAdapter
import com.alibaba.android.vlayout.VirtualLayoutManager
import com.fry.base.base.BaseActivity
import com.mints.street.BR
import com.mints.street.R
import com.mints.street.adapter.EnterDestinationAdapter
import com.mints.street.adapter.GridMapAdapter
import com.mints.street.adapter.GridPaymentAdapter
import com.mints.street.databinding.ActivityOpenvipBinding
import kotlinx.android.synthetic.main.activity_openvip.*
import kotlinx.android.synthetic.main.include_header.*
class OpenvipActivity: BaseActivity<ActivityOpenvipBinding, OpenvipViewModel>(), View.OnClickListener {
// private var vLayout: VirtualLayoutManager? = null
// private var mAdapter: DelegateAdapter? = null
private var vLayout:VirtualLayoutManager?=null
private var mAdapter:DelegateAdapter?=null
override fun initVariableId() = BR.viewModel
override fun initContentView(savedInstanceState: Bundle?)= R.layout.activity_openvip
override fun initData() {
super.initData()
initView()
initListener()
}
private fun initListener() {
iv_left_icon.setOnClickListener(this)
}
private fun initView() {
val layoutInflater = layoutInflater
// 初始化数据
// 初始化数据
val list: MutableList<View> = ArrayList()
val page1 = layoutInflater.inflate(R.layout.view_data_page1, null)
val page2 = layoutInflater.inflate(R.layout.view_data_page2, null)
val page3 = layoutInflater.inflate(R.layout.view_data_page3, null)
list.add(page1)
list.add(page2)
list.add(page3)
//设置显示的数据
cfp_data_viewpager.setViewList(list)
tv_title.text="成为会员"
tv_title.setTextColor(Color.WHITE)
iv_left_icon.setImageResource(R.mipmap.ic_arrow_back)
iv_left_icon.visibility= View.VISIBLE
//recycleView管理
vLayout= VirtualLayoutManager(this)
mAdapter= DelegateAdapter(vLayout,false)
binding.listview.adapter=mAdapter
binding.listview.layoutManager=vLayout
mAdapter?.addAdapter(GridPaymentAdapter(this, listOf("1","2","3")))
}
override fun onClick(v: View?) {
when(v?.id){
R.id.iv_left_icon->finish()
}
}
}
package com.mints.street.main.my
import android.app.Application
import androidx.lifecycle.MutableLiveData
import com.mints.street.model.ApiModel
import com.mints.street.netwrok.base.HttpSubscribeImpl
import me.goldze.mvvmhabit.base.BaseViewModel
import me.goldze.mvvmhabit.http.BaseResponse
import me.goldze.mvvmhabit.utils.KLog
import java.util.HashMap
class OpenvipViewModel (application: Application): BaseViewModel(application) {
val data : MutableLiveData<String> = MutableLiveData()
/**
* 手机验证码
*
* @param mobile
*/
fun sendMobileCode(mobile: String) {
val vo = HashMap<String, Any>()
vo["mobile"] = mobile
vo["type"] = 1
ApiModel.sendMobileCode(lifecycleProvider,vo).safeSubscribe(
object : HttpSubscribeImpl<BaseResponse<Any>>(
this@OpenvipViewModel, true) {
override fun onBusinessSuccess(response: BaseResponse<Any>) {
KLog.e("sendMobileCode", response.result.toString())
}
override fun onError(e: Throwable) {
data.value = "失败"
KLog.e("sendMobileCode", "发送验证码错误")
}
})
}
}
package com.mints.street.main.my package com.mints.street.main.my
import android.Manifest
import android.os.Build
import android.os.Bundle import android.os.Bundle
import android.view.View
import com.fry.base.base.BaseActivity import com.fry.base.base.BaseActivity
import com.github.iielse.switchbutton.SwitchView import com.github.iielse.switchbutton.SwitchView
import com.mints.street.BR import com.mints.street.BR
import com.mints.street.R import com.mints.street.R
import com.mints.street.databinding.ActivityMoresettingsBinding import com.mints.street.common.Constant
import com.mints.street.databinding.ActivityPermissionsBinding import com.mints.street.databinding.ActivityPermissionsBinding
import com.mints.street.main.MainActivity
import com.tbruyelle.rxpermissions2.RxPermissions
import com.tencent.mmkv.MMKV
import kotlinx.android.synthetic.main.activity_permissions.* import kotlinx.android.synthetic.main.activity_permissions.*
import me.goldze.mvvmhabit.utils.ToastUtils
/**
* 描述:权限授权
* 作者:孟崔广
* 时间:2021/7/14 15:51
*/
class PermissionsActivity : BaseActivity<ActivityPermissionsBinding, PermissionsViewModel>(), View.OnClickListener {
class PermissionsActivity : BaseActivity<ActivityPermissionsBinding, PermissionsViewModel>() {
override fun initVariableId() = BR.viewModel override fun initVariableId() = BR.viewModel
override fun initContentView(savedInstanceState: Bundle?)= R.layout.activity_permissions override fun initContentView(savedInstanceState: Bundle?)= R.layout.activity_permissions
override fun initData() { override fun initData() {
super.initData() super.initData()
initView() initView()
initListener()
}
private fun initListener() {
btnPermissionsDont.setOnClickListener(this)
btnPermissionsNext.setOnClickListener(this)
} }
private fun initView() { private fun initView() {
sv_positioning.setOnStateChangedListener(object : SwitchView.OnStateChangedListener { svPosition.setOnStateChangedListener(object : SwitchView.OnStateChangedListener {
override fun toggleToOn(view: SwitchView?) {
svPosition?.isOpened = true
}
override fun toggleToOff(view: SwitchView?) {
svPosition?.isOpened = false
}
})
svStrong.setOnStateChangedListener(object : SwitchView.OnStateChangedListener {
override fun toggleToOn(view: SwitchView?) {
svStrong?.isOpened = true
}
override fun toggleToOff(view: SwitchView?) {
svStrong?.isOpened = false
}
})
svReadmsg.setOnStateChangedListener(object : SwitchView.OnStateChangedListener {
override fun toggleToOn(view: SwitchView?) { override fun toggleToOn(view: SwitchView?) {
sv_positioning?.isOpened = true svReadmsg?.isOpened = true
} }
override fun toggleToOff(view: SwitchView?) { override fun toggleToOff(view: SwitchView?) {
sv_positioning?.isOpened = false svReadmsg?.isOpened = false
} }
}) })
}
override fun onClick(v: View?) {
when(v?.id){
R.id.btnPermissionsDont -> ToastUtils.showLong("请您同意授权,否则将无法使用APP功能")
R.id.btnPermissionsNext->{
val rxPermissions = RxPermissions(this)
rxPermissions.request(
if(svPosition.isOpened&&Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) Manifest.permission.ACCESS_BACKGROUND_LOCATION else "",
if(svPosition.isOpened) Manifest.permission.ACCESS_FINE_LOCATION else "",
if(svStrong.isOpened) Manifest.permission.WRITE_EXTERNAL_STORAGE else "",
if(svReadmsg.isOpened) Manifest.permission.READ_PHONE_STATE else ""
)
.subscribe {
startActivityThenKill(MainActivity::class.java)
}
MMKV.mmkvWithID(Constant.FIRST_OPEN_PERMISSIONS).encode(Constant.FIRST_OPEN_PERMISSIONS, true)
}
}
} }
} }
\ No newline at end of file
package com.mints.street.main.my
class PrivacypolicyActivity {
}
package com.mints.street.main.my
class UseragreementActivity {
}
...@@ -13,11 +13,6 @@ class UserManager { ...@@ -13,11 +13,6 @@ class UserManager {
companion object { companion object {
/**
* 游客 or 登录用户
*/
private const val IS_TEMP_USER = "is_temp_user"
/** /**
* 用户ID * 用户ID
*/ */
...@@ -38,46 +33,6 @@ class UserManager { ...@@ -38,46 +33,6 @@ class UserManager {
*/ */
private const val MOBILE = "mobile" private const val MOBILE = "mobile"
/**
* 姓名
*/
private const val REAL_NAME = "realName"
/**
* 支付宝
*/
private const val ALIPAY_ACCOUNT = "alipay_account"
/**
* 用户金币
*/
private const val USER_GOLD = "user_gold"
/**
* 用户总金币
*/
private const val USER_SUM_GOLD = "user_sum_gold"
/**
* 用户零钱
*/
private const val USER_CASH = "user_cash"
/**
* 是否老用户 true-老用户
*/
private const val USER_OLD = "user_old"
/**
* 猎豹游戏info
*/
private const val GAME_INFO = "game_info"
/**
* 广告隐藏标识
*/
private const val AD_SHOW_FLAG = "ad_show_flag"
/** /**
* 微信名称 * 微信名称
*/ */
...@@ -93,6 +48,16 @@ class UserManager { ...@@ -93,6 +48,16 @@ class UserManager {
*/ */
private const val WX_OPENID = "wx_openid" private const val WX_OPENID = "wx_openid"
/**
* 是否购买会员
*/
private const val IS_FOREVER = "is_forever"
/**
* 会员是否永久
*/
private const val EXPIRETIME = "expiretime"
val INSTANCE: UserManager by lazy(mode = LazyThreadSafetyMode.SYNCHRONIZED) { val INSTANCE: UserManager by lazy(mode = LazyThreadSafetyMode.SYNCHRONIZED) {
UserManager() UserManager()
} }
...@@ -117,26 +82,19 @@ class UserManager { ...@@ -117,26 +82,19 @@ class UserManager {
if (user != null) { if (user != null) {
val mobile: String? = user.mobile val mobile: String? = user.mobile
val openid: String? = user.openid val openid: String? = user.openid
if (mobile == null && openid == null) {
MMKV.mmkvWithID(IS_TEMP_USER).remove(IS_TEMP_USER)
} else {
MMKV.mmkvWithID(IS_TEMP_USER).encode(IS_TEMP_USER, mobile + openid)
}
MMKV.mmkvWithID(USER_ID).encode(USER_ID, user.pk_id.toString()) MMKV.mmkvWithID(USER_ID).encode(USER_ID, user.pk_id.toString())
MMKV.mmkvWithID(CODE_ID).encode(CODE_ID, user.idcode.toString()) MMKV.mmkvWithID(CODE_ID).encode(CODE_ID, user.idcode)
MMKV.mmkvWithID(MOBILE).encode(MOBILE, mobile) if (!TextUtils.isEmpty(mobile)) {
MMKV.mmkvWithID(ALIPAY_ACCOUNT) MMKV.mmkvWithID(MOBILE).encode(MOBILE, mobile)
.encode(ALIPAY_ACCOUNT, user.alipay_account.toString()) }
MMKV.mmkvWithID(USER_GOLD).encode(USER_GOLD, user.coin.toString()) if (!TextUtils.isEmpty(user.nickname)) {
MMKV.mmkvWithID(USER_CASH) MMKV.mmkvWithID(WX_NAME).encode(WX_NAME, user.nickname)
.encode(USER_CASH, String.format("%.2f", user.surplus)) }
MMKV.mmkvWithID(USER_SUM_GOLD).encode(USER_SUM_GOLD, user.sumCoin.toString()) MMKV.mmkvWithID(IS_FOREVER).encode(IS_FOREVER, user.isForever)
MMKV.mmkvWithID(USER_OLD).encode(USER_OLD, !user.isFirstSignInApp) MMKV.mmkvWithID(EXPIRETIME).encode(EXPIRETIME, user.expireTime)
MMKV.mmkvWithID(WX_NAME).encode(WX_NAME, user.nickname.toString()) if (!TextUtils.isEmpty(openid)) {
MMKV.mmkvWithID(WX_HEADER).encode(WX_HEADER, user.head) MMKV.mmkvWithID(WX_OPENID).encode(WX_OPENID, openid)
MMKV.mmkvWithID(WX_OPENID).encode(WX_OPENID, openid) }
MMKV.mmkvWithID(GAME_INFO).encode(GAME_INFO, user.gameInfo)
MMKV.mmkvWithID(REAL_NAME).encode(REAL_NAME, user.real_name)
} }
} }
...@@ -154,7 +112,7 @@ class UserManager { ...@@ -154,7 +112,7 @@ class UserManager {
* @return true为已登录 false 为未登录 * @return true为已登录 false 为未登录
*/ */
fun userIsLogin(): Boolean { fun userIsLogin(): Boolean {
val kv = MMKV.mmkvWithID(IS_TEMP_USER).decodeString(IS_TEMP_USER, "") val kv = MMKV.mmkvWithID(WX_OPENID).decodeString(WX_OPENID, "")
return !TextUtils.isEmpty(kv) return !TextUtils.isEmpty(kv)
} }
...@@ -182,100 +140,6 @@ class UserManager { ...@@ -182,100 +140,6 @@ class UserManager {
return kv.decodeString(CODE_ID, "") return kv.decodeString(CODE_ID, "")
} }
/**
* 获取真实姓名
*/
fun getRealName(): String {
val kv = MMKV.mmkvWithID(REAL_NAME)
return kv.decodeString(REAL_NAME, "")
}
/**
* 设置真实姓名
*
* @param name
*/
fun setRealName(name: String?) {
val kv = MMKV.mmkvWithID(REAL_NAME)
kv.encode(REAL_NAME, name)
}
/**
* 是否老用户 true-老用户
*/
fun getUserOld(): Boolean {
val kv = MMKV.mmkvWithID(USER_OLD)
return kv.decodeBool(USER_OLD, false)
}
fun getAdShowFlag(): Boolean {
val kv = MMKV.mmkvWithID(AD_SHOW_FLAG)
return kv.decodeBool(AD_SHOW_FLAG, false)
}
/**
* 设置真实姓名
*
* @param userOld
*/
fun setUserOld(userOld: Boolean) {
val kv = MMKV.mmkvWithID(USER_OLD)
kv.encode(USER_OLD, userOld)
}
/**
* 获取支付宝账户
*/
fun getAlipayAccount(): String {
val kv = MMKV.mmkvWithID(ALIPAY_ACCOUNT)
return kv.decodeString(ALIPAY_ACCOUNT, "")
}
/**
* 设置支付宝账户
*
* @param alipay
*/
fun setAlipayAccount(alipay: String?) {
val kv = MMKV.mmkvWithID(ALIPAY_ACCOUNT)
kv.encode(ALIPAY_ACCOUNT, alipay)
}
fun getUserSumGold(): String {
val kv = MMKV.mmkvWithID(USER_SUM_GOLD)
return kv.decodeString(USER_SUM_GOLD, "")
}
/**
* 获取用户金币/积分
*/
fun getUserGold(): String {
val kv = MMKV.mmkvWithID(USER_GOLD)
return kv.decodeString(USER_GOLD, "")
}
/**
* 设置用户金币/积分
*
* @param gold
*/
fun setUserGold(gold: String?) {
val kv = MMKV.mmkvWithID(USER_GOLD)
kv.encode(USER_GOLD, gold)
}
/**
* 获取用户零钱
*/
fun getUserCash(): String {
val kv = MMKV.mmkvWithID(USER_CASH)
return kv.decodeString(USER_CASH, "")
}
fun getGameInfo(): String {
val kv = MMKV.mmkvWithID(GAME_INFO)
return kv.decodeString(GAME_INFO, "")
}
fun getWxName(): String { fun getWxName(): String {
val kv = MMKV.mmkvWithID(WX_NAME) val kv = MMKV.mmkvWithID(WX_NAME)
...@@ -292,60 +156,26 @@ class UserManager { ...@@ -292,60 +156,26 @@ class UserManager {
return kv.decodeString(WX_OPENID, "") return kv.decodeString(WX_OPENID, "")
} }
/** fun getIsforever(): Boolean {
* 设置用户零钱 val kv = MMKV.mmkvWithID(IS_FOREVER)
* return kv.decodeBool(IS_FOREVER, false)
* @param cash
*/
fun setUserCash(cash: String?) {
val kv = MMKV.mmkvWithID(USER_CASH)
kv.encode(WX_OPENID, cash)
}
fun setGameInfo(gameInfo: String?) {
val kv = MMKV.mmkvWithID(GAME_INFO)
kv.encode(GAME_INFO, gameInfo)
}
fun setWxName(wxName: String?) {
val kv = MMKV.mmkvWithID(WX_NAME)
kv.encode(WX_NAME, wxName)
}
fun setWxHeader(wxHeader: String?) {
val kv = MMKV.mmkvWithID(WX_HEADER)
kv.encode(WX_HEADER, wxHeader)
} }
/** fun getExpiretime(): Long {
* mobile val kv = MMKV.mmkvWithID(EXPIRETIME)
* return kv.decodeLong(EXPIRETIME, 0)
* @param mobile
*/
fun setMobile(mobile: String?) {
val kv = MMKV.mmkvWithID(MOBILE)
kv.encode(MOBILE, mobile)
} }
fun setAdShowFlag(adShowFlag: Boolean) {
val kv = MMKV.mmkvWithID(AD_SHOW_FLAG)
kv.encode(AD_SHOW_FLAG, adShowFlag)
}
fun userLogout() { fun userLogout() {
MMKV.mmkvWithID(USER_ID).remove(USER_ID) MMKV.mmkvWithID(USER_ID).remove(USER_ID)
MMKV.mmkvWithID(CODE_ID).remove(CODE_ID) MMKV.mmkvWithID(CODE_ID).remove(CODE_ID)
MMKV.mmkvWithID(TOKEN_ID).remove(TOKEN_ID) MMKV.mmkvWithID(TOKEN_ID).remove(TOKEN_ID)
MMKV.mmkvWithID(REAL_NAME).remove(REAL_NAME)
MMKV.mmkvWithID(IS_TEMP_USER).remove(IS_TEMP_USER)
MMKV.mmkvWithID(ALIPAY_ACCOUNT).remove(ALIPAY_ACCOUNT)
MMKV.mmkvWithID(USER_GOLD).remove(USER_GOLD)
MMKV.mmkvWithID(USER_CASH).remove(USER_CASH)
MMKV.mmkvWithID(USER_OLD).remove(USER_OLD)
MMKV.mmkvWithID(WX_OPENID).remove(WX_OPENID) MMKV.mmkvWithID(WX_OPENID).remove(WX_OPENID)
MMKV.mmkvWithID(WX_NAME).remove(WX_NAME) MMKV.mmkvWithID(WX_NAME).remove(WX_NAME)
MMKV.mmkvWithID(WX_HEADER).remove(WX_HEADER) MMKV.mmkvWithID(WX_HEADER).remove(WX_HEADER)
// MMKV.mmkvWithID(GAME_INFO).remove(GAME_INFO) MMKV.mmkvWithID(IS_FOREVER).remove(IS_FOREVER)
MMKV.mmkvWithID(EXPIRETIME).remove(EXPIRETIME)
} }
} }
\ No newline at end of file
package com.mints.street.model package com.mints.street.model
import com.mints.street.api.MainApi import com.mints.street.api.MainApi
import com.mints.street.bean.AwardBean import com.mints.street.bean.BaseResponse
import com.mints.street.bean.UserBean import com.mints.street.bean.UserBean
import com.mints.street.netwrok.common.HttpManager import com.mints.street.netwrok.common.HttpManager
import com.trello.rxlifecycle2.LifecycleProvider import com.trello.rxlifecycle2.LifecycleProvider
import io.reactivex.Observable import io.reactivex.Observable
import me.goldze.mvvmhabit.http.BaseResponse
import retrofit2.Response import retrofit2.Response
/** /**
* Created by 冯瑞雨 on 2021/7/2. * Created by 冯瑞雨 on 2021/7/2.
*/ */
object ApiModel { object ApiModel {
/**
* 发送验证码
*/
fun sendMobileCode(lifecycleProvider: LifecycleProvider<Any>?
,map: Map<String, Any>): Observable<Response<BaseResponse<Any>>> {
return HttpManager.getInstance()
.execute(lifecycleProvider,MainApi.newInstance().sendMobileCode(map))
}
/** /**
* 登录 * 登录
*/ */
...@@ -21,13 +30,22 @@ object ApiModel { ...@@ -21,13 +30,22 @@ object ApiModel {
return HttpManager.getInstance() return HttpManager.getInstance()
.execute(lifecycleProvider,MainApi.newInstance().mobileLogin(map)) .execute(lifecycleProvider,MainApi.newInstance().mobileLogin(map))
} }
/** /**
* 获取用户配置信息 * 设备信息
*
*/ */
fun saveTerminalInfo(lifecycleProvider: LifecycleProvider<Any>?
,map: Map<String, Any>): Observable<Response<BaseResponse<Any>>> {
return HttpManager.getInstance()
.execute(lifecycleProvider,MainApi.newInstance().saveTerminalInfo(map))
}
fun coinMsg(lifecycleProvider: LifecycleProvider<Any>?): Observable<Response<BaseResponse<AwardBean>>> { /**
* 开通会员
*/
fun openvip(lifecycleProvider: LifecycleProvider<Any>?
,map: Map<String, Any>): Observable<Response<BaseResponse<Any>>> {
return HttpManager.getInstance() return HttpManager.getInstance()
.execute(lifecycleProvider,MainApi.newInstance().getCoinMsg()) .execute(lifecycleProvider,MainApi.newInstance().getVipProductsByType(map))
} }
} }
\ No newline at end of file
package com.mints.street.netwrok.base package com.mints.street.netwrok.base
import com.mints.street.bean.BaseResponse
import me.goldze.mvvmhabit._enum.ViewStatus import me.goldze.mvvmhabit._enum.ViewStatus
import me.goldze.mvvmhabit.base.BaseViewModel import me.goldze.mvvmhabit.base.BaseViewModel
import me.goldze.mvvmhabit.http.BaseResponse
import me.goldze.mvvmhabit.http.ExceptionHandle import me.goldze.mvvmhabit.http.ExceptionHandle
import me.goldze.mvvmhabit.http.ResponseThrowable import me.goldze.mvvmhabit.http.ResponseThrowable
import me.goldze.mvvmhabit.utils.ToastUtils import me.goldze.mvvmhabit.utils.ToastUtils
......
package com.mints.street.netwrok.base; package com.mints.street.netwrok.base;
import com.mints.street.bean.BaseResponse;
import io.reactivex.disposables.Disposable; import io.reactivex.disposables.Disposable;
import me.goldze.mvvmhabit.http.BaseResponse;
import me.goldze.mvvmhabit.http.ResponseThrowable; import me.goldze.mvvmhabit.http.ResponseThrowable;
import retrofit2.Response; import retrofit2.Response;
......
package com.mints.street.netwrok.base package com.mints.street.netwrok.base
import com.mints.street.bean.BaseResponse
import io.reactivex.Observer import io.reactivex.Observer
import io.reactivex.disposables.Disposable import io.reactivex.disposables.Disposable
import me.goldze.mvvmhabit.base.BaseViewModel import me.goldze.mvvmhabit.base.BaseViewModel
import me.goldze.mvvmhabit.http.BaseResponse
import retrofit2.Response import retrofit2.Response
/** /**
......
...@@ -7,6 +7,9 @@ import androidx.annotation.NonNull; ...@@ -7,6 +7,9 @@ import androidx.annotation.NonNull;
import com.fry.base.BuildConfig; import com.fry.base.BuildConfig;
import com.mints.street.netwrok.common.GsonConverterFactory; import com.mints.street.netwrok.common.GsonConverterFactory;
import com.mints.street.netwrok.common.OkHttpInterceptor;
import com.mints.street.utils.encry.AESUtils;
import com.orhanobut.logger.Logger;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
...@@ -23,11 +26,12 @@ import okhttp3.ConnectionPool; ...@@ -23,11 +26,12 @@ import okhttp3.ConnectionPool;
import okhttp3.Interceptor; import okhttp3.Interceptor;
import okhttp3.OkHttpClient; import okhttp3.OkHttpClient;
import okhttp3.internal.platform.Platform; import okhttp3.internal.platform.Platform;
import okhttp3.logging.HttpLoggingInterceptor;
import retrofit2.Retrofit; import retrofit2.Retrofit;
import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory; import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory;
/** /**
* Created by jeme on 2019/1/31 * Created by mcg
*/ */
public class RetrofitClient { public class RetrofitClient {
...@@ -46,38 +50,31 @@ public class RetrofitClient { ...@@ -46,38 +50,31 @@ public class RetrofitClient {
OkHttpClient.Builder clientBuilder = new OkHttpClient.Builder() OkHttpClient.Builder clientBuilder = new OkHttpClient.Builder()
.cookieJar(new CookieJarImpl(new PersistentCookieStore(mContext))) .cookieJar(new CookieJarImpl(new PersistentCookieStore(mContext)))
// .cache(cache)
// .addInterceptor()
// .addInterceptor(new CacheInterceptor(mContext))
// .sslSocketFactory(sslParams.sSLSocketFactory, sslParams.trustManager)
.connectTimeout(mHttpConfig.getTimeOut(), TimeUnit.SECONDS) .connectTimeout(mHttpConfig.getTimeOut(), TimeUnit.SECONDS)
.writeTimeout(mHttpConfig.getTimeOut(), TimeUnit.SECONDS) .writeTimeout(mHttpConfig.getTimeOut(), TimeUnit.SECONDS)
.readTimeout(mHttpConfig.getTimeOut(), TimeUnit.SECONDS) .readTimeout(mHttpConfig.getTimeOut(), TimeUnit.SECONDS)
.connectionPool(new ConnectionPool(8, 15, TimeUnit.SECONDS)); .connectionPool(new ConnectionPool(8, 15, TimeUnit.SECONDS));
// 这里你可以根据自己的机型设置同时连接的个数和时间,我这里8个,和每个保持时间为10s
if (configuation.getInterceptors() != null) { if (BuildConfig.DEBUG) {
for (Interceptor interceptor : configuation.getInterceptors()) { HttpLoggingInterceptor logging = new HttpLoggingInterceptor(message -> {
clientBuilder.addInterceptor(interceptor); if (TextUtils.isEmpty(message)) return;
} String s = message.substring(0, 1);
} String request = message.substring(0, 4);
if(BuildConfig.IS_DEV) { if ("{".equals(s) || "[".equals(s)) {
clientBuilder.addInterceptor(new LoggingInterceptor Logger.json(message);
.Builder() } else if (request.contains("-->") || request.contains("<--")) {
//是否开启日志打印 Logger.d("Method" + message);
.loggable(BuildConfig.DEBUG) } else {
//打印的等级 Logger.d("params:" + message);
.setLevel(Level.BASIC) }
// 打印类型 });
.log(Platform.INFO) logging.setLevel(HttpLoggingInterceptor.Level.BODY);
// request的Tag clientBuilder.interceptors().add(logging);
.request("Request")
// Response的Tag
.response("Request")
// .addHeader("log-header", "I am the log request header.") // 添加打印头, 注意 key 和 value 都不能是中文
.build()
);
} }
OkHttpInterceptor okHttpInterceptor = new OkHttpInterceptor(AESUtils.getDefaultKey());
clientBuilder.interceptors().add(okHttpInterceptor);
mOkHttpClient = clientBuilder.build(); mOkHttpClient = clientBuilder.build();
mRetrofit = new Retrofit.Builder() mRetrofit = new Retrofit.Builder()
.client(mOkHttpClient) .client(mOkHttpClient)
...@@ -97,25 +94,4 @@ public class RetrofitClient { ...@@ -97,25 +94,4 @@ public class RetrofitClient {
} }
return mRetrofit.create(service); return mRetrofit.create(service);
} }
/**
* /**
* execute your customer API
* For example:
* MyApiService service =
* RetrofitClient.getInstance(MainActivity.this).create(MyApiService.class);
* <p>
* RetrofitClient.getInstance(MainActivity.this)
* .execute(service.lgon("name", "password"), subscriber)
* * @param subscriber
*/
public static <T> T execute(Observable<T> observable, Observer<T> subscriber) {
observable.subscribeOn(Schedulers.io())
.unsubscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(subscriber);
return null;
}
} }
package com.mints.street.netwrok.common; package com.mints.street.netwrok.common;
import com.google.gson.Gson; import com.google.gson.Gson;
import com.mints.street.bean.BaseResponse;
import com.mints.street.manager.UserManager; import com.mints.street.manager.UserManager;
import java.io.IOException; import java.io.IOException;
...@@ -12,7 +13,6 @@ import java.lang.reflect.Type; ...@@ -12,7 +13,6 @@ import java.lang.reflect.Type;
import java.nio.charset.Charset; import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
import me.goldze.mvvmhabit.http.BaseResponse;
import okhttp3.MediaType; import okhttp3.MediaType;
import okhttp3.RequestBody; import okhttp3.RequestBody;
import okhttp3.ResponseBody; import okhttp3.ResponseBody;
......
package com.mints.street.netwrok.common; package com.mints.street.netwrok.common;
import com.mints.street.bean.BaseResponse;
import io.reactivex.Observable; import io.reactivex.Observable;
import io.reactivex.ObservableSource; import io.reactivex.ObservableSource;
import io.reactivex.ObservableTransformer; import io.reactivex.ObservableTransformer;
import io.reactivex.functions.Function; import io.reactivex.functions.Function;
import me.goldze.mvvmhabit.http.BaseResponse;
import retrofit2.Response; import retrofit2.Response;
/** /**
......
...@@ -3,10 +3,10 @@ package com.mints.street.netwrok.common; ...@@ -3,10 +3,10 @@ package com.mints.street.netwrok.common;
import android.annotation.SuppressLint; import android.annotation.SuppressLint;
import com.fry.base.global.Constants; import com.fry.base.global.Constants;
import com.mints.street.bean.BaseResponse;
import com.mints.street.netwrok.base.HttpConfiguation; import com.mints.street.netwrok.base.HttpConfiguation;
import com.mints.street.netwrok.base.IHttpResponseListener; import com.mints.street.netwrok.base.IHttpResponseListener;
import com.mints.street.netwrok.base.RetrofitClient; import com.mints.street.netwrok.base.RetrofitClient;
import com.mints.street.utils.encry.AESUtils;
import com.trello.rxlifecycle2.LifecycleProvider; import com.trello.rxlifecycle2.LifecycleProvider;
import io.reactivex.Observable; import io.reactivex.Observable;
...@@ -17,7 +17,6 @@ import io.reactivex.functions.Action; ...@@ -17,7 +17,6 @@ import io.reactivex.functions.Action;
import io.reactivex.functions.Consumer; import io.reactivex.functions.Consumer;
import io.reactivex.functions.Function; import io.reactivex.functions.Function;
import io.reactivex.schedulers.Schedulers; import io.reactivex.schedulers.Schedulers;
import me.goldze.mvvmhabit.http.BaseResponse;
import me.goldze.mvvmhabit.http.ResponseThrowable; import me.goldze.mvvmhabit.http.ResponseThrowable;
import me.goldze.mvvmhabit.utils.RxUtils; import me.goldze.mvvmhabit.utils.RxUtils;
import retrofit2.Response; import retrofit2.Response;
...@@ -42,7 +41,6 @@ public class HttpManager { ...@@ -42,7 +41,6 @@ public class HttpManager {
private HttpManager() { private HttpManager() {
mDefaultClient = new RetrofitClient( mDefaultClient = new RetrofitClient(
HttpConfiguation.create(Constants.getBaseUrl()) HttpConfiguation.create(Constants.getBaseUrl())
.addInterceptor(new OkHttpInterceptor(AESUtils.getDefaultKey()))
); );
} }
...@@ -80,60 +78,4 @@ public class HttpManager { ...@@ -80,60 +78,4 @@ public class HttpManager {
.compose(RxUtils.exceptionTransformer()) .compose(RxUtils.exceptionTransformer())
.compose(HttpErrorProcess.businessExceptionTransformer()); .compose(HttpErrorProcess.businessExceptionTransformer());
} }
@SuppressLint("CheckResult")
public <B extends BaseResponse, T extends Response<B>>
void execute(LifecycleProvider life, final Observable<T> observable, IHttpResponseListener<B> listener) {
Observable<T> newObservable = Observable.just(observable)
.observeOn(Schedulers.io())
.flatMap((Function<Observable<T>, ObservableSource<T>>) tObservable -> {
// ServerTimeHelper.requestServerTime();
return observable;
})
.observeOn(AndroidSchedulers.mainThread());
if (life != null) {
newObservable = newObservable.compose(RxUtils.bindToLifecycle(life));
}
newObservable
.compose(RxUtils.schedulersTransformer())
.compose(RxUtils.exceptionTransformer())
.compose(HttpErrorProcess.businessExceptionTransformer())
.doOnSubscribe(new Consumer<Disposable>() {
@Override
public void accept(Disposable disposable) throws Exception {
if (listener != null) {
listener.onStart(disposable);
}
}
})
.doFinally(new Action() {
@Override
public void run() throws Exception {
if (listener != null) {
listener.onCompleted();
}
}
})
.subscribe(t -> {
if (listener != null) {
// listener.onCompleted();
if (!listener.onParseResponse(t)) {
if (t.body() != null && t.body().isOk()) {
listener.onBusinessSuccess(t.body());
} else {
listener.onBusinessFail(t.body());
}
}
}
}, throwable -> {
if (listener != null && throwable instanceof ResponseThrowable) {
listener.onFailed((ResponseThrowable) throwable);
}
throwable.printStackTrace();
}, () -> {
});
}
} }
...@@ -3,10 +3,10 @@ package com.mints.street.netwrok.common ...@@ -3,10 +3,10 @@ package com.mints.street.netwrok.common
import android.text.TextUtils import android.text.TextUtils
import android.util.Log import android.util.Log
import com.bytedance.hume.readapk.HumeSDK import com.bytedance.hume.readapk.HumeSDK
import com.fry.base.bean.AppRequest
import com.google.gson.Gson import com.google.gson.Gson
import com.mints.street.AppApplication import com.mints.street.AppApplication
import com.mints.street.BuildConfig import com.mints.street.BuildConfig
import com.mints.street.bean.AppRequest
import com.mints.street.manager.UserManager import com.mints.street.manager.UserManager
import com.mints.street.utils.CommonUtils import com.mints.street.utils.CommonUtils
import com.mints.street.utils.encry.AESUtils import com.mints.street.utils.encry.AESUtils
...@@ -165,10 +165,6 @@ class OkHttpInterceptor(aesKey: String) : Interceptor { ...@@ -165,10 +165,6 @@ class OkHttpInterceptor(aesKey: String) : Interceptor {
// 解密 // 解密
try { try {
val json = JSONObject(rspString) val json = JSONObject(rspString)
// if(!json.isNull("status")&& TextUtils.equals(json["status"].toString(),"401")){
// return
// }
if (!json.isNull("data")) { if (!json.isNull("data")) {
val data = json["data"] val data = json["data"]
rspString = AESUtils.detrypt(data.toString(), aesKey) rspString = AESUtils.detrypt(data.toString(), aesKey)
......
package com.mints.street.splash
import android.os.Bundle
import android.view.View
import com.bumptech.glide.Glide
import com.fry.base.BR
import com.fry.base.base.BaseActivity
import com.mints.street.R
import com.mints.street.databinding.ActivityGuideBinding
import com.mints.street.main.MainActivity
import kotlinx.android.synthetic.main.activity_guide.*
class GuideActivity : BaseActivity<ActivityGuideBinding,GuideBindingViewModel>(), View.OnClickListener {
override fun initContentView(savedInstanceState: Bundle?)=R.layout.activity_guide
override fun initVariableId()= BR.viewModel
override fun initData() {
super.initData()
initView()
initListener()
}
private fun initListener() {
bt_enter.setOnClickListener(this)
}
private fun initView() {
Glide.with(this).asGif().load(R.mipmap.earth).into(iv_earth);
}
override fun onClick(v: View?) {
when(v?.id){
R.id.bt_enter->{
startActivityThenKill(MainActivity::class.java)
}
}
}
}
\ No newline at end of file
package com.mints.street.splash
import android.app.Application
import me.goldze.mvvmhabit.base.BaseViewModel
class GuideBindingViewModel(application: Application) :BaseViewModel(application){
}
...@@ -12,10 +12,14 @@ import com.bytedance.msdk.api.splash.TTSplashAdLoadCallback ...@@ -12,10 +12,14 @@ import com.bytedance.msdk.api.splash.TTSplashAdLoadCallback
import com.fry.base.base.BaseActivity import com.fry.base.base.BaseActivity
import com.mints.street.BR import com.mints.street.BR
import com.mints.street.R import com.mints.street.R
import com.mints.street.common.Constant
import com.mints.street.common.DeviceInfo import com.mints.street.common.DeviceInfo
import com.mints.street.databinding.ActivitySplashBinding import com.mints.street.databinding.ActivitySplashBinding
import com.mints.street.main.MainActivity import com.mints.street.main.MainActivity
import com.mints.street.main.my.PermissionsActivity
import com.mints.street.manager.CsjGroMoreManager import com.mints.street.manager.CsjGroMoreManager
import com.mints.street.manager.UserManager
import com.tencent.mmkv.MMKV
/** /**
* 描述:gromore开屏页 * 描述:gromore开屏页
...@@ -45,6 +49,7 @@ class SplashActivity:BaseActivity<ActivitySplashBinding,SplashViewModel>() { ...@@ -45,6 +49,7 @@ class SplashActivity:BaseActivity<ActivitySplashBinding,SplashViewModel>() {
} }
//校验App签名
checkAppSign() checkAppSign()
} }
...@@ -53,7 +58,7 @@ class SplashActivity:BaseActivity<ActivitySplashBinding,SplashViewModel>() { ...@@ -53,7 +58,7 @@ class SplashActivity:BaseActivity<ActivitySplashBinding,SplashViewModel>() {
if (mForceGoMain) { if (mForceGoMain) {
goToMainActivity() goToMainActivity()
} }
if (onPaused ) { if (onPaused) {
// 这种情况下,百度开屏广告不能在onAdDismiss中跳转,需要自己在onResume中跳转主页。 // 这种情况下,百度开屏广告不能在onAdDismiss中跳转,需要自己在onResume中跳转主页。
goToMainActivity() goToMainActivity()
} }
...@@ -68,7 +73,6 @@ class SplashActivity:BaseActivity<ActivitySplashBinding,SplashViewModel>() { ...@@ -68,7 +73,6 @@ class SplashActivity:BaseActivity<ActivitySplashBinding,SplashViewModel>() {
override fun onStop() { override fun onStop() {
super.onStop() super.onStop()
mForceGoMain = true mForceGoMain = true
} }
...@@ -163,6 +167,11 @@ class SplashActivity:BaseActivity<ActivitySplashBinding,SplashViewModel>() { ...@@ -163,6 +167,11 @@ class SplashActivity:BaseActivity<ActivitySplashBinding,SplashViewModel>() {
* 跳转到主页面 * 跳转到主页面
*/ */
private fun goToMainActivity() { private fun goToMainActivity() {
startActivityThenKill(MainActivity::class.java) if(MMKV.mmkvWithID(Constant.FIRST_OPEN_PERMISSIONS).decodeBool(Constant.FIRST_OPEN_PERMISSIONS, false)){
// 非新用户
startActivityThenKill(MainActivity::class.java)
}else{
startActivityThenKill(PermissionsActivity::class.java)
}
} }
} }
\ No newline at end of file
package com.mints.street.utils;
import android.text.Editable;
import android.text.Selection;
import android.text.TextWatcher;
import android.widget.EditText;
/**
* 验卷,每四位自动跟横线
* Created by mengcuiguang on 2016/8/15.
*/
public class BackInputUtil {
public static void bankCardNumAddSpace(final EditText mEditText) {
mEditText.addTextChangedListener(new TextWatcher() {
private Editable etable;
int beforeTextLength = 0;
int onTextLength = 0;
boolean isChanged = false;
int location = 0;//记录光标的位置
private char[] tempChar;
private StringBuffer buffer = new StringBuffer();
int konggeNumberB = 0;
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
beforeTextLength = s.length();
if (buffer.length() > 0) {
buffer.delete(0, buffer.length());
}
konggeNumberB = 0;
for (int i = 0; i < s.length(); i++) {
if (s.charAt(i) == ' ') {
konggeNumberB++;
}
}
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
onTextLength = s.length();
buffer.append(s.toString());
if (onTextLength == beforeTextLength || onTextLength <= 3 || isChanged) {
isChanged = false;
return;
}
isChanged = true;
}
@Override
public void afterTextChanged(Editable s) {
if (isChanged) {
location = mEditText.getSelectionEnd();
int index = 0;
while (index < buffer.length()) {
if (buffer.charAt(index) == ' ') {
buffer.deleteCharAt(index);
} else {
index++;
}
}
index = 0;
int konggeNumberC = 0;
while (index < buffer.length()) {
//银行卡号的话需要改这里
if ((index == 4 || index == 9 || index == 14 || index == 19)) {
buffer.insert(index, ' ');
konggeNumberC++;
}
index++;
}
if (konggeNumberC > konggeNumberB) {
location += (konggeNumberC - konggeNumberB);
}
tempChar = new char[buffer.length()];
buffer.getChars(0, buffer.length(), tempChar, 0);
String str = buffer.toString();
if (location > str.length()) {
location = str.length();
} else if (location < 0) {
location = 0;
}
mEditText.setText(str);
etable = mEditText.getText();
Selection.setSelection(etable, location);
isChanged = false;
}
}
});
}
//手机号码的格式
public static void phoneNumAddSpace(final EditText mEditText) {
mEditText.addTextChangedListener(new TextWatcher() {
int beforeTextLength = 0;
int onTextLength = 0;
boolean isChanged = false;
int location = 0;// 记录光标的位置
private char[] tempChar;
private StringBuffer buffer = new StringBuffer();
int konggeNumberB = 0;
@Override
public void beforeTextChanged(CharSequence s, int start, int count,
int after) {
beforeTextLength = s.length();
if (buffer.length() > 0) {
buffer.delete(0, buffer.length());
}
konggeNumberB = 0;
for (int i = 0; i < s.length(); i++) {
if (s.charAt(i) == ' ') {
konggeNumberB++;
}
}
}
@Override
public void onTextChanged(CharSequence s, int start, int before,
int count) {
onTextLength = s.length();
buffer.append(s.toString());
if (onTextLength == beforeTextLength || onTextLength <= 3
|| isChanged) {
isChanged = false;
return;
}
isChanged = true;
}
@Override
public void afterTextChanged(Editable s) {
if (isChanged) {
location = mEditText.getSelectionEnd();
int index = 0;
while (index < buffer.length()) {
if (buffer.charAt(index) == ' ') {
buffer.deleteCharAt(index);
} else {
index++;
}
}
index = 0;
int konggeNumberC = 0;
while (index < buffer.length()) {
if ((index == 3 || index == 8)) {
buffer.insert(index, ' ');
konggeNumberC++;
}
index++;
}
if (konggeNumberC > konggeNumberB) {
location += (konggeNumberC - konggeNumberB);
}
tempChar = new char[buffer.length()];
buffer.getChars(0, buffer.length(), tempChar, 0);
String str = buffer.toString();
if (location > str.length()) {
location = str.length();
} else if (location < 0) {
location = 0;
}
mEditText.setText(str);
Editable etable = mEditText.getText();
Selection.setSelection(etable, location);
isChanged = false;
}
}
});
}
}
package com.mints.street.utils;
import android.content.Context;
import android.content.SharedPreferences;
import android.provider.Settings;
import android.telephony.TelephonyManager;
import com.mints.street.AppApplication;
import java.io.UnsupportedEncodingException;
import java.util.UUID;
/**
* 描述:google生成android设备UUID
* 作者:孟崔广
* 时间:2018/5/9 20:03
* 邮箱:mengcg@xiaojinqb.cn
*/
public class DeviceUuidFactory {
protected static final String PREFS_FILE = "device_id.xml";
protected static final String PREFS_DEVICE_ID = "device_id";
protected static UUID uuid;
public DeviceUuidFactory() {
Context context= AppApplication.Companion.getContext();
if (uuid == null) {
synchronized (DeviceUuidFactory.class) {
if (uuid == null) {
final SharedPreferences prefs = context.getSharedPreferences(PREFS_FILE, 0);
final String id = prefs.getString(PREFS_DEVICE_ID, null);
if (id != null) {
// Use the ids previously computed and stored in the prefs file
uuid = UUID.fromString(id);
} else {
final String androidId = Settings.Secure.getString(context.getContentResolver(), Settings.Secure.ANDROID_ID);
// Use the Android ID unless it's broken, in which case fallback on deviceId,
// unless it's not available, then fallback on a random number which we store
// to a prefs file
try {
if (!"9774d56d682e549c".equals(androidId)) {
uuid = UUID.nameUUIDFromBytes(androidId.getBytes("utf8"));
} else {
final String deviceId = ((TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE)).getDeviceId();
uuid = deviceId != null ? UUID.nameUUIDFromBytes(deviceId.getBytes("utf8")) : UUID.randomUUID();
}
} catch (UnsupportedEncodingException e) {
throw new RuntimeException(e);
}
// Write the value out to the prefs file
prefs.edit().putString(PREFS_DEVICE_ID, uuid.toString()).commit();
}
}
}
}
}
/**
* Returns a unique UUID for the current android device. As with all UUIDs, this unique ID is "very highly likely"
* to be unique across all Android devices. Much more so than ANDROID_ID is.
* <p>
* The UUID is generated by using ANDROID_ID as the base key if appropriate, falling back on
* TelephonyManager.getDeviceID() if ANDROID_ID is known to be incorrect, and finally falling back
* on a random UUID that's persisted to SharedPreferences if getDeviceID() does not return a
* usable value.
* <p>
* In some rare circumstances, this ID may change. In particular, if the device is factory reset a new device ID
* may be generated. In addition, if a user upgrades their phone from certain buggy implementations of Android 2.2
* to a newer, non-buggy version of Android, the device ID may change. Or, if a user uninstalls your app on
* a device that has neither a proper Android ID nor a Device ID, this ID may change on reinstallation.
* <p>
* Note that if the code falls back on using TelephonyManager.getDeviceId(), the resulting ID will NOT
* change after a factory reset. Something to be aware of.
* <p>
* Works around a bug in Android 2.2 for many devices when using ANDROID_ID directly.
*
* @return a UUID that may be used to uniquely identify your device for most purposes.
* @see //http://code.google.com/p/android/issues/detail?id=10603
*/
public UUID getDeviceUuid() {
return uuid;
}
}
package com.mints.street.widget;
import android.content.Context;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.RelativeLayout;
import androidx.viewpager.widget.ViewPager;
import com.fry.base.utils.DensityUtils;
import com.mints.street.R;
import com.mints.street.adapter.CoverFlowAdapter;
import com.mints.street.adapter.listener.OnPageSelectListener;
import java.util.ArrayList;
import java.util.List;
public class CoverFlowViewPager extends RelativeLayout implements OnPageSelectListener {
/**
* 适配器
*/
private CoverFlowAdapter mAdapter;
/**
* 用于左右滚动
*/
private ViewPager mViewPager;
/**
* 需要显示的视图集合
*/
private List<View> mViewList = new ArrayList<>();
private OnPageSelectListener listener;
public CoverFlowViewPager(Context context, AttributeSet attrs) {
super(context, attrs);
inflate(context, R.layout.widget_cover_flow, this);
mViewPager = findViewById(R.id.vp_conver_flow);
// 365dp 380
int marginWidth = DensityUtils.dip2px(50);
int displayWidth = DensityUtils.getDisplayWidth(getContext());
int height = DensityUtils.dip2px( 150);
LayoutParams layoutParams = new LayoutParams(displayWidth - marginWidth, height);
layoutParams.addRule(RelativeLayout.CENTER_HORIZONTAL);
mViewPager.setLayoutParams(layoutParams);
init();
}
/**
* 初始化方法
*/
private void init() {
// 构造适配器,传入数据源
mAdapter = new CoverFlowAdapter(mViewList, getContext());
// 设置选中的回调
mAdapter.setOnPageSelectListener(this);
// 设置适配器
mViewPager.setAdapter(mAdapter);
// 设置滑动的监听,因为adpter实现了滑动回调的接口,所以这里直接设置adpter
mViewPager.addOnPageChangeListener(mAdapter);
// 预加载个数
mViewPager.setOffscreenPageLimit(5);
// 设置触摸事件的分发
setOnTouchListener(new OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
// 传递给ViewPager 进行滑动处理
return mViewPager.dispatchTouchEvent(event);
}
});
}
/**
* 设置显示的数据,进行一层封装
*
* @param lists
*/
public void setViewList(List<View> lists) {
if (lists == null) {
return;
}
mViewList.clear();
for (View view : lists) {
FrameLayout layout = new FrameLayout(getContext());
// 设置padding 值,默认缩小
layout.setPadding(CoverFlowAdapter.sWidthPadding, CoverFlowAdapter.sHeightPadding, CoverFlowAdapter.sWidthPadding, CoverFlowAdapter.sHeightPadding);
layout.addView(view);
mViewList.add(layout);
}
// 刷新数据
mAdapter.notifyDataSetChanged();
}
/**
* 当将某一个作为最中央时的回调
*
* @param listener
*/
public void setOnPageSelectListener(OnPageSelectListener listener) {
this.listener = listener;
}
// 显示的回调
@Override
public void select(int position) {
if (listener != null) {
listener.select(position);
}
}
}
package com.mints.street.widget;
import android.content.Context;
import android.graphics.Rect;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;
import android.view.animation.AccelerateInterpolator;
import android.view.animation.TranslateAnimation;
import androidx.core.widget.NestedScrollView;
/**
* 有弹性的ScrollView
* 实现下拉弹回和上拉弹回
*
* @author zhangjg
* @date Feb 13, 2014 6:11:33 PM
*/
public class ElasticScrollView extends NestedScrollView {
private static final String TAG = "ElasticScrollView";
//移动因子, 是一个百分比, 比如手指移动了100px, 那么View就只移动50px
//目的是达到一个延迟的效果
private static final float MOVE_FACTOR = 0.5f;
//松开手指后, 界面回到正常位置需要的动画时间
private static final int ANIM_TIME = 300;
//ScrollView的子View, 也是ScrollView的唯一一个子View
private View contentView;
//手指按下时的Y值, 用于在移动时计算移动距离
//如果按下时不能上拉和下拉, 会在手指移动时更新为当前手指的Y值
private float startY;
//用于记录正常的布局位置
private Rect originalRect = new Rect();
//手指按下时记录是否可以继续下拉
private boolean canPullDown = false;
//手指按下时记录是否可以继续上拉
private boolean canPullUp = false;
//在手指滑动的过程中记录是否移动了布局
private boolean isMoved = false;
public ElasticScrollView(Context context) {
super(context);
}
public ElasticScrollView(Context context, AttributeSet attrs) {
super(context, attrs);
}
@Override
protected void onFinishInflate() {
super.onFinishInflate();
if (getChildCount() > 0) {
contentView = getChildAt(0);
}
}
@Override
protected void onLayout(boolean changed, int l, int t, int r, int b) {
super.onLayout(changed, l, t, r, b);
if (contentView == null) return;
//ScrollView中的唯一子控件的位置信息, 这个位置信息在整个控件的生命周期中保持不变
originalRect.set(contentView.getLeft(), contentView.getTop(), contentView
.getRight(), contentView.getBottom());
}
/**
* 在触摸事件中, 处理上拉和下拉的逻辑
*/
@Override
public boolean dispatchTouchEvent(MotionEvent ev) {
if (contentView == null) {
return super.dispatchTouchEvent(ev);
}
int action = ev.getAction();
switch (action) {
case MotionEvent.ACTION_DOWN:
//判断是否可以上拉和下拉
canPullDown = isCanPullDown();
canPullUp = isCanPullUp();
//记录按下时的Y值
startY = ev.getY();
break;
case MotionEvent.ACTION_UP:
if (!isMoved) break; //如果没有移动布局, 则跳过执行
// 开启动画
TranslateAnimation anim = new TranslateAnimation(0, 0, contentView.getTop(),
originalRect.top);
anim.setDuration(ANIM_TIME);
anim.setInterpolator(new AccelerateInterpolator());
contentView.startAnimation(anim);
// 设置回到正常的布局位置
contentView.layout(originalRect.left, originalRect.top,
originalRect.right, originalRect.bottom);
//将标志位设回false
canPullDown = false;
canPullUp = false;
isMoved = false;
break;
case MotionEvent.ACTION_MOVE:
//在移动的过程中, 既没有滚动到可以上拉的程度, 也没有滚动到可以下拉的程度
if (!canPullDown && !canPullUp) {
startY = ev.getY();
canPullDown = isCanPullDown();
canPullUp = isCanPullUp();
break;
}
//计算手指移动的距离
float nowY = ev.getY();
int deltaY = (int) (nowY - startY);
//是否应该移动布局
boolean shouldMove =
(canPullDown && deltaY > 0) //可以下拉, 并且手指向下移动
|| (canPullUp && deltaY < 0) //可以上拉, 并且手指向上移动
|| (canPullUp && canPullDown); //既可以上拉也可以下拉(这种情况出现在ScrollView包裹的控件比ScrollView还小)
if (shouldMove) {
//计算偏移量
int offset = (int) (deltaY * MOVE_FACTOR);
//随着手指的移动而移动布局
contentView.layout(originalRect.left, originalRect.top + offset,
originalRect.right, originalRect.bottom + offset);
isMoved = true; //记录移动了布局
}
break;
default:
break;
}
return super.dispatchTouchEvent(ev);
}
/**
* 判断是否滚动到顶部
*/
private boolean isCanPullDown() {
return getScrollY() == 0 ||
contentView.getHeight() < getHeight() + getScrollY();
}
/**
* 判断是否滚动到底部
*/
private boolean isCanPullUp() {
return contentView.getHeight() <= getHeight() + getScrollY();
}
}
\ No newline at end of file
package com.mints.street.widget;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Rect;
import android.text.TextPaint;
import android.util.AttributeSet;
import android.util.Log;
import android.view.MotionEvent;
import android.view.View;
import androidx.annotation.Nullable;
import androidx.appcompat.widget.TintTypedArray;
import com.mints.street.R;
import java.util.ArrayList;
import java.util.List;
/**
* Created by 孟崔广
*/
public class HorizontalselectedView extends View {
private Context context;
private List<String> strings = new ArrayList<String>();//数据源字符串数组
private int seeSize = 5;//可见个数
private int anInt;//每个字母所占的大小;
private TextPaint textPaint;
private boolean firstVisible = true;
private int width;//控件宽度
private int height;//控件高度
private Paint selectedPaint;//被选中文字的画笔
private int n;
private float downX;
private float anOffset;
private float selectedTextSize;
private int selectedColor;
private float textSize;
private int textColor;
private Rect rect = new Rect();
;
private int textWidth = 0;
private int textHeight = 0;
private int centerTextHeight = 0;
public HorizontalselectedView(Context context) {
this(context, null);
}
public HorizontalselectedView(Context context, @Nullable AttributeSet attrs) {
this(context, attrs, 0);
}
public HorizontalselectedView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
this.context = context;
setWillNotDraw(false);
setClickable(true);
initAttrs(attrs);//初始化属性
initPaint();//初始化画笔
}
/**
* 初始化画笔
*/
private void initPaint() {
textPaint = new TextPaint(Paint.ANTI_ALIAS_FLAG);
textPaint.setTextSize(textSize);
textPaint.setColor(textColor);
selectedPaint = new TextPaint(Paint.ANTI_ALIAS_FLAG);
selectedPaint.setColor(selectedColor);
selectedPaint.setTextSize(selectedTextSize);
}
/**
* 初始化属性
* @param attrs
*/
private void initAttrs(AttributeSet attrs) {
TintTypedArray tta = TintTypedArray.obtainStyledAttributes(getContext(), attrs,
R.styleable.HorizontalselectedView);
//两种字体颜色和字体大小
seeSize = tta.getInteger(R.styleable.HorizontalselectedView_HorizontalselectedViewSeesize, 5);
selectedTextSize = tta.getFloat(R.styleable.HorizontalselectedView_HorizontalselectedViewSelectedTextSize, 50);
selectedColor = tta.getColor(R.styleable.HorizontalselectedView_HorizontalselectedViewSelectedTextColor, context.getResources().getColor(android.R.color.black));
textSize = tta.getFloat(R.styleable.HorizontalselectedView_HorizontalselectedViewTextSize, 40);
textColor = tta.getColor(R.styleable.HorizontalselectedView_HorizontalselectedViewTextColor, context.getResources().getColor(android.R.color.darker_gray));
}
@Override
public boolean onTouchEvent(MotionEvent event) {
Log.e("action", "onTouchEvent: " + event.getAction());
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
downX = event.getX();//获得点下去的x坐标
break;
case MotionEvent.ACTION_MOVE://复杂的是移动时的判断
float scrollX = event.getX();
if (n != 0 && n != strings.size() - 1)
anOffset = scrollX - downX;//滑动时的偏移量,用于计算每个是数据源文字的坐标值
else {
anOffset = (float) ((scrollX - downX) / 1.5);//当滑到两端的时候添加一点阻力
}
if (scrollX > downX) {
//向右滑动,当滑动距离大于每个单元的长度时,则改变被选中的文字。
if (scrollX - downX >= anInt) {
if (n > 0) {
anOffset = 0;
n = n - 1;
downX = scrollX;
}
}
} else {
//向左滑动,当滑动距离大于每个单元的长度时,则改变被选中的文字。
if (downX - scrollX >= anInt) {
if (n < strings.size() - 1) {
anOffset = 0;
n = n + 1;
downX = scrollX;
}
}
}
invalidate();
break;
case MotionEvent.ACTION_UP:
//抬起手指时,偏移量归零,相当于回弹。
anOffset = 0;
invalidate();
break;
default:
break;
}
return super.onTouchEvent(event);
}
@Override
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
if (firstVisible) {//第一次绘制的时候得到控件 宽高;
width = getWidth();
height = getHeight();
anInt = width / seeSize;
firstVisible = false;
}
if (n >= 0 && n <= strings.size() - 1) {//加个保护;防止越界
String s = strings.get(n);//得到被选中的文字
/**
* 得到被选中文字 绘制时所需要的宽高
*/
selectedPaint.getTextBounds(s, 0, s.length(), rect);
//3从矩形区域中读出文本内容的宽高
int centerTextWidth = rect.width();
centerTextHeight = rect.height();
canvas.drawText(strings.get(n), getWidth() / 2 - centerTextWidth / 2 + anOffset, getHeight() / 2 + centerTextHeight / 2, selectedPaint);//绘制被选中文字,注意点是y坐标
for (int i = 0; i < strings.size(); i++) {//遍历strings,把每个地方都绘制出来,
if (n > 0 && n < strings.size() - 1) {//这里主要是因为strings数据源的文字长度不一样,为了让被选中两边文字距离中心宽度一样,我们取得左右两个文字长度的平均值
textPaint.getTextBounds(strings.get(n - 1), 0, strings.get(n - 1).length(), rect);
int width1 = rect.width();
textPaint.getTextBounds(strings.get(n + 1), 0, strings.get(n + 1).length(), rect);
int width2 = rect.width();
textWidth = (width1 + width2) / 2;
}
if (i == 0) {//得到高,高度是一样的,所以无所谓
textPaint.getTextBounds(strings.get(0), 0, strings.get(0).length(), rect);
textHeight = rect.height();
}
if (i != n)
canvas.drawText(strings.get(i), (i - n) * anInt + getWidth() / 2 - textWidth / 2 + anOffset, getHeight() / 2 + textHeight / 2, textPaint);//画出每组文字
}
}
}
/**
* 改变中间可见文字的数目
*
* @param seeSizes 可见数
*/
public void setSeeSize(int seeSizes) {
if (seeSize > 0) {
seeSize = seeSizes;
invalidate();
}
}
/**
* 向左移动一个单元
*/
public void setAnLeftOffset() {
if (n < strings.size() - 1) {
n = n + 1;
invalidate();
}
}
/**
* 向右移动一个单元
*/
public void setAnRightOffset() {
if (n > 0) {
n = n - 1;
invalidate();
}
}
/**
* 设置个数据源
*
* @param strings 数据源String集合
*/
public void setData(List<String> strings) {
this.strings = strings;
n = strings.size() / 2;
invalidate();
}
/**
* 获得被选中的文本
*
* @return 被选中的文本
*/
public String getSelectedString() {
if (strings.size() != 0) {
return strings.get(n);
}
return null;
}
}
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/shape_bg_payment" android:state_enabled="true"/>
<item android:drawable="@drawable/shape_bg_payment_down" android:state_enabled="false"/>
</selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners
android:topLeftRadius="20dp"
android:bottomLeftRadius="20dp"/>
<gradient
android:startColor="#73FFFFFF"
android:endColor="#00FFFFFF"
android:angle="0"/>
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/white" />
<corners android:radius="8dp" />
<stroke android:color="#99FF9800" android:width="1dp"/>
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#66EDA412"/>
<corners android:radius="8dp"/>
<stroke android:color="#99FF9800" android:width="1dp"/>
</shape>
\ No newline at end of file
...@@ -2,6 +2,6 @@ ...@@ -2,6 +2,6 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android" <shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle"> android:shape="rectangle">
<solid android:color="#2196F3" /> <solid android:color="#2196F3" />
<corners android:radius="21dp" /> <corners android:radius="30dp" />
</shape> </shape>
\ No newline at end of file
...@@ -7,6 +7,6 @@ ...@@ -7,6 +7,6 @@
android:color="#74000000" android:color="#74000000"
/> />
<solid android:color="#ffffffff" /> <solid android:color="#ffffffff" />
<corners android:radius="21dp" /> <corners android:radius="30dp" />
</shape> </shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"> <shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/color_FF9837" /> <solid android:color="#F1CA54" />
<corners android:radius="100dp" /> <corners android:radius="100dp" />
</shape> </shape>
\ No newline at end of file
...@@ -3,6 +3,6 @@ ...@@ -3,6 +3,6 @@
android:shape="rectangle"> android:shape="rectangle">
<solid android:color="#ffffffff" /> <solid android:color="#ffffffff" />
<corners android:radius="4dp" /> <corners android:radius="10dp" />
</shape> </shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android">
<data>
<variable
name="viewModel"
type="com.mints.street.main.my.BindMobileViewModel" />
</data>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
android:orientation="vertical">
<include layout="@layout/include_header" />
<com.mints.street.widget.ElasticScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<ImageView
android:layout_width="70dp"
android:layout_height="70dp"
android:layout_gravity="center_horizontal"
android:layout_marginTop="50dp"
android:src="@mipmap/ic_launcher_main" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="30dp"
android:layout_marginTop="30dp"
android:layout_marginRight="30dp"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="手机号:" />
<com.mints.street.widget.ClearEditText
android:id="@+id/etLoginMobile"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="30dp"
android:background="@null"
android:gravity="center_vertical"
android:hint="请输入手机号"
android:inputType="number"
android:maxLength="13"
android:maxLines="1"
android:textColor="@color/color_172B54"
android:textColorHint="@color/color_BEC2CC"
android:textSize="12sp" />
</LinearLayout>
<View
style="@style/line_3"
android:layout_marginLeft="30dp"
android:layout_marginRight="30dp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="30dp"
android:layout_marginTop="10dp"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="验证码:" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="30dp">
<com.mints.street.widget.ClearEditText
android:id="@+id/etLoginCode"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerVertical="true"
android:layout_marginRight="120dp"
android:background="@null"
android:hint="请输入验证码"
android:inputType="number"
android:maxLength="4"
android:maxLines="1"
android:textColor="@color/color_172B54"
android:textColorHint="@color/color_BEC2CC"
android:textSize="12sp" />
<TextView
android:id="@+id/tvLoginSendcode"
android:layout_width="100dp"
android:layout_height="30dp"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:gravity="center"
android:text="发送验证码"
android:textColor="@color/color_FF9837"
android:textSize="12sp" />
</RelativeLayout>
</LinearLayout>
<View
style="@style/line_3"
android:layout_marginLeft="30dp"
android:layout_marginRight="30dp" />
<TextView
android:id="@+id/tvLoginNext"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_gravity="center_horizontal"
android:layout_marginLeft="40dp"
android:layout_marginTop="30dp"
android:layout_marginRight="40dp"
android:background="@drawable/shape_main"
android:gravity="center"
android:text="绑定手机号"
android:textColor="@color/white"
android:textSize="14sp" />
</LinearLayout>
</com.mints.street.widget.ElasticScrollView>
</LinearLayout>
</layout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<data>
<variable
name="viewModel"
type="com.mints.street.splash.GuideBindingViewModel" />
</data>
<LinearLayout
android:gravity="center"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/black"
android:orientation="vertical">
<ImageView
android:id="@+id/iv_earth"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TextView
android:layout_marginTop="20dp"
android:id="@+id/tv1"
android:textSize="20sp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/shape_bg_guide_tv"
android:text="国内外全覆盖街景"
android:drawableLeft="@mipmap/satellite"
android:paddingLeft="10dp"/>
<TextView
android:layout_marginTop="20dp"
android:id="@+id/tv2"
android:layout_below="@+id/tv1"
android:textSize="20sp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/shape_bg_guide_tv"
android:text="VR沉浸式景点体验"
android:drawableLeft="@mipmap/satellite"
android:paddingLeft="10dp"/>
<TextView
android:layout_marginTop="20dp"
android:id="@+id/tv3"
android:layout_below="@+id/tv2"
android:textSize="20sp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/shape_bg_guide_tv"
android:text="高清卫星地图/历史影像"
android:drawableLeft="@mipmap/satellite"
android:paddingLeft="10dp"/>
<Button
android:id="@+id/bt_enter"
android:layout_marginTop="70dp"
android:layout_below="@+id/tv3"
android:layout_width="250dp"
android:layout_height="40dp"
android:textSize="18sp"
android:text="立即体验"
android:gravity="center"
android:background="@drawable/shape_login_bg"/>
</RelativeLayout>
</LinearLayout>
</layout>
\ No newline at end of file
...@@ -5,13 +5,95 @@ ...@@ -5,13 +5,95 @@
<data> <data>
<variable <variable
name="ViewModel" name="viewModel"
type="com.mints.street.main.home.HistoricalimageModel" /> type="com.mints.street.main.home.HistoricalimageModel" />
</data> </data>
<LinearLayout <LinearLayout
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/activity_main"
android:layout_width="match_parent" android:layout_width="match_parent"
android:orientation="vertical" android:layout_height="wrap_content"
android:layout_height="match_parent"> android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="20dp"
android:gravity="center"
android:textColor="@color/black"
android:text="V" />
<View
android:layout_width="match_parent"
android:layout_height="0.5dp"
android:background="@android:color/darker_gray"></View>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:orientation="horizontal">
<TextView
android:id="@+id/iv_left"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginLeft="2dp"
android:layout_weight="1"
android:gravity="center"
android:text="<"
android:textSize="16sp" />
<com.mints.street.widget.HorizontalselectedView
android:id="@+id/hsMain"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_gravity="center_vertical"
android:layout_weight="30"
app:HorizontalselectedViewSeesize="5"
app:HorizontalselectedViewSelectedTextColor="@color/black"
app:HorizontalselectedViewSelectedTextSize="60"
app:HorizontalselectedViewTextColor="@color/gray"
app:HorizontalselectedViewTextSize="40" />
<TextView
android:id="@+id/iv_right"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginRight="2dp"
android:layout_weight="1"
android:gravity="center"
android:text=">"
android:textSize="16sp" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="0.5dp"
android:background="@android:color/darker_gray"></View>
<Button
android:id="@+id/bt_main"
android:layout_width="200dp"
android:layout_height="50dp"
android:layout_gravity="center_horizontal"
android:layout_marginTop="100dp"
android:text="点击获得被选文本" />
<TextView
android:padding="5dp"
android:gravity="center"
android:id="@+id/tvMain"
android:layout_gravity="center_horizontal"
android:layout_width="wrap_content"
android:layout_height="50dp"
android:textSize="20sp"
android:layout_marginTop="20dp"
android:background="@color/gray" />
</LinearLayout> </LinearLayout>
</layout> </layout>
\ No newline at end of file
...@@ -14,7 +14,9 @@ ...@@ -14,7 +14,9 @@
android:background="#CC000000" android:background="#CC000000"
android:orientation="vertical"> android:orientation="vertical">
<include layout="@layout/include_header"/> <include
android:id="@+id/ic_q"
layout="@layout/include_header"/>
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
...@@ -22,7 +24,8 @@ ...@@ -22,7 +24,8 @@
android:layout_gravity="center" android:layout_gravity="center"
android:layout_marginTop="60dp" android:layout_marginTop="60dp"
android:text="在国内也能用的" android:text="在国内也能用的"
android:textSize="24dp" /> android:textSize="24dp"
/>
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
...@@ -52,6 +55,7 @@ ...@@ -52,6 +55,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="50dp" android:layout_height="50dp"
android:layout_marginStart="10dp" android:layout_marginStart="10dp"
android:paddingRight="20dp"
android:background="@null" android:background="@null"
android:gravity="center_vertical" android:gravity="center_vertical"
android:hint="@string/str_input_phone" android:hint="@string/str_input_phone"
......
...@@ -10,70 +10,49 @@ ...@@ -10,70 +10,49 @@
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="match_parent"
android:background="@drawable/shape_gold_card"
android:elevation="5dp"
android:orientation="vertical"> android:orientation="vertical">
<include layout="@layout/include_header" />
<LinearLayout
android:id="@+id/ly_aboutus"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="10dp"
android:orientation="horizontal"
android:padding="10dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_weight="1"
android:text="用户协议"
android:textColor="@color/black"
android:textSize="18sp" />
<ImageView
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_alignParentEnd="true"
android:src="@mipmap/bg_right" />
</LinearLayout>
<View <include layout="@layout/include_header" />
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:background="#979797" />
<LinearLayout <com.mints.street.widget.ElasticScrollView
android:id="@+id/ly_moresettings"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="match_parent"
android:layout_gravity="center" android:overScrollMode="never">
android:orientation="horizontal"
android:padding="10dp"> <LinearLayout
android:layout_width="match_parent"
<TextView android:layout_height="match_parent"
android:layout_width="wrap_content" android:elevation="5dp"
android:layout_height="wrap_content" android:orientation="vertical">
android:layout_marginLeft="5dp"
android:layout_weight="1" <include
android:text="隐私政策" android:id="@+id/item_phone"
android:textColor="@color/black" layout="@layout/item_settings" />
android:textSize="18sp" />
<include
<ImageView android:id="@+id/item_userAgree"
android:layout_width="20dp" layout="@layout/item_settings" />
android:layout_height="20dp"
android:layout_alignParentEnd="true" <include
android:src="@mipmap/bg_right" /> android:id="@+id/item_privacyAgree"
layout="@layout/item_settings" />
</LinearLayout> <Button
android:id="@+id/btn_switch"
android:layout_width="200dp"
android:layout_height="50dp"
android:layout_gravity="center"
android:layout_marginTop="20dp"
android:layout_marginBottom="20dp"
android:background="@drawable/shape_btn_switch"
android:text="退出登录"
android:textColor="@color/white"
android:textSize="16sp" />
</LinearLayout>
</com.mints.street.widget.ElasticScrollView>
</LinearLayout> </LinearLayout>
</layout> </layout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
<data>
<variable
name="viewModel"
type="com.mints.street.main.my.OpenvipViewModel" />
</data>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<View
android:layout_width="match_parent"
android:layout_height="200dp"
android:background="@color/black" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<include layout="@layout/include_header" />
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:focusable="true"
android:focusableInTouchMode="true"
android:overScrollMode="never">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="80dp"
android:orientation="vertical">
<com.mints.street.widget.CoverFlowViewPager
android:id="@+id/cfp_data_viewpager"
android:layout_width="match_parent"
android:layout_height="148dp"
android:layout_centerHorizontal="true"
android:layout_marginTop="20dp">
<Space
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</com.mints.street.widget.CoverFlowViewPager>
<androidx.constraintlayout.widget.Guideline
android:id="@+id/guideline3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" />
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal">
<TextView
android:id="@+id/textView5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="享受8大特权"
android:textColor="@color/black"
android:textSize="20sp"
app:layout_constraintBottom_toTopOf="@+id/guideline7"
app:layout_constraintEnd_toStartOf="@+id/guideline6"
app:layout_constraintStart_toStartOf="@+id/guideline5"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/imageView5"
android:layout_width="50dp"
android:layout_height="50dp"
android:src="@mipmap/ic_avatar_ph"
app:layout_constraintEnd_toStartOf="@+id/guideline5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@+id/guideline7"
tools:srcCompat="@tools:sample/avatars" />
<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="无线缩放"
android:textColor="@color/black"
android:textSize="10sp"
app:layout_constraintEnd_toEndOf="@+id/imageView5"
app:layout_constraintStart_toStartOf="@+id/imageView5"
app:layout_constraintTop_toBottomOf="@+id/imageView5" />
<ImageView
android:id="@+id/imageView4"
android:layout_width="50dp"
android:layout_height="50dp"
android:src="@mipmap/ic_avatar_ph"
app:layout_constraintEnd_toStartOf="@+id/guideline4"
app:layout_constraintStart_toStartOf="@+id/guideline5"
app:layout_constraintTop_toTopOf="@+id/guideline7"
tools:ignore="MissingConstraints"
tools:srcCompat="@tools:sample/avatars" />
<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="国内外街景"
android:textColor="@color/black"
android:textSize="10sp"
app:layout_constraintBottom_toTopOf="@+id/guideline8"
app:layout_constraintEnd_toEndOf="@+id/imageView4"
app:layout_constraintStart_toStartOf="@+id/imageView4"
app:layout_constraintTop_toBottomOf="@+id/imageView4" />
<ImageView
android:id="@+id/imageView6"
android:layout_width="50dp"
android:layout_height="50dp"
android:src="@mipmap/ic_avatar_ph"
app:layout_constraintEnd_toStartOf="@+id/guideline6"
app:layout_constraintStart_toStartOf="@+id/guideline4"
app:layout_constraintTop_toTopOf="@+id/guideline7"
tools:ignore="MissingConstraints"
tools:srcCompat="@tools:sample/avatars" />
<TextView
android:id="@+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="VR全景"
android:textColor="@color/black"
android:textSize="10sp"
app:layout_constraintEnd_toEndOf="@+id/imageView6"
app:layout_constraintStart_toStartOf="@+id/imageView6"
app:layout_constraintTop_toBottomOf="@+id/imageView6" />
<ImageView
android:id="@+id/imageView7"
android:layout_width="50dp"
android:layout_height="50dp"
android:src="@mipmap/ic_avatar_ph"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="@+id/guideline6"
app:layout_constraintTop_toTopOf="@+id/guideline7"
tools:srcCompat="@tools:sample/avatars" />
<TextView
android:id="@+id/textView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="3D地图"
android:textColor="@color/black"
android:textSize="10sp"
app:layout_constraintEnd_toEndOf="@+id/imageView7"
app:layout_constraintStart_toStartOf="@+id/imageView7"
app:layout_constraintTop_toBottomOf="@+id/imageView7" />
<ImageView
android:id="@+id/imageView12"
android:layout_width="50dp"
android:layout_height="50dp"
android:src="@mipmap/ic_avatar_ph"
app:layout_constraintEnd_toEndOf="@+id/imageView5"
app:layout_constraintStart_toStartOf="@+id/imageView5"
app:layout_constraintTop_toTopOf="@+id/guideline8"
tools:ignore="MissingConstraints"
tools:srcCompat="@tools:sample/avatars" />
<TextView
android:id="@+id/textView9"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="国外搜索"
android:textColor="@color/black"
android:textSize="10sp"
app:layout_constraintBottom_toTopOf="@+id/guideline9"
app:layout_constraintEnd_toEndOf="@+id/imageView12"
app:layout_constraintStart_toStartOf="@+id/imageView12"
app:layout_constraintTop_toBottomOf="@+id/imageView12" />
<ImageView
android:id="@+id/imageView13"
android:layout_width="50dp"
android:layout_height="50dp"
android:src="@mipmap/ic_avatar_ph"
app:layout_constraintEnd_toEndOf="@+id/imageView4"
app:layout_constraintStart_toStartOf="@+id/imageView4"
app:layout_constraintTop_toTopOf="@+id/guideline8"
tools:ignore="MissingConstraints"
tools:srcCompat="@tools:sample/avatars" />
<ImageView
android:id="@+id/imageView14"
android:layout_width="50dp"
android:layout_height="50dp"
android:src="@mipmap/ic_avatar_ph"
app:layout_constraintEnd_toEndOf="@+id/imageView6"
app:layout_constraintStart_toStartOf="@+id/imageView6"
app:layout_constraintTop_toTopOf="@+id/guideline8"
tools:ignore="MissingConstraints"
tools:srcCompat="@tools:sample/avatars" />
<TextView
android:id="@+id/textView10"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="高清地图"
android:textColor="@color/black"
android:textSize="10sp"
app:layout_constraintBottom_toTopOf="@+id/guideline9"
app:layout_constraintEnd_toEndOf="@+id/imageView13"
app:layout_constraintStart_toStartOf="@+id/imageView13"
app:layout_constraintTop_toBottomOf="@+id/imageView13" />
<TextView
android:id="@+id/textView11"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="历史影像"
android:textColor="@color/black"
android:textSize="10sp"
app:layout_constraintBottom_toTopOf="@+id/guideline9"
app:layout_constraintEnd_toEndOf="@+id/imageView14"
app:layout_constraintStart_toStartOf="@+id/imageView14"
app:layout_constraintTop_toBottomOf="@+id/imageView14" />
<ImageView
android:id="@+id/imageView15"
android:layout_width="50dp"
android:layout_height="50dp"
android:src="@mipmap/ic_avatar_ph"
app:layout_constraintEnd_toEndOf="@+id/imageView7"
app:layout_constraintStart_toStartOf="@+id/imageView7"
app:layout_constraintTop_toTopOf="@+id/guideline8"
tools:ignore="MissingConstraints"
tools:srcCompat="@tools:sample/avatars" />
<TextView
android:id="@+id/textView12"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="景点推荐"
android:textColor="@color/black"
android:textSize="10sp"
app:layout_constraintBottom_toTopOf="@+id/guideline9"
app:layout_constraintEnd_toEndOf="@+id/imageView15"
app:layout_constraintStart_toStartOf="@+id/imageView15"
app:layout_constraintTop_toBottomOf="@+id/imageView15" />
<ImageView
android:id="@+id/imageView16"
android:layout_width="20dp"
android:layout_height="20dp"
android:background="@drawable/shape_btn_friends_unenabled"
app:layout_constraintBottom_toTopOf="@+id/guideline7"
app:layout_constraintEnd_toStartOf="@+id/textView5"
app:layout_constraintStart_toStartOf="@+id/guideline5"
app:layout_constraintTop_toTopOf="parent"
tools:srcCompat="@tools:sample/avatars" />
<ImageView
android:id="@+id/imageView18"
android:layout_width="20dp"
android:layout_height="20dp"
android:background="@drawable/shape_btn_friends_unenabled"
app:layout_constraintBottom_toTopOf="@+id/guideline7"
app:layout_constraintEnd_toStartOf="@+id/guideline6"
app:layout_constraintHorizontal_bias="0.481"
app:layout_constraintStart_toEndOf="@+id/textView5"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.512"
tools:srcCompat="@tools:sample/avatars" />
<ImageView
android:id="@+id/imageView"
android:layout_width="20dp"
android:layout_height="20dp"
android:background="@drawable/shape_btn_friends_unenabled"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/textView7"
app:layout_constraintStart_toStartOf="@+id/guideline5"
app:layout_constraintTop_toTopOf="@+id/guideline9"
tools:ignore="MissingConstraints"
tools:srcCompat="@tools:sample/avatars" />
<TextView
android:id="@+id/textView7"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="套餐推荐"
android:textColor="@color/black"
android:textSize="20sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/guideline6"
app:layout_constraintStart_toStartOf="@+id/guideline5"
app:layout_constraintTop_toTopOf="@+id/guideline9" />
<ImageView
android:id="@+id/imageView2"
android:layout_width="20dp"
android:layout_height="20dp"
android:background="@drawable/shape_btn_friends_unenabled"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/guideline6"
app:layout_constraintStart_toEndOf="@+id/textView7"
app:layout_constraintTop_toTopOf="@+id/guideline9"
tools:srcCompat="@tools:sample/avatars" />
<androidx.constraintlayout.widget.Guideline
android:id="@+id/guideline9"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
app:layout_constraintGuide_percent=".75" />
<androidx.constraintlayout.widget.Guideline
android:id="@+id/guideline8"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
app:layout_constraintGuide_percent="0.5" />
<androidx.constraintlayout.widget.Guideline
android:id="@+id/guideline7"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
app:layout_constraintGuide_percent="0.25" />
<androidx.constraintlayout.widget.Guideline
android:id="@+id/guideline4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.50121653" />
<androidx.constraintlayout.widget.Guideline
android:id="@+id/guideline5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.25" />
<androidx.constraintlayout.widget.Guideline
android:id="@+id/guideline6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.75" />
</androidx.constraintlayout.widget.ConstraintLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:orientation="horizontal">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/listview"
android:layout_width="match_parent"
android:layout_height="100dp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:orientation="horizontal"
android:padding="10dp">
<ImageView
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_alignParentLeft="true"
android:layout_marginStart="15dp"
android:src="@mipmap/iv_about_us" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_weight="1"
android:text="微信支付"
android:textColor="@color/black"
android:textSize="18sp" />
<CheckBox
style="@style/MyCheckBox"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:background="#979797" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:orientation="horizontal"
android:padding="10dp">
<ImageView
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_alignParentLeft="true"
android:layout_marginStart="15dp"
android:src="@mipmap/iv_about_us" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_weight="1"
android:text="支付宝支付"
android:textColor="@color/black"
android:textSize="18sp" />
<CheckBox
style="@style/MyCheckBox"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
</LinearLayout>
</androidx.core.widget.NestedScrollView>
</LinearLayout>
<Button
android:id="@+id/bt_try"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_gravity="bottom"
android:layout_margin="10dp"
android:background="@drawable/shape_btn_friends_unenabled"
android:text="开通全球会员"
android:textColor="@color/white"
android:textSize="10sp" />
</FrameLayout>
</layout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"> <layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<data> <data>
<variable <variable
...@@ -9,7 +10,8 @@ ...@@ -9,7 +10,8 @@
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="716dp" android:layout_height="match_parent"
android:background="@color/white"
android:orientation="vertical"> android:orientation="vertical">
<TextView <TextView
...@@ -17,7 +19,8 @@ ...@@ -17,7 +19,8 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_gravity="center"
android:layout_marginTop="25dp" android:layout_marginTop="25dp"
android:text="世界街景3D地图" android:text="3D高清街景"
android:textStyle="bold"
android:textColor="@color/black" android:textColor="@color/black"
android:textSize="25dp" /> android:textSize="25dp" />
...@@ -26,20 +29,20 @@ ...@@ -26,20 +29,20 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_gravity="center"
android:layout_marginTop="10dp" android:layout_marginTop="10dp"
android:layout_marginBottom="10pt" android:layout_marginBottom="4pt"
android:text="为了提供下服务" android:text="为了提供下服务"
android:textColor="#CD000000" /> android:textColor="#CD000000" />
<RelativeLayout <RelativeLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="110dp" android:layout_height="100dp"
android:layout_margin="10dp" android:layout_margin="10dp"
android:background="@drawable/shape_gold_blue"> android:background="@drawable/shape_gold_blue">
<ImageView <ImageView
android:id="@+id/iv1" android:id="@+id/iv1"
android:layout_width="80dp" android:layout_width="70dp"
android:layout_height="80dp" android:layout_height="70dp"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:layout_marginLeft="10dp" android:layout_marginLeft="10dp"
android:src="@mipmap/ic_my"/> android:src="@mipmap/ic_my"/>
...@@ -49,25 +52,30 @@ ...@@ -49,25 +52,30 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignTop="@+id/iv1" android:layout_alignTop="@+id/iv1"
android:layout_marginStart="20dp" android:layout_marginStart="10dp"
android:layout_toRightOf="@id/iv1" android:layout_toRightOf="@id/iv1"
android:text="提供精准定位及导航服务" android:text="提供精准定位及导航服务"
android:layout_marginTop="10dp"
android:textStyle="bold"
android:textColor="@color/black" android:textColor="@color/black"
android:textSize="12sp" /> android:textSize="14sp" />
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignBottom="@+id/iv1" android:layout_alignBottom="@+id/iv1"
android:layout_marginStart="20dp" android:layout_marginStart="10dp"
android:layout_toRightOf="@+id/iv1" android:layout_toRightOf="@+id/iv1"
android:text="基于您当前位置...." android:textSize="12sp"
android:text="基于您当前位置、为您提供完整的周边信息"
android:layout_marginBottom="10dp"
android:textColor="#A9000000" /> android:textColor="#A9000000" />
<com.github.iielse.switchbutton.SwitchView <com.github.iielse.switchbutton.SwitchView
android:id="@+id/sv_positioning" android:id="@+id/svPosition"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="20dp" android:layout_height="20dp"
app:isOpened="true"
android:layout_alignParentEnd="true" android:layout_alignParentEnd="true"
android:layout_centerHorizontal="true" android:layout_centerHorizontal="true"
android:layout_centerVertical="true" android:layout_centerVertical="true"
...@@ -76,14 +84,14 @@ ...@@ -76,14 +84,14 @@
<RelativeLayout <RelativeLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="110dp" android:layout_height="100dp"
android:layout_margin="10dp" android:layout_margin="10dp"
android:background="@drawable/shape_gold_blue"> android:background="@drawable/shape_gold_blue">
<ImageView <ImageView
android:id="@+id/iv2" android:id="@+id/iv2"
android:layout_width="80dp" android:layout_width="70dp"
android:layout_height="80dp" android:layout_height="70dp"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:layout_marginLeft="10dp" android:layout_marginLeft="10dp"
android:src="@mipmap/ic_my"/> android:src="@mipmap/ic_my"/>
...@@ -93,25 +101,31 @@ ...@@ -93,25 +101,31 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignTop="@+id/iv2" android:layout_alignTop="@+id/iv2"
android:layout_marginStart="20dp" android:layout_marginStart="10dp"
android:layout_toRightOf="@id/iv2" android:layout_toRightOf="@id/iv2"
android:text="提供精准定位及导航服务" android:text="存储地图等相关数据"
android:layout_marginTop="10dp"
android:textStyle="bold"
android:textColor="@color/black" android:textColor="@color/black"
android:textSize="12sp" /> android:textSize="14sp"/>
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignBottom="@+id/iv2" android:layout_alignBottom="@+id/iv2"
android:layout_marginStart="20dp" android:layout_marginStart="10dp"
android:layout_toRightOf="@+id/iv2" android:layout_toRightOf="@+id/iv2"
android:text="基于您当前位置...." android:textSize="12sp"
android:text="用于读写地图、常用地址等相关数据"
android:layout_marginBottom="10dp"
android:textColor="#A9000000" /> android:textColor="#A9000000" />
<com.github.iielse.switchbutton.SwitchView <com.github.iielse.switchbutton.SwitchView
android:id="@+id/svStrong"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="20dp" android:layout_height="20dp"
android:layout_alignParentEnd="true" android:layout_alignParentEnd="true"
app:isOpened="true"
android:layout_centerHorizontal="true" android:layout_centerHorizontal="true"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:layout_marginRight="10dp" /> android:layout_marginRight="10dp" />
...@@ -119,14 +133,14 @@ ...@@ -119,14 +133,14 @@
<RelativeLayout <RelativeLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="110dp" android:layout_height="100dp"
android:layout_margin="10dp" android:layout_margin="10dp"
android:background="@drawable/shape_gold_blue"> android:background="@drawable/shape_gold_blue">
<ImageView <ImageView
android:id="@+id/iv3" android:id="@+id/iv3"
android:layout_width="80dp" android:layout_width="70dp"
android:layout_height="80dp" android:layout_height="70dp"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:layout_marginLeft="10dp" android:layout_marginLeft="10dp"
android:src="@mipmap/ic_my"/> android:src="@mipmap/ic_my"/>
...@@ -136,38 +150,52 @@ ...@@ -136,38 +150,52 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignTop="@+id/iv3" android:layout_alignTop="@+id/iv3"
android:layout_marginStart="20dp" android:layout_marginStart="10dp"
android:layout_toRightOf="@id/iv3" android:layout_toRightOf="@id/iv3"
android:text="提供精准定位及导航服务" android:text="问题诊断及修复"
android:layout_marginTop="10dp"
android:textStyle="bold"
android:textColor="@color/black" android:textColor="@color/black"
android:textSize="12sp" /> android:textSize="14sp"/>
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignBottom="@+id/iv3" android:layout_alignBottom="@+id/iv3"
android:layout_marginStart="20dp" android:layout_marginStart="10dp"
android:layout_toRightOf="@+id/iv3" android:layout_toRightOf="@+id/iv3"
android:text="基于您当前位置...." android:textSize="12sp"
android:text="用于读取信息、快速确诊问题"
android:layout_marginBottom="10dp"
android:textColor="#A9000000" /> android:textColor="#A9000000" />
<com.github.iielse.switchbutton.SwitchView <com.github.iielse.switchbutton.SwitchView
android:id="@+id/svReadmsg"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="20dp" android:layout_height="20dp"
app:isOpened="true"
android:layout_alignParentEnd="true" android:layout_alignParentEnd="true"
android:layout_centerHorizontal="true" android:layout_centerHorizontal="true"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:layout_marginRight="10dp" /> android:layout_marginRight="10dp" />
</RelativeLayout> </RelativeLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="您的个人信息将受到严格的保密,3D高清街景不会将您的个人信息泄露给他人。您也可以在系统设置中关闭授权,但可能影响部分功能使用。"
android:layout_margin="10dp"
android:textColor="#CD000000" />
<LinearLayout <LinearLayout
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_gravity="center"
android:layout_marginTop="20pt" android:layout_marginTop="10pt"
android:orientation="horizontal"> android:orientation="horizontal">
<Button <Button
android:id="@+id/btnPermissionsDont"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginRight="10dp" android:layout_marginRight="10dp"
...@@ -178,6 +206,7 @@ ...@@ -178,6 +206,7 @@
android:textColor="#43000000" /> android:textColor="#43000000" />
<Button <Button
android:id="@+id/btnPermissionsNext"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="10dp" android:layout_marginLeft="10dp"
...@@ -188,37 +217,33 @@ ...@@ -188,37 +217,33 @@
android:textColor="@color/white" /> android:textColor="@color/white" />
</LinearLayout> </LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1" />
<LinearLayout <LinearLayout
android:layout_width="wrap_content" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="match_parent"
android:layout_gravity="center_horizontal" android:layout_marginBottom="20dp"
android:gravity="bottom|center_horizontal"
android:orientation="horizontal"> android:orientation="horizontal">
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="wrap_content"
android:text="链接网络后可查看并同意完整的" android:text="链接网络后可查看并同意完整的"
android:textColor="@color/black" android:textColor="@color/black"
android:textSize="8sp" /> android:textSize="12sp" />
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="《隐私协议》" android:text="《隐私协议》"
android:textColor="@color/black" android:textColor="@color/black"
android:textSize="8sp" /> android:textSize="12sp" />
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="《用户协议》" android:text="《用户协议》"
android:textColor="@color/black" android:textColor="@color/black"
android:textSize="8sp" /> android:textSize="12sp" />
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
......
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
android:layout_height="30dp" android:layout_height="30dp"
android:layout_alignParentStart="true" android:layout_alignParentStart="true"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:src="@mipmap/iv_crown"/> android:src="@mipmap/icon_me_vip" />
<TextView <TextView
android:id="@+id/tv_tips" android:id="@+id/tv_tips"
...@@ -94,17 +94,32 @@ ...@@ -94,17 +94,32 @@
<androidx.constraintlayout.widget.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="wrap_content" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"> android:layout_gravity="center_horizontal"
android:paddingBottom="10dp">
<TextView
android:id="@+id/textView5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="享受8大特权"
android:textColor="@color/black"
android:textSize="20sp"
app:layout_constraintBottom_toTopOf="@+id/guideline7"
app:layout_constraintEnd_toStartOf="@+id/guideline6"
app:layout_constraintStart_toStartOf="@+id/guideline5"
app:layout_constraintTop_toTopOf="parent" />
<ImageView <ImageView
android:id="@+id/imageView5" android:id="@+id/imageView5"
android:layout_width="50dp" android:layout_width="50dp"
android:layout_height="50dp" android:layout_height="50dp"
android:src="@mipmap/ic_avatar_ph" android:layout_marginTop="10dp"
android:src="@mipmap/icon_me1"
app:layout_constraintEnd_toStartOf="@+id/guideline5"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@+id/imageView4" app:layout_constraintTop_toTopOf="@+id/guideline7"
tools:srcCompat="@tools:sample/avatars" /> tools:srcCompat="@tools:sample/avatars" />
<TextView <TextView
...@@ -112,6 +127,7 @@ ...@@ -112,6 +127,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="无线缩放" android:text="无线缩放"
android:textColor="@color/black"
android:textSize="10sp" android:textSize="10sp"
app:layout_constraintEnd_toEndOf="@+id/imageView5" app:layout_constraintEnd_toEndOf="@+id/imageView5"
app:layout_constraintStart_toStartOf="@+id/imageView5" app:layout_constraintStart_toStartOf="@+id/imageView5"
...@@ -119,13 +135,15 @@ ...@@ -119,13 +135,15 @@
<ImageView <ImageView
android:id="@+id/imageView4" android:id="@+id/imageView4"
android:layout_width="50dp" android:layout_width="50dp"
android:layout_height="50dp" android:layout_height="50dp"
android:layout_marginStart="40dp" android:layout_marginTop="10dp"
android:layout_marginTop="20dp" android:src="@mipmap/icon_me2"
android:src="@mipmap/ic_avatar_ph" app:layout_constraintEnd_toStartOf="@+id/guideline4"
app:layout_constraintStart_toEndOf="@+id/imageView5" app:layout_constraintStart_toStartOf="@+id/guideline5"
app:layout_constraintTop_toBottomOf="@+id/imageView16" app:layout_constraintTop_toTopOf="@+id/guideline7"
tools:ignore="MissingConstraints"
tools:srcCompat="@tools:sample/avatars" /> tools:srcCompat="@tools:sample/avatars" />
<TextView <TextView
...@@ -133,19 +151,24 @@ ...@@ -133,19 +151,24 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="国内外街景" android:text="国内外街景"
android:textColor="@color/black"
android:textSize="10sp" android:textSize="10sp"
app:layout_constraintBottom_toTopOf="@+id/guideline8"
app:layout_constraintEnd_toEndOf="@+id/imageView4" app:layout_constraintEnd_toEndOf="@+id/imageView4"
app:layout_constraintStart_toStartOf="@+id/imageView4" app:layout_constraintStart_toStartOf="@+id/imageView4"
app:layout_constraintTop_toBottomOf="@+id/imageView4" /> app:layout_constraintTop_toBottomOf="@+id/imageView4" />
<ImageView <ImageView
android:id="@+id/imageView6" android:id="@+id/imageView6"
android:layout_width="50dp" android:layout_width="50dp"
android:layout_height="50dp" android:layout_height="50dp"
android:layout_marginStart="40dp" android:layout_marginTop="10dp"
android:src="@mipmap/ic_avatar_ph" android:src="@mipmap/icon_me3"
app:layout_constraintStart_toEndOf="@+id/imageView4" app:layout_constraintEnd_toStartOf="@+id/guideline6"
app:layout_constraintTop_toTopOf="@+id/imageView4" app:layout_constraintStart_toStartOf="@+id/guideline4"
app:layout_constraintTop_toTopOf="@+id/guideline7"
tools:ignore="MissingConstraints"
tools:srcCompat="@tools:sample/avatars" /> tools:srcCompat="@tools:sample/avatars" />
<TextView <TextView
...@@ -153,6 +176,7 @@ ...@@ -153,6 +176,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="VR全景" android:text="VR全景"
android:textColor="@color/black"
android:textSize="10sp" android:textSize="10sp"
app:layout_constraintEnd_toEndOf="@+id/imageView6" app:layout_constraintEnd_toEndOf="@+id/imageView6"
app:layout_constraintStart_toStartOf="@+id/imageView6" app:layout_constraintStart_toStartOf="@+id/imageView6"
...@@ -160,12 +184,14 @@ ...@@ -160,12 +184,14 @@
<ImageView <ImageView
android:id="@+id/imageView7" android:id="@+id/imageView7"
android:layout_width="50dp" android:layout_width="50dp"
android:layout_height="50dp" android:layout_height="50dp"
android:layout_marginStart="40dp" android:layout_marginTop="10dp"
android:src="@mipmap/ic_avatar_ph" android:src="@mipmap/icon_me4"
app:layout_constraintStart_toEndOf="@+id/imageView6" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@+id/imageView6" app:layout_constraintStart_toStartOf="@+id/guideline6"
app:layout_constraintTop_toTopOf="@+id/guideline7"
tools:srcCompat="@tools:sample/avatars" /> tools:srcCompat="@tools:sample/avatars" />
<TextView <TextView
...@@ -173,6 +199,7 @@ ...@@ -173,6 +199,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="3D地图" android:text="3D地图"
android:textColor="@color/black"
android:textSize="10sp" android:textSize="10sp"
app:layout_constraintEnd_toEndOf="@+id/imageView7" app:layout_constraintEnd_toEndOf="@+id/imageView7"
app:layout_constraintStart_toStartOf="@+id/imageView7" app:layout_constraintStart_toStartOf="@+id/imageView7"
...@@ -183,19 +210,20 @@ ...@@ -183,19 +210,20 @@
android:layout_width="50dp" android:layout_width="50dp"
android:layout_height="50dp" android:layout_height="50dp"
android:layout_marginTop="20dp" android:layout_marginTop="20dp"
android:src="@mipmap/ic_avatar_ph" android:src="@mipmap/icon_me5"
app:layout_constraintEnd_toEndOf="@+id/imageView5" app:layout_constraintEnd_toEndOf="@+id/imageView5"
app:layout_constraintHorizontal_bias="1.0" app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="@+id/imageView5" app:layout_constraintStart_toStartOf="@+id/imageView5"
app:layout_constraintTop_toBottomOf="@+id/textView2" app:layout_constraintTop_toBottomOf="@+id/textView2"
tools:ignore="MissingConstraints"
tools:srcCompat="@tools:sample/avatars" /> tools:srcCompat="@tools:sample/avatars" />
<TextView <TextView
android:id="@+id/textView9" android:id="@+id/textView9"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="国外搜索" android:text="国外搜索"
android:textColor="@color/black"
android:textSize="10sp" android:textSize="10sp"
app:layout_constraintEnd_toEndOf="@+id/imageView12" app:layout_constraintEnd_toEndOf="@+id/imageView12"
app:layout_constraintStart_toStartOf="@+id/imageView12" app:layout_constraintStart_toStartOf="@+id/imageView12"
...@@ -207,11 +235,12 @@ ...@@ -207,11 +235,12 @@
android:layout_width="50dp" android:layout_width="50dp"
android:layout_height="50dp" android:layout_height="50dp"
android:layout_marginTop="20dp" android:layout_marginTop="20dp"
android:src="@mipmap/ic_avatar_ph" android:src="@mipmap/icon_me6"
app:layout_constraintEnd_toEndOf="@+id/imageView4" app:layout_constraintEnd_toEndOf="@+id/imageView4"
app:layout_constraintHorizontal_bias="0.0" app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="@+id/imageView4" app:layout_constraintStart_toStartOf="@+id/imageView4"
app:layout_constraintTop_toBottomOf="@+id/textView" app:layout_constraintTop_toTopOf="@+id/guideline8"
tools:ignore="MissingConstraints"
tools:srcCompat="@tools:sample/avatars" /> tools:srcCompat="@tools:sample/avatars" />
<ImageView <ImageView
...@@ -220,19 +249,19 @@ ...@@ -220,19 +249,19 @@
android:layout_width="50dp" android:layout_width="50dp"
android:layout_height="50dp" android:layout_height="50dp"
android:layout_marginTop="20dp" android:layout_marginTop="20dp"
android:src="@mipmap/ic_avatar_ph" android:src="@mipmap/icon_me7"
app:layout_constraintEnd_toEndOf="@+id/imageView6" app:layout_constraintEnd_toEndOf="@+id/imageView6"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="@+id/imageView6" app:layout_constraintStart_toStartOf="@+id/imageView6"
app:layout_constraintTop_toBottomOf="@+id/textView3" app:layout_constraintTop_toTopOf="@+id/guideline8"
tools:ignore="MissingConstraints"
tools:srcCompat="@tools:sample/avatars" /> tools:srcCompat="@tools:sample/avatars" />
<TextView <TextView
android:id="@+id/textView10" android:id="@+id/textView10"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="高清地图" android:text="高清地图"
android:textColor="@color/black"
android:textSize="10sp" android:textSize="10sp"
app:layout_constraintEnd_toEndOf="@+id/imageView13" app:layout_constraintEnd_toEndOf="@+id/imageView13"
app:layout_constraintStart_toStartOf="@+id/imageView13" app:layout_constraintStart_toStartOf="@+id/imageView13"
...@@ -240,77 +269,103 @@ ...@@ -240,77 +269,103 @@
<TextView <TextView
android:id="@+id/textView11" android:id="@+id/textView11"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="历史影像" android:text="历史影像"
android:textColor="@color/black"
android:textSize="10sp" android:textSize="10sp"
app:layout_constraintEnd_toEndOf="@+id/imageView14" app:layout_constraintEnd_toEndOf="@+id/imageView14"
app:layout_constraintStart_toStartOf="@+id/imageView14" app:layout_constraintStart_toStartOf="@+id/imageView14"
app:layout_constraintTop_toBottomOf="@+id/imageView14" /> app:layout_constraintTop_toBottomOf="@+id/imageView14" />
<ImageView <ImageView
android:id="@+id/imageView15" android:id="@+id/icon_me8"
android:layout_width="50dp" android:layout_width="50dp"
android:layout_height="50dp" android:layout_height="50dp"
android:layout_marginTop="20dp" android:layout_marginTop="20dp"
android:src="@mipmap/ic_avatar_ph" android:src="@mipmap/icon_me8"
app:layout_constraintEnd_toEndOf="@+id/imageView7" app:layout_constraintEnd_toEndOf="@+id/imageView7"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="@+id/imageView7" app:layout_constraintStart_toStartOf="@+id/imageView7"
app:layout_constraintTop_toBottomOf="@+id/textView4" app:layout_constraintTop_toTopOf="@+id/guideline8"
tools:ignore="MissingConstraints"
tools:srcCompat="@tools:sample/avatars" /> tools:srcCompat="@tools:sample/avatars" />
<TextView <TextView
android:id="@+id/textView12" android:id="@+id/textView12"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="景点推荐" android:text="景点推荐"
android:textColor="@color/black"
android:textSize="10sp" android:textSize="10sp"
app:layout_constraintEnd_toEndOf="@+id/imageView15" app:layout_constraintEnd_toEndOf="@+id/icon_me8"
app:layout_constraintStart_toStartOf="@+id/imageView15" app:layout_constraintStart_toStartOf="@+id/icon_me8"
app:layout_constraintTop_toBottomOf="@+id/imageView15" /> app:layout_constraintTop_toBottomOf="@+id/icon_me8" />
<ImageView <ImageView
android:id="@+id/imageView16" android:id="@+id/imageView16"
android:layout_width="20dp" android:layout_width="20dp"
android:layout_height="20dp" android:layout_height="20dp"
android:layout_marginTop="20dp" android:background="@drawable/shape_btn_friends_unenabled"
android:background="@color/blue" app:layout_constraintBottom_toTopOf="@+id/guideline7"
app:layout_constraintStart_toEndOf="@+id/imageView5" app:layout_constraintEnd_toStartOf="@+id/textView5"
app:layout_constraintStart_toStartOf="@+id/guideline5"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
tools:srcCompat="@tools:sample/avatars" /> tools:srcCompat="@tools:sample/avatars" />
<ImageView <ImageView
android:id="@+id/imageView18" android:id="@+id/imageView18"
android:layout_width="20dp" android:layout_width="20dp"
android:layout_height="20dp" android:layout_height="20dp"
android:background="@color/blue" android:background="@drawable/shape_btn_friends_unenabled"
app:layout_constraintEnd_toStartOf="@+id/imageView7" app:layout_constraintBottom_toTopOf="@+id/guideline7"
app:layout_constraintTop_toTopOf="@+id/imageView16" app:layout_constraintEnd_toStartOf="@+id/guideline6"
app:layout_constraintHorizontal_bias="0.481"
app:layout_constraintStart_toEndOf="@+id/textView5"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.512"
tools:srcCompat="@tools:sample/avatars" /> tools:srcCompat="@tools:sample/avatars" />
<TextView <androidx.constraintlayout.widget.Guideline
android:id="@+id/textView13" android:id="@+id/guideline8"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="10dp" android:orientation="horizontal"
android:layout_marginEnd="10dp" app:layout_constraintGuide_percent="0.59" />
android:text="享受8大特权"
android:textSize="20sp" <androidx.constraintlayout.widget.Guideline
android:textStyle="bold" android:id="@+id/guideline7"
app:layout_constraintBottom_toBottomOf="@+id/imageView18" android:layout_width="wrap_content"
app:layout_constraintEnd_toStartOf="@+id/imageView18" android:layout_height="wrap_content"
app:layout_constraintStart_toEndOf="@+id/imageView16" android:orientation="horizontal"
app:layout_constraintTop_toTopOf="@+id/imageView18" /> app:layout_constraintGuide_percent="0.25" />
<androidx.constraintlayout.widget.Guideline
android:id="@+id/guideline4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.50121653" />
<androidx.constraintlayout.widget.Guideline
android:id="@+id/guideline5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.25" />
<androidx.constraintlayout.widget.Guideline
android:id="@+id/guideline6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.75" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
...@@ -321,77 +376,15 @@ ...@@ -321,77 +376,15 @@
android:elevation="5dp" android:elevation="5dp"
android:orientation="vertical"> android:orientation="vertical">
<LinearLayout <include
android:id="@+id/ly_aboutus" android:id="@+id/aboutus"
android:layout_width="match_parent" layout="@layout/item_settings" />
android:layout_height="wrap_content"
android:layout_gravity="center"
android:orientation="horizontal"
android:padding="10dp">
<ImageView
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_alignParentLeft="true"
android:layout_marginStart="15dp"
android:src="@mipmap/iv_about_us" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_weight="1"
android:text="关于我们"
android:textColor="@color/black"
android:textSize="18sp" />
<ImageView
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_alignParentEnd="true"
android:src="@mipmap/bg_right" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:background="#979797" />
<LinearLayout
android:id="@+id/ly_moresettings"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:orientation="horizontal"
android:padding="10dp">
<ImageView <include
android:layout_width="20dp" android:id="@+id/moresettings"
android:layout_height="20dp" layout="@layout/item_settings" />
android:layout_alignParentLeft="true"
android:layout_marginStart="15dp"
android:src="@mipmap/iv_more_settings" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_weight="1"
android:text="更多设置"
android:textColor="@color/black"
android:textSize="18sp" />
<ImageView
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_alignParentEnd="true"
android:src="@mipmap/bg_right" />
</LinearLayout>
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
</layout> </layout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<layout xmlns:app="http://schemas.android.com/apk/res-auto"> <layout xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:android="http://schemas.android.com/apk/res/android">
<data> <data>
<variable <variable
name="viewModel" name="viewModel"
type="com.mints.street.adapter.GridMapAdapter" /> type="com.mints.street.adapter.GridMapAdapter" />
</data> </data>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" <androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/bg" android:id="@+id/bg"
android:layout_width="150dp" android:layout_width="150dp"
android:layout_height="150dp" android:layout_height="150dp"
android:background="@drawable/shape_gold_card_20" android:background="@drawable/shape_gold_card_20">
>
<ImageView <ImageView
android:id="@+id/image" android:id="@+id/image"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
......
<?xml version="1.0" encoding="utf-8"?>
<layout
xmlns:android="http://schemas.android.com/apk/res/android">
<data>
<variable
name="viewModel"
type="com.mints.street.adapter.GridPaymentAdapter" />
</data>
<LinearLayout
android:id="@+id/bg"
android:layout_width="100dp"
android:layout_height="100dp"
android:orientation="vertical"
android:gravity="center">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="6个月"
android:textColor="@color/black"
android:textStyle="bold"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="¥68.0"
android:textStyle="bold"
android:textSize="20dp"
android:textColor="#FF5722"/>
<TextView
android:id="@+id/text1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="原价¥108.0"
android:textSize="10dp"
android:textColor="#25000000"/>
</LinearLayout>
</layout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_marginStart="20dp"
android:layout_marginEnd="20dp">
<TextView
android:id="@+id/tv_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:drawablePadding="10dp"
android:gravity="center_vertical"
android:textColor="@color/color_121B32"
android:textSize="16sp" />
<ImageView
android:id="@+id/iv_right"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:src="@mipmap/ic_arrow_more"
android:visibility="gone" />
<TextView
android:id="@+id/tv_right"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:visibility="gone" />
<View
style="@style/view_line_E6E6E6"
android:layout_alignParentBottom="true" />
</RelativeLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_horizontal"
android:background="@drawable/shape_bt_disagree"
android:orientation="vertical">
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/shape_bt_disagree"
android:gravity="center_horizontal"
android:orientation="vertical">
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/shape_bt_disagree"
android:gravity="center_horizontal"
android:orientation="vertical">
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clipChildren="false">
<androidx.viewpager.widget.ViewPager
android:id="@+id/vp_conver_flow"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clipChildren="false"
android:overScrollMode="never" />
</RelativeLayout>
\ No newline at end of file
...@@ -4,4 +4,16 @@ ...@@ -4,4 +4,16 @@
<attr name="border_width" format="dimension" /> <attr name="border_width" format="dimension" />
<attr name="border_color" format="color" /> <attr name="border_color" format="color" />
</declare-styleable> </declare-styleable>
<declare-styleable name="HorizontalselectedView">
<!--可见数目-->
<attr name="HorizontalselectedViewSeesize" format="integer"></attr>
<!--被选择文字的大小和颜色-->
<attr name="HorizontalselectedViewSelectedTextSize" format="float"></attr>
<attr name="HorizontalselectedViewSelectedTextColor" format="color|reference"></attr>
<!--未被被选择文字的大小和颜色-->
<attr name="HorizontalselectedViewTextSize" format="float"></attr>
<attr name="HorizontalselectedViewTextColor" format="color|reference"></attr>
</declare-styleable>
</resources> </resources>
\ No newline at end of file
...@@ -20,8 +20,9 @@ android.enableJetifier=true ...@@ -20,8 +20,9 @@ android.enableJetifier=true
isBuildModule=false isBuildModule=false
DEBUG_URL="http://test.mints-id.com/camera-api/" DEBUG_URL="http://test.mints-id.com/map-api/"
RELEASE_URL="https://api.mints-id.com/gc-api/" #RELEASE_URL="https://api.mints-id.com/map-api/"
RELEASE_URL="http://test.mints-id.com/map-api/"
RELEASE_KEY_PASSWORD=mints.street RELEASE_KEY_PASSWORD=mints.street
RELEASE_KEY_ALIAS=mints_street RELEASE_KEY_ALIAS=mints_street
......
...@@ -2,6 +2,7 @@ package com.fry.base.utils; ...@@ -2,6 +2,7 @@ package com.fry.base.utils;
import android.content.Context; import android.content.Context;
import android.graphics.Point; import android.graphics.Point;
import android.util.DisplayMetrics;
import android.view.Display; import android.view.Display;
import android.view.WindowManager; import android.view.WindowManager;
...@@ -10,6 +11,7 @@ import me.goldze.mvvmhabit.utils.Utils; ...@@ -10,6 +11,7 @@ import me.goldze.mvvmhabit.utils.Utils;
/** /**
* 2019-09-29 created * 2019-09-29 created
* dip、px转化. * dip、px转化.
*
* @author KOM * @author KOM
*/ */
public class DensityUtils { public class DensityUtils {
...@@ -17,7 +19,7 @@ public class DensityUtils { ...@@ -17,7 +19,7 @@ public class DensityUtils {
private static Point screenPoint; private static Point screenPoint;
public static Point getWindowWidthHeight() { public static Point getWindowWidthHeight() {
if(screenPoint == null){ if (screenPoint == null) {
screenPoint = new Point(); screenPoint = new Point();
WindowManager wm = (WindowManager) Utils.getContext() WindowManager wm = (WindowManager) Utils.getContext()
.getSystemService(Context.WINDOW_SERVICE); .getSystemService(Context.WINDOW_SERVICE);
...@@ -41,6 +43,22 @@ public class DensityUtils { ...@@ -41,6 +43,22 @@ public class DensityUtils {
return new int[]{point.x, point.y}; return new int[]{point.x, point.y};
} }
private static DisplayMetrics sDisplayMetrics;
public static int getDisplayWidth(Context context) {
initDisplayMetrics(context);
return sDisplayMetrics.widthPixels;
}
public static int getDisplayHeight(Context context) {
initDisplayMetrics(context);
return sDisplayMetrics.heightPixels;
}
private static synchronized void initDisplayMetrics(Context context) {
sDisplayMetrics = context.getResources().getDisplayMetrics();
}
public static int dip2px(float dpValue) { public static int dip2px(float dpValue) {
final float scale = Utils.getContext().getResources().getDisplayMetrics().density; final float scale = Utils.getContext().getResources().getDisplayMetrics().density;
return (int) (dpValue * scale + 0.5f); return (int) (dpValue * scale + 0.5f);
......
#Sat Jul 10 16:33:56 CST 2021 #Mon Jul 12 16:02:26 CST 2021
VERSION_BUILD=2754 VERSION_BUILD=2813
\ No newline at end of file
package me.goldze.mvvmhabit.http; //package me.goldze.mvvmhabit.http;
//
//
import io.reactivex.observers.DisposableObserver; //import io.reactivex.observers.DisposableObserver;
import me.goldze.mvvmhabit.base.AppManager; //import me.goldze.mvvmhabit.base.AppManager;
import me.goldze.mvvmhabit.utils.KLog; //import me.goldze.mvvmhabit.utils.KLog;
import me.goldze.mvvmhabit.utils.ToastUtils; //import me.goldze.mvvmhabit.utils.ToastUtils;
import me.goldze.mvvmhabit.utils.Utils; //import me.goldze.mvvmhabit.utils.Utils;
//
/** ///**
* Created by goldze on 2017/5/10. // * Created by goldze on 2017/5/10.
* 统一的Code封装处理。该类仅供参考,实际业务逻辑, 根据需求来定义, // * 统一的Code封装处理。该类仅供参考,实际业务逻辑, 根据需求来定义,
*/ // */
//
public abstract class ApiDisposableObserver<T> extends DisposableObserver<T> { //public abstract class ApiDisposableObserver<T> extends DisposableObserver<T> {
public abstract void onResult(T t); // public abstract void onResult(T t);
//
@Override // @Override
public void onComplete() { // public void onComplete() {
//
} // }
//
@Override // @Override
public void onError(Throwable e) { // public void onError(Throwable e) {
e.printStackTrace(); // e.printStackTrace();
KLog.e(e.getMessage()); // KLog.e(e.getMessage());
if (e instanceof ResponseThrowable) { // if (e instanceof ResponseThrowable) {
ResponseThrowable rError = (ResponseThrowable) e; // ResponseThrowable rError = (ResponseThrowable) e;
ToastUtils.showShort(rError.getMessage()); // ToastUtils.showShort(rError.getMessage());
return; // return;
} // }
//其他全部甩锅网络异常 // //其他全部甩锅网络异常
ToastUtils.showShort("网络异常"); // ToastUtils.showShort("网络异常");
} // }
//
@Override // @Override
public void onStart() { // public void onStart() {
super.onStart(); // super.onStart();
ToastUtils.showShort("http is start"); // ToastUtils.showShort("http is start");
// if NetworkAvailable no ! must to call onCompleted // // if NetworkAvailable no ! must to call onCompleted
if (!NetworkUtil.isNetworkAvailable(Utils.getContext())) { // if (!NetworkUtil.isNetworkAvailable(Utils.getContext())) {
ToastUtils.showShort("无网络,读取缓存数据"); // ToastUtils.showShort("无网络,读取缓存数据");
onComplete(); // onComplete();
} // }
} // }
//
@Override // @Override
public void onNext(Object o) { // public void onNext(Object o) {
BaseResponse baseResponse = (BaseResponse) o; // BaseResponse baseResponse = (BaseResponse) o;
switch (baseResponse.getstatus()) { // switch (baseResponse.getstatus()) {
case CodeRule.CODE_200: // case CodeRule.CODE_200:
//请求成功, 正确的操作方式 // //请求成功, 正确的操作方式
onResult((T) baseResponse.getResult()); // onResult((T) baseResponse.getResult());
break; // break;
case CodeRule.CODE_220: // case CodeRule.CODE_220:
// 请求成功, 正确的操作方式, 并消息提示 // // 请求成功, 正确的操作方式, 并消息提示
onResult((T) baseResponse.getResult()); // onResult((T) baseResponse.getResult());
break; // break;
case CodeRule.CODE_300: // case CodeRule.CODE_300:
//请求失败,不打印Message // //请求失败,不打印Message
KLog.e("请求失败"); // KLog.e("请求失败");
ToastUtils.showShort("错误代码:", baseResponse.getstatus()); // ToastUtils.showShort("错误代码:", baseResponse.getstatus());
break; // break;
case CodeRule.CODE_330: // case CodeRule.CODE_330:
//请求失败,打印Message // //请求失败,打印Message
ToastUtils.showShort(baseResponse.getMessage()); // ToastUtils.showShort(baseResponse.getMessage());
break; // break;
case CodeRule.CODE_500: // case CodeRule.CODE_500:
//服务器内部异常 // //服务器内部异常
ToastUtils.showShort("错误代码:", baseResponse.getstatus()); // ToastUtils.showShort("错误代码:", baseResponse.getstatus());
break; // break;
case CodeRule.CODE_503: // case CodeRule.CODE_503:
//参数为空 // //参数为空
KLog.e("参数为空"); // KLog.e("参数为空");
break; // break;
case CodeRule.CODE_502: // case CodeRule.CODE_502:
//没有数据 // //没有数据
KLog.e("没有数据"); // KLog.e("没有数据");
break; // break;
case CodeRule.CODE_510: // case CodeRule.CODE_510:
//无效的Token,提示跳入登录页 // //无效的Token,提示跳入登录页
ToastUtils.showShort("token已过期,请重新登录"); // ToastUtils.showShort("token已过期,请重新登录");
//关闭所有页面 // //关闭所有页面
AppManager.getAppManager().finishAllActivity(); // AppManager.getAppManager().finishAllActivity();
//跳入登录界面 // //跳入登录界面
//*****该类仅供参考,实际业务Code, 根据需求来定义,******// // //*****该类仅供参考,实际业务Code, 根据需求来定义,******//
break; // break;
case CodeRule.CODE_530: // case CodeRule.CODE_530:
ToastUtils.showShort("请先登录"); // ToastUtils.showShort("请先登录");
break; // break;
case CodeRule.CODE_551: // case CodeRule.CODE_551:
ToastUtils.showShort("错误代码:", baseResponse.getstatus()); // ToastUtils.showShort("错误代码:", baseResponse.getstatus());
break; // break;
default: // default:
ToastUtils.showShort("错误代码:", baseResponse.getstatus()); // ToastUtils.showShort("错误代码:", baseResponse.getstatus());
break; // break;
} // }
} // }
//
public static final class CodeRule { // public static final class CodeRule {
//请求成功, 正确的操作方式 // //请求成功, 正确的操作方式
static final int CODE_200 = 200; // static final int CODE_200 = 200;
//请求成功, 消息提示 // //请求成功, 消息提示
static final int CODE_220 = 220; // static final int CODE_220 = 220;
//请求失败,不打印Message // //请求失败,不打印Message
static final int CODE_300 = 300; // static final int CODE_300 = 300;
//请求失败,打印Message // //请求失败,打印Message
static final int CODE_330 = 330; // static final int CODE_330 = 330;
//服务器内部异常 // //服务器内部异常
static final int CODE_500 = 500; // static final int CODE_500 = 500;
//参数为空 // //参数为空
static final int CODE_503 = 503; // static final int CODE_503 = 503;
//没有数据 // //没有数据
static final int CODE_502 = 502; // static final int CODE_502 = 502;
//无效的Token // //无效的Token
static final int CODE_510 = 510; // static final int CODE_510 = 510;
//未登录 // //未登录
static final int CODE_530 = 530; // static final int CODE_530 = 530;
//请求的操作异常终止:未知的页面类型 // //请求的操作异常终止:未知的页面类型
static final int CODE_551 = 551; // static final int CODE_551 = 551;
} // }
} //}
\ No newline at end of file \ No newline at end of file
package me.goldze.mvvmhabit.http; //package me.goldze.mvvmhabit.http;
//
import java.util.List; //import java.util.List;
//
/** ///**
* Created by goldze on 2017/5/10. // * Created by goldze on 2017/5/10.
* 该类仅供参考,实际业务返回的固定字段, 根据需求来定义, // * 该类仅供参考,实际业务返回的固定字段, 根据需求来定义,
*/ // */
public class BaseArrayResponse<T> extends BaseResponse<List<T>>{ //public class BaseArrayResponse<T> extends BaseResponse<List<T>>{
//
//
@Override // @Override
public List<T> getResult() { // public List<T> getResult() {
return result; // return result;
} // }
//
@Override // @Override
public void setResult(List<T> result) { // public void setResult(List<T> result) {
this.result = result; // this.result = result;
} // }
//
} //}
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