Commit 2207581e authored by 张释方's avatar 张释方

提交会员界面

parent 47bb2b23
......@@ -87,7 +87,7 @@
<activity android:name=".main.my.MoresettingsActivity"/>
<activity android:name=".main.my.AboutusActivity"/>
<activity android:name=".main.my.PermissionsActivity"/>
<activity android:name=".main.my.OpenvipActivity"/>
<!-- ShareSDK start -->
<activity
android:name="com.mob.tools.MobUIShell"
......
package com.mints.street.adapter;
import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import androidx.viewpager.widget.PagerAdapter;
import androidx.viewpager.widget.ViewPager;
import com.fry.base.utils.DensityUtils;
import com.mints.street.adapter.listener.OnPageSelectListener;
import com.mints.street.widget.CoverFlowViewPager;
import java.util.List;
public class CoverFlowAdapter extends PagerAdapter implements ViewPager.OnPageChangeListener {
/**
* 默认缩小的padding值
*/
public static int sWidthPadding;
public static int sHeightPadding;
/**
* 子元素的集合
*/
private List<View> mViewList;
/**
* 滑动监听的回调接口
*/
private OnPageSelectListener listener;
/**
* 上下文对象
*/
private Context mContext;
public CoverFlowAdapter(List<View> mImageViewList, Context context) {
this.mViewList = mImageViewList;
mContext = context;
// 设置padding值
sWidthPadding = DensityUtils.dip2px(16);
sHeightPadding = DensityUtils.dip2px(28);
}
@Override
public void destroyItem(ViewGroup container, int position, Object object) {
container.removeView(mViewList.get(position));
}
@Override
public Object instantiateItem(ViewGroup container, int position) {
View view = mViewList.get(position);
container.addView(view);
return view;
}
@Override
public int getCount() {
return mViewList == null ? 0 : mViewList.size();
}
@Override
public boolean isViewFromObject(View view, Object object) {
return view == object;
}
@Override
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
// 该方法回调ViewPager 的滑动偏移量
if (mViewList.size() > 0 && position < mViewList.size()) {
//当前手指触摸滑动的页面,从0页滑动到1页 offset越来越大,padding越来越大
int outHeightPadding = (int) (positionOffset * sHeightPadding);
int outWidthPadding = (int) (positionOffset * sWidthPadding);
// 从0滑动到一时,此时position = 0,其应该是缩小的,符合
mViewList.get(position).setPadding(outWidthPadding, outHeightPadding, outWidthPadding, outHeightPadding);
// position+1 为即将显示的页面,越来越大
if (position < mViewList.size() - 1) {
int inWidthPadding = (int) ((1 - positionOffset) * sWidthPadding);
int inHeightPadding = (int) ((1 - positionOffset) * sHeightPadding);
mViewList.get(position + 1).setPadding(inWidthPadding, inHeightPadding, inWidthPadding, inHeightPadding);
}
}
}
@Override
public void onPageSelected(int position) {
// 回调选择的接口
if (listener != null) {
listener.select(position);
}
}
@Override
public void onPageScrollStateChanged(int state) {
}
/**
* 当将某一个作为最中央时的回调
*
* @param listener
*/
public void setOnPageSelectListener(CoverFlowViewPager listener) {
this.listener = listener;
}
}
package com.mints.street.adapter.listener;
public interface OnPageSelectListener {
void select(int position);
}
......@@ -62,7 +62,8 @@ class MyFragment : BaseFragment<FragmentMyBinding, MyViewModel>(), View.OnClickL
//设置立即领取点击事件
binding.btTry.setOnClickListener {
startActivity(PermissionsActivity::class.java)
// startActivity(PermissionsActivity::class.java)
startActivity(OpenvipActivity::class.java)
}
ly_aboutus.setOnClickListener(this)
......
package com.mints.street.main.my
import android.graphics.Color
import android.os.Bundle
import android.view.View
import com.fry.base.base.BaseActivity
import com.mints.street.BR
import com.mints.street.R
import com.mints.street.databinding.ActivityOpenvipBinding
import kotlinx.android.synthetic.main.activity_openvip.*
import kotlinx.android.synthetic.main.include_header.*
class OpenvipActivity: BaseActivity<ActivityOpenvipBinding, OpenvipViewModel>() {
override fun initVariableId() = BR.viewModel
override fun initContentView(savedInstanceState: Bundle?)= R.layout.activity_openvip
override fun initData() {
super.initData()
initView()
}
private fun initView() {
val layoutInflater = layoutInflater
// 初始化数据
// 初始化数据
val list: MutableList<View> = ArrayList()
val page1 = layoutInflater.inflate(R.layout.view_data_page1, null)
val page2 = layoutInflater.inflate(R.layout.view_data_page2, null)
val page3 = layoutInflater.inflate(R.layout.view_data_page3, null)
list.add(page1)
list.add(page2)
list.add(page3)
//设置显示的数据
cfp_data_viewpager.setViewList(list)
tv_title.text="成为会员"
tv_title.setTextColor(Color.WHITE)
iv_left_icon.setImageResource(R.mipmap.iv_return_white)
iv_left_icon.visibility= View.VISIBLE
}
}
package com.mints.street.main.my
import android.app.Application
import me.goldze.mvvmhabit.base.BaseViewModel
class OpenvipViewModel (application: Application): BaseViewModel(application) {
}
......@@ -45,6 +45,7 @@ class SplashActivity:BaseActivity<ActivitySplashBinding,SplashViewModel>() {
}
//校验App签名
checkAppSign()
}
......@@ -53,7 +54,7 @@ class SplashActivity:BaseActivity<ActivitySplashBinding,SplashViewModel>() {
if (mForceGoMain) {
goToMainActivity()
}
if (onPaused ) {
if (onPaused) {
// 这种情况下,百度开屏广告不能在onAdDismiss中跳转,需要自己在onResume中跳转主页。
goToMainActivity()
}
......@@ -68,7 +69,6 @@ class SplashActivity:BaseActivity<ActivitySplashBinding,SplashViewModel>() {
override fun onStop() {
super.onStop()
mForceGoMain = true
}
......
package com.mints.street.widget;
import android.content.Context;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.RelativeLayout;
import androidx.viewpager.widget.ViewPager;
import com.fry.base.utils.DensityUtils;
import com.mints.street.R;
import com.mints.street.adapter.CoverFlowAdapter;
import com.mints.street.adapter.listener.OnPageSelectListener;
import java.util.ArrayList;
import java.util.List;
public class CoverFlowViewPager extends RelativeLayout implements OnPageSelectListener {
/**
* 适配器
*/
private CoverFlowAdapter mAdapter;
/**
* 用于左右滚动
*/
private ViewPager mViewPager;
/**
* 需要显示的视图集合
*/
private List<View> mViewList = new ArrayList<>();
private OnPageSelectListener listener;
public CoverFlowViewPager(Context context, AttributeSet attrs) {
super(context, attrs);
inflate(context, R.layout.widget_cover_flow, this);
mViewPager = findViewById(R.id.vp_conver_flow);
// 365dp 380
int marginWidth = DensityUtils.dip2px(50);
int displayWidth = DensityUtils.getDisplayWidth(getContext());
int height = DensityUtils.dip2px( 150);
LayoutParams layoutParams = new LayoutParams(displayWidth - marginWidth, height);
layoutParams.addRule(RelativeLayout.CENTER_HORIZONTAL);
mViewPager.setLayoutParams(layoutParams);
init();
}
/**
* 初始化方法
*/
private void init() {
// 构造适配器,传入数据源
mAdapter = new CoverFlowAdapter(mViewList, getContext());
// 设置选中的回调
mAdapter.setOnPageSelectListener(this);
// 设置适配器
mViewPager.setAdapter(mAdapter);
// 设置滑动的监听,因为adpter实现了滑动回调的接口,所以这里直接设置adpter
mViewPager.addOnPageChangeListener(mAdapter);
// 预加载个数
mViewPager.setOffscreenPageLimit(5);
// 设置触摸事件的分发
setOnTouchListener(new OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
// 传递给ViewPager 进行滑动处理
return mViewPager.dispatchTouchEvent(event);
}
});
}
/**
* 设置显示的数据,进行一层封装
*
* @param lists
*/
public void setViewList(List<View> lists) {
if (lists == null) {
return;
}
mViewList.clear();
for (View view : lists) {
FrameLayout layout = new FrameLayout(getContext());
// 设置padding 值,默认缩小
layout.setPadding(CoverFlowAdapter.sWidthPadding, CoverFlowAdapter.sHeightPadding, CoverFlowAdapter.sWidthPadding, CoverFlowAdapter.sHeightPadding);
layout.addView(view);
mViewList.add(layout);
}
// 刷新数据
mAdapter.notifyDataSetChanged();
}
/**
* 当将某一个作为最中央时的回调
*
* @param listener
*/
public void setOnPageSelectListener(OnPageSelectListener listener) {
this.listener = listener;
}
// 显示的回调
@Override
public void select(int position) {
if (listener != null) {
listener.select(position);
}
}
}
......@@ -2,7 +2,6 @@
<layout xmlns:android="http://schemas.android.com/apk/res/android">
<data>
<variable
name="ViewModel"
type="com.mints.street.main.my.MoresettingsViewModel" />
......
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
<data>
<variable
name="ViewModel"
type="com.mints.street.main.my.OpenvipViewModel" />
</data>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<View
android:layout_width="match_parent"
android:layout_height="200dp"
android:background="@color/black" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<include layout="@layout/include_header" />
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:focusable="true"
android:focusableInTouchMode="true"
android:overScrollMode="never">
<LinearLayout
android:layout_marginBottom="80dp"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<com.mints.street.widget.CoverFlowViewPager
android:id="@+id/cfp_data_viewpager"
android:layout_width="match_parent"
android:layout_height="148dp"
android:layout_centerHorizontal="true"
android:layout_marginTop="20dp" >
<Space
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</com.mints.street.widget.CoverFlowViewPager>
<androidx.constraintlayout.widget.Guideline
android:id="@+id/guideline3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" />
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal">
<TextView
android:id="@+id/textView5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="享受8大特权"
android:textColor="@color/black"
android:textSize="20sp"
app:layout_constraintBottom_toTopOf="@+id/guideline7"
app:layout_constraintEnd_toStartOf="@+id/guideline6"
app:layout_constraintStart_toStartOf="@+id/guideline5"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/imageView5"
android:layout_width="50dp"
android:layout_height="50dp"
android:src="@mipmap/ic_avatar_ph"
app:layout_constraintEnd_toStartOf="@+id/guideline5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@+id/guideline7"
tools:srcCompat="@tools:sample/avatars" />
<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="无线缩放"
android:textColor="@color/black"
android:textSize="10sp"
app:layout_constraintEnd_toEndOf="@+id/imageView5"
app:layout_constraintStart_toStartOf="@+id/imageView5"
app:layout_constraintTop_toBottomOf="@+id/imageView5" />
<ImageView
android:id="@+id/imageView4"
android:layout_width="50dp"
android:layout_height="50dp"
android:src="@mipmap/ic_avatar_ph"
app:layout_constraintEnd_toStartOf="@+id/guideline4"
app:layout_constraintStart_toStartOf="@+id/guideline5"
app:layout_constraintTop_toTopOf="@+id/guideline7"
tools:ignore="MissingConstraints"
tools:srcCompat="@tools:sample/avatars" />
<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="国内外街景"
android:textColor="@color/black"
android:textSize="10sp"
app:layout_constraintBottom_toTopOf="@+id/guideline8"
app:layout_constraintEnd_toEndOf="@+id/imageView4"
app:layout_constraintStart_toStartOf="@+id/imageView4"
app:layout_constraintTop_toBottomOf="@+id/imageView4" />
<ImageView
android:id="@+id/imageView6"
android:layout_width="50dp"
android:layout_height="50dp"
android:src="@mipmap/ic_avatar_ph"
app:layout_constraintEnd_toStartOf="@+id/guideline6"
app:layout_constraintStart_toStartOf="@+id/guideline4"
app:layout_constraintTop_toTopOf="@+id/guideline7"
tools:ignore="MissingConstraints"
tools:srcCompat="@tools:sample/avatars" />
<TextView
android:id="@+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="VR全景"
android:textColor="@color/black"
android:textSize="10sp"
app:layout_constraintEnd_toEndOf="@+id/imageView6"
app:layout_constraintStart_toStartOf="@+id/imageView6"
app:layout_constraintTop_toBottomOf="@+id/imageView6" />
<ImageView
android:id="@+id/imageView7"
android:layout_width="50dp"
android:layout_height="50dp"
android:src="@mipmap/ic_avatar_ph"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="@+id/guideline6"
app:layout_constraintTop_toTopOf="@+id/guideline7"
tools:srcCompat="@tools:sample/avatars" />
<TextView
android:id="@+id/textView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="3D地图"
android:textColor="@color/black"
android:textSize="10sp"
app:layout_constraintEnd_toEndOf="@+id/imageView7"
app:layout_constraintStart_toStartOf="@+id/imageView7"
app:layout_constraintTop_toBottomOf="@+id/imageView7" />
<ImageView
android:id="@+id/imageView12"
android:layout_width="50dp"
android:layout_height="50dp"
android:src="@mipmap/ic_avatar_ph"
app:layout_constraintEnd_toEndOf="@+id/imageView5"
app:layout_constraintStart_toStartOf="@+id/imageView5"
app:layout_constraintTop_toTopOf="@+id/guideline8"
tools:ignore="MissingConstraints"
tools:srcCompat="@tools:sample/avatars" />
<TextView
android:id="@+id/textView9"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="国外搜索"
android:textColor="@color/black"
android:textSize="10sp"
app:layout_constraintBottom_toTopOf="@+id/guideline9"
app:layout_constraintEnd_toEndOf="@+id/imageView12"
app:layout_constraintStart_toStartOf="@+id/imageView12"
app:layout_constraintTop_toBottomOf="@+id/imageView12" />
<ImageView
android:id="@+id/imageView13"
android:layout_width="50dp"
android:layout_height="50dp"
android:src="@mipmap/ic_avatar_ph"
app:layout_constraintEnd_toEndOf="@+id/imageView4"
app:layout_constraintStart_toStartOf="@+id/imageView4"
app:layout_constraintTop_toTopOf="@+id/guideline8"
tools:ignore="MissingConstraints"
tools:srcCompat="@tools:sample/avatars" />
<ImageView
android:id="@+id/imageView14"
android:layout_width="50dp"
android:layout_height="50dp"
android:src="@mipmap/ic_avatar_ph"
app:layout_constraintEnd_toEndOf="@+id/imageView6"
app:layout_constraintStart_toStartOf="@+id/imageView6"
app:layout_constraintTop_toTopOf="@+id/guideline8"
tools:ignore="MissingConstraints"
tools:srcCompat="@tools:sample/avatars" />
<TextView
android:id="@+id/textView10"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="高清地图"
android:textColor="@color/black"
android:textSize="10sp"
app:layout_constraintBottom_toTopOf="@+id/guideline9"
app:layout_constraintEnd_toEndOf="@+id/imageView13"
app:layout_constraintStart_toStartOf="@+id/imageView13"
app:layout_constraintTop_toBottomOf="@+id/imageView13" />
<TextView
android:id="@+id/textView11"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="历史影像"
android:textColor="@color/black"
android:textSize="10sp"
app:layout_constraintBottom_toTopOf="@+id/guideline9"
app:layout_constraintEnd_toEndOf="@+id/imageView14"
app:layout_constraintStart_toStartOf="@+id/imageView14"
app:layout_constraintTop_toBottomOf="@+id/imageView14" />
<ImageView
android:id="@+id/imageView15"
android:layout_width="50dp"
android:layout_height="50dp"
android:src="@mipmap/ic_avatar_ph"
app:layout_constraintEnd_toEndOf="@+id/imageView7"
app:layout_constraintStart_toStartOf="@+id/imageView7"
app:layout_constraintTop_toTopOf="@+id/guideline8"
tools:ignore="MissingConstraints"
tools:srcCompat="@tools:sample/avatars" />
<TextView
android:id="@+id/textView12"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="景点推荐"
android:textColor="@color/black"
android:textSize="10sp"
app:layout_constraintBottom_toTopOf="@+id/guideline9"
app:layout_constraintEnd_toEndOf="@+id/imageView15"
app:layout_constraintStart_toStartOf="@+id/imageView15"
app:layout_constraintTop_toBottomOf="@+id/imageView15" />
<ImageView
android:id="@+id/imageView16"
android:layout_width="20dp"
android:layout_height="20dp"
android:background="@color/blue"
app:layout_constraintBottom_toTopOf="@+id/guideline7"
app:layout_constraintEnd_toStartOf="@+id/textView5"
app:layout_constraintStart_toStartOf="@+id/guideline5"
app:layout_constraintTop_toTopOf="parent"
tools:srcCompat="@tools:sample/avatars" />
<ImageView
android:id="@+id/imageView18"
android:layout_width="20dp"
android:layout_height="20dp"
android:background="@color/blue"
app:layout_constraintBottom_toTopOf="@+id/guideline7"
app:layout_constraintEnd_toStartOf="@+id/guideline6"
app:layout_constraintHorizontal_bias="0.481"
app:layout_constraintStart_toEndOf="@+id/textView5"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.512"
tools:srcCompat="@tools:sample/avatars" />
<ImageView
android:id="@+id/imageView"
android:layout_width="20dp"
android:layout_height="20dp"
android:background="@drawable/shape_btn_friends_unenabled"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/textView7"
app:layout_constraintStart_toStartOf="@+id/guideline5"
app:layout_constraintTop_toTopOf="@+id/guideline9"
tools:ignore="MissingConstraints"
tools:srcCompat="@tools:sample/avatars" />
<TextView
android:id="@+id/textView7"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="套餐推荐"
android:textColor="@color/black"
android:textSize="20sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/guideline6"
app:layout_constraintStart_toStartOf="@+id/guideline5"
app:layout_constraintTop_toTopOf="@+id/guideline9" />
<ImageView
android:id="@+id/imageView2"
android:layout_width="20dp"
android:layout_height="20dp"
android:background="@drawable/shape_btn_friends_unenabled"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/guideline6"
app:layout_constraintStart_toEndOf="@+id/textView7"
app:layout_constraintTop_toTopOf="@+id/guideline9"
tools:srcCompat="@tools:sample/avatars" />
<androidx.constraintlayout.widget.Guideline
android:id="@+id/guideline9"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
app:layout_constraintGuide_percent=".75" />
<androidx.constraintlayout.widget.Guideline
android:id="@+id/guideline8"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
app:layout_constraintGuide_percent="0.5" />
<androidx.constraintlayout.widget.Guideline
android:id="@+id/guideline7"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
app:layout_constraintGuide_percent="0.25" />
<androidx.constraintlayout.widget.Guideline
android:id="@+id/guideline4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.50121653" />
<androidx.constraintlayout.widget.Guideline
android:id="@+id/guideline5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.25" />
<androidx.constraintlayout.widget.Guideline
android:id="@+id/guideline6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.75" />
</androidx.constraintlayout.widget.ConstraintLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_margin="10dp"
android:orientation="horizontal">
<View
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_marginRight="10dp"
android:background="@drawable/shape_bt_disagree"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/imageView" />
<View
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_marginRight="10dp"
android:background="@drawable/shape_bt_disagree"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/imageView" />
<View
android:layout_width="100dp"
android:layout_height="100dp"
android:background="@drawable/shape_bt_disagree"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/imageView" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:orientation="horizontal"
android:padding="10dp">
<ImageView
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_alignParentLeft="true"
android:layout_marginStart="15dp"
android:src="@mipmap/iv_about_us" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_weight="1"
android:text="微信支付"
android:textColor="@color/black"
android:textSize="18sp" />
<CheckBox
style="@style/MyCheckBox"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:background="#979797" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:orientation="horizontal"
android:padding="10dp">
<ImageView
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_alignParentLeft="true"
android:layout_marginStart="15dp"
android:src="@mipmap/iv_about_us" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_weight="1"
android:text="支付宝支付"
android:textColor="@color/black"
android:textSize="18sp" />
<CheckBox
style="@style/MyCheckBox"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
</LinearLayout>
</androidx.core.widget.NestedScrollView>
</LinearLayout>
<Button
android:id="@+id/bt_try"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_margin="10dp"
android:background="@drawable/shape_btn_friends_unenabled"
android:text="开通全球会员"
android:layout_gravity="bottom"
android:textColor="@color/white"
android:textSize="10sp" />
</FrameLayout>
</layout>
\ No newline at end of file
......@@ -94,17 +94,30 @@
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="wrap_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal">
<TextView
android:id="@+id/textView5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="享受8大特权"
android:textColor="@color/black"
android:textSize="20sp"
app:layout_constraintBottom_toTopOf="@+id/guideline7"
app:layout_constraintEnd_toStartOf="@+id/guideline6"
app:layout_constraintStart_toStartOf="@+id/guideline5"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/imageView5"
android:layout_width="50dp"
android:layout_height="50dp"
android:src="@mipmap/ic_avatar_ph"
app:layout_constraintEnd_toStartOf="@+id/guideline5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@+id/imageView4"
app:layout_constraintTop_toTopOf="@+id/guideline7"
tools:srcCompat="@tools:sample/avatars" />
<TextView
......@@ -112,6 +125,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="无线缩放"
android:textColor="@color/black"
android:textSize="10sp"
app:layout_constraintEnd_toEndOf="@+id/imageView5"
app:layout_constraintStart_toStartOf="@+id/imageView5"
......@@ -121,11 +135,11 @@
android:id="@+id/imageView4"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_marginStart="40dp"
android:layout_marginTop="20dp"
android:src="@mipmap/ic_avatar_ph"
app:layout_constraintStart_toEndOf="@+id/imageView5"
app:layout_constraintTop_toBottomOf="@+id/imageView16"
app:layout_constraintEnd_toStartOf="@+id/guideline4"
app:layout_constraintStart_toStartOf="@+id/guideline5"
app:layout_constraintTop_toTopOf="@+id/guideline7"
tools:ignore="MissingConstraints"
tools:srcCompat="@tools:sample/avatars" />
<TextView
......@@ -133,7 +147,9 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="国内外街景"
android:textColor="@color/black"
android:textSize="10sp"
app:layout_constraintBottom_toTopOf="@+id/guideline8"
app:layout_constraintEnd_toEndOf="@+id/imageView4"
app:layout_constraintStart_toStartOf="@+id/imageView4"
app:layout_constraintTop_toBottomOf="@+id/imageView4" />
......@@ -142,10 +158,11 @@
android:id="@+id/imageView6"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_marginStart="40dp"
android:src="@mipmap/ic_avatar_ph"
app:layout_constraintStart_toEndOf="@+id/imageView4"
app:layout_constraintTop_toTopOf="@+id/imageView4"
app:layout_constraintEnd_toStartOf="@+id/guideline6"
app:layout_constraintStart_toStartOf="@+id/guideline4"
app:layout_constraintTop_toTopOf="@+id/guideline7"
tools:ignore="MissingConstraints"
tools:srcCompat="@tools:sample/avatars" />
<TextView
......@@ -153,6 +170,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="VR全景"
android:textColor="@color/black"
android:textSize="10sp"
app:layout_constraintEnd_toEndOf="@+id/imageView6"
app:layout_constraintStart_toStartOf="@+id/imageView6"
......@@ -162,10 +180,10 @@
android:id="@+id/imageView7"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_marginStart="40dp"
android:src="@mipmap/ic_avatar_ph"
app:layout_constraintStart_toEndOf="@+id/imageView6"
app:layout_constraintTop_toTopOf="@+id/imageView6"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="@+id/guideline6"
app:layout_constraintTop_toTopOf="@+id/guideline7"
tools:srcCompat="@tools:sample/avatars" />
<TextView
......@@ -173,6 +191,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="3D地图"
android:textColor="@color/black"
android:textSize="10sp"
app:layout_constraintEnd_toEndOf="@+id/imageView7"
app:layout_constraintStart_toStartOf="@+id/imageView7"
......@@ -182,20 +201,19 @@
android:id="@+id/imageView12"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_marginTop="20dp"
android:src="@mipmap/ic_avatar_ph"
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:ignore="MissingConstraints"
tools:srcCompat="@tools:sample/avatars" />
<TextView
android:id="@+id/textView9"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="国外搜索"
android:textColor="@color/black"
android:textSize="10sp"
app:layout_constraintEnd_toEndOf="@+id/imageView12"
app:layout_constraintStart_toStartOf="@+id/imageView12"
......@@ -203,36 +221,33 @@
<ImageView
android:id="@+id/imageView13"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_marginTop="20dp"
android:src="@mipmap/ic_avatar_ph"
app:layout_constraintEnd_toEndOf="@+id/imageView4"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="@+id/imageView4"
app:layout_constraintTop_toBottomOf="@+id/textView"
app:layout_constraintTop_toTopOf="@+id/guideline8"
tools:ignore="MissingConstraints"
tools:srcCompat="@tools:sample/avatars" />
<ImageView
android:id="@+id/imageView14"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_marginTop="20dp"
android:src="@mipmap/ic_avatar_ph"
app:layout_constraintEnd_toEndOf="@+id/imageView6"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="@+id/imageView6"
app:layout_constraintTop_toBottomOf="@+id/textView3"
app:layout_constraintTop_toTopOf="@+id/guideline8"
tools:ignore="MissingConstraints"
tools:srcCompat="@tools:sample/avatars" />
<TextView
android:id="@+id/textView10"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="高清地图"
android:textColor="@color/black"
android:textSize="10sp"
app:layout_constraintEnd_toEndOf="@+id/imageView13"
app:layout_constraintStart_toStartOf="@+id/imageView13"
......@@ -240,10 +255,10 @@
<TextView
android:id="@+id/textView11"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="历史影像"
android:textColor="@color/black"
android:textSize="10sp"
app:layout_constraintEnd_toEndOf="@+id/imageView14"
app:layout_constraintStart_toStartOf="@+id/imageView14"
......@@ -253,20 +268,19 @@
android:id="@+id/imageView15"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_marginTop="20dp"
android:src="@mipmap/ic_avatar_ph"
app:layout_constraintEnd_toEndOf="@+id/imageView7"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="@+id/imageView7"
app:layout_constraintTop_toBottomOf="@+id/textView4"
app:layout_constraintTop_toTopOf="@+id/guideline8"
tools:ignore="MissingConstraints"
tools:srcCompat="@tools:sample/avatars" />
<TextView
android:id="@+id/textView12"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="景点推荐"
android:textColor="@color/black"
android:textSize="10sp"
app:layout_constraintEnd_toEndOf="@+id/imageView15"
app:layout_constraintStart_toStartOf="@+id/imageView15"
......@@ -274,38 +288,63 @@
<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"
android:background="@drawable/shape_btn_friends_unenabled"
app:layout_constraintBottom_toTopOf="@+id/guideline7"
app:layout_constraintEnd_toStartOf="@+id/textView5"
app:layout_constraintStart_toStartOf="@+id/guideline5"
app:layout_constraintTop_toTopOf="parent"
tools:srcCompat="@tools:sample/avatars" />
<ImageView
android:id="@+id/imageView18"
android:layout_width="20dp"
android:layout_height="20dp"
android:background="@color/blue"
app:layout_constraintEnd_toStartOf="@+id/imageView7"
app:layout_constraintTop_toTopOf="@+id/imageView16"
android:background="@drawable/shape_btn_friends_unenabled"
app:layout_constraintBottom_toTopOf="@+id/guideline7"
app:layout_constraintEnd_toStartOf="@+id/guideline6"
app:layout_constraintHorizontal_bias="0.481"
app:layout_constraintStart_toEndOf="@+id/textView5"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.512"
tools:srcCompat="@tools:sample/avatars" />
<TextView
android:id="@+id/textView13"
<androidx.constraintlayout.widget.Guideline
android:id="@+id/guideline8"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginEnd="10dp"
android:text="享受8大特权"
android:textSize="20sp"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="@+id/imageView18"
app:layout_constraintEnd_toStartOf="@+id/imageView18"
app:layout_constraintStart_toEndOf="@+id/imageView16"
app:layout_constraintTop_toTopOf="@+id/imageView18" />
android:orientation="horizontal"
app:layout_constraintGuide_percent="0.59" />
<androidx.constraintlayout.widget.Guideline
android:id="@+id/guideline7"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
app:layout_constraintGuide_percent="0.25" />
<androidx.constraintlayout.widget.Guideline
android:id="@+id/guideline4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.50121653" />
<androidx.constraintlayout.widget.Guideline
android:id="@+id/guideline5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.25" />
<androidx.constraintlayout.widget.Guideline
android:id="@+id/guideline6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.75" />
</androidx.constraintlayout.widget.ConstraintLayout>
......
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_horizontal"
android:background="@drawable/shape_bt_disagree"
android:orientation="vertical">
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/shape_bt_disagree"
android:gravity="center_horizontal"
android:orientation="vertical">
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/shape_bt_disagree"
android:gravity="center_horizontal"
android:orientation="vertical">
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clipChildren="false">
<androidx.viewpager.widget.ViewPager
android:id="@+id/vp_conver_flow"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clipChildren="false"
android:overScrollMode="never" />
</RelativeLayout>
\ No newline at end of file
......@@ -2,6 +2,7 @@ package com.fry.base.utils;
import android.content.Context;
import android.graphics.Point;
import android.util.DisplayMetrics;
import android.view.Display;
import android.view.WindowManager;
......@@ -10,6 +11,7 @@ import me.goldze.mvvmhabit.utils.Utils;
/**
* 2019-09-29 created
* dip、px转化.
*
* @author KOM
*/
public class DensityUtils {
......@@ -17,7 +19,7 @@ public class DensityUtils {
private static Point screenPoint;
public static Point getWindowWidthHeight() {
if(screenPoint == null){
if (screenPoint == null) {
screenPoint = new Point();
WindowManager wm = (WindowManager) Utils.getContext()
.getSystemService(Context.WINDOW_SERVICE);
......@@ -41,6 +43,22 @@ public class DensityUtils {
return new int[]{point.x, point.y};
}
private static DisplayMetrics sDisplayMetrics;
public static int getDisplayWidth(Context context) {
initDisplayMetrics(context);
return sDisplayMetrics.widthPixels;
}
public static int getDisplayHeight(Context context) {
initDisplayMetrics(context);
return sDisplayMetrics.heightPixels;
}
private static synchronized void initDisplayMetrics(Context context) {
sDisplayMetrics = context.getResources().getDisplayMetrics();
}
public static int dip2px(float dpValue) {
final float scale = Utils.getContext().getResources().getDisplayMetrics().density;
return (int) (dpValue * scale + 0.5f);
......
#Sat Jul 10 16:33:56 CST 2021
VERSION_BUILD=2754
#Mon Jul 12 16:02:26 CST 2021
VERSION_BUILD=2813
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