Commit 3cb0a246 authored by mengcuiguang2's avatar mengcuiguang2

代码合并,解决冲突

parents 196713fe c4cf9d81
...@@ -84,6 +84,9 @@ ...@@ -84,6 +84,9 @@
android:theme="@style/AppTheme.NoneTranslucent"> android:theme="@style/AppTheme.NoneTranslucent">
</activity> </activity>
<activity android:name=".main.my.MoresettingsActivity"/>
<activity android:name=".main.my.AboutusActivity"/>
<activity android:name=".main.my.PermissionsActivity"/>
<!-- ShareSDK start --> <!-- ShareSDK start -->
<activity <activity
......
package com.mints.street.adapter
import android.content.Context
import android.view.View
import androidx.databinding.ObservableArrayList
import androidx.databinding.ObservableList
import androidx.databinding.ViewDataBinding
import com.alibaba.android.vlayout.DelegateAdapter
import com.alibaba.android.vlayout.VirtualLayoutManager
import com.alibaba.android.vlayout.layout.GridLayoutHelper
import com.alibaba.android.vlayout.layout.LinearLayoutHelper
import com.fry.base.adapter.AbstractVLayoutBaseAdapter
import com.fry.base.adapter.BindingViewHolder
import com.mints.street.BR
import com.mints.street.R
import com.mints.street.databinding.EnterDestinationAdapterBinding
import com.mints.street.main.vr.FreeZoneViewModel
import me.tatarka.bindingcollectionadapter2.BindingRecyclerViewAdapter
import me.tatarka.bindingcollectionadapter2.ItemBinding
/**
* Created by 冯瑞雨 on 2021/7/9.
*/
class EnterDestinationAdapter(val context: Context, val list :String):
AbstractVLayoutBaseAdapter<EnterDestinationAdapterBinding, String>(context,list,1) {
private var vLayout: VirtualLayoutManager? = null
private var mAdapter: DelegateAdapter? = null
override fun onBindViewHolder(
holder: BindingViewHolder<EnterDestinationAdapterBinding>,
position: Int) {
vLayout = VirtualLayoutManager(context, VirtualLayoutManager.HORIZONTAL)
mAdapter = DelegateAdapter(vLayout,false)
holder.binding.listView.layoutManager = vLayout
holder.binding.listView.adapter = mAdapter
mAdapter?.addAdapter(ItemEnterDestinationAdapter(context,"",true))
}
override fun getItemCount() = 1
override fun onCreateLayoutHelper() = LinearLayoutHelper()
override fun getLayoutId(viewType: Int) = R.layout.enter_destination_adapter
}
\ No newline at end of file
package com.mints.street.adapter
import android.content.Context
import com.alibaba.android.vlayout.LayoutHelper
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.ItemGridMapAdapterBinding
import me.goldze.mvvmhabit.utils.AppUtils
/**
* Created by 冯瑞雨 on 2021/7/9.
*/
class GridMapAdapter(val context: Context,val list :List<String>):AbstractVLayoutBaseAdapter<ItemGridMapAdapterBinding,List<String>>(context,list,2) {
override fun onBindViewHolder(
holder: BindingViewHolder<ItemGridMapAdapterBinding>,
position: Int
) {
var a = holder.binding.bg.layoutParams
if(position%2 == 0){
holder.binding.bg.setMargin(AppUtils.dp2Px(context,10F),AppUtils.dp2Px(context,10F),AppUtils.dp2Px(context,10F),0,null,null,null)
}else{
holder.binding.bg.setMargin(0,AppUtils.dp2Px(context,10F),AppUtils.dp2Px(context,10F),0,null,null,null)
}
}
override fun getItemCount() = list.size
override fun onCreateLayoutHelper()=GridLayoutHelper(2)
override fun getLayoutId(viewType: Int) = R.layout.item_grid_map_adapter
}
\ No newline at end of file
package com.mints.street.adapter
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.fry.base.adapter.AbstractVLayoutBaseAdapter
import com.fry.base.adapter.BindingViewHolder
import com.mints.street.R
import com.mints.street.databinding.ItemEnterDestinationAdapterBinding
import me.goldze.mvvmhabit.base.AppManager
import me.goldze.mvvmhabit.utils.KLog
/**
* Created by 冯瑞雨 on 2021/7/9.
* @param isMultipleLayout 是否是多布局
*/
class ItemEnterDestinationAdapter(val context: Context,string:String,val isMultipleLayout:Boolean)
:AbstractVLayoutBaseAdapter<ItemEnterDestinationAdapterBinding,String>(context,string,1) {
override fun onBindViewHolder(
holder: BindingViewHolder<ItemEnterDestinationAdapterBinding>,
position: Int
) {
var a = context.resources.displayMetrics;
val bgLayoutParams = holder.binding.bg.layoutParams
if(isMultipleLayout){
bgLayoutParams.width = (a.widthPixels*0.9).toInt()
}else{
bgLayoutParams.width = a.widthPixels
}
}
override fun getItemCount() = 2
override fun onCreateLayoutHelper() = LinearLayoutHelper()
override fun getLayoutId(viewType: Int) = R.layout.item_enter_destination_adapter
}
package com.mints.street.main.home
import me.goldze.mvvmhabit.base.ItemViewModel
/**
* Created by 冯瑞雨 on 2021/7/9.
*/
class HomeButtonItemVM (viewModel: HomeViewModel): ItemViewModel<HomeViewModel?>(viewModel) {
}
\ No newline at end of file
...@@ -18,4 +18,9 @@ class HomeFragment:BaseFragment<FragmentHomeBinding,HomeViewModel>() { ...@@ -18,4 +18,9 @@ class HomeFragment:BaseFragment<FragmentHomeBinding,HomeViewModel>() {
savedInstanceState: Bundle?)= R.layout.fragment_home savedInstanceState: Bundle?)= R.layout.fragment_home
override fun initVariableId()=BR.viewModel override fun initVariableId()=BR.viewModel
override fun initData() {
super.initData()
viewModel.add()
}
} }
\ No newline at end of file
package com.mints.street.main.home package com.mints.street.main.home
import android.app.Application import android.app.Application
import androidx.databinding.ObservableArrayList
import com.mints.street.BR
import com.mints.street.R
import me.goldze.mvvmhabit.base.BaseViewModel import me.goldze.mvvmhabit.base.BaseViewModel
import me.tatarka.bindingcollectionadapter2.ItemBinding
/** /**
* Created by 冯瑞雨 on 2021/7/2. * Created by 冯瑞雨 on 2021/7/2.
*/ */
class HomeViewModel(application: Application):BaseViewModel(application) { class HomeViewModel(application: Application):BaseViewModel(application) {
var addressList = ObservableArrayList<HomeButtonItemVM?>()
var addressItemBinding = ItemBinding.of<HomeButtonItemVM>(BR.viewModel, R.layout.item_home_button)
fun add(){
for (index in 0..10){
addressList.add(HomeButtonItemVM(this))
}
}
} }
\ No newline at end of file
package com.mints.street.main.my
import android.graphics.Color
import android.os.Bundle
import android.view.View
import com.mints.street.databinding.ActivityAboutusBinding
import com.fry.base.base.BaseActivity
import com.mints.street.BR
import com.mints.street.R
import kotlinx.android.synthetic.main.activity_aboutus.*
import kotlinx.android.synthetic.main.header_layout.*
class AboutusActivity :BaseActivity<ActivityAboutusBinding, AboutusViewModel>(), View.OnClickListener {
override fun initVariableId() = BR.viewModel
override fun initContentView(savedInstanceState: Bundle?)= R.layout.activity_aboutus
override fun initData() {
super.initData()
initView()
}
private fun initView() {
tv_title.text="关于我们"
tv_title.setTextColor(Color.BLACK)
iv_left_icon.setImageResource(R.mipmap.iv_return)
tv_user.setOnClickListener(this)
tv_privacy.setOnClickListener(this)
}
override fun onClick(v: View?) {
when(v?.id){
R.id.tv_user->{
// startActivity(UseragreementActivity::class.java)
}
R.id.tv_privacy->{
// startActivity(PrivacypolicyActivity::class.java)
}
}
}
}
package com.mints.street.main.my
import android.app.Application
import me.goldze.mvvmhabit.base.BaseViewModel
class AboutusViewModel(application: Application): BaseViewModel(application) {
}
\ No newline at end of file
package com.mints.street.main.my
import android.graphics.Color
import android.os.Bundle
import com.fry.base.base.BaseActivity
import com.mints.street.BR
import com.mints.street.R
import com.mints.street.databinding.ActivityMoresettingsBinding
import kotlinx.android.synthetic.main.header_layout.*
class MoresettingsActivity: BaseActivity<ActivityMoresettingsBinding, MoresettingsViewModel>() {
override fun initVariableId() = BR.viewModel
override fun initContentView(savedInstanceState: Bundle?)= R.layout.activity_moresettings
override fun initData() {
super.initData()
initView()
}
private fun initView() {
tv_title.text="更多设置"
tv_title.setTextColor(Color.BLACK)
iv_left_icon.setImageResource(R.mipmap.iv_return)
}
}
package com.mints.street.main.my
import android.app.Application
import me.goldze.mvvmhabit.base.BaseViewModel
class MoresettingsViewModel(application: Application): BaseViewModel(application) {
}
package com.mints.street.main.my package com.mints.street.main.my
import android.graphics.Color
import android.graphics.drawable.BitmapDrawable
import android.os.Bundle import android.os.Bundle
import android.util.Log
import android.view.Gravity
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import android.widget.PopupWindow
import android.widget.Toast
import androidx.activity.OnBackPressedCallback
import com.fry.base.base.BaseFragment import com.fry.base.base.BaseFragment
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.FragmentMyBinding import com.mints.street.databinding.FragmentMyBinding
import kotlinx.android.synthetic.main.fragment_my.*
import kotlinx.android.synthetic.main.header_layout.*
/** /**
* Created by 冯瑞雨 on 2021/7/2. * Created by 冯瑞雨 on 2021/7/2.
* 个人中心页面 * 个人中心页面
*/ */
class MyFragment : BaseFragment<FragmentMyBinding, MyViewModel>() { class MyFragment : BaseFragment<FragmentMyBinding, MyViewModel>(), View.OnClickListener {
private var popupWindow: PopupWindow? = null
private var contentView: View? = null
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
override fun initVariableId() = BR.viewModel override fun initVariableId() = BR.viewModel
override fun initData() {
super.initData()
binding.llMyLogin.setOnClickListener {
// showPopwindow();
startActivity(PermissionsActivity::class.java)
}
binding.btTry.setOnClickListener {
Toast.makeText(context,"点击事件响应了",Toast.LENGTH_SHORT).show()
}
ly_aboutus.setOnClickListener(this)
ly_moresettings.setOnClickListener(this)
requireActivity().onBackPressedDispatcher.addCallback(
this,
object : OnBackPressedCallback(true) {
override fun handleOnBackPressed() {
//监听到后要执行的逻辑
if (popupWindow != null && popupWindow!!.isShowing()) {
popupWindow?.dismiss();
}
}
})
}
override fun onClick(v: View?) {
when (v?.id) {
R.id.ly_aboutus -> {
startActivity(AboutusActivity::class.java)
}
R.id.ly_moresettings -> {
startActivity(MoresettingsActivity::class.java)
}
}
}
private fun showPopwindow() {
//加载弹出框的布局
contentView = LayoutInflater.from(context).inflate(
R.layout.layout_popupwindow, null);
// 设置按钮的点击事件
popupWindow = PopupWindow(contentView,
ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.WRAP_CONTENT)
popupWindow!!.isFocusable = true // 取得焦点
//注意 要是点击外部空白处弹框消息 那么必须给弹框设置一个背景色 不然是不起作用的
//注意 要是点击外部空白处弹框消息 那么必须给弹框设置一个背景色 不然是不起作用的
popupWindow!!.setBackgroundDrawable(BitmapDrawable())
//点击外部消失
//点击外部消失
popupWindow!!.isOutsideTouchable = true
//设置可以点击
//设置可以点击
popupWindow!!.isTouchable = true
//进入退出的动画,指定刚才定义的style
//进入退出的动画,指定刚才定义的style
popupWindow!!.animationStyle = R.style.ipopwindow_anim_style
}
fun openPopWindow(v: View?) {
//从底部显示
popupWindow!!.showAtLocation(contentView, Gravity.BOTTOM, 0, 0)
}
} }
package com.mints.street.main.my
import android.os.Bundle
import com.fry.base.base.BaseActivity
import com.mints.street.BR
import com.mints.street.R
import com.mints.street.databinding.ActivityMoresettingsBinding
import com.mints.street.databinding.ActivityPermissionsBinding
class PermissionsActivity : BaseActivity<ActivityPermissionsBinding, PermissionsViewModel>() {
override fun initVariableId() = BR.viewModel
override fun initContentView(savedInstanceState: Bundle?)= R.layout.activity_permissions
override fun initData() {
super.initData()
initView()
}
private fun initView() {
}
}
\ No newline at end of file
package com.mints.street.main.my
import android.app.Application
import me.goldze.mvvmhabit.base.BaseViewModel
class PermissionsViewModel (application: Application): BaseViewModel(application) {
}
package com.mints.street.main.my
class PrivacypolicyActivity {
}
package com.mints.street.main.my
class UseragreementActivity {
}
package com.mints.street.main.vr
import android.os.Bundle
import android.view.LayoutInflater
import android.view.ViewGroup
import com.alibaba.android.vlayout.DelegateAdapter
import com.alibaba.android.vlayout.VirtualLayoutManager
import com.fry.base.base.BaseFragment
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.ItemEnterDestinationAdapter
import com.mints.street.databinding.FragmentFeaturedExperienceBinding
/**
* Created by 冯瑞雨 on 2021/7/9.
* 精选体验
*/
class FeaturedExperienceFragment:BaseFragment<FragmentFeaturedExperienceBinding
,FeaturedExperienceViewModel>() {
private var vLayout: VirtualLayoutManager? = null
private var mAdapter: DelegateAdapter? = null
override fun initContentView(
inflater: LayoutInflater?,
container: ViewGroup?,
savedInstanceState: Bundle?
)= R.layout.fragment_featured_experience
override fun initVariableId() = BR.viewModel
override fun initData() {
super.initData()
//初始化布局管理器
if (context ==null)return
vLayout = VirtualLayoutManager(context!!);
mAdapter = DelegateAdapter(vLayout,false)
binding.listView.layoutManager = vLayout
binding.listView.adapter = mAdapter
mAdapter?.addAdapter(ItemEnterDestinationAdapter(context!!, "",false))
}
}
\ No newline at end of file
package com.mints.street.main.vr
import android.app.Application
import me.goldze.mvvmhabit.base.BaseViewModel
/**
* Created by 冯瑞雨 on 2021/7/9.
*/
class FeaturedExperienceViewModel(application: Application):BaseViewModel(application) {
}
\ No newline at end of file
package com.mints.street.main.vr
import android.os.Bundle
import android.view.LayoutInflater
import android.view.ViewGroup
import com.alibaba.android.vlayout.DelegateAdapter
import com.alibaba.android.vlayout.VirtualLayoutManager
import com.fry.base.base.BaseFragment
import com.mints.street.BR
import com.mints.street.R
import com.mints.street.adapter.EnterDestinationAdapter
import com.mints.street.adapter.ItemEnterDestinationAdapter
import com.mints.street.adapter.GridMapAdapter
import com.mints.street.databinding.FragmentFreeZoneBinding
import me.goldze.mvvmhabit.utils.AppUtils
import me.goldze.mvvmhabit.utils.Utils
/**
* Created by 冯瑞雨 on 2021/7/9.
* 免费专区
*/
class FreeZoneFragment:BaseFragment<FragmentFreeZoneBinding,FreeZoneViewModel>() {
private var vLayout: VirtualLayoutManager? = null
private var mAdapter: DelegateAdapter? = null
override fun initContentView(
inflater: LayoutInflater?,
container: ViewGroup?,
savedInstanceState: Bundle?
)= R.layout.fragment_free_zone
override fun initVariableId() = BR.viewModel
override fun initData() {
super.initData()
//初始化布局管理器
if (context ==null)return
vLayout = VirtualLayoutManager(context!!);
mAdapter = DelegateAdapter(vLayout,false)
binding.listView.layoutManager = vLayout
binding.listView.adapter = mAdapter
mAdapter?.addAdapter(EnterDestinationAdapter(context!!, ""))
mAdapter?.addAdapter(GridMapAdapter(context!!, listOf("1","2","3","4","5","")))
}
}
\ No newline at end of file
package com.mints.street.main.vr
import android.app.Application
import me.goldze.mvvmhabit.base.BaseViewModel
/**
* Created by 冯瑞雨 on 2021/7/9.
*/
class FreeZoneViewModel(application: Application):BaseViewModel(application) {
}
\ No newline at end of file
...@@ -46,12 +46,12 @@ class VRFragment : BaseFragment<FragmentVrBinding, VRViewModel>() { ...@@ -46,12 +46,12 @@ class VRFragment : BaseFragment<FragmentVrBinding, VRViewModel>() {
private fun initTabFragment() { private fun initTabFragment() {
val tabNames = mutableListOf<String>() val tabNames = mutableListOf<String>()
tabNames.add("热门") tabNames.add("免费专区")
tabNames.add("变老特效") tabNames.add("精选体验")
val fragments = mutableListOf<Fragment>() val fragments = mutableListOf<Fragment>()
fragments.add(MyFragment()) fragments.add(FreeZoneFragment())
fragments.add(MyFragment()) fragments.add(FeaturedExperienceFragment())
//初始化viewpager2 //初始化viewpager2
......
...@@ -112,8 +112,8 @@ class SplashActivity:BaseActivity<ActivitySplashBinding,SplashViewModel>() { ...@@ -112,8 +112,8 @@ class SplashActivity:BaseActivity<ActivitySplashBinding,SplashViewModel>() {
//step3:创建开屏广告请求参数AdSlot,具体参数含义参考文档 //step3:创建开屏广告请求参数AdSlot,具体参数含义参考文档
val adSlot = AdSlot.Builder() val adSlot = AdSlot.Builder()
.setImageAdSize(1080, 1920) // 既适用于原生类型,也适用于模版类型。 .setImageAdSize(1080, 1920) // 既适用于原生类型,也适用于模版类型。
.build() .build()
//自定义兜底方案 选择使用 //自定义兜底方案 选择使用
val ttNetworkRequestInfo: TTNetworkRequestInfo val ttNetworkRequestInfo: TTNetworkRequestInfo
......
package com.mints.street.widget;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Bitmap;
import android.graphics.BitmapShader;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.ColorFilter;
import android.graphics.Matrix;
import android.graphics.Paint;
import android.graphics.RectF;
import android.graphics.Shader;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.util.AttributeSet;
import android.widget.ImageView;
import com.mints.street.R;
public class CircleImageView extends ImageView {
private static final ScaleType SCALE_TYPE = ScaleType.CENTER_CROP;
private static final Bitmap.Config BITMAP_CONFIG = Bitmap.Config.ARGB_8888;
private static final int COLORDRAWABLE_DIMENSION = 2;
private static final int DEFAULT_BORDER_WIDTH = 0;
private int mBorderWidth = DEFAULT_BORDER_WIDTH;
private static final int DEFAULT_BORDER_COLOR = Color.BLACK;
private int mBorderColor = DEFAULT_BORDER_COLOR;
private final RectF mDrawableRect = new RectF();
private final RectF mBorderRect = new RectF();
private final Matrix mShaderMatrix = new Matrix();
private final Paint mBitmapPaint = new Paint();
private final Paint mBorderPaint = new Paint();
private Bitmap mBitmap;
private BitmapShader mBitmapShader;
private int mBitmapWidth;
private int mBitmapHeight;
private float mDrawableRadius;
private float mBorderRadius;
private ColorFilter mColorFilter;
private boolean mReady;
private boolean mSetupPending;
public CircleImageView(Context context) {
super(context);
init();
}
public CircleImageView(Context context, AttributeSet attrs) {
this(context, attrs, 0);
}
public CircleImageView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.CircleImageView, defStyle, 0);
mBorderWidth = a.getDimensionPixelSize(R.styleable.CircleImageView_border_width, DEFAULT_BORDER_WIDTH);
mBorderColor = a.getColor(R.styleable.CircleImageView_border_color, DEFAULT_BORDER_COLOR);
a.recycle();
init();
}
private void init() {
super.setScaleType(SCALE_TYPE);
mReady = true;
if (mSetupPending) {
setup();
mSetupPending = false;
}
}
@Override
public void setAdjustViewBounds(boolean adjustViewBounds) {
if (adjustViewBounds) {
throw new IllegalArgumentException("adjustViewBounds not supported.");
}
} @Override
public ScaleType getScaleType() {
return SCALE_TYPE;
}
@Override
public void setImageResource(int resId) {
super.setImageResource(resId);
mBitmap = getBitmapFromDrawable(getDrawable());
setup();
} @Override
public void setScaleType(ScaleType scaleType) {
if (scaleType != SCALE_TYPE) {
throw new IllegalArgumentException(String.format("ScaleType %s not supported.", scaleType));
}
}
@Override
public void setImageURI(Uri uri) {
super.setImageURI(uri);
mBitmap = getBitmapFromDrawable(getDrawable());
setup();
}
@Override
public void setImageDrawable(Drawable drawable) {
super.setImageDrawable(drawable);
mBitmap = getBitmapFromDrawable(drawable);
setup();
} @Override
protected void onDraw(Canvas canvas) {
if (getDrawable() == null) {
return;
}
canvas.drawCircle(getWidth() / 2, getHeight() / 2, mDrawableRadius, mBitmapPaint);
if (mBorderWidth != 0) {
canvas.drawCircle(getWidth() / 2, getHeight() / 2, mBorderRadius, mBorderPaint);
}
}
@Override
public void setImageBitmap(Bitmap bm) {
super.setImageBitmap(bm);
mBitmap = bm;
setup();
}
@Override
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
super.onSizeChanged(w, h, oldw, oldh);
setup();
}
public int getBorderColor() {
return mBorderColor;
}
public void setBorderColor(int borderColor) {
if (borderColor == mBorderColor) {
return;
}
mBorderColor = borderColor;
mBorderPaint.setColor(mBorderColor);
invalidate();
}
public int getBorderWidth() {
return mBorderWidth;
}
public void setBorderWidth(int borderWidth) {
if (borderWidth == mBorderWidth) {
return;
}
mBorderWidth = borderWidth;
setup();
}
private Bitmap getBitmapFromDrawable(Drawable drawable) {
if (drawable == null) {
return null;
}
if (drawable instanceof BitmapDrawable) {
return ((BitmapDrawable) drawable).getBitmap();
}
try {
Bitmap bitmap;
if (drawable instanceof ColorDrawable) {
bitmap = Bitmap.createBitmap(COLORDRAWABLE_DIMENSION, COLORDRAWABLE_DIMENSION, BITMAP_CONFIG);
} else {
bitmap = Bitmap.createBitmap(drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight(), BITMAP_CONFIG);
}
Canvas canvas = new Canvas(bitmap);
drawable.setBounds(0, 0, canvas.getWidth(), canvas.getHeight());
drawable.draw(canvas);
return bitmap;
} catch (OutOfMemoryError e) {
return null;
}
}
private void setup() {
if (!mReady) {
mSetupPending = true;
return;
}
if (mBitmap == null) {
return;
}
mBitmapShader = new BitmapShader(mBitmap, Shader.TileMode.CLAMP, Shader.TileMode.CLAMP);
mBitmapPaint.setAntiAlias(true);
mBitmapPaint.setShader(mBitmapShader);
mBorderPaint.setStyle(Paint.Style.STROKE);
mBorderPaint.setAntiAlias(true);
mBorderPaint.setColor(mBorderColor);
mBorderPaint.setStrokeWidth(mBorderWidth);
mBitmapHeight = mBitmap.getHeight();
mBitmapWidth = mBitmap.getWidth();
mBorderRect.set(0, 0, getWidth(), getHeight());
mBorderRadius = Math.min((mBorderRect.height() - mBorderWidth) / 2, (mBorderRect.width() - mBorderWidth) / 2);
mDrawableRect.set(mBorderWidth, mBorderWidth, mBorderRect.width() - mBorderWidth, mBorderRect.height() - mBorderWidth);
mDrawableRadius = Math.min(mDrawableRect.height() / 2, mDrawableRect.width() / 2);
updateShaderMatrix();
invalidate();
}
private void updateShaderMatrix() {
float scale;
float dx = 0;
float dy = 0;
mShaderMatrix.set(null);
if (mBitmapWidth * mDrawableRect.height() > mDrawableRect.width() * mBitmapHeight) {
scale = mDrawableRect.height() / (float) mBitmapHeight;
dx = (mDrawableRect.width() - mBitmapWidth * scale) * 0.5f;
} else {
scale = mDrawableRect.width() / (float) mBitmapWidth;
dy = (mDrawableRect.height() - mBitmapHeight * scale) * 0.5f;
}
mShaderMatrix.setScale(scale, scale);
mShaderMatrix.postTranslate((int) (dx + 0.5f) + mBorderWidth, (int) (dy + 0.5f) + mBorderWidth);
mBitmapShader.setLocalMatrix(mShaderMatrix);
}
@Override
public void setColorFilter(ColorFilter cf) {
if (cf == mColorFilter) {
return;
}
mColorFilter = cf;
mBitmapPaint.setColorFilter(mColorFilter);
invalidate();
}
}
\ No newline at end of file
package com.mints.street.widget
import android.animation.ValueAnimator
import android.content.Context
import android.util.AttributeSet
import android.view.View
/**
* Created by 冯瑞雨 on 2021/7/9.
*/
class HomeBottomView(context: Context?, attrs: AttributeSet?, defStyleAttr: Int) : View(context, attrs,defStyleAttr) {
init {
}
val STATUS_DEFAULT = 0
val STATUS_EXTEND = 1
val STATUS_CLOSE = 2
val STATUS_ING = 3 //滑动中
private var touchSlop = 0
private var slideSlop = 0
private var offsetB = 0
private var animator: ValueAnimator? = null
private var width1 = 0
private val height1 = 0
private var offsetY = 0
private var offsetExtend = 0
private var offsetClose //是负数
= 0
private var offsetDefault = 0
private var child_default_height = 0
}
\ No newline at end of file
package com.mints.street.widget;
import android.animation.Animator;
import android.animation.ValueAnimator;
import android.content.Context;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewConfiguration;
import android.view.ViewGroup;
import android.view.animation.LinearInterpolator;
import me.goldze.mvvmhabit.utils.AppUtils;
import me.goldze.mvvmhabit.utils.KLog;
/**
* Created by yunzhao.liu on 2018/6/20
* <p>
* ScrollTo和ScrollBy滑动的是view的显示内容,并不改变view的坐标(即:ScrollLayout里的内容)
* ScrollBy:它是基于当前位置的相对滑动
* x和y不是坐标点,是偏移量,坐标系是左正上正
*/
public class ScrollLayout extends ViewGroup {
public ScrollLayout(Context context) {
this(context, null);
}
public ScrollLayout(Context context, AttributeSet attrs) {
this(context, attrs, 0);
}
public ScrollLayout(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
init(context);
}
public final static int STATUS_DEFAULT = 0;
public final static int STATUS_EXTEND = 1;
public final static int STATUS_CLOSE = 2;//关闭
public final static int STATUS_ING = 3;//滑动中
private int touchSlop;
private int slideSlop;
private int offsetB;
private ValueAnimator animator;
private int width;
private int height;
private int offsetY;
private int offsetExtend;
private int offsetClose;//是负数
private int offsetDefault;
private int child_default_height;
private float dX, dY;//TouchEvent_ACTION_DOWN坐标(dX,dY)
private float lastY;//TouchEvent最后一次坐标(lastX,lastY)
private boolean isEventValid = true;//本次touch事件是否有效
private boolean isMoveValid;//是移动有效
private int status;
private int curY, finalY;
private float factor;
private void init(Context context) {
touchSlop = ViewConfiguration.get(context).getScaledTouchSlop();
slideSlop = AppUtils.dp2Px(context, 45);
offsetB = AppUtils.dp2Px(context, 60);
animator = ValueAnimator.ofFloat(0f, 1f);
animator.setDuration(200);
animator.setInterpolator(new LinearInterpolator());
animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
factor = (float) animation.getAnimatedValue();
//这里打印会先打印出:1,然后再从0-1打印,因为每次在start时,都会先调用stop
KLog.i("liuyzz--onAnimation--:", "" + factor);
//curY可为负数或正数
float scrollY = curY + (finalY - curY) * factor;
scrollTo(0, (int) scrollY);
postInvalidate();
if (listener != null) {
listener.onScrollChange(STATUS_ING);
//大于设置的展开距离后才设置颜色渐变
if (getScrollY() > offsetB) {
listener.onScrollProgress(255 * getScrollY() / offsetY);
} else {
listener.onScrollProgress(0);
}
}
}
});
animator.addListener(new Animator.AnimatorListener() {
@Override
public void onAnimationStart(Animator animation) {
}
//动画全部更新完成后再走此方法:addUpdateListener->onAnimationEnd
@Override
public void onAnimationEnd(Animator animation) {
factor = 1;//容错处理,正常情况下addUpdateListener执行完成后factor是1
if (listener != null) {
listener.onScrollChange(status);
}
}
@Override
public void onAnimationCancel(Animator animation) {
}
@Override
public void onAnimationRepeat(Animator animation) {
}
});
}
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
width = MeasureSpec.getSize(widthMeasureSpec);
height = MeasureSpec.getSize(heightMeasureSpec);
//界面下边显示出来的子View的高度
child_default_height = AppUtils.dp2Px(getContext(), 110);
offsetY = height - child_default_height;
offsetExtend = offsetY - offsetB;
offsetClose = offsetY + offsetB - height;//负数 向下移动到剩下40dp的高度
offsetDefault = 0;
int count = getChildCount();
for (int i = 0; i < count; i++) {
View child = getChildAt(i);
measureChild(child, widthMeasureSpec, heightMeasureSpec);
}
setMeasuredDimension(width, height);
}
@Override
protected void onLayout(boolean changed, int l, int t, int r, int b) {
int count = getChildCount();
if (count > 0) {
int top = offsetY;//第一个View距顶高度
for (int i = 0; i < count; i++) {
View child = getChildAt(i);
int childHeight = child.getMeasuredHeight();
//必须有三个孩子,多了不显示
switch (i) {
case 0:
child.layout(0, top, width, top + childHeight);
top += childHeight;
break;
case 1:
//下:需要用屏幕高度-状态栏的高度(40dp)-第一个孩子的高度
child.layout(0, top, width, top + height - offsetB - getChildAt(0).getMeasuredHeight());
top += childHeight;
break;
case 2:
child.layout(0, offsetY, width, offsetY + childHeight);
break;
}
}
}
}
@Override
public boolean dispatchTouchEvent(MotionEvent ev) {
//手势坐标系:下正右正
float eX = ev.getX();
float eY = ev.getY();
switch (ev.getAction()) {
case MotionEvent.ACTION_DOWN:
dX = eX;
lastY = dY = eY;
isMoveValid = false;
isEventValid = true;
//首次进入getScrollY为0,当eY点击区域在offsetY距离下边,则进入
//当点击距离在offsetY上边则进入else
if (getScrollY() + eY > offsetY) {
//当动画正在执行时,事件不往View中传递
if (!(factor == 0 || factor == 1)) {
isEventValid = false;
} else {
//当子View为非滑动事件如TextView,LinearLayoutd等会调用它们的onTouchEvent的所有事件
//当子View为滑动事件如ListView,RecyclerView等不会调用onTouchEvent的Down事件,而是从Move事件开始嗲用
super.dispatchTouchEvent(ev);
}
return true;
}
return false;
case MotionEvent.ACTION_MOVE:
//当动画正在执行时,点击滑动不起作用
if (!isEventValid) return false;
//下滑offset就是负数,上滑就是正数
int offset = (int) (lastY - eY);
lastY = eY;
if ((status == STATUS_EXTEND
|| status == STATUS_CLOSE)
&& super.dispatchTouchEvent(ev)) {
return true;
}
//判断滑动的区间是否满足条件
if (!isMoveValid
&& Math.abs(eY - dY) > touchSlop
&& Math.abs(eY - dY) > Math.abs(eX - dX)) {
isMoveValid = true;
}
if (isMoveValid) {
if (getScrollY() + offset <= offsetClose) {
scrollTo(0, offsetClose);
status = STATUS_CLOSE;
if (listener != null) {
listener.onScrollChange(status);
}
} else if (getScrollY() + offset >= offsetExtend) {
scrollTo(0, offsetExtend);
status = STATUS_EXTEND;
setRecyclerViewLastY(true);
if (listener != null) {
listener.onScrollChange(status);
}
} else {
//偏移量坐标 左正上正
scrollBy(0, offset);
if (listener != null) {
if (getScrollY() > offsetB) {
listener.onScrollProgress(255 * getScrollY() / offsetY);
} else {
listener.onScrollProgress(0);
}
listener.onScrollChange(STATUS_ING);
}
}
}
return true;
case MotionEvent.ACTION_CANCEL:
case MotionEvent.ACTION_UP:
if (!isEventValid)return false;
if (isMoveValid
&& getScrollY() > offsetClose
&& getScrollY() < offsetExtend) {
dealUp(getScrollY());
isMoveValid = false;
return true;
}
setRecyclerViewLastY(status);
break;
}
return super.dispatchTouchEvent(ev);
}
private void dealUp(int scrollY) {
switch (status) {
case STATUS_DEFAULT:
if (scrollY > slideSlop) {//展开
toggle(STATUS_EXTEND);
} else if (scrollY < -slideSlop) {//关闭
toggle(STATUS_CLOSE);
} else {
toggle(STATUS_DEFAULT);
}
break;
case STATUS_EXTEND:
//scrollY<0,说明至少滑动了offsetExtend的距离
//偏移量scrollY是负数,所以关闭
if (scrollY < offsetDefault) {
toggle(STATUS_CLOSE);
} else if (scrollY < offsetExtend - slideSlop) {
toggle(STATUS_DEFAULT);
} else {
//滑动的距离大于0小于slideSlop距离时,恢复到原状态
toggle(STATUS_EXTEND);
}
break;
case STATUS_CLOSE:
//偏移量大于0则展开
if (scrollY > offsetDefault) {
toggle(STATUS_EXTEND);
//滑动距离大于slideSlop但小于0则滑动到初始状态
} else if (scrollY > offsetClose + slideSlop) {
toggle(STATUS_DEFAULT);
} else {
//滑动距离小于slideSlop距离则恢复到原状态
toggle(STATUS_CLOSE);
}
break;
}
}
public void toggle(int status) {
this.status = status;
curY = getScrollY();//y轴上的偏移量
switch (status) {
case STATUS_DEFAULT:
finalY = offsetDefault;
setRecyclerViewLastY(status);
break;
case STATUS_EXTEND:
finalY = offsetExtend;
setRecyclerViewLastY(status);
break;
case STATUS_CLOSE:
finalY = offsetClose;
setRecyclerViewLastY(status);
break;
}
start();
}
public void start() {
stop();
if (animator != null) {
animator.start();
}
}
public void stop() {
if (animator != null) {
animator.end();
}
}
/**
* 设置RecyclerView是否可滑动
* 目的:恢复当从顶部下滑后再滑动到顶部,可跟随滑动
*/
private void setRecyclerViewLastY(boolean isScroll) {
// ScrollRecyclerView.canScroll = isScroll;
}
private OnScrollChangedListener listener;
public interface OnScrollChangedListener {
void onScrollChange(int status);
void onScrollProgress(int progress);
}
public void setOnScrollChangedListener(OnScrollChangedListener l) {
this.listener = l;
}
/**
* 暂时不用
* @param status
*/
private void setRecyclerViewLastY(int status) {
// ScrollRecyclerView.lastY = (status == STATUS_EXTEND ? height : child_default_height);
}
}
package com.mints.street.widget;
import android.content.Context;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;
import com.fry.base.ui.widget.CustomRecycleView;
import androidx.annotation.Nullable;
import androidx.recyclerview.widget.LinearLayoutManager;
import me.goldze.mvvmhabit.utils.KLog;
/**
* Created by yunzhao.liu on 2018/6/20
*/
public class ScrollRecyclerView extends CustomRecycleView {
public static boolean canScroll = true;
public float lastY;
public ScrollRecyclerView(Context context) {
this(context, null);
}
public ScrollRecyclerView(Context context, @Nullable AttributeSet attrs) {
this(context, attrs, 0);
}
public ScrollRecyclerView(Context context, @Nullable AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
}
@Override
public boolean onTouchEvent(MotionEvent e) {
float eY = e.getY();
switch (e.getAction()) {
//因为是滚动列表,所以父View的dispatchTouchEvent不会调用Down事件,而是从Move事件开始调用
case MotionEvent.ACTION_DOWN:
KLog.i("liuyzz:recyclerview:", "---down");
lastY = eY;
canScroll = true;
super.onTouchEvent(e);
return true;
case MotionEvent.ACTION_MOVE:
if (!canScroll) {
return false;
}
//下滑负 上滑正
int offset = (int) (lastY - eY);
lastY = eY;
KLog.i("liuyzz:recyclerview:", ""+canScroll+"-isTop:"+isTop()+"-offset:"+offset);
canScroll = !isTop() || offset > 0;
super.onTouchEvent(e);//如果不写,则会不让滑动
return canScroll;
case MotionEvent.ACTION_CANCEL:
case MotionEvent.ACTION_UP:
canScroll = true;
super.onTouchEvent(e);
return true;
}
return super.onTouchEvent(e);
}
private boolean isTop() {
LayoutManager manager = getLayoutManager();
if (manager == null
|| !(manager instanceof LinearLayoutManager)) {
return false;
}
//显示区域最上面一条信息的position
int visibleItemPosition = ((LinearLayoutManager) manager).findFirstVisibleItemPosition();
View childView = getChildAt(0);//getChildAt(0)只能获得当前能看到的item的第一个
KLog.i("liuyzz:recyclerview:", "position:"+visibleItemPosition+"-top:"+childView.getTop());
//坐标系 下正右正
//D/liuyzz:recyclerview:: position:0-top:-3
//D/liuyzz:recyclerview:: position:0-top:-35
//D/liuyzz:recyclerview:: position:3-top:-10
//D/liuyzz:recyclerview:: position:3-top:-34
return childView != null && visibleItemPosition <= 0 && childView.getTop() >= 0;
}
}
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate
android:duration="800"
android:fromYDelta="0"
android:toYDelta="50%p" />
<alpha
android:duration="1000"
android:fromAlpha="1.0"
android:toAlpha="0.0" />
</set>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate
android:duration="800"
android:fromYDelta="100%p"
android:toYDelta="0" />
<alpha
android:duration="500"
android:fromAlpha="0.0"
android:toAlpha="1.0" />
</set>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#2196F3" />
<corners android:radius="21dp" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<!-- 边框的颜色和粗细 -->
<stroke
android:width="1dp"
android:color="#74000000"
/>
<solid android:color="#ffffffff" />
<corners android:radius="21dp" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<!-- android:radius 圆角的半径 -->
<corners
android:topLeftRadius="10dp"
android:topRightRadius="10dp"
android:bottomRightRadius="0dp"
android:bottomLeftRadius="0dp" />
<!-- 填充的颜色 -->
<solid android:color="@color/black" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<!-- 边框的颜色和粗细 -->
<stroke
android:width="1dp"
android:color="@color/blue"
/>
<solid android:color="#ffffffff" />
<corners android:radius="10dp" />
</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="10dp" /> <corners android:radius="4dp" />
</shape> </shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="@color/color_7EE2FF" />
<corners android:radius="20dp" />
</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.AboutusViewModel" />
</data>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<include
android:id="@+id/header"
layout="@layout/header_layout" />
<TextView
android:layout_below="@+id/header"
android:paddingTop="30dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="世界街景3D地图"
android:textColor="@color/black"
android:layout_centerInParent="true"/>
<ImageView
android:id="@+id/iv_app"
android:layout_width="120dp"
android:layout_height="120dp"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="65dp"
android:src="@mipmap/ic_avatar_ph" />
<LinearLayout
android:layout_centerHorizontal="true"
android:id="@+id/ly_text"
android:paddingTop="10dp"
android:layout_alignParentBottom="true"
android:layout_marginBottom="25dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/tv_user"
android:layout_marginRight="10dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/black"
android:text="《用户协议》"/>
<TextView
android:id="@+id/tv_privacy"
android:layout_marginLeft="10dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/black"
android:text="《隐私政策》"/>
</LinearLayout>
</RelativeLayout>
</layout>
\ No newline at end of file
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<layout xmlns:android="http://schemas.android.com/apk/res/android"> <layout xmlns:android="http://schemas.android.com/apk/res/android">
<data> <data>
<variable <variable
name="ViewModel" name="viewModel"
type="com.mints.street.login.LoginViewModel" /> type="com.mints.street.login.LoginViewModel" />
</data> </data>
<androidx.appcompat.widget.LinearLayoutCompat <androidx.appcompat.widget.LinearLayoutCompat
......
<?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.MoresettingsViewModel" />
</data>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="15dp"
android:layout_marginTop="19dp"
android:layout_marginEnd="15dp"
android:background="@drawable/shape_gold_card"
android:elevation="5dp"
android:orientation="vertical">
<include layout="@layout/header_layout" />
<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
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">
<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>
</layout>
\ 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.PermissionsViewModel" />
</data>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="25dp"
android:text="世界街景3D地图"
android:textColor="@color/black"
android:textSize="25dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="10dp"
android:layout_marginBottom="10pt"
android:text="为了提供一下服务"
android:textColor="#CD000000" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="110dp"
android:layout_margin="10dp"
android:background="@drawable/shape_gold_blue">
<ImageView
android:id="@+id/iv1"
android:layout_width="80dp"
android:layout_height="80dp"
android:layout_centerVertical="true"
android:layout_marginLeft="10dp"
android:background="@color/black" />
<TextView
android:id="@+id/tv1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="@+id/iv1"
android:layout_toRightOf="@id/iv1"
android:text="提供精准定位及导航服务"
android:textColor="@color/black"
android:textSize="18sp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/iv1"
android:layout_toRightOf="@+id/iv1"
android:text="基于您当前位置...." />
<com.github.iielse.switchbutton.SwitchView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:layout_marginRight="10dp" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="110dp"
android:layout_margin="10dp"
android:background="@drawable/shape_gold_blue">
<ImageView
android:id="@+id/iv2"
android:layout_width="80dp"
android:layout_height="80dp"
android:layout_centerVertical="true"
android:layout_marginLeft="10dp"
android:background="@color/black" />
<TextView
android:id="@+id/tv2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="@+id/iv2"
android:layout_toRightOf="@id/iv2"
android:text="提供精准定位及导航服务"
android:textColor="@color/black"
android:textSize="18sp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/iv2"
android:layout_toRightOf="@+id/iv2"
android:text="基于您当前位置...." />
<com.github.iielse.switchbutton.SwitchView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:layout_marginRight="10dp" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="110dp"
android:layout_margin="10dp"
android:background="@drawable/shape_gold_blue">
<ImageView
android:id="@+id/iv3"
android:layout_width="80dp"
android:layout_height="80dp"
android:layout_centerVertical="true"
android:layout_marginLeft="10dp"
android:background="@color/black" />
<TextView
android:id="@+id/tv3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="@+id/iv3"
android:layout_toRightOf="@id/iv3"
android:text="提供精准定位及导航服务"
android:textColor="@color/black"
android:textSize="18sp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/iv3"
android:layout_toRightOf="@+id/iv3"
android:text="基于您当前位置...." />
<com.github.iielse.switchbutton.SwitchView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:layout_marginRight="10dp" />
</RelativeLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="20pt"
android:orientation="horizontal">
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="10dp"
android:background="@drawable/shape_bt_disagree"
android:paddingLeft="20pt"
android:paddingRight="20pt"
android:text="我不同意"
android:textColor="#43000000" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:background="@drawable/shape_bt_agree"
android:paddingLeft="20pt"
android:paddingRight="20pt"
android:text="同意并开始授权"
android:textColor="@color/white" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
/>
<LinearLayout
android:layout_gravity="center_horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="链接网络后可查看并同意完整的"
android:textColor="@color/black" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="《隐私协议》"
android:textColor="@color/black" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="《用户协议》"
android:textColor="@color/black" />
</LinearLayout>
</LinearLayout>
</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">
<FrameLayout
android:id="@+id/fl_splash"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/white">
<FrameLayout <!--这里模拟一张oneshot单的焦点图展示-->
android:id="@+id/splash_container" <ImageView
android:id="@+id/oneshot_image"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="400px" />
<RelativeLayout
android:id="@+id/splash_main"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@color/white" android:background="@android:color/white">
android:src="@drawable/bg_splash"
/> <!-- 广点通开屏广告支持“半屏/全屏”展示,开发者可以把Logo区域放在屏幕底部,然后在Logo上方提供一个容器来放置半开屏广告,请注意此容器高度不得小于400dp -->
<!-- 1.Logo区域:展示半开屏广告时使用,如果想展示全开屏广告,可以不需要这个Logo区域 -->
<!-- 注意:如需要这个Logo区域,建议开发者使用自己的Logo资源,而不是联盟的Logo资源@drawable/gdt_splash_logo,资源规格可参照@drawable/gdt_splash_logo -->
<FrameLayout
android:id="@+id/splash_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@id/app_logo" />
<!-- 2.预设开屏图片区域: -->
<!-- 开发者可以把自家App设计开屏图片摆放在这里,本示例中放置了一张静态图片。!-->
<!-- 注意1:直接将此图放在广告容器的下面即可,始终不要将广告容器splash_container的设为invisible,否则将不会展示广告无法计费,返回错误码600。-->
<!-- 注意2:建议开发者使用自己的开屏图片资源,而不是联盟的@drawable/splash_holder,资源规格可参照@drawable/splash_holder -->
<ImageView
android:id="@+id/splash_holder"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@id/app_logo"
android:scaleType="fitXY" />
<!-- 3.开屏广告容器区域:-->
<!-- 注意:该区域高度不得小于400dp。在本示例中没有写死splash_container的高度值,是因为第1部分的app_logo区域是一个高度很小的图片。 -->
<ImageView
android:id="@+id/app_logo"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="10dp"
/>
<!-- 4.自定义跳过按钮区域:开发者可以根据需要自己实现不同样式的跳过按钮 -->
<!-- 注意1:根据广告法规定,跳过按钮必须在屏幕当中出现。因此广告展示的时候,必须让将SkipView显示出来,即visible,否则将SDK将不展示广告,返回错误码608。。 -->
<!-- 注意2:SDK除了会检查跳过按钮的可见性,还将检测它的尺寸,其尺寸不得小于3dp*3dp,否则将SDK将不展示广告,返回错误码608。 -->
<TextView
android:id="@+id/skip_view"
android:layout_width="96dp"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentTop="true"
android:layout_marginBottom="16dp"
android:layout_marginEnd="16dp"
android:layout_marginTop="16dp"
android:background="@drawable/shape_bg_circle"
android:gravity="center"
android:text="点击跳过"
android:textColor="@android:color/white"
android:textSize="14sp"
android:visibility="gone" />
<!-- 本示例省略了自定义的倒计时,和跳过按钮放在一起实现了。开发者也可以实现自己的倒计时View,方法是在onADTick回调中获得广告剩余的展示时间,并自由决定倒计时View的样式,SDK对倒计时的View没有要求。 -->
<!-- 自定义wifi预加载按钮,需设置状态为不显示,当素材为视频且视频开始播放时,SDK内部会处理为显示状态-->
<TextView
android:id="@+id/preload_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_margin="16dp"
android:background="@drawable/shape_bg_circle"
android:gravity="center"
android:text="已Wi-Fi预加载"
android:textColor="@android:color/white"
android:textSize="14sp"
android:visibility="gone" />
</RelativeLayout>
</FrameLayout>
<data> <data>
......
<?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>
</data>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="140dp"
>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/list_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
</androidx.recyclerview.widget.RecyclerView>
</FrameLayout>
</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.vr.FeaturedExperienceViewModel" />
</data>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.scwang.smartrefresh.layout.SmartRefreshLayout
android:id="@+id/srl_my"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:srlAccentColor="@color/gray"
app:srlPrimaryColor="@color/white">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/list_view"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</com.scwang.smartrefresh.layout.SmartRefreshLayout>
</FrameLayout>
</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.vr.FreeZoneViewModel" />
</data>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.scwang.smartrefresh.layout.SmartRefreshLayout
android:id="@+id/srl_my"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:srlAccentColor="@color/gray"
app:srlPrimaryColor="@color/white">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/list_view"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</com.scwang.smartrefresh.layout.SmartRefreshLayout>
</FrameLayout>
</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: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> <data>
<variable <variable
name="ViewModel" name="viewModel"
type="com.mints.street.main.home.HomeViewModel" /> type="com.mints.street.main.home.HomeViewModel" />
</data> </data>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" <androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent"
<TextView >
android:layout_width="wrap_content"
android:layout_height="wrap_content" <ImageView
android:layout_marginTop="15dp"
android:id="@+id/image_map_change"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent" android:layout_width="35dp"
android:text="广场" android:layout_height="35dp"
android:textColor="@color/black" android:src="@mipmap/map_change_icon"
android:textSize="39dp" />
<ImageView
android:layout_marginTop="15dp"
android:id="@+id/image_map_history"
app:layout_constraintTop_toBottomOf="@id/image_map_change"
app:layout_constraintEnd_toEndOf="parent"
android:layout_width="35dp"
android:layout_height="35dp"
android:src="@mipmap/map_history_icon"
/> />
<ImageView
android:layout_marginTop="15dp"
android:id="@+id/image_location_icon"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
android:layout_marginBottom="120dp"
android:layout_width="35dp"
android:layout_height="35dp"
android:src="@mipmap/location_icon"
/>
<LinearLayout
android:id="@+id/map_a_d"
android:layout_width="31dp"
android:layout_height="63dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toTopOf="@id/image_location_icon"
android:orientation="vertical"
android:background="@drawable/shape_gold_card"
android:layout_marginEnd="2dp"
android:layout_marginBottom="10dp"
>
<ImageView
android:padding="10dp"
android:layout_width="31dp"
android:layout_height="31dp"
android:src="@mipmap/scale_add_icon"
/>
<View
android:layout_marginStart="12dp"
android:layout_marginEnd="12dp"
android:layout_width="wrap_content"
android:layout_height="0.5dp"
android:background="@color/color_333"
/>
<ImageView
android:padding="10dp"
android:layout_width="31dp"
android:layout_height="31dp"
android:src="@mipmap/scale_shrink_icon"
/>
</LinearLayout>
<com.mints.street.widget.ScrollLayout
android:id="@+id/scroll_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#00000000"
android:fillViewport="true"
tools:layout_editor_absoluteX="0dp"
tools:layout_editor_absoluteY="0dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:gravity="center_horizontal"
android:orientation="vertical">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="8dp"
android:src="@mipmap/icon_content_back" />
<TextView
android:layout_width="match_parent"
android:layout_height="40dp"
android:gravity="center"
android:text="占位置"
android:textColor="@color/color_2B3238" />
</LinearLayout>
<com.mints.street.widget.ScrollRecyclerView
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:itemBinding="@{viewModel.addressItemBinding}"
app:items="@{viewModel.addressList}"
tools:listitem="@layout/item_home_button">
</com.mints.street.widget.ScrollRecyclerView>
</com.mints.street.widget.ScrollLayout>
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
</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: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> <data>
<variable <variable
name="ViewModel" name="viewModel"
type="com.mints.street.main.my.MyViewModel" /> type="com.mints.street.main.my.MyViewModel" />
</data> </data>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout
android:id="@+id/llMyRoot"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="wrap_content"
<TextView android:orientation="vertical">
android:layout_width="wrap_content"
<LinearLayout
android:id="@+id/ll_my_login"
android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent" android:layout_marginStart="15dp"
app:layout_constraintStart_toStartOf="parent" android:layout_marginTop="15dp"
android:text="个人中心" android:orientation="horizontal"
android:textColor="@color/black" android:layout_marginBottom="15dp">
android:textSize="39dp"
/> <com.mints.street.widget.CircleImageView
</androidx.constraintlayout.widget.ConstraintLayout> android:id="@+id/item_title_avatar"
android:layout_width="60dp"
android:layout_height="60dp"
android:src="@mipmap/ic_avatar_ph"/>
<TextView
android:id="@+id/item_title_id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="20dp"
android:ellipsize="end"
android:maxLength="10"
android:layout_gravity="center"
android:maxLines="1"
android:text="未登录"
android:textColor="@color/black"
android:textSize="20sp"
android:textStyle="bold"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="15dp"
android:layout_marginEnd="15dp"
android:background="@drawable/shape_gold_card"
android:elevation="5dp"
android:orientation="vertical">
<RelativeLayout
android:background="@drawable/shape_gold"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:paddingStart="10pt"
android:paddingEnd="10dp">
<ImageView
android:id="@+id/iv_flag"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_alignParentStart="true"
android:layout_centerVertical="true"
android:background="@color/blue" />
<TextView
android:id="@+id/tv_tips"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toRightOf="@id/iv_flag"
android:text="恭喜你被全球会员卡砸中~"
android:textColor="@color/white" />
<Button
android:id="@+id/bt_try"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_gravity="center_vertical"
android:layout_marginEnd="8dp"
android:background="@drawable/btn_friends_selectored"
android:text="立即领取"
android:textColor="@color/black"
android:textSize="10sp" />
</RelativeLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal">
<ImageView
android:id="@+id/imageView5"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_marginStart="28dp"
android:background="@color/blue"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@+id/imageView4"
tools:srcCompat="@tools:sample/avatars" />
<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="无线缩放"
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="20dp"
android:layout_height="20dp"
android:layout_marginStart="40dp"
android:layout_marginTop="20dp"
android:background="@color/blue"
app:layout_constraintStart_toEndOf="@+id/imageView5"
app:layout_constraintTop_toBottomOf="@+id/imageView16"
tools:srcCompat="@tools:sample/avatars" />
<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="国内外街景"
android:textSize="10sp"
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="20dp"
android:layout_height="20dp"
android:layout_marginStart="40dp"
android:background="@color/blue"
app:layout_constraintStart_toEndOf="@+id/imageView4"
app:layout_constraintTop_toTopOf="@+id/imageView4"
tools:srcCompat="@tools:sample/avatars" />
<TextView
android:id="@+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="VR全景"
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="20dp"
android:layout_height="20dp"
android:layout_marginStart="40dp"
android:background="@color/blue"
app:layout_constraintStart_toEndOf="@+id/imageView6"
app:layout_constraintTop_toTopOf="@+id/imageView6"
tools:srcCompat="@tools:sample/avatars" />
<TextView
android:id="@+id/textView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="3D地图"
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="20dp"
android:layout_height="20dp"
android:layout_marginTop="20dp"
android:background="@color/blue"
app:layout_constraintEnd_toEndOf="@+id/imageView5"
app:layout_constraintHorizontal_bias="1.0"
app:layout_constraintStart_toStartOf="@+id/imageView5"
app:layout_constraintTop_toBottomOf="@+id/textView2"
tools:srcCompat="@tools:sample/avatars" />
<TextView
android:id="@+id/textView9"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="国外搜索"
android:textSize="10sp"
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="20dp"
android:layout_height="20dp"
android:layout_marginTop="20dp"
android:background="@color/blue"
app:layout_constraintEnd_toEndOf="@+id/imageView4"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="@+id/imageView4"
app:layout_constraintTop_toBottomOf="@+id/textView"
tools:srcCompat="@tools:sample/avatars" />
<ImageView
android:id="@+id/imageView14"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_marginTop="20dp"
android:background="@color/blue"
app:layout_constraintEnd_toEndOf="@+id/imageView6"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="@+id/imageView6"
app:layout_constraintTop_toBottomOf="@+id/textView3"
tools:srcCompat="@tools:sample/avatars" />
<TextView
android:id="@+id/textView10"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="高清地图"
android:textSize="10sp"
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:textSize="10sp"
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="20dp"
android:layout_height="20dp"
android:layout_marginTop="20dp"
android:background="@color/blue"
app:layout_constraintEnd_toEndOf="@+id/imageView7"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="@+id/imageView7"
app:layout_constraintTop_toBottomOf="@+id/textView4"
tools:srcCompat="@tools:sample/avatars" />
<TextView
android:id="@+id/textView12"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="景点推荐"
android:textSize="10sp"
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:layout_marginTop="20dp"
android:background="@color/blue"
app:layout_constraintStart_toEndOf="@+id/imageView5"
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="@color/blue"
app:layout_constraintEnd_toStartOf="@+id/imageView7"
app:layout_constraintTop_toTopOf="@+id/imageView16"
tools:srcCompat="@tools:sample/avatars" />
<TextView
android:id="@+id/textView13"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginEnd="10dp"
android:text="享受8大特权"
android:textSize="10sp"
app:layout_constraintBottom_toBottomOf="@+id/imageView18"
app:layout_constraintEnd_toStartOf="@+id/imageView18"
app:layout_constraintStart_toEndOf="@+id/imageView16"
app:layout_constraintTop_toTopOf="@+id/imageView18" />
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="15dp"
android:layout_marginTop="19dp"
android:layout_marginEnd="15dp"
android:background="@drawable/shape_gold_card"
android:elevation="5dp"
android:orientation="vertical">
<LinearLayout
android:id="@+id/ly_aboutus"
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" />
<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
android:layout_width="20dp"
android:layout_height="20dp"
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>
</layout> </layout>
\ No newline at end of file
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<layout xmlns:app="http://schemas.android.com/apk/res-auto"> <layout xmlns:app="http://schemas.android.com/apk/res-auto">
<data> <data>
<variable <variable
name="ViewModel" name="viewModel"
type="com.mints.street.main.vr.VRViewModel" /> type="com.mints.street.main.vr.VRViewModel" />
</data> </data>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
......
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
<data>
<variable
name="viewModel"
type="com.mints.street.adapter.ItemEnterDestinationAdapter" />
</data>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/bg"
android:layout_width="match_parent"
android:layout_height="140dp"
android:background="@mipmap/vip_google_bg"
android:layout_marginStart="5dp"
android:layout_marginEnd="5dp"
android:padding="10dp"
>
<TextView
android:id="@+id/tv_name"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="测试"
android:textColor="@color/black"
android:textSize="16sp"
android:textStyle="bold"
/>
<TextView
android:gravity="center"
android:layout_marginTop="5dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_name"
android:id="@+id/tv_number_people"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="人数"
android:drawableStart="@mipmap/search_hot_icon"
android:textColor="@color/black"
android:textSize="12sp"
/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@mipmap/street_go"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@id/tv_name"
app:layout_constraintBottom_toBottomOf="@id/tv_number_people"
/>
<ImageView
android:id="@+id/image1"
android:layout_width="0dp"
android:layout_height="60dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toStartOf="@id/image2"
android:src="@mipmap/bg_fl"
/>
<ImageView
android:layout_marginStart="10dp"
android:id="@+id/image2"
android:layout_width="0dp"
android:layout_height="60dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/image1"
app:layout_constraintEnd_toStartOf="@id/image3"
android:src="@mipmap/bg_fl"
/>
<ImageView
android:layout_marginStart="10dp"
android:id="@+id/image3"
android:layout_width="0dp"
android:layout_height="60dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/image2"
app:layout_constraintEnd_toEndOf="parent"
android:src="@mipmap/bg_fl"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:app="http://schemas.android.com/apk/res-auto">
<data>
<variable
name="viewModel"
type="com.mints.street.adapter.GridMapAdapter" />
</data>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/bg"
android:layout_width="150dp"
android:layout_height="150dp"
android:background="@drawable/shape_gold_card_20"
>
<ImageView
android:id="@+id/image"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
android:layout_width="match_parent"
android:layout_height="90dp"/>
<TextView
android:padding="10dp"
android:id="@+id/tv_name"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="测试"
android:textColor="@color/black"
android:textSize="12sp"
/>
<LinearLayout
app:layout_constraintTop_toBottomOf="@id/tv_name"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
android:layout_width="0dp"
android:layout_height="wrap_content"
>
<ImageView
android:padding="5dp"
android:layout_width="20dp"
android:layout_height="20dp"
android:src="@mipmap/star_icon"
/><ImageView
android:padding="5dp"
android:layout_width="20dp"
android:layout_height="20dp"
android:src="@mipmap/star_icon"
/><ImageView
android:padding="5dp"
android:layout_width="20dp"
android:layout_height="20dp"
android:src="@mipmap/star_icon"
/><ImageView
android:padding="5dp"
android:layout_width="20dp"
android:layout_height="20dp"
android:src="@mipmap/star_icon"
/>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<layout 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.home.HomeButtonItemVM" />
</data>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="120dp"
android:background="@mipmap/abc_popup_background_mtrl_mult"
android:padding="15dp"
>
<TextView
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="sdfasd"
android:textSize="16sp"
android:singleLine="true"
android:textStyle="bold"
android:textColor="@color/color_2B3238"
/>
<ImageView
android:id="@+id/image1"
android:layout_width="0dp"
android:layout_height="65dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toStartOf="@id/image2"
tools:src="@mipmap/bg_fl"
/>
<ImageView
android:layout_marginStart="10dp"
android:id="@+id/image2"
android:layout_width="0dp"
android:layout_height="65dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/image1"
app:layout_constraintEnd_toStartOf="@id/image3"
tools:src="@mipmap/bg_fl"
/>
<ImageView
android:layout_marginStart="10dp"
android:id="@+id/image3"
android:layout_width="0dp"
android:layout_height="65dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/image2"
app:layout_constraintEnd_toEndOf="parent"
tools:src="@mipmap/bg_fl"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>
<?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="match_parent"
android:background="#553b3a3a">
<LinearLayout
android:id="@+id/content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:background="@android:color/white"
android:orientation="vertical">
<TextView
android:id="@+id/open_from_camera"
android:layout_width="match_parent"
android:layout_height="40dp"
android:gravity="center"
android:padding="8dp"
android:text="相机"
android:textColor="#333"
android:textSize="15sp" />
<TextView
android:id="@+id/open_album"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_marginTop="1dp"
android:gravity="center"
android:padding="8dp"
android:text="打开图库"
android:textColor="#333"
android:textSize="15sp" />
<TextView
android:id="@+id/cancel"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_marginTop="1dp"
android:gravity="center"
android:padding="8dp"
android:text="取消"
android:textColor="#333"
android:textSize="15sp" />
</LinearLayout>
</RelativeLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<resources>
<declare-styleable name="CircleImageView">
<attr name="border_width" format="dimension" />
<attr name="border_color" format="color" />
</declare-styleable>
</resources>
\ No newline at end of file
...@@ -139,7 +139,12 @@ ...@@ -139,7 +139,12 @@
<item name="android:layout_height">1px</item> <item name="android:layout_height">1px</item>
<item name="android:background">#d3d3d3</item> <item name="android:background">#d3d3d3</item>
</style> </style>
<style name="ipopwindow_anim_style">
<item name="android:windowEnterAnimation">@anim/popshow_anim</item>
<!-- 指定显示的动画xml -->
<item name="android:windowExitAnimation">@anim/pophidden</item>
<!-- 指定消失的动画xml -->
</style>
</resources> </resources>
\ No newline at end of file
...@@ -68,4 +68,7 @@ dependencies { ...@@ -68,4 +68,7 @@ dependencies {
//底部bottomBar //底部bottomBar
api 'com.github.ittianyu:BottomNavigationViewEx:2.0.4' api 'com.github.ittianyu:BottomNavigationViewEx:2.0.4'
//万能布局管理器VirtualLayout
api 'com.alibaba.android:vlayout:1.0.9'
} }
package com.fry.base.adapter;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.ViewGroup;
import com.alibaba.android.vlayout.DelegateAdapter;
import androidx.annotation.NonNull;
import androidx.databinding.ViewDataBinding;
/**
* @author jeme
* @date 2019/9/21
*/
public abstract class AbstractVLayoutBaseAdapter<T extends ViewDataBinding,D> extends DelegateAdapter.Adapter<BindingViewHolder<T>> {
protected Context mContext;
protected D mData;
protected int mViewType;
public AbstractVLayoutBaseAdapter(Context context, D datas, int viewType){
this.mContext = context;
this.mData = datas;
this.mViewType = viewType;
}
protected abstract int getLayoutId(int viewType);
public D getData(){
return mData;
}
@Override
public int getItemViewType(int position) {
return mViewType;
}
@Override
public long getItemId(int position) {
return position;
}
@NonNull
@Override
public BindingViewHolder<T> onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
return new BindingViewHolder<>(LayoutInflater.from(mContext).inflate(getLayoutId(viewType), parent, false));
}
}
#Fri Jul 09 16:57:51 CST 2021 #Fri Jul 09 19:56:02 CST 2021
VERSION_BUILD=2659 VERSION_BUILD=2724
#Fri Jul 09 15:21:04 CST 2021 #Fri Jul 09 19:56:04 CST 2021
D\:\\android_space\\MyStreet\\shareSdkLib\\src\\main\\res\\drawable-xhdpi\\ssdk_auth_title_back.png=D\:\\android_space\\MyStreet\\shareSdkLib\\build\\intermediates\\packaged_res\\debug\\drawable-xhdpi-v4\\ssdk_auth_title_back.png D\:\\android_space\\MyStreet\\shareSdkLib\\src\\main\\res\\drawable-xhdpi\\ssdk_auth_title_back.png=D\:\\android_space\\MyStreet\\shareSdkLib\\build\\intermediates\\packaged_res\\debug\\drawable-xhdpi-v4\\ssdk_auth_title_back.png
D\:\\android_space\\MyStreet\\shareSdkLib\\src\\main\\res\\drawable-xhdpi\\ssdk_oks_classic_yixin.png=D\:\\android_space\\MyStreet\\shareSdkLib\\build\\intermediates\\packaged_res\\debug\\drawable-xhdpi-v4\\ssdk_oks_classic_yixin.png D\:\\android_space\\MyStreet\\shareSdkLib\\src\\main\\res\\drawable-xhdpi\\ssdk_oks_classic_yixin.png=D\:\\android_space\\MyStreet\\shareSdkLib\\build\\intermediates\\packaged_res\\debug\\drawable-xhdpi-v4\\ssdk_oks_classic_yixin.png
D\:\\android_space\\MyStreet\\shareSdkLib\\src\\main\\res\\drawable-xhdpi\\ssdk_oks_classic_wechatfavorite.png=D\:\\android_space\\MyStreet\\shareSdkLib\\build\\intermediates\\packaged_res\\debug\\drawable-xhdpi-v4\\ssdk_oks_classic_wechatfavorite.png D\:\\android_space\\MyStreet\\shareSdkLib\\src\\main\\res\\drawable-xhdpi\\ssdk_oks_classic_wechatfavorite.png=D\:\\android_space\\MyStreet\\shareSdkLib\\build\\intermediates\\packaged_res\\debug\\drawable-xhdpi-v4\\ssdk_oks_classic_wechatfavorite.png
......
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