Commit 6e6b01fb authored by mengcuiguang2's avatar mengcuiguang2

Merge branch 'dev_1.0.0' into dev_ad

parents 5b7bea65 810bb144
...@@ -3,6 +3,8 @@ apply plugin: 'com.android.application' ...@@ -3,6 +3,8 @@ apply plugin: 'com.android.application'
apply plugin: 'kotlin-android' apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions' apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt' apply plugin: 'kotlin-kapt'
apply plugin: "kotlin-noarg"
apply plugin: "kotlin-allopen"
android { android {
...@@ -189,14 +191,9 @@ dependencies { ...@@ -189,14 +191,9 @@ dependencies {
//room数据库 //room数据库
def room_version = "2.3.0" api rootProject.ext.dependencies["room-runtime"]
implementation "androidx.room:room-runtime:$room_version" api rootProject.ext.dependencies["room-rxjava2"]
annotationProcessor "androidx.room:room-compiler:$room_version" // use kapt for Kotlin api rootProject.ext.dependencies["room-guava"]
// optional - RxJava support for Room kapt rootProject.ext.dependencies["room-compiler"]
implementation "androidx.room:room-rxjava2:$room_version"
// optional - Guava support for Room, including Optional and ListenableFuture
implementation "androidx.room:room-guava:$room_version"
// Test helpers
testImplementation "androidx.room:room-testing:$room_version"
} }
\ No newline at end of file
...@@ -11,8 +11,7 @@ ...@@ -11,8 +11,7 @@
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> <!-- 访问网络,进行地图相关业务数据请求,包括地图数据,路线规划,POI检索等 --> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> <!-- 访问网络,进行地图相关业务数据请求,包括地图数据,路线规划,POI检索等 -->
<uses-permission android:name="android.permission.INTERNET" /> <!-- 调用相机,用于实现扫描二维码,预览个性化地图编辑器生成的个性化地图样式(开发者实际开发中地图SDK不需要该权限) --> <uses-permission android:name="android.permission.INTERNET" /> <!-- 调用相机,用于实现扫描二维码,预览个性化地图编辑器生成的个性化地图样式(开发者实际开发中地图SDK不需要该权限) -->
<uses-permission android:name="android.permission.CAMERA" /> <!-- 获取手机状态信息 --> <uses-permission android:name="android.permission.CAMERA" /> <!-- 获取手机状态信息 -->
<uses-permission android:name="android.permission.READ_PHONE_STATE" /> <uses-permission android:name="android.permission.READ_PHONE_STATE" /> <!-- android10以后 后台运行位置 -->
<!-- android10以后 后台运行位置 -->
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" /> <uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
<application <application
...@@ -26,6 +25,7 @@ ...@@ -26,6 +25,7 @@
android:supportsRtl="true" android:supportsRtl="true"
android:theme="@style/AppTheme" android:theme="@style/AppTheme"
android:usesCleartextTraffic="true"> android:usesCleartextTraffic="true">
<activity android:name=".main.vr.DetailedActivity"></activity>
<uses-library <uses-library
android:name="org.apache.http.legacy" android:name="org.apache.http.legacy"
...@@ -51,12 +51,10 @@ ...@@ -51,12 +51,10 @@
android:value="${SHARE_KEY}" /> android:value="${SHARE_KEY}" />
<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 <service
android:name="com.baidu.location.f" android:name="com.baidu.location.f"
android:enabled="true" android:enabled="true"
...@@ -71,21 +69,20 @@ ...@@ -71,21 +69,20 @@
<category android:name="android.intent.category.LAUNCHER" /> <category android:name="android.intent.category.LAUNCHER" />
</intent-filter> </intent-filter>
</activity> </activity>
<activity android:name=".login.LoginActivity"></activity> <activity android:name=".login.LoginActivity" />
<activity <activity
android:name=".main.MainActivity" 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"></activity> android:theme="@style/AppTheme.NoneTranslucent" />
<activity android:name=".main.my.MoresettingsActivity" /> <activity android:name=".main.my.MoresettingsActivity" />
<activity android:name=".main.my.AboutusActivity" /> <activity android:name=".main.my.AboutusActivity" />
<activity android:name=".main.my.PermissionsActivity" /> <activity android:name=".main.my.PermissionsActivity" />
<activity android:name=".main.my.OpenvipActivity" /> <activity android:name=".main.my.OpenvipActivity" />
<activity android:name=".main.home.HistoricalimageActivity" /> <activity android:name=".main.home.HistoricalimageActivity" />
<activity android:name=".main.my.BindMobileActivity" /> <activity android:name=".main.my.BindMobileActivity" />
<activity android:name=".splash.GuideActivity"/> <activity android:name=".splash.GuideActivity" />
<activity android:name=".main.home.SearchMapActivity"/> <activity android:name=".main.home.SearchMapActivity" /> <!-- ShareSDK start -->
<!-- ShareSDK start -->
<activity <activity
android:name="com.mob.tools.MobUIShell" android:name="com.mob.tools.MobUIShell"
android:configChanges="keyboardHidden|orientation|screenSize" android:configChanges="keyboardHidden|orientation|screenSize"
...@@ -165,9 +162,7 @@ ...@@ -165,9 +162,7 @@
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" />
<activity android:name=".webview.MintsWebViewActivity"> <activity android:name=".webview.MintsWebViewActivity"></activity>
</activity>
</application> </application>
</manifest> </manifest>
\ No newline at end of file
...@@ -13,6 +13,7 @@ import com.fry.base.adapter.AbstractVLayoutBaseAdapter ...@@ -13,6 +13,7 @@ import com.fry.base.adapter.AbstractVLayoutBaseAdapter
import com.fry.base.adapter.BindingViewHolder import com.fry.base.adapter.BindingViewHolder
import com.mints.street.BR import com.mints.street.BR
import com.mints.street.R import com.mints.street.R
import com.mints.street.bean.VrmapBean
import com.mints.street.databinding.EnterDestinationAdapterBinding import com.mints.street.databinding.EnterDestinationAdapterBinding
import com.mints.street.main.vr.FreeZoneViewModel import com.mints.street.main.vr.FreeZoneViewModel
import me.tatarka.bindingcollectionadapter2.BindingRecyclerViewAdapter import me.tatarka.bindingcollectionadapter2.BindingRecyclerViewAdapter
...@@ -21,8 +22,8 @@ import me.tatarka.bindingcollectionadapter2.ItemBinding ...@@ -21,8 +22,8 @@ import me.tatarka.bindingcollectionadapter2.ItemBinding
/** /**
* Created by 冯瑞雨 on 2021/7/9. * Created by 冯瑞雨 on 2021/7/9.
*/ */
class EnterDestinationAdapter(val context: Context, val list :String): class EnterDestinationAdapter(val context: Context,val bean :List<VrmapBean.Abroad>?):
AbstractVLayoutBaseAdapter<EnterDestinationAdapterBinding, String>(context,list,1) { AbstractVLayoutBaseAdapter<EnterDestinationAdapterBinding, List<VrmapBean.Abroad>?>(context,bean,1) {
private var vLayout: VirtualLayoutManager? = null private var vLayout: VirtualLayoutManager? = null
...@@ -37,7 +38,7 @@ class EnterDestinationAdapter(val context: Context, val list :String): ...@@ -37,7 +38,7 @@ class EnterDestinationAdapter(val context: Context, val list :String):
holder.binding.listView.layoutManager = vLayout holder.binding.listView.layoutManager = vLayout
holder.binding.listView.adapter = mAdapter holder.binding.listView.adapter = mAdapter
mAdapter?.addAdapter(ItemEnterDestinationAdapter(context,"",true)) mAdapter?.addAdapter(ItemEnterDestinationAdapter(context,true,bean))
} }
......
...@@ -27,9 +27,9 @@ class GridMapAdapter(val context: Context, var list: List<VrmapBean.Internal>?) ...@@ -27,9 +27,9 @@ class GridMapAdapter(val context: Context, var list: List<VrmapBean.Internal>?)
var a = holder.binding.bg.layoutParams var a = holder.binding.bg.layoutParams
if (position % 2 == 0) { if (position % 2 == 0) {
holder.binding.bg.setMargin(AppUtils.dp2Px(context, 10F), AppUtils.dp2Px(context, 10F), holder.binding.bg.setMargin(AppUtils.dp2Px(context, 10F), AppUtils.dp2Px(context, 10F),
AppUtils.dp2Px(context, 10F), 0, null, null, null) AppUtils.dp2Px(context, 5F), 0, null, null, null)
} else { } else {
holder.binding.bg.setMargin(0, AppUtils.dp2Px(context, 10F), AppUtils.dp2Px(context, 10F), holder.binding.bg.setMargin(AppUtils.dp2Px(context, 5F), AppUtils.dp2Px(context, 10F), AppUtils.dp2Px(context, 10F),
0, null, null, null) 0, null, null, null)
} }
...@@ -61,7 +61,7 @@ class GridMapAdapter(val context: Context, var list: List<VrmapBean.Internal>?) ...@@ -61,7 +61,7 @@ class GridMapAdapter(val context: Context, var list: List<VrmapBean.Internal>?)
override fun getItemCount() = list!!.size override fun getItemCount() = list!!.size
override fun onCreateLayoutHelper(): LayoutHelper { override fun onCreateLayoutHelper(): LayoutHelper {
val hp : GridLayoutHelper= GridLayoutHelper(2) val hp: GridLayoutHelper = GridLayoutHelper(2)
hp.setAutoExpand(false) hp.setAutoExpand(false)
return hp return hp
} }
......
...@@ -73,7 +73,7 @@ class GridPaymentAdapter(val context: Context, val list: List<VipBean.ListBean>) ...@@ -73,7 +73,7 @@ class GridPaymentAdapter(val context: Context, val list: List<VipBean.ListBean>)
fun getPosition() = mposition fun getPosition() = mposition
override fun onCreateLayoutHelper(): LayoutHelper { override fun onCreateLayoutHelper(): LayoutHelper {
val hp : GridLayoutHelper= GridLayoutHelper(3) val hp: GridLayoutHelper = GridLayoutHelper(3)
hp.setAutoExpand(false) hp.setAutoExpand(false)
return hp return hp
} }
......
package com.mints.street.adapter
import android.content.Context
import android.content.pm.ActivityInfo
import android.view.Window
import android.view.WindowManager
import androidx.recyclerview.widget.RecyclerView
import com.alibaba.android.vlayout.LayoutHelper
import com.alibaba.android.vlayout.LayoutView
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.ItemGridVrmapAdapterBinding
import me.goldze.mvvmhabit.utils.AppUtils
class GridVrMapAdapter(val context: Context, var list: List<String>?) :
AbstractVLayoutBaseAdapter<ItemGridVrmapAdapterBinding, List<String>>(context, list, 2) {
override fun onBindViewHolder(
holder: BindingViewHolder<ItemGridVrmapAdapterBinding>,
position: Int
) {
var a = context.resources.displayMetrics;
val bgLayoutParams = holder.binding.bg.layoutParams
bgLayoutParams.height = (a.widthPixels * 0.5).toInt()
if (position % 2 == 0) {
holder.binding.bg.setMargin(AppUtils.dp2Px(context, 10F), AppUtils.dp2Px(context, 10F),
AppUtils.dp2Px(context, 6F), 0, null, null, null)
} else {
holder.binding.bg.setMargin(AppUtils.dp2Px(context, 6F), AppUtils.dp2Px(context, 10F), AppUtils.dp2Px(context, 10F),
0, null, null, null)
}
}
override fun getItemCount() = list!!.size
override fun onCreateLayoutHelper(): LayoutHelper {
val hp: GridLayoutHelper = GridLayoutHelper(2)
hp.setAutoExpand(false)
return hp
}
override fun getLayoutId(viewType: Int) = R.layout.item_grid_vrmap_adapter
}
\ No newline at end of file
package com.mints.street.adapter package com.mints.street.adapter
import android.content.Context import android.content.Context
import android.graphics.Point
import android.util.DisplayMetrics
import android.view.Display
import com.alibaba.android.vlayout.layout.LinearLayoutHelper import com.alibaba.android.vlayout.layout.LinearLayoutHelper
import com.fry.base.adapter.AbstractVLayoutBaseAdapter import com.fry.base.adapter.AbstractVLayoutBaseAdapter
import com.fry.base.adapter.BindingViewHolder import com.fry.base.adapter.BindingViewHolder
import com.fry.base.utils.ImageLoader
import com.mints.street.R import com.mints.street.R
import com.mints.street.bean.VrmapBean
import com.mints.street.databinding.ItemEnterDestinationAdapterBinding import com.mints.street.databinding.ItemEnterDestinationAdapterBinding
import me.goldze.mvvmhabit.base.AppManager
import me.goldze.mvvmhabit.utils.KLog
/** /**
* Created by 冯瑞雨 on 2021/7/9. * Created by 冯瑞雨 on 2021/7/9.
* @param isMultipleLayout 是否是多布局 * @param isMultipleLayout 是否是多布局
*/ */
class ItemEnterDestinationAdapter(val context: Context,string:String,val isMultipleLayout:Boolean) class ItemEnterDestinationAdapter(
:AbstractVLayoutBaseAdapter<ItemEnterDestinationAdapterBinding,String>(context,string,1) { val context: Context,
private val isMultipleLayout: Boolean,
val list: List<VrmapBean.Abroad>?
) : AbstractVLayoutBaseAdapter<ItemEnterDestinationAdapterBinding, List<VrmapBean.Abroad>?>(
context,
list,
1
) {
override fun onBindViewHolder( override fun onBindViewHolder(
holder: BindingViewHolder<ItemEnterDestinationAdapterBinding>, holder: BindingViewHolder<ItemEnterDestinationAdapterBinding>,
position: Int position: Int
) { ) {
var a = context.resources.displayMetrics; var a = context.resources.displayMetrics;
val bgLayoutParams = holder.binding.bg.layoutParams val bgLayoutParams = holder.binding.bg.layoutParams
if(isMultipleLayout){ if (isMultipleLayout) {
bgLayoutParams.width = (a.widthPixels*0.9).toInt() bgLayoutParams.width = (a.widthPixels * 0.9).toInt()
}else{ } else {
bgLayoutParams.width = a.widthPixels bgLayoutParams.width = a.widthPixels
} }
list?.let { it ->
holder.binding.tvName.text = it[position].name
holder.binding.tvNumberPeople.text = "人数"
it[position].img?.let { url ->
for (index in it.indices) {
when (index) {
0 -> {
ImageLoader.ImageBuilder.with(context)
.setUrl(url[index]).setTargetView(holder.binding.image1).start()
} }
1 -> {
ImageLoader.ImageBuilder.with(context)
.setUrl(url[index]).setTargetView(holder.binding.image2).start()
}
2 -> {
ImageLoader.ImageBuilder.with(context)
.setUrl(url[index]).setTargetView(holder.binding.image3).start()
override fun getItemCount() = 2 }
}
}
}
}
}
override fun getItemCount() = list?.size ?: 0
override fun onCreateLayoutHelper() = LinearLayoutHelper() override fun onCreateLayoutHelper() = LinearLayoutHelper()
override fun getLayoutId(viewType: Int) = R.layout.item_enter_destination_adapter override fun getLayoutId(viewType: Int) = R.layout.item_enter_destination_adapter
} }
package com.mints.street.bean
/**
*
* @author 冯瑞雨
* @date 2021/7/23
*/
class UpgradeInfo(var title : String?
,var name : String?
,var content : String?
, var versionName : String?
,var v_code : String?
,var downloadUrl : String
,var apkMd5 : String?
,var isForce : Boolean) {
}
\ No newline at end of file
...@@ -10,7 +10,7 @@ import me.goldze.mvvmhabit.utils.Utils ...@@ -10,7 +10,7 @@ import me.goldze.mvvmhabit.utils.Utils
*/ */
@Database(entities = [ScenicSpotBean::class], version = 1) @Database(entities = [ScenicSpotBean::class], version = 1)
abstract class AppDatabase : RoomDatabase() { abstract class AppDatabase : RoomDatabase() {
abstract fun userDao(): ScenicSpotDao abstract fun scenicSpotDao(): ScenicSpotDao
companion object { companion object {
private var _instance: AppDatabase? = null private var _instance: AppDatabase? = null
......
package com.mints.street.db package com.mints.street.db
import androidx.room.Dao import androidx.room.*
import androidx.room.Query
/** /**
* Created by 冯瑞雨 on 2021/7/20. * Created by 冯瑞雨 on 2021/7/20.
*/ */
@Dao @Dao
interface ScenicSpotDao { interface ScenicSpotDao {
@Query("SELECT * FROM scenic_spot") /**
fun getAll(): List<ScenicSpotBean> * 添加 VR 免费专区
* OnConflictStrategy.REPLACE表如已有数据,就覆盖掉。
*/
@Insert(onConflict = OnConflictStrategy.REPLACE)
fun addVRFreeZoneAll(list:List<ScenicSpotBean>)
/**
* 获取 VR 免费专区
*/
@Query("SELECT * FROM vr_scenic_spot")
fun getVRFreeZoneAll(): List<ScenicSpotBean>
//
// /**
// * 删除 VR 免费专区
// */
// @Delete
// fun deleteVRFreeZoneAll(list:List<ScenicSpotBean>)
//
// /**
// * 获取 国外的 免费专区
// */
// @Query("SELECT * FROM foreign_scenic_spots WHERE is_free = 1")
// fun getForeignFreeAll(list:List<ForeignScenicSpots>)
//
// /**
// * 获取 国外的 收费(精选体验)
// */
// @Query("SELECT * FROM foreign_scenic_spots WHERE is_free = 2")
// fun getForeignTollAll(list:List<ForeignScenicSpots>)
//
// /**
// * 添加 VR 国外
// */
// @Insert(onConflict = OnConflictStrategy.REPLACE)
// fun addForeignAll(list:List<ForeignScenicSpots>)
//
// /**
// * 删除 VR 国外免费
// */
// @Query("DELETE FROM foreign_scenic_spots WHERE is_free =1")
// fun deleteForeignFreeAll()
// /**
// * 删除 VR 国外收费
// */
// @Query("DELETE FROM foreign_scenic_spots WHERE is_free =2")
// fun deleteForeignTollAll()
} }
\ No newline at end of file
package com.mints.street.db package com.mints.street.db
import androidx.room.ColumnInfo
import androidx.room.Entity import androidx.room.Entity
import androidx.room.PrimaryKey import androidx.room.PrimaryKey
/** /**
* Created by 冯瑞雨 on 2021/7/20. * Created by 冯瑞雨 on 2021/7/20.
* 景区表 * VR景区表
*/ */
@Entity(tableName = "scenic_spot") @Entity(tableName = "vr_scenic_spot")
class ScenicSpotBean( class ScenicSpotBean(
//主键 自增 //主键 自增
@PrimaryKey(autoGenerate = true) var id: Int = 0, @PrimaryKey(autoGenerate = true)
//景区 类型 1=境内热门景区 2=境内免费专区 3=首页的景区 var id: Int = 0,
var type :Int = 0,
//景区 经度 //景区 经度
var longitude :Double?=null, var longitude :Double?=null,
//景区 纬度 //景区 纬度
...@@ -20,7 +20,33 @@ class ScenicSpotBean( ...@@ -20,7 +20,33 @@ class ScenicSpotBean(
//景区 名称 //景区 名称
var name :String? = null, var name :String? = null,
//景区 图片 //景区 图片
var images : List<String>? = null, var images : String? = null,
//景区 url地址
var url : String? = null,
//景区 星级 默认0-5 //景区 星级 默认0-5
var starRating : Int? = null @ColumnInfo(name="star_rating")
var starRating : String? = null
)
@Entity(tableName = "foreign_scenic_spots")
class ForeignScenicSpots(
//主键 自增
@PrimaryKey(autoGenerate = true)
var id: Int = 0,
//景区 免费还是收费的 1=免费 2=收费
@ColumnInfo(name="is_free")
var isFree:Int,
//景区 经度
var longitude :Double?=null,
//景区 纬度
var latitude :Double?=null,
//景区 目的地的ID
var did :Int?=null,
//景区 名称
var name :String? = null,
//景区 人数
@ColumnInfo(name = "number_people")
var numberPeople :Int? = null,
//景区 图片
var images : List<String>? = null
) )
\ No newline at end of file
package com.mints.street.eventbean;
/**
* @author 冯瑞雨
* @date 2019/10/23 16:29
*/
public class DownloadEvent {
/**
* apk 的大小
*/
private long apkSize;
/**
* 下载的进度 百分比
*/
private int apkCurrentProgress;
/**
* 下载当前进度
*/
private long apkSchedule;
public long getApkSize() {
return apkSize;
}
public void setApkSize(long apkSize) {
this.apkSize = apkSize;
}
public int getApkCurrentProgress() {
return apkCurrentProgress;
}
public void setApkCurrentProgress(int apkCurrentProgress) {
this.apkCurrentProgress = apkCurrentProgress;
}
public long getApkSchedule() {
return apkSchedule;
}
public void setApkSchedule(long apkSchedule) {
this.apkSchedule = apkSchedule;
}
public DownloadEvent(long apkSize, int apkCurrentProgress, long apkSchedule) {
this.apkSize = apkSize;
this.apkCurrentProgress = apkCurrentProgress;
this.apkSchedule = apkSchedule;
}
}
package com.mints.street.main package com.mints.street.main
import android.Manifest import android.Manifest
import android.content.Intent
import android.os.Bundle import android.os.Bundle
import android.view.KeyEvent import android.view.KeyEvent
import android.view.View import android.view.View
...@@ -15,19 +14,17 @@ import com.fry.base.utils.ImageLoader ...@@ -15,19 +14,17 @@ import com.fry.base.utils.ImageLoader
import com.ittianyu.bottomnavigationviewex.BottomNavigationViewEx import com.ittianyu.bottomnavigationviewex.BottomNavigationViewEx
import com.mints.street.BR import com.mints.street.BR
import com.mints.street.R import com.mints.street.R
import com.mints.street.bean.UpgradeInfo
import com.mints.street.databinding.ActivityMainBinding import com.mints.street.databinding.ActivityMainBinding
import com.mints.street.main.home.HomeFragment import com.mints.street.main.home.HomeFragment
import com.mints.street.main.home.SearchMapActivity
import com.mints.street.main.my.MyFragment import com.mints.street.main.my.MyFragment
import com.mints.street.main.vr.VRFragment import com.mints.street.main.vr.VRFragment
import com.mints.street.manager.UmengManager
import com.mints.street.manager.oaid.OaidManager import com.mints.street.manager.oaid.OaidManager
import com.mints.street.utils.UpdateHelper
import com.tbruyelle.rxpermissions2.RxPermissions import com.tbruyelle.rxpermissions2.RxPermissions
import com.umeng.analytics.MobclickAgent import com.umeng.analytics.MobclickAgent
import me.goldze.mvvmhabit.base.AppManager import me.goldze.mvvmhabit.base.AppManager
import me.goldze.mvvmhabit.utils.KLog
import me.goldze.mvvmhabit.utils.ToastUtils import me.goldze.mvvmhabit.utils.ToastUtils
import me.goldze.mvvmhabit.utils.systembar.StatusBarUtil
class MainActivity : BaseActivity<ActivityMainBinding, MainViewModel>() { class MainActivity : BaseActivity<ActivityMainBinding, MainViewModel>() {
...@@ -75,6 +72,9 @@ class MainActivity : BaseActivity<ActivityMainBinding, MainViewModel>() { ...@@ -75,6 +72,9 @@ class MainActivity : BaseActivity<ActivityMainBinding, MainViewModel>() {
.subscribe { .subscribe {
} }
UpdateHelper.processUpdate(this@MainActivity, UpgradeInfo("1","2","3","4",
"5","6","7",false))
} }
......
...@@ -28,6 +28,7 @@ import com.mints.street.bean.PositioningBean ...@@ -28,6 +28,7 @@ import com.mints.street.bean.PositioningBean
import com.mints.street.databinding.FragmentHomeBinding import com.mints.street.databinding.FragmentHomeBinding
import com.mints.street.manager.UmengManager import com.mints.street.manager.UmengManager
import com.mints.street.webview.MintsWebViewActivity import com.mints.street.webview.MintsWebViewActivity
import com.mints.street.widget.ScrollLayout
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.RxUtils import me.goldze.mvvmhabit.utils.RxUtils
...@@ -116,6 +117,7 @@ class HomeFragment : BaseFragment<FragmentHomeBinding, HomeViewModel>(), SensorE ...@@ -116,6 +117,7 @@ class HomeFragment : BaseFragment<FragmentHomeBinding, HomeViewModel>(), SensorE
// 默认 天安门 // 默认 天安门
val center = LatLng(it["latitude"] ?:39.915071, it["longitude"] ?:116.403907) val center = LatLng(it["latitude"] ?:39.915071, it["longitude"] ?:116.403907)
setNewMapStatus(center) setNewMapStatus(center)
binding.scrollLayout.toggle(ScrollLayout.STATUS_CLOSE)
}) })
} }
......
package com.mints.street.main.my package com.mints.street.main.my
import android.content.res.ColorStateList
import android.graphics.Color import android.graphics.Color
import android.os.Bundle import android.os.Bundle
import android.view.View import android.view.View
...@@ -11,7 +10,6 @@ import com.fry.base.base.BaseActivity ...@@ -11,7 +10,6 @@ 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 com.mints.street.main.MainActivity
import com.mints.street.manager.UserManager import com.mints.street.manager.UserManager
import com.mints.street.webview.MintsWebViewActivity import com.mints.street.webview.MintsWebViewActivity
import kotlinx.android.synthetic.main.activity_moresettings.* import kotlinx.android.synthetic.main.activity_moresettings.*
...@@ -34,7 +32,7 @@ class MoresettingsActivity : BaseActivity<ActivityMoresettingsBinding, Moresetti ...@@ -34,7 +32,7 @@ class MoresettingsActivity : BaseActivity<ActivityMoresettingsBinding, Moresetti
override fun initData() { override fun initData() {
super.initData() super.initData()
StatusBarUtil.setHeightAndPadding(this, binding.btnSwitch) StatusBarUtil.setHeightAndPadding(this, binding.elView)
initView() initView()
initListener() initListener()
......
package com.mints.street.main.vr
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.view.View
import android.widget.TextView
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.GridMapAdapter
import com.mints.street.adapter.GridVrMapAdapter
import com.mints.street.databinding.ActivityDetailedBinding
import com.mints.street.databinding.ActivityMoresettingsBinding
import com.mints.street.main.my.MoresettingsViewModel
import kotlinx.android.synthetic.main.activity_detailed.*
import me.goldze.mvvmhabit.utils.KLog
import me.goldze.mvvmhabit.utils.systembar.StatusBarUtil
class DetailedActivity : BaseActivity<ActivityDetailedBinding, DetailedViewModel>(), View.OnClickListener {
override fun initVariableId() = BR.viewModel
override fun initContentView(savedInstanceState: Bundle?) = R.layout.activity_detailed
private var vLayout: VirtualLayoutManager? = null
private var mAdapter: DelegateAdapter? = null
private var gridVrMapAdapter: GridVrMapAdapter? = null
override fun initData() {
super.initData()
initView()
initListener()
}
private fun initListener() {
}
private fun initView() {
//初始化布局管理器
// if (this == null) return
vLayout = VirtualLayoutManager(this!!);
mAdapter = DelegateAdapter(vLayout, false)
binding.listview.layoutManager = vLayout
binding.listview.adapter = mAdapter
if (gridVrMapAdapter == null) {
gridVrMapAdapter = GridVrMapAdapter(this,
listOf("1", "2", "3", "1", "2", "3", "1", "2", "3", "1", "2", "3", "1", "2", "3"))
KLog.e("aaa", "${this.window.decorView.width.toFloat()}")
mAdapter?.addAdapter(gridVrMapAdapter)
mAdapter?.notifyDataSetChanged()
}
}
override fun onClick(v: View?) {
}
}
\ No newline at end of file
package com.mints.street.main.vr
import android.app.Application
import me.goldze.mvvmhabit.base.BaseViewModel
class DetailedViewModel(application: Application) : BaseViewModel(application) {
}
...@@ -3,6 +3,7 @@ package com.mints.street.main.vr ...@@ -3,6 +3,7 @@ package com.mints.street.main.vr
import android.os.Bundle import android.os.Bundle
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.ViewGroup import android.view.ViewGroup
import androidx.lifecycle.Observer
import com.alibaba.android.vlayout.DelegateAdapter import com.alibaba.android.vlayout.DelegateAdapter
import com.alibaba.android.vlayout.VirtualLayoutManager import com.alibaba.android.vlayout.VirtualLayoutManager
import com.fry.base.base.BaseFragment import com.fry.base.base.BaseFragment
...@@ -39,7 +40,14 @@ class FeaturedExperienceFragment:BaseFragment<FragmentFeaturedExperienceBinding ...@@ -39,7 +40,14 @@ class FeaturedExperienceFragment:BaseFragment<FragmentFeaturedExperienceBinding
binding.listView.layoutManager = vLayout binding.listView.layoutManager = vLayout
binding.listView.adapter = mAdapter binding.listView.adapter = mAdapter
viewModel.vrPlaces()
}
override fun initViewObservable() {
super.initViewObservable()
viewModel.VrmapBean.observe(this, Observer {
mAdapter?.addAdapter(ItemEnterDestinationAdapter(context!!, false,it.abroad))
mAdapter?.addAdapter(ItemEnterDestinationAdapter(context!!, "",false)) })
} }
} }
\ No newline at end of file
package com.mints.street.main.vr package com.mints.street.main.vr
import android.app.Application import android.app.Application
import androidx.lifecycle.MutableLiveData
import com.mints.street.bean.BaseResponse
import com.mints.street.bean.VrmapBean
import com.mints.street.db.ScenicSpotBean
import com.mints.street.model.ApiModel
import com.mints.street.netwrok.base.HttpSubscribeImpl
import me.goldze.mvvmhabit.base.BaseViewModel import me.goldze.mvvmhabit.base.BaseViewModel
import me.goldze.mvvmhabit.utils.KLog
/** /**
* Created by 冯瑞雨 on 2021/7/9. * Created by 冯瑞雨 on 2021/7/9.
*/ */
class FeaturedExperienceViewModel(application: Application):BaseViewModel(application) { class FeaturedExperienceViewModel(application: Application):BaseViewModel(application) {
//获取vr街景数据
val VrmapBean: MutableLiveData<VrmapBean> = MutableLiveData()
fun vrPlaces(){//无参数传递
ApiModel.vrPlaces(lifecycleProvider).safeSubscribe(
object : HttpSubscribeImpl<BaseResponse<VrmapBean>>(
this@FeaturedExperienceViewModel,true){
override fun onBusinessSuccess(response: BaseResponse<VrmapBean>) {
VrmapBean.value=response.result
val a:MutableList<ScenicSpotBean> = ArrayList()
for (item in response.result.internal!!){
a.add(
ScenicSpotBean(name = item.name,url = item.url
,starRating = item.stars,images = item.img)
)
}
}
override fun onError(e: Throwable) {
KLog.e("vrPlaces","请求失败 : $e")
}
}
)
}
} }
\ No newline at end of file
...@@ -22,6 +22,7 @@ class FreeZoneFragment : BaseFragment<FragmentFreeZoneBinding, FreeZoneViewModel ...@@ -22,6 +22,7 @@ class FreeZoneFragment : BaseFragment<FragmentFreeZoneBinding, FreeZoneViewModel
private var vLayout: VirtualLayoutManager? = null private var vLayout: VirtualLayoutManager? = null
private var mAdapter: DelegateAdapter? = null private var mAdapter: DelegateAdapter? = null
private var gridMapAdapter: GridMapAdapter? = null private var gridMapAdapter: GridMapAdapter? = null
private var enterDestinationAdapter: EnterDestinationAdapter? = null
override fun initContentView( override fun initContentView(
inflater: LayoutInflater?, inflater: LayoutInflater?,
container: ViewGroup?, container: ViewGroup?,
...@@ -48,13 +49,17 @@ class FreeZoneFragment : BaseFragment<FragmentFreeZoneBinding, FreeZoneViewModel ...@@ -48,13 +49,17 @@ class FreeZoneFragment : BaseFragment<FragmentFreeZoneBinding, FreeZoneViewModel
binding.listView.layoutManager = vLayout binding.listView.layoutManager = vLayout
binding.listView.adapter = mAdapter binding.listView.adapter = mAdapter
mAdapter?.addAdapter(EnterDestinationAdapter(context!!, ""))
} }
override fun initViewObservable() { override fun initViewObservable() {
super.initViewObservable() super.initViewObservable()
viewModel.VrmapBean.observe(this, Observer<VrmapBean> { viewModel.VrmapBean.observe(this, Observer<VrmapBean> {
if(enterDestinationAdapter == null){
enterDestinationAdapter = EnterDestinationAdapter(context!!,it.abroad )
mAdapter?.addAdapter(enterDestinationAdapter)
}
if (gridMapAdapter == null){ if (gridMapAdapter == null){
gridMapAdapter = GridMapAdapter(context!!, it.internal) gridMapAdapter = GridMapAdapter(context!!, it.internal)
mAdapter?.addAdapter(gridMapAdapter) mAdapter?.addAdapter(gridMapAdapter)
......
...@@ -5,6 +5,8 @@ import androidx.lifecycle.MutableLiveData ...@@ -5,6 +5,8 @@ import androidx.lifecycle.MutableLiveData
import com.mints.street.bean.BaseResponse import com.mints.street.bean.BaseResponse
import com.mints.street.bean.VipBean import com.mints.street.bean.VipBean
import com.mints.street.bean.VrmapBean import com.mints.street.bean.VrmapBean
import com.mints.street.db.AppDatabase
import com.mints.street.db.ScenicSpotBean
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 me.goldze.mvvmhabit.base.BaseViewModel import me.goldze.mvvmhabit.base.BaseViewModel
...@@ -24,11 +26,19 @@ class FreeZoneViewModel(application: Application):BaseViewModel(application) { ...@@ -24,11 +26,19 @@ class FreeZoneViewModel(application: Application):BaseViewModel(application) {
this@FreeZoneViewModel,true){ this@FreeZoneViewModel,true){
override fun onBusinessSuccess(response: BaseResponse<VrmapBean>) { override fun onBusinessSuccess(response: BaseResponse<VrmapBean>) {
VrmapBean.value=response.result VrmapBean.value=response.result
KLog.e("vrPlaces","请求成功") val a:MutableList<ScenicSpotBean> = ArrayList()
for (item in response.result.internal!!){
a.add(ScenicSpotBean(name = item.name,url = item.url
,starRating = item.stars,images = item.img))
}
// AppDatabase.instance().scenicSpotDao().addVRFreeZoneAll(a)
// for(item in AppDatabase.instance().scenicSpotDao().getVRFreeZoneAll()){
// KLog.e("AppDatabase.instance().scenicSpotDao().getVRFreeZoneAll()",item.toString())
// }
} }
override fun onError(e: Throwable) { override fun onError(e: Throwable) {
KLog.e("vrPlaces","请求失败") KLog.e("vrPlaces","请求失败 : $e")
} }
} }
) )
......
...@@ -109,7 +109,7 @@ class VRFragment : BaseFragment<FragmentVrBinding, VRViewModel>() { ...@@ -109,7 +109,7 @@ class VRFragment : BaseFragment<FragmentVrBinding, VRViewModel>() {
//未选中颜色 //未选中颜色
normalColor = Color.BLACK normalColor = Color.BLACK
//选中颜色 //选中颜色
selectedColor = ContextCompat.getColor(context, R.color.main_color) selectedColor = ContextCompat.getColor(context, R.color.main_blue_lower)
//点击事件 //点击事件
setOnClickListener { setOnClickListener {
viewPager.currentItem = index viewPager.currentItem = index
...@@ -129,7 +129,7 @@ class VRFragment : BaseFragment<FragmentVrBinding, VRViewModel>() { ...@@ -129,7 +129,7 @@ class VRFragment : BaseFragment<FragmentVrBinding, VRViewModel>() {
startInterpolator = AccelerateInterpolator() startInterpolator = AccelerateInterpolator()
endInterpolator = DecelerateInterpolator(2.0f) endInterpolator = DecelerateInterpolator(2.0f)
//线条的颜色 //线条的颜色
setColors(ContextCompat.getColor(context, R.color.main_color)) setColors(ContextCompat.getColor(context, R.color.main_blue_lower))
} }
} }
} }
......
package com.mints.street.services;
import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
import com.fry.base.utils.NotificationUtils;
import com.mints.street.BuildConfig;
import com.mints.street.eventbean.DownloadEvent;
import com.mints.street.utils.UpdateHelper;
import java.io.File;
import me.goldze.mvvmhabit.bus.RxBus;
import me.goldze.mvvmhabit.http.DownLoadManager;
import me.goldze.mvvmhabit.http.download.ProgressCallBack;
import me.goldze.mvvmhabit.utils.AppUtils;
import me.goldze.mvvmhabit.utils.ToastUtils;
import me.goldze.mvvmhabit.utils.Utils;
import okhttp3.ResponseBody;
/**
* 升级下载服务
*
* @author 冯瑞雨
* @date 2021/7/23
*/
public class UpdateServices extends Service {
public static final String VERSION_CODE_KEY = "versionCode";
public static final String DOWNLOAD_URL_KEY = "url";
public static final String APK_MD5 = "apkMd5";
public static final String IS_FORCED_UPDATE_KEY = "isForcedUpdate";
private boolean isForcedUpdate;
/***
* 文件存放的路径
*/
private String destFileDir;
/***
* 文件存放的名称
*/
private String destFileName = "last-" + BuildConfig.VERSION_CODE + ".apk";
private String targetVersionName;
private NotificationUtils mNotificationUtils;
private boolean hasDownloading = false;
@Override
public IBinder onBind(Intent intent) {
return null;
}
@Override
public void onStart(Intent intent, int startId) {
super.onStart(intent, startId);
}
@Override
public void onCreate() {
super.onCreate();
destFileDir = UpdateHelper.getDownloadDir(this);
}
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
if (intent == null) {
return super.onStartCommand(intent, flags, startId);
}
if (intent.hasExtra(VERSION_CODE_KEY)) {
targetVersionName = intent.getStringExtra(VERSION_CODE_KEY);
destFileName = UpdateHelper.getFileName(targetVersionName);
}
if (mNotificationUtils == null) {
mNotificationUtils = new NotificationUtils(getBaseContext());
}
//启动线程开始执行下载任务
if (!hasDownloading && intent.hasExtra(DOWNLOAD_URL_KEY)) {
startForeground(1, mNotificationUtils.getNotification("下载", "准备下载").build());
downFile(intent.getStringExtra(DOWNLOAD_URL_KEY));
}
if (intent.hasExtra(IS_FORCED_UPDATE_KEY)) {
isForcedUpdate = intent.getBooleanExtra(IS_FORCED_UPDATE_KEY, false);
}
/**
* 这个常量是{@link #onStartCommand}方法的其中一个返回值:如果这个服务的进程在这个服务
* 已经启动(也就是{@link #onStartCommand}方法已经运行完了)之后因为系统资源紧张等问题
* 被系统关闭了,这个服务会被系统用最近一次启动这个服务所用的Intent重新启动它。这个Intent
* 会被系统一直保存到{@link #stopSelf(int)}方法被调用为止。这种情况下,服务当中的
* {@link #onStartCommand(Intent, int, int)}里面的intent不会是null。因为这种服务只
* 会在所有启动它的intent都执行完了的情况下才不会重新启动。
*/
return Service.START_REDELIVER_INTENT;/*super.onStartCommand(intent, flags, startId);*/
}
@Override
public void onDestroy() {
super.onDestroy();
}
//下载更新文件
private void downFile(final String url) {
if (hasDownloading) {
return;
}
DownLoadManager.getInstance().load(url, new ProgressCallBack<ResponseBody>(destFileDir, destFileName) {
@Override
public void onStart() {
super.onStart();
hasDownloading = true;
ToastUtils.showShort("开始下载!");
}
@Override
public void onSuccess(ResponseBody o) {
//如果md5为空,则不校验文件是否合法
ToastUtils.showShort("文件下载成功!");
installApk(destFileDir + "/" + destFileName);
if (isForcedUpdate) {
RxBus.getDefault().post(new DownloadEvent(0, 100, 0));
}
hasDownloading = false;
//停止掉当前的服务
stopSelf();
}
@Override
public void progress(long progress, long total) {
//更新状态栏上的下载进度信息
int processValue = (int) ((progress / (double) total) * 100);
if (isForcedUpdate) {
RxBus.getDefault().post(new DownloadEvent(total, processValue, progress));
} else {
mNotificationUtils.sendNotificationProgress("升级", "已下载" + processValue + "%", processValue, null);
}
}
@Override
public void onError(Throwable e) {
//如果断网,会抛IO异常
e.printStackTrace();
ToastUtils.showShort("文件下载失败!");
File file = new File(destFileDir + File.separator + destFileName);
if (file.exists()) {
file.delete();
}
// nm.cancel(notificationId);
hasDownloading = false;
//停止掉当前的服务
stopSelf();
// progressDialog.dismiss();
}
@Override
public void onCompleted() {
// progressDialog.dismiss();
//下载完成后清除所有下载信息,执行安装提示
// nm.cancel(notificationId);
hasDownloading = false;
//停止掉当前的服务
stopSelf();
}
});
}
private void installApk(String s) {
AppUtils.installApk(Utils.getContext(), s);
}
}
package com.mints.street.utils;
import android.content.Context;
import android.os.Build;
import android.os.Environment;
import android.text.TextUtils;
import com.lxj.xpopup.interfaces.OnConfirmListener;
import com.mints.street.bean.UpgradeInfo;
import com.mints.street.widget.dialog.UpdateDialog;
import java.io.File;
import androidx.appcompat.app.AppCompatActivity;
import me.goldze.mvvmhabit.utils.AppUtils;
import me.goldze.mvvmhabit.utils.CommonDialogUtils;
/**
* @author jeme
* @date 2019/12/29
*/
public class UpdateHelper {
/***
* 普通升级
*/
public static final int UPDATE = 1;
/***
* 强制升级
*/
public static final int FORCE_UPDATE = 2;
/***
* 处理升级功能
*/
public static void processUpdate(AppCompatActivity appCompatActivity, UpgradeInfo upgradeInfoBean) {
UpdateDialog.showDialog(appCompatActivity, upgradeInfoBean);
}
/***
* 检查升级文件合法性
*/
public static boolean checkUpdateFile(Context context, String appVersionCode, String md5) {
if (TextUtils.isEmpty(md5)) {
return false;
}
String dir = getDownloadDir(context);
File file = new File(String.format("%s%s%s", dir, File.separator, appVersionCode));
if (file.exists()) {
String md5_ = me.goldze.mvvmhabit.utils.FileUtils.getFileMD5(file);
return TextUtils.equals(md5, md5_);
}
return false;
}
public static String getDownloadDir(Context context) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
return context.getExternalFilesDir(Environment.DIRECTORY_DOWNLOADS).getPath();
} else {
return Environment.getExternalStorageDirectory().getPath();
}
}
public static String getFileName(String newVersionCode) {
return String.format("last-%s.apk", newVersionCode);
}
private static void showInstallDialog(AppCompatActivity activity, String appVersion) {
CommonDialogUtils.showMessage(activity, "安装", "新包已经下载成功,是否直接安装?", "确定", "取消", new OnConfirmListener() {
@Override
public void onConfirm() {
AppUtils.installApk(activity,
String.format("%s%s%s", getDownloadDir(activity),
File.separator, getFileName(appVersion)));
}
},null,false);
/* TDialogHelper.selectDialog(activity,"安装","新包已经下载成功,是否直接安装?")
.setOnViewClickListener(new OnViewClickListener() {
@Override
public void onViewClick(BindViewHolder viewHolder, View view, TDialog tDialog) {
if(view.getId() == R.id.tv_confirm){
AppUtils.installApk(activity,
String.format("%s%s%s",getDownloadDir(activity),
File.separator,getFileName(appVersion)));
}
tDialog.dismiss();
}
}).create().show();*/
}
}
package com.mints.street.widget;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;
import com.mints.street.R;
import androidx.annotation.Nullable;
/**
* Created by 冯瑞雨 on 2021/7/21.
*/
public class RatingStar extends View {
private int normalId;
private Bitmap normalImg;
private Bitmap focusImg;
private int number;
private int w1;
private int h1;
private int marginLeft;
private int marginTop;
private int marginBottom;
private int marginRight;
private int height;
private int width;
private int p;
private float w0;
private int i0;
private int mGrade;
public RatingStar(Context context) {
this(context,null);
}
public RatingStar(Context context, @Nullable AttributeSet attrs) {
this(context, attrs,0);
}
public RatingStar(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
TypedArray array = context.obtainStyledAttributes(attrs, R.styleable.RatingStar);
normalId = array.getResourceId(R.styleable.RatingStar_starNormal,0);
normalImg = BitmapFactory.decodeResource(getResources(), normalId);
number = array.getInteger(R.styleable.RatingStar_starNumber,5);
array.recycle();
i0 = -1;
}
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
w1 = normalImg.getWidth();
h1 = normalImg.getHeight();
//中间间隔
p = 10;
// marginTop = 20;
// marginBottom = 20;
// marginLeft = 20;
// marginRight = 20;
height = h1 + marginTop + marginBottom;
width = w1 *number+(number-1)*p +marginLeft+marginRight;
setMeasuredDimension(width, height);
}
@Override
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
for (int i = 0; i < number; i++) {
if (i <= i0){
canvas.drawBitmap(focusImg,i*w1+marginLeft+i*p,marginTop,null);
mGrade = i+1;
}else{
canvas.drawBitmap(normalImg,i*w1+marginLeft+i*p,marginTop,null);
}
}
// Log.e("msg","我被调用了!");
}
}
\ No newline at end of file
package com.mints.street.widget.dialog;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;
import android.util.DisplayMetrics;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import android.widget.ProgressBar;
import android.widget.TextView;
import com.mints.street.R;
import com.mints.street.eventbean.DownloadEvent;
import java.text.DecimalFormat;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.DialogFragment;
import io.reactivex.disposables.Disposable;
import io.reactivex.functions.Consumer;
import me.goldze.mvvmhabit.bus.RxBus;
import me.goldze.mvvmhabit.bus.RxSubscriptions;
import me.goldze.mvvmhabit.utils.Utils;
/**
* @author 冯瑞雨
* @date 2019/10/23 14:54
*/
public class DownloadDialog extends DialogFragment {
private TextView tvDownloadSchedule, tvDownloadSize, tvApkSize;
private ProgressBar progressBar;
private Disposable mSubscribe;
private DecimalFormat df = new DecimalFormat("#.00");
private double apkSize;
public static DownloadDialog newInstance() {
Bundle args = new Bundle();
DownloadDialog fragment = new DownloadDialog();
fragment.setArguments(args);
return fragment;
}
@Override
public void onStart() {
super.onStart();
Window window = getDialog().getWindow();
window.setBackgroundDrawable(new ColorDrawable());
DisplayMetrics dm = new DisplayMetrics();
getActivity().getWindowManager().getDefaultDisplay().getMetrics(dm);
window.setLayout(WindowManager.LayoutParams.WRAP_CONTENT, WindowManager.LayoutParams.WRAP_CONTENT);
WindowManager.LayoutParams params = window.getAttributes();
params.gravity = Gravity.CENTER;
window.setAttributes(params);
setCancelable(false);
window.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
| View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
// window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
window.setStatusBarColor(Color.TRANSPARENT);
}
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View inflate = inflater.inflate(R.layout.main_dialog_download_fragment, container, false);
return inflate;
}
@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
tvDownloadSchedule = view.findViewById(R.id.tv_download_schedule);
tvDownloadSize = view.findViewById(R.id.tv_download_size);
progressBar = view.findViewById(R.id.pb_progress_bar);
tvApkSize = view.findViewById(R.id.tv_apk_size);
mSubscribe = RxBus.getDefault().toObservable(DownloadEvent.class).subscribe(new Consumer<DownloadEvent>() {
@Override
public void accept(DownloadEvent downloadEvent) throws Exception {
Utils.getHandler().post(new Runnable() {
@Override
public void run() {
if (apkSize == 0){
apkSize = downloadEvent.getApkSize()/(1024f*1024f);
if (tvApkSize != null) {
tvApkSize.setText(String.format("/%sM",df.format(apkSize
)));
}
}
if (tvDownloadSchedule != null) {
tvDownloadSchedule.setText(String.format("下载%s%%", downloadEvent.getApkCurrentProgress()));
}
if (progressBar != null) {
progressBar.setProgress(downloadEvent.getApkCurrentProgress());
}
if (tvDownloadSize != null) {
tvDownloadSize.setText(String.format("%sM",df.format(downloadEvent.getApkSchedule()/(1024f*1024f))));
}
if (downloadEvent.getApkSize() == 0 && downloadEvent.getApkSchedule()==0){
tvDownloadSize.setText(String.format("%sM",df.format(apkSize)));
}
}
});
}
});
RxSubscriptions.add(mSubscribe);
}
@Override
public void onDestroy() {
super.onDestroy();
RxSubscriptions.remove(mSubscribe);
}
}
package com.mints.street.widget.dialog
import android.Manifest
import android.annotation.SuppressLint
import android.annotation.TargetApi
import android.content.Intent
import android.net.Uri
import android.os.Build
import android.provider.Settings
import android.text.TextUtils
import android.view.View
import androidx.fragment.app.FragmentActivity
import com.fry.base.utils.SpannableUtils
import com.lxj.xpopup.XPopup
import com.lxj.xpopup.core.CenterPopupView
import com.lxj.xpopup.interfaces.SimpleCallback
import com.mints.street.R
import com.mints.street.bean.UpgradeInfo
import com.mints.street.services.UpdateServices
import com.tbruyelle.rxpermissions2.RxPermissions
import kotlinx.android.synthetic.main.main_update_dialog.view.*
import me.goldze.mvvmhabit.base.AppManager
import me.goldze.mvvmhabit.utils.RxUtils
import me.goldze.mvvmhabit.utils.ToastUtils
/**
*
* @author 冯瑞雨
* @date 2021/7/23
*/
class UpdateDialog(val activity: FragmentActivity, val upgradeInfoBean: UpgradeInfo) : CenterPopupView(activity) {
companion object {
@JvmStatic
fun showDialog(activity: FragmentActivity, upgradeInfoBean: UpgradeInfo): UpdateDialog {
return XPopup.Builder(activity)
.setPopupCallback(object : SimpleCallback() {
override fun onBackPressed(): Boolean {
if (!upgradeInfoBean.isForce) { //非强制升级
return false
}
return true
}
})
.dismissOnBackPressed(!upgradeInfoBean.isForce)
.dismissOnTouchOutside(false/*!upgradeInfoBean.isForce*/)
.asCustom(UpdateDialog(activity, upgradeInfoBean))
.show() as UpdateDialog
}
}
override fun getImplLayoutId() = R.layout.main_update_dialog
override fun onCreate() {
super.onCreate()
initView()
initClick()
}
private fun initView() {
tv_update_content.text = upgradeInfoBean.content
tv_tip.text = SpannableUtils.getGradientTxt(upgradeInfoBean.title,
intArrayOf(0xFFFFDA81.toInt(), 0xFFFFF1D5.toInt(), 0xFFFFEDAA.toInt()), null)
tv_title.text = SpannableUtils.getGradientTxt(upgradeInfoBean.name,
intArrayOf(0xFFFFD56F.toInt(), 0xFFFFF1DA.toInt(), 0xFFFFEC98.toInt()), null)
if (upgradeInfoBean.isForce) { //强制升级
stv_download_next.visibility = View.GONE
} else { //普通升级
stv_download_next.visibility = View.VISIBLE
}
}
private fun initClick() {
stv_download_next.setOnClickListener { this.dismiss() }
RxUtils.onMultiClick(stv_download_now){
permissionStorage()
}
}
@SuppressLint("CheckResult")
private fun permissionStorage() {
//请求存储权限
val rxPermissions = RxPermissions(activity)
rxPermissions.request(Manifest.permission.WRITE_EXTERNAL_STORAGE
, Manifest.permission.READ_EXTERNAL_STORAGE)
.subscribe{ grant: Boolean ->
if (grant) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { //  8.0 检测是否允许安装apk
val b: Boolean = activity.packageManager.canRequestPackageInstalls()
if (b) {
startDownload()
} else {
permissionInstall()
}
} else {
startDownload()
}
} else {
if (upgradeInfoBean.isForce) {
AppManager.getAppManager().finishAllActivity()
} else {
dismiss()
}
ToastUtils.showLong("请前往系统设置里允许读写权限")
}
}
}
/**
* 8.0安装新版本APK权限
*/
@TargetApi(Build.VERSION_CODES.O)
@SuppressLint("CheckResult")
private fun permissionInstall() {
//请求安装权限
val rxPermissions = RxPermissions(activity)
rxPermissions.request(Manifest.permission.REQUEST_INSTALL_PACKAGES)
.subscribe { grant: Boolean ->
if (grant) {
startDownload()
} else {
//跳转到安装未知应用界面
val packageURI = Uri.parse("package:" + activity.packageName)
val intent = Intent(Settings.ACTION_MANAGE_UNKNOWN_APP_SOURCES, packageURI)
activity.startActivity(intent)
}
}
}
private fun startDownload() {
if (TextUtils.isEmpty(upgradeInfoBean.downloadUrl)) {
return
}
//打开服务
val intent = Intent(activity, UpdateServices::class.java)
intent.putExtra(UpdateServices.DOWNLOAD_URL_KEY, upgradeInfoBean.downloadUrl)
intent.putExtra(UpdateServices.VERSION_CODE_KEY, upgradeInfoBean.v_code)
if (upgradeInfoBean.isForce) { //强制更新
//弹出新的进度框
intent.putExtra(UpdateServices.IS_FORCED_UPDATE_KEY, true)
DownloadDialog.newInstance().show(activity.supportFragmentManager, "")
} else { //后台下载
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
activity.startForegroundService(intent)
} else {
activity.startService(intent)
}
dismiss()
}
}
\ 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">
<corners <corners
android:topLeftRadius="15dp" android:topLeftRadius="30dp"
android:topRightRadius="20dp" /> android:topRightRadius="30dp" />
<solid android:color="@color/white" /> <solid android:color="@color/white" />
</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="#80FFFFFF" /> <solid android:color="#80FFFFFF" />
<corners android:radius="5dp" /> <corners android:radius="15dp" />
</shape> </shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners
android:topLeftRadius="15dp"
android:topRightRadius="20dp" />
<solid android:color="@color/white" />
</shape>
\ 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"
tools:context=".main.vr.DetailedActivity">
<data>
<variable
name="viewModel"
type="com.mints.street.main.vr.DetailedViewModel" />
</data>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<View
android:id="@+id/view_bg"
android:layout_width="match_parent"
android:layout_height="220dp"
android:background="#668BFF" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<com.fry.base.ui.widget.CommonTitleBar
android:id="@+id/ctb_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:ctb_theme="light"
app:ctb_title="街景" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="20dp"
android:paddingLeft="15dp"
android:text="巴黎嫩亮点"
android:textColor="@color/white"
android:textSize="16sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="15dp"
android:paddingTop="5dp"
android:textSize="12sp"
android:text="巴黎嫩作为文化十字路口的历史可以追溯到数千年前。探索其古老的以及和自然奇观。" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/listview"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="20dp"
android:paddingLeft="6dp"
android:paddingRight="6dp"
android:background="@drawable/vr_item_bg"/>
</LinearLayout>
</FrameLayout>
</layout>
\ No newline at end of file
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
<com.mints.street.widget.ElasticScrollView <com.mints.street.widget.ElasticScrollView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="wrap_content"
android:overScrollMode="never"> android:overScrollMode="never">
<LinearLayout <LinearLayout
...@@ -63,6 +63,10 @@ ...@@ -63,6 +63,10 @@
android:text="退出登录" android:text="退出登录"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="16sp" /> android:textSize="16sp" />
<View
android:id="@+id/el_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</LinearLayout> </LinearLayout>
......
...@@ -16,6 +16,12 @@ ...@@ -16,6 +16,12 @@
android:layout_height="match_parent" android:layout_height="match_parent"
app:srlAccentColor="@color/gray" app:srlAccentColor="@color/gray"
app:srlPrimaryColor="@color/white"> app:srlPrimaryColor="@color/white">
<com.scwang.smartrefresh.layout.header.ClassicsHeader
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:srlTextFailed="释放立即刷新"
app:srlTextRefreshing="下拉可以刷新"
/>
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/list_view" android:id="@+id/list_view"
android:layout_width="match_parent" android:layout_width="match_parent"
......
...@@ -16,6 +16,12 @@ ...@@ -16,6 +16,12 @@
android:layout_height="match_parent" android:layout_height="match_parent"
app:srlAccentColor="@color/gray" app:srlAccentColor="@color/gray"
app:srlPrimaryColor="@color/white"> app:srlPrimaryColor="@color/white">
<com.scwang.smartrefresh.layout.header.ClassicsHeader
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:srlTextFailed="释放立即刷新"
app:srlTextRefreshing="下拉可以刷新"
/>
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/list_view" android:id="@+id/list_view"
android:layout_width="wrap_content" android:layout_width="wrap_content"
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="测试" tools:text="测试"
android:textColor="@color/black" android:textColor="@color/black"
android:textSize="16sp" android:textSize="16sp"
android:textStyle="bold" android:textStyle="bold"
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
android:id="@+id/tv_number_people" android:id="@+id/tv_number_people"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="人数" tools:text="人数"
android:drawableStart="@mipmap/search_hot_icon" android:drawableStart="@mipmap/search_hot_icon"
android:textColor="@color/black" android:textColor="@color/black"
android:textSize="12sp" android:textSize="12sp"
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toStartOf="@id/image2" app:layout_constraintEnd_toStartOf="@id/image2"
android:src="@mipmap/bg_fl" tools:src="@mipmap/bg_fl"
/> />
<ImageView <ImageView
android:layout_marginStart="10dp" android:layout_marginStart="10dp"
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/image1" app:layout_constraintStart_toEndOf="@id/image1"
app:layout_constraintEnd_toStartOf="@id/image3" app:layout_constraintEnd_toStartOf="@id/image3"
android:src="@mipmap/bg_fl" tools:src="@mipmap/bg_fl"
/> />
<ImageView <ImageView
...@@ -75,7 +75,7 @@ ...@@ -75,7 +75,7 @@
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/image2" app:layout_constraintStart_toEndOf="@id/image2"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
android:src="@mipmap/bg_fl" tools:src="@mipmap/bg_fl"
/> />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
<LinearLayout <LinearLayout
android:layout_margin="15dp" android:layout_margin="15dp"
android:id="@+id/bg" android:id="@+id/bg"
android:layout_width="wrap_content" android:layout_width="100dp"
android:layout_height="230dp" android:layout_height="230dp"
android:background="@drawable/shape_bg_vrdata" android:background="@drawable/shape_bg_vrdata"
android:elevation="5dp" android:elevation="5dp"
......
<?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.GridVrMapAdapter" />
</data>
<LinearLayout
android:id="@+id/bg"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_margin="15dp"
android:background="@drawable/shape_bg_vrdata"
android:elevation="5dp"
android:orientation="vertical">
<com.mints.street.widget.XCRoundRectImageView
android:id="@+id/image"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:src="@mipmap/icon_card1" />
<TextView
android:id="@+id/tv_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="10dp"
android:text="测试"
android:textColor="@color/black"
android:textSize="12sp" />
<LinearLayout
android:id="@+id/ly_star"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
</LinearLayout>
</LinearLayout>
</layout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_gravity="center"
>
<TextView
android:id="@+id/tv_download_schedule"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="下载0%"
android:textSize="14sp"
android:textColor="@color/white"
/>
<ProgressBar
android:layout_marginTop="10dp"
app:layout_constraintTop_toBottomOf="@id/tv_download_schedule"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
android:layout_marginLeft="10dp"
android:id="@+id/pb_progress_bar"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="200dp"
android:layout_height="8dp"
android:max="100"
tools:progress="80"
/>
<TextView
android:id="@+id/tv_download_size"
app:layout_constraintTop_toBottomOf="@+id/pb_progress_bar"
app:layout_constraintStart_toStartOf="@+id/pb_progress_bar"
android:layout_marginTop="10dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="0M"
android:textSize="14sp"
android:textColor="@color/white"
/>
<TextView
android:id="@+id/tv_apk_size"
app:layout_constraintTop_toBottomOf="@+id/pb_progress_bar"
app:layout_constraintStart_toEndOf="@id/tv_download_size"
android:layout_marginTop="10dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="/0M"
android:textSize="14sp"
android:textColor="@color/white"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:background="@mipmap/ic_update_bg">
<TextView
android:id="@+id/tv_tip"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="27dp"
android:paddingStart="4dp"
android:paddingEnd="4dp"
android:text="发现新版本"
android:textColor="@color/white"
android:textSize="14sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<View
android:layout_width="18dp"
android:layout_height="0.5dp"
android:background="@color/white"
app:layout_constraintTop_toTopOf="@id/tv_tip"
app:layout_constraintBottom_toBottomOf="@id/tv_tip"
app:layout_constraintEnd_toStartOf="@id/tv_tip"/>
<View
android:layout_width="18dp"
android:layout_height="0.5dp"
android:background="@color/white"
app:layout_constraintTop_toTopOf="@id/tv_tip"
app:layout_constraintBottom_toBottomOf="@id/tv_tip"
app:layout_constraintStart_toEndOf="@id/tv_tip"/>
<TextView
android:id="@+id/tv_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="50dp"
android:textColor="@color/white"
android:textSize="22sp"
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:text="V3.0.0诚邀更新" />
<!-- <View
android:layout_width="0dp"
android:layout_height="0dp"
app:stv_solid="@color/white"
app:stv_corner="6dp"
app:stv_left_top_corner="false"
app:stv_left_bottom_corner="true"
app:stv_right_top_corner="false"
app:stv_right_bottom_corner="true"
app:layout_constraintTop_toTopOf="@id/sv_update_container"
app:layout_constraintBottom_toBottomOf="parent"/>-->
<androidx.core.widget.NestedScrollView
android:id="@+id/sv_update_container"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_margin="10dp"
android:minHeight="110dp"
app:layout_constraintTop_toBottomOf="@id/tv_title">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="@+id/tv_update_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="@color/white"
android:textSize="13sp"
tools:text="1、我的关注,一件找货更方便,我的关注,一件找货更方便\n
1、新增【爱拼团】活动,立享超低\n
1、新增【爱拼团】活动,立享超低\n
1、新增【爱拼团】活动,立享超低" />
</LinearLayout>
</androidx.core.widget.NestedScrollView>
<TextView
android:id="@+id/stv_download_next"
android:layout_width="0dp"
android:layout_height="42dp"
android:layout_marginStart="20dp"
android:layout_marginTop="17dp"
android:layout_marginEnd="5dp"
android:layout_weight="1"
android:background="@mipmap/ic_update_btn_bg"
android:gravity="center"
android:text="下次再说"
android:textColor="@color/white"
android:textSize="16sp"
app:layout_constraintEnd_toStartOf="@id/stv_download_now"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/sv_update_container"
tools:visibility="gone" />
<com.coorchice.library.SuperTextView
android:id="@+id/stv_download_now"
android:layout_width="0dp"
android:layout_height="42dp"
android:layout_marginStart="5dp"
android:layout_marginTop="17dp"
android:layout_marginEnd="20dp"
android:layout_marginBottom="20dp"
android:layout_weight="1"
android:gravity="center"
android:text="现在升级"
android:textColor="@color/white"
android:textSize="16sp"
app:stv_shaderEnable="true"
app:stv_corner="4dp"
app:stv_shaderStartColor="#9A885B"
app:stv_shaderEndColor="#C3B387"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/stv_download_next"
app:layout_constraintTop_toBottomOf="@id/sv_update_container"
app:layout_goneMarginStart="20dp" />
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
...@@ -7,38 +7,4 @@ ...@@ -7,38 +7,4 @@
android:paddingLeft="15dp" android:paddingLeft="15dp"
android:paddingTop="20dp"> android:paddingTop="20dp">
<TextView
android:id="@+id/tv1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:text="无线放大不模糊"
android:textStyle="bold"
android:textColor="#99000000"
android:typeface="serif"
android:textSize="20sp" />
<TextView
android:id="@+id/tv2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tv1"
android:textColor="#99000000"
android:layout_marginBottom="15dp"
android:text="地面也能看清楚"
android:textSize="12sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tv2"
android:layout_marginBottom="10dp"
android:background="@drawable/shape_bg_openvipcard"
android:paddingLeft="20dp"
android:paddingTop="7dp"
android:paddingRight="20dp"
android:paddingBottom="7dp"
android:text="立即领取"
android:textColor="#CCFFFFFF"
android:textSize="14sp" />
</RelativeLayout> </RelativeLayout>
\ No newline at end of file
...@@ -7,38 +7,5 @@ ...@@ -7,38 +7,5 @@
android:paddingLeft="15dp" android:paddingLeft="15dp"
android:paddingTop="20dp"> android:paddingTop="20dp">
<TextView
android:id="@+id/tv1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:text="3D高清街景"
android:textStyle="bold"
android:textColor="#99000000"
android:typeface="serif"
android:textSize="20sp" />
<TextView
android:id="@+id/tv2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tv1"
android:textColor="#99000000"
android:layout_marginBottom="15dp"
android:text="提供全休个城市高清实景"
android:textSize="12sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tv2"
android:layout_marginBottom="10dp"
android:background="@drawable/shape_bg_openvipcard"
android:paddingLeft="20dp"
android:paddingTop="7dp"
android:paddingRight="20dp"
android:paddingBottom="7dp"
android:text="立即领取"
android:textColor="#CCFFFFFF"
android:textSize="14sp" />
</RelativeLayout> </RelativeLayout>
\ No newline at end of file
...@@ -6,39 +6,4 @@ ...@@ -6,39 +6,4 @@
android:gravity="center_vertical" android:gravity="center_vertical"
android:paddingLeft="15dp" android:paddingLeft="15dp"
android:paddingTop="20dp"> android:paddingTop="20dp">
<TextView
android:id="@+id/tv1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:text="VR全景视角"
android:textStyle="bold"
android:textColor="#99000000"
android:typeface="serif"
android:textSize="20sp" />
<TextView
android:id="@+id/tv2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tv1"
android:textColor="#99000000"
android:layout_marginBottom="15dp"
android:text="720度沉浸式体验"
android:textSize="12sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tv2"
android:layout_marginBottom="10dp"
android:background="@drawable/shape_bg_openvipcard"
android:paddingLeft="20dp"
android:paddingTop="7dp"
android:paddingRight="20dp"
android:paddingBottom="7dp"
android:text="立即领取"
android:textColor="#CCFFFFFF"
android:textSize="14sp" />
</RelativeLayout> </RelativeLayout>
\ No newline at end of file
...@@ -2,43 +2,8 @@ ...@@ -2,43 +2,8 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@mipmap/icon_card4" android:background="@mipmap/icon_card3"
android:gravity="center_vertical" android:gravity="center_vertical"
android:paddingLeft="15dp" android:paddingLeft="15dp"
android:paddingTop="20dp"> android:paddingTop="20dp">
<TextView
android:id="@+id/tv1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:text="2D/3D任意切换"
android:textStyle="bold"
android:textColor="#99000000"
android:typeface="serif"
android:textSize="20sp" />
<TextView
android:id="@+id/tv2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tv1"
android:textColor="#99000000"
android:layout_marginBottom="15dp"
android:text="3D立体效果更真实"
android:textSize="12sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tv2"
android:layout_marginBottom="10dp"
android:background="@drawable/shape_bg_openvipcard"
android:paddingLeft="20dp"
android:paddingTop="7dp"
android:paddingRight="20dp"
android:paddingBottom="7dp"
android:text="立即领取"
android:textColor="#CCFFFFFF"
android:textSize="14sp" />
</RelativeLayout> </RelativeLayout>
\ No newline at end of file
...@@ -2,43 +2,9 @@ ...@@ -2,43 +2,9 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@mipmap/icon_card5" android:background="@mipmap/icon_card4"
android:gravity="center_vertical" android:gravity="center_vertical"
android:paddingLeft="15dp" android:paddingLeft="15dp"
android:paddingTop="20dp"> android:paddingTop="20dp">
<TextView
android:id="@+id/tv1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:text="查询国外地址"
android:textStyle="bold"
android:textColor="#99000000"
android:typeface="serif"
android:textSize="20sp" />
<TextView
android:id="@+id/tv2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tv1"
android:textColor="#99000000"
android:layout_marginBottom="15dp"
android:text="无需翻墙也可能看国外街景"
android:textSize="12sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tv2"
android:layout_marginBottom="10dp"
android:background="@drawable/shape_bg_openvipcard"
android:paddingLeft="20dp"
android:paddingTop="7dp"
android:paddingRight="20dp"
android:paddingBottom="7dp"
android:text="立即领取"
android:textColor="#CCFFFFFF"
android:textSize="14sp" />
</RelativeLayout> </RelativeLayout>
\ No newline at end of file
...@@ -7,38 +7,4 @@ ...@@ -7,38 +7,4 @@
android:paddingLeft="15dp" android:paddingLeft="15dp"
android:paddingTop="20dp"> android:paddingTop="20dp">
<TextView
android:id="@+id/tv1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:text="高清地图任意看"
android:textStyle="bold"
android:textColor="#99000000"
android:typeface="serif"
android:textSize="20sp" />
<TextView
android:id="@+id/tv2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tv1"
android:textColor="#99000000"
android:layout_marginBottom="15dp"
android:text="卫星/地形等地图高清不卡顿"
android:textSize="12sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tv2"
android:layout_marginBottom="10dp"
android:background="@drawable/shape_bg_openvipcard"
android:paddingLeft="20dp"
android:paddingTop="7dp"
android:paddingRight="20dp"
android:paddingBottom="7dp"
android:text="立即领取"
android:textColor="#CCFFFFFF"
android:textSize="14sp" />
</RelativeLayout> </RelativeLayout>
\ No newline at end of file
...@@ -7,38 +7,4 @@ ...@@ -7,38 +7,4 @@
android:paddingLeft="15dp" android:paddingLeft="15dp"
android:paddingTop="20dp"> android:paddingTop="20dp">
<TextView
android:id="@+id/tv1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:text="历史影像图数据"
android:textStyle="bold"
android:textColor="#99000000"
android:typeface="serif"
android:textSize="20sp" />
<TextView
android:id="@+id/tv2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tv1"
android:textColor="#99000000"
android:layout_marginBottom="15dp"
android:text="带你一起见证城市变迁"
android:textSize="12sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tv2"
android:layout_marginBottom="10dp"
android:background="@drawable/shape_bg_openvipcard"
android:paddingLeft="20dp"
android:paddingTop="7dp"
android:paddingRight="20dp"
android:paddingBottom="7dp"
android:text="立即领取"
android:textColor="#CCFFFFFF"
android:textSize="14sp" />
</RelativeLayout> </RelativeLayout>
\ No newline at end of file
...@@ -7,38 +7,4 @@ ...@@ -7,38 +7,4 @@
android:paddingLeft="15dp" android:paddingLeft="15dp"
android:paddingTop="20dp"> android:paddingTop="20dp">
<TextView
android:id="@+id/tv1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:text="全球网红景点走一遍"
android:textStyle="bold"
android:textColor="#99000000"
android:typeface="serif"
android:textSize="20sp" />
<TextView
android:id="@+id/tv2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tv1"
android:textColor="#99000000"
android:layout_marginBottom="15dp"
android:text="出行旅游攻略提前看"
android:textSize="12sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tv2"
android:layout_marginBottom="10dp"
android:background="@drawable/shape_bg_openvipcard"
android:paddingLeft="20dp"
android:paddingTop="7dp"
android:paddingRight="20dp"
android:paddingBottom="7dp"
android:text="立即领取"
android:textColor="#CCFFFFFF"
android:textSize="14sp" />
</RelativeLayout> </RelativeLayout>
\ No newline at end of file
...@@ -16,4 +16,9 @@ ...@@ -16,4 +16,9 @@
<attr name="HorizontalselectedViewTextColor" format="color|reference"></attr> <attr name="HorizontalselectedViewTextColor" format="color|reference"></attr>
</declare-styleable> </declare-styleable>
<declare-styleable name="RatingStar">
<attr name="starNormal" format="reference"/>
<attr name="starFocus" format="reference"/>
<attr name="starNumber" format="integer"/>
</declare-styleable>
</resources> </resources>
\ No newline at end of file
...@@ -84,6 +84,11 @@ ext { ...@@ -84,6 +84,11 @@ ext {
//阿里路由框架 //阿里路由框架
"arouter-api" : "com.alibaba:arouter-api:1.5.0", "arouter-api" : "com.alibaba:arouter-api:1.5.0",
"arouter-compiler" : "com.alibaba:arouter-compiler:1.2.2", "arouter-compiler" : "com.alibaba:arouter-compiler:1.2.2",
//room
"room-runtime" : "androidx.room:room-runtime:2.2.5",
"room-rxjava2" : "androidx.room:room-rxjava2:2.2.5",
"room-compiler" : "androidx.room:room-compiler:2.2.5",
"room-guava" : "androidx.room:room-guava:2.2.5",
"constraint-layout" : 'androidx.constraintlayout:constraintlayout:1.1.3', "constraint-layout" : 'androidx.constraintlayout:constraintlayout:1.1.3',
//图片选择和拍照功能 //图片选择和拍照功能
......
...@@ -103,7 +103,7 @@ public class CommonTitleBar extends FrameLayout implements View.OnClickListener ...@@ -103,7 +103,7 @@ public class CommonTitleBar extends FrameLayout implements View.OnClickListener
int color = typedArray.getColor(R.styleable.CommonTitleBar_ctb_title_color, -1); int color = typedArray.getColor(R.styleable.CommonTitleBar_ctb_title_color, -1);
setTitle(title); setTitle(title);
setTitleSize(size); setTitleSize(size);
if (color > 0) { if (color != -1) {
setTitleColor(color); setTitleColor(color);
} }
......
...@@ -22,9 +22,8 @@ android { ...@@ -22,9 +22,8 @@ android {
} }
dependencies { dependencies {
//implementation fileTree(include: ['*.jar','*.aar'], dir: 'libs') api fileTree(include: ['*.jar','*.aar'], dir: 'libs')
compileOnly files('libs\\xpopup-release.aar')
//support //support
api rootProject.ext.support["support-v4"] api rootProject.ext.support["support-v4"]
api rootProject.ext.support["appcompat-v7"] api rootProject.ext.support["appcompat-v7"]
......
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