Commit 3cb0a246 authored by mengcuiguang2's avatar mengcuiguang2

代码合并,解决冲突

parents 196713fe c4cf9d81
......@@ -84,6 +84,9 @@
android:theme="@style/AppTheme.NoneTranslucent">
</activity>
<activity android:name=".main.my.MoresettingsActivity"/>
<activity android:name=".main.my.AboutusActivity"/>
<activity android:name=".main.my.PermissionsActivity"/>
<!-- ShareSDK start -->
<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>() {
savedInstanceState: Bundle?)= R.layout.fragment_home
override fun initVariableId()=BR.viewModel
override fun initData() {
super.initData()
viewModel.add()
}
}
\ No newline at end of file
package com.mints.street.main.home
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.tatarka.bindingcollectionadapter2.ItemBinding
/**
* Created by 冯瑞雨 on 2021/7/2.
*/
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
import android.graphics.Color
import android.graphics.drawable.BitmapDrawable
import android.os.Bundle
import android.util.Log
import android.view.Gravity
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.PopupWindow
import android.widget.Toast
import androidx.activity.OnBackPressedCallback
import com.fry.base.base.BaseFragment
import com.mints.street.BR
import com.mints.street.R
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.
* 个人中心页面
*/
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?,
container: ViewGroup?,
savedInstanceState: Bundle?) = R.layout.fragment_my
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>() {
private fun initTabFragment() {
val tabNames = mutableListOf<String>()
tabNames.add("热门")
tabNames.add("变老特效")
tabNames.add("免费专区")
tabNames.add("精选体验")
val fragments = mutableListOf<Fragment>()
fragments.add(MyFragment())
fragments.add(MyFragment())
fragments.add(FreeZoneFragment())
fragments.add(FeaturedExperienceFragment())
//初始化viewpager2
......
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
This diff is collapsed.
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 @@
android:shape="rectangle">
<solid android:color="#ffffffff" />
<corners android:radius="10dp" />
<corners android:radius="4dp" />
</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 @@
<layout xmlns:android="http://schemas.android.com/apk/res/android">
<data>
<variable
name="ViewModel"
name="viewModel"
type="com.mints.street.login.LoginViewModel" />
</data>
<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"?>
<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">
<!--这里模拟一张oneshot单的焦点图展示-->
<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_height="match_parent"
android:background="@android:color/white">
<!-- 广点通开屏广告支持“半屏/全屏”展示,开发者可以把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:background="@color/white"
android:src="@drawable/bg_splash"
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>
<variable
......
<?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"?>
<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>
<variable
name="ViewModel"
name="viewModel"
type="com.mints.street.main.home.HomeViewModel" />
</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_height="match_parent">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_height="match_parent"
>
<ImageView
android:layout_marginTop="15dp"
android:id="@+id/image_map_change"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
android:text="广场"
android:textColor="@color/black"
android:textSize="39dp"
android:layout_width="35dp"
android:layout_height="35dp"
android:src="@mipmap/map_change_icon"
/>
<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>
</layout>
\ No newline at end of file
This diff is collapsed.
......@@ -2,7 +2,7 @@
<layout xmlns:app="http://schemas.android.com/apk/res-auto">
<data>
<variable
name="ViewModel"
name="viewModel"
type="com.mints.street.main.vr.VRViewModel" />
</data>
<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 @@
<item name="android:layout_height">1px</item>
<item name="android:background">#d3d3d3</item>
</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>
\ No newline at end of file
......@@ -68,4 +68,7 @@ dependencies {
//底部bottomBar
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
VERSION_BUILD=2659
#Fri Jul 09 19:56:02 CST 2021
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_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
......
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